@axis-bootstrap/cli 0.1.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/README.md +90 -0
- package/package.json +42 -0
- package/src/commands/audit.js +53 -0
- package/src/commands/cleanup.js +42 -0
- package/src/commands/doctor.js +137 -0
- package/src/commands/init.js +297 -0
- package/src/commands/link.js +31 -0
- package/src/commands/spdd.js +139 -0
- package/src/commands/state.js +21 -0
- package/src/index.js +113 -0
- package/src/lib/copy.js +19 -0
- package/src/lib/detect.js +70 -0
- package/src/lib/i18n.js +147 -0
- package/src/lib/paths.js +45 -0
- package/src/lib/ui.js +29 -0
- package/templates/CANVAS.md +48 -0
- package/templates/CONVENTIONS.md +43 -0
- package/templates/INSTRUCTIONS.md +49 -0
- package/templates/STATE.md +27 -0
- package/templates/bootstrap-skill/PLANNER.md +221 -0
- package/templates/bootstrap-skill/PROMPT-TEMPLATE.md +128 -0
- package/templates/bootstrap-skill/SKILL.md +56 -0
- package/templates/bootstrap-skill/references/CANVAS-REASONS.md +111 -0
- package/templates/bootstrap-skill/references/PATTERNS.md +372 -0
- package/templates/bootstrap-skill/references/PHASE-1-DISCOVERY.md +120 -0
- package/templates/bootstrap-skill/references/PHASE-2-SPEC.md +250 -0
- package/templates/bootstrap-skill/references/PHASE-3-HARNESS.md +331 -0
- package/templates/bootstrap-skill/references/PHASE-4-MEMORY.md +187 -0
- package/templates/bootstrap-skill/references/PHASE-5-VALIDATION.md +194 -0
- package/templates/bootstrap-skill/references/QUICKSTART.md +144 -0
- package/templates/bootstrap-skill/references/TEMPLATES.md +602 -0
- package/templates/bootstrap-skill/references/UNIVERSAL-MAP.md +216 -0
- package/templates/settings.json +29 -0
- package/templates/setup-ide-links.sh +33 -0
- package/templates/skills/abstraction-first.md +55 -0
- package/templates/skills/alignment.md +53 -0
- package/templates/skills/iterative-review.md +55 -0
- package/templates/skills/story-decompose.md +54 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
# Patterns — Technical Patterns of the Framework
|
|
2
|
+
|
|
3
|
+
Reusable patterns that the bootstrap applies and that should be followed in any post-bootstrap project evolution.
|
|
4
|
+
|
|
5
|
+
## Index
|
|
6
|
+
|
|
7
|
+
| # | Pattern | Layer |
|
|
8
|
+
| --- | ---------------------------------- | ---------- |
|
|
9
|
+
| 1 | Progressive Disclosure | Spec |
|
|
10
|
+
| 2 | Token Budget | Spec |
|
|
11
|
+
| 3 | Knowledge Verification Chain | Harness |
|
|
12
|
+
| 4 | Auto-Sizing by Complexity | Harness |
|
|
13
|
+
| 5 | Skill Granularity | Spec |
|
|
14
|
+
| 6 | Description Quality | Spec |
|
|
15
|
+
| 7 | Flows vs State | Spec |
|
|
16
|
+
| 8 | Composability Between Skills | Spec |
|
|
17
|
+
| 9 | Maintenance Loop | Memory |
|
|
18
|
+
| 10 | Anthropic Three-Agent Pattern | Harness |
|
|
19
|
+
| 11 | Usage Scenarios | (examples) |
|
|
20
|
+
| 12 | ACE — Memory as Evolving Playbook | Memory |
|
|
21
|
+
| 13 | K-Trial Reliability | Harness |
|
|
22
|
+
| 14 | Testable Spec (Anti-Verbosity) | Spec |
|
|
23
|
+
| 15 | Bidirectional Spec-Code Sync | Memory |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 1. Progressive Disclosure (3 Layers)
|
|
28
|
+
|
|
29
|
+
The spec loads in three distinct moments to minimize tokens:
|
|
30
|
+
|
|
31
|
+
| Layer | When it loads | Content | Cost |
|
|
32
|
+
| ----------------- | ---------------- | --------------------------------------- | -------------- |
|
|
33
|
+
| **1 — Discovery** | Always (startup) | `name` + `description` from frontmatter | ~3 lines/skill |
|
|
34
|
+
| **2 — Index** | When relevant | Full `SKILL.md` | ~40-60 lines |
|
|
35
|
+
| **3 — On-demand** | When needed | `references/*.md` | on demand |
|
|
36
|
+
|
|
37
|
+
The agent knows a skill exists (layer 1), decides if it needs it (layer 2), only pulls deep details when implementing (layer 3).
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 2. Token Budget
|
|
42
|
+
|
|
43
|
+
Progressive Disclosure only works with explicit limits. Define:
|
|
44
|
+
|
|
45
|
+
| Category | Budget | Rule |
|
|
46
|
+
| ------------------------------------------- | -------------------- | ------------------------------- |
|
|
47
|
+
| **Fixed base** (INSTRUCTIONS + frontmatter) | ~1,500-2,000 tokens | Always loaded |
|
|
48
|
+
| **Active skills** (full SKILL.md) | ~3,000-5,000 tokens | Only relevant ones for the task |
|
|
49
|
+
| **References on-demand** | ~5,000-10,000 tokens | Only when necessary |
|
|
50
|
+
| **Target total** | <15,000 tokens | Reserve maximum for reasoning |
|
|
51
|
+
|
|
52
|
+
**Loading rules:**
|
|
53
|
+
|
|
54
|
+
- Never load multiple `SKILL.md` simultaneously if not for the same task
|
|
55
|
+
- Never load multiple architecture docs at the same time
|
|
56
|
+
- When reaching the limit, unload the oldest content
|
|
57
|
+
- Warn when the docs context exceeds the budget (signal of oversized skills)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 3. Knowledge Verification Chain
|
|
62
|
+
|
|
63
|
+
**Before asserting anything**, the agent follows this order **mandatorily**:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Step 1: Codebase → verify existing code, conventions and patterns
|
|
67
|
+
Step 2: Project docs → README, .ai/docs/, inline comments, skills
|
|
68
|
+
Step 3: Official docs (MCP/Context7) → resolve lib ID, consult current API
|
|
69
|
+
Step 4: Web search → official docs, reliable sources, community standards
|
|
70
|
+
Step 5: Mark as uncertain → "I'm not sure about X — please verify"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Inviolable rules:**
|
|
74
|
+
|
|
75
|
+
- Never skip to Step 5 if 1-4 are available
|
|
76
|
+
- Step 5 is **always** signaled as uncertain — never presented as fact
|
|
77
|
+
- **Never assume or fabricate.** If not found, say "I found no documentation"
|
|
78
|
+
- Inventing APIs, patterns or behaviors causes cascading failures: wrong design → wrong tasks → wrong implementation
|
|
79
|
+
- Uncertainty is always preferable to fabrication
|
|
80
|
+
|
|
81
|
+
This chain must be referenced in `CONVENTIONS.md` and can be an independent rule in `.ai/rules/knowledge-verification.md`.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 4. Auto-Sizing by Complexity
|
|
86
|
+
|
|
87
|
+
Not every task needs the same level of planning. Before starting, the agent evaluates:
|
|
88
|
+
|
|
89
|
+
| Complexity | Indicators | Documentation | What to skip |
|
|
90
|
+
| ----------- | ----------------------------- | ----------------------------- | -------------------------------- |
|
|
91
|
+
| **Small** | ≤3 files, scope in 1 sentence | Describe → Implement → Verify | Spec, design, task breakdown |
|
|
92
|
+
| **Medium** | Clear feature, <10 steps | Brief spec + inline design | Formal design |
|
|
93
|
+
| **Large** | Multi-component, >10 steps | Full spec + design + tasks | Nothing |
|
|
94
|
+
| **Complex** | Ambiguity, new domain | Spec + discussion + research | Nothing + interactive validation |
|
|
95
|
+
|
|
96
|
+
**Rules:**
|
|
97
|
+
|
|
98
|
+
- **Specify** and **Execute** are always mandatory — always know WHAT and DO IT
|
|
99
|
+
- **Design** is skipped if the change is direct (no new architectural decisions)
|
|
100
|
+
- **Task breakdown** is skipped if there are ≤3 obvious steps
|
|
101
|
+
- **Safety valve:** even when tasks are skipped, the agent lists steps inline. If the listing reveals >5 steps or complex dependencies, **STOP** and create a formal task breakdown
|
|
102
|
+
|
|
103
|
+
Avoids two extremes: over-engineering on simple tasks (burns tokens with ceremony) and under-planning on complex ones (generates rework).
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 5. Skill Granularity
|
|
108
|
+
|
|
109
|
+
**When to create a new skill:**
|
|
110
|
+
|
|
111
|
+
- Domain has >5 specific concepts
|
|
112
|
+
- Has its own workflow
|
|
113
|
+
- Information not derivable from the code without external context
|
|
114
|
+
- Agent makes recurring errors without the skill
|
|
115
|
+
|
|
116
|
+
**When to expand an existing one:**
|
|
117
|
+
|
|
118
|
+
- Information is complementary
|
|
119
|
+
- `SKILL.md` is still <60 lines after addition
|
|
120
|
+
- Use scenario is the same
|
|
121
|
+
|
|
122
|
+
**When to use `docs/` instead of a skill:**
|
|
123
|
+
|
|
124
|
+
- It is pure reference documentation (schema, contracts)
|
|
125
|
+
- Does not involve a workflow
|
|
126
|
+
- Will be referenced by multiple skills
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 6. Description Quality
|
|
131
|
+
|
|
132
|
+
The `description` in the frontmatter is the **only information** the agent reads in 100% of sessions. It determines whether the skill is used or ignored.
|
|
133
|
+
|
|
134
|
+
**Checklist:**
|
|
135
|
+
|
|
136
|
+
- [ ] Contains exact domain terms that appear in developer questions
|
|
137
|
+
- [ ] Lists scenarios with action verbs ("implementing", "debugging", "understanding")
|
|
138
|
+
- [ ] Has 2-4 lines (1 is vague, 5+ is excessive)
|
|
139
|
+
- [ ] A new developer understands when to use it just by reading the description
|
|
140
|
+
|
|
141
|
+
**Example:**
|
|
142
|
+
|
|
143
|
+
```yaml
|
|
144
|
+
# Weak
|
|
145
|
+
description: Reference for the payments API integration.
|
|
146
|
+
|
|
147
|
+
# Strong
|
|
148
|
+
description: Complete reference for the Payments API integration.
|
|
149
|
+
Use when implementing API calls (endpoints, auth, payload format),
|
|
150
|
+
debugging API responses (error codes, rate limits),
|
|
151
|
+
or understanding the retry strategy and idempotency rules.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 7. Flows vs State
|
|
157
|
+
|
|
158
|
+
| Type | Where | Example |
|
|
159
|
+
| --------------- | ----------------------------------- | ------------------------- |
|
|
160
|
+
| Workflow | `skills/<name>/SKILL.md` | "How to collect API data" |
|
|
161
|
+
| Algorithm/logic | `skills/<name>/references/GUIDE.md` | "Deduplication logic" |
|
|
162
|
+
| Schema/contract | `docs/database-schema.md` | "Transactions table" |
|
|
163
|
+
| Current state | `docs/STATE.md` | "Feature X in progress" |
|
|
164
|
+
|
|
165
|
+
**Rule:** skills document **flows**; docs document **state**.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 8. Composability Between Skills
|
|
170
|
+
|
|
171
|
+
Skills often need each other. Protocol:
|
|
172
|
+
|
|
173
|
+
1. **Check availability** — before using another skill's functionality, check if it exists
|
|
174
|
+
2. **Delegate if available** — use the complementary skill, do not reimplement
|
|
175
|
+
3. **Graceful fallback** — if not available, use the standard approach
|
|
176
|
+
4. **Recommend once** — suggest installation at most once per session
|
|
177
|
+
|
|
178
|
+
**How to document in SKILL.md:**
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
## Integrations
|
|
182
|
+
|
|
183
|
+
- **Diagrams:** If `mermaid-studio` available, delegate diagram creation.
|
|
184
|
+
Fallback: inline Mermaid code blocks.
|
|
185
|
+
- **Exploration:** If `codenavi` available, delegate navigation.
|
|
186
|
+
Fallback: built-in search tools.
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Creates a modular ecosystem without rigid dependencies.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 9. Maintenance Loop
|
|
194
|
+
|
|
195
|
+
Unmaintained documentation becomes misinformation — worse than absent, because the agent acts with confidence on wrong info.
|
|
196
|
+
|
|
197
|
+
**Fundamental rule:** every relevant behavioral change in the code must be reflected in the skills/docs **in the same session**.
|
|
198
|
+
|
|
199
|
+
**Triggers:**
|
|
200
|
+
|
|
201
|
+
| Event | Expected action |
|
|
202
|
+
| ------------------------------------ | -------------------------------------------- |
|
|
203
|
+
| Code changes a skill's flow | Propose skill update before closing session |
|
|
204
|
+
| Business rule emerges | Ask if it should be documented in skill/docs |
|
|
205
|
+
| Bug reveals undocumented behavior | Propose documenting it |
|
|
206
|
+
| New integration | Evaluate new skill or expansion |
|
|
207
|
+
| Session paused with work in progress | Update `STATE.md` |
|
|
208
|
+
|
|
209
|
+
**Closing protocol:**
|
|
210
|
+
|
|
211
|
+
At the end of a session with changes, the agent:
|
|
212
|
+
|
|
213
|
+
1. Lists behavioral changes in the code
|
|
214
|
+
2. Identifies affected skills/docs
|
|
215
|
+
3. Asks: *"The following documentation needs updating: [list]. Update now?"*
|
|
216
|
+
|
|
217
|
+
Creates habit without being intrusive — does not update automatically, but does not let it pass without warning.
|
|
218
|
+
|
|
219
|
+
**The agent as documentation guardian:** with `CONVENTIONS.md` in context, actively identifies when code contradicts docs and reports — even when not asked.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 10. Anthropic Three-Agent Pattern
|
|
224
|
+
|
|
225
|
+
For long tasks, separate into sub-agents:
|
|
226
|
+
|
|
227
|
+
- **Planner** decomposes spec into tasks (does not execute)
|
|
228
|
+
- **Generator** implements tasks (does not decide)
|
|
229
|
+
- **Evaluator** validates output against spec (does not consult implementation history)
|
|
230
|
+
|
|
231
|
+
Application in the framework:
|
|
232
|
+
|
|
233
|
+
- `PLANNER.md` orchestrates phases (does not create artifacts)
|
|
234
|
+
- Each `PHASE-N.md` generates artifacts (does not decide the next phase)
|
|
235
|
+
- `PHASE-5-VALIDATION.md` validates (does not correct without confirmation)
|
|
236
|
+
|
|
237
|
+
This separation avoids the classic problem where the agent starts "adjusting" decisions while implementing, losing the original path.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 11. Usage Scenarios (examples)
|
|
242
|
+
|
|
243
|
+
### Scenario 1 — Implement an integration
|
|
244
|
+
|
|
245
|
+
```text
|
|
246
|
+
Dev: "Implement data sending to API X"
|
|
247
|
+
|
|
248
|
+
Startup: Agent reads INSTRUCTIONS.md, identifies via frontmatter
|
|
249
|
+
that skills api-integration and field-mapping are relevant.
|
|
250
|
+
|
|
251
|
+
Trigger: Reads the 2 SKILL.md (~80 lines total). Knows endpoints,
|
|
252
|
+
normalization flow, retry pattern.
|
|
253
|
+
|
|
254
|
+
On-demand: Needs full payload → reads API-REFERENCE.md.
|
|
255
|
+
Needs the mapping table → reads MAPPING-TABLE.md.
|
|
256
|
+
|
|
257
|
+
Total: ~400 lines, vs ~2,000+ if everything was in a monolithic file.
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Scenario 2 — New feature
|
|
261
|
+
|
|
262
|
+
```text
|
|
263
|
+
Dev: "Add support for processing marketplace data"
|
|
264
|
+
|
|
265
|
+
1. Agent reads collection skill → understands existing pattern
|
|
266
|
+
2. Reads architecture-patterns.md → knows how to create strategies
|
|
267
|
+
3. Reads code-style.md → follows naming conventions
|
|
268
|
+
4. Reads detailed guide → understands pagination, dedup, enrichment
|
|
269
|
+
|
|
270
|
+
Result: implements following patterns without asking.
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Scenario 3 — Multi-IDE
|
|
274
|
+
|
|
275
|
+
New dev uses Windsurf while team uses Cursor. Without additional configuration, Windsurf reads `AGENTS.md` (symlink to `.ai/INSTRUCTIONS.md`) and skills in `.agents/skills/` (symlink to `.ai/skills/`). Receives exactly the same context.
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 12. ACE — Memory as Evolving Playbook
|
|
280
|
+
|
|
281
|
+
> Based on: **Agentic Context Engineering** (arxiv 2510.04618). +10.6% in agent benchmarks, +8.6% in finance.
|
|
282
|
+
|
|
283
|
+
The ACE approach treats `STATE.md` as a **self-curating playbook** — not as a history log. Three operations per session:
|
|
284
|
+
|
|
285
|
+
| Operation | What it does | Frequency |
|
|
286
|
+
| -------------- | ----------------------------------------- | -------------------------- |
|
|
287
|
+
| **Generation** | Adds new learning, decision, blocker | Every session with changes |
|
|
288
|
+
| **Reflection** | Identifies what is resolved or obsolete | Every session |
|
|
289
|
+
| **Curation** | Removes the obsolete, elevates the useful | Every session |
|
|
290
|
+
|
|
291
|
+
**Curation rules:**
|
|
292
|
+
|
|
293
|
+
- STATE.md ≤ 80 lines → if larger, something was not removed
|
|
294
|
+
- An entry in "Lessons Learned" only enters if it is *non-obvious* — insights a new dev would not know
|
|
295
|
+
- "Deferred" is the organized trash can — idea that does not die, but does not block
|
|
296
|
+
|
|
297
|
+
**Why it works:** prevents the problem documented in Spec Kit issue #75 — specs that grow indefinitely generate noise, not context. Curated context > voluminous context.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## 13. K-Trial Reliability
|
|
302
|
+
|
|
303
|
+
> Based on: **ReliabilityBench** (arxiv 2601.06112). pass@1 overestimates reliability by 20-40%.
|
|
304
|
+
|
|
305
|
+
Instead of measuring only "did the agent pass this task?", AXIS recommends measuring consistency:
|
|
306
|
+
|
|
307
|
+
| Metric | What it measures | How to apply |
|
|
308
|
+
| ---------------- | ------------------------------ | ----------------------------------------- |
|
|
309
|
+
| **pass@1** | Passed on the first attempt | Baseline — do not use alone |
|
|
310
|
+
| **pass@k** | Passed in k independent runs | Smoke test the same flow 3x |
|
|
311
|
+
| **ε-robustness** | Passed with variation in input | Test with slight reformulation of request |
|
|
312
|
+
|
|
313
|
+
**Minimum protocol for smoke test in Phase 5:**
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# Run the same bootstrap command 3x on a test project
|
|
317
|
+
# If the result is identical in all 3 runs: reliable
|
|
318
|
+
# If it varies: document the variation point in STATE.md as blocker
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**Warning signal:** if the generated structure varies between sessions, the harness is under-configured — probably missing explicit template or acceptance criteria in the skill.
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## 14. Testable Spec (Anti-Verbosity)
|
|
326
|
+
|
|
327
|
+
> Based on: GitHub Spec Kit issue #75 ("creates illusion of work") and ReliabilityBench findings.
|
|
328
|
+
|
|
329
|
+
Long specs are not better specs. AXIS enforces:
|
|
330
|
+
|
|
331
|
+
| Artifact | Limit | Consequence of exceeding |
|
|
332
|
+
| ----------------- | ------------- | --------------------------------------- |
|
|
333
|
+
| `INSTRUCTIONS.md` | 100-180 lines | Context loaded always — direct noise |
|
|
334
|
+
| `SKILL.md` | ≤ 60 lines | Indexed always — each line costs tokens |
|
|
335
|
+
| `STATE.md` | ≤ 80 lines | Read at session start — must be focused |
|
|
336
|
+
|
|
337
|
+
**Testability criterion for a spec:** a spec item is testable if you can answer "how would I know the agent followed this?". If you can't answer, the item is too vague.
|
|
338
|
+
|
|
339
|
+
Examples:
|
|
340
|
+
|
|
341
|
+
| Vague (noise) | Testable (signal) |
|
|
342
|
+
| ----------------------- | ------------------------------------------------------------------ |
|
|
343
|
+
| "Follow best practices" | "Use `createQueryBuilder` for bulk insert >100 records" |
|
|
344
|
+
| "Be careful with data" | "Never execute `DROP` or `TRUNCATE` without explicit confirmation" |
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## 15. Bidirectional Spec-Code Sync
|
|
349
|
+
|
|
350
|
+
When code and spec diverge, the direction of the fix depends on the **type of change**:
|
|
351
|
+
|
|
352
|
+
| Change type | Direction | Rule |
|
|
353
|
+
| --------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------- |
|
|
354
|
+
| **Requirements changed** (new AC, business rule modified) | spec → code | Update the Canvas/skill/STATE first. Then regenerate or modify code guided by the updated spec. |
|
|
355
|
+
| **Refactoring** (structure/style, no behavior change) | code → spec | Refactor code first. Then sync the spec back to reflect the new structure. |
|
|
356
|
+
| **Bug fix** (behavior was wrong) | spec → code | Clarify the correct behavior in the spec. Then fix the code. Never patch code without closing the intent loop. |
|
|
357
|
+
|
|
358
|
+
**The golden rule:** when reality diverges from the spec, fix the spec first — then the code. The only exception is refactoring: clean the code, then sync.
|
|
359
|
+
|
|
360
|
+
**Why it matters:** if you patch code without updating the spec, the next session starts with wrong context. The agent "rediscovers" the bug. The spec is the upstream source of truth — code is its output.
|
|
361
|
+
|
|
362
|
+
**In AXIS terms:**
|
|
363
|
+
|
|
364
|
+
- `STATE.md` is updated before implementation when requirements change
|
|
365
|
+
- Skills are updated in the same session as the code that makes them stale
|
|
366
|
+
- The Maintenance Loop (Pattern #9) triggers at session end — this pattern triggers at change time
|
|
367
|
+
|
|
368
|
+
**Practical signals that divergence happened:**
|
|
369
|
+
|
|
370
|
+
- Agent proposes something the spec explicitly contradicts → spec is stale
|
|
371
|
+
- Code review reveals a pattern not in any rule → rule is missing
|
|
372
|
+
- Bug surfaces that a Safeguard should have caught → Safeguard was absent or vague
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Phase 1 — Discovery
|
|
2
|
+
|
|
3
|
+
**Goal:** understand the project deeply enough to generate a correct spec in Phase 2 without needing to go back.
|
|
4
|
+
|
|
5
|
+
**Typical duration:** 5-15 minutes of interview.
|
|
6
|
+
|
|
7
|
+
**Output of this phase:** a mental *Project Profile* (or text draft) covering type, tools, domains, constraints, quality target, and IDEs.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Principle: Read Before Asking
|
|
12
|
+
|
|
13
|
+
Before the first question, the agent:
|
|
14
|
+
|
|
15
|
+
1. Lists the target project files (up to 2 levels deep)
|
|
16
|
+
2. Reads `README.md`, `package.json`/`pyproject.toml`/equivalent, and any pre-existing AI file (`CLAUDE.md`, `AGENTS.md`)
|
|
17
|
+
3. Identifies the stack if possible
|
|
18
|
+
4. **Only then asks** — and never asks what is already in the files
|
|
19
|
+
|
|
20
|
+
This reduces friction and demonstrates attention to context.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Block 1 — Universal Questions (always ask)
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
1. In one sentence: what does this project do and for whom?
|
|
28
|
+
2. Is it a software project, or another type (content, research, business, legal, educational)?
|
|
29
|
+
3. How many people will work on it and for how long?
|
|
30
|
+
4. Which agents/IDEs will be used? (Claude Code, Cursor, Windsurf, Copilot, others)
|
|
31
|
+
5. Are there critical constraints? (compliance, deadline, budget, security)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Confirm the answers in a summary before advancing to Block 2.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Block 2 — Branching by Type
|
|
39
|
+
|
|
40
|
+
Use the answer to question 2 to choose the sub-block below. May apply more than one if the project is hybrid (e.g., research + content).
|
|
41
|
+
|
|
42
|
+
### If SOFTWARE
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
6a. What is the main stack? (language, framework, runtime)
|
|
46
|
+
7a. How does the project run? (exact command — npm run dev, python main.py, go run, etc.)
|
|
47
|
+
8a. Is there a database, queue, cache, or external services?
|
|
48
|
+
9a. Is there an adopted architecture pattern? (DI, hexagonal, monolith, microservices, MVC, etc.)
|
|
49
|
+
10a. Are there tests? What framework? Coverage of what?
|
|
50
|
+
11a. Is there CI/CD? Where? (GitHub Actions, GitLab CI, etc.)
|
|
51
|
+
12a. Which 3-5 areas/modules of the code have specific rules that deserve to become a skill?
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### If CONTENT (articles, marketing, technical docs)
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
6b. What is the format and distribution channel? (blog, LinkedIn, newsletter, book, video script)
|
|
58
|
+
7b. Tone of voice and target audience?
|
|
59
|
+
8b. Is there an established SEO, branding, or style guideline?
|
|
60
|
+
9b. What is the workflow? (briefing → draft → review → publish)
|
|
61
|
+
10b. Which skills would help? (e.g., "tone of voice", "article structure", "SEO checklist", "fact-checking")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### If RESEARCH / ACADEMIC
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
6c. What is the discipline and central research question?
|
|
68
|
+
7c. What methodology? (qualitative, quantitative, experimental, review)
|
|
69
|
+
8c. What artifacts will be produced? (paper, dataset, analysis code, slides)
|
|
70
|
+
9c. What conventions/norms? (APA, MLA, Chicago; citation format)
|
|
71
|
+
10c. Which skills? (e.g., "methodology", "data collection", "statistical analysis", "academic writing")
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### If BUSINESS / MANAGEMENT
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
6d. What is the goal? (strategic planning, OKRs, reports, market analysis)
|
|
78
|
+
7d. What are the expected artifacts? (deck, report, spreadsheet, BSC)
|
|
79
|
+
8d. Who are the stakeholders and what is their technical level?
|
|
80
|
+
9d. Are there adopted frameworks? (OKR, BSC, lean canvas, SWOT)
|
|
81
|
+
10d. Which skills? (e.g., "executive report structure", "SWOT analysis", "tone for board")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### If LEGAL / COMPLIANCE
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
6e. What jurisdiction and area? (labor, tax, GDPR/LGPD, contractual)
|
|
88
|
+
7e. What artifacts? (contracts, legal opinions, DPIA, policies)
|
|
89
|
+
8e. Are there official templates to follow?
|
|
90
|
+
9e. What critical risks to avoid?
|
|
91
|
+
10e. Which skills? (e.g., "contract drafting", "clause analysis", "compliance checklist")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### If EDUCATIONAL
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
6f. What is the target audience and level?
|
|
98
|
+
7f. What artifacts? (course, lesson plan, instructional material, assessment)
|
|
99
|
+
8f. Is there a pedagogical methodology? (PBL, Bloom, flipped classroom)
|
|
100
|
+
9f. Which skills? (e.g., "instructional design", "assessment design", "language for level X")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### If OTHER
|
|
104
|
+
|
|
105
|
+
Apply principles from [UNIVERSAL-MAP.md](UNIVERSAL-MAP.md) and adapt. Ultimately, every activity has:
|
|
106
|
+
|
|
107
|
+
- Knowledge domains (→ skills)
|
|
108
|
+
- Quality standards (→ rules)
|
|
109
|
+
- Final artifacts (→ templates)
|
|
110
|
+
- Continuity between sessions (→ memory)
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Block 3 — Quality Calibration
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
13. Is this a proof-of-concept, MVP, or production?
|
|
118
|
+
14. What level of validation is acceptable? (vibe-check, human review, automated gates, all)
|
|
119
|
+
15. Is there a history of problems the framework should prevent? (e.g., "we lose context whenever the dev changes", "AI responses diverge between IDEs")
|
|
120
|
+
```
|