learnship 2.0.10 → 2.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/.claude-plugin/plugin.json +2 -2
- package/.cursor-plugin/plugin.json +2 -2
- package/README.md +59 -14
- package/SKILL.md +24 -2
- package/agents/learnship-doc-writer.md +63 -0
- package/agents/learnship-security-auditor.md +67 -0
- package/bin/install.js +9 -4
- package/commands/learnship/discuss-phase.md +1 -1
- package/commands/learnship/docs-update.md +22 -0
- package/commands/learnship/execute-phase.md +2 -6
- package/commands/learnship/extract-learnings.md +22 -0
- package/commands/learnship/forensics.md +21 -0
- package/commands/learnship/help.md +2 -1
- package/commands/learnship/ideate.md +1 -1
- package/commands/learnship/milestone-summary.md +22 -0
- package/commands/learnship/note.md +22 -0
- package/commands/learnship/plan-phase.md +0 -1
- package/commands/learnship/quick.md +1 -5
- package/commands/learnship/secure-phase.md +23 -0
- package/commands/learnship/session-report.md +21 -0
- package/commands/learnship/undo.md +22 -0
- package/commands/learnship/verify-work.md +1 -1
- package/cursor-rules/learnship.mdc +12 -2
- package/gemini-extension.json +2 -2
- package/hooks/session-start +12 -1
- package/learnship/agents/doc-writer.md +63 -0
- package/learnship/agents/security-auditor.md +67 -0
- package/learnship/references/common-bug-patterns.md +92 -0
- package/learnship/references/context-budget.md +49 -0
- package/learnship/references/domain-probes.md +133 -0
- package/learnship/references/gates.md +72 -0
- package/learnship/references/planning-config.md +99 -9
- package/learnship/references/thinking-models.md +61 -0
- package/learnship/references/universal-anti-patterns.md +51 -0
- package/learnship/templates/agents.md +20 -6
- package/learnship/templates/context.md +207 -32
- package/learnship/templates/discussion-log.md +49 -0
- package/learnship/templates/security.md +61 -0
- package/learnship/templates/ui-spec.md +107 -0
- package/learnship/workflows/complete-milestone.md +4 -5
- package/learnship/workflows/compound.md +2 -0
- package/learnship/workflows/debug.md +2 -0
- package/learnship/workflows/discuss-phase.md +73 -15
- package/learnship/workflows/docs-update.md +144 -0
- package/learnship/workflows/execute-phase.md +42 -7
- package/learnship/workflows/extract-learnings.md +161 -0
- package/learnship/workflows/forensics.md +118 -0
- package/learnship/workflows/help.md +20 -2
- package/learnship/workflows/ideate.md +63 -4
- package/learnship/workflows/ls.md +1 -1
- package/learnship/workflows/milestone-summary.md +150 -0
- package/learnship/workflows/new-project.md +68 -4
- package/learnship/workflows/next.md +1 -1
- package/learnship/workflows/note.md +110 -0
- package/learnship/workflows/pause-work.md +2 -0
- package/learnship/workflows/plan-phase.md +17 -2
- package/learnship/workflows/quick.md +28 -8
- package/learnship/workflows/review.md +1 -0
- package/learnship/workflows/secure-phase.md +147 -0
- package/learnship/workflows/session-report.md +133 -0
- package/learnship/workflows/settings.md +40 -46
- package/learnship/workflows/ship.md +2 -0
- package/learnship/workflows/undo.md +151 -0
- package/learnship/workflows/verify-work.md +36 -4
- package/package.json +1 -1
- package/references/common-bug-patterns.md +92 -0
- package/references/context-budget.md +49 -0
- package/references/domain-probes.md +133 -0
- package/references/gates.md +72 -0
- package/references/planning-config.md +139 -0
- package/references/solution-schema.md +159 -0
- package/references/thinking-models.md +61 -0
- package/references/universal-anti-patterns.md +51 -0
- package/templates/agents.md +80 -7
- package/templates/config.json +28 -3
- package/templates/context.md +207 -32
- package/templates/discussion-log.md +49 -0
- package/templates/security.md +61 -0
- package/templates/ui-spec.md +107 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<gates>
|
|
2
|
+
|
|
3
|
+
Canonical gate types used across learnship workflows. Every validation checkpoint maps to one of these four types.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Gate Types
|
|
8
|
+
|
|
9
|
+
### Pre-flight Gate
|
|
10
|
+
**Purpose:** Validates preconditions before starting an operation.
|
|
11
|
+
**Behavior:** Blocks entry if conditions unmet. No partial work created.
|
|
12
|
+
**Recovery:** Fix the missing precondition, then retry.
|
|
13
|
+
**Examples:**
|
|
14
|
+
- plan-phase checks for REQUIREMENTS.md before planning
|
|
15
|
+
- execute-phase validates PLAN.md exists before execution
|
|
16
|
+
- discuss-phase confirms phase exists in ROADMAP.md
|
|
17
|
+
|
|
18
|
+
### Revision Gate
|
|
19
|
+
**Purpose:** Evaluates output quality and routes to revision if insufficient.
|
|
20
|
+
**Behavior:** Loops back to producer with specific feedback. Bounded by iteration cap.
|
|
21
|
+
**Recovery:** Producer addresses feedback; checker re-evaluates. The loop also escalates early if issue count does not decrease between consecutive iterations (stall detection). After max iterations, escalates unconditionally.
|
|
22
|
+
**Examples:**
|
|
23
|
+
- Plan-checker reviewing PLAN.md (max 3 iterations)
|
|
24
|
+
- Verifier checking phase deliverables against success criteria
|
|
25
|
+
|
|
26
|
+
### Escalation Gate
|
|
27
|
+
**Purpose:** Surfaces unresolvable issues to the developer for a decision.
|
|
28
|
+
**Behavior:** Pauses workflow, presents options, waits for human input.
|
|
29
|
+
**Recovery:** Developer chooses action; workflow resumes on selected path.
|
|
30
|
+
**Examples:**
|
|
31
|
+
- Revision loop exhausted after 3 iterations
|
|
32
|
+
- Ambiguous requirement needing clarification
|
|
33
|
+
- Security threat requiring human risk acceptance
|
|
34
|
+
|
|
35
|
+
### Abort Gate
|
|
36
|
+
**Purpose:** Terminates the operation to prevent damage or waste.
|
|
37
|
+
**Behavior:** Stops immediately, preserves state, reports reason.
|
|
38
|
+
**Recovery:** Developer investigates root cause, fixes, restarts from checkpoint.
|
|
39
|
+
**Examples:**
|
|
40
|
+
- Context window critically low during execution
|
|
41
|
+
- STATE.md in error state
|
|
42
|
+
- Verification finds critical missing deliverables
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Gate Matrix
|
|
47
|
+
|
|
48
|
+
| Workflow | Phase | Gate Type | Artifacts Checked | Failure Behavior |
|
|
49
|
+
|----------|-------|-----------|-------------------|------------------|
|
|
50
|
+
| plan-phase | Entry | Pre-flight | REQUIREMENTS.md, ROADMAP.md | Block with missing-file message |
|
|
51
|
+
| plan-phase | Step 6 | Revision | PLAN.md quality | Loop to planner (max 3) |
|
|
52
|
+
| plan-phase | Post-revision | Escalation | Unresolved issues | Surface to developer |
|
|
53
|
+
| execute-phase | Entry | Pre-flight | PLAN.md | Block with missing-plan message |
|
|
54
|
+
| execute-phase | Completion | Revision | SUMMARY.md completeness | Re-run incomplete tasks |
|
|
55
|
+
| verify-work | Entry | Pre-flight | SUMMARY.md | Block with missing-summary |
|
|
56
|
+
| verify-work | Evaluation | Escalation | Failed criteria | Surface gaps to developer |
|
|
57
|
+
| secure-phase | Entry | Pre-flight | SUMMARY.md | Block until phase executed |
|
|
58
|
+
| secure-phase | Threats | Escalation | Open threats | Present to developer for decision |
|
|
59
|
+
| quick | Plan check | Revision | PLAN.md quality | Loop (max 2) |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Applying Gates in Custom Workflows
|
|
64
|
+
|
|
65
|
+
When creating new workflows:
|
|
66
|
+
|
|
67
|
+
1. **Every workflow needs at least one pre-flight gate** — check that required inputs exist before starting work
|
|
68
|
+
2. **Any AI-generated output needs a revision gate** — bounded loops prevent infinite regeneration
|
|
69
|
+
3. **Decisions the AI cannot make need escalation gates** — risk acceptance, ambiguous requirements, conflicting constraints
|
|
70
|
+
4. **Resource exhaustion needs abort gates** — context budget, time limits, repeated failures
|
|
71
|
+
|
|
72
|
+
</gates>
|
|
@@ -181,4 +181,143 @@ Squash merge is recommended — keeps main branch history clean while preserving
|
|
|
181
181
|
|
|
182
182
|
</branching_strategy_behavior>
|
|
183
183
|
|
|
184
|
+
<v2_config_options>
|
|
185
|
+
|
|
186
|
+
## v2.0.0 Configuration Options
|
|
187
|
+
|
|
188
|
+
These options were added in v2.0.0 to support the new compounding, review, ship, and safety workflows.
|
|
189
|
+
|
|
190
|
+
| Option | Default | Description |
|
|
191
|
+
|--------|---------|-------------|
|
|
192
|
+
| `test_first` | `false` | Enable TDD mode — red-green-refactor cycle in executor |
|
|
193
|
+
| `workflow.review` | `true` | Enable the `/review` code review workflow |
|
|
194
|
+
| `workflow.solutions_search` | `true` | Search `.planning/solutions/` for prior art during plan-phase |
|
|
195
|
+
| `review.auto_after_verify` | `false` | Automatically run `/review` after verify-work passes |
|
|
196
|
+
| `ship.auto_test` | `true` | Run tests before shipping |
|
|
197
|
+
| `ship.conventional_commits` | `true` | Use conventional commit format in `/ship` |
|
|
198
|
+
| `ship.pr_template` | `true` | Auto-generate PR description in `/ship` |
|
|
199
|
+
|
|
200
|
+
</v2_config_options>
|
|
201
|
+
|
|
202
|
+
<v21_config_options>
|
|
203
|
+
|
|
204
|
+
## v2.1.0 Configuration Options
|
|
205
|
+
|
|
206
|
+
New sections and fields added in v2.1.0 for security, parallelization control, gates, and safety.
|
|
207
|
+
|
|
208
|
+
### Workflow Section (new fields)
|
|
209
|
+
|
|
210
|
+
| Option | Default | Description |
|
|
211
|
+
|--------|---------|-------------|
|
|
212
|
+
| `workflow.security_enforcement` | `true` | Enable per-phase security verification via `/secure-phase` |
|
|
213
|
+
| `workflow.discuss_mode` | `"discuss"` | Discussion mode for discuss-phase |
|
|
214
|
+
| `workflow.tdd_mode` | `false` | Instruct planner to apply `type: tdd` to eligible tasks |
|
|
215
|
+
|
|
216
|
+
### Parallelization Section (replaces flat boolean)
|
|
217
|
+
|
|
218
|
+
The `parallelization` field is now an object. Legacy flat `"parallelization": true` is still honored for backward compatibility.
|
|
219
|
+
|
|
220
|
+
| Option | Default | Description |
|
|
221
|
+
|--------|---------|-------------|
|
|
222
|
+
| `parallelization.enabled` | `false` | Enable parallel subagent execution on supported platforms |
|
|
223
|
+
| `parallelization.plan_level` | `true` | Parallelize at plan level (each plan gets its own agent) |
|
|
224
|
+
| `parallelization.task_level` | `false` | Parallelize at task level within a plan (experimental) |
|
|
225
|
+
| `parallelization.max_concurrent_agents` | `5` | Maximum number of concurrent subagents per wave |
|
|
226
|
+
| `parallelization.min_plans_for_parallel` | `2` | Minimum plans in a wave before parallelization activates |
|
|
227
|
+
|
|
228
|
+
**Why default 5?** Each subagent gets its own context window (~200k tokens). 5 agents is the sweet spot for cost vs. speed — most phases have 2-5 plans per wave. Going higher risks git lock contention and significant cost spikes without proportional speed gains. Configurable for power users.
|
|
229
|
+
|
|
230
|
+
### Gates Section
|
|
231
|
+
|
|
232
|
+
Controls which confirmation prompts are shown during workflows. Set to `false` to skip specific confirmations (useful for experienced users in yolo mode).
|
|
233
|
+
|
|
234
|
+
| Option | Default | Description |
|
|
235
|
+
|--------|---------|-------------|
|
|
236
|
+
| `gates.confirm_project` | `true` | Confirm PROJECT.md before proceeding |
|
|
237
|
+
| `gates.confirm_phases` | `true` | Confirm phase breakdown |
|
|
238
|
+
| `gates.confirm_roadmap` | `true` | Confirm roadmap before proceeding |
|
|
239
|
+
| `gates.confirm_plan` | `true` | Confirm plans before execution |
|
|
240
|
+
| `gates.execute_next_plan` | `true` | Confirm before executing each plan |
|
|
241
|
+
| `gates.issues_review` | `true` | Confirm issue resolution approach |
|
|
242
|
+
| `gates.confirm_transition` | `true` | Confirm before phase transitions |
|
|
243
|
+
|
|
244
|
+
### Safety Section
|
|
245
|
+
|
|
246
|
+
| Option | Default | Description |
|
|
247
|
+
|--------|---------|-------------|
|
|
248
|
+
| `safety.always_confirm_destructive` | `true` | Always confirm before destructive operations (file deletion, git reset) |
|
|
249
|
+
| `safety.always_confirm_external_services` | `true` | Always confirm before calling external APIs or services |
|
|
250
|
+
|
|
251
|
+
### Hooks Section
|
|
252
|
+
|
|
253
|
+
| Option | Default | Description |
|
|
254
|
+
|--------|---------|-------------|
|
|
255
|
+
| `hooks.context_warnings` | `true` | Show context budget warnings when usage is high |
|
|
256
|
+
|
|
257
|
+
### Example config.json with all v2.1 options
|
|
258
|
+
|
|
259
|
+
```json
|
|
260
|
+
{
|
|
261
|
+
"mode": "interactive",
|
|
262
|
+
"granularity": "standard",
|
|
263
|
+
"model_profile": "balanced",
|
|
264
|
+
"learning_mode": "auto",
|
|
265
|
+
"test_first": false,
|
|
266
|
+
"planning": {
|
|
267
|
+
"commit_docs": true,
|
|
268
|
+
"commit_mode": "auto",
|
|
269
|
+
"search_gitignored": false
|
|
270
|
+
},
|
|
271
|
+
"workflow": {
|
|
272
|
+
"research": true,
|
|
273
|
+
"plan_check": true,
|
|
274
|
+
"verifier": true,
|
|
275
|
+
"validation": true,
|
|
276
|
+
"review": true,
|
|
277
|
+
"solutions_search": true,
|
|
278
|
+
"security_enforcement": true,
|
|
279
|
+
"discuss_mode": "discuss",
|
|
280
|
+
"tdd_mode": false
|
|
281
|
+
},
|
|
282
|
+
"parallelization": {
|
|
283
|
+
"enabled": false,
|
|
284
|
+
"plan_level": true,
|
|
285
|
+
"task_level": false,
|
|
286
|
+
"max_concurrent_agents": 5,
|
|
287
|
+
"min_plans_for_parallel": 2
|
|
288
|
+
},
|
|
289
|
+
"gates": {
|
|
290
|
+
"confirm_project": true,
|
|
291
|
+
"confirm_phases": true,
|
|
292
|
+
"confirm_roadmap": true,
|
|
293
|
+
"confirm_plan": true,
|
|
294
|
+
"execute_next_plan": true,
|
|
295
|
+
"issues_review": true,
|
|
296
|
+
"confirm_transition": true
|
|
297
|
+
},
|
|
298
|
+
"safety": {
|
|
299
|
+
"always_confirm_destructive": true,
|
|
300
|
+
"always_confirm_external_services": true
|
|
301
|
+
},
|
|
302
|
+
"review": {
|
|
303
|
+
"auto_after_verify": false
|
|
304
|
+
},
|
|
305
|
+
"ship": {
|
|
306
|
+
"auto_test": true,
|
|
307
|
+
"conventional_commits": true,
|
|
308
|
+
"pr_template": true
|
|
309
|
+
},
|
|
310
|
+
"hooks": {
|
|
311
|
+
"context_warnings": true
|
|
312
|
+
},
|
|
313
|
+
"git": {
|
|
314
|
+
"branching_strategy": "none",
|
|
315
|
+
"phase_branch_template": "phase-{phase}-{slug}",
|
|
316
|
+
"milestone_branch_template": "{milestone}-{slug}"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
</v21_config_options>
|
|
322
|
+
|
|
184
323
|
</planning_config>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Solution Schema Reference
|
|
2
|
+
|
|
3
|
+
Canonical contract for `.planning/solutions/` frontmatter written by the `/compound` workflow.
|
|
4
|
+
|
|
5
|
+
Use this file as the quick reference for:
|
|
6
|
+
- Required fields
|
|
7
|
+
- Enum values
|
|
8
|
+
- Validation expectations
|
|
9
|
+
- Category mapping
|
|
10
|
+
- Track classification (bug vs knowledge)
|
|
11
|
+
|
|
12
|
+
## Tracks
|
|
13
|
+
|
|
14
|
+
The `problem_type` determines which **track** applies. Each track has different required and optional fields.
|
|
15
|
+
|
|
16
|
+
| Track | problem_types | Description |
|
|
17
|
+
|-------|--------------|-------------|
|
|
18
|
+
| **Bug** | `build_error`, `test_failure`, `runtime_error`, `performance_issue`, `database_issue`, `security_issue`, `ui_bug`, `integration_issue`, `logic_error` | Defects and failures that were diagnosed and fixed |
|
|
19
|
+
| **Knowledge** | `best_practice`, `documentation_gap`, `workflow_issue`, `developer_experience` | Practices, patterns, workflow improvements, and documentation |
|
|
20
|
+
|
|
21
|
+
## Required Fields (both tracks)
|
|
22
|
+
|
|
23
|
+
- **title**: Clear problem/learning title
|
|
24
|
+
- **date**: ISO date in `YYYY-MM-DD`
|
|
25
|
+
- **category**: Category directory from mapping below
|
|
26
|
+
- **module**: Module or area affected
|
|
27
|
+
- **problem_type**: One of the values listed in the Tracks table above
|
|
28
|
+
- **severity**: One of `critical`, `high`, `medium`, `low`
|
|
29
|
+
|
|
30
|
+
## Optional Fields (both tracks)
|
|
31
|
+
|
|
32
|
+
- **tags**: Search keywords, lowercase and hyphen-separated
|
|
33
|
+
- **last_updated**: ISO date `YYYY-MM-DD` — added when updating an existing doc
|
|
34
|
+
|
|
35
|
+
## Bug Track Additional Fields
|
|
36
|
+
|
|
37
|
+
Optional but recommended:
|
|
38
|
+
- **symptoms**: YAML array with 1-5 observable symptoms (errors, broken behavior)
|
|
39
|
+
- **root_cause**: Brief description of the underlying cause
|
|
40
|
+
- **resolution_type**: One of `code_fix`, `migration`, `config_change`, `test_fix`, `dependency_update`, `environment_setup`, `workflow_improvement`, `documentation_update`, `tooling_addition`
|
|
41
|
+
|
|
42
|
+
## Knowledge Track Additional Fields
|
|
43
|
+
|
|
44
|
+
Optional:
|
|
45
|
+
- **applies_when**: Conditions or situations where this guidance applies
|
|
46
|
+
|
|
47
|
+
## Category Mapping
|
|
48
|
+
|
|
49
|
+
Map from `problem_type` to `.planning/solutions/` subdirectory:
|
|
50
|
+
|
|
51
|
+
- `build_error` → `.planning/solutions/build-errors/`
|
|
52
|
+
- `test_failure` → `.planning/solutions/test-failures/`
|
|
53
|
+
- `runtime_error` → `.planning/solutions/runtime-errors/`
|
|
54
|
+
- `performance_issue` → `.planning/solutions/performance-issues/`
|
|
55
|
+
- `database_issue` → `.planning/solutions/database-issues/`
|
|
56
|
+
- `security_issue` → `.planning/solutions/security-issues/`
|
|
57
|
+
- `ui_bug` → `.planning/solutions/ui-bugs/`
|
|
58
|
+
- `integration_issue` → `.planning/solutions/integration-issues/`
|
|
59
|
+
- `logic_error` → `.planning/solutions/logic-errors/`
|
|
60
|
+
- `best_practice` → `.planning/solutions/best-practices/`
|
|
61
|
+
- `workflow_issue` → `.planning/solutions/workflow-issues/`
|
|
62
|
+
- `developer_experience` → `.planning/solutions/developer-experience/`
|
|
63
|
+
- `documentation_gap` → `.planning/solutions/documentation-gaps/`
|
|
64
|
+
|
|
65
|
+
## Bug Track Template
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
---
|
|
69
|
+
title: [Clear problem title]
|
|
70
|
+
date: [YYYY-MM-DD]
|
|
71
|
+
category: [category directory]
|
|
72
|
+
module: [module or area]
|
|
73
|
+
problem_type: [enum value]
|
|
74
|
+
severity: [critical|high|medium|low]
|
|
75
|
+
tags: [keyword-one, keyword-two]
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
# [Clear problem title]
|
|
79
|
+
|
|
80
|
+
## Problem
|
|
81
|
+
[1-2 sentence description of the issue and impact]
|
|
82
|
+
|
|
83
|
+
## Symptoms
|
|
84
|
+
- [Observable symptom or error]
|
|
85
|
+
|
|
86
|
+
## What Didn't Work
|
|
87
|
+
- [Attempted fix and why it failed]
|
|
88
|
+
|
|
89
|
+
## Solution
|
|
90
|
+
[The fix that worked, including code snippets]
|
|
91
|
+
|
|
92
|
+
## Why This Works
|
|
93
|
+
[Root cause explanation and why the fix addresses it]
|
|
94
|
+
|
|
95
|
+
## Prevention
|
|
96
|
+
- [Concrete practice, test, or guardrail]
|
|
97
|
+
|
|
98
|
+
## Related
|
|
99
|
+
- [Related docs or issues, if any]
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Knowledge Track Template
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
---
|
|
106
|
+
title: [Clear, descriptive title]
|
|
107
|
+
date: [YYYY-MM-DD]
|
|
108
|
+
category: [category directory]
|
|
109
|
+
module: [module or area]
|
|
110
|
+
problem_type: [enum value]
|
|
111
|
+
severity: [critical|high|medium|low]
|
|
112
|
+
tags: [keyword-one, keyword-two]
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# [Clear, descriptive title]
|
|
116
|
+
|
|
117
|
+
## Context
|
|
118
|
+
[What situation, gap, or friction prompted this guidance]
|
|
119
|
+
|
|
120
|
+
## Guidance
|
|
121
|
+
[The practice, pattern, or recommendation with code examples]
|
|
122
|
+
|
|
123
|
+
## Why This Matters
|
|
124
|
+
[Rationale and impact of following or not following this guidance]
|
|
125
|
+
|
|
126
|
+
## When to Apply
|
|
127
|
+
- [Conditions or situations where this applies]
|
|
128
|
+
|
|
129
|
+
## Examples
|
|
130
|
+
[Concrete before/after or usage examples]
|
|
131
|
+
|
|
132
|
+
## Related
|
|
133
|
+
- [Related docs or issues, if any]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Validation Rules
|
|
137
|
+
|
|
138
|
+
1. Determine the track from `problem_type` using the Tracks table
|
|
139
|
+
2. All required fields must be present
|
|
140
|
+
3. Enum fields must match allowed values exactly
|
|
141
|
+
4. `date` must match `YYYY-MM-DD`
|
|
142
|
+
5. `tags` should be lowercase and hyphen-separated
|
|
143
|
+
6. Filename pattern: `[sanitized-problem-slug]-[YYYY-MM-DD].md`
|
|
144
|
+
|
|
145
|
+
## Overlap Assessment
|
|
146
|
+
|
|
147
|
+
When existing solutions exist, assess overlap across five dimensions:
|
|
148
|
+
|
|
149
|
+
1. Problem statement
|
|
150
|
+
2. Root cause
|
|
151
|
+
3. Solution approach
|
|
152
|
+
4. Referenced files
|
|
153
|
+
5. Prevention rules
|
|
154
|
+
|
|
155
|
+
| Score | Dimensions | Action |
|
|
156
|
+
|-------|-----------|--------|
|
|
157
|
+
| **High** | 4-5 match | Update existing doc, add `last_updated` |
|
|
158
|
+
| **Moderate** | 2-3 match | Create new doc, note overlap |
|
|
159
|
+
| **Low** | 0-1 match | Create new doc normally |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<thinking_models>
|
|
2
|
+
|
|
3
|
+
Structured reasoning models for the **planner** and **plan-checker** agents. Apply these at decision points during plan creation, not continuously. Each model counters a specific failure mode.
|
|
4
|
+
|
|
5
|
+
## Conflict Resolution
|
|
6
|
+
|
|
7
|
+
Pre-Mortem and Constraint Analysis both analyze risk at different granularities. Run Constraint Analysis FIRST (identify the hardest constraint), then Pre-Mortem (enumerate failure modes around that constraint and the rest of the plan).
|
|
8
|
+
|
|
9
|
+
## 1. Pre-Mortem Analysis
|
|
10
|
+
|
|
11
|
+
**Counters:** Optimistic plan decomposition that ignores failure modes.
|
|
12
|
+
|
|
13
|
+
Before finalizing this plan, assume it has already failed. List the 3 most likely reasons for failure — missing dependency, wrong decomposition, underestimated complexity — and add mitigation steps or acceptance criteria that would catch each failure early.
|
|
14
|
+
|
|
15
|
+
## 2. MECE Decomposition
|
|
16
|
+
|
|
17
|
+
**Counters:** Overlapping tasks (merge conflicts) or gapped tasks (missing requirements).
|
|
18
|
+
|
|
19
|
+
Verify this task breakdown is MECE at the REQUIREMENT level: (1) list every requirement from the phase goal, (2) confirm each maps to exactly one task's `<done>`, (3) if two tasks modify the same file, confirm they modify DIFFERENT sections or serve DIFFERENT requirements, (4) flag any requirement not covered by any task.
|
|
20
|
+
|
|
21
|
+
## 3. Constraint Analysis
|
|
22
|
+
|
|
23
|
+
**Counters:** Deferring the hardest constraint to the last task, causing late-stage failures.
|
|
24
|
+
|
|
25
|
+
Identify the single hardest constraint in this phase — the one thing that, if it doesn't work, makes everything else irrelevant. Schedule that constraint as Task 1 or 2, not last. If the constraint involves an external API or unfamiliar library, add a spike/proof-of-concept task before the main implementation.
|
|
26
|
+
|
|
27
|
+
## 4. Reversibility Test
|
|
28
|
+
|
|
29
|
+
**Counters:** Over-analyzing cheap decisions, under-analyzing costly ones.
|
|
30
|
+
|
|
31
|
+
For each significant decision in this plan, classify as REVERSIBLE (can change later with low cost) or IRREVERSIBLE (changing later requires migration, breaking changes, or significant rework). Spend analysis time proportional to irreversibility. For irreversible decisions, document the rationale in the plan.
|
|
32
|
+
|
|
33
|
+
## 5. Curse of Knowledge Counter
|
|
34
|
+
|
|
35
|
+
**Counters:** Plan-to-executor ambiguity from compressed instructions.
|
|
36
|
+
|
|
37
|
+
For each `<action>` step, re-read it as if you have NEVER seen this codebase. Is every noun unambiguous (which file? which function? which endpoint?)? Is every verb specific (add WHERE? modify HOW?)? If a step could be interpreted two ways, rewrite it. Include file paths, function names, and expected behavior in every action step.
|
|
38
|
+
|
|
39
|
+
## 6. Base Rate Neglect Counter
|
|
40
|
+
|
|
41
|
+
**Counters:** Planners ignoring low-confidence research caveats.
|
|
42
|
+
|
|
43
|
+
Before finalizing the plan, read ALL `[NEEDS DECISION]` items and LOW-confidence recommendations from RESEARCH.md. For each: either (a) create a checkpoint task to resolve it, or (b) document why the risk is acceptable in the plan's deviation notes. Low-confidence items that are silently accepted become undocumented technical debt.
|
|
44
|
+
|
|
45
|
+
## Gap Closure Mode: Root-Cause Check
|
|
46
|
+
|
|
47
|
+
**Applies only when:** Planner enters gap closure mode (triggered by `gaps_found` in VERIFICATION.md).
|
|
48
|
+
|
|
49
|
+
Before writing the fix plan, apply a single "why" round: Why did this gap occur? Was it a plan deficiency (wrong task), an execution miss (correct task, wrong implementation), or a changed assumption (environment/dependency shift)? The fix plan must target the root cause category, not just the symptom.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## When NOT to Think
|
|
54
|
+
|
|
55
|
+
Skip structured reasoning models when the situation does not benefit from them:
|
|
56
|
+
|
|
57
|
+
- **Single-task plans** — If the phase has one clear requirement and one obvious task, do not run Pre-Mortem or MECE analysis. Write the task directly.
|
|
58
|
+
- **Well-researched phases** — If RESEARCH.md has HIGH-confidence recommendations for every decision and no `[NEEDS DECISION]` items, skip Base Rate Neglect Counter.
|
|
59
|
+
- **Gap closure plans** — Focus on the Root-Cause Check model only. Skip all others — the original plan already went through them.
|
|
60
|
+
|
|
61
|
+
</thinking_models>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<universal_anti_patterns>
|
|
2
|
+
|
|
3
|
+
Rules that apply to ALL workflows and agents. Individual workflows may have additional specific anti-patterns.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Context Budget Rules
|
|
8
|
+
|
|
9
|
+
1. **Never** read agent definition files (`agents/*.md`) when spawning subagents — `subagent_type` auto-loads them. Reading agent definitions into the orchestrator wastes context for content automatically injected into subagent sessions.
|
|
10
|
+
2. **Never** inline large files into subagent prompts — tell agents to read files from disk instead. Agents have their own context windows.
|
|
11
|
+
3. **Read depth scales with context window** — check `context_window` in `.planning/config.json`. At < 500000: read only frontmatter, status fields, or summaries. At >= 500000: full body reads permitted when content is needed for inline decisions. See `references/context-budget.md` for the complete table.
|
|
12
|
+
4. **Delegate** heavy work to subagents — the orchestrator routes, it does not build, analyze, research, investigate, or verify.
|
|
13
|
+
5. **Proactive pause warning**: If you have already consumed significant context (large file reads, multiple subagent results), warn the user: "Context budget is getting heavy. Consider checkpointing progress."
|
|
14
|
+
|
|
15
|
+
## File Reading Rules
|
|
16
|
+
|
|
17
|
+
6. **SUMMARY.md read depth scales with context window** — at context_window < 500000: read frontmatter only from prior phase SUMMARYs. At >= 500000: full body reads permitted for direct-dependency phases. Transitive dependencies (2+ phases back) remain frontmatter-only regardless.
|
|
18
|
+
7. **Never** read full PLAN.md files from other phases — only current phase plans.
|
|
19
|
+
8. **Do not** re-read full file contents when frontmatter is sufficient — frontmatter contains status, key_files, commits, and provides fields.
|
|
20
|
+
|
|
21
|
+
## Subagent Rules
|
|
22
|
+
|
|
23
|
+
9. **Always use learnship agent types** (`learnship-executor`, `learnship-planner`, `learnship-phase-researcher`, etc.) — never fall back to generic or built-in agent types. Learnship agents have project-aware prompts and workflow context.
|
|
24
|
+
10. **Do not** re-litigate decisions that are already locked in CONTEXT.md — respect locked decisions unconditionally.
|
|
25
|
+
|
|
26
|
+
## Questioning Anti-Patterns
|
|
27
|
+
|
|
28
|
+
11. **Do not** walk through checklists — checklist walking (asking items one by one from a list) is the #1 anti-pattern. Instead, use progressive depth: start broad, dig where interesting.
|
|
29
|
+
12. **Do not** use corporate speak — avoid jargon like "stakeholder alignment", "synergize", "deliverables". Use plain language.
|
|
30
|
+
13. **Do not** apply premature constraints — don't narrow the solution space before understanding the problem. Ask about the problem first, then constrain.
|
|
31
|
+
|
|
32
|
+
## State Management Anti-Patterns
|
|
33
|
+
|
|
34
|
+
14. **Always use atomic file writes for STATE.md and ROADMAP.md.** Read the current content, modify, write the whole file. Do not use append-only operations that could corrupt the file on interruption.
|
|
35
|
+
15. **Never** skip STATE.md updates after completing work — downstream workflows depend on accurate state.
|
|
36
|
+
|
|
37
|
+
## Behavioral Rules
|
|
38
|
+
|
|
39
|
+
16. **Do not** create artifacts the user did not approve — always confirm before writing new planning documents.
|
|
40
|
+
17. **Do not** modify files outside the workflow's stated scope — check the plan's files_modified list.
|
|
41
|
+
18. **Do not** suggest multiple next actions without clear priority — one primary suggestion, alternatives listed secondary.
|
|
42
|
+
19. **Do not** use `git add .` or `git add -A` — stage specific files only.
|
|
43
|
+
20. **Do not** include sensitive information (API keys, passwords, tokens) in planning documents or commits.
|
|
44
|
+
|
|
45
|
+
## Error Recovery Rules
|
|
46
|
+
|
|
47
|
+
21. **Git lock detection**: Before any git operation, if it fails with "Unable to create lock file", check for stale `.git/index.lock` and advise the user to remove it (do not remove automatically).
|
|
48
|
+
22. **Config fallback awareness**: Config loading returns `null` silently on invalid JSON. If your workflow depends on config values, check for null and warn the user: "config.json is invalid or missing — running with defaults."
|
|
49
|
+
23. **Partial state recovery**: If STATE.md references a phase directory that doesn't exist, do not proceed silently. Warn the user and suggest diagnosing the mismatch.
|
|
50
|
+
|
|
51
|
+
</universal_anti_patterns>
|
package/templates/agents.md
CHANGED
|
@@ -21,6 +21,9 @@ collaborators with different strengths.
|
|
|
21
21
|
The "why" matters more than the "what."
|
|
22
22
|
- **Domain-aware, not domain-faking.** Know the domain of this project. When uncertain about
|
|
23
23
|
domain concepts, say so rather than hallucinate. Getting it wrong here has real consequences.
|
|
24
|
+
- **Stop when confused, not after.** If something is ambiguous, surface it immediately. Present
|
|
25
|
+
the interpretations. Ask which one. Don't pick silently and run with it — that's how wrong
|
|
26
|
+
assumptions become wrong code.
|
|
24
27
|
- **Learnings are first-class.** Every significant fix gets a "why it broke" and "what we
|
|
25
28
|
learned." This is non-negotiable.
|
|
26
29
|
- **Swearing is allowed when it lands.** Don't force it. Don't avoid it.
|
|
@@ -46,9 +49,13 @@ Decision-making heuristics for navigating ambiguity.
|
|
|
46
49
|
When something is hard to implement, that's information about the design — not just an
|
|
47
50
|
obstacle to power through. Investigate the resistance before routing around it.
|
|
48
51
|
|
|
49
|
-
### 2. Minimal
|
|
52
|
+
### 2. Minimal Fix, Surgical Change
|
|
50
53
|
|
|
51
|
-
Fix the root cause
|
|
54
|
+
Fix the root cause, not the symptoms. One fix, one place. Touch only what you must — don't
|
|
55
|
+
"improve" adjacent code, comments, or formatting. Don't refactor things that aren't broken.
|
|
56
|
+
Match existing style, even if you'd do it differently. Every changed line should trace directly
|
|
57
|
+
to the request. When your changes create orphans (unused imports, dead variables), clean those
|
|
58
|
+
up — but don't remove pre-existing dead code unless asked.
|
|
52
59
|
|
|
53
60
|
### 3. Preserve Real-World Signal
|
|
54
61
|
|
|
@@ -70,15 +77,19 @@ future guardrails.
|
|
|
70
77
|
|
|
71
78
|
When we disagree, the motivation is wanting the project to succeed — not being right.
|
|
72
79
|
|
|
73
|
-
### 7. One
|
|
80
|
+
### 7. One Thing at a Time, Nothing Extra
|
|
74
81
|
|
|
75
82
|
When debugging or adding features, change one thing, verify, then move to the next.
|
|
76
|
-
Multi-variable changes obscure what actually fixed the problem.
|
|
83
|
+
Multi-variable changes obscure what actually fixed the problem. Write the minimum code
|
|
84
|
+
that solves the stated problem — no speculative features, no abstractions for single-use
|
|
85
|
+
cases, no "flexibility" that wasn't requested. If 200 lines could be 50, rewrite.
|
|
77
86
|
|
|
78
|
-
### 8.
|
|
87
|
+
### 8. Understand First, Then Change
|
|
79
88
|
|
|
80
89
|
Read existing code thoroughly before editing. Understand the current design before proposing
|
|
81
|
-
changes. Most bugs come from not understanding what's already there.
|
|
90
|
+
changes. Most bugs come from not understanding what's already there. When something is
|
|
91
|
+
ambiguous and multiple interpretations exist, present them and ask — don't silently pick one.
|
|
92
|
+
If you're confused, stop. Name what's unclear. Ask.
|
|
82
93
|
|
|
83
94
|
### 9. Keep Copies in Sync
|
|
84
95
|
|
|
@@ -92,14 +103,61 @@ follow. The map should become territory.
|
|
|
92
103
|
|
|
93
104
|
---
|
|
94
105
|
|
|
106
|
+
## Request Routing Protocol
|
|
107
|
+
|
|
108
|
+
**This section is mandatory. Apply it before responding to ANY user message.**
|
|
109
|
+
|
|
110
|
+
When a user sends a message — whether it's a vague idea, a specific bug report, a feature request, or a detailed technical prompt — you MUST route it through the correct learnship workflow. **Do not make code changes, fix bugs, or implement anything in direct response to a user message.** Every task goes through a workflow.
|
|
111
|
+
|
|
112
|
+
### Decision tree — apply in order:
|
|
113
|
+
|
|
114
|
+
**0. Is `/new-project` currently in progress?**
|
|
115
|
+
|
|
116
|
+
If `.planning/PROJECT.md` does NOT exist but you are currently running `/new-project` (i.e., you have asked "What do you want to build?" and are waiting for answers, or you are in any step of the new-project ceremony): **the user's message is an answer to your workflow question, not a task to route.** Do NOT apply the routing protocol. Continue the `/new-project` ceremony from where you left off.
|
|
117
|
+
|
|
118
|
+
**1. Is there a `.planning/PROJECT.md`?**
|
|
119
|
+
- **No** → Stop. Tell the user: "No project found. Run `/new-project` to initialize." Do nothing else.
|
|
120
|
+
- **Yes** → Continue to step 2.
|
|
121
|
+
|
|
122
|
+
**2. Does the user message look like a task, problem, bug, or feature request?**
|
|
123
|
+
(Anything that would result in a code change, file edit, config change, or new capability)
|
|
124
|
+
- **Yes** → Route to step 3. Do NOT start implementing.
|
|
125
|
+
- **No** (pure question, status check, discussion) → Answer normally.
|
|
126
|
+
|
|
127
|
+
**3. How large/complex is the task?**
|
|
128
|
+
- **Small, self-contained** (estimated < 1 hour, touches ≤ 3 files, no design decisions needed):
|
|
129
|
+
→ Tell the user: "This looks like a quick task. I'll run `/quick` for this — it gives us atomic commits and state tracking without full planning ceremony. Proceed?"
|
|
130
|
+
→ Wait for confirmation, then invoke `/quick "[description]"`.
|
|
131
|
+
- **Medium or uncertain** (design decisions needed, multiple files, touches active phase work):
|
|
132
|
+
→ Tell the user: "This touches phase [N] work. I'll run `/discuss-phase [N]` to capture your intent before planning. Proceed?"
|
|
133
|
+
→ Wait for confirmation, then invoke `discuss-phase`.
|
|
134
|
+
- **Large or cross-cutting** (new capability, affects multiple phases, architectural):
|
|
135
|
+
→ Tell the user: "This is significant scope. Let me check where we are first."
|
|
136
|
+
→ Run `/ls` to show current status, then recommend the right workflow (plan-phase, new-milestone, etc).
|
|
137
|
+
|
|
138
|
+
**4. Never self-route silently.**
|
|
139
|
+
Always tell the user which workflow you're about to invoke and why, then wait for a "yes" before proceeding. Do not assume consent from a detailed prompt.
|
|
140
|
+
|
|
141
|
+
### Examples of what NOT to do:
|
|
142
|
+
- User says "the login button is broken" → ❌ Don't fix it directly → ✅ Route to `/quick`
|
|
143
|
+
- User says "I want to add dark mode" → ❌ Don't start implementing → ✅ Route to `discuss-phase`
|
|
144
|
+
- User pastes a detailed spec → ❌ Don't treat it as a command to execute → ✅ Classify size, propose workflow, wait for yes
|
|
145
|
+
- `/new-project` asked "What do you want to build?" and user replies with a detailed description → ❌ Don't treat as a task to route → ✅ It is ANSWER_1. Record it and ask Exchange 2.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
95
149
|
## Platform Context
|
|
96
150
|
|
|
97
151
|
This project uses **learnship**. Key facts:
|
|
98
152
|
|
|
99
153
|
- All planning artifacts live in `.planning/` — read STATE.md and ROADMAP.md first when unsure where we are
|
|
100
|
-
- The phase loop: `discuss-phase` → `plan-phase` → `execute-phase` → `verify-work` →
|
|
154
|
+
- The phase loop: `discuss-phase` → `plan-phase` → `execute-phase` → `verify-work` → `/review` → `/ship` → `/compound`
|
|
155
|
+
- Optional per-phase: `/secure-phase` (security verification), `/extract-learnings` (capture meta-knowledge)
|
|
156
|
+
- Recovery: `/forensics` (post-mortem), `/undo` (safe revert)
|
|
101
157
|
- Current status is always in `.planning/STATE.md`
|
|
102
158
|
- Decisions are tracked in `.planning/DECISIONS.md` — read it before proposing approaches that may conflict
|
|
159
|
+
- Compounded solutions live in `.planning/solutions/` — organized by category with YAML frontmatter (module, problem_type, severity, tags). Search these before planning to avoid reinventing known solutions
|
|
160
|
+
- Quick ideas: `/note [text]` for zero-friction capture, `/session-report` for end-of-session summaries
|
|
103
161
|
- Run `/ls` if context is unclear about what phase we're on or what to do next — it shows status and offers to run the next step
|
|
104
162
|
|
|
105
163
|
---
|
|
@@ -143,6 +201,8 @@ This project uses **learnship**. Key facts:
|
|
|
143
201
|
|
|
144
202
|
## Skills — Operational Knowledge
|
|
145
203
|
|
|
204
|
+
<!-- LEARNSHIP_SKILLS_BLOCK -->
|
|
205
|
+
|
|
146
206
|
### CHANGELOG Discipline
|
|
147
207
|
|
|
148
208
|
Every significant change gets a dated entry in `CHANGELOG.md` with:
|
|
@@ -156,6 +216,19 @@ Architectural and scope decisions are tracked in `.planning/DECISIONS.md`.
|
|
|
156
216
|
Read it before proposing an approach that has been previously considered.
|
|
157
217
|
When a new decision is made during a session, capture it with `/decision-log`.
|
|
158
218
|
|
|
219
|
+
### Solutions Store
|
|
220
|
+
|
|
221
|
+
Compounded solutions live in `.planning/solutions/` — organized by category (build-errors, runtime-errors, best-practices, etc.) with YAML frontmatter for searchability. The `/plan-phase` workflow automatically searches these before planning.
|
|
222
|
+
|
|
223
|
+
**Run `/compound` after any of these events — do not skip:**
|
|
224
|
+
- Fixing a bug (especially root-cause discoveries)
|
|
225
|
+
- Completing a phase (`execute-phase` → `verify-work` → `/compound`)
|
|
226
|
+
- Shipping a feature (`/ship` → `/compound`)
|
|
227
|
+
- Any aha moment or pattern discovery during development
|
|
228
|
+
- Resolving a debugging session (`/debug` → `/compound`)
|
|
229
|
+
|
|
230
|
+
Context fades fast. If a solution was worth finding, it's worth capturing.
|
|
231
|
+
|
|
159
232
|
---
|
|
160
233
|
|
|
161
234
|
## Regressions — What Broke and What We Learned
|