@justjoshn/pi-pstack 0.15.36-pi.1 → 0.15.36-pi.7

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.
Files changed (114) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +15 -12
  3. package/agents/ci-watcher.md +27 -0
  4. package/agents/thermo-nuclear-code-quality-review.md +23 -0
  5. package/assets/logo.png +0 -0
  6. package/automations/benny/FOR_AGENTS.md +1 -1
  7. package/automations/benny/README.md +2 -2
  8. package/automations/benny/skills/setup-benny/SKILL.md +5 -5
  9. package/bin/pstack-routines-supervisor +9 -0
  10. package/docs/guide/07-overnight.md +1 -1
  11. package/docs/guide/09-make-it-yours.md +1 -1
  12. package/docs/guide/10-recipes-and-pitfalls.md +1 -1
  13. package/docs/native-gaps.md +11 -5
  14. package/docs/parity-reverse-engineering.md +94 -0
  15. package/package.json +41 -6
  16. package/packaging/install-supervisor-unit.sh +164 -0
  17. package/packaging/launchd/com.pstack.routines-supervisor.plist.example +24 -0
  18. package/packaging/systemd/pstack-routines-supervisor.service.example +15 -0
  19. package/skills/architect/SKILL.md +1 -1
  20. package/skills/architect/references/runner-prompt.md +1 -1
  21. package/skills/arena/SKILL.md +3 -3
  22. package/skills/check-compiler-errors/SKILL.md +23 -0
  23. package/skills/create-skill/SKILL.md +515 -29
  24. package/skills/fix-ci/SKILL.md +29 -0
  25. package/skills/fix-merge-conflicts/SKILL.md +32 -0
  26. package/skills/get-pr-comments/SKILL.md +23 -0
  27. package/skills/how/SKILL.md +1 -1
  28. package/skills/ketchup-video/SKILL.md +2 -2
  29. package/skills/loop-on-ci/SKILL.md +50 -0
  30. package/skills/make-bot-ui/SKILL.md +2 -2
  31. package/skills/make-pr-easy-to-review/SKILL.md +59 -0
  32. package/skills/new-branch-and-pr/SKILL.md +29 -0
  33. package/skills/no-inline-imports/SKILL.md +12 -0
  34. package/skills/poteto-help/SKILL.md +4 -4
  35. package/skills/poteto-mode/playbooks/multi-phase-plan.md +1 -1
  36. package/skills/poteto-mode/playbooks/orchestrate.md +1 -1
  37. package/skills/pr-review-canvas/SKILL.md +176 -0
  38. package/skills/pr-review-canvas/renderer.js +170 -0
  39. package/skills/pr-review-canvas/styles.css +96 -0
  40. package/skills/pr-review-canvas/template.html +18 -0
  41. package/skills/reflect/SKILL.md +1 -1
  42. package/skills/review-and-ship/SKILL.md +41 -0
  43. package/skills/run-smoke-tests/SKILL.md +42 -0
  44. package/skills/statechart/scripts/test/cli.test.ts +1 -1
  45. package/skills/swarm/SKILL.md +2 -2
  46. package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
  47. package/skills/typescript-exhaustive-switch/SKILL.md +10 -0
  48. package/skills/verify-this/SKILL.md +74 -0
  49. package/skills/weekly-review/SKILL.md +32 -0
  50. package/skills/what-did-i-get-done/SKILL.md +31 -0
  51. package/skills/why/SKILL.md +1 -1
  52. package/skills/workflow-from-chats/SKILL.md +50 -0
  53. package/src/mode.ts +3 -3
  54. package/src/paths.ts +13 -0
  55. package/src/pi-command.ts +12 -0
  56. package/src/rule.ts +4 -4
  57. package/src/sections.ts +2 -1
  58. package/src/subscriptions/durable-store.ts +482 -0
  59. package/src/subscriptions/durable-types.ts +41 -0
  60. package/src/subscriptions/ensure-supervisor.ts +67 -0
  61. package/src/subscriptions/index.ts +231 -271
  62. package/src/subscriptions/supervisor-main.ts +88 -0
  63. package/src/subscriptions/supervisor.ts +271 -0
  64. package/src/subscriptions/webhook.ts +22 -9
  65. package/src/task/card.ts +29 -0
  66. package/src/task/records.ts +3 -8
  67. package/src/task/runner.ts +9 -14
  68. package/src/task/tool.ts +18 -21
  69. package/src/todo.ts +1 -2
  70. package/scripts/live-e2e.mjs +0 -257
  71. package/test/aliases.test.ts +0 -57
  72. package/test/ask.test.ts +0 -85
  73. package/test/autocomplete.test.ts +0 -39
  74. package/test/e2e/aliases.e2e.test.ts +0 -81
  75. package/test/e2e/ask.e2e.test.ts +0 -135
  76. package/test/e2e/harness.ts +0 -179
  77. package/test/e2e/host.e2e.test.ts +0 -193
  78. package/test/e2e/lifecycle.e2e.test.ts +0 -99
  79. package/test/e2e/mode.e2e.test.ts +0 -160
  80. package/test/e2e/package.e2e.test.ts +0 -67
  81. package/test/e2e/task.e2e.test.ts +0 -734
  82. package/test/e2e/todo.e2e.test.ts +0 -59
  83. package/test/fixtures/cursor-askquestion-calls.json +0 -806
  84. package/test/fixtures/fake-pi.mjs +0 -96
  85. package/test/fixtures/image-model.ts +0 -16
  86. package/test/fixtures/list-models.ts +0 -15
  87. package/test/fixtures/readonly-shell-exit.ts +0 -17
  88. package/test/fixtures/scripted-model.ts +0 -113
  89. package/test/loop.test.ts +0 -209
  90. package/test/mode.test.ts +0 -143
  91. package/test/plan.test.ts +0 -126
  92. package/test/readonly-shell-security.test.ts +0 -84
  93. package/test/readonly-shell.test.ts +0 -44
  94. package/test/records.test.ts +0 -143
  95. package/test/registry.test.ts +0 -18
  96. package/test/resources.test.ts +0 -162
  97. package/test/rule.test.ts +0 -92
  98. package/test/scripts.test.ts +0 -182
  99. package/test/sections.test.ts +0 -56
  100. package/test/subscriptions-cron.test.ts +0 -60
  101. package/test/subscriptions.test.ts +0 -598
  102. package/test/task-agents.test.ts +0 -49
  103. package/test/task-card.test.ts +0 -34
  104. package/test/task-fork.test.ts +0 -233
  105. package/test/task-format.test.ts +0 -65
  106. package/test/task-model.test.ts +0 -141
  107. package/test/task-runner.test.ts +0 -259
  108. package/test/task-schema.test.ts +0 -50
  109. package/test/task-status.test.ts +0 -155
  110. package/test/task-worktree.test.ts +0 -106
  111. package/test/todo.test.ts +0 -74
  112. package/test/visualize.test.ts +0 -152
  113. package/tsconfig.json +0 -5
  114. package/vitest.config.ts +0 -16
@@ -1,45 +1,454 @@
1
1
  ---
2
2
  name: create-skill
3
- description: Create or revise a Pi skill (a directory with SKILL.md plus optional scripts, references, and assets). Covers placement, frontmatter, agent-facing writing, a draft-test-iterate loop, and tuning the description so the skill triggers when it should. Use for /create-skill, "write a skill", "turn this workflow into a skill", or editing an existing SKILL.md.
3
+ description: >-
4
+ Create or revise a Pi skill (a directory with SKILL.md plus optional scripts,
5
+ references, and assets). Covers the requirements interview, placement,
6
+ frontmatter, agent-facing writing, progressive disclosure, common patterns,
7
+ a draft-test-iterate loop, and tuning the description so the skill triggers
8
+ when it should. Use for /create-skill, "write a skill", "turn this workflow
9
+ into a skill", or editing an existing SKILL.md.
4
10
  ---
5
11
 
6
12
  # Create a skill
7
13
 
8
14
  A skill is a directory whose `SKILL.md` holds YAML frontmatter and instructions for an agent. Pi lists a skill's name, description, and path in the system prompt and loads the body only when a task calls for it, or when the user types `/skill:<name>`.
9
15
 
10
- ## 1. Decide placement and name
16
+ ## Before you begin: gather requirements
11
17
 
12
- - Project skill: `.pi/skills/<name>/SKILL.md`, or `.agents/skills/<name>/SKILL.md` for other Agent Skills hosts. Commit it with the repo.
13
- - Personal skill: `~/.pi/agent/skills/<name>/SKILL.md` (respect `PI_CODING_AGENT_DIR` when it is set).
14
- - Packaged skill: a `skills/` directory inside a Pi package.
15
- - The name uses lowercase letters, digits, and single hyphens, at most 64 characters, and matches the directory name.
16
- - Before creating a new skill, search the existing skills for one that already covers the job. Extend it instead of adding an overlap.
18
+ Before creating a skill, gather this from the user:
17
19
 
18
- ## 2. Write the frontmatter
20
+ 1. **Purpose and scope.** What specific task or workflow should this skill help with?
21
+ 2. **Target location.** Personal (`~/.pi/agent/skills/`), project (`.pi/skills/`), or packaged (`skills/` inside a Pi package)?
22
+ 3. **Trigger scenarios.** When should the agent automatically apply this skill?
23
+ 4. **Key domain knowledge.** What specialized information does the agent need that it would not already know?
24
+ 5. **Output format preferences.** Are there specific templates, formats, or styles required?
25
+ 6. **Existing patterns.** Are there existing examples or conventions to follow?
26
+
27
+ ### Verbatim text from the user
28
+
29
+ If the user includes exact wording to use in the skill, respect it and use it **verbatim** in `SKILL.md` (same words, same order). Do not paraphrase, soften, or expand their copy, and do not add unrequested headings or commentary around it.
30
+
31
+ ### Inferring from context
32
+
33
+ If you have previous conversation context, infer the skill from what was discussed. You can create skills based on workflows, patterns, or domain knowledge that emerged in the conversation.
34
+
35
+ ### Gathering additional information
36
+
37
+ If you need clarification, use the AskQuestion tool when available:
38
+
39
+ ```
40
+ Example AskQuestion usage:
41
+ - "Where should this skill be stored?" with options like ["Personal (~/.pi/agent/skills/)", "Project (.pi/skills/)"]
42
+ - "Should this skill include executable scripts?" with options like ["Yes", "No"]
43
+ ```
44
+
45
+ If the AskQuestion tool is not available, ask these questions conversationally.
19
46
 
20
- ```yaml
21
47
  ---
22
- name: verify-checkout
23
- description: Drive the checkout flow in a real browser and capture proof. Use when a change touches cart, payment, or order confirmation.
48
+
49
+ ## Skill file structure
50
+
51
+ ### Directory layout
52
+
53
+ Skills are stored as directories containing a `SKILL.md` file:
54
+
55
+ ```
56
+ skill-name/
57
+ ├── SKILL.md # Required - main instructions
58
+ ├── references/ # Optional - detailed documentation the agent reads on demand
59
+ │ └── reference.md
60
+ ├── examples.md # Optional - usage examples (or under references/)
61
+ └── scripts/ # Optional - utility scripts
62
+ ├── validate.py
63
+ └── helper.sh
64
+ ```
65
+
66
+ ### Storage locations
67
+
68
+ | Type | Path | Scope |
69
+ |------|------|-------|
70
+ | Personal | `~/.pi/agent/skills/<name>/` (respect `PI_CODING_AGENT_DIR` when set) | Available in every project on this machine |
71
+ | Project | `.pi/skills/<name>/`, or `.agents/skills/<name>/` for other Agent Skills hosts | Shared with anyone using the repository |
72
+ | Packaged | `skills/<name>/` inside a Pi package | Ships with the package (`pi install`) |
73
+
74
+ **IMPORTANT.** Never write personal or project skills into a Pi package's `skills/` tree unless the user is editing that package on purpose. Packaged skills are owned by the package maintainer.
75
+
76
+ Before creating a new skill, search the existing skills for one that already covers the job. Extend it instead of adding an overlap.
77
+
78
+ ### SKILL.md structure
79
+
80
+ Every skill requires a `SKILL.md` file with YAML frontmatter and markdown body:
81
+
82
+ ```markdown
83
+ ---
84
+ name: your-skill-name
85
+ description: Brief description of what this skill does and when to use it
24
86
  disable-model-invocation: true
25
87
  ---
88
+
89
+ # Your skill name
90
+
91
+ ## Instructions
92
+ Clear, step-by-step guidance for the agent.
93
+
94
+ ## Examples
95
+ Concrete examples of using this skill.
26
96
  ```
27
97
 
28
- - `name` and `description` are required. Pi skips a skill without a description.
29
- - `description` is one YAML scalar of at most 1024 characters. Quote it, or use `description: >-` with indented continuation lines, when it contains `: `, a leading special character, or line breaks.
30
- - Write the description as "what it does" plus "when to use it", with the words a user or agent would actually say. It is the only text the model sees before deciding to load the skill.
31
- - Set `disable-model-invocation: true` when the skill should run only on an explicit `/skill:<name>`, for example a workflow with side effects or a personal mode.
32
- - Other Agent Skills fields are `license`, `compatibility`, `metadata` (a key-value map), and `allowed-tools`. Put host-specific fields under `metadata`.
98
+ Default `disable-model-invocation: true` so the skill only loads when named explicitly (`/skill:<name>` or an explicit handoff). Omit it only when the agent should auto-invoke from ambient context.
99
+
100
+ ### Required metadata fields
101
+
102
+ | Field | Requirements | Purpose |
103
+ |-------|--------------|---------|
104
+ | `name` | Max 64 chars, lowercase letters/numbers/hyphens only. Must match the directory name. | Unique identifier for the skill |
105
+ | `description` | Max 1024 chars, non-empty. One YAML scalar. | Helps the agent decide when to apply the skill |
106
+
107
+ `name` and `description` are required. Pi skips a skill without a description.
108
+
109
+ Quote the description, or use `description: >-` with indented continuation lines, when it contains `: `, a leading special character, or line breaks.
110
+
111
+ Other Agent Skills fields are `license`, `compatibility`, `metadata` (a key-value map), and `allowed-tools`. Put host-specific fields under `metadata`.
112
+
113
+ ---
114
+
115
+ ## Writing effective descriptions
33
116
 
34
- ## 3. Write the body for an agent reader
117
+ The description is **critical** for skill discovery. The agent uses it to decide when to apply your skill. It is the only text the model sees before deciding to load the body.
118
+
119
+ ### Description best practices
120
+
121
+ 1. **Write in third person** (the description is injected into the system prompt):
122
+ - Good: "Processes Excel files and generates reports"
123
+ - Avoid: "I can help you process Excel files"
124
+ - Avoid: "You can use this to process Excel files"
125
+
126
+ 2. **Be specific and include trigger terms**:
127
+ - Good: "Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction."
128
+ - Vague: "Helps with documents"
129
+
130
+ 3. **Include both WHAT and WHEN**:
131
+ - WHAT: What the skill does (specific capabilities)
132
+ - WHEN: When the agent should use it (trigger scenarios)
133
+
134
+ ### Description examples
135
+
136
+ ```yaml
137
+ # PDF processing
138
+ description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
139
+
140
+ # Excel analysis
141
+ description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
142
+
143
+ # Git commit helper
144
+ description: Generate descriptive commit messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes.
145
+
146
+ # Code review
147
+ description: Review code for quality, security, and best practices following team standards. Use when reviewing pull requests, code changes, or when the user asks for a code review.
148
+ ```
149
+
150
+ ### Tune the description (trigger loop)
151
+
152
+ Use this loop when a skill exists but does not trigger, or triggers on the wrong requests.
153
+
154
+ 1. Write five prompts that should trigger it and five near misses that should not.
155
+ 2. For each prompt, run a fresh session with the skill discoverable and check whether the agent read the skill's `SKILL.md`.
156
+ 3. Rewrite the description to name the missing triggers and to exclude the near misses. Keep it one scalar.
157
+ 4. Repeat until both sets behave. Skills with `disable-model-invocation: true` never auto-trigger, so this loop does not apply to them.
158
+
159
+ ---
160
+
161
+ ## Core authoring principles
162
+
163
+ ### 1. Concise is key
164
+
165
+ The context window is shared with conversation history, other skills, and requests. Every token competes for space.
166
+
167
+ **Default assumption.** The agent is already very smart. Only add context it does not already have.
168
+
169
+ Challenge each piece of information:
170
+ - "Does the agent really need this explanation?"
171
+ - "Can I assume the agent knows this?"
172
+ - "Does this paragraph justify its token cost?"
173
+
174
+ **Good (concise):**
175
+ ```markdown
176
+ ## Extract PDF text
177
+
178
+ Use pdfplumber for text extraction:
179
+
180
+ \`\`\`python
181
+ import pdfplumber
182
+
183
+ with pdfplumber.open("file.pdf") as pdf:
184
+ text = pdf.pages[0].extract_text()
185
+ \`\`\`
186
+ ```
187
+
188
+ **Bad (verbose):**
189
+ ```markdown
190
+ ## Extract PDF text
191
+
192
+ PDF (Portable Document Format) files are a common file format that contains
193
+ text, images, and other content. To extract text from a PDF, you'll need to
194
+ use a library. There are many libraries available for PDF processing, but we
195
+ recommend pdfplumber because it's easy to use and handles most cases well...
196
+ ```
197
+
198
+ ### 2. Keep SKILL.md under 500 lines
199
+
200
+ For optimal performance, the main SKILL.md file should be concise. Use progressive disclosure for detailed content.
201
+
202
+ ### 3. Progressive disclosure
203
+
204
+ Put essential information in SKILL.md. Put detailed reference material in separate files that the agent reads only when needed.
205
+
206
+ ```markdown
207
+ # PDF processing
208
+
209
+ ## Quick start
210
+ [Essential instructions here]
211
+
212
+ ## Additional resources
213
+ - For complete API details, see \`references/api.md\`
214
+ - For usage examples, see \`examples.md\`
215
+ ```
216
+
217
+ **Keep references one level deep.** Link directly from SKILL.md to reference files. Deeply nested references may result in partial reads.
218
+
219
+ Use paths relative to the skill directory for bundled files. Pi tells the agent where the skill lives.
220
+
221
+ ### 4. Set appropriate degrees of freedom
222
+
223
+ Match specificity to the task's fragility:
224
+
225
+ | Freedom level | When to use | Example |
226
+ |---------------|-------------|---------|
227
+ | **High** (text instructions) | Multiple valid approaches, context-dependent | Code review guidelines |
228
+ | **Medium** (pseudocode/templates) | Preferred pattern with acceptable variation | Report generation |
229
+ | **Low** (specific scripts) | Fragile operations, consistency critical | Database migrations |
230
+
231
+ ### 5. Write the body for an agent reader
35
232
 
36
233
  - Start with what the skill produces, then the steps in order. One instruction per sentence.
37
- - Give exact commands, paths, and file names. Use paths relative to the skill directory for bundled files; Pi tells the agent where the skill lives.
38
- - Move long reference material into `references/` and executable helpers into `scripts/`, and say when to read or run each one.
234
+ - Give exact commands, paths, and file names.
39
235
  - Encode a rule that must always hold as a script, check, or lint the skill runs. Prose alone is a request, not a guarantee.
40
236
  - Cut anything the agent already knows. Keep the body short enough to read in full before acting.
41
237
 
42
- ## 4. Draft, test, iterate
238
+ ---
239
+
240
+ ## Common patterns
241
+
242
+ ### Template pattern
243
+
244
+ Provide output format templates:
245
+
246
+ ```markdown
247
+ ## Report structure
248
+
249
+ Use this template:
250
+
251
+ \`\`\`markdown
252
+ # [Analysis title]
253
+
254
+ ## Executive summary
255
+ [One-paragraph overview of key findings]
256
+
257
+ ## Key findings
258
+ - Finding 1 with supporting data
259
+ - Finding 2 with supporting data
260
+
261
+ ## Recommendations
262
+ 1. Specific actionable recommendation
263
+ 2. Specific actionable recommendation
264
+ \`\`\`
265
+ ```
266
+
267
+ ### Examples pattern
268
+
269
+ For skills where output quality depends on seeing examples:
270
+
271
+ ```markdown
272
+ ## Commit message format
273
+
274
+ **Example 1:**
275
+ Input: Added user authentication with JWT tokens
276
+ Output:
277
+ \`\`\`
278
+ feat(auth): implement JWT-based authentication
279
+
280
+ Add login endpoint and token validation middleware
281
+ \`\`\`
282
+
283
+ **Example 2:**
284
+ Input: Fixed bug where dates displayed incorrectly
285
+ Output:
286
+ \`\`\`
287
+ fix(reports): correct date formatting in timezone conversion
288
+
289
+ Use UTC timestamps consistently across report generation
290
+ \`\`\`
291
+ ```
292
+
293
+ ### Workflow pattern
294
+
295
+ Break complex operations into clear steps with checklists:
296
+
297
+ ```markdown
298
+ ## Form filling workflow
299
+
300
+ Copy this checklist and track progress:
301
+
302
+ \`\`\`
303
+ Task progress:
304
+ - [ ] Step 1: Analyze the form
305
+ - [ ] Step 2: Create field mapping
306
+ - [ ] Step 3: Validate mapping
307
+ - [ ] Step 4: Fill the form
308
+ - [ ] Step 5: Verify output
309
+ \`\`\`
310
+
311
+ **Step 1: Analyze the form**
312
+ Run: \`python scripts/analyze_form.py input.pdf\`
313
+ ...
314
+ ```
315
+
316
+ ### Conditional workflow pattern
317
+
318
+ Guide through decision points:
319
+
320
+ ```markdown
321
+ ## Document modification workflow
322
+
323
+ 1. Determine the modification type:
324
+
325
+ **Creating new content?** Follow "Creation workflow" below.
326
+ **Editing existing content?** Follow "Editing workflow" below.
327
+
328
+ 2. Creation workflow:
329
+ - Use docx-js library
330
+ - Build document from scratch
331
+ ...
332
+ ```
333
+
334
+ ### Feedback loop pattern
335
+
336
+ For quality-critical tasks, implement validation loops:
337
+
338
+ ```markdown
339
+ ## Document editing process
340
+
341
+ 1. Make your edits
342
+ 2. **Validate immediately**: \`python scripts/validate.py output/\`
343
+ 3. If validation fails:
344
+ - Review the error message
345
+ - Fix the issues
346
+ - Run validation again
347
+ 4. **Only proceed when validation passes**
348
+ ```
349
+
350
+ ---
351
+
352
+ ## Utility scripts
353
+
354
+ Pre-made scripts offer advantages over generated code:
355
+ - More reliable than generated code
356
+ - Save tokens (no code in context)
357
+ - Save time (no code generation)
358
+ - Ensure consistency across uses
359
+
360
+ ```markdown
361
+ ## Utility scripts
362
+
363
+ **analyze_form.py**: Extract all form fields from PDF
364
+ \`\`\`bash
365
+ python scripts/analyze_form.py input.pdf > fields.json
366
+ \`\`\`
367
+
368
+ **validate.py**: Check for errors
369
+ \`\`\`bash
370
+ python scripts/validate.py fields.json
371
+ # Returns: "OK" or lists conflicts
372
+ \`\`\`
373
+ ```
374
+
375
+ Make clear whether the agent should **execute** the script (most common) or **read** it as reference. Prefer `bash` for running scripts. Prefer `read`, `grep`, and `find` when inspecting skill files.
376
+
377
+ ---
378
+
379
+ ## Anti-patterns to avoid
380
+
381
+ ### 1. Windows-style paths
382
+ - Use: `scripts/helper.py`
383
+ - Avoid: `scripts\helper.py`
384
+
385
+ ### 2. Too many options
386
+ ```markdown
387
+ # Bad - confusing
388
+ "You can use pypdf, or pdfplumber, or PyMuPDF, or..."
389
+
390
+ # Good - provide a default with escape hatch
391
+ "Use pdfplumber for text extraction.
392
+ For scanned PDFs requiring OCR, use pdf2image with pytesseract instead."
393
+ ```
394
+
395
+ ### 3. Time-sensitive information
396
+ ```markdown
397
+ # Bad - will become outdated
398
+ "If you're doing this before August 2025, use the old API."
399
+
400
+ # Good - use an "old patterns" section
401
+ ## Current method
402
+ Use the v2 API endpoint.
403
+
404
+ ## Old patterns (deprecated)
405
+ <details>
406
+ <summary>Legacy v1 API</summary>
407
+ ...
408
+ </details>
409
+ ```
410
+
411
+ ### 4. Inconsistent terminology
412
+ Choose one term and use it throughout:
413
+ - Always "API endpoint" (not mixing "URL", "route", "path")
414
+ - Always "field" (not mixing "box", "element", "control")
415
+
416
+ ### 5. Vague skill names
417
+ - Good: `processing-pdfs`, `analyzing-spreadsheets`
418
+ - Avoid: `helper`, `utils`, `tools`
419
+
420
+ ---
421
+
422
+ ## Skill creation workflow
423
+
424
+ When helping a user create a skill, follow this process.
425
+
426
+ ### Phase 1: Discovery
427
+
428
+ Gather information about:
429
+ 1. The skill's purpose and primary use case
430
+ 2. Storage location (personal vs project vs packaged)
431
+ 3. Trigger scenarios
432
+ 4. Any specific requirements or constraints
433
+ 5. Existing examples or patterns to follow
434
+
435
+ If you have access to the AskQuestion tool, use it for efficient structured gathering. Otherwise, ask conversationally.
436
+
437
+ ### Phase 2: Design
438
+
439
+ 1. Draft the skill name (lowercase, hyphens, max 64 chars, matches directory)
440
+ 2. Write a specific, third-person description
441
+ 3. Outline the main sections needed
442
+ 4. Identify if supporting files or scripts are needed
443
+
444
+ ### Phase 3: Implementation
445
+
446
+ 1. Create the directory structure
447
+ 2. Write the SKILL.md file with frontmatter (`write` for new files, `edit` for revisions)
448
+ 3. Create any supporting reference files
449
+ 4. Create any utility scripts if needed
450
+
451
+ ### Phase 4: Draft, test, iterate
43
452
 
44
453
  1. Draft the skill in place.
45
454
  2. Load it: start Pi where the skill is discoverable, or run `pi --skill <dir>`. Fix every startup diagnostic.
@@ -47,16 +456,93 @@ disable-model-invocation: true
47
456
  4. Note each place it skipped a step, guessed, or went off course. Tighten the instruction that allowed it, then rerun the same tasks.
48
457
  5. Stop when the runs follow the skill without help. Run `/reload` in open sessions after edits.
49
458
 
50
- ## 5. Tune the description
459
+ ### Phase 5: Verification
51
460
 
52
- Use this loop when a skill exists but does not trigger, or triggers on the wrong requests.
461
+ 1. Verify the SKILL.md is under 500 lines
462
+ 2. Check that the description is specific and includes trigger terms
463
+ 3. Ensure consistent terminology throughout
464
+ 4. Verify all file references are one level deep
465
+ 5. Confirm the skill loads with no diagnostics after `/reload`
466
+ 6. Report the path, the frontmatter, what each run showed, and anything left to tune
53
467
 
54
- 1. Write five prompts that should trigger it and five near misses that should not.
55
- 2. For each prompt, run a fresh session with the skill discoverable and check whether the agent read the skill's `SKILL.md`.
56
- 3. Rewrite the description to name the missing triggers and to exclude the near misses. Keep it one scalar.
57
- 4. Repeat until both sets behave. Skills with `disable-model-invocation: true` never auto-trigger, so this loop does not apply to them.
468
+ ---
469
+
470
+ ## Complete example
471
+
472
+ Here's a complete example of a well-structured skill:
473
+
474
+ **Directory structure:**
475
+ ```
476
+ code-review/
477
+ ├── SKILL.md
478
+ ├── references/
479
+ │ └── STANDARDS.md
480
+ └── examples.md
481
+ ```
482
+
483
+ **SKILL.md:**
484
+ ```markdown
485
+ ---
486
+ name: code-review
487
+ description: Review code for quality, security, and maintainability following team standards. Use when reviewing pull requests, examining code changes, or when the user asks for a code review.
488
+ ---
489
+
490
+ # Code review
491
+
492
+ ## Quick start
493
+
494
+ When reviewing code:
495
+
496
+ 1. Check for correctness and potential bugs
497
+ 2. Verify security best practices
498
+ 3. Assess code readability and maintainability
499
+ 4. Ensure tests are adequate
500
+
501
+ ## Review checklist
502
+
503
+ - [ ] Logic is correct and handles edge cases
504
+ - [ ] No security vulnerabilities (SQL injection, XSS, etc.)
505
+ - [ ] Code follows project style conventions
506
+ - [ ] Functions are appropriately sized and focused
507
+ - [ ] Error handling is comprehensive
508
+ - [ ] Tests cover the changes
509
+
510
+ ## Providing feedback
511
+
512
+ Format feedback as:
513
+ - **Critical**: Must fix before merge
514
+ - **Suggestion**: Consider improving
515
+ - **Nice to have**: Optional enhancement
516
+
517
+ ## Additional resources
518
+
519
+ - For detailed coding standards, see \`references/STANDARDS.md\`
520
+ - For example reviews, see \`examples.md\`
521
+ ```
522
+
523
+ ---
524
+
525
+ ## Summary checklist
526
+
527
+ Before finalizing a skill, verify:
528
+
529
+ ### Core quality
530
+ - [ ] Description is specific and includes key terms
531
+ - [ ] Description includes both WHAT and WHEN
532
+ - [ ] Written in third person
533
+ - [ ] SKILL.md body is under 500 lines
534
+ - [ ] Consistent terminology throughout
535
+ - [ ] Examples are concrete, not abstract
58
536
 
59
- ## 6. Finish
537
+ ### Structure
538
+ - [ ] File references are one level deep
539
+ - [ ] Progressive disclosure used appropriately
540
+ - [ ] Workflows have clear steps
541
+ - [ ] No time-sensitive information
542
+ - [ ] Placement is personal, project, or packaged as intended
60
543
 
61
- - Reload and confirm the skill loads with no diagnostics.
62
- - Report the path, the frontmatter, what each run showed, and anything left to tune.
544
+ ### If including scripts
545
+ - [ ] Scripts solve problems rather than punt
546
+ - [ ] Required packages are documented
547
+ - [ ] Error handling is explicit and helpful
548
+ - [ ] No Windows-style paths
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: fix-ci
3
+ description: Find failing PR checks, inspect logs or external check links, and apply focused fixes
4
+ ---
5
+
6
+ # Fix CI
7
+
8
+ ## Trigger
9
+
10
+ Branch or PR CI is failing and needs a fast, iterative path to green checks.
11
+
12
+ ## Workflow
13
+
14
+ 1. Resolve the active PR and inspect `gh pr checks --json name,bucket,state,workflow,link`.
15
+ 2. Inspect failed jobs and extract the first actionable error. Use GitHub Actions logs when available; otherwise use the check link to identify the failing command or service.
16
+ 3. Apply the smallest safe fix.
17
+ 4. Push, re-check the PR check set, and repeat until green.
18
+
19
+ ## Guardrails
20
+
21
+ - Fix one actionable failure at a time.
22
+ - Prefer minimal, low-risk changes before broader refactors.
23
+ - Keep `gh pr checks` as the source of truth for overall PR CI state.
24
+
25
+ ## Output
26
+
27
+ - Primary failing job and root error
28
+ - Fixes applied in iteration order
29
+ - Current CI status and next action
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: fix-merge-conflicts
3
+ description: Resolve merge conflicts non-interactively, validate build and tests, and finalize conflict resolution
4
+ ---
5
+
6
+ # Fix merge conflicts
7
+
8
+ ## Trigger
9
+
10
+ Branch has unresolved merge conflicts and needs a reliable path to a buildable state.
11
+
12
+ ## Workflow
13
+
14
+ 1. Detect all conflicting files from git status and conflict markers.
15
+ 2. Resolve each conflict with minimal, correctness-first edits.
16
+ 3. Prefer preserving both sides when safe. Otherwise, choose the variant that compiles and keeps public behavior stable.
17
+ 4. Regenerate lockfiles with package manager tools instead of hand-editing.
18
+ 5. Run compile, lint, and relevant tests.
19
+ 6. Stage resolved files and summarize key decisions.
20
+
21
+ ## Guardrails
22
+
23
+ - Keep changes minimal and readable.
24
+ - Do not leave conflict markers in any file.
25
+ - Avoid broad refactors while resolving conflicts.
26
+ - Do not push or tag during conflict resolution.
27
+
28
+ ## Output
29
+
30
+ - Files resolved
31
+ - Notable resolution choices
32
+ - Build/test outcome
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: get-pr-comments
3
+ description: Fetch and summarize review comments from the active pull request
4
+ ---
5
+
6
+ # Get PR comments
7
+
8
+ ## Trigger
9
+
10
+ Need a concise, actionable summary of feedback on the active pull request.
11
+
12
+ ## Workflow
13
+
14
+ 1. Resolve the active PR for the current branch.
15
+ 2. Fetch review comments and discussion comments.
16
+ 3. Group feedback by severity and actionability.
17
+ 4. Return a concise action list.
18
+
19
+ ## Output
20
+
21
+ - Grouped feedback summary
22
+ - Action list ordered by priority
23
+ - Open questions that still need clarification
@@ -8,7 +8,7 @@ disable-model-invocation: true
8
8
 
9
9
  Explore the codebase to answer "how does X work?" questions. Produce architectural explanations at the level of a senior engineer onboarding onto a subsystem, enough to build a working mental model, not so much that it reads like annotated source code.
10
10
 
11
- Every spawn is a Task subagent with `subagent_type: generalPurpose` and `readonly: true`. Explorers use the `how explorer` line in the model rule, `~/.pi/agent/pstack/pstack-models.md` (default `grok-4.7:xhigh`), and every explainer uses the `how explainer` line (default `claude-opus-5-5:xhigh`). Set `model` to that line's value, or to the default if the rule or the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section of the **poteto-mode** skill.
11
+ Every spawn is a Task subagent with `subagent_type: generalPurpose` and `readonly: true`. Explorers use the `how explorer` line in the model rule at the path the system prompt names (default `grok-4.7:xhigh`), and every explainer uses the `how explainer` line (default `claude-opus-5-5:xhigh`). Set `model` to that line's value, or to the default if the rule or the line is missing. Leave `model` unset when the value is `auto` or `inherit-parent`. If the Task tool rejects a slug, use the default and say so. If it rejects the default, use the closest valid slug of the same family from its error message. Pick each subagent's reasoning level (the `:<level>` suffix), and fast or standard speed when the model has a `-fast` variant, for the job, per the Subagents section of the **poteto-mode** skill.
12
12
 
13
13
  ## 1. Assess complexity
14
14