@vpxa/aikit 0.1.19 → 0.1.21
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/package.json +1 -1
- package/packages/core/dist/types.d.ts +2 -0
- package/packages/flows/dist/adapters/claude-plugin.js +1 -1
- package/packages/flows/dist/adapters/copilot.js +1 -1
- package/packages/flows/dist/builtins.js +1 -1
- package/packages/flows/dist/loader.js +1 -1
- package/packages/flows/dist/types.d.ts +2 -2
- package/packages/indexer/dist/smart-index-scheduler.d.ts +4 -1
- package/packages/indexer/dist/smart-index-scheduler.js +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/tool-metadata.js +1 -1
- package/packages/server/dist/tools/flow.tools.js +1 -1
- package/packages/store/dist/lance-store.d.ts +2 -0
- package/packages/store/dist/lance-store.js +1 -1
- package/scaffold/adapters/claude-code.mjs +4 -22
- package/scaffold/definitions/bodies.mjs +74 -62
- package/scaffold/definitions/plugins.mjs +92 -0
- package/scaffold/definitions/protocols.mjs +2 -2
- package/scaffold/flows/aikit-advanced/README.md +70 -0
- package/scaffold/flows/aikit-advanced/flow.json +15 -6
- package/scaffold/flows/aikit-advanced/steps/design/README.md +164 -0
- package/scaffold/flows/aikit-advanced/{skills/execute/SKILL.md → steps/execute/README.md} +19 -0
- package/scaffold/flows/aikit-advanced/{skills/plan/SKILL.md → steps/plan/README.md} +20 -0
- package/scaffold/flows/aikit-advanced/{skills/spec/SKILL.md → steps/spec/README.md} +19 -0
- package/scaffold/flows/aikit-advanced/{skills/task/SKILL.md → steps/task/README.md} +18 -0
- package/scaffold/flows/aikit-advanced/{skills/verify/SKILL.md → steps/verify/README.md} +21 -0
- package/scaffold/flows/aikit-basic/README.md +51 -0
- package/scaffold/flows/aikit-basic/flow.json +13 -4
- package/scaffold/flows/aikit-basic/{skills/assess/SKILL.md → steps/assess/README.md} +25 -0
- package/scaffold/flows/aikit-basic/steps/design/README.md +107 -0
- package/scaffold/flows/aikit-basic/{skills/implement/SKILL.md → steps/implement/README.md} +24 -0
- package/scaffold/flows/aikit-basic/{skills/verify/SKILL.md → steps/verify/README.md} +25 -0
- package/scaffold/general/agents/Orchestrator.agent.md +61 -53
- package/scaffold/general/agents/Planner.agent.md +12 -8
- package/scaffold/general/agents/_shared/code-agent-base.md +2 -2
- package/scaffold/general/skills/adr-skill/SKILL.md +6 -6
- package/scaffold/general/skills/aikit/SKILL.md +10 -10
- package/scaffold/general/skills/brainstorming/SKILL.md +11 -13
- package/scaffold/general/skills/c4-architecture/SKILL.md +1 -0
- package/scaffold/general/skills/requirements-clarity/SKILL.md +5 -3
- package/scaffold/general/skills/session-handoff/SKILL.md +2 -0
- package/scaffold/general/skills/brainstorming/scripts/frame-template.html +0 -365
- package/scaffold/general/skills/brainstorming/scripts/helper.js +0 -216
- package/scaffold/general/skills/brainstorming/scripts/server.cjs +0 -9
- package/scaffold/general/skills/brainstorming/scripts/server.src.cjs +0 -249
- package/scaffold/general/skills/brainstorming/visual-companion.md +0 -430
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Design Gate — Basic Flow
|
|
2
|
+
|
|
3
|
+
Lightweight design gate for bug fixes, small features, and refactoring. Evaluates the task type and determines whether design work is needed before proceeding.
|
|
4
|
+
|
|
5
|
+
## When This Step Runs
|
|
6
|
+
|
|
7
|
+
This is the **first step** of the `aikit:basic` flow. It runs before assessment.
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
### 1. Task Classification
|
|
12
|
+
|
|
13
|
+
Classify the task into one of these categories:
|
|
14
|
+
|
|
15
|
+
| Category | Indicators | Action |
|
|
16
|
+
|----------|-----------|--------|
|
|
17
|
+
| **Bug fix** | Error reports, stack traces, regression, "fix", "broken" | → **Auto-skip** to next step |
|
|
18
|
+
| **Refactor** | Code cleanup, rename, restructure, no behavior change | → **Auto-skip** to next step |
|
|
19
|
+
| **Small feature** | New behavior, new endpoint, new component, UI change | → Run **Quick Design** below |
|
|
20
|
+
|
|
21
|
+
**If the task is a bug fix or refactor**, produce a minimal `design-decisions.md`:
|
|
22
|
+
```markdown
|
|
23
|
+
## Design Decisions
|
|
24
|
+
- **Task type**: Bug fix / Refactor
|
|
25
|
+
- **Design gate**: Auto-skipped — no design work needed
|
|
26
|
+
- **Proceed to**: Assessment
|
|
27
|
+
```
|
|
28
|
+
Then report `DONE` to the Orchestrator so the flow advances.
|
|
29
|
+
|
|
30
|
+
### 2. Quick Design (Small Features Only)
|
|
31
|
+
|
|
32
|
+
For small features that need minimal design:
|
|
33
|
+
|
|
34
|
+
1. **FORGE Classify** — Run `forge_classify({ task: "<task description>", files: [<relevant files>] })` to determine complexity tier
|
|
35
|
+
2. **Brainstorming** (if tier ≥ Standard) — Load the `brainstorming` skill and run a focused brainstorming session:
|
|
36
|
+
- What is the user trying to achieve?
|
|
37
|
+
- What are the constraints?
|
|
38
|
+
- What is the simplest approach?
|
|
39
|
+
3. **Decision Protocol** (if technical decisions exist) — Delegate to 2-4 Researcher agents in parallel:
|
|
40
|
+
- Each researcher evaluates a different approach
|
|
41
|
+
- Synthesize findings into a recommendation
|
|
42
|
+
4. **Produce `design-decisions.md`**:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
## Design Decisions
|
|
46
|
+
|
|
47
|
+
### FORGE Assessment
|
|
48
|
+
- **Tier**: {Floor | Standard | Critical}
|
|
49
|
+
- **Rationale**: {why this tier}
|
|
50
|
+
|
|
51
|
+
### Task Summary
|
|
52
|
+
- **Goal**: {what we're building}
|
|
53
|
+
- **Approach**: {chosen approach}
|
|
54
|
+
- **Key decisions**: {list}
|
|
55
|
+
|
|
56
|
+
### Constraints
|
|
57
|
+
- {constraint 1}
|
|
58
|
+
- {constraint 2}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 3. Report to Orchestrator
|
|
62
|
+
|
|
63
|
+
When complete, report status:
|
|
64
|
+
- `DONE` — design decisions captured, ready for assessment
|
|
65
|
+
- `DONE_WITH_CONCERNS` — design captured but open questions remain (list them)
|
|
66
|
+
|
|
67
|
+
**Do NOT call `flow_step`** — let the Orchestrator advance the flow.
|
|
68
|
+
|
|
69
|
+
## Produces
|
|
70
|
+
|
|
71
|
+
- `design-decisions.md` — Task classification, FORGE tier, key design decisions
|
|
72
|
+
|
|
73
|
+
## Agents
|
|
74
|
+
|
|
75
|
+
- `Researcher-Alpha`, `Researcher-Beta`, `Researcher-Gamma`, `Researcher-Delta` — for parallel research during decision protocol
|
|
76
|
+
|
|
77
|
+
## Foundation Integration
|
|
78
|
+
|
|
79
|
+
Load these skills BEFORE executing this step:
|
|
80
|
+
|
|
81
|
+
| Skill | Purpose | When |
|
|
82
|
+
|-------|---------|------|
|
|
83
|
+
| `aikit` | Core MCP tools — search, analyze, remember, validate | Always (auto-loaded) |
|
|
84
|
+
| `present` | Rich rendering for any structured output — assessments, reports, comparisons, reviews, status boards, tables, charts, and all artifact content | Use for ANY output that benefits from rich rendering, not just dashboards |
|
|
85
|
+
| `multi-agents-development` | Dispatch templates, task decomposition, review pipeline patterns | Before dispatching any subagent |
|
|
86
|
+
| `brainstorming` | Structured ideation for design/creative decisions | Before any design choice or new feature exploration |
|
|
87
|
+
| `c4-architecture` | C4 model architecture diagrams — system context, container, component, deployment views | When visualizing system structure during design |
|
|
88
|
+
| `adr-skill` | Architecture Decision Records — create, review, maintain ADRs | When making non-trivial design or technology decisions |
|
|
89
|
+
|
|
90
|
+
### Presentation Rules
|
|
91
|
+
- Use `present` for **any output** that benefits from rich rendering — not limited to dashboards
|
|
92
|
+
- Assessments, reports, comparisons, reviews, status boards → `present({ format: "html" })`
|
|
93
|
+
- Tables, charts, progress tracking, code review findings → always present
|
|
94
|
+
- Artifact content and summaries → present with structured layout
|
|
95
|
+
- Only use plain text for brief confirmations and simple questions
|
|
96
|
+
|
|
97
|
+
## Completion Criteria
|
|
98
|
+
|
|
99
|
+
## Knowledge Capture
|
|
100
|
+
|
|
101
|
+
Before completing this step, persist important findings using `remember()`:
|
|
102
|
+
|
|
103
|
+
- **Design decisions**: Chosen approach and alternatives considered with trade-offs
|
|
104
|
+
- **Architecture patterns**: New patterns introduced or existing patterns that must be followed
|
|
105
|
+
- **Constraints discovered**: Technical limitations, compatibility requirements, or performance boundaries
|
|
106
|
+
|
|
107
|
+
**Every step produces knowledge worth preserving.** If you discovered something that would help a future session, call `remember()` now.
|
|
@@ -13,6 +13,19 @@ Execute the implementation plan from the assessment, writing production code and
|
|
|
13
13
|
|
|
14
14
|
- `.spec/<slug>/assessment.md` — the approach, affected files, and risks
|
|
15
15
|
|
|
16
|
+
## Prerequisites Check
|
|
17
|
+
|
|
18
|
+
Before executing this step, verify:
|
|
19
|
+
|
|
20
|
+
- [ ] Assessment complete and scope approved (from the assess step)
|
|
21
|
+
- [ ] Files-to-modify list is clear and bounded
|
|
22
|
+
- [ ] `check({})` baseline captured (know what currently passes)
|
|
23
|
+
|
|
24
|
+
If any prerequisites are missing or incomplete:
|
|
25
|
+
1. Inform the Orchestrator with specifics about what's missing
|
|
26
|
+
2. Recommend `flow_step({ action: 'redo' })` on the **assess** step
|
|
27
|
+
3. Do NOT proceed with partial inputs — quality degrades downstream
|
|
28
|
+
|
|
16
29
|
## Process
|
|
17
30
|
|
|
18
31
|
1. **Read assessment** — Load `.spec/<slug>/assessment.md` and internalize the approach
|
|
@@ -67,6 +80,7 @@ Load these skills BEFORE executing this step:
|
|
|
67
80
|
| `present` | Rich rendering for any structured output — assessments, reports, comparisons, reviews, status boards, tables, charts, and all artifact content | Use for ANY output that benefits from rich rendering, not just dashboards |
|
|
68
81
|
| `multi-agents-development` | Dispatch templates, task decomposition, review pipeline patterns | Before dispatching any subagent |
|
|
69
82
|
| `brainstorming` | Structured ideation for design/creative decisions | Before any design choice or new feature exploration |
|
|
83
|
+
| `session-handoff` | Context preservation for session transfers | When implementation is long-running and context may fill up |
|
|
70
84
|
|
|
71
85
|
### Presentation Rules
|
|
72
86
|
- Use `present` for **any output** that benefits from rich rendering — not limited to dashboards
|
|
@@ -103,3 +117,13 @@ Follow the `multi-agents-development` skill patterns for dispatch:
|
|
|
103
117
|
- [ ] `test_run({})` passes (no test failures)
|
|
104
118
|
- [ ] No files modified outside assessed scope
|
|
105
119
|
- [ ] `.spec/<slug>/progress.md` written
|
|
120
|
+
|
|
121
|
+
## Knowledge Capture
|
|
122
|
+
|
|
123
|
+
Before completing this step, persist important findings using `remember()`:
|
|
124
|
+
|
|
125
|
+
- **Implementation decisions**: Why specific approaches were chosen over alternatives
|
|
126
|
+
- **Patterns established**: New conventions or patterns that future code should follow
|
|
127
|
+
- **Gotchas encountered**: Edge cases, workarounds, or non-obvious behaviors discovered during implementation
|
|
128
|
+
|
|
129
|
+
**Every step produces knowledge worth preserving.** If you discovered something that would help a future session, call `remember()` now.
|
|
@@ -14,6 +14,19 @@ Validate that the implementation meets the original requirements, passes all qua
|
|
|
14
14
|
- `.spec/<slug>/assessment.md` — original requirements and approach
|
|
15
15
|
- `.spec/<slug>/progress.md` — what was implemented and any deviations
|
|
16
16
|
|
|
17
|
+
## Prerequisites Check
|
|
18
|
+
|
|
19
|
+
Before executing this step, verify:
|
|
20
|
+
|
|
21
|
+
- [ ] Implementation complete (from the implement step)
|
|
22
|
+
- [ ] `check({})` + `test_run({})` pass at baseline
|
|
23
|
+
- [ ] Changed files list is available for blast radius analysis
|
|
24
|
+
|
|
25
|
+
If any prerequisites are missing or incomplete:
|
|
26
|
+
1. Inform the Orchestrator with specifics about what's missing
|
|
27
|
+
2. Recommend `flow_step({ action: 'redo' })` on the **implement** step
|
|
28
|
+
3. Do NOT proceed with partial inputs — quality degrades downstream
|
|
29
|
+
|
|
17
30
|
## Process
|
|
18
31
|
|
|
19
32
|
1. **Load context** — Read assessment and progress artifacts
|
|
@@ -70,6 +83,8 @@ Load these skills BEFORE executing this step:
|
|
|
70
83
|
| `present` | Rich rendering for any structured output — assessments, reports, comparisons, reviews, status boards, tables, charts, and all artifact content | Use for ANY output that benefits from rich rendering, not just dashboards |
|
|
71
84
|
| `multi-agents-development` | Dispatch templates, task decomposition, review pipeline patterns | Before dispatching any subagent |
|
|
72
85
|
| `brainstorming` | Structured ideation for design/creative decisions | Before any design choice or new feature exploration |
|
|
86
|
+
| `lesson-learned` | Extract engineering lessons from completed work via git history | After verification completes — capture principles from what was built |
|
|
87
|
+
| `session-handoff` | Context preservation for session transfers | When verification is the final step and session context should be saved |
|
|
73
88
|
|
|
74
89
|
### Presentation Rules
|
|
75
90
|
- Use `present` for **any output** that benefits from rich rendering — not limited to dashboards
|
|
@@ -94,3 +109,13 @@ After all reviews complete:
|
|
|
94
109
|
- [ ] Security review complete
|
|
95
110
|
- [ ] Blast radius assessed
|
|
96
111
|
- [ ] `.spec/<slug>/verify-report.md` written with clear PASS/FAIL verdict
|
|
112
|
+
|
|
113
|
+
## Knowledge Capture
|
|
114
|
+
|
|
115
|
+
Before completing this step, persist important findings using `remember()`:
|
|
116
|
+
|
|
117
|
+
- **Test coverage gaps**: Areas that couldn't be fully tested and why
|
|
118
|
+
- **Quality findings**: Issues found during verification and their resolutions
|
|
119
|
+
- **Session checkpoint**: Summarize what was accomplished, decisions made, and any remaining work
|
|
120
|
+
|
|
121
|
+
**Every step produces knowledge worth preserving.** If you discovered something that would help a future session, call `remember()` now.
|
|
@@ -41,15 +41,6 @@ You orchestrate the full development lifecycle: **planning → implementation
|
|
|
41
41
|
|
|
42
42
|
**Parallelism**: Read-only agents run in parallel freely. File-modifying agents run in parallel ONLY on completely different files. Max 4 concurrent file-modifying agents.
|
|
43
43
|
|
|
44
|
-
## Phase 0: Design Gate
|
|
45
|
-
|
|
46
|
-
| Situation | Route |
|
|
47
|
-
|-----------|-------|
|
|
48
|
-
| New feature/component/behavior | **Brainstorming skill** → user dialogue → design doc |
|
|
49
|
-
| Non-trivial technical decision | **Decision protocol** → 4 Researchers parallel → synthesize → ADR |
|
|
50
|
-
| Both | Brainstorming first → escalate unresolved decisions to protocol |
|
|
51
|
-
| Bug fix / refactor / explicit skip | **→ Phase 1** |
|
|
52
|
-
|
|
53
44
|
## FORGE Protocol
|
|
54
45
|
|
|
55
46
|
1. `forge_classify({ task, files })` → determine tier (Floor/Standard/Critical)
|
|
@@ -57,32 +48,66 @@ You orchestrate the full development lifecycle: **planning → implementation
|
|
|
57
48
|
3. After review: `evidence_map({ action: "gate", task_id })` → YIELD/HOLD/HARD_BLOCK
|
|
58
49
|
4. Auto-upgrade tier if unknowns reveal contract/security issues
|
|
59
50
|
|
|
60
|
-
## Flow-Driven Development
|
|
51
|
+
## Flow-Driven Development (PRIMARY BEHAVIOR)
|
|
61
52
|
|
|
62
|
-
|
|
53
|
+
**After bootstrap, the Orchestrator MUST select and start a flow.** Flows define the step sequence — Orchestrator adds multi-agent orchestration, quality gates, and review protocols on top. Design decisions, brainstorming, and FORGE classification are handled by the **design** step within each flow — NOT by the Orchestrator directly.
|
|
63
54
|
|
|
64
|
-
### Flow
|
|
55
|
+
### Flow Activation (MANDATORY after bootstrap)
|
|
65
56
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
1. `flow_status` — check for an active flow from a previous session
|
|
58
|
+
2. **If active flow exists:**
|
|
59
|
+
- Note current step name and instruction path
|
|
60
|
+
- Read the current step instruction with `flow_read_instruction`
|
|
61
|
+
- Follow its instructions
|
|
62
|
+
- When complete: `flow_step({ action: 'next' })`
|
|
63
|
+
3. **If NO active flow:**
|
|
64
|
+
- `flow_list` — retrieve ALL available flows (builtin AND custom)
|
|
65
|
+
- **Auto-select** the flow when the task clearly matches:
|
|
71
66
|
|
|
72
|
-
|
|
67
|
+
| Task signal | Auto-activate flow |
|
|
68
|
+
|-------------|--------------------|
|
|
69
|
+
| Bug fix, typo, hotfix, "fix ...", error reproduction | `aikit:basic` |
|
|
70
|
+
| Small feature (≤3 files), refactoring, cleanup, dependency update | `aikit:basic` |
|
|
71
|
+
| New feature, API design, architecture change, multi-component work | `aikit:advanced` |
|
|
72
|
+
| Task matches a custom flow's description/tags exactly | That custom flow |
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
- **Auto-start:** When exactly one flow matches, start it immediately — `flow_start({ flow: '<matched>' })` — and inform the user which flow was activated and why.
|
|
75
|
+
- **Ask only when ambiguous:** If the task could fit multiple flows, or no flow clearly matches, present the options and let the user choose.
|
|
76
|
+
- Do NOT present a menu for obvious cases. Speed matters.
|
|
77
|
+
4. **Every task goes through a flow.** There is no flowless path.
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
3.
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
|
|
79
|
+
### Flow Execution Loop
|
|
80
|
+
|
|
81
|
+
For EACH step in the active flow:
|
|
82
|
+
|
|
83
|
+
1. `flow_read_instruction` — read the current step's README.md
|
|
84
|
+
2. Follow the step's instructions — delegate work to the appropriate agents
|
|
85
|
+
3. Apply **Orchestrator Protocols** (PRE-DISPATCH GATE, FORGE, review cycle) during execution
|
|
86
|
+
4. When the step is complete and results are approved:
|
|
87
|
+
- `flow_step({ action: 'next' })` to advance
|
|
88
|
+
5. Repeat until the flow is complete
|
|
89
|
+
|
|
90
|
+
**Custom flows work identically** — `flow_list` returns them alongside builtins. The execution loop is the same for ALL flows.
|
|
91
|
+
|
|
92
|
+
### Flow Completion & Cleanup
|
|
93
|
+
|
|
94
|
+
Flows MUST be driven to completion. A flow left active forever blocks future work.
|
|
95
|
+
|
|
96
|
+
**Normal completion:**
|
|
97
|
+
- When the last step's `flow_step({ action: 'next' })` is called, the flow finishes automatically
|
|
98
|
+
- After completion: run post-implementation protocol (`check` → `test_run` → `blast_radius` → `reindex` → `produce_knowledge` → `remember`)
|
|
99
|
+
- Inform the user the flow is complete with a summary of artifacts produced
|
|
100
|
+
|
|
101
|
+
**Stale flow detection** (check at session start when `flow_status` returns an active flow):
|
|
102
|
+
- If the active flow's current step has no matching work context in the conversation → **ask the user**: "A flow `<name>` is active at step `<step>`. Continue, or reset to start fresh?"
|
|
103
|
+
- If the user says reset → `flow_reset()` then activate a new flow for the current task
|
|
104
|
+
- If the user says continue → resume from the current step
|
|
105
|
+
|
|
106
|
+
**Abandoned step recovery:**
|
|
107
|
+
- If a step has been attempted ≥ 2 times with `BLOCKED` status → escalate to user with diagnostics, offer to `flow_step({ action: 'skip' })` or `flow_reset()`
|
|
108
|
+
- Never silently retry a blocked step indefinitely
|
|
109
|
+
|
|
110
|
+
**One active flow at a time.** To switch tasks, the current flow must be completed or reset first.
|
|
86
111
|
|
|
87
112
|
### Orchestrator Protocols (apply during ALL flow steps)
|
|
88
113
|
|
|
@@ -131,7 +156,7 @@ Batch 2 (after batch 1):
|
|
|
131
156
|
| `flow_step` | Advance: next, skip, or redo current step |
|
|
132
157
|
| `flow_status` | Check current execution state |
|
|
133
158
|
| `flow_reset` | Clear flow state to start over |
|
|
134
|
-
| `
|
|
159
|
+
| `flow_read_instruction` | Read the instruction content for the current step |
|
|
135
160
|
|
|
136
161
|
## Emergency: STOP → ASSESS → CONTAIN → RECOVER → DOCUMENT
|
|
137
162
|
|
|
@@ -177,7 +202,7 @@ When subagents complete, their visual outputs (from `present`) are NOT visible t
|
|
|
177
202
|
3. **Maximize parallelism** — independent tasks MUST run as parallel `runSubagent` calls in the SAME function block. Sequential dispatch of parallelizable tasks is a protocol violation.
|
|
178
203
|
4. **Fresh context per subagent** — paste relevant code, don't reference conversation history
|
|
179
204
|
5. **Search AI Kit before planning** — check past decisions with `search()`
|
|
180
|
-
6. **
|
|
205
|
+
6. **Always use flows** — every task goes through a flow; design decisions happen in the flow's design step
|
|
181
206
|
7. **Never proceed without user approval** at 🛑 stops
|
|
182
207
|
8. **Max 2 retries** then escalate to user
|
|
183
208
|
|
|
@@ -214,35 +239,18 @@ Before every tool call, verify:
|
|
|
214
239
|
|-------|--------------|
|
|
215
240
|
| `multi-agents-development` | **Before any delegation** — task decomposition, dispatch templates, review pipeline, recovery patterns |
|
|
216
241
|
| `present` | When presenting plans, findings, or visual content to the user — dashboards, tables, charts, timelines |
|
|
217
|
-
| `brainstorming` |
|
|
242
|
+
| `brainstorming` | When a flow's design step requires creative/design work |
|
|
218
243
|
| `session-handoff` | Context filling up, session ending, or major milestone |
|
|
219
244
|
| `lesson-learned` | After completing work — extract engineering principles |
|
|
220
245
|
|
|
221
246
|
**When dispatching subagents**, include relevant skill names in the prompt so subagents know which skills to load (e.g., "Load the `react` and `typescript` skills for this task").
|
|
222
247
|
|
|
223
|
-
##
|
|
248
|
+
## Flows
|
|
224
249
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
- Note the current step name and skill path
|
|
229
|
-
- Load the current step's skill file
|
|
230
|
-
- Follow its instructions for this step
|
|
231
|
-
- When step is complete, call `flow_step({ action: 'next' })`
|
|
232
|
-
3. If no active flow:
|
|
233
|
-
- Check `flow_list` for available flows
|
|
234
|
-
- Suggest starting a flow based on the task type
|
|
235
|
-
- Use `flow_start({ flow: '<name>' })` to begin
|
|
250
|
+
This project uses aikit's pluggable flow system. Check flow status with the `flow_status` MCP tool.
|
|
251
|
+
If a flow is active, follow the current step's instructions. Advance with `flow_step({ action: 'next' })`.
|
|
252
|
+
Use `flow_list` to see available flows and `flow_start` to begin one.
|
|
236
253
|
|
|
237
|
-
### Flow MCP Tools
|
|
238
|
-
| Tool | Purpose |
|
|
239
|
-
|------|---------|
|
|
240
|
-
| `flow_list` | List installed flows and active flow |
|
|
241
|
-
| `flow_info` | Get detailed flow info including steps |
|
|
242
|
-
| `flow_start` | Start a named flow |
|
|
243
|
-
| `flow_step` | Advance: next, skip, or redo current step |
|
|
244
|
-
| `flow_status` | Check current execution state |
|
|
245
|
-
| `flow_reset` | Clear flow state to start over |
|
|
246
254
|
|
|
247
255
|
## Flows
|
|
248
256
|
|
|
@@ -38,16 +38,20 @@ You are the **Planner**, autonomous planner that researches codebases and writes
|
|
|
38
38
|
5. **Dependency Graph** — For each phase, list dependencies. Group into parallel batches
|
|
39
39
|
6. **Present** — Show plan with open questions, complexity estimate, parallel batch layout
|
|
40
40
|
|
|
41
|
-
## Flow Integration
|
|
41
|
+
## Flow Integration (PRIMARY MODE)
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
1. Check `flow_status` for current step context
|
|
45
|
-
2. Read the step's skill file for specific instructions
|
|
46
|
-
3. Follow skill instructions while applying Planner methodology
|
|
47
|
-
4. Produce required artifacts (as specified by the flow step's `produces` field)
|
|
48
|
-
5. When complete, report to Orchestrator (do NOT call `flow_step` — let Orchestrator advance)
|
|
43
|
+
The Planner is typically activated by the Orchestrator as part of a flow step (e.g., `aikit:advanced` plan step, `aikit:basic` assess step, or a custom flow's planning step).
|
|
49
44
|
|
|
50
|
-
When
|
|
45
|
+
**When activated as part of a flow:**
|
|
46
|
+
1. `flow_status` — check current step context and which flow is active
|
|
47
|
+
2. `flow_read_instruction` — read the current step's README.md for specific instructions
|
|
48
|
+
3. Follow the step's instructions as the primary guide, applying Planner methodology on top
|
|
49
|
+
4. Read the flow's README.md for overall context on how the flow works
|
|
50
|
+
5. Produce required artifacts (as specified by the flow step's `produces` field)
|
|
51
|
+
6. When complete, report status to Orchestrator: `DONE` | `DONE_WITH_CONCERNS` | `NEEDS_CONTEXT` | `BLOCKED`
|
|
52
|
+
7. Do NOT call `flow_step` — the Orchestrator controls flow advancement
|
|
53
|
+
|
|
54
|
+
**When no flow is active** (standalone mode), operate autonomously following normal Planner methodology.
|
|
51
55
|
|
|
52
56
|
## Subagent Output Relay
|
|
53
57
|
|
|
@@ -60,7 +60,7 @@ You may be invoked in two modes:
|
|
|
60
60
|
|
|
61
61
|
```
|
|
62
62
|
flow_status({}) # Check/resume active flow FIRST
|
|
63
|
-
# If flow active →
|
|
63
|
+
# If flow active → flow_read_instruction({ step }) → follow step instructions
|
|
64
64
|
status({}) # Check AI Kit health + onboard state
|
|
65
65
|
# If onboard not run → onboard({ path: "." }) # First-time codebase analysis
|
|
66
66
|
flow_list({}) # See available flows
|
|
@@ -73,7 +73,7 @@ search({ query: "SESSION CHECKPOINT", origin: "curated" }) # Resume prior wo
|
|
|
73
73
|
|
|
74
74
|
| Category | Tools | Purpose |
|
|
75
75
|
|----------|-------|---------|
|
|
76
|
-
| Flows | `flow_list`, `flow_info`, `flow_start`, `flow_step`, `flow_status`, `
|
|
76
|
+
| Flows | `flow_list`, `flow_info`, `flow_start`, `flow_step`, `flow_status`, `flow_read_instruction`, `flow_reset` | Structured multi-step workflows |
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
@@ -262,7 +262,7 @@ Preferred: let `scripts/new_adr.js --update-index` do it. Otherwise:
|
|
|
262
262
|
When introducing ADRs to a repo that has none:
|
|
263
263
|
|
|
264
264
|
```bash
|
|
265
|
-
node
|
|
265
|
+
node scripts/bootstrap_adr.js
|
|
266
266
|
```
|
|
267
267
|
|
|
268
268
|
This creates the directory, an index file, and a filled-out first ADR ("Adopt architecture decision records") with real content explaining why the team is using ADRs. Use `--json` for machine-readable output. Use `--dir` to override the directory name.
|
|
@@ -306,20 +306,20 @@ Date prefixes are local to each category. Choose a categorization scheme early (
|
|
|
306
306
|
|
|
307
307
|
### Script Usage
|
|
308
308
|
|
|
309
|
-
From the
|
|
309
|
+
From the directory that contains this skill's `scripts/` folder:
|
|
310
310
|
|
|
311
311
|
```bash
|
|
312
312
|
# Simple ADR
|
|
313
|
-
node
|
|
313
|
+
node scripts/new_adr.js --title "Choose database" --status proposed
|
|
314
314
|
|
|
315
315
|
# MADR-style with options
|
|
316
|
-
node
|
|
316
|
+
node scripts/new_adr.js --title "Choose database" --template madr --status proposed
|
|
317
317
|
|
|
318
318
|
# With index update
|
|
319
|
-
node
|
|
319
|
+
node scripts/new_adr.js --title "Choose database" --status proposed --update-index
|
|
320
320
|
|
|
321
321
|
# Bootstrap a new repo
|
|
322
|
-
node
|
|
322
|
+
node scripts/bootstrap_adr.js --dir docs/decisions
|
|
323
323
|
```
|
|
324
324
|
|
|
325
325
|
Notes:
|
|
@@ -43,7 +43,7 @@ core → store → embeddings → chunker → indexer → analyzers → tools
|
|
|
43
43
|
### Start (do ALL)
|
|
44
44
|
```
|
|
45
45
|
flow_status({}) # Check/resume active flow FIRST
|
|
46
|
-
# If flow active →
|
|
46
|
+
# If flow active → flow_read_instruction({ step }) → follow step instructions
|
|
47
47
|
status({}) # Check AI Kit health + onboard state
|
|
48
48
|
# If onboard not run → onboard({ path: "." }) # First-time codebase analysis
|
|
49
49
|
flow_list({}) # See available flows
|
|
@@ -189,7 +189,7 @@ Lane actions: `create` (copy files to lane), `list`, `status` (modified/added/de
|
|
|
189
189
|
| `flow_start` | `aikit flow start` | Start a named flow |
|
|
190
190
|
| `flow_step` | `aikit flow step` | Advance, skip, or redo the current step |
|
|
191
191
|
| `flow_status` | `aikit flow status` | Check if a flow is active and view the current step |
|
|
192
|
-
| `
|
|
192
|
+
| `flow_read_instruction` | `aikit flow read-instruction` | Read the current step's instruction file content directly |
|
|
193
193
|
| `flow_reset` | `aikit flow reset` | Clear flow state to start over |
|
|
194
194
|
|
|
195
195
|
### Presentation (1)
|
|
@@ -219,8 +219,8 @@ Flows are multi-step guided workflows that structure complex tasks. Each step ha
|
|
|
219
219
|
flow_list() # See available flows
|
|
220
220
|
flow_info({ flow: "aikit:basic" }) # View steps, skills, agents
|
|
221
221
|
flow_start({ flow: "aikit:basic" }) # Start — sets current step to first
|
|
222
|
-
|
|
223
|
-
# ... do the work described in the
|
|
222
|
+
flow_read_instruction({ step: "assess" }) # Read current step's instructions
|
|
223
|
+
# ... do the work described in the instruction ...
|
|
224
224
|
flow_step({ action: "next" }) # Advance to next step
|
|
225
225
|
flow_step({ action: "skip" }) # Skip current step
|
|
226
226
|
flow_step({ action: "redo" }) # Redo current step
|
|
@@ -241,14 +241,14 @@ artifacts_dir: .spec
|
|
|
241
241
|
steps:
|
|
242
242
|
- id: design
|
|
243
243
|
name: Design
|
|
244
|
-
|
|
244
|
+
instruction: steps/design/README.md
|
|
245
245
|
description: "Create the design document"
|
|
246
246
|
produces: [design.md]
|
|
247
247
|
requires: []
|
|
248
248
|
agents: [Planner]
|
|
249
249
|
- id: implement
|
|
250
250
|
name: Implement
|
|
251
|
-
|
|
251
|
+
instruction: steps/implement/README.md
|
|
252
252
|
description: "Implement the design"
|
|
253
253
|
produces: [code]
|
|
254
254
|
requires: [design]
|
|
@@ -271,7 +271,7 @@ install: []
|
|
|
271
271
|
### Agent-Flow Integration
|
|
272
272
|
|
|
273
273
|
- All code agents have a "Flows" section instructing them to check `flow_status()` first
|
|
274
|
-
- If a flow is active, the agent follows the current step's
|
|
274
|
+
- If a flow is active, the agent follows the current step's instruction via `flow_read_instruction()`
|
|
275
275
|
- After completing a step's work, advance with `flow_step({ action: "next" })`
|
|
276
276
|
- The **Orchestrator** selects and starts flows; other agents follow them
|
|
277
277
|
- The **Orchestrator** specifies `aikit` skill loading — all agents should load `aikit` skill to access flow tools
|
|
@@ -528,7 +528,7 @@ Flows are structured multi-step workflows that guide agents through complex task
|
|
|
528
528
|
| `flow_info` | Get flow details including steps and skill paths |
|
|
529
529
|
| `flow_start` | Start a named flow |
|
|
530
530
|
| `flow_step` | Advance: `next`, `skip`, or `redo` current step |
|
|
531
|
-
| `
|
|
531
|
+
| `flow_read_instruction` | Read the current step's instruction file content directly |
|
|
532
532
|
| `flow_reset` | Clear flow state to start over |
|
|
533
533
|
|
|
534
534
|
### Flow Selection
|
|
@@ -545,7 +545,7 @@ Flows are structured multi-step workflows that guide agents through complex task
|
|
|
545
545
|
### Flow Lifecycle
|
|
546
546
|
|
|
547
547
|
1. **Start**: `flow_list({})` → choose flow → `flow_start({ flow: "<name>" })`
|
|
548
|
-
2. **Each step**: `
|
|
548
|
+
2. **Each step**: `flow_read_instruction({ step: "<name>" })` → follow step instructions → complete work
|
|
549
549
|
3. **Advance**: `flow_step({ action: "next" })` → repeat from step 2
|
|
550
|
-
4. **Resume**: `flow_status({})` → if active, `
|
|
550
|
+
4. **Resume**: `flow_status({})` → if active, `flow_read_instruction` for current step → continue
|
|
551
551
|
5. **Reset**: `flow_reset({})` if you need to start over
|
|
@@ -90,7 +90,7 @@ digraph brainstorming_simple {
|
|
|
90
90
|
|
|
91
91
|
1. **Explore project context** — check files, docs, recent commits
|
|
92
92
|
2. **Assess scope** — if multiple independent subsystems, decompose before detailing (see below)
|
|
93
|
-
3. **Offer visual
|
|
93
|
+
3. **Offer visual presentation support** (if topic will involve visual questions) — this is its own message, not combined with a clarifying question. Use `present({ format: "html" })` to display brainstorming results as a rich visual dashboard.
|
|
94
94
|
4. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
95
95
|
5. **Propose 2-3 approaches via Decision Protocol** — launch ALL 4 Researcher variants in parallel to independently generate approaches. Synthesize their output into deduplicated options with trade-offs and your recommendation. Present agreements and disagreements to the user. *(See "Decision Protocol Integration" below.)*
|
|
96
96
|
6. **Present design** — in sections scaled to their complexity, get user approval after each section
|
|
@@ -122,7 +122,7 @@ digraph brainstorming_advanced {
|
|
|
122
122
|
"Assess scope" [shape=diamond];
|
|
123
123
|
"Decompose into sub-projects" [shape=box];
|
|
124
124
|
"Visual questions ahead?" [shape=diamond];
|
|
125
|
-
"Offer Visual
|
|
125
|
+
"Offer Visual Presentation\n(own message)" [shape=box];
|
|
126
126
|
"Ask clarifying questions" [shape=box];
|
|
127
127
|
"Decision Protocol:\n4 Researchers in parallel" [shape=box, style=bold];
|
|
128
128
|
"Synthesize approaches" [shape=box];
|
|
@@ -138,9 +138,9 @@ digraph brainstorming_advanced {
|
|
|
138
138
|
"Assess scope" -> "Decompose into sub-projects" [label="too large"];
|
|
139
139
|
"Assess scope" -> "Visual questions ahead?" [label="right-sized"];
|
|
140
140
|
"Decompose into sub-projects" -> "Visual questions ahead?" [label="first sub-project"];
|
|
141
|
-
"Visual questions ahead?" -> "Offer Visual
|
|
141
|
+
"Visual questions ahead?" -> "Offer Visual Presentation\n(own message)" [label="yes"];
|
|
142
142
|
"Visual questions ahead?" -> "Ask clarifying questions" [label="no"];
|
|
143
|
-
"Offer Visual
|
|
143
|
+
"Offer Visual Presentation\n(own message)" -> "Ask clarifying questions";
|
|
144
144
|
"Ask clarifying questions" -> "Decision Protocol:\n4 Researchers in parallel";
|
|
145
145
|
"Decision Protocol:\n4 Researchers in parallel" -> "Synthesize approaches";
|
|
146
146
|
"Synthesize approaches" -> "Present design sections";
|
|
@@ -242,18 +242,16 @@ Wait for the user's response. If they request changes, make them and re-run the
|
|
|
242
242
|
- **Incremental validation** — Present design, get approval before moving on
|
|
243
243
|
- **Be flexible** — Go back and clarify when something doesn't make sense
|
|
244
244
|
|
|
245
|
-
## Visual
|
|
245
|
+
## Visual Presentation Support (Advanced Mode Only)
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
Use the `present` MCP tool for showing mockups, diagrams, and visual options during brainstorming. It is available as a tool, not a separate mode. Choosing this means you can present rich visual output when it helps; it does NOT mean every question should become visual.
|
|
248
248
|
|
|
249
|
-
**Offering
|
|
250
|
-
> "Some of what we're working on might be easier to explain
|
|
249
|
+
**Offering visual presentation:** When you anticipate that upcoming questions will involve visual content (mockups, layouts, diagrams), offer it once for consent:
|
|
250
|
+
> "Some of what we're working on might be easier to explain visually. I can use `present({ format: \"html\" })` to show mockups, diagrams, comparisons, and other visuals as we go. Want me to use that when helpful?"
|
|
251
251
|
|
|
252
252
|
**This offer MUST be its own message.** Do not combine it with clarifying questions, context summaries, or any other content. Wait for the user's response before continuing. If they decline, proceed with text-only brainstorming.
|
|
253
253
|
|
|
254
|
-
**Per-question decision:** Even after the user accepts, decide FOR EACH QUESTION whether to use
|
|
254
|
+
**Per-question decision:** Even after the user accepts, decide FOR EACH QUESTION whether to use visual output or plain chat. The test: **would the user understand this better by seeing it than reading it?**
|
|
255
255
|
|
|
256
|
-
- **Use
|
|
257
|
-
- **Use
|
|
258
|
-
|
|
259
|
-
If they agree to the companion, read `visual-companion.md` for the detailed setup and usage guide.
|
|
256
|
+
- **Use `present({ format: "html" })`** for visual content — mockups, wireframes, layout comparisons, architecture diagrams, side-by-side visual designs
|
|
257
|
+
- **Use regular chat** for text content — requirements questions, conceptual choices, tradeoff lists, A/B/C/D text options, scope decisions
|
|
@@ -12,6 +12,7 @@ Generate software architecture documentation using C4 model diagrams in Mermaid
|
|
|
12
12
|
1. **Understand scope** - Determine which C4 level(s) are needed based on audience
|
|
13
13
|
2. **Analyze codebase** - Explore the system to identify components, containers, and relationships
|
|
14
14
|
3. **Generate diagrams** - Create Mermaid C4 diagrams at appropriate abstraction levels
|
|
15
|
+
> **Tip:** Use `present({ format: "html" })` to render diagrams as interactive visual output, rather than raw Mermaid code blocks. This provides a better viewing experience for stakeholders.
|
|
15
16
|
4. **Document** - Write diagrams to markdown files with explanatory context
|
|
16
17
|
|
|
17
18
|
## C4 Diagram Levels
|
|
@@ -70,7 +70,7 @@ When invoked, detect vague requirements:
|
|
|
70
70
|
1. Parse and understand core requirement
|
|
71
71
|
2. Generate feature name (kebab-case format)
|
|
72
72
|
3. Determine document version (default `1.0` unless user specifies otherwise)
|
|
73
|
-
4. Ensure
|
|
73
|
+
4. Ensure `.spec/{feature_name}/` exists for PRD output
|
|
74
74
|
5. Perform initial clarity assessment (0-100)
|
|
75
75
|
|
|
76
76
|
**Assessment Rubric**:
|
|
@@ -85,6 +85,8 @@ Technical Specificity: /25 points
|
|
|
85
85
|
- Integration points identified: 8 pts
|
|
86
86
|
- Constraints specified: 9 pts
|
|
87
87
|
|
|
88
|
+
|
|
89
|
+
If you present this rubric or a requirements scorecard to the user, use `present({ format: 'html' })` to display a rich dashboard when visual formatting would help.
|
|
88
90
|
Implementation Completeness: /25 points
|
|
89
91
|
- Edge cases considered: 8 pts
|
|
90
92
|
- Error handling mentioned: 9 pts
|
|
@@ -191,9 +193,9 @@ Once clarity score ≥ 90, generate comprehensive PRD.
|
|
|
191
193
|
|
|
192
194
|
**Output File**:
|
|
193
195
|
|
|
194
|
-
1. **Final PRD**:
|
|
196
|
+
1. **Final PRD**: `.spec/{feature_name}/requirements.md`
|
|
195
197
|
|
|
196
|
-
Use
|
|
198
|
+
Use `create_file` to save this file. Derive `{version}` from the document version recorded in the PRD (default `1.0`).
|
|
197
199
|
|
|
198
200
|
## PRD Document Structure
|
|
199
201
|
|
|
@@ -20,6 +20,8 @@ Determine which mode applies:
|
|
|
20
20
|
**Proactive suggestion?** After substantial work (5+ file edits, complex debugging, major decisions), suggest:
|
|
21
21
|
> "We've made significant progress. Consider creating a handoff document to preserve this context for future sessions. Say 'create handoff' when ready."
|
|
22
22
|
|
|
23
|
+
> **aikit Integration:** If the project uses the aikit MCP server, complement file-based handoffs with `remember({ title: "Session checkpoint: ...", content: "...", category: "conventions" })` to persist key decisions in the knowledge base. Use `search({ query: "SESSION CHECKPOINT" })` at session start to retrieve past checkpoints.
|
|
24
|
+
|
|
23
25
|
## CREATE Workflow
|
|
24
26
|
|
|
25
27
|
### Step 1: Generate Scaffold
|