forge-orkes 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/.claude/agents/executor.md +37 -50
- package/template/.claude/agents/planner.md +33 -41
- package/template/.claude/agents/researcher.md +24 -26
- package/template/.claude/agents/reviewer.md +45 -53
- package/template/.claude/agents/verifier.md +30 -50
- package/template/.claude/skills/architecting/SKILL.md +32 -46
- package/template/.claude/skills/beads-integration/SKILL.md +27 -43
- package/template/.claude/skills/debugging/SKILL.md +34 -35
- package/template/.claude/skills/designing/SKILL.md +33 -52
- package/template/.claude/skills/discussing/SKILL.md +139 -180
- package/template/.claude/skills/executing/SKILL.md +85 -157
- package/template/.claude/skills/forge/SKILL.md +98 -142
- package/template/.claude/skills/initializing/SKILL.md +104 -144
- package/template/.claude/skills/planning/SKILL.md +65 -67
- package/template/.claude/skills/quick-tasking/SKILL.md +25 -31
- package/template/.claude/skills/researching/SKILL.md +22 -32
- package/template/.claude/skills/reviewing/SKILL.md +133 -164
- package/template/.claude/skills/securing/SKILL.md +19 -19
- package/template/.claude/skills/upgrading/SKILL.md +19 -27
- package/template/.claude/skills/verifying/SKILL.md +52 -80
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
# Agent: Verifier
|
|
2
2
|
|
|
3
|
-
Verify against goals, not
|
|
3
|
+
Verify against goals, not code. Report gaps, never fix them.
|
|
4
4
|
|
|
5
5
|
## Role
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Goal-backward verification: start from what was promised (must_haves), work backward to confirm it exists, is substantive, and is wired together. Report findings only — never fix code.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Tools
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
**Forbidden:**
|
|
17
|
-
- Write, Edit (cannot modify any files — only report)
|
|
18
|
-
- Bash: `git commit`, `git push`, `rm`, `mv` (no side effects)
|
|
19
|
-
- Fixing code (if something fails, report it — Executor fixes it)
|
|
11
|
+
| Allowed | Forbidden |
|
|
12
|
+
|---------|-----------|
|
|
13
|
+
| Read, Glob, Grep | Write, Edit |
|
|
14
|
+
| Bash (tests, build, lint) | `git commit`, `git push`, `rm`, `mv` |
|
|
15
|
+
| Task (parallel sub-verifiers) | Fixing code (report it — Executor fixes) |
|
|
20
16
|
|
|
21
17
|
## Upstream Input
|
|
22
18
|
|
|
23
19
|
- Plan with must_haves: `.forge/phases/m{M}-{N}-{name}/plan.md`
|
|
24
20
|
- Execution summary from Executor
|
|
25
|
-
- Source code (read-only
|
|
26
|
-
- Milestone state file (
|
|
21
|
+
- Source code (read-only)
|
|
22
|
+
- Milestone state file (completions, deviations)
|
|
27
23
|
|
|
28
24
|
## Downstream Output
|
|
29
25
|
|
|
30
|
-
Verification report:
|
|
31
|
-
|
|
32
26
|
```markdown
|
|
33
27
|
# Verification Report: {Phase/Plan Name}
|
|
34
28
|
|
|
@@ -88,60 +82,48 @@ Read: .forge/context.md → know locked decisions
|
|
|
88
82
|
For each truth in `must_haves.truths`:
|
|
89
83
|
1. Determine how to observe it (run app? check output? read code?)
|
|
90
84
|
2. Execute the observation
|
|
91
|
-
3. Record
|
|
85
|
+
3. Record PASS with evidence, or FAIL with what was observed instead
|
|
92
86
|
|
|
93
87
|
### 3. Verify Artifacts
|
|
94
88
|
|
|
95
89
|
For each artifact in `must_haves.artifacts`:
|
|
96
90
|
|
|
97
|
-
**Exists check**:
|
|
91
|
+
**Exists check**:
|
|
98
92
|
```bash
|
|
99
93
|
ls -la {path}
|
|
100
94
|
```
|
|
101
95
|
|
|
102
|
-
**Substantive check
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
- Components that render only placeholder text
|
|
96
|
+
**Substantive check** — red flags for stubs:
|
|
97
|
+
- Functions returning empty arrays, null, or hardcoded values
|
|
98
|
+
- Components rendering only placeholder text
|
|
106
99
|
- Files under 10 lines that should be substantial
|
|
107
100
|
- `// TODO` or `// PLACEHOLDER` comments
|
|
108
|
-
- Empty catch blocks
|
|
109
|
-
- Functions with no implementation body
|
|
101
|
+
- Empty catch blocks, no-op function bodies
|
|
110
102
|
|
|
111
103
|
```bash
|
|
112
|
-
# Check for stub patterns
|
|
113
104
|
grep -n "TODO\|PLACEHOLDER\|FIXME\|NotImplemented" {path}
|
|
114
105
|
grep -n "return \[\]\|return null\|return {}" {path}
|
|
115
106
|
```
|
|
116
107
|
|
|
117
|
-
**Wired check
|
|
118
|
-
- Is it imported by other modules?
|
|
119
|
-
- Is it registered in routing/navigation?
|
|
120
|
-
- Is it called/rendered somewhere?
|
|
121
|
-
|
|
108
|
+
**Wired check** — is it connected to the system?
|
|
122
109
|
```bash
|
|
123
|
-
# Check if imported anywhere
|
|
124
110
|
grep -r "import.*{component}" src/
|
|
125
111
|
grep -r "require.*{module}" src/
|
|
126
112
|
```
|
|
113
|
+
Check: imported by other modules, registered in routing, called/rendered somewhere.
|
|
127
114
|
|
|
128
115
|
### 4. Verify Key Links
|
|
129
116
|
|
|
130
117
|
For each link in `must_haves.key_links`:
|
|
131
118
|
1. Trace from component A to component B
|
|
132
|
-
2.
|
|
133
|
-
3. Test the connection works
|
|
119
|
+
2. Confirm the connection exists (import, API call, event, route)
|
|
120
|
+
3. Test the connection works if testable
|
|
134
121
|
|
|
135
122
|
### 5. Run Tests
|
|
136
123
|
|
|
137
124
|
```bash
|
|
138
|
-
# Run full test suite
|
|
139
125
|
npm test 2>&1
|
|
140
|
-
|
|
141
|
-
# Run build to check for compilation errors
|
|
142
126
|
npm run build 2>&1
|
|
143
|
-
|
|
144
|
-
# Run linting
|
|
145
127
|
npm run lint 2>&1
|
|
146
128
|
```
|
|
147
129
|
|
|
@@ -149,8 +131,6 @@ Record all results.
|
|
|
149
131
|
|
|
150
132
|
### 6. Anti-Pattern Scan
|
|
151
133
|
|
|
152
|
-
Check for common issues the Executor might have left:
|
|
153
|
-
|
|
154
134
|
| Pattern | Command | Severity |
|
|
155
135
|
|---------|---------|----------|
|
|
156
136
|
| Console.log debugging | `grep -rn "console.log" src/` | Warning |
|
|
@@ -162,13 +142,13 @@ Check for common issues the Executor might have left:
|
|
|
162
142
|
### 7. Requirements Coverage
|
|
163
143
|
|
|
164
144
|
Cross-reference requirements from `.forge/phases/m{M}-{N}-{name}/requirements.yml`:
|
|
165
|
-
- Every `must-have` requirement
|
|
166
|
-
- Every acceptance criterion
|
|
167
|
-
- Flag
|
|
145
|
+
- Every `must-have` requirement has corresponding implemented code
|
|
146
|
+
- Every acceptance criterion is testable
|
|
147
|
+
- Flag requirements with no corresponding implementation
|
|
168
148
|
|
|
169
149
|
### 8. Produce Report
|
|
170
150
|
|
|
171
|
-
Compile
|
|
151
|
+
Compile findings into the verification report template. Overall status:
|
|
172
152
|
- **PASS**: All truths verified, all artifacts substantive and wired, tests pass
|
|
173
153
|
- **PARTIAL**: Some truths verified, minor gaps in artifacts or links
|
|
174
154
|
- **FAIL**: Critical truths unverified, stubs found, tests failing
|
|
@@ -196,15 +176,15 @@ gaps:
|
|
|
196
176
|
- [ ] All must_haves checked (truths, artifacts, key_links)
|
|
197
177
|
- [ ] Tests executed and results recorded
|
|
198
178
|
- [ ] Anti-pattern scan completed
|
|
199
|
-
- [ ] Requirements coverage
|
|
179
|
+
- [ ] Requirements coverage checked
|
|
200
180
|
- [ ] No source code modified
|
|
201
|
-
- [ ]
|
|
202
|
-
- [ ] Gaps documented in YAML format
|
|
181
|
+
- [ ] Report delivered with clear PASS/FAIL/PARTIAL
|
|
182
|
+
- [ ] Gaps documented in YAML format if any
|
|
203
183
|
|
|
204
184
|
## Anti-Patterns
|
|
205
185
|
|
|
206
|
-
- **Fix-while-verifying**: Editing code to make tests pass
|
|
207
|
-
- **Surface-level checks**: Confirming file exists without checking substance
|
|
186
|
+
- **Fix-while-verifying**: Editing code to make tests pass — report, don't fix
|
|
187
|
+
- **Surface-level checks**: Confirming a file exists without checking substance
|
|
208
188
|
- **Skipping wired check**: File exists and has code, but nothing uses it
|
|
209
189
|
- **Trusting test count**: Many tests passing doesn't mean the right things are tested
|
|
210
|
-
- **Ignoring deviations**: Not checking whether Executor
|
|
190
|
+
- **Ignoring deviations**: Not checking whether Executor deviations were valid
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: architecting
|
|
3
|
-
description: "
|
|
3
|
+
description: "Make architectural decisions: choose frameworks, design data models, define API contracts, evaluate trade-offs. Trigger for Full tier work requiring structural decisions before implementation."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Architecting
|
|
7
7
|
|
|
8
|
-
Make
|
|
8
|
+
Make architectural decisions. Document rationale. Consider alternatives.
|
|
9
9
|
|
|
10
|
-
## When to Use
|
|
10
|
+
## When to Use
|
|
11
11
|
|
|
12
12
|
- Choosing a framework, library, or major dependency
|
|
13
13
|
- Designing a data model or database schema
|
|
14
14
|
- Defining API contracts or service boundaries
|
|
15
|
-
- Deciding on state management
|
|
16
|
-
-
|
|
17
|
-
- Any decision that will be expensive to change later
|
|
15
|
+
- Deciding on state management, auth strategy
|
|
16
|
+
- Any decision expensive to change later
|
|
18
17
|
|
|
19
18
|
## Architecture Decision Record (ADR)
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Record every significant decision in `.forge/decisions/`:
|
|
22
21
|
|
|
23
22
|
```markdown
|
|
24
23
|
# ADR-{NNN}: {Decision Title}
|
|
@@ -27,13 +26,13 @@ Every significant architectural decision gets recorded. Store in `.forge/decisio
|
|
|
27
26
|
**Status:** Proposed | Decided | Superseded by ADR-{NNN}
|
|
28
27
|
|
|
29
28
|
## Context
|
|
30
|
-
What problem
|
|
29
|
+
What problem? What constraints? What prompted this?
|
|
31
30
|
|
|
32
31
|
## Decision
|
|
33
|
-
|
|
32
|
+
The chosen approach — be specific about the approach, not the tool.
|
|
34
33
|
|
|
35
34
|
## Rationale
|
|
36
|
-
Why this
|
|
35
|
+
Why this won.
|
|
37
36
|
|
|
38
37
|
## Alternatives Considered
|
|
39
38
|
|
|
@@ -50,13 +49,11 @@ Why this approach? What are the key benefits that made this the winner?
|
|
|
50
49
|
- Why rejected: {Specific reason}
|
|
51
50
|
|
|
52
51
|
## Trade-Offs
|
|
53
|
-
What are we gaining and what are we giving up?
|
|
54
52
|
- Gain: {benefit}
|
|
55
53
|
- Give up: {drawback}
|
|
56
54
|
- Mitigation: {how we'll handle the drawback}
|
|
57
55
|
|
|
58
56
|
## Consequences
|
|
59
|
-
What changes because of this decision?
|
|
60
57
|
- {Positive consequence}
|
|
61
58
|
- {Negative consequence}
|
|
62
59
|
- {Future decisions this enables or blocks}
|
|
@@ -64,70 +61,59 @@ What changes because of this decision?
|
|
|
64
61
|
|
|
65
62
|
## Constitutional Gate Check
|
|
66
63
|
|
|
67
|
-
Before finalizing any
|
|
64
|
+
Before finalizing any decision, check against `.forge/constitution.md`:
|
|
68
65
|
|
|
69
66
|
1. Read the relevant articles
|
|
70
|
-
2.
|
|
71
|
-
3.
|
|
67
|
+
2. Confirm the decision satisfies all gates
|
|
68
|
+
3. Gate fails → change the decision or propose a constitutional amendment
|
|
72
69
|
|
|
73
|
-
Common
|
|
74
|
-
- **Article I (Library-First)**: Custom solution when library exists?
|
|
75
|
-
- **Article III (Simplicity)**:
|
|
76
|
-
- **Article IV (Consistency)**: Breaking
|
|
77
|
-
- **Article V (Design System)**:
|
|
70
|
+
Common conflicts:
|
|
71
|
+
- **Article I (Library-First)**: Custom solution when a library exists?
|
|
72
|
+
- **Article III (Simplicity)**: Unnecessary complexity?
|
|
73
|
+
- **Article IV (Consistency)**: Breaking patterns without justification?
|
|
74
|
+
- **Article V (Design System)**: UI elements outside the design system?
|
|
78
75
|
|
|
79
76
|
## Scope Assessment
|
|
80
77
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
|
84
|
-
|-------|---------|-----------------|
|
|
85
|
-
| Single feature only | Comment in code + brief note in plan | No |
|
|
78
|
+
| Scope | Storage | Review |
|
|
79
|
+
|-------|---------|--------|
|
|
80
|
+
| Single feature | Code comment + plan note | No |
|
|
86
81
|
| Multiple features | `.forge/decisions/ADR-{NNN}.md` | User approval |
|
|
87
|
-
|
|
|
88
|
-
| External
|
|
82
|
+
| Project structure | ADR + update `project.yml` | User approval + constitutional check |
|
|
83
|
+
| External boundary | ADR + API contract | User approval + security review |
|
|
89
84
|
|
|
90
85
|
## Data Model Design
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
1. Start with the user stories (what data do they need to see/create/edit?)
|
|
87
|
+
1. Start from user stories — what data do they see/create/edit?
|
|
95
88
|
2. Identify entities and relationships
|
|
96
|
-
3. Define required
|
|
97
|
-
4. Consider indexing
|
|
98
|
-
5. Plan for evolution
|
|
89
|
+
3. Define required vs. optional fields
|
|
90
|
+
4. Consider indexing for frequent queries
|
|
91
|
+
5. Plan for evolution — prefer nullable fields over rigid schemas
|
|
99
92
|
|
|
100
93
|
Document in `.forge/phases/m{M}-{N}-{name}/data-model.md`.
|
|
101
94
|
|
|
102
95
|
## API Contract Design
|
|
103
96
|
|
|
104
|
-
When designing APIs:
|
|
105
|
-
|
|
106
97
|
1. Define endpoints with HTTP methods
|
|
107
98
|
2. Specify request/response schemas (TypeScript interfaces or JSON Schema)
|
|
108
99
|
3. Document error responses
|
|
109
|
-
4.
|
|
110
|
-
5. Plan
|
|
100
|
+
4. Add pagination for list endpoints
|
|
101
|
+
5. Plan per-endpoint auth requirements
|
|
111
102
|
|
|
112
103
|
Document in `.forge/phases/m{M}-{N}-{name}/contracts/`.
|
|
113
104
|
|
|
114
105
|
## Output
|
|
115
106
|
|
|
116
|
-
After completing architectural work:
|
|
117
107
|
1. ADR filed in `.forge/decisions/`
|
|
118
108
|
2. Data model documented (if applicable)
|
|
119
109
|
3. API contracts defined (if applicable)
|
|
120
|
-
4. Constitutional gates
|
|
121
|
-
5. User
|
|
110
|
+
4. Constitutional gates checked
|
|
111
|
+
5. User approved significant decisions
|
|
122
112
|
|
|
123
113
|
## Phase Handoff
|
|
124
114
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
1. **Verify persistence** — Confirm ADRs are written to `.forge/decisions/`, data models and API contracts to `.forge/phases/m{M}-{N}-{name}/`
|
|
115
|
+
1. **Persist** — Confirm ADRs in `.forge/decisions/`, models and contracts in `.forge/phases/m{M}-{N}-{name}/`
|
|
128
116
|
2. **Update state** — Set `current.status` to `planning` in `.forge/state/milestone-{id}.yml`
|
|
129
117
|
3. **Recommend context clear:**
|
|
130
118
|
|
|
131
|
-
*"
|
|
132
|
-
|
|
133
|
-
*Ready to continue? Clear context and invoke `/forge` to resume."*
|
|
119
|
+
*"Architecture decisions written. `/clear` then `/forge` to continue with planning."*
|
|
@@ -1,70 +1,60 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: beads-integration
|
|
3
|
-
description: "Use when Beads is installed
|
|
3
|
+
description: "Use when Beads is installed for persistent cross-session memory. Trigger on: session start (bd prime), finding unblocked work (bd ready), completing tasks (bd complete), or managing multi-session projects. Requires Beads CLI."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Beads Integration
|
|
6
|
+
# Beads Integration
|
|
7
7
|
|
|
8
|
-
Persistent cross-session memory.
|
|
8
|
+
Persistent cross-session memory. Requires Beads CLI.
|
|
9
9
|
|
|
10
10
|
## Prerequisites
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
2. Beads initialized in project: `.beads/` directory exists
|
|
12
|
+
1. Beads CLI installed: `bd --version`
|
|
13
|
+
2. Beads initialized: `.beads/` directory exists
|
|
15
14
|
3. Forge integration enabled: `settings.json → forge.beads_integration: true`
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
Without Beads, Forge uses `.forge/state/` + Session Memory.
|
|
18
17
|
|
|
19
18
|
## Integration Points
|
|
20
19
|
|
|
21
|
-
###
|
|
20
|
+
### Session Start: `bd prime`
|
|
22
21
|
|
|
23
|
-
Run at
|
|
22
|
+
Run at every session start:
|
|
24
23
|
|
|
25
24
|
```bash
|
|
26
25
|
bd prime
|
|
27
26
|
```
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
- Open tasks with zero open blockers
|
|
31
|
-
- Recently closed tasks (last 3)
|
|
32
|
-
- Active blockers and their status
|
|
28
|
+
Injects ~1-2K tokens: open unblocked tasks, recently closed tasks (last 3), active blockers.
|
|
33
29
|
|
|
34
|
-
Combine with Forge state:
|
|
30
|
+
Combine with Forge state: `.forge/state/milestone-{id}.yml` for workflow position, `bd prime` for project-wide context.
|
|
35
31
|
|
|
36
32
|
### Finding Work: `bd ready`
|
|
37
33
|
|
|
38
|
-
Instead of manually triaging, query what's available:
|
|
39
|
-
|
|
40
34
|
```bash
|
|
41
35
|
bd ready # All unblocked tasks, sorted by priority
|
|
42
36
|
bd ready --priority 3 # Only priority 3+ tasks
|
|
43
37
|
bd ready --json # Machine-readable output
|
|
44
38
|
```
|
|
45
39
|
|
|
46
|
-
Use
|
|
40
|
+
Use output to decide which Forge phase/plan to work on next.
|
|
47
41
|
|
|
48
42
|
### During Work: `bd update`
|
|
49
43
|
|
|
50
|
-
As you complete Forge tasks, update Beads:
|
|
51
|
-
|
|
52
44
|
```bash
|
|
53
|
-
bd complete {task-id}
|
|
54
|
-
bd block {task-id} --by {blocker-id}
|
|
55
|
-
bd unblock {task-id}
|
|
45
|
+
bd complete {task-id} # Mark task done
|
|
46
|
+
bd block {task-id} --by {blocker-id} # Record a blocker
|
|
47
|
+
bd unblock {task-id} # Remove a blocker
|
|
56
48
|
```
|
|
57
49
|
|
|
58
50
|
### Memory Hygiene: `bd compact`
|
|
59
51
|
|
|
60
|
-
Periodically clean up old completed tasks:
|
|
61
|
-
|
|
62
52
|
```bash
|
|
63
|
-
bd compact --analyze --json #
|
|
53
|
+
bd compact --analyze --json # Preview what gets compacted
|
|
64
54
|
bd compact --apply # Summarize old tasks (30+ days closed)
|
|
65
55
|
```
|
|
66
56
|
|
|
67
|
-
Compaction replaces detailed task content with LLM-generated summaries,
|
|
57
|
+
Compaction replaces detailed task content with LLM-generated summaries, reducing token cost while preserving essential context.
|
|
68
58
|
|
|
69
59
|
## Forge + Beads Workflow
|
|
70
60
|
|
|
@@ -83,37 +73,31 @@ bd prime → bd ready (pick task) → researching → discussing → planning
|
|
|
83
73
|
bd prime → bd ready (pick phase) → researching → discussing → architecting → planning → executing → bd complete → verifying → done
|
|
84
74
|
```
|
|
85
75
|
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
Forge's `.forge/state/` and Beads' `.beads/` serve different purposes:
|
|
76
|
+
## State Sync
|
|
89
77
|
|
|
90
78
|
| Concern | Forge (state/) | Beads (.beads/) |
|
|
91
79
|
|---------|----------------|-----------------|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
| Locked decisions |
|
|
95
|
-
| Project-wide task graph | |
|
|
96
|
-
| Cross-session memory | |
|
|
97
|
-
| Task prioritization | |
|
|
98
|
-
| Memory compaction | |
|
|
80
|
+
| Workflow position | milestone-{id}.yml: phase, plan, task | |
|
|
81
|
+
| Framework patterns | index.yml: desire_paths, metrics | |
|
|
82
|
+
| Locked decisions | context.md | |
|
|
83
|
+
| Project-wide task graph | | DAG with dependencies |
|
|
84
|
+
| Cross-session memory | | Persists in git |
|
|
85
|
+
| Task prioritization | | 5-level priority |
|
|
86
|
+
| Memory compaction | | Semantic summarization |
|
|
99
87
|
|
|
100
|
-
Both are git-tracked
|
|
88
|
+
Both are git-tracked and survive session boundaries. They complement each other.
|
|
101
89
|
|
|
102
90
|
## Creating Beads from Forge Plans
|
|
103
91
|
|
|
104
|
-
|
|
92
|
+
Optionally create Beads from Forge plan tasks for DAG dependency tracking:
|
|
105
93
|
|
|
106
94
|
```bash
|
|
107
95
|
bd create "Implement login form" --priority 3
|
|
108
96
|
bd create "Add auth API endpoint" --priority 3 --blocked-by {login-form-id}
|
|
109
97
|
```
|
|
110
98
|
|
|
111
|
-
This gives you the DAG dependency tracking that Forge's flat plan files don't provide.
|
|
112
|
-
|
|
113
99
|
## Disabling Beads Integration
|
|
114
100
|
|
|
115
|
-
If you want Forge without Beads:
|
|
116
|
-
|
|
117
101
|
```json
|
|
118
102
|
{
|
|
119
103
|
"forge": {
|
|
@@ -122,4 +106,4 @@ If you want Forge without Beads:
|
|
|
122
106
|
}
|
|
123
107
|
```
|
|
124
108
|
|
|
125
|
-
Beads continues working independently
|
|
109
|
+
Beads continues working independently; Forge stops querying/updating it.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: debugging
|
|
3
|
-
description: "
|
|
3
|
+
description: "Systematic debugging when tests fail, features break, errors are cryptic/intermittent, or you've been stuck 10+ minutes. Prevents thrashing via scientific method."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Debugging
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Every hypothesis tested, every dead end recorded.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Scientific Method
|
|
11
11
|
|
|
12
|
-
1. **Observe**:
|
|
13
|
-
2. **Hypothesize**:
|
|
14
|
-
3. **Predict**: If hypothesis
|
|
15
|
-
4. **Test**: Run
|
|
16
|
-
5. **Eliminate**:
|
|
17
|
-
6. **Iterate**: Next hypothesis
|
|
18
|
-
7. **Conclude**: Root cause
|
|
12
|
+
1. **Observe**: Exact behavior — error, repro steps, when it started
|
|
13
|
+
2. **Hypothesize**: Max 3 candidate causes
|
|
14
|
+
3. **Predict**: If hypothesis holds, what should the test show?
|
|
15
|
+
4. **Test**: Run it. Capture evidence.
|
|
16
|
+
5. **Eliminate**: Support or refute? Record result.
|
|
17
|
+
6. **Iterate**: Next hypothesis or refine current one
|
|
18
|
+
7. **Conclude**: Root cause found. Fix it.
|
|
19
19
|
|
|
20
20
|
## Persistent Debug File
|
|
21
21
|
|
|
@@ -69,62 +69,61 @@ updated: 2026-02-16T19:30:00Z
|
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
### Update Rules
|
|
72
|
-
- **Status**: Overwrite
|
|
73
|
-
- **Current Focus**: Overwrite
|
|
72
|
+
- **Status**: Overwrite on phase transitions only
|
|
73
|
+
- **Current Focus**: Overwrite before every action
|
|
74
74
|
- **Symptoms**: Immutable after gathering phase
|
|
75
|
-
- **Eliminated**: Append only
|
|
75
|
+
- **Eliminated**: Append only — prevents re-investigating dead ends
|
|
76
76
|
- **Evidence Log**: Append only
|
|
77
77
|
|
|
78
78
|
## Investigation Techniques
|
|
79
79
|
|
|
80
|
-
Use
|
|
80
|
+
Use in order of effectiveness:
|
|
81
81
|
|
|
82
|
-
### 1. Read the Error
|
|
83
|
-
Read the ENTIRE error message, stack trace, and surrounding log output. Most bugs are explained by the error
|
|
82
|
+
### 1. Read the Error
|
|
83
|
+
Read the ENTIRE error message, stack trace, and surrounding log output. Most bugs are explained by the error.
|
|
84
84
|
|
|
85
85
|
### 2. Binary Search
|
|
86
|
-
Cut the problem space in half.
|
|
86
|
+
Cut the problem space in half. Test after step 5 of 10. Works? Bug is in 6-10. Repeat.
|
|
87
87
|
|
|
88
88
|
### 3. Minimal Reproduction
|
|
89
|
-
Strip away everything until only the bug remains. Remove middleware, simplify data,
|
|
89
|
+
Strip away everything until only the bug remains. Remove middleware, simplify data, hardcode values.
|
|
90
90
|
|
|
91
91
|
### 4. Differential Debugging
|
|
92
|
-
What changed? `git diff`, `git log`, recent dependency updates.
|
|
92
|
+
What changed? `git diff`, `git log`, recent dependency updates.
|
|
93
93
|
|
|
94
94
|
### 5. Working Backwards
|
|
95
|
-
Start from the wrong output. Trace
|
|
95
|
+
Start from the wrong output. Trace data backward: which function produced it? What was its input?
|
|
96
96
|
|
|
97
97
|
### 6. Comment Out Everything
|
|
98
|
-
Remove all code. Uncomment one piece at a time. When the bug reappears,
|
|
98
|
+
Remove all code. Uncomment one piece at a time. When the bug reappears, that's the culprit.
|
|
99
99
|
|
|
100
100
|
### 7. Add Observability First
|
|
101
|
-
|
|
101
|
+
Add logging before changing behavior. See what's happening before guessing.
|
|
102
102
|
|
|
103
103
|
### 8. Git Bisect
|
|
104
|
-
|
|
104
|
+
`git bisect start`, `git bisect bad` (current), `git bisect good {hash}` (working version). Git finds the exact breaking commit.
|
|
105
105
|
|
|
106
|
-
## Cognitive Bias
|
|
106
|
+
## Cognitive Bias Traps
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
- **
|
|
110
|
-
- **
|
|
111
|
-
- **
|
|
112
|
-
- **Sunk cost**: Continuing a dead-end investigation because you've spent time on it
|
|
108
|
+
- **Confirmation bias**: Seeking evidence for your theory, ignoring counter-evidence
|
|
109
|
+
- **Anchoring**: Fixating on the first theory
|
|
110
|
+
- **Availability bias**: Blaming the last thing changed, even if unrelated
|
|
111
|
+
- **Sunk cost**: Continuing a dead-end investigation because of time spent
|
|
113
112
|
|
|
114
|
-
|
|
113
|
+
After 3 failed hypotheses, step back and re-read symptoms from scratch.
|
|
115
114
|
|
|
116
|
-
##
|
|
115
|
+
## Escalation
|
|
117
116
|
|
|
118
|
-
After 5 hypotheses tested without
|
|
119
|
-
1. Document everything in debug file
|
|
120
|
-
2. Mark
|
|
117
|
+
After 5 hypotheses tested without root cause:
|
|
118
|
+
1. Document everything in the debug file
|
|
119
|
+
2. Mark `[NEEDS PAIR DEBUGGING]` in `.forge/state/milestone-{id}.yml` blockers
|
|
121
120
|
3. The debug file saves the next person hours of re-investigation
|
|
122
121
|
|
|
123
122
|
## Resolution
|
|
124
123
|
|
|
125
124
|
When root cause found:
|
|
126
125
|
1. Fix the issue
|
|
127
|
-
2. Add a test
|
|
126
|
+
2. Add a regression test for this specific bug
|
|
128
127
|
3. Commit: `fix({scope}): {description of root cause and fix}`
|
|
129
128
|
4. Move debug file to `.forge/debug/resolved/`
|
|
130
129
|
5. Update `.forge/state/milestone-{id}.yml` — remove from blockers
|