@jadeit/forge-ai 0.0.0 → 1.2.1

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.
Files changed (49) hide show
  1. package/agents/build-agent.md +221 -0
  2. package/agents/deploy-agent.md +256 -0
  3. package/agents/design-agent.md +221 -0
  4. package/agents/feature-dev/approach.md +169 -0
  5. package/agents/feature-dev/clarify.md +131 -0
  6. package/agents/feature-dev/discover.md +113 -0
  7. package/agents/feature-dev/explore.md +124 -0
  8. package/agents/feature-dev/implement.md +200 -0
  9. package/agents/feature-dev/review.md +205 -0
  10. package/agents/feature-dev/summarise.md +187 -0
  11. package/agents/feature-dev/validate.md +211 -0
  12. package/agents/forge-orchestrator.md +188 -0
  13. package/agents/maintain-agent.md +251 -0
  14. package/agents/plan-agent.md +181 -0
  15. package/agents/test-agent.md +215 -0
  16. package/commands/forge-1-plan.md +48 -0
  17. package/commands/forge-2-design.md +51 -0
  18. package/commands/forge-3-build-1-discover.md +34 -0
  19. package/commands/forge-3-build-2-explore.md +30 -0
  20. package/commands/forge-3-build-3-clarify.md +39 -0
  21. package/commands/forge-3-build-4-approach.md +38 -0
  22. package/commands/forge-3-build-5-implement.md +38 -0
  23. package/commands/forge-3-build-6-review.md +50 -0
  24. package/commands/forge-3-build-7-validate.md +49 -0
  25. package/commands/forge-3-build-8-summarise.md +49 -0
  26. package/commands/forge-3-build.md +54 -0
  27. package/commands/forge-4-test.md +45 -0
  28. package/commands/forge-5-deploy.md +50 -0
  29. package/commands/forge-6-maintain.md +66 -0
  30. package/commands/forge-init.md +111 -0
  31. package/commands/forge-status.md +94 -0
  32. package/commands/forge.md +77 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +168 -2
  35. package/dist/index.js.map +1 -1
  36. package/package.json +7 -3
  37. package/skills/forge-context-loader/SKILL.md +99 -0
  38. package/skills/forge-quality-checker/SKILL.md +227 -0
  39. package/skills/forge-state-manager/SKILL.md +235 -0
  40. package/skills/forge-template-loader/SKILL.md +162 -0
  41. package/templates/defects/DEFECT_TEMPLATE.md +96 -0
  42. package/templates/design/design-decisions.md +64 -0
  43. package/templates/design/task-list.md +56 -0
  44. package/templates/design/tasks/TASK_TEMPLATE.md +87 -0
  45. package/templates/planning/implementation-plan.md +59 -0
  46. package/templates/planning/project-scope.md +53 -0
  47. package/templates/planning/technology-and-architecture.md +80 -0
  48. package/templates/planning/user-stories.md +48 -0
  49. package/templates/testing/uat-results.md +68 -0
@@ -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,162 @@
1
+ ---
2
+ name: forge-template-loader
3
+ description: Load and apply Forge document templates for all phases and artifacts
4
+ license: MIT
5
+ compatibility: opencode
6
+ metadata:
7
+ audience: forge-users
8
+ workflow: document-creation
9
+ ---
10
+
11
+ # Forge Template Loader
12
+
13
+ Load and apply Forge document templates for all phases and artifacts.
14
+
15
+ ## Template Locations
16
+
17
+ ```
18
+ .forge/templates/
19
+ ├── planning/
20
+ │ ├── project-scope.md
21
+ │ ├── user-stories.md
22
+ │ ├── implementation-plan.md
23
+ │ └── technology-and-architecture.md
24
+ ├── design/
25
+ │ ├── design-decisions.md
26
+ │ ├── task-list.md
27
+ │ └── tasks/
28
+ │ └── TASK_TEMPLATE.md
29
+ ├── testing/
30
+ │ └── uat-results.md
31
+ └── defects/
32
+ └── DEFECT_TEMPLATE.md
33
+ ```
34
+
35
+ ## Usage by Phase
36
+
37
+ ### Phase 1: Planning Templates
38
+
39
+ Load from `.forge/templates/planning/`:
40
+
41
+ | Document | Template | Output Location |
42
+ |----------|----------|-----------------|
43
+ | Project Scope | `project-scope.md` | `docs/planning/project-scope.md` |
44
+ | User Stories | `user-stories.md` | `docs/planning/user-stories.md` |
45
+ | Implementation Plan | `implementation-plan.md` | `docs/planning/implementation-plan.md` |
46
+ | Technology & Architecture | `technology-and-architecture.md` | `docs/planning/technology-and-architecture.md` |
47
+
48
+ ### Phase 2: Design Templates
49
+
50
+ Load from `.forge/templates/design/`:
51
+
52
+ | Document | Template | Output Location |
53
+ |----------|----------|-----------------|
54
+ | Design Decisions | `design-decisions.md` | `docs/design/design-decisions.md` |
55
+ | Task List | `task-list.md` | `docs/design/task-list.md` |
56
+ | Individual Task | `tasks/TASK_TEMPLATE.md` | `docs/design/tasks/{task-slug}.md` |
57
+
58
+ ### Phase 4: Testing Templates
59
+
60
+ | Document | Template | Output Location |
61
+ |----------|----------|-----------------|
62
+ | UAT Results | `testing/uat-results.md` | `docs/testing/uat-results.md` |
63
+
64
+ ### Defect Templates
65
+
66
+ | Document | Template | Output Location |
67
+ |----------|----------|-----------------|
68
+ | Defect Report | `defects/DEFECT_TEMPLATE.md` | `docs/defects/{defect-slug}.md` |
69
+
70
+ ## Template Variables
71
+
72
+ When applying templates, replace these placeholders:
73
+
74
+ | Variable | Description | Example |
75
+ |----------|-------------|---------|
76
+ | `[Task Title]` | Title of the task | "Implement user authentication" |
77
+ | `[Task Slug]` | URL-safe identifier | "implement-user-auth" |
78
+ | `[YYYY-MM-DD]` | Date placeholder | "2026-03-22" |
79
+ | `[timestamp]` | ISO 8601 timestamp | "2026-03-22T10:00:00Z" |
80
+ | `[Persona]` | User persona name | "End User" |
81
+ | `[Goal]` | User goal | "reset my password" |
82
+ | `[Benefit]` | User benefit | " regain access to my account" |
83
+
84
+ ## Required Frontmatter Fields
85
+
86
+ ### Task Document
87
+
88
+ ```yaml
89
+ ---
90
+ title: [Task Title]
91
+ status: not-started
92
+ mode: greenfield | brownfield
93
+ complexity: small | medium | large
94
+ categories:
95
+ - backend
96
+ affected_modules: []
97
+ dependencies: []
98
+ ---
99
+ ```
100
+
101
+ ### Defect Document
102
+
103
+ ```yaml
104
+ ---
105
+ title: [Defect Title]
106
+ severity: critical | high | medium | low
107
+ classification: design | implementation
108
+ status: open
109
+ source:
110
+ type: sentry | logs | test | uat | user-report
111
+ url: null
112
+ discovered: [timestamp]
113
+ affected_features: []
114
+ routed_to: null
115
+ ---
116
+ ```
117
+
118
+ ## Template Application Process
119
+
120
+ ### Creating a New Document
121
+
122
+ 1. **Read the template** from `.forge/templates/`
123
+ 2. **Replace placeholders** with actual values
124
+ 3. **Set initial status** in frontmatter (e.g., `status: in-progress`)
125
+ 4. **Set dates** to current timestamp
126
+ 5. **Write to destination** in `docs/`
127
+
128
+ ### Example: Creating a Task Document
129
+
130
+ ```
131
+ Input: TASK_TEMPLATE.md
132
+ Variables:
133
+ title = "Implement user authentication"
134
+ slug = "implement-user-auth"
135
+ complexity = "medium"
136
+ categories = ["backend", "database"]
137
+
138
+ Output: docs/design/tasks/implement-user-auth.md
139
+ ```
140
+
141
+ ## Template Validation
142
+
143
+ After creating a document, validate:
144
+
145
+ 1. **Frontmatter present** - Document starts with `---`
146
+ 2. **Required fields** - All required fields populated
147
+ 3. **Valid enums** - Status, mode, complexity use valid values
148
+ 4. **File path** - Correct location and naming
149
+
150
+ ## Modifying Templates
151
+
152
+ Templates can be customized per project:
153
+
154
+ 1. Copy from `.forge/templates/` to project root
155
+ 2. Modify as needed
156
+ 3. Use project-local template instead of global
157
+
158
+ Or extend `.forge/config.yaml`:
159
+ ```yaml
160
+ templates:
161
+ custom_path: .forge/templates-custom/
162
+ ```
@@ -0,0 +1,96 @@
1
+ ---
2
+ title: [Defect Title]
3
+ severity: critical
4
+ classification: implementation
5
+ status: open
6
+ source:
7
+ type: sentry
8
+ url: null
9
+ discovered: null
10
+ affected_features: []
11
+ routed_to: null
12
+ reproduction_steps: []
13
+ expected_behaviour: null
14
+ actual_behaviour: null
15
+ created: null
16
+ last_updated: null
17
+ ---
18
+
19
+ # Defect Report: [Title]
20
+
21
+ ## Summary
22
+
23
+ <!-- One-line summary of the defect -->
24
+
25
+ ## Severity
26
+
27
+ - [ ] Critical - System unusable, data loss risk
28
+ - [ ] High - Major feature broken, no workaround
29
+ - [ ] Medium - Feature broken, workaround exists
30
+ - [ ] Low - Minor issue, cosmetic
31
+
32
+ ## Classification
33
+
34
+ - **Design** - Flawed design that needs revisiting
35
+ - **Implementation** - Incorrect implementation of correct design
36
+
37
+ ## Source
38
+
39
+ | Field | Value |
40
+ |-------|-------|
41
+ | Type | sentry / logs / test / uat / user-report |
42
+ | URL | |
43
+ | Discovered | |
44
+
45
+ ## Affected Features
46
+
47
+ -
48
+
49
+ ## Reproduction Steps
50
+
51
+ 1.
52
+ 2.
53
+ 3.
54
+
55
+ ## Expected Behaviour
56
+
57
+ <!-- What should happen -->
58
+
59
+ ## Actual Behaviour
60
+
61
+ <!-- What actually happens -->
62
+
63
+ ## Screenshots / Logs
64
+
65
+ <!-- Include relevant screenshots or log excerpts -->
66
+
67
+ ## Environment
68
+
69
+ | Field | Value |
70
+ |-------|-------|
71
+ | Browser/OS | |
72
+ | Version | |
73
+ | User Type | |
74
+
75
+ ## Resolution
76
+
77
+ ### Routed To
78
+
79
+ - Design phase (`forge 2:design`)
80
+ - Build phase (`forge 3:build`)
81
+
82
+ ### Root Cause
83
+
84
+ <!-- Analysis of the root cause -->
85
+
86
+ ### Fix Applied
87
+
88
+ <!-- How the defect was resolved -->
89
+
90
+ ### Resolution Date
91
+
92
+ ## Changelog
93
+
94
+ | Date | Action | By |
95
+ |------|--------|-----|
96
+ | | | |
@@ -0,0 +1,64 @@
1
+ ---
2
+ title: Design Decisions
3
+ phase: 2
4
+ status: in-progress
5
+ created: null
6
+ last_updated: null
7
+ ---
8
+
9
+ # Design Decisions
10
+
11
+ ## Decision Record Template
12
+
13
+ | Field | Value |
14
+ |-------|-------|
15
+ | **Decision ID** | ADDR-001 |
16
+ | **Date** | YYYY-MM-DD |
17
+ | **Status** | Proposed / Accepted / Deprecated |
18
+ | **Deciders** | |
19
+ | **Context** | |
20
+ | **Decision** | |
21
+ | **Consequences** | |
22
+
23
+ ---
24
+
25
+ ## ADDR-001: [Title]
26
+
27
+ **Status:** Accepted
28
+
29
+ ### Context
30
+
31
+ <!-- What is the issue or decision being addressed? -->
32
+
33
+ ### Decision
34
+
35
+ <!-- What is the change that is proposed or has been made? -->
36
+
37
+ ### Alternatives Considered
38
+
39
+ 1. **Option A:**
40
+ - Pros:
41
+ - Cons:
42
+
43
+ 2. **Option B:**
44
+ - Pros:
45
+ - Cons:
46
+
47
+ ### Consequences
48
+
49
+ **Positive:**
50
+ -
51
+
52
+ **Negative:**
53
+ -
54
+
55
+ **Neutral:**
56
+ -
57
+
58
+ ---
59
+
60
+ ## Decision Index
61
+
62
+ | ID | Title | Status | Date |
63
+ |----|-------|--------|------|
64
+ | ADDR-001 | | | |
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Task List
3
+ phase: 2
4
+ status: in-progress
5
+ created: null
6
+ last_updated: null
7
+ ---
8
+
9
+ # Task List
10
+
11
+ ## Summary
12
+
13
+ | Total Tasks | Small | Medium | Large |
14
+ |-------------|-------|--------|-------|
15
+ | | | | |
16
+
17
+ ## Tasks by Category
18
+
19
+ ### Backend
20
+ | Task Slug | Title | Complexity | Dependencies |
21
+ |-----------|-------|------------|--------------|
22
+ | | | | |
23
+
24
+ ### Frontend
25
+ | Task Slug | Title | Complexity | Dependencies |
26
+ |-----------|-------|------------|--------------|
27
+ | | | | |
28
+
29
+ ### Infrastructure
30
+ | Task Slug | Title | Complexity | Dependencies |
31
+ |-----------|-------|------------|--------------|
32
+ | | | | |
33
+
34
+ ### Database
35
+ | Task Slug | Title | Complexity | Dependencies |
36
+ |-----------|-------|------------|--------------|
37
+ | | | | |
38
+
39
+ ### Documentation
40
+ | Task Slug | Title | Complexity | Dependencies |
41
+ |-----------|-------|------------|--------------|
42
+ | | | | |
43
+
44
+ ## Task Dependencies Graph
45
+
46
+ ```mermaid
47
+ flowchart LR
48
+ A[Task A] --> B[Task B]
49
+ B --> C[Task C]
50
+ ```
51
+
52
+ ## Implementation Order Recommendation
53
+
54
+ 1.
55
+ 2.
56
+ 3.
@@ -0,0 +1,87 @@
1
+ ---
2
+ title: [Task Title]
3
+ status: not-started
4
+ mode: greenfield
5
+ complexity: medium
6
+ categories:
7
+ - backend
8
+ affected_modules: []
9
+ dependencies: []
10
+ acceptance_criteria: []
11
+ created: null
12
+ last_updated: null
13
+ ---
14
+
15
+ # Task: [Title]
16
+
17
+ ## Summary / Objective
18
+
19
+ <!-- What this task achieves and why it is needed -->
20
+
21
+ ## User Story Reference
22
+
23
+ <!-- Link to the user story this task supports: US-XXX -->
24
+
25
+ ## Acceptance Criteria
26
+
27
+ - [ ] Criterion 1
28
+ - [ ] Criterion 2
29
+ - [ ] Criterion 3
30
+
31
+ ## Implementation Detail
32
+
33
+ ### Approach
34
+
35
+ <!-- How to implement this task -->
36
+
37
+ ### Components to Create/Modify
38
+
39
+ | Component | Action | Description |
40
+ |-----------|--------|-------------|
41
+ | | | |
42
+
43
+ ### Illustrative Code
44
+
45
+ ```typescript
46
+ // Example interface or pseudo-code
47
+ interface Example {
48
+ id: string;
49
+ // ...
50
+ }
51
+ ```
52
+
53
+ ### API Changes
54
+
55
+ | Endpoint | Method | Description |
56
+ |----------|--------|-------------|
57
+ | | | |
58
+
59
+ ## Testing Criteria
60
+
61
+ ### Unit Tests
62
+
63
+ - Test case 1
64
+ - Test case 2
65
+
66
+ ### Integration Tests
67
+
68
+ - Integration scenario 1
69
+
70
+ ### Manual Tests
71
+
72
+ - Manual verification step 1
73
+
74
+ ## Edge Cases
75
+
76
+ - Edge case 1 and how it is handled
77
+ - Edge case 2 and how it is handled
78
+
79
+ ## Notes
80
+
81
+ <!-- Additional context, concerns, or decisions -->
82
+
83
+ ## Changelog
84
+
85
+ | Date | Change | By |
86
+ |------|--------|-----|
87
+ | | | |