Metadata-Version: 2.4
Name: phronesis
Version: 0.16.0
Summary: A chest of skills: list them, install them into an agent harness (vibe, ...)
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml>=6.0
Requires-Dist: argcomplete>=3.3
Dynamic: license-file

# phronesis

A chest of skills: a repository of `SKILL.md` instruction packages and
a CLI that lists them and installs them into an agent harness such as
[Vibe](https://mistral.ai).

The name is [phronesis](https://en.wikipedia.org/wiki/Phronesis) —
Aristotle's word for *practical wisdom*: the knowledge a skilled
practitioner has, as opposed to abstract theory (`episteme`).

## Install

```bash
pipx install phronesis       # or: pip install phronesis
phronesis                    # list every bundled skill
```

## Command line

The grammar follows winget/apt: a verb, then its arguments. The catalog
tables show an `id` and a `source` column; bundled skills have the id
`builtin.<name>` and the source `builtin`.

```text
phronesis                     usage block, apt style (version and the verbs)
phronesis catalog             list every bundled (builtin) skill
phronesis search <regex>      case-insensitive regex over name, id, description, category
phronesis show <skill>        one skill card plus an install hint
phronesis install <skill>     install globally (~/.vibe/skills; --project for .vibe/skills);
                              the word is a name or an id (builtin.memory), --source picks
                              the origin source (builtin only, for now)
phronesis uninstall <skill>   remove it again (--project for the project scope)
phronesis update [skill]      update every installed skill, or just one
phronesis list                list every installation, tracked or untracked
phronesis source add <ref>    register a source feed (path, URL, or builtin://)
phronesis source edit         open the sources file in your $VISUAL / $EDITOR
phronesis --init              register tab completion (bash)
```

- `install` and `update` print a colored draft (names green, proposed
  versions yellow, an installed version bright blue), then one
  `proceed? [Y/n]` question (the default is yes); `-f` / `--force`
  skips it. An installed skill shows as `would update <old> -> <new>`,
  or as `already up to date` and is left untouched.
- `phronesis list` shows one row per installation with its `id` and
  `source`: a bundled install has the id `builtin.<name>`; an install
  with no known group (tracked but no longer bundled, or found on
  disk with no state entry) shows the bare name and the source
  `unknown` or `untracked`, and the skill directory path under each
  row.
- Installations are recorded in a per-machine state file
  (`~/.config/phronesis/installed.json`), which powers `update`.
- Every skill arrives through one uniform source-feed pipeline
  (SPEC section 14): the bundle itself is the `builtin` source, a
  packaged feed registered by default, and `source add` / `source
  edit` manage `~/.config/phronesis/sources.json`. A feed is one
  JSON document whose entries carry an `id` (`<group>.<name>`,
  e.g. `acme.parser`), a name, description, category, and an
  install spec: `local` (a directory beside the feed - offline),
  `archive` (https or file URL with a mandatory `sha256`), or
  `git` (a repo dedicated to one skill, pinned to a tag or
  commit). No version lives in feeds: the SKILL.md of the fetched
  skill is read live, so remote entries show `-` in catalog tables
  until installed. Every entry carries a mandatory `files`
  whitelist (glob patterns, SPEC item 14.2.1): only matching
  files materialize into the harness, so a fetched repository's
  whole tree never installs. An element of `files` may instead be
  `{"pattern": <glob>, "protected": true}`: still whitelisted,
  but the installed file is locally maintained - add-only on
  update, a `[s]kip or [o]verwrite` prompt when the incoming copy
  differs and again before any uninstall wipes it (SPEC item
  6.18); `MEMORIES.md` has no hardcoded treatment, sources tag
  their own memory convention.
- Shell completion via argcomplete; `phronesis --init` registers the
  hook in `~/.bashrc` (idempotent; `--bashrc <path>` targets another
  file, `--dry-run` prints the block without writing).

The example table:

```text
Phronesis Version: 0.1.0

skill        id                 version  category     source
-----------  -----------------  -------  -----------  -------
python-tdd   builtin.python-tdd 1.2.0    development  builtin
        Minimalist TDD architect for Python work
```

## Layout

```text
phronesis/
├── src/phronesis/          # the CLI package (cli, registry, harnesses, state, ...)
├── test/                   # pytest suite
├── skill/                  # one directory per skill; ships as package data
│   └── python-tdd/SKILL.md
├── autotest.py             # every repo check, single entry point
├── SPEC.md                 # the full specification (sectionized, citable)
├── README.md, CONTRIBUTING.md, LICENSE
└── pyproject.toml, requirements.txt
```

## Skills

| Skill | Version | Category | Purpose |
| --- | --- | --- | --- |
| [fiona](https://gitea.nolivaldeziii.com/nvaldez/phronesis/src/branch/master/skill/fiona/SKILL.md) | 2.2.0 | productivity | Operate an llm-wiki with the fiona-assistant CLI |
| [memory](https://gitea.nolivaldeziii.com/nvaldez/phronesis/src/branch/master/skill/memory/SKILL.md) | 1.0.1 | productivity | Give a skill its own MEMORIES.md beside its SKILL.md |
| [python-tdd](https://gitea.nolivaldeziii.com/nvaldez/phronesis/src/branch/master/skill/python-tdd/SKILL.md) | 1.2.0 | development | Minimalist TDD architect for Python work |
| [sectionize-markdown](https://gitea.nolivaldeziii.com/nvaldez/phronesis/src/branch/master/skill/sectionize-markdown/SKILL.md) | 1.2.0 | documentation | Number headings and list items so each rule can be cited |
| [specification-writer](https://gitea.nolivaldeziii.com/nvaldez/phronesis/src/branch/master/skill/specification-writer/SKILL.md) | 1.1.0 | documentation | Write structured, maintainable SPEC.md files |

The `linux-server-hardening` skill moved to its own repository and is
served through the [nolivaldez source
feed](https://gitea.nolivaldeziii.com/nvaldez/linux-server-hardening)
since phronesis 0.13.0: register the bare clone URL - phronesis finds
its `phronesis_feed.json` itself - with
`phronesis source add https://gitea.nolivaldeziii.com/nvaldez/linux-server-hardening.git`
and install with `phronesis install nolivaldez.linux-server-hardening`.

## Checks

`autotest.py` verifies every script and markdown file in the repo:

- **sanity** — LF line endings, no committed private keys, file size limit
- **python_syntax** — every `.py` file parses (`ast.parse`)
- **pycodestyle** — PEP 8 style on every `.py` file
- **shellcheck** — every shell script (`.sh`, `.bash`, or shebang)
- **builtin_feed** — `skill/builtin.json` (the packaged `builtin`
  source feed) lists exactly the bundled skills, with matching
  id, name, description, and category, and no `version` key
- **frontmatter** — every `skill/<name>/SKILL.md` carries a `---` fenced
  YAML header with `name`, `version`, `description`, `category`; `name`
  matches the directory, `version` is `x.y.z`, `category` is kebab
- **markdown** — markdownlint on every `.md` file, via `pymarkdownlnt`
  with front-matter support; `md013` (line length) and `md033` (inline
  HTML) are ignored, and md025 treats front-matter `title` keys as
  headings off, so skills with a `title` plus one `#` stay clean
- **pytest** — the suite in `test/` with 75 percent coverage floor

Run all checks:

```bash
python -m pip install -r requirements.txt
python -m pip install -e .
python autotest.py               # every check
python autotest.py frontmatter   # only the named checks
```

## Adding a skill

See [CONTRIBUTING.md](https://gitea.nolivaldeziii.com/nvaldez/phronesis/src/branch/master/CONTRIBUTING.md). The short version: one
directory per skill under `skill/`, everything the agent needs in a
single `SKILL.md`, and `python autotest.py` green before you commit.

## License

[MIT](https://gitea.nolivaldeziii.com/nvaldez/phronesis/src/branch/master/LICENSE)
