@jaybeeuu/agent-cortex 1.37.1 → 1.39.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/.agents/skills/style-versioning/SKILL.md +9 -8
- package/.github/workflows/ci.yml +190 -8
- package/AGENTS.md +27 -6
- package/CHANGELOG.md +72 -0
- package/README.md +156 -39
- package/agents/README.md +49 -13
- package/agents/plan/agent.md +51 -0
- package/agents/plan/claude/frontmatter.json +6 -0
- package/agents/plan/copilot/frontmatter.json +6 -0
- package/agents/plan/pi/frontmatter.json +6 -0
- package/agents/plan.agent.md +3 -0
- package/agents/ralph/agent.md +262 -0
- package/agents/ralph/claude/frontmatter.json +6 -0
- package/agents/ralph/claude/polling.md +31 -0
- package/agents/ralph/copilot/frontmatter.json +6 -0
- package/agents/ralph/copilot/polling.md +62 -0
- package/agents/ralph/pi/frontmatter.json +6 -0
- package/agents/ralph/pi/polling.md +74 -0
- package/agents/ralph-plan/agent.md +114 -0
- package/agents/ralph-plan/claude/frontmatter.json +6 -0
- package/agents/ralph-plan/copilot/frontmatter.json +6 -0
- package/agents/ralph-plan/pi/frontmatter.json +6 -0
- package/agents/ralph-plan.agent.md +6 -3
- package/agents/ralph.agent.md +83 -57
- package/agents/strategy/agent.md +104 -0
- package/agents/strategy/claude/frontmatter.json +6 -0
- package/agents/strategy/copilot/frontmatter.json +6 -0
- package/agents/strategy/pi/frontmatter.json +6 -0
- package/agents/strategy.agent.md +3 -0
- package/bin/agent-cortex.mjs +76 -1
- package/bin/installers/claude.mjs +376 -0
- package/bin/installers/copilot.mjs +129 -0
- package/bin/installers/pi.mjs +197 -0
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/agents/plan.md +3 -1
- package/claude/agents/ralph-plan.md +6 -4
- package/claude/agents/strategy.md +3 -1
- package/claude/hooks/scripts/notify.mjs +54 -0
- package/claude/hooks.json +15 -0
- package/docs/claude-hooks.md +115 -0
- package/docs/ideas/auto-model-selection.md +75 -0
- package/docs/ideas/extension-manifests.md +75 -0
- package/docs/ideas/improve-pi-system-prompt.md +34 -0
- package/docs/ideas/model-selector.md +40 -0
- package/docs/ideas/pi-task-memory.md +34 -0
- package/docs/ideas/qa-extension.md +43 -0
- package/docs/ideas/record-ideas-as-beads.md +115 -0
- package/docs/ideas/subagent-visibility.md +72 -0
- package/docs/ideas/task-session-context.md +89 -0
- package/docs/ideas/unified-ci-pipeline.md +28 -0
- package/docs/research/skill-design-research.md +4 -4
- package/docs/research/skill-improvements-analysis.md +1 -1
- package/docs/skills/skill-anatomy.md +47 -2
- package/docs/technical-direction/migration-execution-labels.md +132 -0
- package/extensions/agent-modes/README.md +54 -0
- package/extensions/agent-modes/discover.test.ts +241 -0
- package/extensions/agent-modes/discover.ts +458 -0
- package/extensions/agent-modes/index.ts +13 -224
- package/extensions/agent-modes/node_modules/.bin/pi +21 -0
- package/extensions/agent-modes/node_modules/.bin/tsc +21 -0
- package/extensions/agent-modes/node_modules/.bin/tsserver +21 -0
- package/extensions/agent-modes/node_modules/.bin/tsx +21 -0
- package/extensions/agent-modes/package.json +20 -0
- package/extensions/agent-modes/tsconfig.json +12 -0
- package/extensions/subagent/README.md +19 -0
- package/extensions/subagent/index.ts +131 -45
- package/extensions/subagent/node_modules/.bin/pi +21 -0
- package/extensions/subagent/node_modules/.bin/pi-ai +21 -0
- package/extensions/subagent/node_modules/.bin/tsc +21 -0
- package/extensions/subagent/node_modules/.bin/tsserver +21 -0
- package/extensions/subagent/node_modules/.bin/tsx +21 -0
- package/extensions/subagent/package.json +23 -0
- package/extensions/subagent/tsconfig.json +12 -0
- package/extensions/subagent/wait.test.ts +202 -0
- package/extensions/subagent/wait.ts +118 -0
- package/hooks/claude/hooks.json +38 -0
- package/hooks/claude/scripts/notify.mjs +54 -0
- package/lib/cli.mjs +68 -3
- package/package.json +6 -4
- package/plugin.json +1 -1
- package/pnpm-workspace.yaml +1 -1
- package/scripts/build-copilot-agents.mjs +30 -0
- package/scripts/lib/compose-agent.mjs +241 -0
- package/skills/engineering/design-an-interface/SKILL.md +78 -58
- package/skills/engineering/grill-with-docs/REFERENCE.md +78 -0
- package/skills/engineering/grill-with-docs/SKILL.md +66 -63
- package/skills/engineering/improve-codebase-architecture/SKILL.md +66 -48
- package/skills/engineering/technical-direction/FORMAT.md +38 -0
- package/skills/engineering/technical-direction/SKILL.md +70 -77
- package/skills/planning/classify-bead/SKILL.md +59 -35
- package/skills/planning/create-task/REFERENCE.md +40 -0
- package/skills/planning/create-task/SKILL.md +70 -66
- package/skills/planning/create-task/scripts/create-chores.ts +6 -1
- package/skills/planning/create-task/scripts/node_modules/.bin/tsc +21 -0
- package/skills/planning/create-task/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/planning/create-task/scripts/node_modules/.bin/tsx +21 -0
- package/skills/planning/prd-to-tasks/REFERENCE.md +66 -0
- package/skills/planning/prd-to-tasks/SKILL.md +86 -170
- package/skills/planning/record-idea/FORMAT.md +44 -0
- package/skills/planning/record-idea/SKILL.md +70 -53
- package/skills/planning/request-refactor-plan/FORMAT.md +45 -0
- package/skills/planning/request-refactor-plan/SKILL.md +57 -46
- package/skills/planning/write-a-prd/FORMAT.md +54 -0
- package/skills/planning/write-a-prd/SKILL.md +49 -48
- package/skills/planning/write-a-ticket/SKILL.md +68 -53
- package/skills/productivity/handoff/SKILL.md +12 -0
- package/skills/productivity/init-beads/SKILL.md +48 -40
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsc +21 -0
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsx +21 -0
- package/skills/productivity/write-a-skill/SKILL.md +2 -1
- package/skills/review/maintain-agent-docs/SKILL.md +71 -51
- package/skills/workflow/hitl-collab/SKILL.md +86 -17
- package/skills/workflow/ralph/REFERENCE.md +24 -19
- package/skills/workflow/ralph/SKILL.md +88 -74
- package/skills/workflow/run-pipeline-stage/REFERENCE.md +22 -0
- package/skills/workflow/run-pipeline-stage/SKILL.md +91 -93
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +6 -107
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +4 -2
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsc +21 -0
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsserver +21 -0
- package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsx +21 -0
- package/skills/workflow/using-agent-skills/SKILL.md +122 -0
- package/test/claude-installer.test.mjs +248 -0
- package/test/cli.test.mjs +115 -2
- package/test/copilot-installer.test.mjs +298 -0
- package/test/installer.test.mjs +179 -0
- package/test/notify-hook.test.mjs +63 -0
- package/test/pi-installer.test.mjs +371 -0
- package/token-map.README.md +130 -0
- package/token-map.json +106 -0
- package/.github/workflows/ci.test.ts +0 -217
- package/.github/workflows/release.yml +0 -58
- package/scripts/build-claude-agents.mjs +0 -179
- package/scripts/publish-release.sh +0 -32
|
@@ -1,88 +1,91 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: grill-with-docs
|
|
3
|
-
description: Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
|
|
3
|
+
description: Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when the user wants to stress-test a plan against their project's language and documented decisions: "grill my plan", "check this against our docs".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Grill With Docs
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## When to use
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- The user wants to stress-test a plan against the project's existing language: "grill my plan", "grill me on this design".
|
|
11
|
+
- Domain terms are fuzzy or drifting and you need to pin them against `CONTEXT.md`.
|
|
12
|
+
- A decision needs recording as an ADR before the design moves on.
|
|
13
|
+
- Invoked by `ralph-plan` when the domain language is unclear or inconsistent.
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
## When NOT to use
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
- Grilling a plan with no documentation dimension — use `grill-me` for a pure design interview.
|
|
18
|
+
- Deciding architecture or technology trade-offs — use `technical-direction` for a justified recommendation.
|
|
19
|
+
- Writing project docs without an interview; this skill extracts language from the user, it does not generate it.
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
## Workflow
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
1. **Load the domain model.** Locate and read `CONTEXT.md` (single context) or `CONTEXT-MAP.md` (multi-context; the map points to each context's glossary and `docs/adr/`). Read existing ADRs so you question from the project's actual vocabulary. If neither file exists, you are starting a fresh glossary.
|
|
24
|
+
2. **Grill one question at a time.** State the decision branch, give your recommended answer, and wait for feedback before continuing. If a question can be answered by exploring the codebase, explore instead of asking.
|
|
25
|
+
3. **Challenge against the glossary.** When a term conflicts with `CONTEXT.md`, call it out immediately: "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?" When the user uses vague or overloaded terms, propose a precise canonical term.
|
|
26
|
+
4. **Stress-test with concrete scenarios.** Probe domain relationships with invented edge cases that force precision about concept boundaries.
|
|
27
|
+
5. **Cross-reference with code.** When the user states how something works, check whether the code agrees. Surface contradictions the moment you find them.
|
|
28
|
+
6. **Update `CONTEXT.md` inline.** When a term resolves, write the entry right there — do not batch. Keep it a pure glossary: no implementation details, no specs, no scratch notes. Entry format and file-discovery rules live in `REFERENCE.md`.
|
|
29
|
+
7. **Offer ADRs sparingly.** Propose an ADR only when all three hold: hard to reverse, surprising without context, and the result of a real trade-off. If any is missing, skip it. ADR format lives in `REFERENCE.md`.
|
|
30
|
+
8. **Close when shared understanding is reached.** Confirm every design-tree branch is resolved or explicitly deferred, and that the glossary diff captures the session's new language.
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
## Red Flags
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
- **Batching questions** — asking several at once lets the user answer the easy ones while the hard branch dies silently.
|
|
35
|
+
- **Drifting into generic design Q&A** — every question must anchor in the domain model, not general software opinion.
|
|
36
|
+
- **Deferring `CONTEXT.md` writes** — "I'll write it up later" loses the precision of the moment; terms resolved in context get reinterpreted from memory.
|
|
37
|
+
- **Stuffing implementation detail into `CONTEXT.md`** — it is a glossary; specs and scratch notes belong elsewhere.
|
|
38
|
+
- **Offering ADRs on autopilot** — an ADR for an easily-reversed choice bloats the log and buries the real decisions.
|
|
23
39
|
|
|
24
|
-
|
|
40
|
+
## Common Rationalizations
|
|
25
41
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
│ └── 0002-postgres-for-write-model.md
|
|
33
|
-
└── src/
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
/
|
|
40
|
-
├── CONTEXT-MAP.md
|
|
41
|
-
├── docs/
|
|
42
|
-
│ └── adr/ ← system-wide decisions
|
|
43
|
-
├── src/
|
|
44
|
-
│ ├── ordering/
|
|
45
|
-
│ │ ├── CONTEXT.md
|
|
46
|
-
│ │ └── docs/adr/ ← context-specific decisions
|
|
47
|
-
│ └── billing/
|
|
48
|
-
│ ├── CONTEXT.md
|
|
49
|
-
│ └── docs/adr/
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
|
|
53
|
-
|
|
54
|
-
## During the session
|
|
55
|
-
|
|
56
|
-
### Challenge against the glossary
|
|
42
|
+
| Rationalization | Rebuttal |
|
|
43
|
+
|---|---|
|
|
44
|
+
| "I'll ask three questions at once to save a round trip" | Branches depend on each other's answers; batching forces guesswork. |
|
|
45
|
+
| "We both know what this term means — no need to write it" | If you won't write it down, it isn't resolved; unwritten terms get relitigated. |
|
|
46
|
+
| "This decision feels important, let me write an ADR" | Only hard-to-reverse, surprising, real-trade-off decisions earn an ADR. |
|
|
47
|
+
| "The code contradicts you, but I'll note it later" | The contradiction changes the next answer — surface it now. |
|
|
57
48
|
|
|
58
|
-
|
|
49
|
+
## Philosophy / rationale
|
|
59
50
|
|
|
60
|
-
|
|
51
|
+
- **One question at a time, with a recommended answer** — every exchange settles a branch instead of opening several, so shared understanding accumulates.
|
|
52
|
+
- **Capture inline, not batched** — decisions recorded in context are precise; decisions reconstructed from memory drift.
|
|
53
|
+
- **`CONTEXT.md` is a glossary and nothing else** — the vocabulary stays stable while the design churns around it.
|
|
54
|
+
- **ADRs are rare** — the three criteria keep the ADR log a history of decisions, not a diary.
|
|
61
55
|
|
|
62
|
-
|
|
56
|
+
## Cross-skill references
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
| When you need… | Use |
|
|
59
|
+
|---|---|
|
|
60
|
+
| A design interview without touching project docs | `grill-me` |
|
|
61
|
+
| A justified recommendation on architecture or technology | `technical-direction` |
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
## Examples
|
|
67
64
|
|
|
68
|
-
|
|
65
|
+
**Sharpening a fuzzy term**
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
`CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
|
|
77
|
-
|
|
78
|
-
### Offer ADRs sparingly
|
|
67
|
+
```
|
|
68
|
+
User: "So cancelled orders can still ship."
|
|
69
|
+
You: "CONTEXT.md defines cancellation as 'void before fulfilment begins'.
|
|
70
|
+
What you describe is reversing after shipping — that's a refund. Which is it?"
|
|
71
|
+
User: "A refund."
|
|
72
|
+
```
|
|
79
73
|
|
|
80
|
-
|
|
74
|
+
Entry appended to CONTEXT.md the moment it resolves:
|
|
81
75
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
```
|
|
77
|
+
# refund
|
|
78
|
+
Reversal of an order after fulfilment has begun. Distinct from cancellation,
|
|
79
|
+
which voids an order before fulfilment. See cancellation.
|
|
80
|
+
```
|
|
85
81
|
|
|
86
|
-
|
|
82
|
+
## Verification checklist
|
|
87
83
|
|
|
88
|
-
|
|
84
|
+
- [ ] Questions asked one at a time, each with a recommended answer
|
|
85
|
+
- [ ] Every question answerable by code was explored in the codebase instead
|
|
86
|
+
- [ ] Each resolved term written to `CONTEXT.md` during the session — none batched at the end
|
|
87
|
+
- [ ] `CONTEXT.md` holds only glossary entries — no implementation detail, specs, or scratch notes
|
|
88
|
+
- [ ] Terminology conflicts and vague terms called out the moment they appeared
|
|
89
|
+
- [ ] Claims cross-referenced against code; contradictions surfaced
|
|
90
|
+
- [ ] ADRs offered only when all three criteria held (offering none is a valid outcome)
|
|
91
|
+
- [ ] All design-tree branches resolved or explicitly deferred before closing
|
|
@@ -1,81 +1,99 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: improve-codebase-architecture
|
|
3
|
-
description: Explore a codebase to
|
|
3
|
+
description: Explore a codebase to surface architectural friction and turn it into module-deepening refactors that improve testability and AI-navigability. Use when the user wants to improve the architecture, find refactoring opportunities, consolidate tightly-coupled modules, or says a codebase is hard to navigate.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Improve Codebase Architecture
|
|
7
7
|
|
|
8
|
-
Explore a codebase
|
|
8
|
+
Explore a codebase the way an AI would, surface where understanding requires bouncing between many small files, and propose module-deepening refactors as executable beads.
|
|
9
9
|
|
|
10
|
-
A **deep module** (John Ousterhout, "A Philosophy of Software Design") has a small interface hiding a large implementation. Deep modules are more testable, more AI-navigable, and
|
|
10
|
+
A **deep module** (John Ousterhout, "A Philosophy of Software Design") has a small interface hiding a large implementation. Deep modules are more testable, more AI-navigable, and testable at the boundary instead of inside the seams.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## When to use
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- The user wants to improve the architecture or find refactoring opportunities.
|
|
15
|
+
- The user asks to consolidate tightly-coupled modules or "make this more testable".
|
|
16
|
+
- The user says a codebase is "hard to navigate" or hard for AI to work with.
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
## When NOT to use
|
|
17
19
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- Which parts of the codebase are untested, or hard to test?
|
|
20
|
+
- The refactor target is decided and only an implementation plan is missing — run `request-refactor-plan` instead.
|
|
21
|
+
- The task is comparing two specific options with trade-offs — run `technical-direction` instead.
|
|
22
|
+
- The user wants interface shapes for one known module — run `design-an-interface` instead.
|
|
23
|
+
- The work is a new feature needing scoping — run `plan` or `write-a-prd` instead.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
## Workflow
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
1. **Explore the codebase.** Navigate with {{TOOL:bash}}, {{TOOL:rg}}, {{TOOL:view}}, and {{TOOL:glob}}, and note where you experience friction: concepts spread across many small files, interfaces nearly as complex as their implementations, pure functions extracted for testability while bugs hide in their call sites, tight coupling creating integration risk, or untested hard-to-test areas. The friction you encounter is the signal — record it as you go.
|
|
27
28
|
|
|
28
|
-
Present a numbered list of deepening opportunities. For each
|
|
29
|
+
2. **Present candidates.** Give a numbered list of deepening opportunities. For each, show the cluster of modules involved, why they are coupled (shared types, call patterns, co-ownership of a concept), the dependency category (see [REFERENCE.md](REFERENCE.md)), and the test impact. Do not propose interfaces yet — ask "Which of these would you like to explore?"
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
- **Why they're coupled**: Shared types, call patterns, co-ownership of a concept
|
|
32
|
-
- **Dependency category**: See [REFERENCE.md](REFERENCE.md) for the four categories
|
|
33
|
-
- **Test impact**: What existing tests would be replaced by boundary tests
|
|
31
|
+
3. **User picks a candidate.**
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
4. **Frame the problem space.** Before designing anything, write a user-facing frame for the chosen candidate: the constraints any new interface must satisfy, the dependencies it must rely on, and a rough illustrative code sketch. A sketch is not a proposal — it grounds the constraints. Show the frame and proceed immediately; the user reads it while you design.
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
5. **Design multiple interfaces.** Cycle through radically different constraints, writing each design out fully before the next:
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
1. **Minimal** — aim for 1-3 entry points; what complexity hides behind a small surface?
|
|
38
|
+
2. **Flexible** — open for future use cases and extension.
|
|
39
|
+
3. **Caller-optimised** — make the most common calling pattern trivial.
|
|
40
|
+
4. **Ports & adapters** (if cross-boundary deps) — isolate side effects from pure logic.
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
For each design, output the interface signature, a usage example, the complexity it hides, the dependency strategy (see [REFERENCE.md](REFERENCE.md)), and its trade-offs. Present designs sequentially, then compare them in prose and give your own recommendation — propose a hybrid where elements combine well. The user wants a strong read, not a menu.
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
- The dependencies it would need to rely on
|
|
45
|
-
- A rough illustrative code sketch to make the constraints concrete — this is not a proposal, just a way to ground the constraints
|
|
44
|
+
6. **User picks an interface** (or accepts the recommendation).
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
7. **Create the refactor bead.** Run the `create-task` skill with a concise title, the description from the template in [REFERENCE.md](REFERENCE.md), and priority P2. Always use `create-task` — never `bd create` directly — because it classifies the bead and expands AFK work into pipeline stages ralph can execute. Do not ask the user to review before creating; share the bead ID.
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
## Red Flags
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
- Red flag: proposing an interface during candidate presentation — it biases which problem space the user picks.
|
|
51
|
+
- Red flag: skipping the problem-space frame to save a step — designs without stated constraints drift.
|
|
52
|
+
- Red flag: designing a single interface — the first design is rarely the strongest ("Design It Twice").
|
|
53
|
+
- Red flag: filing the bead with `bd create` instead of `create-task` — the pipeline expansion is skipped.
|
|
54
|
+
- Red flag: judging designs by implementation effort — a deeper interface often looks harder to build.
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
2. **Flexible interface** — support many use cases and extension. How do you make it open for future needs?
|
|
55
|
-
3. **Caller-optimised** — make the most common calling pattern trivial. What does the primary caller look like?
|
|
56
|
-
4. **Ports & adapters** (if cross-boundary deps) — isolate side effects from pure logic.
|
|
56
|
+
## Common Rationalizations
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
| Rationalization | Rebuttal |
|
|
59
|
+
|---|---|
|
|
60
|
+
| "I already know the best interface" | The first design is rarely the best. Generating alternatives is where the comparison insight comes from. |
|
|
61
|
+
| "The candidates are obvious — list them quickly" | The presentation is what lets the user pick deliberately; short-circuiting it forces a guess. |
|
|
62
|
+
| "The problem space is clear enough — skip the frame" | An unframed design session produces interfaces that satisfy imagined constraints. |
|
|
63
|
+
| "It's one task — `bd create` is fine" | `create-task` classifies the bead and expands pipeline stages; bypassing it strands the work for ralph. |
|
|
59
64
|
|
|
60
|
-
|
|
61
|
-
2. Usage example showing how callers use it
|
|
62
|
-
3. What complexity it hides internally
|
|
63
|
-
4. Dependency strategy (how deps are handled — see [REFERENCE.md](REFERENCE.md))
|
|
64
|
-
5. Trade-offs
|
|
65
|
+
## Philosophy / rationale
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
- **Deep modules beat shallow ones.** A small interface hiding real complexity is easier to learn, test, and navigate; a shallow module forces callers to know as much as the implementation does.
|
|
68
|
+
- **An AI's navigation friction is the signal.** Wherever exploration requires bouncing between files, a missing seam or a shallow module is hiding — the explorer's pain maps directly to where a deep module is needed.
|
|
69
|
+
- **Replace, don't layer tests.** Once boundary tests exist at the deepened interface, the old shallow-module tests are waste — tests should assert observable outcomes through the public interface, not internal state.
|
|
70
|
+
- **Candidate-first, interface-later.** Interfaces proposed before the user picks a problem space pre-commit the exploration to a shape they did not choose.
|
|
67
71
|
|
|
68
|
-
|
|
72
|
+
## Phase-gate checklists
|
|
69
73
|
|
|
70
|
-
|
|
74
|
+
- [ ] Phase 1 complete: exploration done and candidates presented without proposing interfaces
|
|
75
|
+
- [ ] Phase 2 complete: problem space framed and shown to the user before any design work
|
|
76
|
+
- [ ] Phase 3 complete: at least two radically different designs presented and compared, with a recommendation given
|
|
77
|
+
- [ ] Phase 4 complete: refactor bead created via `create-task` and the bead ID reported
|
|
71
78
|
|
|
72
|
-
|
|
79
|
+
## Cross-skill references
|
|
73
80
|
|
|
74
|
-
|
|
81
|
+
- Run `design-an-interface` at step 5 for a guided parallel sub-agent design flow.
|
|
82
|
+
- Run `create-task` at step 7 to file the refactor bead.
|
|
83
|
+
- Run `grill-with-docs` when the deepened module's terminology is unsettled — interface names should match the ubiquitous language.
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
- **title**: a concise name for the refactor
|
|
78
|
-
- **description**: the bead body using the template in [REFERENCE.md](REFERENCE.md)
|
|
79
|
-
- **priority**: P2
|
|
85
|
+
## Examples
|
|
80
86
|
|
|
81
|
-
|
|
87
|
+
Input: "This codebase is hard to navigate — can you make it more testable?"
|
|
88
|
+
Output: numbered deepening candidates (cluster, coupling, dependency category, test impact) → chosen candidate → problem-space frame → at least two interface designs with a recommendation → a P2 refactor bead ID from `create-task`, with the bead description following the template in [REFERENCE.md](REFERENCE.md).
|
|
89
|
+
|
|
90
|
+
## Verification checklist
|
|
91
|
+
|
|
92
|
+
- [ ] Friction notes recorded during exploration
|
|
93
|
+
- [ ] Candidates presented with cluster, coupling, dependency category, and test impact — no interfaces proposed
|
|
94
|
+
- [ ] Problem-space frame shown to the user before any design work
|
|
95
|
+
- [ ] At least two radically different designs, each with signature, usage example, hidden complexity, dependency strategy, and trade-offs
|
|
96
|
+
- [ ] Recommendation given in prose, with a hybrid proposed where elements combine well
|
|
97
|
+
- [ ] Refactor bead created via `create-task` at P2 using the REFERENCE.md description template
|
|
98
|
+
- [ ] Bead ID reported and no review gate imposed before creation
|
|
99
|
+
- [ ] No unrelated areas explored or refactors proposed outside the chosen candidate
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Decision Memo Format
|
|
2
|
+
|
|
3
|
+
The decision memo is the deliverable of `technical-direction`. Save it as `docs/technical-direction/<feature-slug>.md`:
|
|
4
|
+
|
|
5
|
+
```md
|
|
6
|
+
# Technical Direction: <Feature Name>
|
|
7
|
+
## Problem and target outcome
|
|
8
|
+
- What we are solving
|
|
9
|
+
- Why this matters now
|
|
10
|
+
## Current-state constraints
|
|
11
|
+
- Architecture and integration constraints
|
|
12
|
+
- Team/runtime/operational constraints
|
|
13
|
+
- Unknowns and assumptions
|
|
14
|
+
## Options considered
|
|
15
|
+
### Option A: <name>
|
|
16
|
+
- Approach
|
|
17
|
+
- Pros
|
|
18
|
+
- Cons
|
|
19
|
+
- Risks
|
|
20
|
+
### Option B: <name>
|
|
21
|
+
...
|
|
22
|
+
### Option C: <name>
|
|
23
|
+
...
|
|
24
|
+
## Recommendation
|
|
25
|
+
- Chosen approach
|
|
26
|
+
- Why this is best under current constraints
|
|
27
|
+
- Why alternatives were not selected
|
|
28
|
+
## Tradeoffs accepted
|
|
29
|
+
- Explicit compromises and consequences
|
|
30
|
+
## Validation plan
|
|
31
|
+
- Fastest experiments/spikes to de-risk decision
|
|
32
|
+
- Success/failure signals
|
|
33
|
+
## Revisit triggers
|
|
34
|
+
- Conditions that should force re-evaluation
|
|
35
|
+
## References
|
|
36
|
+
- Web sources used for decisions (title + URL)
|
|
37
|
+
- Code evidence links (repo path + line range, and permalink URL when available)
|
|
38
|
+
```
|
|
@@ -1,86 +1,79 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: technical-direction
|
|
3
|
-
description:
|
|
3
|
+
description: Challenge assumptions, map constraints, compare options, and justify the choice. Use when deciding technical direction, choosing architecture or technology, or designing a solution with tradeoffs.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Technical Direction
|
|
7
7
|
|
|
8
|
-
Act
|
|
8
|
+
Act as a pragmatic, challenging staff engineer: constructive, direct, and evidence-driven. The deliverable is a justified recommendation, not consensus.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- "Decide technical direction" for a change with real architectural weight.
|
|
13
|
+
- Evaluating architecture or technology choices that carry tradeoffs.
|
|
14
|
+
- A PRD or brief is approved and the solution shape is still open.
|
|
15
|
+
- "Design a solution" where alternatives need mapping and comparison before picking one.
|
|
16
|
+
|
|
17
|
+
## When NOT to use
|
|
18
|
+
|
|
19
|
+
- Stress-testing an existing plan or sharpening domain language — use `grill-with-docs`.
|
|
20
|
+
- Scoping a feature into PRD and tasks — use `plan` before direction makes sense.
|
|
21
|
+
- Exploring a codebase for refactoring opportunities — use `improve-codebase-architecture`.
|
|
22
|
+
- Reversible decisions with no meaningful tradeoffs — a memo costs more than it saves.
|
|
9
23
|
|
|
10
24
|
## Workflow
|
|
11
25
|
|
|
12
|
-
1. **Anchor on problem context
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
- Why alternatives were not selected
|
|
67
|
-
## Tradeoffs accepted
|
|
68
|
-
- Explicit compromises and consequences
|
|
69
|
-
## Validation plan
|
|
70
|
-
- Fastest experiments/spikes to de-risk decision
|
|
71
|
-
- Success/failure signals
|
|
72
|
-
## Revisit triggers
|
|
73
|
-
- Conditions that should force re-evaluation
|
|
74
|
-
## References
|
|
75
|
-
- Web sources used for decisions (title + URL)
|
|
76
|
-
- Code evidence links (repo path + line range, and permalink URL when available)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Rules
|
|
80
|
-
|
|
81
|
-
- Ask questions one at a time.
|
|
82
|
-
- If the answer exists in the codebase, investigate before asking.
|
|
83
|
-
- Be challenging but collaborative; do not optimize for agreement.
|
|
84
|
-
- Avoid premature implementation details until direction is selected.
|
|
85
|
-
- Every recommendation must include explicit constraints and tradeoffs.
|
|
86
|
-
- When web or code sources materially inform decisions, include them in `## References`.
|
|
26
|
+
1. **Anchor on problem context.** Start from the PRD or user brief. Confirm goals, non-goals, and the decision horizon (how long this choice must hold).
|
|
27
|
+
2. **Discover constraints from the codebase first.** Investigate architecture, existing interfaces, deployment and runtime constraints, data-model boundaries, and team conventions using {{TOOL:rg}}, {{TOOL:view}}, and {{TOOL:glob}}. Record unknowns and risks explicitly.
|
|
28
|
+
3. **Run the challenge loop, one question at a time.** Ask focused, high-leverage questions. Challenge vague claims and hidden assumptions; require explicit justification for each major decision. Keep drilling until constraints and tradeoffs are concrete. If an answer exists in the codebase, find it before asking.
|
|
29
|
+
4. **Generate options.** Always include Option A (extend the current approach), Option B (moderate architectural shift), and Option C (a stronger alternative using new tech or patterns). Evaluate each on feasibility, complexity, migration cost, operational impact, testability, performance, and failure modes.
|
|
30
|
+
5. **Use web research when the codebase is insufficient.** Do this autonomously for high-impact decisions needing external comparison. Prefer authoritative sources (official docs, maintainers, widely adopted production guidance) via {{TOOL:web_fetch}}; bring findings back as tradeoffs with source links.
|
|
31
|
+
6. **Converge on a recommendation.** Select the best-fit option under current constraints. Explain explicitly why each alternative was not chosen. List decision triggers that would justify revisiting.
|
|
32
|
+
7. **Write the decision memo.** Ensure `docs/technical-direction/` exists and save `docs/technical-direction/<feature-slug>.md` using the template in [FORMAT.md](FORMAT.md).
|
|
33
|
+
|
|
34
|
+
## Red Flags
|
|
35
|
+
|
|
36
|
+
- Red flag: proposing options before constraints are mapped — alternatives become uncomparable.
|
|
37
|
+
- Red flag: asking a question the codebase can answer without looking first.
|
|
38
|
+
- Red flag: optimising for agreement instead of surfacing hard tradeoffs.
|
|
39
|
+
- Red flag: recommending direction without stated tradeoffs, revisit triggers, or validation signals.
|
|
40
|
+
- Red flag: sliding into premature implementation details before direction is selected.
|
|
41
|
+
|
|
42
|
+
## Common Rationalizations
|
|
43
|
+
|
|
44
|
+
| Rationalization | Rebuttal |
|
|
45
|
+
|---|---|
|
|
46
|
+
| "We already know the answer" | Stated answers often rest on unstated assumptions. Test the recommendation against the constraints before accepting it. |
|
|
47
|
+
| "The tradeoffs are obvious" | Obvious today is forgotten in a month. The memo exists so reversible choices stay reversible and irreversible ones are signposted. |
|
|
48
|
+
| "Web research is overkill" | For high-impact choices with insufficient codebase evidence, external comparison is the cheapest way to kill a plausible-but-wrong option. |
|
|
49
|
+
| "One option is clearly right" | A single option is a statement, not a decision. Alternatives and their failure modes are what justify the choice. |
|
|
50
|
+
|
|
51
|
+
## Philosophy / rationale
|
|
52
|
+
|
|
53
|
+
- **Constraints first, options second.** Options only compare against the constraints that bound them, so map the codebase and decision horizon before generating alternatives.
|
|
54
|
+
- **Challenge is the deliverable.** The value of a direction session is the assumptions it surfaces and kills. Optimising for agreement produces a recommendation nobody tested.
|
|
55
|
+
- **Every recommendation carries its tradeoffs.** A choice without documented tradeoffs, revisit triggers, and validation signals cannot be revisited intelligently later.
|
|
56
|
+
|
|
57
|
+
## Cross-skill references
|
|
58
|
+
|
|
59
|
+
- `write-a-prd` produces the input brief when no PRD exists yet.
|
|
60
|
+
- `grill-with-docs` sharpens contested terminology and stress-tests the memo against domain docs.
|
|
61
|
+
- `design-an-interface` structures the option-generation step when the decision is about interface shape.
|
|
62
|
+
- `style-documentation` governs the memo's what/whether criteria before writing.
|
|
63
|
+
|
|
64
|
+
## Examples
|
|
65
|
+
|
|
66
|
+
Input: "Decide on the write-path storage for the events service."
|
|
67
|
+
Output: a decision memo at `docs/technical-direction/events-write-path.md` covering constraints, three options scored against them, a justified recommendation, tradeoffs accepted, a validation plan, revisit triggers, and references. See [FORMAT.md](FORMAT.md) for the full template.
|
|
68
|
+
|
|
69
|
+
## Verification checklist
|
|
70
|
+
|
|
71
|
+
- [ ] Goals, non-goals, and decision horizon confirmed before options were generated
|
|
72
|
+
- [ ] Codebase constraints explored before asking questions; unknowns and risks recorded
|
|
73
|
+
- [ ] Questions asked one at a time; nothing answerable from the codebase asked of the user
|
|
74
|
+
- [ ] At least three options considered, including an extend-current approach and a stronger alternative
|
|
75
|
+
- [ ] Each option scored on feasibility, complexity, migration cost, operational impact, testability, performance, and failure modes
|
|
76
|
+
- [ ] Recommendation states why alternatives were not chosen and lists revisit triggers
|
|
77
|
+
- [ ] Decision memo saved to `docs/technical-direction/<feature-slug>.md` using the FORMAT.md template
|
|
78
|
+
- [ ] Tradeoffs accepted, validation plan, and references (web and code, with links) included
|
|
79
|
+
- [ ] No premature implementation detail in the memo — direction only
|