@jaybeeuu/agent-cortex 2.1.0 → 2.3.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.
- package/CHANGELOG.md +411 -0
- package/README.md +33 -13
- package/agents/README.md +22 -10
- package/agents/plan/agent.md +2 -2
- package/agents/ralph/agent.md +126 -88
- package/agents/ralph/claude/frontmatter.json +3 -3
- package/agents/ralph/claude/wake.md +46 -0
- package/agents/ralph/pi/{polling.md → wake.md} +35 -20
- package/agents/ralph-plan/agent.md +23 -11
- package/bin/agent-cortex.mjs +66 -4
- package/bin/installers/claude.mjs +182 -68
- package/bin/installers/pi.mjs +200 -24
- package/extensions/agent-guardrails/README.md +1 -1
- package/extensions/agent-guardrails/guardrails.ts +1 -1
- package/extensions/agent-guardrails/index.ts +1 -1
- package/extensions/agent-modes/discover.test.ts +2 -2
- package/extensions/output-style/README.md +1 -1
- package/extensions/output-style/index.ts +2 -2
- package/extensions/output-style/output-style.ts +2 -2
- package/hooks/claude/scripts/notify.mjs +8 -1
- package/lib/cli.mjs +91 -2
- package/package.json +27 -3
- package/scripts/check-changeset.mjs +4 -0
- package/scripts/check-no-sync.mjs +5 -1
- package/scripts/lib/compose-agent.mjs +69 -9
- package/scripts/lib/fs.mjs +10 -2
- package/scripts/lib/migrate.mjs +736 -0
- package/scripts/lib/release-gates.mjs +21 -1
- package/scripts/lib/skill-frontmatter.mjs +23 -6
- package/scripts/lib/skill-links.mjs +52 -0
- package/scripts/lib/verify-worker-tree.mjs +25 -0
- package/scripts/resolve-publish-command.mjs +4 -0
- package/skills/engineering/design-an-interface/SKILL.md +3 -3
- package/skills/engineering/grill-with-docs/SKILL.md +3 -5
- package/skills/engineering/improve-codebase-architecture/SKILL.md +5 -4
- package/skills/engineering/tdd/SKILL.md +5 -7
- package/skills/engineering/technical-direction/SKILL.md +5 -5
- package/skills/planning/classify-bead/REFERENCE.md +3 -3
- package/skills/planning/classify-bead/SKILL.md +14 -9
- package/skills/planning/classify-bead/scripts/classify-bead.mjs +5 -4
- package/skills/planning/create-task/REFERENCE.md +52 -3
- package/skills/planning/create-task/SKILL.md +70 -26
- package/skills/planning/create-task/scripts/{create-chores.ts → create-chores.mjs} +48 -23
- package/skills/planning/flesh-out-idea/REFERENCE.md +116 -0
- package/skills/planning/flesh-out-idea/SKILL.md +146 -0
- package/skills/planning/prd-to-tasks/REFERENCE.md +54 -5
- package/skills/planning/prd-to-tasks/SKILL.md +22 -16
- package/skills/planning/record-idea/FORMAT.md +66 -17
- package/skills/planning/record-idea/SKILL.md +48 -24
- package/skills/planning/request-refactor-plan/SKILL.md +4 -4
- package/skills/planning/spec-to-tickets/SKILL.md +5 -5
- package/skills/planning/write-a-prd/SKILL.md +8 -9
- package/skills/planning/write-a-ticket/SKILL.md +4 -6
- package/skills/productivity/bd-tool/SKILL.md +15 -10
- package/skills/productivity/grill-me/SKILL.md +5 -0
- package/skills/productivity/init-beads/SKILL.md +3 -3
- package/skills/productivity/migration/REFERENCE.md +227 -0
- package/skills/productivity/migration/SKILL.md +188 -0
- package/skills/productivity/validate-agent-dir/scripts/{validate-agent-dir.ts → validate-agent-dir.mjs} +49 -28
- package/skills/productivity/write-a-skill/SKILL.md +5 -5
- package/skills/review/maintain-agent-docs/SKILL.md +5 -7
- package/skills/review/refactor-skill/SKILL.md +4 -3
- package/skills/review/review-security/SKILL.md +3 -5
- package/skills/style/style-code/SKILL.md +5 -10
- package/skills/style/style-comms/SKILL.md +5 -7
- package/skills/style/style-documentation/SKILL.md +5 -6
- package/skills/style/style-tests/SKILL.md +5 -7
- package/skills/workflow/git-workflow/SKILL.md +52 -26
- package/skills/workflow/hitl-collab/SKILL.md +4 -6
- package/skills/workflow/plan/SKILL.md +41 -30
- package/skills/workflow/ralph/REFERENCE.md +182 -51
- package/skills/workflow/ralph/SKILL.md +89 -50
- package/skills/workflow/run-pipeline-stage/SKILL.md +72 -71
- package/skills/workflow/run-pipeline-stage/playbooks/code.md +11 -0
- package/skills/workflow/run-pipeline-stage/playbooks/document.md +12 -0
- package/skills/workflow/run-pipeline-stage/playbooks/fix.md +12 -0
- package/skills/workflow/run-pipeline-stage/playbooks/review.md +11 -0
- package/skills/workflow/run-pipeline-stage/playbooks/verify.md +13 -0
- package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +73 -1
- package/token-map.README.md +9 -4
- package/token-map.json +13 -6
- package/.agents/skills/style-versioning/SKILL.md +0 -172
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.github/workflows/ci.yml +0 -302
- package/.junie/guidelines.md +0 -87
- package/.junie/mcp/mcp.json +0 -10
- package/AGENTS.md +0 -153
- package/agents/ralph/claude/polling.md +0 -31
- package/agents-native/ralph.md +0 -203
- package/docs/claude-hooks.md +0 -144
- package/docs/commit-signing.md +0 -231
- package/docs/ideas/auto-model-selection.md +0 -75
- package/docs/ideas/ban-content-assertion-tests.md +0 -75
- package/docs/ideas/bead-progress-notes-for-session-resumption.md +0 -75
- package/docs/ideas/classify-beads-via-deterministic-script-with-agent-fallback.md +0 -70
- package/docs/ideas/ctx-alias-version-and-update-commands.md +0 -65
- package/docs/ideas/ctx-feedback-command-for-capturing-ideas-from-any-machine.md +0 -67
- package/docs/ideas/dedicated-review-tests-skill.md +0 -71
- package/docs/ideas/deployment-beads-for-post-merge-pipelines.md +0 -36
- package/docs/ideas/design-and-delivery-as-separate-bead-trees/design-and-delivery-as-separate-bead-trees.md +0 -99
- package/docs/ideas/enable-signed-commit-enforcement-changesets-bot-commits-must-be-signed.md +0 -42
- package/docs/ideas/extension-manifests.md +0 -121
- package/docs/ideas/improve-pi-system-prompt.md +0 -43
- package/docs/ideas/map-every-cortex-tool-to-a-real-pi-equivalent.md +0 -95
- package/docs/ideas/model-selector.md +0 -40
- package/docs/ideas/pi-task-memory.md +0 -34
- package/docs/ideas/qa-extension.md +0 -43
- package/docs/ideas/record-idea-implementation-questions.md +0 -68
- package/docs/ideas/record-ideas-as-beads.md +0 -115
- package/docs/ideas/self-flushing-session.md +0 -72
- package/docs/ideas/state-in-beads-not-md.md +0 -69
- package/docs/ideas/subagent-visibility.md +0 -72
- package/docs/ideas/task-session-context.local.md +0 -95
- package/docs/ideas/task-session-context.md +0 -89
- package/docs/ideas/test-data-creation-helpers.md +0 -92
- package/docs/ideas/test-planning-stage-bead-in-feature-planning.md +0 -68
- package/docs/ideas/unified-ci-pipeline.md +0 -28
- package/docs/ideas/unify-the-ticket-and-task-decomposition-workflows.md +0 -71
- package/docs/ideas/worktree-housekeeping-for-closed-beads.md +0 -39
- package/docs/inspirations.md +0 -33
- package/docs/research/disable-model-invocation.md +0 -82
- package/docs/research/gas-city-research.md +0 -256
- package/docs/research/skill-design-research.md +0 -286
- package/docs/research/skill-improvements-analysis.md +0 -117
- package/docs/research/skill-patterns-research.md +0 -24
- package/docs/skills/skill-anatomy.md +0 -200
- package/docs/technical-direction/harness-config.md +0 -177
- package/docs/technical-direction/migration-execution-labels.md +0 -177
- package/docs/user-preferences.md +0 -17
- package/extensions/agent-guardrails/tsconfig.json +0 -12
- package/extensions/agent-modes/tsconfig.json +0 -12
- package/extensions/output-style/tsconfig.json +0 -12
- package/extensions/session-start/tsconfig.json +0 -12
- package/extensions/skill-stats/pnpm-lock.yaml +0 -329
- package/extensions/skill-stats/tsconfig.json +0 -12
- package/extensions/subagent/agents/planner.md +0 -37
- package/extensions/subagent/agents/reviewer.md +0 -35
- package/extensions/subagent/agents/scout.md +0 -50
- package/extensions/subagent/agents/worker.md +0 -24
- package/extensions/subagent/prompts/implement-and-review.md +0 -10
- package/extensions/subagent/prompts/implement.md +0 -10
- package/extensions/subagent/prompts/scout-and-plan.md +0 -9
- package/extensions/subagent/tsconfig.json +0 -12
- package/pi/keybindings.json +0 -3
- package/pi/settings.json +0 -34
- package/pnpm-workspace.yaml +0 -14
- package/skills/planning/create-task/scripts/package.json +0 -14
- package/skills/planning/create-task/scripts/pnpm-lock.yaml +0 -342
- package/skills/planning/create-task/scripts/tsconfig.json +0 -12
- package/skills/planning/record-idea/scripts/new-idea.sh +0 -89
- package/skills/productivity/validate-agent-dir/scripts/package.json +0 -15
- package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +0 -329
- package/skills/productivity/validate-agent-dir/scripts/pnpm-workspace.yaml +0 -2
- package/skills/productivity/validate-agent-dir/scripts/tsconfig.json +0 -19
- package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.test.ts +0 -317
- package/skills/workflow/run-pipeline-stage/REFERENCE.md +0 -22
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +0 -682
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +0 -588
- package/skills/workflow/run-pipeline-stage/scripts/package.json +0 -15
- package/skills/workflow/run-pipeline-stage/scripts/pnpm-lock.yaml +0 -342
- package/skills/workflow/run-pipeline-stage/scripts/pnpm-workspace.yaml +0 -2
- package/skills/workflow/run-pipeline-stage/scripts/tsconfig.json +0 -12
- package/test/classify-bead.test.mjs +0 -277
- package/test/claude-installer.test.mjs +0 -308
- package/test/cli.test.mjs +0 -314
- package/test/create-chores.test.mjs +0 -85
- package/test/fake-bd.test.mjs +0 -72
- package/test/fs.test.mjs +0 -76
- package/test/helpers/fake-bd.mjs +0 -87
- package/test/helpers/fake-claude.mjs +0 -152
- package/test/helpers/fake-pi.mjs +0 -132
- package/test/installer.test.mjs +0 -806
- package/test/notify-hook.test.mjs +0 -63
- package/test/pending-gates.test.mjs +0 -147
- package/test/pi-installer.test.mjs +0 -785
- package/test/pi-register.test.mjs +0 -342
- package/test/pi-sweep.test.mjs +0 -619
- package/test/release-gates.test.mjs +0 -190
- package/test/skill-frontmatter.test.mjs +0 -137
- package/test/verify-worker-tree.test.mjs +0 -120
|
@@ -1,117 +0,0 @@
|
|
|
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 | Done (ASCII-only style guide in skill-anatomy.md) |
|
|
114
|
-
| Cross-references between skills | Planned |
|
|
115
|
-
| Consistent skeleton template | Partially adopted |
|
|
116
|
-
|
|
117
|
-
[Inspirations](../inspirations.md)
|
|
@@ -1,24 +0,0 @@
|
|
|
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)
|
|
@@ -1,200 +0,0 @@
|
|
|
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
|
-
Frontmatter is machine-validated: `pnpm lint` runs `check:skills`, which fails on a
|
|
13
|
-
frontmatter block that would make pi silently drop the skill.
|
|
14
|
-
|
|
15
|
-
Optional fields:
|
|
16
|
-
- `argument-hint`: input prompt shown to users at invocation.
|
|
17
|
-
- `disable-model-invocation`: hides the skill from automatic model routing; explicit
|
|
18
|
-
`/skill-name` invocation still works. Set it when the danger is a fuzzy description
|
|
19
|
-
match, e.g. a skill whose steps are destructive. Preserved and honoured by pi and
|
|
20
|
-
Claude Code. See `docs/research/disable-model-invocation.md`.
|
|
21
|
-
|
|
22
|
-
## Description format rules
|
|
23
|
-
|
|
24
|
-
- Target ≤200 characters even though max is 1024.
|
|
25
|
-
- Write in third-person declarative voice.
|
|
26
|
-
- Sentence 1: what the skill does.
|
|
27
|
-
- Sentence 2: starts with `Use when ...`.
|
|
28
|
-
- Include 2-4 natural user trigger phrases (quoted) such as "diagnose this" or "something is broken".
|
|
29
|
-
- Prefer user vocabulary over internal jargon.
|
|
30
|
-
|
|
31
|
-
## Voice and tone rules
|
|
32
|
-
|
|
33
|
-
- Write the body in imperative second-person: "Run X", "Check Y", "Report Z".
|
|
34
|
-
- Use positive framing; reserve "do not" only for hard safety/correctness boundaries.
|
|
35
|
-
- Add one rationale sentence for non-obvious rules so behavior generalizes in novel cases.
|
|
36
|
-
- Avoid ALL-CAPS emphasis.
|
|
37
|
-
|
|
38
|
-
## Tool references
|
|
39
|
-
|
|
40
|
-
Reference agent tools by `{{TOOL:name}}` token (canonical authoring name), never a
|
|
41
|
-
hardcoded harness-specific name such as `bash`, `task`, or `read_agent` — installers
|
|
42
|
-
substitute the per-harness name from `token-map.json` at install time. Add any new tool
|
|
43
|
-
to the map's `tools` section in the same change; unknown tokens are hard errors. See
|
|
44
|
-
`token-map.README.md` for the full authoring rules.
|
|
45
|
-
|
|
46
|
-
## Required sections
|
|
47
|
-
|
|
48
|
-
Every skill must include:
|
|
49
|
-
1. `## When to use`
|
|
50
|
-
2. `## Workflow` (numbered steps)
|
|
51
|
-
3. `## Verification checklist` (`- [ ]` items)
|
|
52
|
-
|
|
53
|
-
## Optional sections
|
|
54
|
-
|
|
55
|
-
For each optional section, define **what it is**, include an **example snippet**, and state **when to include** and **when to omit**.
|
|
56
|
-
|
|
57
|
-
| Section | What it is | Example snippet | When to include | When to omit |
|
|
58
|
-
|---|---|---|---|---|
|
|
59
|
-
| `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 |
|
|
60
|
-
| `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 |
|
|
61
|
-
| `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 |
|
|
62
|
-
| `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 |
|
|
63
|
-
| `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 |
|
|
64
|
-
| `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 |
|
|
65
|
-
| `Examples` | Full worked sample of expected outcome/output | `- Input: ... Output: ...` | Any non-trivial output contract | Trivially self-evident skills |
|
|
66
|
-
| `Workflow diagrams` | Inline ASCII diagram showing step flow and decision points | Fenced block of `[Box]`, `|`, `-`, `>`, `v` arrows, e.g. `[Start] --> [Validate] --> [Run]` | Multi-step or branching workflows where a glanceable flow improves comprehension | Simple linear workflows already clear from numbered steps |
|
|
67
|
-
|
|
68
|
-
## Workflow diagram style guide
|
|
69
|
-
|
|
70
|
-
When a skill includes a workflow diagram, follow these rules so it renders
|
|
71
|
-
reliably in any CLI:
|
|
72
|
-
|
|
73
|
-
- **ASCII only** — never Mermaid, images, or unicode box-drawing characters.
|
|
74
|
-
Keep to `|`, `-`, `>`, `+`, and `v`.
|
|
75
|
-
- **Fenced block** — wrap the diagram in a fenced code block so monospace is
|
|
76
|
-
preserved.
|
|
77
|
-
- **At most 80 characters per line** — narrow enough for terminal-width readers.
|
|
78
|
-
- **Short box labels** — imperative verbs or nouns (e.g. `[Validate scope]`),
|
|
79
|
-
never full sentences.
|
|
80
|
-
- **Read left-to-right, top-down** — prefer one branch level over dense joins.
|
|
81
|
-
- **Mirror the numbered workflow** — the diagram is a glanceable summary of the
|
|
82
|
-
`## Workflow` steps, never a source of truth that contradicts them.
|
|
83
|
-
|
|
84
|
-
## Section ordering
|
|
85
|
-
|
|
86
|
-
### When to use
|
|
87
|
-
|
|
88
|
-
State concrete invocation triggers using natural language phrases users actually type.
|
|
89
|
-
|
|
90
|
-
### When NOT to use
|
|
91
|
-
|
|
92
|
-
Place this section immediately after `When to use` whenever present.
|
|
93
|
-
|
|
94
|
-
### Workflow
|
|
95
|
-
|
|
96
|
-
Provide ordered, deterministic steps with observable outcomes.
|
|
97
|
-
|
|
98
|
-
### Verification checklist
|
|
99
|
-
|
|
100
|
-
Provide completion gates that are testable and stage-scoped.
|
|
101
|
-
|
|
102
|
-
## File layout and progressive disclosure
|
|
103
|
-
|
|
104
|
-
- Target ~150 lines for `SKILL.md`.
|
|
105
|
-
- Split long docs into purpose-named support files:
|
|
106
|
-
- `EXAMPLES.md` for worked examples.
|
|
107
|
-
- `FORMAT.md` for schemas/templates.
|
|
108
|
-
- `REFERENCE.md` for rare edge cases.
|
|
109
|
-
- Use slash-command references when another skill should be invoked.
|
|
110
|
-
|
|
111
|
-
## Acceptance criteria checklist
|
|
112
|
-
|
|
113
|
-
A skill passes anatomy review when:
|
|
114
|
-
- [ ] Front matter uses required fields and valid description format.
|
|
115
|
-
- [ ] Tool references use `{{TOOL:name}}` tokens, not hardcoded tool names.
|
|
116
|
-
- [ ] Required sections exist and follow canonical ordering.
|
|
117
|
-
- [ ] Optional sections (if present) include what/when/example guidance.
|
|
118
|
-
- [ ] Workflow diagrams (if present) are ASCII-only and follow the workflow diagram style guide.
|
|
119
|
-
- [ ] Verification checklist contains concrete, machine-checkable items.
|
|
120
|
-
- [ ] Supporting docs are split by purpose when `SKILL.md` would exceed ~150 lines.
|
|
121
|
-
|
|
122
|
-
## Annotated template
|
|
123
|
-
|
|
124
|
-
```md
|
|
125
|
-
---
|
|
126
|
-
name: skill-name
|
|
127
|
-
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".
|
|
128
|
-
argument-hint: Optional prompt shown to users when extra input is needed.
|
|
129
|
-
disable-model-invocation: false
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
# Skill Name
|
|
133
|
-
|
|
134
|
-
## When to use
|
|
135
|
-
|
|
136
|
-
- Trigger phrases users actually say, e.g. "triage this failure".
|
|
137
|
-
- Include 2-4 concrete patterns.
|
|
138
|
-
|
|
139
|
-
## When NOT to use
|
|
140
|
-
|
|
141
|
-
- Out-of-scope cases that should route elsewhere.
|
|
142
|
-
|
|
143
|
-
## Workflow
|
|
144
|
-
|
|
145
|
-
1. Gather required context and validate scope boundaries.
|
|
146
|
-
2. Reject early with the reason when validation fails; otherwise continue.
|
|
147
|
-
3. Execute deterministic steps in order, recording key decisions.
|
|
148
|
-
4. Produce the required output artifact or terminal response.
|
|
149
|
-
|
|
150
|
-
Workflow at a glance (include only when the flow branches):
|
|
151
|
-
|
|
152
|
-
[Trigger]
|
|
153
|
-
|
|
|
154
|
-
v
|
|
155
|
-
[Gather context]
|
|
156
|
-
|
|
|
157
|
-
v
|
|
158
|
-
[Validate scope] --(invalid)--> [Reject early]
|
|
159
|
-
|
|
|
160
|
-
(valid)
|
|
161
|
-
v
|
|
162
|
-
[Run deterministic steps]
|
|
163
|
-
|
|
|
164
|
-
v
|
|
165
|
-
[Produce output artifact]
|
|
166
|
-
|
|
167
|
-
## Red Flags
|
|
168
|
-
|
|
169
|
-
- Red flag: skipping validation of unknown external input.
|
|
170
|
-
|
|
171
|
-
## Common Rationalizations
|
|
172
|
-
|
|
173
|
-
| Rationalization | Rebuttal |
|
|
174
|
-
|---|---|
|
|
175
|
-
| "This is too small for process" | Process protects against regressions regardless of size. |
|
|
176
|
-
|
|
177
|
-
## Philosophy / rationale
|
|
178
|
-
|
|
179
|
-
- We optimize for explicit boundaries because they reduce rework and improve reliability.
|
|
180
|
-
|
|
181
|
-
## Phase-gate checklist
|
|
182
|
-
|
|
183
|
-
- [ ] Phase 1 complete and baseline checks captured.
|
|
184
|
-
- [ ] Phase 2 complete and contract validation passed.
|
|
185
|
-
|
|
186
|
-
## Cross-skill references
|
|
187
|
-
|
|
188
|
-
- Run `review-security` before committing any externally exposed change.
|
|
189
|
-
|
|
190
|
-
## Examples
|
|
191
|
-
|
|
192
|
-
Input: "Investigate this flaky suite"
|
|
193
|
-
Output: concise root-cause summary, failing tests list, and next action.
|
|
194
|
-
|
|
195
|
-
## Verification checklist
|
|
196
|
-
|
|
197
|
-
- [ ] Output matches requested format.
|
|
198
|
-
- [ ] Required tests/lints were run and results recorded.
|
|
199
|
-
- [ ] No unrelated files were changed.
|
|
200
|
-
```
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# Technical Direction: Harness config and third-party extensions
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
|
|
5
|
-
**Partly superseded (2026-10-24) by the staged-package model** (`agnt-ctx-7kru`). Two premises
|
|
6
|
-
below no longer hold:
|
|
7
|
-
|
|
8
|
-
- **The pi half landed without bundling.** `agent-cortex install pi` stages a self-contained
|
|
9
|
-
package at `~/.agent-cortex/pi` and copies the required third-party packages — resolved
|
|
10
|
-
through Node's own resolution — into that tree's `node_modules/`, instead of declaring
|
|
11
|
-
`bundledDependencies` in the published tarball. pi loads a local directory and resolves no
|
|
12
|
-
npm packages itself, so a tarball's `node_modules/` reached nobody; bundling also forced a
|
|
13
|
-
repo-wide `node-linker=hoisted`, surrendering pnpm's isolated resolution for the workspace.
|
|
14
|
-
- **pi's own settings are no longer installer output.** The installer writes nothing into
|
|
15
|
-
`~/.pi/agent`; it registers the staged package by driving pi's own `pi install` /
|
|
16
|
-
`pi remove` commands, which own `settings.json` → `packages[]`. `pi/settings.json` and
|
|
17
|
-
`pi/keybindings.json` are reference templates. Registration's invariant is **one
|
|
18
|
-
agent-cortex source**: a source pointing at a raw agent-cortex checkout is removed first,
|
|
19
|
-
and one that survives `pi remove` fails the run rather than leave two sources configured
|
|
20
|
-
that both load.
|
|
21
|
-
|
|
22
|
-
`pi.packages` and `lib/pi-packages.mjs` are deleted, so the bespoke-pi-mechanism problem this
|
|
23
|
-
memo was written to settle is closed. The Claude analysis stands; Copilot CLI is no longer a
|
|
24
|
-
deploy target (`agnt-ctx-2rl`).
|
|
25
|
-
|
|
26
|
-
## Problem and target outcome
|
|
27
|
-
|
|
28
|
-
- **What we are solving.** agent-cortex ships agents and skills to two harnesses (pi, Claude
|
|
29
|
-
Code) and needs a declared, reproducible set of *third-party* extensions those agents depend
|
|
30
|
-
on (pi packages / Claude plugins). Two bespoke mechanisms currently exist and
|
|
31
|
-
disagree: `main` declares packages in `package.json` → `pi.packages` and provisions them from
|
|
32
|
-
`lib/pi-packages.mjs`; the unmerged pi-harness epic (`agnt-ctx-dfq3`) declares them in
|
|
33
|
-
`pi.extensions.json` / `claude.extensions.json` and provisions them via `agent-cortex ext
|
|
34
|
-
install`. **Neither file is read by any harness** — both are agent-cortex inventions.
|
|
35
|
-
- **Target outcome.** One idiomatic mechanism per harness: extensions the agents *require* are
|
|
36
|
-
resolved by the harness's native dependency field; extensions that are *optional* are declared
|
|
37
|
-
in the harness's committed settings template. No bespoke manifest format survives.
|
|
38
|
-
- **Why now.** The epic is unmerged and diverging from `main` (7 commits behind), and PR #142
|
|
39
|
-
(`ext prune`) was closed as redundant with the harnesses' own package management. Keeping both
|
|
40
|
-
models means keeping the drift the original idea set out to remove.
|
|
41
|
-
|
|
42
|
-
## Current-state constraints
|
|
43
|
-
|
|
44
|
-
- **Public package.** `publishConfig.access: public`, npm `@jaybeeuu/agent-cortex@1.40.0` — every
|
|
45
|
-
bundled dependency or committed template affects anyone who installs the package, not just the
|
|
46
|
-
author.
|
|
47
|
-
- **pi is idiomatic two ways.** Machine state is `~/.pi/agent/settings.json` → `packages[]`, owned
|
|
48
|
-
by `pi install/remove/list`. A package's own resource declarations live in `package.json` → `pi`
|
|
49
|
-
(`extensions`, `skills`, `prompts`, `themes`); third-party pi packages are depended on via
|
|
50
|
-
`dependencies` + `bundledDependencies` and referenced through `node_modules/…`. **There is no
|
|
51
|
-
`pi.packages` field** — pi ignores it.
|
|
52
|
-
- **Claude is idiomatic two ways.** Machine state is `~/.claude/settings.json` → `enabledPlugins`
|
|
53
|
-
+ `extraKnownMarketplaces`. A plugin declares other plugins in `.claude-plugin/plugin.json` →
|
|
54
|
-
`dependencies`, which Claude Code resolves and auto-installs.
|
|
55
|
-
- **The epic already built two-thirds of the target.** Unmerged commit `afab2c6` (F3) materialises
|
|
56
|
-
`pi/settings.json` + `pi/keybindings.json` from committed templates with merge-keep-personal and
|
|
57
|
-
the CLI owning `packages`; `1ff212d` (F4) makes bundled pi extensions load via package
|
|
58
|
-
registration. Only `1e0e970` (F5, the bespoke manifests) is off-direction.
|
|
59
|
-
- **Unknowns resolved during this memo:** pi bundling is feasible (see Validation plan); Claude
|
|
60
|
-
dependency auto-install is real but cross-marketplace needs an allowlist; Claude currently
|
|
61
|
-
declares **zero** third-party plugins.
|
|
62
|
-
|
|
63
|
-
## Options considered
|
|
64
|
-
|
|
65
|
-
### Option A: one bespoke config per harness
|
|
66
|
-
|
|
67
|
-
- **Approach.** A `config/<harness>.json` (or the epic's `*.extensions.json`) holds settings and
|
|
68
|
-
the extension list; the CLI provisions from it.
|
|
69
|
-
- **Pros.** Uniform across harnesses; full control; explicit single place to look.
|
|
70
|
-
- **Cons.** A third format that neither harness reads; duplicates the native `packages` /
|
|
71
|
-
`enabledPlugins` fields; re-creates the manifest-vs-machine drift the idea exists to remove.
|
|
72
|
-
- **Risks.** The redundancy that made `ext prune` (F6) not worth building.
|
|
73
|
-
|
|
74
|
-
### Option B: native dependency fields + committed settings templates *(recommended)*
|
|
75
|
-
|
|
76
|
-
- **Approach.** Required extensions → `dependencies` + `bundledDependencies` (pi) and
|
|
77
|
-
`.claude-plugin/plugin.json` `dependencies` (Claude). Optional extensions → the harness's own
|
|
78
|
-
committed settings template (`pi/settings.json` `packages`; `claude/settings.json`
|
|
79
|
-
`enabledPlugins` + `extraKnownMarketplaces`), materialised with merge-keep-personal. Drop the
|
|
80
|
-
bespoke manifests, the `ext install`/`ext prune` family, and the separate diff command —
|
|
81
|
-
`agent-cortex install <harness>` reconciles.
|
|
82
|
-
- **Pros.** Idiomatic; no bespoke format; each harness resolves its own required deps; the
|
|
83
|
-
optional list lives in the file the harness already reads, so `pi list` / `claude plugin list
|
|
84
|
-
--json` are the exact machine-state comparison; drift self-heals on install.
|
|
85
|
-
- **Cons.** pi bundling shifts update cadence to agent-cortex releases and grows the tarball;
|
|
86
|
-
Claude cross-marketplace deps need an allowlist; the committed template also carries personal
|
|
87
|
-
settings.
|
|
88
|
-
- **Risks.** Loading TS extensions from bundled `node_modules/`; maintaining the Claude
|
|
89
|
-
cross-marketplace allowlist.
|
|
90
|
-
|
|
91
|
-
### Option C: fully delegate to the harnesses
|
|
92
|
-
|
|
93
|
-
- **Approach.** pi bundles its deps, Claude auto-installs plugin deps, `install` only registers;
|
|
94
|
-
there is no optional layer at all.
|
|
95
|
-
- **Pros.** Least code; no declaration surface to maintain.
|
|
96
|
-
- **Cons.** No way to declare the optional/opt-in personal toolset; the original problem —
|
|
97
|
-
"the toolset isn't reproducible or documented" — goes unsolved for everything not strictly
|
|
98
|
-
required.
|
|
99
|
-
- **Risks.** Silently drops the reproducibility goal.
|
|
100
|
-
|
|
101
|
-
## Recommendation
|
|
102
|
-
|
|
103
|
-
**Option B.** It is the only option that satisfies both halves of the problem: *required*
|
|
104
|
-
extensions resolve through the harness's own mechanism (so an agent's tools can't be missing),
|
|
105
|
-
and *optional* ones stay declared and reproducible without inventing a format the harnesses
|
|
106
|
-
ignore. It also deletes the most code — the two competing bespoke models, `lib/pi-packages.mjs`,
|
|
107
|
-
and the `ext` command family — rather than adding a third.
|
|
108
|
-
|
|
109
|
-
Alternatives were not chosen because: **A** keeps a third format and the drift it causes; **C**
|
|
110
|
-
abandons the declared-toolset goal that started the work.
|
|
111
|
-
|
|
112
|
-
**Concrete disposition:** salvage the epic's F3 (`afab2c6`) and F4 (`1ff212d`) — they *are* the
|
|
113
|
-
settings-template and bundled-dependency mechanisms — drop F5/F6 (`1e0e970` and PR #142), close
|
|
114
|
-
the epic, and delete `pi.packages` + `lib/pi-packages.mjs` from `main`.
|
|
115
|
-
|
|
116
|
-
## Tradeoffs accepted
|
|
117
|
-
|
|
118
|
-
- **pi bundling changes update cadence.** Bundled pi packages are pinned by agent-cortex's
|
|
119
|
-
`package.json` ranges and update when agent-cortex releases, not via `pi update`. Accepted: it
|
|
120
|
-
makes the required toolset a property of agent-cortex rather than of the machine.
|
|
121
|
-
- **Tarball size.** `pi-web-access` pulls 5 runtime deps (readability, linkedom, p-limit, turndown,
|
|
122
|
-
unpdf). Accepted for the required set; the optional set stays provisioned, not bundled.
|
|
123
|
-
- **Claude cross-marketplace allowlist.** If a required Claude plugin lives in another
|
|
124
|
-
marketplace, agent-cortex's `marketplace.json` must list it in
|
|
125
|
-
`allowCrossMarketplaceDependenciesOn`. Accepted; currently moot (zero declared plugins).
|
|
126
|
-
- **Committed personal settings.** `pi/settings.json` already carries models/theme; the template
|
|
127
|
-
model makes the repo own the whole pi settings surface. Accepted; F3's merge preserves personal
|
|
128
|
-
keys and only `packages` is CLI-owned.
|
|
129
|
-
- **No dedicated diff command.** A read-only `status` is deferred until drift is shown to hurt.
|
|
130
|
-
|
|
131
|
-
## Validation plan
|
|
132
|
-
|
|
133
|
-
Run before implementation (three already run during this memo):
|
|
134
|
-
|
|
135
|
-
1. **Can `pi-questions` / `pi-web-access` be bundled and load from `node_modules/`?** ✅ *Ran.*
|
|
136
|
-
`pi-questions@0.3.4` is a single extension file with no deps or install-time state;
|
|
137
|
-
`pi-web-access@0.10.7` is an extension + skills with 5 runtime deps. Both are conventional pi
|
|
138
|
-
packages — bundling is feasible. Success signal: a scratch package depending on both loads
|
|
139
|
-
`ask_questions` / `fetch_content` in a fresh pi session.
|
|
140
|
-
2. **Does Claude's `plugin.json` `dependencies` auto-install from agent-cortex's marketplace?**
|
|
141
|
-
✅ *Ran.* Yes, but cross-marketplace deps require `allowCrossMarketplaceDependenciesOn` in the
|
|
142
|
-
root `marketplace.json`, and version constraints need `{plugin-name}--v{version}` git tags.
|
|
143
|
-
3. **Does F3 reconcile `packages` when the template drops one?** ✅ *Ran.* Yes — the CLI owns
|
|
144
|
-
`packages` outright, so removing an entry from the template removes it on next install. The
|
|
145
|
-
documented limitation is the reverse (ad-hoc `pi install` entries don't persist), which is
|
|
146
|
-
intended.
|
|
147
|
-
|
|
148
|
-
Still to run before shipping: a scratch end-to-end install on a clean `HOME` proving a required
|
|
149
|
-
pi extension loads from `node_modules/` and an optional one is materialised from the template.
|
|
150
|
-
|
|
151
|
-
## Revisit triggers
|
|
152
|
-
|
|
153
|
-
- pi or Claude ship a first-class *optional* dependency field, making the settings template
|
|
154
|
-
unnecessary.
|
|
155
|
-
- Claude still declares zero third-party plugins after the migration — then Claude parity is
|
|
156
|
-
speculative and should be dropped rather than maintained.
|
|
157
|
-
- Bundling `pi-web-access`'s native-ish dependency tree (unpdf, linkedom) proves brittle or
|
|
158
|
-
unacceptable on a fresh machine.
|
|
159
|
-
- Drift between the committed template and the machine becomes a recurring annoyance — add the
|
|
160
|
-
deferred read-only `status`.
|
|
161
|
-
|
|
162
|
-
## References
|
|
163
|
-
|
|
164
|
-
- pi docs, *Settings* and *Packages* (installed at
|
|
165
|
-
`…/@earendil-works/pi-coding-agent@0.85.1/docs/settings.md`, `…/docs/packages.md`): `packages`
|
|
166
|
-
array is the machine store; the `pi` manifest keys are `extensions`/`skills`/`prompts`/`themes`;
|
|
167
|
-
other pi packages are bundled and referenced through `node_modules/`.
|
|
168
|
-
- Claude Code, *Constrain plugin dependency versions* — https://code.claude.com/docs/en/plugin-dependencies
|
|
169
|
-
(auto-install, cross-marketplace allowlist, tag naming).
|
|
170
|
-
- Claude Code, *Settings* — https://code.claude.com/docs/en/settings (`enabledPlugins`,
|
|
171
|
-
`extraKnownMarketplaces`).
|
|
172
|
-
- Code evidence (as of 2026-09 — `pi.packages` and `lib/pi-packages.mjs` were removed in
|
|
173
|
-
`agnt-ctx-7kru.1`, see Status): `package.json` (`pi.packages`), `lib/pi-packages.mjs` (main's
|
|
174
|
-
provisioner);
|
|
175
|
-
`pi.extensions.json`, `claude.extensions.json`, `lib/extension-manifest.mjs` (epic F5, `1e0e970`);
|
|
176
|
-
`bin/installers/pi.mjs` settings materialisation (epic F3, `afab2c6`);
|
|
177
|
-
`docs/ideas/extension-manifests.md` (the originating idea).
|