aiwcli 0.12.7 → 0.13.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/dist/commands/clean.d.ts +7 -0
- package/dist/commands/clean.js +17 -8
- package/dist/commands/clear.d.ts +85 -0
- package/dist/commands/clear.js +455 -347
- package/dist/commands/init/index.d.ts +15 -0
- package/dist/commands/init/index.js +79 -38
- package/dist/lib/gitignore-manager.js +12 -13
- package/dist/lib/settings-hierarchy.d.ts +13 -1
- package/dist/lib/settings-hierarchy.js +1 -1
- package/dist/lib/template-linter.d.ts +4 -0
- package/dist/lib/template-linter.js +1 -1
- package/dist/lib/tty-detection.d.ts +1 -0
- package/dist/lib/tty-detection.js +1 -0
- package/dist/templates/CLAUDE.md +27 -0
- package/dist/templates/_shared/.claude/settings.json +7 -7
- package/dist/templates/_shared/.claude/{commands/handoff.md → skills/handoff/SKILL.md} +4 -3
- package/dist/templates/_shared/.claude/{commands/handoff-resume.md → skills/handoff-resume/SKILL.md} +3 -2
- package/dist/templates/_shared/.claude/skills/meta-plan/SKILL.md +43 -0
- package/dist/templates/_shared/.codex/workflows/handoff.md +1 -1
- package/dist/templates/_shared/.codex/workflows/meta-plan.md +347 -0
- package/dist/templates/_shared/.windsurf/workflows/handoff.md +1 -1
- package/dist/templates/_shared/.windsurf/workflows/meta-plan.md +347 -0
- package/dist/templates/_shared/hooks-ts/lint_after_edit.ts +59 -0
- package/dist/templates/_shared/hooks-ts/session_end.ts +11 -10
- package/dist/templates/_shared/hooks-ts/session_start.ts +15 -12
- package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +12 -12
- package/dist/templates/_shared/lib-ts/CLAUDE.md +3 -3
- package/dist/templates/_shared/lib-ts/base/constants.ts +324 -306
- package/dist/templates/_shared/lib-ts/base/hook-utils.ts +26 -7
- package/dist/templates/_shared/lib-ts/base/inference.ts +19 -19
- package/dist/templates/_shared/lib-ts/base/lint-dispatch.ts +287 -0
- package/dist/templates/_shared/lib-ts/base/state-io.ts +4 -3
- package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +3 -3
- package/dist/templates/_shared/lib-ts/context/CLAUDE.md +134 -0
- package/dist/templates/_shared/lib-ts/context/context-formatter.ts +16 -15
- package/dist/templates/_shared/lib-ts/context/context-selector.ts +16 -16
- package/dist/templates/_shared/lib-ts/context/context-store.ts +15 -14
- package/dist/templates/_shared/lib-ts/context/plan-manager.ts +2 -2
- package/dist/templates/_shared/scripts/resolve-run.ts +61 -0
- package/dist/templates/_shared/scripts/resolve_context.ts +1 -1
- package/dist/templates/_shared/scripts/status_line.ts +100 -94
- package/dist/templates/_shared/{handoff-system → skills/handoff-system}/CLAUDE.md +433 -421
- package/dist/templates/_shared/{handoff-system → skills/handoff-system}/lib/document-generator.ts +5 -4
- package/dist/templates/_shared/{handoff-system → skills/handoff-system}/lib/handoff-reader.ts +2 -1
- package/dist/templates/_shared/{handoff-system → skills/handoff-system}/scripts/resume_handoff.ts +6 -6
- package/dist/templates/_shared/{handoff-system → skills/handoff-system}/scripts/save_handoff.ts +16 -17
- package/dist/templates/_shared/{handoff-system → skills/handoff-system}/workflows/handoff-resume.md +2 -2
- package/dist/templates/_shared/{handoff-system → skills/handoff-system}/workflows/handoff.md +3 -3
- package/dist/templates/_shared/skills/meta-plan/CLAUDE.md +44 -0
- package/dist/templates/_shared/skills/meta-plan/workflows/meta-plan.md +347 -0
- package/dist/templates/cc-native/.claude/commands/cc-native/specdev.md +1 -1
- package/dist/templates/cc-native/.claude/settings.json +86 -57
- package/dist/templates/cc-native/_cc-native/artifacts/CLAUDE.md +64 -0
- package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/format.ts +599 -597
- package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/index.ts +26 -26
- package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/tracker.ts +107 -106
- package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/write.ts +119 -118
- package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +237 -247
- package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +76 -74
- package/dist/templates/cc-native/_cc-native/hooks/validate_task_prompt.ts +76 -0
- package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +163 -156
- package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +15 -16
- package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +116 -116
- package/dist/templates/cc-native/_cc-native/lib-ts/plan-discovery.ts +3 -3
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/embedding-indexer.ts +16 -12
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/hyde.ts +2 -3
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/index.ts +31 -31
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/logger.ts +7 -6
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/ollama-client.ts +9 -7
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/retrieval-pipeline.ts +17 -14
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-indexer.ts +41 -37
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-loader.ts +43 -33
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-searcher.ts +20 -20
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/types.ts +9 -8
- package/dist/templates/cc-native/_cc-native/lib-ts/rlm/vector-store.ts +4 -3
- package/dist/templates/cc-native/_cc-native/lib-ts/settings.ts +9 -10
- package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +20 -19
- package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +329 -329
- package/dist/templates/cc-native/_cc-native/plan-review/CLAUDE.md +149 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/CLAUDE.md +143 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/PLAN-ORCHESTRATOR.md +213 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-questions/PLAN-QUESTIONER.md +70 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-EVOLUTION.md +62 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-PATTERNS.md +61 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-STRUCTURE.md +62 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ASSUMPTION-TRACER.md +56 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CLARITY-AUDITOR.md +53 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-FEASIBILITY.md +66 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-GAPS.md +70 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-ORDERING.md +62 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CONSTRAINT-VALIDATOR.md +72 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-ADR-VALIDATOR.md +61 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-SCALE-MATCHER.md +64 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DEVILS-ADVOCATE.md +56 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DOCUMENTATION-PHILOSOPHY.md +86 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HANDOFF-READINESS.md +59 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HIDDEN-COMPLEXITY.md +58 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/INCREMENTAL-DELIVERY.md +66 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-DEPENDENCY.md +62 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-FMEA.md +66 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-PREMORTEM.md +71 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-REVERSIBILITY.md +74 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SCOPE-BOUNDARY.md +77 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SIMPLICITY-GUARDIAN.md +62 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SKEPTIC.md +68 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-BEHAVIOR-AUDITOR.md +61 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-CHARACTERIZATION.md +71 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-FIRST-VALIDATOR.md +61 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-PYRAMID-ANALYZER.md +61 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-COSTS.md +67 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-STAKEHOLDERS.md +65 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-COVERAGE.md +74 -0
- package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-STRENGTH.md +69 -0
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/agent-selection.ts +162 -163
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/corroboration.ts +119 -119
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/graduation.ts +132 -132
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/orchestrator.ts +70 -70
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/output-builder.ts +121 -130
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/plan-questions.ts +101 -102
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/review-pipeline.ts +507 -511
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/agent.ts +73 -74
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/base/base-agent.ts +217 -217
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/index.ts +12 -12
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/claude-agent.ts +66 -66
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/codex-agent.ts +185 -185
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/gemini-agent.ts +39 -39
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/orchestrator-claude-agent.ts +196 -196
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/schemas.ts +201 -201
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/types.ts +23 -23
- package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/verdict.ts +72 -72
- package/dist/templates/cc-native/_cc-native/{workflows → plan-review/workflows}/specdev.md +9 -9
- package/oclif.manifest.json +1 -1
- package/package.json +6 -5
- package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +0 -21
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# MetaPlan Workflow
|
|
2
|
+
|
|
3
|
+
> **Trigger:** "meta-plan", "chain thinking", "dissect problem", "comprehensive plan", "help me figure out the right approach"
|
|
4
|
+
|
|
5
|
+
## Reference Material
|
|
6
|
+
|
|
7
|
+
- `../CLAUDE.md` — MetaPlan system spec: purpose, design decisions, constraints
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
A workflow for complex problems where choosing the right approach is harder than implementing it. Chains thinking categories together to produce a comprehensive, reviewable plan before any implementation begins.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- Problems with high ambiguity or large solution spaces
|
|
16
|
+
- Multiple valid approaches where the trade-offs are unclear
|
|
17
|
+
- Unfamiliar domains requiring structured exploration before commitment
|
|
18
|
+
- Multi-stakeholder problems needing multiple perspectives
|
|
19
|
+
- Any situation where "version 1" quality matters and rework is expensive
|
|
20
|
+
|
|
21
|
+
## When NOT to Use
|
|
22
|
+
|
|
23
|
+
- The solution is already known — just implement it
|
|
24
|
+
- Simple, well-scoped tasks with obvious approaches
|
|
25
|
+
- Trivial fixes, typos, or configuration changes
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Section 1 — Intent Preservation (First-Principles Decomposition)
|
|
30
|
+
|
|
31
|
+
Decompose the user's prompt into 5 categories. **Preserve all information** from the original prompt — no summarizing, no condensing, no abbreviating. Quote verbatim where possible.
|
|
32
|
+
|
|
33
|
+
### The 5 Decomposition Categories
|
|
34
|
+
|
|
35
|
+
1. **Explicit wants** — what they directly asked for, quoted verbatim where possible
|
|
36
|
+
2. **Implied wants** — what they expect but didn't state (inferred from context, domain norms, prior work)
|
|
37
|
+
3. **Explicit constraints** — stated limitations, requirements, boundaries, deadlines
|
|
38
|
+
4. **Implied constraints** — assumed limitations from context, domain norms, technical environment, prior decisions
|
|
39
|
+
5. **Anti-wants** — what they explicitly or implicitly don't want (stated rejections, implied aversions, things to avoid)
|
|
40
|
+
|
|
41
|
+
### Information Loss Check
|
|
42
|
+
|
|
43
|
+
After completing the decomposition, **re-read the original prompt in full** and explicitly list any information not captured in the 5 categories above. This prevents silent information loss.
|
|
44
|
+
|
|
45
|
+
Output one of:
|
|
46
|
+
- A numbered list of missed information items (then incorporate them into the appropriate category)
|
|
47
|
+
- "None — all information captured" (only if genuinely everything is accounted for)
|
|
48
|
+
|
|
49
|
+
### Problem Classification
|
|
50
|
+
|
|
51
|
+
Classify the problem along these dimensions to guide which thinking categories to apply:
|
|
52
|
+
|
|
53
|
+
| Dimension | Assessment |
|
|
54
|
+
|-----------|-----------|
|
|
55
|
+
| **Ambiguity level** | How many valid interpretations exist? (Low: 1-2, Medium: 3-5, High: 5+) |
|
|
56
|
+
| **Solution space size** | How many viable approaches exist? (Small: 1-2, Medium: 3-5, Large: 5+) |
|
|
57
|
+
| **Domain familiarity** | How well-understood is the problem domain? (Familiar / Partially familiar / Unfamiliar) |
|
|
58
|
+
| **Stakeholder count** | How many perspectives must be considered? (Single / Few / Many) |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Section 2 — Problem Classification Decision Tree
|
|
63
|
+
|
|
64
|
+
Based on the characteristics from Section 1, select which thinking categories to apply and in what order. **Not all categories are required for every problem** — the decision tree gates execution, not just ordering.
|
|
65
|
+
|
|
66
|
+
| Problem Profile | Categories to Apply | Rationale |
|
|
67
|
+
|----------------|-------------------|-----------|
|
|
68
|
+
| High ambiguity, any domain | 1 → 2 → 3 → 7 (Decomposition → Divergent → Convergent → Integration) | Must explore broadly before narrowing |
|
|
69
|
+
| Large solution space, familiar domain | 1 → 2 → 4 → 5 → 7 (Decomposition → Divergent → Adversarial → Trade-off → Integration) | Need to stress-test candidates |
|
|
70
|
+
| Unfamiliar domain, any ambiguity | 1 → 6 → 2 → 3 → 7 (Decomposition → Expert Synthesis → Divergent → Convergent → Integration) | Research before ideation |
|
|
71
|
+
| Multi-stakeholder, moderate ambiguity | 1 → 6 → 5 → 4 → 7 (Decomposition → Expert Synthesis → Trade-off → Adversarial → Integration) | Gather perspectives, evaluate trade-offs |
|
|
72
|
+
| Low ambiguity, small solution space | 1 → 4 → 7 (Decomposition → Adversarial → Integration) | Quick path: decompose, stress-test, synthesize |
|
|
73
|
+
| Multiple valid approaches, familiar domain | 1 → 2 → 5 → 4 → 7 (Decomposition → Divergent → Trade-off → Adversarial → Integration) | Compare, evaluate, stress-test |
|
|
74
|
+
|
|
75
|
+
Numbers reference the 7 categories in Section 3.
|
|
76
|
+
|
|
77
|
+
**If no profile matches exactly:** Select the closest match, or combine elements. When in doubt, use the full sequence: 1 → 2 → 3 → 4 → 5 → 6 → 7.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Section 3 — The 7 Thinking Categories
|
|
82
|
+
|
|
83
|
+
Each category has concrete instructions to execute directly. External skills discovered at runtime (see Section 4) can enhance any category but are never required.
|
|
84
|
+
|
|
85
|
+
### Category 1: Decomposition
|
|
86
|
+
|
|
87
|
+
Break the complex problem into atomic sub-problems that can be addressed independently.
|
|
88
|
+
|
|
89
|
+
**Instructions:**
|
|
90
|
+
- List every distinct sub-problem, constraint, and dependency
|
|
91
|
+
- Identify which sub-problems are independent (parallelizable) vs. sequential (dependent)
|
|
92
|
+
- For each sub-problem, state what "solved" looks like in one sentence
|
|
93
|
+
- Map dependencies: which sub-problems must be solved before others can start
|
|
94
|
+
|
|
95
|
+
**Output:** Numbered list of sub-problems with dependency relationships noted.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Category 2: Divergent Ideation
|
|
100
|
+
|
|
101
|
+
Generate multiple distinct solution candidates — prioritize breadth over depth.
|
|
102
|
+
|
|
103
|
+
**Instructions:**
|
|
104
|
+
- For each sub-problem (or the whole problem if atomic), brainstorm 3-5 fundamentally different approaches
|
|
105
|
+
- Each approach must differ in architecture, not just parameters (e.g., "use a queue" vs "use polling" vs "use webhooks" — not "poll every 5s" vs "poll every 10s")
|
|
106
|
+
- Name each approach with a descriptive 3-5 word label
|
|
107
|
+
- For each, list 1-2 key strengths and 1-2 key weaknesses in brief
|
|
108
|
+
|
|
109
|
+
**Output:** Table of approaches per sub-problem, each with a label, strengths, and weaknesses.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### Category 3: Convergent Analysis
|
|
114
|
+
|
|
115
|
+
Narrow from many candidates to 1-3 finalists using structured evaluation.
|
|
116
|
+
|
|
117
|
+
**Instructions:**
|
|
118
|
+
- Define 3-5 evaluation criteria relevant to this problem (e.g., complexity, performance, maintainability, risk, time-to-implement)
|
|
119
|
+
- Score each approach against each criterion (High / Medium / Low)
|
|
120
|
+
- Identify deal-breakers: any approach that fails a critical criterion is eliminated with stated reason
|
|
121
|
+
- Rank surviving approaches
|
|
122
|
+
|
|
123
|
+
**Output:** Evaluation matrix with scores, eliminations noted, and shortlist of 1-3 surviving approaches.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Category 4: Adversarial Challenge
|
|
128
|
+
|
|
129
|
+
Stress-test the leading approach(es) by actively trying to break them.
|
|
130
|
+
|
|
131
|
+
**Instructions:**
|
|
132
|
+
- Answer each question for the leading approach:
|
|
133
|
+
- "What is the strongest argument against this approach?"
|
|
134
|
+
- "Under what conditions does this approach fail catastrophically?"
|
|
135
|
+
- "What is the most likely way this approach produces a subtly wrong result?"
|
|
136
|
+
- "If I had to argue for a completely different approach, what would I say?"
|
|
137
|
+
- For each identified weakness, either:
|
|
138
|
+
- Propose a concrete mitigation, or
|
|
139
|
+
- Acknowledge the risk explicitly with conditions under which it becomes critical
|
|
140
|
+
|
|
141
|
+
**Output:** List of challenges with mitigations or acknowledged risks.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### Category 5: Trade-off Evaluation
|
|
146
|
+
|
|
147
|
+
Compare surviving approaches on key dimensions with explicit trade-off acknowledgment.
|
|
148
|
+
|
|
149
|
+
**Instructions:**
|
|
150
|
+
- For each pair of finalist approaches, state what you gain and what you lose by choosing one over the other
|
|
151
|
+
- Identify irreversible decisions (hard to change later) vs. reversible ones (can switch cheaply)
|
|
152
|
+
- State the conditions under which you would switch from the recommended approach to an alternative
|
|
153
|
+
- Flag any "one-way door" decisions that deserve extra scrutiny
|
|
154
|
+
|
|
155
|
+
**Output:** Trade-off matrix with gain/lose analysis and switching conditions.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### Category 6: Expert Synthesis
|
|
160
|
+
|
|
161
|
+
Gather domain-specific knowledge relevant to the problem.
|
|
162
|
+
|
|
163
|
+
**Instructions:**
|
|
164
|
+
- What established patterns, best practices, or prior art exist for this type of problem?
|
|
165
|
+
- What domain-specific constraints or conventions apply that a non-expert might miss?
|
|
166
|
+
- What are the known failure modes or anti-patterns in this domain?
|
|
167
|
+
- What would a domain expert check first?
|
|
168
|
+
|
|
169
|
+
*Note: This category operates on available knowledge. If external research tools or skills are available in the environment, use them to augment this category.*
|
|
170
|
+
|
|
171
|
+
**Output:** Domain knowledge summary with explicit relevance to the current problem.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### Category 7: Integration
|
|
176
|
+
|
|
177
|
+
Combine all thinking outputs into a coherent, actionable plan.
|
|
178
|
+
|
|
179
|
+
**Instructions:**
|
|
180
|
+
- State the recommended approach with rationale referencing evidence from prior categories
|
|
181
|
+
- List trade-offs explicitly acknowledged (from Category 5)
|
|
182
|
+
- List risks explicitly accepted with mitigations (from Category 4)
|
|
183
|
+
- Apply domain knowledge as validation (from Category 6, if used)
|
|
184
|
+
- Define concrete next steps with enough detail to begin execution immediately
|
|
185
|
+
|
|
186
|
+
**Output:** Structured plan document containing:
|
|
187
|
+
- Problem decomposition results
|
|
188
|
+
- Approaches considered with trade-offs
|
|
189
|
+
- Recommended approach with rationale
|
|
190
|
+
- Risk assessment with mitigations
|
|
191
|
+
- Domain context applied (if Category 6 was used)
|
|
192
|
+
- Actionable next steps
|
|
193
|
+
- Execution Manifest (from Section 4)
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Section 4 — Runtime Skill Discovery (Two-Pass)
|
|
198
|
+
|
|
199
|
+
Before executing the thinking chain, scan for ALL available skills and commands in the current environment. Skills serve two distinct roles in MetaPlan — they can enhance the *thinking* process and/or become steps in the *execution* plan.
|
|
200
|
+
|
|
201
|
+
### Discovery Protocol
|
|
202
|
+
|
|
203
|
+
**Pass 1 — Enumerate:** Scan all available skills, commands, and workflows in the current environment (skill registries, help commands, workflow directories). For each, read its description or summary.
|
|
204
|
+
|
|
205
|
+
**Pass 2 — Classify:** Place each discovered skill into one or both categories:
|
|
206
|
+
|
|
207
|
+
**Thinking Skills** — enhance one of the 7 thinking categories during the MetaPlan process itself:
|
|
208
|
+
- Decomposition-related skills → Category 1
|
|
209
|
+
- Ideation/creativity skills → Category 2
|
|
210
|
+
- Analysis/evaluation skills → Category 3
|
|
211
|
+
- Adversarial/red-team skills → Category 4
|
|
212
|
+
- Comparison/trade-off skills → Category 5
|
|
213
|
+
- Research/domain-knowledge skills → Category 6
|
|
214
|
+
- Synthesis/integration skills → Category 7
|
|
215
|
+
|
|
216
|
+
**Auxiliary Skills** — relevant to *executing* the recommended solution, not to thinking about it:
|
|
217
|
+
- Domain-specific tools (coding standards, linting, formatting, testing frameworks)
|
|
218
|
+
- Content processing (PDF extraction, image generation, data transformation)
|
|
219
|
+
- Research and information gathering (web search, content analysis)
|
|
220
|
+
- Communication and output (presentation, documentation, knowledge management)
|
|
221
|
+
- Automation and infrastructure (browser automation, deployment, CI/CD)
|
|
222
|
+
- Any skill that the person executing the plan would benefit from knowing about
|
|
223
|
+
|
|
224
|
+
A single skill can appear in both lists — e.g., a research skill might enhance Category 6 (Expert Synthesis) during thinking AND be a standalone step in the execution plan.
|
|
225
|
+
|
|
226
|
+
### If Zero Skills Are Discovered
|
|
227
|
+
|
|
228
|
+
Proceed with inline instructions only. This is the **normal path**, not a degraded path. The inline instructions in Section 3 are complete and self-contained, and the plan output uses generic step descriptions instead of skill-specific invocations.
|
|
229
|
+
|
|
230
|
+
### Skill Inventory (Required Output)
|
|
231
|
+
|
|
232
|
+
After discovery, output the classified inventory:
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
## Skill Inventory
|
|
236
|
+
|
|
237
|
+
### Thinking Skills (enhance MetaPlan categories)
|
|
238
|
+
| Skill | Maps To | Role |
|
|
239
|
+
|-------|---------|------|
|
|
240
|
+
| [name] | Category N | Enhances/replaces inline instructions |
|
|
241
|
+
|
|
242
|
+
### Auxiliary Skills (available for execution plan)
|
|
243
|
+
| Skill | Domain | Potential Use |
|
|
244
|
+
|-------|--------|---------------|
|
|
245
|
+
| [name] | [domain] | [how it helps execute the solution] |
|
|
246
|
+
|
|
247
|
+
### Unclassified
|
|
248
|
+
| Skill | Reason |
|
|
249
|
+
|-------|--------|
|
|
250
|
+
| [name] | Not relevant to this problem |
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Section 5 — Chain Execution
|
|
256
|
+
|
|
257
|
+
Execute the thinking categories selected by the decision tree (Section 2), in the specified order.
|
|
258
|
+
|
|
259
|
+
**Rules:**
|
|
260
|
+
- Feed each category's output forward as context for subsequent categories
|
|
261
|
+
- Accumulate all outputs in a running document
|
|
262
|
+
- If a category's output reveals new information that changes earlier conclusions, note the update explicitly (e.g., "Category 4 revealed X, which changes the Category 2 assessment of approach Y")
|
|
263
|
+
- Do not skip a selected category — if the decision tree selected it, execute it
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Section 6 — Plan Synthesis
|
|
268
|
+
|
|
269
|
+
The Integration category (Category 7) produces the final plan. This is the primary deliverable of MetaPlan — a **sequential, step-by-step execution plan** that a new session can follow mechanically.
|
|
270
|
+
|
|
271
|
+
The plan captures in plan mode or the project's context/notes system automatically. No special output file handling is needed.
|
|
272
|
+
|
|
273
|
+
### Part A — Analysis Summary
|
|
274
|
+
|
|
275
|
+
Summarize the thinking work that informed the plan:
|
|
276
|
+
|
|
277
|
+
1. **Problem decomposition** — sub-problems identified and dependency-mapped (Category 1)
|
|
278
|
+
2. **Solution landscape** — approaches considered with strengths and weaknesses (Category 2)
|
|
279
|
+
3. **Evaluation** — how approaches were narrowed, what was eliminated and why (Category 3, if used)
|
|
280
|
+
4. **Risk assessment** — stress-test results with mitigations or accepted risks (Category 4)
|
|
281
|
+
5. **Trade-off analysis** — what is gained and lost with the recommended approach (Category 5, if used)
|
|
282
|
+
6. **Domain context** — relevant patterns, practices, and failure modes applied (Category 6, if used)
|
|
283
|
+
7. **Recommended approach** — clear statement with rationale referencing evidence above
|
|
284
|
+
|
|
285
|
+
### Part B — Sequential Execution Plan (Skill Chain)
|
|
286
|
+
|
|
287
|
+
The core deliverable. A numbered sequence of steps that interleaves thinking categories and auxiliary skills into a single executable chain. Each step specifies exactly what to do, so a new session can follow it without additional context.
|
|
288
|
+
|
|
289
|
+
**Step format:**
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
### Step N: [Action description]
|
|
293
|
+
- **Invoke:** [Skill name, thinking category, or "manual" for inline work]
|
|
294
|
+
- **Input:** [What to feed this step — output from a prior step, user context, or specific files]
|
|
295
|
+
- **Expected output:** [What this step produces — be specific enough to verify completion]
|
|
296
|
+
- **Feeds into:** Step M [or "Final output"]
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Branching format** (when a step's output determines the next path):
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
### Step N: [Decision point description]
|
|
303
|
+
- **Invoke:** [Skill or category]
|
|
304
|
+
- **Input:** [What to evaluate]
|
|
305
|
+
- **Branch:**
|
|
306
|
+
- IF [condition A] → proceed to Step M
|
|
307
|
+
- IF [condition B] → proceed to Step P
|
|
308
|
+
- ELSE → proceed to Step Q
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Overlay format** (when a thinking category and auxiliary skill run together):
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
### Step N: [Combined action description]
|
|
315
|
+
- **Invoke:** [Thinking category] + [Auxiliary skill]
|
|
316
|
+
- **Role of thinking category:** [What the category contributes — e.g., adversarial pressure]
|
|
317
|
+
- **Role of auxiliary skill:** [What the skill contributes — e.g., domain standards to test against]
|
|
318
|
+
- **Input:** [Combined input context]
|
|
319
|
+
- **Expected output:** [Combined output]
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Rules for building the chain:**
|
|
323
|
+
- Every step must have a clear input and output — no dangling steps
|
|
324
|
+
- Thinking categories from Section 3 and auxiliary skills from Section 4 can freely interleave
|
|
325
|
+
- A single step can overlay a thinking category with one or more auxiliary skills when they naturally combine
|
|
326
|
+
- Branching logic uses IF/ELSE based on concrete, observable conditions from the prior step's output
|
|
327
|
+
- The chain must be followable by a session with zero prior context — include enough detail in each step
|
|
328
|
+
- If no auxiliary skills were discovered, the chain uses thinking categories and manual inline steps only
|
|
329
|
+
|
|
330
|
+
### Part C — Skill Inventory
|
|
331
|
+
|
|
332
|
+
Include the full Skill Inventory from Section 4 so the executing session knows what tools are available.
|
|
333
|
+
|
|
334
|
+
### Part D — Execution Manifest
|
|
335
|
+
|
|
336
|
+
After completing the thinking chain, output a summary showing what ran and how:
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
## Execution Manifest
|
|
340
|
+
| Step | Type | Skill/Category Used | Method |
|
|
341
|
+
|------|------|---------------------|--------|
|
|
342
|
+
| 1 | Thinking | Category 1: Decomposition | Inline |
|
|
343
|
+
| 2 | Auxiliary | [discovered skill name] | Skill invocation |
|
|
344
|
+
| 3 | Thinking + Auxiliary | Category 4 + [skill name] | Overlay |
|
|
345
|
+
| 4 | Branch | — | IF/ELSE on Step 3 output |
|
|
346
|
+
| ... | ... | ... | ... |
|
|
347
|
+
```
|
|
@@ -150,7 +150,7 @@ If a plan document path was provided in `$ARGUMENTS`:
|
|
|
150
150
|
Instead of writing the file directly, pipe your handoff content to the save script:
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
bun .aiwcli/_shared/handoff-system/scripts/save_handoff.ts "{context_id}" <<'EOF'
|
|
153
|
+
bun .aiwcli/_shared/skills/handoff-system/scripts/save_handoff.ts "{context_id}" <<'EOF'
|
|
154
154
|
{Your complete handoff markdown content from Step 3}
|
|
155
155
|
EOF
|
|
156
156
|
```
|