@jadeit/forge-ai 0.0.0 → 1.4.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/agents/build-agent.md +206 -0
- package/agents/deploy-agent.md +256 -0
- package/agents/design-agent.md +261 -0
- package/agents/feature-dev/approach.md +169 -0
- package/agents/feature-dev/clarify.md +131 -0
- package/agents/feature-dev/discover.md +113 -0
- package/agents/feature-dev/explore.md +124 -0
- package/agents/feature-dev/implement.md +211 -0
- package/agents/feature-dev/review.md +208 -0
- package/agents/feature-dev/summarise.md +199 -0
- package/agents/feature-dev/validate.md +211 -0
- package/agents/forge-orchestrator.md +188 -0
- package/agents/maintain-agent.md +251 -0
- package/agents/plan-agent.md +192 -0
- package/agents/test-agent.md +215 -0
- package/commands/forge-1-plan.md +48 -0
- package/commands/forge-2-design.md +51 -0
- package/commands/forge-3-build-1-discover.md +34 -0
- package/commands/forge-3-build-2-explore.md +30 -0
- package/commands/forge-3-build-3-clarify.md +39 -0
- package/commands/forge-3-build-4-approach.md +38 -0
- package/commands/forge-3-build-5-implement.md +38 -0
- package/commands/forge-3-build-6-review.md +50 -0
- package/commands/forge-3-build-7-validate.md +49 -0
- package/commands/forge-3-build-8-summarise.md +49 -0
- package/commands/forge-3-build.md +54 -0
- package/commands/forge-4-test.md +45 -0
- package/commands/forge-5-deploy.md +50 -0
- package/commands/forge-6-maintain.md +66 -0
- package/commands/forge-init.md +111 -0
- package/commands/forge-status.md +94 -0
- package/commands/forge.md +77 -0
- package/dist/agents/build-agent.md +29 -44
- package/dist/agents/design-agent.md +41 -1
- package/dist/agents/feature-dev/implement.md +11 -0
- package/dist/agents/feature-dev/review.md +3 -0
- package/dist/agents/feature-dev/summarise.md +12 -0
- package/dist/agents/plan-agent.md +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +171 -2
- package/dist/index.js.map +1 -1
- package/dist/skills/forge-build/SKILL.md +48 -0
- package/dist/skills/forge-build-approach/SKILL.md +39 -0
- package/dist/skills/forge-build-clarify/SKILL.md +40 -0
- package/dist/skills/forge-build-discover/SKILL.md +35 -0
- package/dist/skills/forge-build-explore/SKILL.md +31 -0
- package/dist/skills/forge-build-implement/SKILL.md +39 -0
- package/dist/skills/forge-build-review/SKILL.md +51 -0
- package/dist/skills/forge-build-summarise/SKILL.md +51 -0
- package/dist/skills/forge-build-validate/SKILL.md +50 -0
- package/dist/skills/forge-deploy/SKILL.md +52 -0
- package/dist/skills/forge-design/SKILL.md +53 -0
- package/dist/skills/forge-init/SKILL.md +83 -0
- package/dist/skills/forge-maintain/SKILL.md +53 -0
- package/dist/skills/forge-plan/SKILL.md +50 -0
- package/dist/skills/forge-status/SKILL.md +59 -0
- package/dist/skills/forge-test/SKILL.md +47 -0
- package/package.json +7 -3
- package/skills/forge-build/SKILL.md +48 -0
- package/skills/forge-build-approach/SKILL.md +39 -0
- package/skills/forge-build-clarify/SKILL.md +40 -0
- package/skills/forge-build-discover/SKILL.md +35 -0
- package/skills/forge-build-explore/SKILL.md +31 -0
- package/skills/forge-build-implement/SKILL.md +39 -0
- package/skills/forge-build-review/SKILL.md +51 -0
- package/skills/forge-build-summarise/SKILL.md +51 -0
- package/skills/forge-build-validate/SKILL.md +50 -0
- package/skills/forge-context-loader/SKILL.md +99 -0
- package/skills/forge-deploy/SKILL.md +52 -0
- package/skills/forge-design/SKILL.md +53 -0
- package/skills/forge-init/SKILL.md +83 -0
- package/skills/forge-maintain/SKILL.md +53 -0
- package/skills/forge-plan/SKILL.md +50 -0
- package/skills/forge-quality-checker/SKILL.md +227 -0
- package/skills/forge-state-manager/SKILL.md +235 -0
- package/skills/forge-status/SKILL.md +59 -0
- package/skills/forge-template-loader/SKILL.md +162 -0
- package/skills/forge-test/SKILL.md +47 -0
- package/templates/defects/DEFECT_TEMPLATE.md +96 -0
- package/templates/design/design-decisions.md +64 -0
- package/templates/design/task-list.md +56 -0
- package/templates/design/tasks/TASK_TEMPLATE.md +87 -0
- package/templates/planning/implementation-plan.md +59 -0
- package/templates/planning/project-scope.md +53 -0
- package/templates/planning/technology-and-architecture.md +80 -0
- package/templates/planning/user-stories.md +48 -0
- package/templates/testing/uat-results.md +68 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-plan
|
|
3
|
+
description: Forge AI Phase 1 - Planning and requirement analysis
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Forge AI: Phase 1 - Planning
|
|
9
|
+
|
|
10
|
+
Invoke the `@forge-plan` agent to begin Phase 1: Planning.
|
|
11
|
+
|
|
12
|
+
## What Happens
|
|
13
|
+
|
|
14
|
+
1. Context is loaded (existing README/brief if present)
|
|
15
|
+
2. Planning agent creates required documents:
|
|
16
|
+
- `docs/planning/project-scope.md`
|
|
17
|
+
- `docs/planning/user-stories.md`
|
|
18
|
+
- `docs/planning/implementation-plan.md`
|
|
19
|
+
- `docs/planning/technology-and-architecture.md`
|
|
20
|
+
3. Agent validates all required artifacts exist
|
|
21
|
+
4. State is updated in `.forge/state.yaml`
|
|
22
|
+
5. You confirm transition to Phase 2
|
|
23
|
+
|
|
24
|
+
## Phase 1 Outputs
|
|
25
|
+
|
|
26
|
+
| Document | Purpose |
|
|
27
|
+
|----------|---------|
|
|
28
|
+
| project-scope.md | Project aim, high-level design, technology choices |
|
|
29
|
+
| user-stories.md | User stories that drive development |
|
|
30
|
+
| implementation-plan.md | High-level phases to be implemented |
|
|
31
|
+
| technology-and-architecture.md | Tech choices and architecture (C4 Model) |
|
|
32
|
+
|
|
33
|
+
## Constraints
|
|
34
|
+
|
|
35
|
+
- NO executable code, scaffolding, or infrastructure
|
|
36
|
+
- Illustrative code snippets ARE permitted
|
|
37
|
+
- Use Mermaid diagrams for architecture
|
|
38
|
+
|
|
39
|
+
## Flags
|
|
40
|
+
|
|
41
|
+
- `--only {artifact}` - Work on specific artifact only
|
|
42
|
+
- Options: project-scope, user-stories, implementation-plan, technology
|
|
43
|
+
|
|
44
|
+
## Prerequisites
|
|
45
|
+
|
|
46
|
+
None — Phase 1 is the starting point.
|
|
47
|
+
|
|
48
|
+
## Next Steps
|
|
49
|
+
|
|
50
|
+
After Phase 1 complete, use `/forge-design` for Phase 2: Design.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-quality-checker
|
|
3
|
+
description: Run quality gates for Forge Phase 3 - linting, type checking, security, coverage
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
metadata:
|
|
7
|
+
audience: forge-users
|
|
8
|
+
workflow: build-phase
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Forge Quality Checker
|
|
12
|
+
|
|
13
|
+
Run quality gates for Feature Development (Phase 3).
|
|
14
|
+
|
|
15
|
+
## Quality Thresholds
|
|
16
|
+
|
|
17
|
+
Read from `.forge/config.yaml`:
|
|
18
|
+
```yaml
|
|
19
|
+
quality:
|
|
20
|
+
test_coverage_minimum: 80
|
|
21
|
+
lint_must_pass: true
|
|
22
|
+
type_check_must_pass: true
|
|
23
|
+
security_audit_must_pass: true
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Quality Gate Sequence
|
|
27
|
+
|
|
28
|
+
Run in this order - fail fast:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
1. Lint Check
|
|
32
|
+
↓ (if pass)
|
|
33
|
+
2. Type Check
|
|
34
|
+
↓ (if pass)
|
|
35
|
+
3. Security Audit
|
|
36
|
+
↓ (if pass)
|
|
37
|
+
4. Tests
|
|
38
|
+
↓ (if pass)
|
|
39
|
+
5. Coverage Check
|
|
40
|
+
↓ (if pass)
|
|
41
|
+
6. AI Code Review
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Gate Definitions
|
|
45
|
+
|
|
46
|
+
### 1. Lint Check
|
|
47
|
+
|
|
48
|
+
Run the project's linter:
|
|
49
|
+
```bash
|
|
50
|
+
# Python
|
|
51
|
+
npm run lint # or ruff, pylint, etc.
|
|
52
|
+
|
|
53
|
+
# JavaScript/TypeScript
|
|
54
|
+
npm run lint
|
|
55
|
+
|
|
56
|
+
# Multiple
|
|
57
|
+
npm run lint && npm run lint:style
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Gate:** Must pass (exit code 0)
|
|
61
|
+
|
|
62
|
+
### 2. Type Check
|
|
63
|
+
|
|
64
|
+
Run the project's type checker:
|
|
65
|
+
```bash
|
|
66
|
+
# TypeScript
|
|
67
|
+
npx tsc --noEmit
|
|
68
|
+
|
|
69
|
+
# Python
|
|
70
|
+
npm run typecheck # or mypy, pyright
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Gate:** Must pass (exit code 0)
|
|
74
|
+
|
|
75
|
+
### 3. Security Audit
|
|
76
|
+
|
|
77
|
+
Run security checks:
|
|
78
|
+
```bash
|
|
79
|
+
# npm
|
|
80
|
+
npm audit
|
|
81
|
+
|
|
82
|
+
# pip
|
|
83
|
+
pip-audit
|
|
84
|
+
|
|
85
|
+
# Docker
|
|
86
|
+
trivy image [image-name]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Gate:** Must pass (no critical/high vulnerabilities, or all acknowledged)
|
|
90
|
+
|
|
91
|
+
### 4. Tests
|
|
92
|
+
|
|
93
|
+
Run the test suite:
|
|
94
|
+
```bash
|
|
95
|
+
npm test
|
|
96
|
+
# or
|
|
97
|
+
pytest
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Gate:** All tests must pass (no failures)
|
|
101
|
+
|
|
102
|
+
### 5. Coverage Check
|
|
103
|
+
|
|
104
|
+
Run tests with coverage:
|
|
105
|
+
```bash
|
|
106
|
+
# Jest
|
|
107
|
+
npm run test:coverage
|
|
108
|
+
|
|
109
|
+
# pytest
|
|
110
|
+
pytest --cov=. --cov-report=term-missing
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Gate:** Coverage >= configured minimum (default 80%)
|
|
114
|
+
|
|
115
|
+
## Tool Detection
|
|
116
|
+
|
|
117
|
+
Detect available tools automatically:
|
|
118
|
+
|
|
119
|
+
| File | Tool |
|
|
120
|
+
|------|------|
|
|
121
|
+
| `package.json` | npm, jest, eslint, tsc |
|
|
122
|
+
| `pyproject.toml` | pytest, ruff, mypy |
|
|
123
|
+
| `Dockerfile` | hadolint, trivy |
|
|
124
|
+
| `Makefile` | make targets |
|
|
125
|
+
|
|
126
|
+
## Language-Specific Guidelines
|
|
127
|
+
|
|
128
|
+
### Python
|
|
129
|
+
|
|
130
|
+
- Use `ruff` for linting and formatting
|
|
131
|
+
- Use `mypy` or `pyright` for type checking
|
|
132
|
+
- Use `pytest` for testing
|
|
133
|
+
- Use `bandit` for security
|
|
134
|
+
|
|
135
|
+
### JavaScript/TypeScript
|
|
136
|
+
|
|
137
|
+
- Use `eslint` for linting
|
|
138
|
+
- Use `typescript` (tsc) for type checking
|
|
139
|
+
- Use `jest` or `vitest` for testing
|
|
140
|
+
- Use `npm audit` for security
|
|
141
|
+
|
|
142
|
+
### Multi-language Projects
|
|
143
|
+
|
|
144
|
+
Run all applicable tools:
|
|
145
|
+
```bash
|
|
146
|
+
# Run all checks
|
|
147
|
+
npm run lint && npm run typecheck && npm test
|
|
148
|
+
ruff check .
|
|
149
|
+
mypy src/
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## AI Code Review
|
|
153
|
+
|
|
154
|
+
After automated checks pass, perform AI review:
|
|
155
|
+
|
|
156
|
+
### SOLID Principles Check
|
|
157
|
+
|
|
158
|
+
- **S**ingle Responsibility: Does each module do one thing?
|
|
159
|
+
- **O**pen/Closed: Open for extension, closed for modification?
|
|
160
|
+
- **L**iskov Substitution: Can subtypes replace base types?
|
|
161
|
+
- **I**nterface Segregation: Are interfaces small and focused?
|
|
162
|
+
- **D**ependency Inversion: Depend on abstractions?
|
|
163
|
+
|
|
164
|
+
### Design Patterns Check
|
|
165
|
+
|
|
166
|
+
Are established patterns used appropriately?
|
|
167
|
+
- Factory, Builder, Singleton
|
|
168
|
+
- Repository, Unit of Work
|
|
169
|
+
- Observer, Strategy
|
|
170
|
+
|
|
171
|
+
### Error Handling Check
|
|
172
|
+
|
|
173
|
+
- Are errors caught and handled appropriately?
|
|
174
|
+
- Are exceptions used for exceptional cases only?
|
|
175
|
+
- Is error context preserved?
|
|
176
|
+
|
|
177
|
+
### Security Check (Manual)
|
|
178
|
+
|
|
179
|
+
- Input validation on all user inputs
|
|
180
|
+
- Authentication/authorization properly enforced
|
|
181
|
+
- Secrets not logged or exposed
|
|
182
|
+
- SQL injection, XSS, CSRF addressed
|
|
183
|
+
|
|
184
|
+
## Reporting
|
|
185
|
+
|
|
186
|
+
### Pass Report
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
Quality Gates: PASSED
|
|
190
|
+
|
|
191
|
+
✓ Lint Check - No issues
|
|
192
|
+
✓ Type Check - No errors
|
|
193
|
+
✓ Security Audit - No vulnerabilities
|
|
194
|
+
✓ Tests - 42 passed, 0 failed
|
|
195
|
+
✓ Coverage - 87% (threshold: 80%)
|
|
196
|
+
|
|
197
|
+
AI Code Review: PASSED
|
|
198
|
+
- SOLID compliance: ✓
|
|
199
|
+
- Design patterns: ✓
|
|
200
|
+
- Error handling: ✓
|
|
201
|
+
- Security: ✓
|
|
202
|
+
|
|
203
|
+
Ready to proceed.
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Fail Report
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
Quality Gates: FAILED
|
|
210
|
+
|
|
211
|
+
✗ Lint Check - 3 issues found
|
|
212
|
+
- src/auth.ts:45 - Unused variable 'temp'
|
|
213
|
+
- src/utils.ts:12 - Line too long (85 > 80)
|
|
214
|
+
- src/api.ts:78 - Missing semicolon
|
|
215
|
+
|
|
216
|
+
Fix required before proceeding.
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Rework Routing
|
|
220
|
+
|
|
221
|
+
| Issue Type | Route To |
|
|
222
|
+
|------------|----------|
|
|
223
|
+
| Lint/type errors | `forge 3:build 5:implement` |
|
|
224
|
+
| Test failures | `forge 3:build 5:implement` |
|
|
225
|
+
| Coverage below threshold | `forge 3:build 5:implement` |
|
|
226
|
+
| Design flaw | `forge 3:build 4:approach` |
|
|
227
|
+
| Security vulnerability | `forge 3:build 5:implement` (critical) or `forge 3:build 4:approach` |
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-state-manager
|
|
3
|
+
description: Manage Forge state transitions, phase tracking, feature status, and git hooks
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
metadata:
|
|
7
|
+
audience: forge-users
|
|
8
|
+
workflow: phase-execution
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Forge State Manager
|
|
12
|
+
|
|
13
|
+
Manage Forge state transitions, phase tracking, feature status, and git commit hooks.
|
|
14
|
+
|
|
15
|
+
## State File Location
|
|
16
|
+
|
|
17
|
+
`.forge/state.yaml`
|
|
18
|
+
|
|
19
|
+
## State Structure
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
project_phase: 1
|
|
23
|
+
phase_history:
|
|
24
|
+
- phase: 1
|
|
25
|
+
status: complete
|
|
26
|
+
started: 2026-03-20T10:00:00Z
|
|
27
|
+
completed: 2026-03-22T14:00:00Z
|
|
28
|
+
|
|
29
|
+
features:
|
|
30
|
+
auth-system:
|
|
31
|
+
phase: 3
|
|
32
|
+
mode: brownfield
|
|
33
|
+
started: 2026-03-22T14:00:00Z
|
|
34
|
+
current_sub_phase: 5_implement
|
|
35
|
+
rework_tracking:
|
|
36
|
+
implement_loops: 0
|
|
37
|
+
approach_loops: 0
|
|
38
|
+
history: []
|
|
39
|
+
commits: []
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Operations
|
|
43
|
+
|
|
44
|
+
### 1. Read Current State
|
|
45
|
+
|
|
46
|
+
Read `.forge/state.yaml` to understand:
|
|
47
|
+
- Current project phase
|
|
48
|
+
- Phase history and completion status
|
|
49
|
+
- Active features and their sub-phase
|
|
50
|
+
|
|
51
|
+
### 2. Update Phase Status
|
|
52
|
+
|
|
53
|
+
When completing a phase:
|
|
54
|
+
```yaml
|
|
55
|
+
phase_history:
|
|
56
|
+
- phase: 1
|
|
57
|
+
status: complete
|
|
58
|
+
started: 2026-03-20T10:00:00Z
|
|
59
|
+
completed: 2026-03-22T14:00:00Z
|
|
60
|
+
- phase: 2
|
|
61
|
+
status: in-progress
|
|
62
|
+
started: 2026-03-22T14:00:00Z
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. Update Feature Status
|
|
66
|
+
|
|
67
|
+
When working on a feature:
|
|
68
|
+
```yaml
|
|
69
|
+
features:
|
|
70
|
+
feature-slug:
|
|
71
|
+
phase: 3
|
|
72
|
+
mode: brownfield
|
|
73
|
+
started: 2026-03-22T14:00:00Z
|
|
74
|
+
current_sub_phase: 5_implement
|
|
75
|
+
task_document: docs/design/tasks/feature-slug.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 4. Update Task Status
|
|
79
|
+
|
|
80
|
+
In task document frontmatter:
|
|
81
|
+
```yaml
|
|
82
|
+
status: in-progress:approach # When in approach phase
|
|
83
|
+
status: complete # When done
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Phase Transition Process
|
|
87
|
+
|
|
88
|
+
### Before Transition
|
|
89
|
+
|
|
90
|
+
1. **Check artifact completeness** for current phase:
|
|
91
|
+
- Phase 1: project-scope.md, user-stories.md, implementation-plan.md, technology-and-architecture.md
|
|
92
|
+
- Phase 2: design-decisions.md, task-list.md, all task documents with required frontmatter
|
|
93
|
+
- Phase 3: Task implementation complete, review passes, validation passes
|
|
94
|
+
- Phase 4: UAT results documented, user sign-off obtained
|
|
95
|
+
- Phase 5: Deployment verified
|
|
96
|
+
- Phase 6: Monitoring active
|
|
97
|
+
|
|
98
|
+
2. **Propose transition** to user:
|
|
99
|
+
```
|
|
100
|
+
Phase 1 complete — all required artifacts found:
|
|
101
|
+
- ✓ docs/planning/project-scope.md
|
|
102
|
+
- ✓ docs/planning/user-stories.md
|
|
103
|
+
- ✓ docs/planning/implementation-plan.md
|
|
104
|
+
- ✓ docs/planning/technology-and-architecture.md
|
|
105
|
+
|
|
106
|
+
Confirm transition to Phase 2: Design?
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. **Wait for confirmation** before updating state
|
|
110
|
+
|
|
111
|
+
### After Confirmation
|
|
112
|
+
|
|
113
|
+
Update `.forge/state.yaml` with new phase and history entry
|
|
114
|
+
|
|
115
|
+
## Prerequisite Checking
|
|
116
|
+
|
|
117
|
+
### Check Function
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
function check_prerequisites(current_phase: int, target_phase: int) -> tuple[bool, list[str]]:
|
|
121
|
+
missing = []
|
|
122
|
+
if target_phase > 1 and current_phase < 1:
|
|
123
|
+
missing.append("Phase 1 (Planning) must be complete")
|
|
124
|
+
if target_phase > 2 and current_phase < 2:
|
|
125
|
+
missing.append("Phase 2 (Design) must be complete")
|
|
126
|
+
# ... etc
|
|
127
|
+
return (len(missing) == 0, missing)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Gate Behaviour
|
|
131
|
+
|
|
132
|
+
From `.forge/config.yaml`:
|
|
133
|
+
```yaml
|
|
134
|
+
gates:
|
|
135
|
+
warn_on_prerequisite_failure: true
|
|
136
|
+
allow_override: true
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
If prerequisites not met:
|
|
140
|
+
1. **Warn** the user about missing prerequisites
|
|
141
|
+
2. **List** what's missing
|
|
142
|
+
3. **Allow override** if user confirms to proceed anyway
|
|
143
|
+
|
|
144
|
+
## Feature Dev Sub-Phase Tracking
|
|
145
|
+
|
|
146
|
+
Track progress through Feature Dev sub-phases in state:
|
|
147
|
+
```yaml
|
|
148
|
+
features:
|
|
149
|
+
feature-slug:
|
|
150
|
+
current_sub_phase: 5_implement
|
|
151
|
+
sub_phase_history:
|
|
152
|
+
- sub_phase: 1_discover
|
|
153
|
+
status: complete
|
|
154
|
+
completed: 2026-03-22T14:30:00Z
|
|
155
|
+
- sub_phase: 2_explore
|
|
156
|
+
status: complete
|
|
157
|
+
completed: 2026-03-22T15:00:00Z
|
|
158
|
+
- sub_phase: 3_clarify
|
|
159
|
+
status: complete
|
|
160
|
+
completed: 2026-03-22T15:30:00Z
|
|
161
|
+
- sub_phase: 4_approach
|
|
162
|
+
status: complete
|
|
163
|
+
completed: 2026-03-22T16:00:00Z
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Rework Loop Detection
|
|
167
|
+
|
|
168
|
+
Track iterations when rework occurs.
|
|
169
|
+
|
|
170
|
+
### Tracking
|
|
171
|
+
|
|
172
|
+
Increment counters when rework happens:
|
|
173
|
+
|
|
174
|
+
| Action | Counter to Increment |
|
|
175
|
+
|--------|---------------------|
|
|
176
|
+
| Review → Implement (minor fixes) | `implement_loops` |
|
|
177
|
+
| Review → Approach (fundamental issues) | `approach_loops` |
|
|
178
|
+
|
|
179
|
+
### State Update
|
|
180
|
+
|
|
181
|
+
```yaml
|
|
182
|
+
features:
|
|
183
|
+
feature-slug:
|
|
184
|
+
rework_tracking:
|
|
185
|
+
implement_loops: 1
|
|
186
|
+
approach_loops: 0
|
|
187
|
+
history:
|
|
188
|
+
- action: rework_implement
|
|
189
|
+
timestamp: 2026-03-22T16:00:00Z
|
|
190
|
+
reason: "Type check failures"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Thresholds
|
|
194
|
+
|
|
195
|
+
Default thresholds (from `.forge/config.yaml`):
|
|
196
|
+
```yaml
|
|
197
|
+
rework:
|
|
198
|
+
max_implement_loops: 3
|
|
199
|
+
max_approach_loops: 2
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Warning Format
|
|
203
|
+
|
|
204
|
+
When threshold exceeded:
|
|
205
|
+
```
|
|
206
|
+
⚠️ Rework Alert: auth-system
|
|
207
|
+
- Implement loops: 3/3 (MAX)
|
|
208
|
+
- Approach loops: 1/2
|
|
209
|
+
|
|
210
|
+
Consider:
|
|
211
|
+
1. Pausing implementation
|
|
212
|
+
2. Re-evaluating approach
|
|
213
|
+
3. Requesting human review
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Reset on Success
|
|
217
|
+
|
|
218
|
+
Reset counters when sub-phase completes successfully:
|
|
219
|
+
```yaml
|
|
220
|
+
rework_tracking:
|
|
221
|
+
implement_loops: 0
|
|
222
|
+
approach_loops: 0
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Rework State Management
|
|
226
|
+
|
|
227
|
+
### Minor Issues (Loop to Implement)
|
|
228
|
+
- Stay in current feature
|
|
229
|
+
- Track iteration count in `rework_tracking.implement_loops`
|
|
230
|
+
- Don't create new sub-phase entries
|
|
231
|
+
|
|
232
|
+
### Approach Issues (Loop to Approach)
|
|
233
|
+
- Move current_sub_phase back to "4_approach"
|
|
234
|
+
- Track in `rework_tracking.approach_loops`
|
|
235
|
+
- Note what changed in approach
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forge-status
|
|
3
|
+
description: Forge AI - Diagnose and recover from state inconsistencies
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Forge Status - State Recovery
|
|
9
|
+
|
|
10
|
+
Diagnose and recover from Forge state inconsistencies.
|
|
11
|
+
|
|
12
|
+
## What It Checks
|
|
13
|
+
|
|
14
|
+
### 1. Phase Consistency
|
|
15
|
+
- Verify `project_phase` matches phase_history
|
|
16
|
+
- Check for orphaned phase entries
|
|
17
|
+
- Validate phase transitions are logical
|
|
18
|
+
|
|
19
|
+
### 2. Feature State Integrity
|
|
20
|
+
- Validate all features have required fields
|
|
21
|
+
- Check current_sub_phase is valid (1_discover through 8_summarise)
|
|
22
|
+
- Verify task_document paths exist
|
|
23
|
+
|
|
24
|
+
### 3. Task Document References
|
|
25
|
+
- Verify all referenced task documents exist
|
|
26
|
+
- Check for broken references
|
|
27
|
+
- Validate frontmatter consistency
|
|
28
|
+
|
|
29
|
+
### 4. Rework Tracking
|
|
30
|
+
- Report rework loop counts
|
|
31
|
+
- Warn if approaching thresholds
|
|
32
|
+
|
|
33
|
+
### 5. Context Budget
|
|
34
|
+
- Report context usage
|
|
35
|
+
- Warn if approaching limits
|
|
36
|
+
|
|
37
|
+
## Diagnostic Output Format
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Forge Status Report
|
|
41
|
+
====================
|
|
42
|
+
|
|
43
|
+
Phase: 3 (Development)
|
|
44
|
+
Active Features: 2
|
|
45
|
+
- auth-system: 5_implement (loops: 1/3)
|
|
46
|
+
- api-gateway: 3_clarify (loops: 0/3)
|
|
47
|
+
|
|
48
|
+
Issues Found: 1
|
|
49
|
+
⚠ WARN: docs/design/tasks/legacy-task.md references non-existent task
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Recovery Actions
|
|
53
|
+
|
|
54
|
+
| Issue | Recovery |
|
|
55
|
+
|-------|----------|
|
|
56
|
+
| Missing phase history | Rebuild from artifacts |
|
|
57
|
+
| Invalid sub-phase | Reset to valid state |
|
|
58
|
+
| Broken task ref | Remove orphaned reference |
|
|
59
|
+
| Corrupted state | Offer state reset |
|