@counterposition/skill-pi 0.1.1 → 0.65.1

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.
@@ -1,26 +1,61 @@
1
1
  # Skills
2
2
 
3
- Skills are self-contained capability packages that Pi's agent loads on demand. They follow the [Agent Skills standard](https://github.com/anthropics/agent-skills).
3
+ Skills are self-contained capability packages that Pi loads on demand. Pi follows the [Agent Skills specification](https://agentskills.io/specification) and stays fairly lenient, warning on many violations instead of hard-failing.
4
4
 
5
5
  ## How Skills Work
6
6
 
7
- 1. At startup, Pi discovers all skills and loads their **name + description** into the system prompt as XML.
8
- 2. When the agent encounters a task matching a skill's description, it uses the `read` tool to load the full `SKILL.md`.
9
- 3. The skill body contains detailed instructions, and may reference additional files in subdirectories.
7
+ 1. At startup, Pi scans skill locations and extracts each skill's name and description.
8
+ 2. The system prompt includes those skills in XML form.
9
+ 3. When a task matches, the agent uses `read` to load the full `SKILL.md`.
10
+ 4. The skill body can route to `references/`, `scripts/`, or `assets/` files via relative paths.
10
11
 
11
- This progressive disclosure keeps the system prompt lean while making deep knowledge available when needed.
12
+ This is progressive disclosure: descriptions stay in prompt context, full instructions are loaded only when needed.
13
+
14
+ ## Locations
15
+
16
+ Pi discovers skills from:
17
+
18
+ - Global:
19
+ - `~/.pi/agent/skills/`
20
+ - `~/.agents/skills/`
21
+ - Project:
22
+ - `.pi/skills/`
23
+ - `.agents/skills/` in `cwd` and ancestor directories
24
+ - Packages:
25
+ - `skills/` directories or `pi.skills` entries in `package.json`
26
+ - Settings:
27
+ - `skills` array in `settings.json`
28
+ - CLI:
29
+ - `--skill <path>` (repeatable, still additive even with `--no-skills`)
30
+
31
+ Discovery rules:
32
+
33
+ - Root `.md` files in `.pi/skills/` and `~/.pi/agent/skills/` are loaded as standalone skills.
34
+ - Directories containing `SKILL.md` are discovered recursively in all skill locations.
35
+ - Root `.md` files in `.agents/skills/` locations are ignored.
36
+
37
+ ## Skill Commands
38
+
39
+ Every skill can register as `/skill:name` when `enableSkillCommands` is enabled:
40
+
41
+ ```text
42
+ /skill:my-skill
43
+ /skill:my-skill extra arguments
44
+ ```
45
+
46
+ Arguments after the command are appended to the skill body as `User: ...`.
12
47
 
13
48
  ## Directory Structure
14
49
 
15
50
  ```text
16
51
  my-skill/
17
- ├── SKILL.md # Required — frontmatter + instructions
18
- ├── scripts/ # Optional — executable helper scripts
19
- │ └── build.sh
20
- ├── references/ # Optional — docs loaded into context as needed
21
- │ └── api-reference.md
22
- └── assets/ # Optional — templates, icons, fonts
23
- └── template.html
52
+ ├── SKILL.md
53
+ ├── scripts/
54
+ │ └── process.sh
55
+ ├── references/
56
+ │ └── api.md
57
+ └── assets/
58
+ └── template.json
24
59
  ```
25
60
 
26
61
  ## SKILL.md Format
@@ -28,84 +63,59 @@ my-skill/
28
63
  ```markdown
29
64
  ---
30
65
  name: my-skill
31
- description: "What this skill does and when to use it. Be specific about trigger phrases and contexts — Pi tends to under-trigger skills, so make descriptions slightly assertive."
66
+ description: "What this skill does and when to use it. Be specific."
32
67
  license: MIT
33
- compatibility: "Requires bash and node tools"
68
+ compatibility: "Requires bash"
34
69
  ---
35
70
 
36
71
  # My Skill
37
72
 
38
- Instructions for the agent go here. Write in imperative form.
39
- Use markdown formatting. Reference supporting files with relative paths.
40
-
41
- ## Step 1: Do the thing
42
-
43
- Read `references/api-reference.md` for the full API spec, then...
44
- ```
45
-
46
- ## Frontmatter Fields
47
-
48
- | Field | Required | Constraints | Notes |
49
- |-------|----------|------------|-------|
50
- | `name` | Yes | 1–64 chars, lowercase `[a-z0-9-]` | Should match directory name |
51
- | `description` | Yes | Max 1024 chars | Primary trigger mechanism — include trigger phrases |
52
- | `license` | No | String | License identifier |
53
- | `compatibility` | No | String | Tool/dependency requirements |
54
- | `allowed-tools` | No | List | Restrict which tools the skill can use |
55
- | `disable-model-invocation` | No | Boolean | If true, agent cannot auto-invoke this skill |
56
-
57
- ## Discovery Locations
73
+ ## Setup
58
74
 
59
- Skills are discovered from (in priority order — first wins on name collision):
75
+ Run `npm install` in this directory before first use.
60
76
 
61
- 1. `.pi/skills/` — project-local
62
- 2. `~/.pi/agent/skills/` — global
63
- 3. Installed packages (via `pi install`)
64
- 4. `settings.json` → `skills` array
65
- 5. `pi --skills <path>` CLI argument
77
+ ## Usage
66
78
 
67
- Discovery respects `.gitignore`, `.ignore`, and `.fdignore` patterns.
79
+ Read `references/api.md` for the full details.
80
+ ```
68
81
 
69
- ## Invocation
82
+ ## Frontmatter
70
83
 
71
- - **Manual:** User types `/skill:my-skill` in the editor
72
- - **Automatic:** Agent reads the skill when it matches the task (progressive disclosure)
73
- - **Disable auto-invoke:** Set `disable-model-invocation: true` in frontmatter
84
+ | Field | Required | Notes |
85
+ |-------|----------|-------|
86
+ | `name` | Yes | 1-64 chars, lowercase letters/numbers/hyphens, must match parent dir |
87
+ | `description` | Yes | Max 1024 chars; primary trigger text |
88
+ | `license` | No | License name or bundled reference |
89
+ | `compatibility` | No | Environment requirements |
90
+ | `metadata` | No | Arbitrary key-value mapping |
91
+ | `allowed-tools` | No | Experimental, space-delimited list of pre-approved tools |
92
+ | `disable-model-invocation` | No | Hides skill from system prompt; user must use `/skill:name` |
74
93
 
75
94
  ## Writing Good Skills
76
95
 
77
- ### Descriptions
78
-
79
- The description is the **primary trigger mechanism**. Make it assertive and specific:
80
-
81
- **Bad:** `"A tool for working with Docker"`
96
+ - Make the description specific and assertive. It is the main trigger.
97
+ - Keep `SKILL.md` focused and move bulk detail into `references/`.
98
+ - Use imperative instructions and explain why when it changes the workflow.
99
+ - Use relative links/paths so the agent can open supporting files reliably.
100
+ - Put deterministic helper logic in `scripts/` instead of asking the model to recreate it.
82
101
 
83
- **Good:** `"How to build, run, and debug Docker containers and docker-compose setups. Use this skill whenever the user mentions Docker, containers, docker-compose, Dockerfiles, container orchestration, or asks about building/deploying containerized applications."`
102
+ ## Using Skills from Other Harnesses
84
103
 
85
- ### Body Structure
104
+ To reuse Claude Code or Codex skill directories, add them to settings:
86
105
 
87
- - Keep SKILL.md under 500 lines. If approaching this limit, split detail into `references/` files with clear pointers.
88
- - Write in imperative form: "Run the build script" not "You should run the build script."
89
- - Explain **why** behind instructions so the model can adapt to edge cases.
90
- - Include concrete examples with input/output pairs.
91
- - For multi-domain skills, organize by variant in `references/` and let SKILL.md route to the right one.
92
-
93
- ### Reference Files
94
-
95
- - Reference with relative paths: `Read references/aws.md for AWS-specific steps.`
96
- - For files over 300 lines, include a table of contents at the top.
97
- - The model reads these with the `read` tool — they don't go into the system prompt.
98
-
99
- ### Helper Scripts
100
-
101
- Place in `scripts/`. The model can execute them via the `bash` tool. This avoids the model reinventing the wheel for deterministic operations.
106
+ ```json
107
+ {
108
+ "skills": ["~/.claude/skills", "~/.codex/skills"]
109
+ }
110
+ ```
102
111
 
103
112
  ## Validation
104
113
 
105
- Pi validates skills at load time:
114
+ Pi warns on most issues but still loads the skill when possible:
115
+
116
+ - Name and parent-directory mismatch
117
+ - Name too long or invalid
118
+ - Description too long
119
+ - Duplicate names, where first discovered wins
106
120
 
107
- - Missing `description` → skill not loaded
108
- - Name > 64 chars → warning
109
- - Description > 1024 chars → warning
110
- - Name-directory mismatch → warning
111
- - Duplicate names → first discovered wins, warning issued
121
+ One hard failure remains: a skill without `description` is not loaded.