phronesis 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- phronesis-0.1.0/CONTRIBUTING.md +68 -0
- phronesis-0.1.0/LICENSE +21 -0
- phronesis-0.1.0/MANIFEST.in +7 -0
- phronesis-0.1.0/PKG-INFO +116 -0
- phronesis-0.1.0/README.md +105 -0
- phronesis-0.1.0/SPEC.md +306 -0
- phronesis-0.1.0/pyproject.toml +37 -0
- phronesis-0.1.0/setup.cfg +4 -0
- phronesis-0.1.0/skill/fiona/SKILL.md +1187 -0
- phronesis-0.1.0/skill/fiona/llm-wiki-mod.md +144 -0
- phronesis-0.1.0/skill/fiona/markdown_rules.md +1419 -0
- phronesis-0.1.0/skill/memory/MEMORIES.md +173 -0
- phronesis-0.1.0/skill/memory/SKILL.md +109 -0
- phronesis-0.1.0/skill/python-tdd/SKILL.md +192 -0
- phronesis-0.1.0/skill/sectionize-markdown/SKILL.md +160 -0
- phronesis-0.1.0/skill/specification-writer/SKILL.md +322 -0
- phronesis-0.1.0/src/phronesis/__init__.py +26 -0
- phronesis-0.1.0/src/phronesis/__main__.py +7 -0
- phronesis-0.1.0/src/phronesis/cli.py +202 -0
- phronesis-0.1.0/src/phronesis/completions.py +20 -0
- phronesis-0.1.0/src/phronesis/formatting.py +81 -0
- phronesis-0.1.0/src/phronesis/harnesses.py +54 -0
- phronesis-0.1.0/src/phronesis/registry.py +106 -0
- phronesis-0.1.0/src/phronesis/state.py +79 -0
- phronesis-0.1.0/src/phronesis.egg-info/PKG-INFO +116 -0
- phronesis-0.1.0/src/phronesis.egg-info/SOURCES.txt +35 -0
- phronesis-0.1.0/src/phronesis.egg-info/dependency_links.txt +1 -0
- phronesis-0.1.0/src/phronesis.egg-info/entry_points.txt +2 -0
- phronesis-0.1.0/src/phronesis.egg-info/requires.txt +2 -0
- phronesis-0.1.0/src/phronesis.egg-info/top_level.txt +1 -0
- phronesis-0.1.0/test/test_cli.py +215 -0
- phronesis-0.1.0/test/test_completions.py +18 -0
- phronesis-0.1.0/test/test_formatting.py +75 -0
- phronesis-0.1.0/test/test_harnesses.py +26 -0
- phronesis-0.1.0/test/test_publish.py +193 -0
- phronesis-0.1.0/test/test_registry.py +51 -0
- phronesis-0.1.0/test/test_state.py +66 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Contributing to phronesis
|
|
2
|
+
|
|
3
|
+
A **skill** is one directory under `skill/` containing a single
|
|
4
|
+
`SKILL.md` file. It must be self-contained: anyone (or any agent)
|
|
5
|
+
reading only that file should be able to follow the skill.
|
|
6
|
+
|
|
7
|
+
## Adding a skill
|
|
8
|
+
|
|
9
|
+
1. Create a directory named after the skill:
|
|
10
|
+
`skill/<kebab-case-name>/`.
|
|
11
|
+
2. Add `skill/<name>/SKILL.md` with this front matter:
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
---
|
|
15
|
+
name: <name> # must equal the directory name
|
|
16
|
+
version: x.y.z # semantic, start at 1.0.0
|
|
17
|
+
description: <one line> # what the skill is for
|
|
18
|
+
category: <kebab> # lowercase label, used by `phronesis <category>`
|
|
19
|
+
---
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
3. Write the instructions below the front matter. Cover identity,
|
|
23
|
+
rules, workflow, and examples; avoid references that only make
|
|
24
|
+
sense inside your machine.
|
|
25
|
+
4. Add the skill to the table in [README.md](./README.md).
|
|
26
|
+
5. Run the checks. All of them must pass:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
python -m pip install -r requirements.txt
|
|
30
|
+
python -m pip install -e .
|
|
31
|
+
python autotest.py
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
6. Commit with a semantic message, e.g. `feat: add skill <name>`.
|
|
35
|
+
A new category is announced to users the moment the skill is
|
|
36
|
+
bundled, since `phronesis` lists it live.
|
|
37
|
+
|
|
38
|
+
## Changing a skill
|
|
39
|
+
|
|
40
|
+
- Bump the `version` in the front matter for every change:
|
|
41
|
+
patch for fixes, minor for additions, major for breaking changes.
|
|
42
|
+
- Keep `SKILL.md` the only required file; support files are allowed
|
|
43
|
+
but must stay inside the skill's directory.
|
|
44
|
+
|
|
45
|
+
## Check failures
|
|
46
|
+
|
|
47
|
+
`autotest.py <check>` runs one check; without arguments it runs all:
|
|
48
|
+
|
|
49
|
+
- `sanity` — LF line endings, no private keys, file size limit
|
|
50
|
+
- `python_syntax` — `.py` files parse
|
|
51
|
+
- `pycodestyle` — PEP 8 on `.py` files
|
|
52
|
+
- `shellcheck` — shell scripts lint clean
|
|
53
|
+
- `frontmatter` — YAML header valid, `name`, `version`, and `category`
|
|
54
|
+
correct
|
|
55
|
+
- `markdown` — markdownlint (`md013` line length and `md033` inline
|
|
56
|
+
HTML are ignored)
|
|
57
|
+
- `pytest` — the suite in `test/`, coverage floor 75 percent
|
|
58
|
+
|
|
59
|
+
## Style
|
|
60
|
+
|
|
61
|
+
- KISS/YAGNI: a skill that fits in one screen beats a manual.
|
|
62
|
+
- Plain, imperative sentences. Lists over prose where order matters.
|
|
63
|
+
- Test what you preach: a TDD skill is itself written cleanly.
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
By contributing you agree your work is released under the
|
|
68
|
+
[MIT license](./LICENSE).
|
phronesis-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nvaldez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
phronesis-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phronesis
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A chest of skills: list them, install them into an agent harness (vibe, ...)
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: pyyaml>=6.0
|
|
9
|
+
Requires-Dist: argcomplete>=3.3
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
# phronesis
|
|
13
|
+
|
|
14
|
+
A chest of skills: a repository of `SKILL.md` instruction packages and
|
|
15
|
+
a CLI that lists them and installs them into an agent harness such as
|
|
16
|
+
[Vibe](https://mistral.ai).
|
|
17
|
+
|
|
18
|
+
The name is [phronesis](https://en.wikipedia.org/wiki/Phronesis) —
|
|
19
|
+
Aristotle's word for *practical wisdom*: the knowledge a skilled
|
|
20
|
+
practitioner has, as opposed to abstract theory (`episteme`).
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pipx install phronesis # or: pip install phronesis
|
|
26
|
+
phronesis # list every bundled skill
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Command line
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
phronesis list every skill
|
|
33
|
+
phronesis <category> filter the list
|
|
34
|
+
phronesis <skill> show one skill and an install hint
|
|
35
|
+
phronesis <skill> --install [--harness <name>] install globally (~/.vibe/skills)
|
|
36
|
+
phronesis <skill> --project [--harness <name>] install in the project only (.vibe/skills)
|
|
37
|
+
phronesis --update update every installed skill
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- Already-installed skills prompt before being overwritten; `-f` /
|
|
41
|
+
`--force` skips the prompt.
|
|
42
|
+
- Installations are recorded in a per-machine state file
|
|
43
|
+
(`~/.config/phronesis/installed.json`), which powers `--update`.
|
|
44
|
+
- Shell completion via argcomplete; run
|
|
45
|
+
`activate-global-python-argcomplete` once after pipx install.
|
|
46
|
+
|
|
47
|
+
The example table:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Phronesis Version: 0.1.0
|
|
51
|
+
|
|
52
|
+
skill version category
|
|
53
|
+
----------- ------- ----------
|
|
54
|
+
python-tdd 1.2.0 development
|
|
55
|
+
Minimalist TDD architect for Python work
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Layout
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
phronesis/
|
|
62
|
+
├── src/phronesis/ # the CLI package (cli, registry, harnesses, state, ...)
|
|
63
|
+
├── test/ # pytest suite
|
|
64
|
+
├── skill/ # one directory per skill; ships as package data
|
|
65
|
+
│ └── python-tdd/SKILL.md
|
|
66
|
+
├── autotest.py # every repo check, single entry point
|
|
67
|
+
├── SPEC.md # the full specification (sectionized, citable)
|
|
68
|
+
├── README.md, CONTRIBUTING.md, LICENSE
|
|
69
|
+
└── pyproject.toml, requirements.txt
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Skills
|
|
73
|
+
|
|
74
|
+
| Skill | Version | Category | Purpose |
|
|
75
|
+
| --- | --- | --- | --- |
|
|
76
|
+
| [fiona](./skill/fiona/SKILL.md) | 2.2.0 | productivity | Operate an llm-wiki with the fiona-assistant CLI |
|
|
77
|
+
| [memory](./skill/memory/SKILL.md) | 1.0.1 | productivity | Give a skill its own MEMORIES.md beside its SKILL.md |
|
|
78
|
+
| [python-tdd](./skill/python-tdd/SKILL.md) | 1.2.0 | development | Minimalist TDD architect for Python work |
|
|
79
|
+
| [sectionize-markdown](./skill/sectionize-markdown/SKILL.md) | 1.2.0 | documentation | Number headings and list items so each rule can be cited |
|
|
80
|
+
| [specification-writer](./skill/specification-writer/SKILL.md) | 1.1.0 | documentation | Write structured, maintainable SPEC.md files |
|
|
81
|
+
|
|
82
|
+
## Checks
|
|
83
|
+
|
|
84
|
+
`autotest.py` verifies every script and markdown file in the repo:
|
|
85
|
+
|
|
86
|
+
- **sanity** — LF line endings, no committed private keys, file size limit
|
|
87
|
+
- **python_syntax** — every `.py` file parses (`ast.parse`)
|
|
88
|
+
- **pycodestyle** — PEP 8 style on every `.py` file
|
|
89
|
+
- **shellcheck** — every shell script (`.sh`, `.bash`, or shebang)
|
|
90
|
+
- **frontmatter** — every `skill/<name>/SKILL.md` carries a `---` fenced
|
|
91
|
+
YAML header with `name`, `version`, `description`, `category`; `name`
|
|
92
|
+
matches the directory, `version` is `x.y.z`, `category` is kebab
|
|
93
|
+
- **markdown** — markdownlint on every `.md` file, via `pymarkdownlnt`
|
|
94
|
+
with front-matter support; `md013` (line length) and `md033` (inline
|
|
95
|
+
HTML) are ignored, and md025 treats front-matter `title` keys as
|
|
96
|
+
headings off, so skills with a `title` plus one `#` stay clean
|
|
97
|
+
- **pytest** — the suite in `test/` with 75 percent coverage floor
|
|
98
|
+
|
|
99
|
+
Run all checks:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
python -m pip install -r requirements.txt
|
|
103
|
+
python -m pip install -e .
|
|
104
|
+
python autotest.py # every check
|
|
105
|
+
python autotest.py frontmatter # only the named checks
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Adding a skill
|
|
109
|
+
|
|
110
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md). The short version: one
|
|
111
|
+
directory per skill under `skill/`, everything the agent needs in a
|
|
112
|
+
single `SKILL.md`, and `python autotest.py` green before you commit.
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# phronesis
|
|
2
|
+
|
|
3
|
+
A chest of skills: a repository of `SKILL.md` instruction packages and
|
|
4
|
+
a CLI that lists them and installs them into an agent harness such as
|
|
5
|
+
[Vibe](https://mistral.ai).
|
|
6
|
+
|
|
7
|
+
The name is [phronesis](https://en.wikipedia.org/wiki/Phronesis) —
|
|
8
|
+
Aristotle's word for *practical wisdom*: the knowledge a skilled
|
|
9
|
+
practitioner has, as opposed to abstract theory (`episteme`).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pipx install phronesis # or: pip install phronesis
|
|
15
|
+
phronesis # list every bundled skill
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Command line
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
phronesis list every skill
|
|
22
|
+
phronesis <category> filter the list
|
|
23
|
+
phronesis <skill> show one skill and an install hint
|
|
24
|
+
phronesis <skill> --install [--harness <name>] install globally (~/.vibe/skills)
|
|
25
|
+
phronesis <skill> --project [--harness <name>] install in the project only (.vibe/skills)
|
|
26
|
+
phronesis --update update every installed skill
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Already-installed skills prompt before being overwritten; `-f` /
|
|
30
|
+
`--force` skips the prompt.
|
|
31
|
+
- Installations are recorded in a per-machine state file
|
|
32
|
+
(`~/.config/phronesis/installed.json`), which powers `--update`.
|
|
33
|
+
- Shell completion via argcomplete; run
|
|
34
|
+
`activate-global-python-argcomplete` once after pipx install.
|
|
35
|
+
|
|
36
|
+
The example table:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
Phronesis Version: 0.1.0
|
|
40
|
+
|
|
41
|
+
skill version category
|
|
42
|
+
----------- ------- ----------
|
|
43
|
+
python-tdd 1.2.0 development
|
|
44
|
+
Minimalist TDD architect for Python work
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Layout
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
phronesis/
|
|
51
|
+
├── src/phronesis/ # the CLI package (cli, registry, harnesses, state, ...)
|
|
52
|
+
├── test/ # pytest suite
|
|
53
|
+
├── skill/ # one directory per skill; ships as package data
|
|
54
|
+
│ └── python-tdd/SKILL.md
|
|
55
|
+
├── autotest.py # every repo check, single entry point
|
|
56
|
+
├── SPEC.md # the full specification (sectionized, citable)
|
|
57
|
+
├── README.md, CONTRIBUTING.md, LICENSE
|
|
58
|
+
└── pyproject.toml, requirements.txt
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Skills
|
|
62
|
+
|
|
63
|
+
| Skill | Version | Category | Purpose |
|
|
64
|
+
| --- | --- | --- | --- |
|
|
65
|
+
| [fiona](./skill/fiona/SKILL.md) | 2.2.0 | productivity | Operate an llm-wiki with the fiona-assistant CLI |
|
|
66
|
+
| [memory](./skill/memory/SKILL.md) | 1.0.1 | productivity | Give a skill its own MEMORIES.md beside its SKILL.md |
|
|
67
|
+
| [python-tdd](./skill/python-tdd/SKILL.md) | 1.2.0 | development | Minimalist TDD architect for Python work |
|
|
68
|
+
| [sectionize-markdown](./skill/sectionize-markdown/SKILL.md) | 1.2.0 | documentation | Number headings and list items so each rule can be cited |
|
|
69
|
+
| [specification-writer](./skill/specification-writer/SKILL.md) | 1.1.0 | documentation | Write structured, maintainable SPEC.md files |
|
|
70
|
+
|
|
71
|
+
## Checks
|
|
72
|
+
|
|
73
|
+
`autotest.py` verifies every script and markdown file in the repo:
|
|
74
|
+
|
|
75
|
+
- **sanity** — LF line endings, no committed private keys, file size limit
|
|
76
|
+
- **python_syntax** — every `.py` file parses (`ast.parse`)
|
|
77
|
+
- **pycodestyle** — PEP 8 style on every `.py` file
|
|
78
|
+
- **shellcheck** — every shell script (`.sh`, `.bash`, or shebang)
|
|
79
|
+
- **frontmatter** — every `skill/<name>/SKILL.md` carries a `---` fenced
|
|
80
|
+
YAML header with `name`, `version`, `description`, `category`; `name`
|
|
81
|
+
matches the directory, `version` is `x.y.z`, `category` is kebab
|
|
82
|
+
- **markdown** — markdownlint on every `.md` file, via `pymarkdownlnt`
|
|
83
|
+
with front-matter support; `md013` (line length) and `md033` (inline
|
|
84
|
+
HTML) are ignored, and md025 treats front-matter `title` keys as
|
|
85
|
+
headings off, so skills with a `title` plus one `#` stay clean
|
|
86
|
+
- **pytest** — the suite in `test/` with 75 percent coverage floor
|
|
87
|
+
|
|
88
|
+
Run all checks:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
python -m pip install -r requirements.txt
|
|
92
|
+
python -m pip install -e .
|
|
93
|
+
python autotest.py # every check
|
|
94
|
+
python autotest.py frontmatter # only the named checks
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Adding a skill
|
|
98
|
+
|
|
99
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md). The short version: one
|
|
100
|
+
directory per skill under `skill/`, everything the agent needs in a
|
|
101
|
+
single `SKILL.md`, and `python autotest.py` green before you commit.
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
[MIT](./LICENSE)
|
phronesis-0.1.0/SPEC.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# phronesis specification
|
|
2
|
+
|
|
3
|
+
How this repository is laid out, what the CLI does, and the rules for
|
|
4
|
+
maintaining it. This file alone is enough to rebuild the tool: it
|
|
5
|
+
states every observable behavior. Change this file first when the
|
|
6
|
+
behavior changes, then change the code and the tests to match.
|
|
7
|
+
|
|
8
|
+
<!-- toc-start: headings 2..6 -->
|
|
9
|
+
|
|
10
|
+
- [1. Purpose](#1-purpose)
|
|
11
|
+
- [2. Layout](#2-layout)
|
|
12
|
+
- [3. Command line](#3-command-line)
|
|
13
|
+
- [4. Skill registry and front matter](#4-skill-registry-and-front-matter)
|
|
14
|
+
- [5. Harnesses](#5-harnesses)
|
|
15
|
+
- [6. Install and project](#6-install-and-project)
|
|
16
|
+
- [7. Update](#7-update)
|
|
17
|
+
- [8. State file](#8-state-file)
|
|
18
|
+
- [9. Quality gates](#9-quality-gates)
|
|
19
|
+
- [10. Packaging](#10-packaging)
|
|
20
|
+
- [11. Implementation plan](#11-implementation-plan)
|
|
21
|
+
|
|
22
|
+
<!-- toc-end -->
|
|
23
|
+
|
|
24
|
+
## 1. Purpose
|
|
25
|
+
|
|
26
|
+
- **1.1** Every heading and list item has a stable id. Cite an item as
|
|
27
|
+
`SPEC item 3.7.1`. New items get the next free number; numbers of
|
|
28
|
+
removed items are not reused.
|
|
29
|
+
- **1.2** phronesis is a repository of skills: self-contained
|
|
30
|
+
`SKILL.md` instruction packages. The CLI lists them, and installs
|
|
31
|
+
them into an agent harness such as Vibe:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
phronesis list every skill
|
|
35
|
+
phronesis <category> filter the list
|
|
36
|
+
phronesis <skill> show one skill and an install hint
|
|
37
|
+
phronesis <skill> --install [--harness <name>] install globally
|
|
38
|
+
phronesis <skill> --project [--harness <name>] install in the project only
|
|
39
|
+
phronesis --update update every installed skill
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- **1.3** The tool is a pip or pipx package (section 10); after
|
|
43
|
+
`pipx install phronesis` the command `phronesis` is on `PATH` with the
|
|
44
|
+
skills bundled inside the wheel.
|
|
45
|
+
- **1.4** Harnesses are modular: the CLI knows only the harness
|
|
46
|
+
interface (section 5); each harness knows where that agent keeps its
|
|
47
|
+
skills. Adding a harness adds one class and one registry entry; no
|
|
48
|
+
other file changes.
|
|
49
|
+
- **1.5** The software may crash on bad input; no broad except hiding
|
|
50
|
+
defects (python-tdd skill item 0). The one dependency policy: reuse
|
|
51
|
+
first (daedalus SPEC item 1.5); today the dependencies are PyYAML
|
|
52
|
+
(front matter) and argcomplete (completion, guarded import).
|
|
53
|
+
|
|
54
|
+
## 2. Layout
|
|
55
|
+
|
|
56
|
+
- **2.1** Repository tree:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
phronesis/
|
|
60
|
+
├── src/
|
|
61
|
+
│ └── phronesis/ # The CLI package
|
|
62
|
+
│ ├── __init__.py # Package version, REPO_ROOT
|
|
63
|
+
│ ├── __main__.py # python -m phronesis
|
|
64
|
+
│ ├── cli.py # Parser, list, install, update, dispatch
|
|
65
|
+
│ ├── registry.py # Skill dataclass, bundled SKILLS, front matter
|
|
66
|
+
│ ├── harnesses.py # Harness interface, HARNESS_REGISTRY, vibe harness
|
|
67
|
+
│ ├── state.py # installed.json load, save, record
|
|
68
|
+
│ ├── completions.py # Completion candidates for argcomplete
|
|
69
|
+
│ └── formatting.py # Table cells, wrapping, colors
|
|
70
|
+
├── test/ # pytest suite, one module per source module
|
|
71
|
+
├── skill/ # One directory per skill; ships as package data
|
|
72
|
+
│ └── <name>/
|
|
73
|
+
│ └── SKILL.md
|
|
74
|
+
├── autotest.py # Every repo check, single entry point
|
|
75
|
+
├── SPEC.md # This file
|
|
76
|
+
├── README.md, CONTRIBUTING.md, LICENSE
|
|
77
|
+
└── pyproject.toml, requirements.txt
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- **2.2** The skills ship through the package as
|
|
81
|
+
`phronesis._skills` mapped to the repository folder `skill/`
|
|
82
|
+
(SPEC item 10.3), so the registry resolves the same paths from a
|
|
83
|
+
checkout and from an installed package (daedalus `_library` pattern).
|
|
84
|
+
|
|
85
|
+
## 3. Command line
|
|
86
|
+
|
|
87
|
+
| Call | Result | Exit code |
|
|
88
|
+
| --- | --- | --- |
|
|
89
|
+
| `phronesis` | Version line, then every skill (SPEC items 3.3.1 to 3.3.5) | 0 |
|
|
90
|
+
| `phronesis -l`, `phronesis --list` | Same as the bare call | 0 |
|
|
91
|
+
| `phronesis <category>` | Version line, then the skills in that category | 0 |
|
|
92
|
+
| `phronesis <skill>` | The one-row table for that skill plus an install hint | 0 |
|
|
93
|
+
| `phronesis <skill> --install [--harness <name>]` | Install globally (section 6) | 0, or 2 on error |
|
|
94
|
+
| `phronesis <skill> --project [--harness <name>]` | Install in the project only (section 6) | 0, or 2 on error |
|
|
95
|
+
| `phronesis --update` | Update every installed skill (section 7) | 0, or 2 on error |
|
|
96
|
+
| `phronesis --version` | `phronesis <version>` | 0 |
|
|
97
|
+
| `phronesis -h`, `phronesis --help` | Usage (SPEC item 3.8) | 0 |
|
|
98
|
+
| Unknown option, category, or skill; unknown harness | Error and close matches to stderr | 2 |
|
|
99
|
+
|
|
100
|
+
- **3.1** One positional `<category|skill>` word is allowed. A token is
|
|
101
|
+
a category only when it matches a category in use; otherwise it is
|
|
102
|
+
treated as a skill name. Names and category labels must not collide
|
|
103
|
+
(SPEC item 4.6).
|
|
104
|
+
- **3.2** `--install` and `--project` are mutually exclusive; using
|
|
105
|
+
both exits 2. Each needs a skill word; with neither option the call
|
|
106
|
+
lists.
|
|
107
|
+
- **3.3** Listing format (bare, `--list`, filtered, one skill):
|
|
108
|
+
- **3.3.1** First line `Phronesis Version: <version>`. When at least
|
|
109
|
+
one skill is listed, a blank line and the table follow.
|
|
110
|
+
- **3.3.2** The table has a header row `skill`, `version`,
|
|
111
|
+
`category`, then a rule row of `-` per column. Columns are
|
|
112
|
+
left-aligned, padded to the widest cell (header included), and
|
|
113
|
+
separated by two spaces. The `version` column is at least 7 wide.
|
|
114
|
+
- **3.3.3** One row per skill, sorted by name. `version` is the
|
|
115
|
+
front matter version, `category` the front matter category.
|
|
116
|
+
- **3.3.4** Under each row the description is wrapped to the terminal
|
|
117
|
+
width (at least 40 columns; 80 when the width cannot be read),
|
|
118
|
+
every line indented by 8 spaces. Long words and hyphenated words
|
|
119
|
+
are not split.
|
|
120
|
+
- **3.3.5** Color like daedalus: when enabled, the padded name cell
|
|
121
|
+
is green (`ESC[32m`), the version cell yellow (`ESC[33m`), the
|
|
122
|
+
category cell bright blue (`ESC[94m`), each followed by `ESC[0m`.
|
|
123
|
+
Enabled when `NO_COLOR` is unset or empty and either `FORCE_COLOR`
|
|
124
|
+
is non-empty or stdout is a terminal; a non-empty `NO_COLOR` wins.
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
Phronesis Version: 0.1.0
|
|
128
|
+
|
|
129
|
+
skill version category
|
|
130
|
+
----------- ------- ----------
|
|
131
|
+
python-tdd 1.2.0 development
|
|
132
|
+
Minimalist TDD architect for Python work
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- **3.4** `phronesis <skill>` (no install option) prints the filtered
|
|
136
|
+
table for that one skill, then a blank line and
|
|
137
|
+
`install: phronesis <skill> --install --harness <name>`.
|
|
138
|
+
- **3.5** Unknown skill or empty category: exit 2 with close matches
|
|
139
|
+
on stderr (up to 3 candidates, similarity at least 0.6).
|
|
140
|
+
- **3.6** `-h` / `--help` prints the argparse rendering of the parser
|
|
141
|
+
in SPEC item 3.10.
|
|
142
|
+
- **3.7** The installed command is the entry point
|
|
143
|
+
`phronesis = phronesis.cli:main`; `python -m phronesis` from the
|
|
144
|
+
repository root works the same.
|
|
145
|
+
- **3.8** Shell completion uses argcomplete and is off when the
|
|
146
|
+
package is not installed (guarded import). The completion candidates
|
|
147
|
+
are the category labels in use, the skill names, the `--harness`
|
|
148
|
+
choices, and `--install`, `--project`, `--force`, `-f`.
|
|
149
|
+
- **3.9** `--version` prints the installed distribution version; when
|
|
150
|
+
the metadata is missing, the version falls back to the checkout
|
|
151
|
+
`pyproject.toml`, else `unknown`.
|
|
152
|
+
|
|
153
|
+
## 4. Skill registry and front matter
|
|
154
|
+
|
|
155
|
+
- **4.1** A skill is one directory under `skill/` named after the
|
|
156
|
+
skill, containing a single required file `SKILL.md`. Support files
|
|
157
|
+
may follow later; the whole directory is copied on install.
|
|
158
|
+
- **4.2** `SKILL.md` starts with a `---` fenced YAML header with the
|
|
159
|
+
required keys `name`, `version`, `description`, `category`.
|
|
160
|
+
- **4.3** `name` equals the directory name; `version` is `x.y.z`;
|
|
161
|
+
`category` is a lowercase kebab label `^[a-z][a-z0-9-]*$`.
|
|
162
|
+
- **4.4** The registry loads every bundled skill at import time by
|
|
163
|
+
scanning `phronesis._skills/*/SKILL.md` through
|
|
164
|
+
`importlib.resources` and parsing the front matter; a malformed
|
|
165
|
+
skill raises at import, so tests and CI catch it immediately.
|
|
166
|
+
- **4.5** Skills cached in `SKILLS: dict[str, Skill]` keyed by name;
|
|
167
|
+
`Skill` carries name, version, description, category, and the source
|
|
168
|
+
directory path.
|
|
169
|
+
- **4.6** Every category in use is offered by completion and by the
|
|
170
|
+
`<category>` word (SPEC items 3.1, 3.8).
|
|
171
|
+
|
|
172
|
+
## 5. Harnesses
|
|
173
|
+
|
|
174
|
+
- **5.1** A harness is a class with `name` and two locations:
|
|
175
|
+
`global_dir()` for the machine-level skill directory, and
|
|
176
|
+
`project_dir(cwd)` for the project-level skill directory.
|
|
177
|
+
- **5.2** `HARNESS_REGISTRY: dict[str, Harness]` maps names to instances;
|
|
178
|
+
`--harness <name>` picks from it. Unknown harness exits 2 with the
|
|
179
|
+
available names on stderr.
|
|
180
|
+
- **5.3** `--harness` defaults to `vibe`; the default can change when
|
|
181
|
+
more harnesses arrive, never silently in a patch release.
|
|
182
|
+
- **5.4** The `vibe` harness targets Mistral Vibe:
|
|
183
|
+
- **5.4.1** `global_dir()` is `~/.vibe/skills`.
|
|
184
|
+
- **5.4.2** `project_dir(cwd)` is `<cwd>/.vibe/skills`.
|
|
185
|
+
- **5.4.3** Skills install as `<dir>/<name>/SKILL.md`; Vibe
|
|
186
|
+
discovers global skills in `~/.vibe/skills` and project skills in
|
|
187
|
+
the project's `.vibe/skills`.
|
|
188
|
+
- **5.5** A new harness adds one class and one `HARNESS_REGISTRY` entry;
|
|
189
|
+
the CLI, table, tests, and state file do not change.
|
|
190
|
+
|
|
191
|
+
## 6. Install and project
|
|
192
|
+
|
|
193
|
+
- **6.1** `phronesis <skill> --install` copies the whole skill
|
|
194
|
+
directory from the bundle into `harness.global_dir()/<name>/`;
|
|
195
|
+
`--project` copies into `harness.project_dir(cwd)/<name>/`. Parent
|
|
196
|
+
directories are created.
|
|
197
|
+
- **6.2** When the target `SKILL.md` already exists the CLI prompts
|
|
198
|
+
once on stderr and reads the answer from stdin:
|
|
199
|
+
`skill installed as <version>, bundle has <version>. update? [y/N]`
|
|
200
|
+
- **6.2.1** Answering `y` or `Y` overwrites and records the state.
|
|
201
|
+
- **6.2.2** Any other answer or end of stdin leaves the target
|
|
202
|
+
untouched, prints `skipped`, and exits 0.
|
|
203
|
+
- **6.2.3** `--force` (or `-f`) overwrites and records without
|
|
204
|
+
prompting.
|
|
205
|
+
- **6.3** After every install or overwrite the state file records the
|
|
206
|
+
entry (section 8).
|
|
207
|
+
- **6.4** Success prints one line to stdout:
|
|
208
|
+
`installed python-tdd 1.2.0 (vibe, global) -> /home/me/.vibe/skills/python-tdd/SKILL.md`.
|
|
209
|
+
- **6.5** A skill that is not bundled exits 2 with close matches
|
|
210
|
+
(SPEC item 3.5).
|
|
211
|
+
|
|
212
|
+
## 7. Update
|
|
213
|
+
|
|
214
|
+
- **7.1** `phronesis --update` loads the state file and processes
|
|
215
|
+
every recorded entry, so all installed skills end at the bundled
|
|
216
|
+
versions; it never prompts.
|
|
217
|
+
- **7.2** Per entry: copy the bundled directory over the recorded
|
|
218
|
+
path, print `updated python-tdd 1.0.0 -> 1.2.0 (vibe, global)`, and
|
|
219
|
+
record the new version in the state.
|
|
220
|
+
- **7.3** Entries whose local file is missing are reinstalled the same
|
|
221
|
+
way, so `--update` also repairs a broken tree.
|
|
222
|
+
- **7.4** Entries whose skill is no longer bundled print a warning to
|
|
223
|
+
stderr and are kept; the exit code stays 0.
|
|
224
|
+
- **7.5** When the state file records nothing, `--update` prints
|
|
225
|
+
`nothing installed` and exits 0.
|
|
226
|
+
|
|
227
|
+
## 8. State file
|
|
228
|
+
|
|
229
|
+
- **8.1** The CLI keeps one JSON state file per machine at
|
|
230
|
+
`<config>/phronesis/installed.json`, where `<config>` is
|
|
231
|
+
`%APPDATA%` on Windows and `$XDG_CONFIG_HOME` else `~/.config`
|
|
232
|
+
elsewhere. `$PHRONESIS_CONFIG` overrides the location wholesale for
|
|
233
|
+
tests and unusual setups.
|
|
234
|
+
- **8.2** The file is a JSON object holding a `skills` list; each
|
|
235
|
+
entry has `name`, `version`, `harness`, `scope`, `path`, and
|
|
236
|
+
`installed` (an ISO date):
|
|
237
|
+
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"skills": [
|
|
241
|
+
{
|
|
242
|
+
"name": "python-tdd",
|
|
243
|
+
"version": "1.2.0",
|
|
244
|
+
"harness": "vibe",
|
|
245
|
+
"scope": "global",
|
|
246
|
+
"path": "/home/me/.vibe/skills/python-tdd/SKILL.md",
|
|
247
|
+
"installed": "2026-11-19"
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- **8.3** An entry is unique by `(name, harness, scope)`: reinstalling
|
|
254
|
+
updates the entry instead of appending a new one. The `path` is the
|
|
255
|
+
absolute `SKILL.md` path; `scope` is `global` or `project`.
|
|
256
|
+
- **8.4** Uninstalling is not part of the CLI; removing the harness
|
|
257
|
+
directory and the state entry is the workaround until section 6
|
|
258
|
+
grows a `--remove`.
|
|
259
|
+
|
|
260
|
+
## 9. Quality gates
|
|
261
|
+
|
|
262
|
+
- **9.1** `autotest.py` is the single entry point and runs every check
|
|
263
|
+
in parallel; any check failing fails the run (exit 1).
|
|
264
|
+
- **9.2** `sanity`, `python_syntax`, `pycodestyle`, `shellcheck`,
|
|
265
|
+
`frontmatter`, and `markdown` cover every script and markdown file
|
|
266
|
+
in the repository as in the daedalus spec.
|
|
267
|
+
- **9.3** `frontmatter` requires the SPEC item 4.2 keys and checks the
|
|
268
|
+
SPEC item 4.3 formats on every `skill/<name>/SKILL.md`.
|
|
269
|
+
- **9.4** `pytest` runs the suite from `test/` in a subprocess with
|
|
270
|
+
coverage over the `phronesis` package and fails under 75 percent.
|
|
271
|
+
- **9.5** `requirements.txt` pins the check dependencies and the test
|
|
272
|
+
dependencies; the runtime dependencies live in `pyproject.toml`
|
|
273
|
+
(SPEC item 10.2).
|
|
274
|
+
- **9.6** The markdown check configures md025's `front_matter_title`
|
|
275
|
+
search with a pattern that never matches, so a `title` key in
|
|
276
|
+
skill front matter is not an implicit second top-level heading;
|
|
277
|
+
a genuine duplicate h1 still fails the check.
|
|
278
|
+
|
|
279
|
+
## 10. Packaging
|
|
280
|
+
|
|
281
|
+
- **10.1** src layout: the package lives at `src/phronesis/`, the
|
|
282
|
+
console script is `phronesis = phronesis.cli:main`, the wheel
|
|
283
|
+
requires Python 3.11 or newer.
|
|
284
|
+
- **10.2** Runtime dependencies: `pyyaml`, `argcomplete`.
|
|
285
|
+
- **10.3** The `skill/` folder ships as package data: the distribution
|
|
286
|
+
maps the package `phronesis._skills` to the repository folder
|
|
287
|
+
`skill/` with every file included, so the registry sees the packaged
|
|
288
|
+
skills through `importlib.resources` (SPEC item 2.2).
|
|
289
|
+
- **10.4** Build backend is setuptools; a checkout can run
|
|
290
|
+
`python -m pip install -e .` and the CLI stays identical to the
|
|
291
|
+
installed one.
|
|
292
|
+
|
|
293
|
+
## 11. Implementation plan
|
|
294
|
+
|
|
295
|
+
- **11.1** `registry.py` first: front matter parsing, `Skill`, and the
|
|
296
|
+
SKILLS scan; unit tested alone.
|
|
297
|
+
- **11.2** `state.py`: the JSON load, save, and record logic with
|
|
298
|
+
roundtrip tests.
|
|
299
|
+
- **11.3** `harnesses.py`: the interface and the vibe harness, tested
|
|
300
|
+
against empty temporary home and project directories.
|
|
301
|
+
- **11.4** `formatting.py` and `completions.py`: the table rendering
|
|
302
|
+
and the completion candidate functions, tested as pure functions.
|
|
303
|
+
- **11.5** `cli.py` last: parser, dispatch, install, and update wiring
|
|
304
|
+
the parts above; end to end tests through `main(argv)`.
|
|
305
|
+
- **11.6** The implementation order is bottom up so every layer has a
|
|
306
|
+
test before its consumer exists.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "phronesis"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A chest of skills: list them, install them into an agent harness (vibe, ...)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = ["pyyaml>=6.0", "argcomplete>=3.3"]
|
|
12
|
+
|
|
13
|
+
[project.scripts]
|
|
14
|
+
phronesis = "phronesis.cli:main"
|
|
15
|
+
|
|
16
|
+
# The skills ship in the wheel as phronesis._skills mapped to the
|
|
17
|
+
# repository folder skill/, so the registry resolves the same paths from
|
|
18
|
+
# a checkout and from an installed package (SPEC.md 10.3).
|
|
19
|
+
[tool.setuptools]
|
|
20
|
+
packages = ["phronesis", "phronesis._skills"]
|
|
21
|
+
|
|
22
|
+
[tool.setuptools.package-dir]
|
|
23
|
+
"" = "src"
|
|
24
|
+
"phronesis._skills" = "skill"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.package-data]
|
|
27
|
+
"phronesis._skills" = ["**/*"]
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.exclude-package-data]
|
|
30
|
+
"*" = ["*.pyc", "__pycache__/*", "**/__pycache__/*"]
|
|
31
|
+
|
|
32
|
+
[tool.pytest.ini_options]
|
|
33
|
+
testpaths = ["test"]
|
|
34
|
+
pythonpath = ["src"]
|
|
35
|
+
|
|
36
|
+
[tool.coverage.run]
|
|
37
|
+
omit = ["*/test/*", "*/__main__.py"]
|