@jaybeeuu/agent-cortex 1.20.0

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 (154) hide show
  1. package/.beads/README.md +81 -0
  2. package/.beads/config.yaml +1 -0
  3. package/.beads/issues.jsonl +236 -0
  4. package/.beads/metadata.json +7 -0
  5. package/.claude-plugin/marketplace.json +16 -0
  6. package/.github/workflows/ci.test.ts +217 -0
  7. package/.github/workflows/ci.yml +35 -0
  8. package/.github/workflows/publish.yml +36 -0
  9. package/.junie/guidelines.md +87 -0
  10. package/.junie/mcp/mcp.json +10 -0
  11. package/AGENTS.md +102 -0
  12. package/CHANGELOG.md +705 -0
  13. package/README.md +209 -0
  14. package/agents/README.md +235 -0
  15. package/agents/plan.agent.md +56 -0
  16. package/agents/ralph-plan.agent.md +119 -0
  17. package/agents/ralph.agent.md +305 -0
  18. package/agents/strategy.agent.md +109 -0
  19. package/agents-native/ralph.md +193 -0
  20. package/bin/agent-cortex.mjs +27 -0
  21. package/claude/.claude-plugin/plugin.json +11 -0
  22. package/claude/.mcp.json +18 -0
  23. package/claude/agents/plan.md +56 -0
  24. package/claude/agents/ralph-plan.md +119 -0
  25. package/claude/agents/ralph.md +193 -0
  26. package/claude/agents/strategy.md +109 -0
  27. package/claude/hooks.json +23 -0
  28. package/claude/scripts/statusline-command.sh +124 -0
  29. package/docs/ideas/auto-model-selection.md +75 -0
  30. package/docs/ideas/improve-pi-system-prompt.md +34 -0
  31. package/docs/ideas/model-selector.md +40 -0
  32. package/docs/ideas/pi-task-memory.md +34 -0
  33. package/docs/ideas/qa-extension.md +43 -0
  34. package/docs/inspirations.md +33 -0
  35. package/docs/research/gas-city-research.md +256 -0
  36. package/docs/research/skill-design-research.md +286 -0
  37. package/docs/research/skill-improvements-analysis.md +117 -0
  38. package/docs/research/skill-patterns-research.md +24 -0
  39. package/docs/skills/skill-anatomy.md +149 -0
  40. package/docs/user-preferences.md +17 -0
  41. package/extensions/agent-modes/index.ts +507 -0
  42. package/extensions/auto-name.ts +107 -0
  43. package/extensions/context-loader.md +35 -0
  44. package/extensions/context-loader.ts +65 -0
  45. package/extensions/lib/tiny-model.ts +212 -0
  46. package/extensions/notify/index.ts +293 -0
  47. package/extensions/session-start.ts +44 -0
  48. package/extensions/skill-stats/README.md +74 -0
  49. package/extensions/skill-stats/context-loader.test.ts +107 -0
  50. package/extensions/skill-stats/discover.ts +119 -0
  51. package/extensions/skill-stats/format.ts +13 -0
  52. package/extensions/skill-stats/index.test.ts +452 -0
  53. package/extensions/skill-stats/index.ts +222 -0
  54. package/extensions/skill-stats/package.json +19 -0
  55. package/extensions/skill-stats/pnpm-lock.yaml +329 -0
  56. package/extensions/skill-stats/record.ts +48 -0
  57. package/extensions/skill-stats/store.ts +104 -0
  58. package/extensions/skill-stats/tsconfig.json +12 -0
  59. package/extensions/subagent/README.md +175 -0
  60. package/extensions/subagent/agents/planner.md +37 -0
  61. package/extensions/subagent/agents/reviewer.md +35 -0
  62. package/extensions/subagent/agents/scout.md +50 -0
  63. package/extensions/subagent/agents/worker.md +24 -0
  64. package/extensions/subagent/agents.ts +126 -0
  65. package/extensions/subagent/index.ts +1138 -0
  66. package/extensions/subagent/prompts/implement-and-review.md +10 -0
  67. package/extensions/subagent/prompts/implement.md +10 -0
  68. package/extensions/subagent/prompts/scout-and-plan.md +9 -0
  69. package/hooks.json +10 -0
  70. package/lib/cli.mjs +37 -0
  71. package/package.json +39 -0
  72. package/pi/keybindings.json +3 -0
  73. package/pi/settings.json +29 -0
  74. package/plugin.json +35 -0
  75. package/pnpm-workspace.yaml +7 -0
  76. package/scripts/build-claude-agents.mjs +179 -0
  77. package/scripts/install-instructions.sh +82 -0
  78. package/skills/engineering/design-an-interface/SKILL.md +94 -0
  79. package/skills/engineering/grill-with-docs/SKILL.md +88 -0
  80. package/skills/engineering/improve-codebase-architecture/REFERENCE.md +78 -0
  81. package/skills/engineering/improve-codebase-architecture/SKILL.md +81 -0
  82. package/skills/engineering/tdd/SKILL.md +150 -0
  83. package/skills/engineering/tdd/deep-modules.md +33 -0
  84. package/skills/engineering/tdd/interface-design.md +31 -0
  85. package/skills/engineering/tdd/mocking.md +59 -0
  86. package/skills/engineering/tdd/refactoring.md +10 -0
  87. package/skills/engineering/tdd/tests.md +61 -0
  88. package/skills/engineering/technical-direction/SKILL.md +86 -0
  89. package/skills/planning/classify-bead/SKILL.md +67 -0
  90. package/skills/planning/create-task/SKILL.md +96 -0
  91. package/skills/planning/create-task/pipeline.json +33 -0
  92. package/skills/planning/create-task/scripts/create-chores.ts +112 -0
  93. package/skills/planning/create-task/scripts/package.json +14 -0
  94. package/skills/planning/create-task/scripts/pnpm-lock.yaml +342 -0
  95. package/skills/planning/create-task/scripts/tsconfig.json +12 -0
  96. package/skills/planning/create-task/templates/code.md +40 -0
  97. package/skills/planning/create-task/templates/document.md +40 -0
  98. package/skills/planning/create-task/templates/fix.md +27 -0
  99. package/skills/planning/create-task/templates/review.md +36 -0
  100. package/skills/planning/create-task/templates/verify.md +43 -0
  101. package/skills/planning/prd-to-tasks/SKILL.md +227 -0
  102. package/skills/planning/record-idea/SKILL.md +62 -0
  103. package/skills/planning/record-idea/scripts/new-idea.sh +89 -0
  104. package/skills/planning/request-refactor-plan/SKILL.md +73 -0
  105. package/skills/planning/write-a-prd/SKILL.md +74 -0
  106. package/skills/planning/write-a-ticket/SKILL.md +97 -0
  107. package/skills/productivity/bd-tool/SKILL.md +90 -0
  108. package/skills/productivity/grill-me/SKILL.md +10 -0
  109. package/skills/productivity/handoff/SKILL.md +15 -0
  110. package/skills/productivity/init-beads/SKILL.md +93 -0
  111. package/skills/productivity/teach/GLOSSARY-FORMAT.md +35 -0
  112. package/skills/productivity/teach/LEARNING-RECORD-FORMAT.md +46 -0
  113. package/skills/productivity/teach/MISSION-FORMAT.md +31 -0
  114. package/skills/productivity/teach/RESOURCES-FORMAT.md +32 -0
  115. package/skills/productivity/teach/SKILL.md +109 -0
  116. package/skills/productivity/validate-agent-dir/scripts/package.json +15 -0
  117. package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +329 -0
  118. package/skills/productivity/validate-agent-dir/scripts/pnpm-workspace.yaml +2 -0
  119. package/skills/productivity/validate-agent-dir/scripts/tsconfig.json +19 -0
  120. package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.test.ts +317 -0
  121. package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.ts +127 -0
  122. package/skills/productivity/write-a-skill/SKILL.md +74 -0
  123. package/skills/review/maintain-agent-docs/REFERENCE.md +246 -0
  124. package/skills/review/maintain-agent-docs/SKILL.md +83 -0
  125. package/skills/review/refactor-skill/EXAMPLES.md +20 -0
  126. package/skills/review/refactor-skill/SKILL.md +148 -0
  127. package/skills/review/review-security/SKILL.md +107 -0
  128. package/skills/review/review-security/scripts/install-gitleaks.sh +43 -0
  129. package/skills/style/style-code/REFERENCE.md +38 -0
  130. package/skills/style/style-code/SKILL.md +113 -0
  131. package/skills/style/style-comms/SKILL.md +93 -0
  132. package/skills/style/style-documentation/SKILL.md +112 -0
  133. package/skills/style/style-tests/SKILL.md +97 -0
  134. package/skills/workflow/git-workflow/SKILL.md +85 -0
  135. package/skills/workflow/hitl-collab/SKILL.md +29 -0
  136. package/skills/workflow/plan/SKILL.md +272 -0
  137. package/skills/workflow/ralph/REFERENCE.md +202 -0
  138. package/skills/workflow/ralph/SKILL.md +105 -0
  139. package/skills/workflow/run-pipeline-stage/SKILL.md +151 -0
  140. package/skills/workflow/run-pipeline-stage/playbooks/code.md +17 -0
  141. package/skills/workflow/run-pipeline-stage/playbooks/document.md +18 -0
  142. package/skills/workflow/run-pipeline-stage/playbooks/fix.md +17 -0
  143. package/skills/workflow/run-pipeline-stage/playbooks/review.md +19 -0
  144. package/skills/workflow/run-pipeline-stage/playbooks/verify.md +14 -0
  145. package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +20 -0
  146. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +783 -0
  147. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +586 -0
  148. package/skills/workflow/run-pipeline-stage/scripts/package.json +15 -0
  149. package/skills/workflow/run-pipeline-stage/scripts/pnpm-lock.yaml +342 -0
  150. package/skills/workflow/run-pipeline-stage/scripts/pnpm-workspace.yaml +2 -0
  151. package/skills/workflow/run-pipeline-stage/scripts/tsconfig.json +12 -0
  152. package/skills/workflow/using-agent-skills/SKILL.md +109 -0
  153. package/skills/workflow/using-agent-skills/scripts/validate-skill-structure.test.ts +73 -0
  154. package/test/cli.test.mjs +149 -0
@@ -0,0 +1,286 @@
1
+ # Skill Design Research: Recommendations for agent-cortex
2
+
3
+ This is a promoted research note.
4
+
5
+
6
+ *Researched: 2026-05-26 — compares `mattpocock/skills` (commit b8be62f) against this repo's skills, cross-referenced with empirical prompt-engineering literature.*
7
+
8
+ ---
9
+
10
+ ## 1. Executive Summary
11
+
12
+ Three parallel research streams were combined:
13
+
14
+ 1. **Structural analysis** of `mattpocock/skills` (14 active skills, authored by Matt Pocock)
15
+ 2. **Inventory** of the 31 skills in this repo (`agent-cortex`)
16
+ 3. **Literature review** of prompt/skill design research (Anthropic, Google, 10+ papers)
17
+
18
+ The headline finding: **agent-cortex skills are well-structured but systematically over-long, under-exampled, and too passive in their body text.** The mattpocock repo is ahead on progressive disclosure, cross-skill composability, and opinionated philosophy. The research literature backs all three of those design choices.
19
+
20
+ ---
21
+
22
+ ## 2. Comparison: mattpocock/skills vs agent-cortex
23
+
24
+ ### 2.1 Structure
25
+
26
+ | Dimension | mattpocock/skills | agent-cortex | Delta |
27
+ |---|---|---|---|
28
+ | YAML front-matter | `name`, `description`, optional `argument-hint`, `disable-model-invocation` | `name`, `description` | Missing 2 fields |
29
+ | Description format | "What it does. Use when [natural-language triggers]." | Same — consistent | ✅ Aligned |
30
+ | Body sections | No enforced schema; phase headers, checklists, philosophy, anti-patterns | No enforced schema; varies widely | Similar |
31
+ | Typical SKILL.md length | 7–160 lines; strict 100-line soft cap | 29–169 lines; soft cap documented but not enforced | agent-cortex skews longer |
32
+ | Progressive disclosure | `REFERENCE.md` + named supporting `.md` files linked inline | `REFERENCE.md` on 3 skills only | Under-used in agent-cortex |
33
+ | Named supporting docs | `tests.md`, `mocking.md`, `ADR-FORMAT.md`, `CONTEXT-FORMAT.md`, `DEEPENING.md`, etc. | None — overflow goes to `REFERENCE.md` only | mattpocock more granular |
34
+ | Checklists | Used as explicit phase gates (`- [ ]`) | Rare | Missing in agent-cortex |
35
+ | Cross-skill references | Explicit inline calls: "run `/grill-with-docs`" | Implicit — no inline cross-refs | agent-cortex weaker |
36
+ | Shared vocabulary file | `CONTEXT.md` at repo root; skills told to read it | None | Missing in agent-cortex |
37
+ | Skill manifest | Flat JSON array of skill paths | Same | ✅ Aligned |
38
+ | `disable-model-invocation` | Used for pure prompt-injection skills | Not used | Feature gap |
39
+ | Missing SKILL.md | 0 | 1 (`prd-to-epics`) | Bug in agent-cortex |
40
+
41
+ ### 2.2 Tone and Voice
42
+
43
+ | Dimension | mattpocock/skills | agent-cortex | Delta |
44
+ |---|---|---|---|
45
+ | Body voice | Imperative, 2nd person ("Read the full issue. Ask.") | Mixed — imperative in some, descriptive in others | Inconsistent in agent-cortex |
46
+ | Emphasis style | **bold** for key decisions; minimal CAPS | Occasional ALL-CAPS (`CRITICAL`, `MUST`) | Over-emphasis in agent-cortex |
47
+ | Conciseness | Punchy; no filler; "say it once" | Some skills have verbose rationale paragraphs | agent-cortex wordier |
48
+ | Examples | Inline code blocks, before/after contrasts, XML output templates | Sparse — only a handful of skills include examples | agent-cortex under-exampled |
49
+ | Philosophy | Explicitly baked in (Kent Beck references, banned practices with `DO NOT`) | Workflow-focused; philosophy largely absent | agent-cortex skips the "why" |
50
+ | Anti-pattern sections | Common (`## Anti-Pattern:`, before/after code blocks) | Absent | Missing in agent-cortex |
51
+ | Negative instructions | Mixed: "DO NOT write all tests first" (hard gate) + positive framing elsewhere | Heavy use of "do not", "never", "don't" | agent-cortex over-uses negatives |
52
+
53
+ ### 2.3 Description Field Quality
54
+
55
+ Both repos follow the same two-part format: capability sentence + `"Use when..."`. The mattpocock descriptions tend to list *exact user vocabulary* (quoted phrases: `"diagnose this"`, `"let me play with it"`) which is more precise as a routing signal. agent-cortex descriptions are sometimes more abstract.
56
+
57
+ **mattpocock example** (precise triggers):
58
+ > "Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says 'diagnose this' / 'debug this', reports a bug, says something is broken/throwing/failing, or describes a performance regression."
59
+
60
+ **agent-cortex example** (vaguer triggers):
61
+ > "Create a bead, classify it, and if AFK expand it into pipeline stage child beads plus a HITL PR gate task. Use when creating a new task that should be tracked and moved through implementation and human review gates."
62
+
63
+ The agent-cortex description describes internal mechanics rather than what the user is trying to accomplish.
64
+
65
+ ---
66
+
67
+ ## 3. Evidence-Backed Recommendations
68
+
69
+ ### Rec 1 — Progressive Disclosure: Split overlong skills
70
+
71
+ **Evidence**: Anthropic Claude Code best practices: *"Bloated CLAUDE.md files cause Claude to ignore your actual instructions!"* LIMA (Zhou et al., NeurIPS 2023) confirms quality beats quantity — 1,000 curated examples matched GPT-4; adding more degraded focus. Schulhoff et al. (ACL 2024, arXiv:2406.06608) found structure + clarity most consistently effective across 58 techniques.
72
+
73
+ **Current state**: 11 of 28 agent-cortex skills exceed 100 lines (`run-beads` is 169, `style-code` 151). Only 3 have `REFERENCE.md`.
74
+
75
+ **Recommendation**: Split all skills over ~100 lines. Prefer *named, purpose-specific files* over a catch-all `REFERENCE.md`:
76
+ - `REFERENCE.md` — rarely-needed edge cases
77
+ - `EXAMPLES.md` — worked examples (if multiple)
78
+ - `FORMAT.md` — output schemas / templates
79
+ - `WORKFLOW.md` — detailed step expansions
80
+
81
+ Candidates to split immediately: `run-beads`, `style-code`, `tdd`, `ralph`.
82
+
83
+ ---
84
+
85
+ ### Rec 2 — Consistent Imperative Voice in Skill Bodies
86
+
87
+ **Evidence**: The "26 Principles" paper (Bsharat et al., arXiv:2312.16171, VILA Lab 2024) tested 26 prompting principles on GPT-3.5/4 and LLaMA, finding an average **57.7% quality improvement** on GPT-4. Direct command framing (Principle 16) and specificity (Principle 5) had the largest gains on large models. Anthropic explicitly: *"treat the model as a brilliant but new employee who lacks context on your norms"* — this framing implies 2nd-person imperative.
88
+
89
+ **Current state**: agent-cortex mixes voices. Some skills are tight and imperative (`review-security`); others narrate what the skill *will* do rather than commanding the agent to do it.
90
+
91
+ **Recommendation**:
92
+ - Skill body: imperative, 2nd person. "Run `gitleaks protect --staged`", not "The skill runs gitleaks."
93
+ - Description field: third-person declarative. "Scans git changes for secrets."
94
+ - Remove all-caps emphasis (`CRITICAL`, `MUST`). Anthropic Claude Code notes: *"Where you might have said 'CRITICAL: You MUST use this tool when...', you can use more normal prompting like 'Use this tool when...'"* — over-emphasis backfires with modern models.
95
+
96
+ ---
97
+
98
+ ### Rec 3 — Replace Negative Instructions with Positive Framing
99
+
100
+ **Evidence**: Anthropic Prompting Best Practices gives an explicit side-by-side:
101
+ > ❌ `"Do not use markdown in your response"`
102
+ > ✅ `"Your response should be composed of smoothly flowing prose paragraphs."`
103
+
104
+ The "26 Principles" paper lists "affirmative instructions, no 'don't'" as Principle 3 with consistent cross-model gains. Mechanistically, negative instructions require the model to hold a prohibited concept in working memory and suppress it — more error-prone than activating the desired pattern directly.
105
+
106
+ **Current state**: agent-cortex skills have frequent negative phrasing: "Do not work a HITL bead", "Don't commit without scanning", "Never use relative paths."
107
+
108
+ **Recommendation**:
109
+
110
+ | Instead of | Use |
111
+ |---|---|
112
+ | "Do not work a HITL bead" | "Inform the user it requires human action and stop" |
113
+ | "Never use relative paths" | "Use absolute paths — agents may change CWD mid-session" |
114
+ | "Don't commit without scanning" | "Always run `review-security` before committing" |
115
+
116
+ Reserve "do not" for hard correctness/safety constraints that genuinely need an explicit backstop. For stylistic preferences, positive framing only.
117
+
118
+ ---
119
+
120
+ ### Rec 4 — Include Rationale for Non-Obvious Rules
121
+
122
+ **Evidence**: Anthropic best practices: *"Providing context or motivation behind your instructions, such as explaining why such behavior is important, can help Claude better understand your goals and deliver more targeted responses. Claude is smart enough to generalize from the explanation."* Chain-of-Thought (Wei et al., NeurIPS 2022, arXiv:2201.11903) showed that *reasoning traces* — not just input→output — dramatically outperform bare instructions. The "26 Principles" paper Principles 2 and 5 (explain purpose, specify stakes) were among the highest-impact on GPT-4.
123
+
124
+ **Current state**: agent-cortex skills state rules but rarely explain them. A reader (or agent) encountering "Use absolute paths" won't know why.
125
+
126
+ **Recommendation**: Add one-sentence rationale for any non-obvious rule. Pattern:
127
+
128
+ ```markdown
129
+ Use absolute paths — agents may change CWD mid-session, breaking relative references.
130
+ ```
131
+
132
+ Do **not** write paragraphs of rationale. One sentence is enough; the model generalises from it.
133
+
134
+ ---
135
+
136
+ ### Rec 5 — Add Worked Examples to Key Skills
137
+
138
+ **Evidence**: Chain-of-Thought (Wei et al., NeurIPS 2022): *"prompting a 540B-parameter language model with just 8 chain-of-thought exemplars achieves state-of-the-art accuracy on GSM8K, surpassing even fine-tuned GPT-3."* Anthropic: *"A few well-crafted examples can dramatically improve accuracy and consistency."* Recommendation: 3–5 examples, wrapped in `<example>` tags, covering diverse cases. APE (Zhou et al., ICLR 2023, arXiv:2211.01910) found example-seeded instructions outperformed hand-written instructions on 19/24 tasks. Selective Annotation (Su et al., arXiv:2209.01975) showed *diverse* examples give a 12.9% relative gain over random ones.
139
+
140
+ **Current state**: most agent-cortex skills have no worked examples. `run-beads` has a `---REPORT---` output template; `review-security` shows exact commands. These are the strongest skills.
141
+
142
+ **Recommendation**: For each skill, identify what the agent produces as output and include 1 complete worked example. For CLI-heavy skills, show exact commands with substitution markers. For decision-heavy skills, add a decision table.
143
+
144
+ ```markdown
145
+ ## Example Output
146
+
147
+ ---REPORT---
148
+ Bead: bd-42 "Add login page"
149
+ Status: ✅ done
150
+ PR: https://github.com/org/repo/pull/99
151
+ ---
152
+ ```
153
+
154
+ Extract to `EXAMPLES.md` if more than ~30 lines.
155
+
156
+ ---
157
+
158
+ ### Rec 6 — Add Explicit Phase Gates (Checklists)
159
+
160
+ **Evidence**: Schulhoff et al. (ACL 2024) found structured verification steps consistently reduce hallucination and task-deviation. Anthropic Building Effective Agents: *"Give Claude a way to verify its work."* The mattpocock `diagnose` and `tdd` skills use `- [ ]` checklists as explicit gates between phases — the agent cannot proceed without the checklist being satisfied.
161
+
162
+ **Current state**: agent-cortex multi-phase skills (`ralph`, `run-beads`, `tdd`) describe phases in prose but have no explicit verification gates.
163
+
164
+ **Recommendation**: For any multi-phase skill, add a short checklist at the end of each phase:
165
+
166
+ ```markdown
167
+ ## Phase 1 — Explore
168
+
169
+ - Read the bead description and all linked files
170
+ - Identify the affected modules
171
+ - [ ] Can you describe the change in one sentence?
172
+ - [ ] Do you know which files will change?
173
+
174
+ Move to Phase 2 only when both boxes are checked.
175
+ ```
176
+
177
+ ---
178
+
179
+ ### Rec 7 — Sharpen Description Trigger Vocabulary
180
+
181
+ **Evidence**: Anthropic Building Effective Agents: *"Think of this as writing a great docstring for a junior developer on your team."* For agents, descriptions are the only routing signal. FLAN (Wei et al., ICLR 2022) showed instruction-tuned models generalise from natural language task descriptions — use the vocabulary a user would *actually speak*, not internal system jargon. Anthropic tool use note: `"Use when"` language *actively counteracts* the model's default tendency to solve problems without invoking tools.
182
+
183
+ **Current state**: some agent-cortex descriptions describe internal mechanics rather than user intent. E.g., `create-task`: *"Use when creating a new task that should be tracked and moved through implementation and human review gates"* — references internal workflow terms a user wouldn't say.
184
+
185
+ **Recommendation**: Rewrite descriptions to lead with user-vocabulary triggers. Include 2–4 quoted phrases or scenario patterns a user might say:
186
+
187
+ ```yaml
188
+ description: >
189
+ Break a piece of work into a tracked task with a full implementation pipeline.
190
+ Use when the user says "create a task", "let's track this", "add a bead", "file this
191
+ as a ticket", or wants to turn a conversation into actionable work.
192
+ ```
193
+
194
+ ---
195
+
196
+ ### Rec 8 — Establish Composability via Explicit Cross-References
197
+
198
+ **Evidence**: Anthropic Building Effective Agents promotes "orchestration" patterns where agents compose tools rather than re-implementing logic. mattpocock's skills reference each other by name inline (e.g., "run `/grill-with-docs`"), creating a composable skill library. Meta-prompting (Suzgun et al., arXiv:2401.12954) found high-level orchestration instructions (+17.1%) outperform monolithic step-by-step skills.
199
+
200
+ **Current state**: agent-cortex skills are largely self-contained monoliths. `ralph` calls `run-beads` but this is the only explicit cross-reference.
201
+
202
+ **Recommendation**: Where a skill currently duplicates logic from another skill, replace the duplication with an explicit invocation: *"Run the `review-security` skill before committing."* Document the skill dependency graph informally in `AGENTS.md`.
203
+
204
+ ---
205
+
206
+ ### Rec 9 — Add `argument-hint` to Input-Driven Skills
207
+
208
+ **Evidence**: Anthropic tool design (Building Effective Agents, Appendix 2): *"Is it obvious how to use this tool? ... This is especially important when using many similar tools."* The `argument-hint` front-matter field (present in mattpocock's plugin schema) surfaces a prompt to the user at invocation time — preventing input ambiguity before the skill runs.
209
+
210
+ **Current state**: agent-cortex plugin schema doesn't include `argument-hint`. Skills like `write-a-ticket`, `run-beads` take implicit input that could benefit from a hint.
211
+
212
+ **Recommendation**: Add `argument-hint` support to `plugin.json` schema and add hints to skills that take input:
213
+
214
+ ```yaml
215
+ argument-hint: "Describe the bug or paste the error message"
216
+ ```
217
+
218
+ ---
219
+
220
+ ### Rec 10 — Fix prd-to-epics Missing SKILL.md
221
+
222
+ **Current state**: `skills/prd-to-epics/` directory exists in the repo but has no `SKILL.md`. It cannot be invoked.
223
+
224
+ **Recommendation**: Either write the missing `SKILL.md` or remove the directory. This is a straightforward bug.
225
+
226
+ ---
227
+
228
+ ## 4. Prioritised Change List
229
+
230
+ | Priority | Change | Effort | Evidence strength |
231
+ |---|---|---|---|
232
+ | P0 | Fix missing `prd-to-epics/SKILL.md` | Low | N/A — broken |
233
+ | P1 | Split skills > 100 lines (7 candidates) | Medium | Strong — Anthropic production data |
234
+ | P1 | Convert negative instructions to positive framing | Low | Strong — 26 Principles paper, Anthropic |
235
+ | P1 | Sharpen description trigger vocabulary (use user-vocab) | Low | Strong — FLAN, Anthropic tool use docs |
236
+ | P2 | Add imperative voice to passive skill bodies | Medium | Strong — 26 Principles paper |
237
+ | P2 | Remove ALL-CAPS emphasis | Low | Medium — Anthropic Claude Code guide |
238
+ | P2 | Add 1-sentence rationale to non-obvious rules | Low | Strong — CoT, 26 Principles |
239
+ | P2 | Add worked examples to output-producing skills | Medium | Strong — Wei et al. CoT, Anthropic |
240
+ | P3 | Add phase-gate checklists to multi-phase skills | Medium | Medium — Schulhoff survey, mattpocock pattern |
241
+ | P3 | Add explicit cross-skill references | Low | Medium — Meta-prompting paper |
242
+ | P3 | Add `argument-hint` support and populate | Medium | Medium — Anthropic tool design |
243
+
244
+ ---
245
+
246
+ ## 5. What mattpocock Does That We Should Consider Adopting Wholesale
247
+
248
+ These are patterns present in `mattpocock/skills` that have no equivalent here and are backed by evidence:
249
+
250
+ 1. **`CONTEXT.md` at repo root** — a shared domain glossary that all skills read. Prevents terminology drift across skills and gives the agent grounding in project domain terms. (The `grill-with-docs` skill builds this automatically.)
251
+
252
+ 2. **Philosophy sections in skills** — `tdd` doesn't just describe TDD, it argues *why* horizontal slicing is wrong. This bakes intent into the skill so the agent handles novel cases correctly (backed by CoT rationale evidence).
253
+
254
+ 3. **`disable-model-invocation: true`** — for skills that *are* the prompt (pure injection, no interpretation). Prevents the model from summarising/transforming the skill content before executing it.
255
+
256
+ 4. **Composability by design** — skills reference each other by slash-command inline. This keeps each skill shorter and creates a network of reusable primitives rather than monolithic blobs.
257
+
258
+ ---
259
+
260
+ ## 6. What We Do Well That mattpocock Doesn't
261
+
262
+ 1. **Richer plugin manifest** — MCP server declarations, richer metadata.
263
+ 2. **Bundled scripts** — `run-beads`, `create-task`, `review-security`, `record-idea` all include deterministic scripts that reduce regeneration of boilerplate. mattpocock has this for `diagnose` and `git-guardrails` only.
264
+ 3. **Task tracking integration** — `bd` / beads integration is deeply embedded across skills; mattpocock uses GitHub Issues directly without an equivalent agent-native tracker.
265
+ 4. **HITL/AFK distinction** — explicitly modelled and surfaced in `run-beads`, `classify-bead`, etc. mattpocock's `to-issues` introduces the concept but doesn't enforce it system-wide.
266
+
267
+ ---
268
+
269
+ ## Sources
270
+
271
+ | Source | Key Findings Used |
272
+ |---|---|
273
+ | Anthropic Prompting Best Practices | Positive framing, numbered steps, XML tags, 3–5 examples, rationale inclusion, query placement (+30%) |
274
+ | Anthropic Building Effective Agents | Tool documentation = system prompt importance; ACI design; poka-yoke; verification criteria |
275
+ | Anthropic Claude Code Best Practices | Conciseness critical; bloated files → ignored rules; positive examples > negative instructions; no ALL-CAPS |
276
+ | Google Vertex AI Clear Instructions | Specificity + constraints → precise output |
277
+ | Bsharat et al. (2024) arXiv:2312.16171 | 26 prompting principles; avg +57.7% quality / +36.4% correctness on GPT-4 |
278
+ | Wei et al. (2022) arXiv:2201.11903 (CoT) | 8 CoT examples beat fine-tuned models; reasoning traces > bare instructions |
279
+ | Wei et al. (2021) arXiv:2109.01652 (FLAN) | Natural-language commands generalise better than passive descriptions |
280
+ | Zhou et al. (2022) arXiv:2211.01910 (APE) | Example-seeded instructions beat human instructions on 19/24 tasks |
281
+ | Zhou et al. (2023) arXiv:2305.11206 (LIMA) | 1,000 curated examples ≈ GPT-4 quality; quality >> volume |
282
+ | Suzgun et al. (2024) arXiv:2401.12954 | High-level orchestration +17.1% vs standard prompting |
283
+ | Schulhoff et al. (2024) arXiv:2406.06608 | ACL survey of 58 techniques; structure + clarity most consistently effective |
284
+ | mattpocock/skills (commit b8be62f) | Structural reference; progressive disclosure; composability; checklists |
285
+
286
+ [Inspirations](../inspirations.md)
@@ -0,0 +1,117 @@
1
+ # Skill Improvements: Lessons from addyosmani/agent-skills
2
+
3
+ This is a promoted research note.
4
+
5
+
6
+ > Source: https://github.com/addyosmani/agent-skills
7
+ > Reviewed: 2026-05-26
8
+
9
+ ## Summary
10
+
11
+ Compared our skills with addyosmani/agent-skills across structure, tone, and evidence-backed
12
+ patterns. Their skills are consistently richer (200–350 lines vs our 50–170), follow a strict
13
+ shared skeleton, and include several patterns backed by LLM research that we currently lack.
14
+
15
+ ---
16
+
17
+ ## What they do that we don't
18
+
19
+ ### 1. "Common Rationalizations" table
20
+
21
+ Every skill includes a table debunking common excuses for not following it:
22
+
23
+ | Rationalization | Reality |
24
+ |---|---|
25
+ | "Tests slow me down" | Tests slow you now. They speed you up every change later. |
26
+
27
+ **Evidence**: LLM sycophancy research (Perez et al.; Anthropic Constitutional AI) shows models
28
+ rationalise away inconvenient instructions. Naming these in the prompt preemptively counters
29
+ the behaviour.
30
+
31
+ ---
32
+
33
+ ### 2. "When NOT to use" sections
34
+
35
+ Every skill explicitly states when _not_ to invoke it:
36
+
37
+ > "When NOT to use: Single-line fixes, typo corrections, or changes where requirements are
38
+ > unambiguous and self-contained."
39
+
40
+ **Evidence**: Wang et al. (SuperNaturalInstructions, 2022) — explicit out-of-scope boundaries
41
+ reduce false-positive invocations and improve precision.
42
+
43
+ ---
44
+
45
+ ### 3. "Red Flags" list
46
+
47
+ Concrete, detectable anti-patterns named inline:
48
+
49
+ - "Bug fixes without reproduction tests"
50
+ - "Tests that pass on the first run"
51
+
52
+ **Evidence**: Contrastive examples (positive + negative) improve instruction adherence. Naming
53
+ failure modes alongside correct behaviour helps models self-correct.
54
+
55
+ ---
56
+
57
+ ### 4. Verification checklists at the end
58
+
59
+ Every skill ends with a checkbox list:
60
+
61
+ ```
62
+ - [ ] Every new behavior has a corresponding test
63
+ - [ ] All tests pass: `npm test`
64
+ ```
65
+
66
+ **Evidence**: Wei et al. (Chain-of-Thought, 2022) — decomposing into explicit steps reduces
67
+ omission errors and improves task completion reliability.
68
+
69
+ ---
70
+
71
+ ### 5. Concrete code/output examples
72
+
73
+ Skills show realistic before/after examples, not just abstract descriptions.
74
+
75
+ **Evidence**: Brown et al. (GPT-3, 2020) — few-shot examples consistently outperform abstract
76
+ prose descriptions for in-context learning.
77
+
78
+ ---
79
+
80
+ ### 6. 100-line limit is too restrictive
81
+
82
+ Our `write-a-skill` caps SKILL.md at 100 lines. The addyosmani skills are 200–350 lines and
83
+ their richness (rationalizations, red flags, examples, checklists) directly follows from that
84
+ budget. The constraint is working against us.
85
+
86
+ **Proposed change**: "prefer under 150 lines; overflow rarely-needed reference detail into
87
+ REFERENCE.md" — keeping SKILL.md as the primary working document rather than gutting it.
88
+
89
+ ---
90
+
91
+ ## What we do better
92
+
93
+ - **Workflow depth**: `run-beads` + `ralph` encode a full pipeline (test-writing → coding →
94
+ verifying → reviewing → fixing → documenting) that the external skills can't match.
95
+ - **Philosophy**: `tdd` has a more rigorous treatment of vertical slicing and horizontal-slice
96
+ anti-patterns than the external TDD skill.
97
+ - **Domain specificity**: our skills are tightly integrated with `bd`, worktrees, and the ralph
98
+ orchestrator — that's genuine value the external repo can't offer.
99
+ - **Progressive disclosure**: `REFERENCE.md` + `EXAMPLES.md` support already documented.
100
+
101
+ ---
102
+
103
+ ## Bead IDs
104
+
105
+ | Improvement | Status |
106
+ |---|---|
107
+ | Common Rationalizations tables | Planned |
108
+ | When NOT to use sections | Planned |
109
+ | Red Flags sections | Planned |
110
+ | Verification checklists | Planned |
111
+ | Concrete examples | Planned |
112
+ | Reconsider 100-line limit | Done (raised to 150) |
113
+ | ASCII workflow diagrams | Not yet |
114
+ | Cross-references between skills | Planned |
115
+ | Consistent skeleton template | Partially adopted |
116
+
117
+ [Inspirations](../inspirations.md)
@@ -0,0 +1,24 @@
1
+ # Skill Pattern Research Notes
2
+
3
+ A promoted research note collecting evidence behind recurring skill structure patterns.
4
+
5
+ ## Patterns and evidence
6
+
7
+ 1. **Explicit scope boundaries improve instruction following**
8
+ - Super-NaturalInstructions (Wang et al., 2022): broad, explicit instruction framing improves task generalization.
9
+ 2. **Concrete examples outperform abstract-only guidance**
10
+ - GPT-3 paper (Brown et al., 2020): few-shot examples consistently improve downstream behavior.
11
+ 3. **Checklists reduce skipped steps**
12
+ - Chain-of-Thought prompting (Wei et al., 2022): structured intermediate prompts improve completion reliability.
13
+ 4. **Constrained behavior framing lowers unsafe compliance**
14
+ - Constitutional AI (Bai et al., 2022) and sycophancy analyses (Perez et al., 2022): explicit refusal/constraint framing improves adherence.
15
+
16
+ ## References
17
+
18
+ - https://arxiv.org/abs/2204.02311
19
+ - https://arxiv.org/abs/2005.14165
20
+ - https://arxiv.org/abs/2201.11903
21
+ - https://arxiv.org/abs/2212.08073
22
+ - https://arxiv.org/abs/2211.03873
23
+
24
+ [Inspirations](../inspirations.md)
@@ -0,0 +1,149 @@
1
+ # Skill Anatomy
2
+
3
+ This document is the **canonical skill anatomy** for `agent-cortex` skills.
4
+ Use it as the source of truth for `SKILL.md` structure, language, and review quality gates.
5
+
6
+ ## Front-matter spec
7
+
8
+ Required fields:
9
+ - `name`: kebab-case skill identifier.
10
+ - `description`: max 1024 characters.
11
+
12
+ Optional fields:
13
+ - `argument-hint`: input prompt shown to users at invocation.
14
+ - `disable-model-invocation`: for deterministic prompt-injection skills that should not be summarized/interpreted.
15
+
16
+ ## Description format rules
17
+
18
+ - Target ≤200 characters even though max is 1024.
19
+ - Write in third-person declarative voice.
20
+ - Sentence 1: what the skill does.
21
+ - Sentence 2: starts with `Use when ...`.
22
+ - Include 2-4 natural user trigger phrases (quoted) such as "diagnose this" or "something is broken".
23
+ - Prefer user vocabulary over internal jargon.
24
+
25
+ ## Voice and tone rules
26
+
27
+ - Write the body in imperative second-person: "Run X", "Check Y", "Report Z".
28
+ - Use positive framing; reserve "do not" only for hard safety/correctness boundaries.
29
+ - Add one rationale sentence for non-obvious rules so behavior generalizes in novel cases.
30
+ - Avoid ALL-CAPS emphasis.
31
+
32
+ ## Required sections
33
+
34
+ Every skill must include:
35
+ 1. `## When to use`
36
+ 2. `## Workflow` (numbered steps)
37
+ 3. `## Verification checklist` (`- [ ]` items)
38
+
39
+ ## Optional sections
40
+
41
+ For each optional section, define **what it is**, include an **example snippet**, and state **when to include** and **when to omit**.
42
+
43
+ | Section | What it is | Example snippet | When to include | When to omit |
44
+ |---|---|---|---|---|
45
+ | `When NOT to use` | Explicit out-of-scope invocation boundaries | `- When NOT to use: single-line typo fixes with no process risk.` | Skills with similar neighbors where invocation precision matters | Truly unique one-purpose utility skills |
46
+ | `Red Flags` | Detectable anti-patterns the agent should self-correct during execution | `- Red flag: skipping boundary validation to save time.` | Discipline-enforcement skills (security, TDD, review) | Simple utility wrappers |
47
+ | `Common Rationalizations` | Excuses models use to skip process with rebuttals | `| "This is small" | Small changes still need invariants checked. |` | Process-critical skills where shortcut pressure is common | Mechanical one-step skills |
48
+ | `Philosophy / rationale` | Why the method exists and what trade-offs it protects | `- We front-load validation because downstream rollback cost is higher.` | Opinionated skills expected to handle novel variants | Purely mechanical instructions |
49
+ | `Phase-gate checklists` | Mid-workflow gates that must pass before proceeding | `- [ ] Phase 1 complete: baseline tests captured.` | Multi-phase workflows (3+ distinct phases) | Linear single-phase tasks |
50
+ | `Cross-skill references` | Explicit delegation to another skill for a real sub-task | `- Run \\`review-security\\` before committing.` | Another skill owns a sub-domain better than restating it | Self-contained skills |
51
+ | `Examples` | Full worked sample of expected outcome/output | `- Input: ... Output: ...` | Any non-trivial output contract | Trivially self-evident skills |
52
+
53
+ ## Section ordering
54
+
55
+ ### When to use
56
+
57
+ State concrete invocation triggers using natural language phrases users actually type.
58
+
59
+ ### When NOT to use
60
+
61
+ Place this section immediately after `When to use` whenever present.
62
+
63
+ ### Workflow
64
+
65
+ Provide ordered, deterministic steps with observable outcomes.
66
+
67
+ ### Verification checklist
68
+
69
+ Provide completion gates that are testable and stage-scoped.
70
+
71
+ ## File layout and progressive disclosure
72
+
73
+ - Target ~150 lines for `SKILL.md`.
74
+ - Split long docs into purpose-named support files:
75
+ - `EXAMPLES.md` for worked examples.
76
+ - `FORMAT.md` for schemas/templates.
77
+ - `REFERENCE.md` for rare edge cases.
78
+ - Use slash-command references when another skill should be invoked.
79
+
80
+ ## Acceptance criteria checklist
81
+
82
+ A skill passes anatomy review when:
83
+ - [ ] Front matter uses required fields and valid description format.
84
+ - [ ] Required sections exist and follow canonical ordering.
85
+ - [ ] Optional sections (if present) include what/when/example guidance.
86
+ - [ ] Verification checklist contains concrete, machine-checkable items.
87
+ - [ ] Supporting docs are split by purpose when `SKILL.md` would exceed ~150 lines.
88
+
89
+ ## Annotated template
90
+
91
+ ```md
92
+ ---
93
+ name: skill-name
94
+ description: This skill performs a specific capability. Use when a user asks for a matching workflow such as "triage this", "investigate this", or "prepare a handoff".
95
+ argument-hint: Optional prompt shown to users when extra input is needed.
96
+ disable-model-invocation: false
97
+ ---
98
+
99
+ # Skill Name
100
+
101
+ ## When to use
102
+
103
+ - Trigger phrases users actually say, e.g. "triage this failure".
104
+ - Include 2-4 concrete patterns.
105
+
106
+ ## When NOT to use
107
+
108
+ - Out-of-scope cases that should route elsewhere.
109
+
110
+ ## Workflow
111
+
112
+ 1. Gather required context and validate scope boundaries.
113
+ 2. Execute deterministic steps in order, recording key decisions.
114
+ 3. Produce the required output artifact or terminal response.
115
+
116
+ ## Red Flags
117
+
118
+ - Red flag: skipping validation of unknown external input.
119
+
120
+ ## Common Rationalizations
121
+
122
+ | Rationalization | Rebuttal |
123
+ |---|---|
124
+ | "This is too small for process" | Process protects against regressions regardless of size. |
125
+
126
+ ## Philosophy / rationale
127
+
128
+ - We optimize for explicit boundaries because they reduce rework and improve reliability.
129
+
130
+ ## Phase-gate checklist
131
+
132
+ - [ ] Phase 1 complete and baseline checks captured.
133
+ - [ ] Phase 2 complete and contract validation passed.
134
+
135
+ ## Cross-skill references
136
+
137
+ - Run `review-security` before committing any externally exposed change.
138
+
139
+ ## Examples
140
+
141
+ Input: "Investigate this flaky suite"
142
+ Output: concise root-cause summary, failing tests list, and next action.
143
+
144
+ ## Verification checklist
145
+
146
+ - [ ] Output matches requested format.
147
+ - [ ] Required tests/lints were run and results recorded.
148
+ - [ ] No unrelated files were changed.
149
+ ```
@@ -0,0 +1,17 @@
1
+ # User Preferences
2
+
3
+ This file records personal development preferences for the author (**jaybeeuu**).
4
+ Both Copilot CLI agents and PI coding agents should read this file for user-level
5
+ context when making tooling and workflow decisions.
6
+
7
+ ## Package manager
8
+
9
+ | Preference | Value |
10
+ |---|---|
11
+ | **Preferred tool** | **PNPM** (`pnpm`) over npm (`npm`) |
12
+ | Rationale | Faster installs, disk-efficient with content-addressable store, stricter dependency resolution, and built-in workspace support. |
13
+ | Impact | Use `pnpm` for installs, script execution, and package management. Use `pnpm dlx` instead of `npx`. Do not suggest `npm install` or `npx` unless the project explicitly uses npm. |
14
+
15
+ ## Future preferences
16
+
17
+ Add new preferences below as they are established.