@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,200 @@
1
+ ---
2
+ name: forge-implement
3
+ description: Feature Dev sub-phase 5 - Build the feature
4
+ mode: subagent
5
+ permission:
6
+ skill:
7
+ "forge-*": allow
8
+ "documents-*": allow
9
+ "code-*": allow
10
+ "*": deny
11
+ tools:
12
+ read: true
13
+ write: true
14
+ edit: true
15
+ bash: true
16
+ glob: true
17
+ grep: true
18
+ websearch: true
19
+ webfetch: true
20
+ ---
21
+
22
+ # Feature Dev: 5. Implement
23
+
24
+ Build the feature following the validated approach.
25
+
26
+ ## Load Skills
27
+
28
+ Use these skills:
29
+ - `@forge-context-loader` - Load context for implementation
30
+ - `@forge-quality-checker` - For quality gate checks
31
+
32
+ ## Implementation Principles
33
+
34
+ ### Core Principles
35
+
36
+ 1. **Step by Step** - Implement incrementally, don't skip steps
37
+ 2. **SOLID Principles** - Apply throughout
38
+ 3. **DRY Code** - Don't repeat yourself
39
+ 4. **Clear Naming** - Variables, functions, files should be self-explanatory
40
+ 5. **Error Handling** - Appropriate for context
41
+
42
+ ### Code Standards
43
+
44
+ - Linting must pass (run `npm run lint` or equivalent)
45
+ - Type checking must pass (run `npm run typecheck` or equivalent)
46
+ - Follow existing patterns in codebase
47
+ - Add inline comments for non-obvious logic
48
+
49
+ ## Implementation Order
50
+
51
+ Follow the approach plan. Typical order:
52
+
53
+ ### 1. Foundation
54
+ - Type definitions / interfaces
55
+ - Configuration / constants
56
+ - Base classes / utilities
57
+
58
+ ### 2. Core Domain/Business Logic
59
+ - Domain models
60
+ - Business rules
61
+ - Validation
62
+
63
+ ### 3. Data Layer (if applicable)
64
+ - Database schema changes
65
+ - Repository patterns
66
+ - Data access objects
67
+
68
+ ### 4. API Layer (if applicable)
69
+ - Route handlers
70
+ - Request/response DTOs
71
+ - API documentation
72
+
73
+ ### 5. Integration Points
74
+ - External service clients
75
+ - Event handlers
76
+ - Middleware
77
+
78
+ ### 6. Tests
79
+ - Unit tests
80
+ - Integration tests
81
+
82
+ ## Implementation Checklist
83
+
84
+ - [ ] Types/interfaces defined
85
+ - [ ] Core logic implemented
86
+ - [ ] Error handling added
87
+ - [ ] Input validation added
88
+ - [ ] Tests written
89
+ - [ ] Lint passes
90
+ - [ ] Type check passes
91
+
92
+ ## File Naming Conventions
93
+
94
+ Detect language from project and follow appropriate conventions:
95
+
96
+ | Type | Python | TypeScript | Go |
97
+ |------|--------|------------|-----|
98
+ | Components/Modules | `snake_case.py` | `PascalCase.tsx` | `snake_case.go` |
99
+ | Utilities | `snake_case.py` | `camelCase.ts` | `snake_case.go` |
100
+ | Constants | `UPPER_SNAKE.py` | `UPPER_SNAKE.ts` | `UpperSnake.go` |
101
+ | Types | `snake_case.py` | `PascalCase.ts` | - |
102
+ | Tests | `test_*.py` | `*.test.ts` | `*_test.go` |
103
+
104
+ ## Error Handling Pattern
105
+
106
+ Follow language-specific patterns:
107
+
108
+ ### Python
109
+ ```python
110
+ try:
111
+ result = perform_operation()
112
+ return result
113
+ except KnownError as e:
114
+ raise UserFriendlyError('Message', cause=e)
115
+ except Exception:
116
+ logger.error('Unexpected error', extra={'context': context})
117
+ raise
118
+ ```
119
+
120
+ ### TypeScript
121
+ ```typescript
122
+ try {
123
+ const result = await performOperation();
124
+ return result;
125
+ } catch (error) {
126
+ if (error instanceof KnownError) {
127
+ throw new UserFriendlyError('Message', { cause: error });
128
+ }
129
+ logger.error('Unexpected error', { error, context });
130
+ throw error;
131
+ }
132
+ ```
133
+
134
+ ### Go
135
+ ```go
136
+ result, err := performOperation()
137
+ if err != nil {
138
+ if errors.Is(err, knownError) {
139
+ return nil, fmt.Errorf("user friendly: %w", err)
140
+ }
141
+ logger.Error("Unexpected error", "context", context)
142
+ return nil, err
143
+ }
144
+ return result, nil
145
+ ```
146
+
147
+ ## Output
148
+
149
+ ### Update Task Document
150
+
151
+ Add "Implementation" section:
152
+
153
+ ```markdown
154
+ ## Implementation
155
+
156
+ ### Changes Made
157
+ | File | Change | Lines |
158
+ |------|--------|-------|
159
+ | src/auth.ts | Created | +120 |
160
+ | src/auth.test.ts | Created | +85 |
161
+
162
+ ### Implementation Notes
163
+ - [Any notes about the implementation]
164
+
165
+ ### Decisions Made During Implementation
166
+ - [If different from approach, document why]
167
+ ```
168
+
169
+ ### Update Frontmatter
170
+
171
+ ```yaml
172
+ status: in-progress:implement
173
+ ```
174
+
175
+ ### Track Progress
176
+
177
+ Keep track of what's been implemented vs what's left:
178
+ ```markdown
179
+ ### Progress
180
+ - [x] Types defined
181
+ - [x] Core logic
182
+ - [ ] API endpoints
183
+ - [ ] Tests
184
+ ```
185
+
186
+ ## Next Steps
187
+
188
+ Proceed to `@forge-review` when:
189
+ - Implementation is complete
190
+ - All approach steps followed
191
+ - Basic self-checks pass (lint, type check)
192
+
193
+ ## Rework Handling
194
+
195
+ If `@forge-review` finds issues:
196
+ 1. Fix the issues in this phase
197
+ 2. Re-run quality checks
198
+ 3. Proceed back to review
199
+
200
+ Use `@forge-quality-checker` to run automated checks.
@@ -0,0 +1,205 @@
1
+ ---
2
+ name: forge-review
3
+ description: Feature Dev sub-phase 6 - Automated checks and AI code review
4
+ mode: subagent
5
+ permission:
6
+ skill:
7
+ "forge-*": allow
8
+ "documents-*": allow
9
+ "code-*": allow
10
+ "*": deny
11
+ tools:
12
+ read: true
13
+ write: true
14
+ edit: true
15
+ bash: true
16
+ glob: true
17
+ grep: true
18
+ ---
19
+
20
+ # Feature Dev: 6. Review
21
+
22
+ Quality review using automated checks followed by AI code review.
23
+
24
+ ## Load Skills
25
+
26
+ Use these skills:
27
+ - `@forge-quality-checker` - Run automated quality gates
28
+ - `@forge-state-manager` - Update task status
29
+
30
+ ## Review Sequence
31
+
32
+ Run in this order:
33
+
34
+ ```
35
+ 1. Automated Checks (fast failures)
36
+ ├── Lint Check
37
+ ├── Type Check
38
+ └── Security Audit
39
+
40
+ 2. Tests
41
+ ├── Unit Tests
42
+ └── Integration Tests
43
+
44
+ 3. Coverage Check
45
+
46
+ 4. AI Code Review (if automated checks pass)
47
+ ```
48
+
49
+ ## Automated Checks
50
+
51
+ ### Run Quality Gates
52
+
53
+ Use `@forge-quality-checker` skill. Run these commands:
54
+
55
+ ```bash
56
+ # 1. Linting
57
+ npm run lint
58
+
59
+ # 2. Type Checking
60
+ npm run typecheck
61
+
62
+ # 3. Security Audit
63
+ npm audit
64
+ ```
65
+
66
+ ### Required Thresholds
67
+
68
+ From `.forge/config.yaml`:
69
+ ```yaml
70
+ quality:
71
+ test_coverage_minimum: 80
72
+ lint_must_pass: true
73
+ type_check_must_pass: true
74
+ security_audit_must_pass: true
75
+ ```
76
+
77
+ ## AI Code Review
78
+
79
+ After automated checks pass, review for:
80
+
81
+ ### SOLID Principles
82
+
83
+ | Principle | What to Check |
84
+ |-----------|---------------|
85
+ | **S**ingle Responsibility | Does each module have one responsibility? |
86
+ | **O**pen/Closed | Can features be added without modifying existing code? |
87
+ | **L**iskov Substitution | Can subtypes replace base types safely? |
88
+ | **I**nterface Segregation | Are interfaces small and focused? |
89
+ | **D**ependency Inversion | Do modules depend on abstractions? |
90
+
91
+ ### Design Patterns
92
+
93
+ Check for appropriate use of:
94
+ - Factory, Builder, Singleton
95
+ - Repository, Unit of Work
96
+ - Observer, Strategy
97
+ - Dependency Injection
98
+
99
+ ### Error Handling
100
+
101
+ - Are errors caught and handled appropriately?
102
+ - Are exceptions used for exceptional cases only?
103
+ - Is error context preserved for debugging?
104
+
105
+ ### Security
106
+
107
+ - Input validation on all user inputs?
108
+ - Authentication/authorization enforced?
109
+ - Secrets not logged or exposed?
110
+ - SQL injection, XSS, CSRF addressed?
111
+
112
+ ### Performance
113
+
114
+ - Obvious bottlenecks?
115
+ - Unnecessary computations?
116
+ - Missing caching opportunities?
117
+
118
+ ### Maintainability
119
+
120
+ - Would another developer understand this?
121
+ - Is the code self-documenting?
122
+ - Are there appropriate tests?
123
+
124
+ ## Review Output
125
+
126
+ ### Create Review Report
127
+
128
+ ```markdown
129
+ ## Review Report
130
+
131
+ ### Automated Checks
132
+
133
+ | Check | Status | Details |
134
+ |-------|--------|---------|
135
+ | Lint | PASS | No issues |
136
+ | Type Check | PASS | No errors |
137
+ | Security | PASS | 0 vulnerabilities |
138
+ | Tests | PASS | 42/42 passed |
139
+ | Coverage | PASS | 87% |
140
+
141
+ ### AI Code Review
142
+
143
+ #### SOLID Compliance
144
+ | Principle | Status | Notes |
145
+ |-----------|--------|-------|
146
+ | SRP | ✓ | Good separation |
147
+ | OCP | ✓ | Extensible design |
148
+ | LSP | ✓ | Proper inheritance |
149
+ | ISP | ⚠ | Interface X is large |
150
+ | DIP | ✓ | Good abstraction |
151
+
152
+ #### Design Patterns
153
+ - [Patterns identified]
154
+
155
+ #### Issues Found
156
+
157
+ | Severity | Issue | Location | Recommendation |
158
+ |----------|-------|----------|-----------------|
159
+ | High | Missing validation | auth.ts:45 | Add input validation |
160
+ | Medium | Deep nesting | process.ts:78 | Extract function |
161
+
162
+ #### Summary
163
+ - **Critical Issues:** 0
164
+ - **High Issues:** 1
165
+ - **Medium Issues:** 2
166
+ - **Low Issues:** 1
167
+
168
+ **Verdict:** APPROVED / REWORK REQUIRED
169
+ ```
170
+
171
+ ## Rework Decision
172
+
173
+ | Verdict | Action |
174
+ |---------|--------|
175
+ | APPROVED | Proceed to `@forge-validate` |
176
+ | REWORK (Minor) | Loop to `@forge-implement` |
177
+ | REWORK (Approach) | Loop to `@forge-approach` |
178
+
179
+ ### Minor Issues (Loop to Implement)
180
+ - Code fixes
181
+ - Missing assertions in tests
182
+ - Lint/type errors
183
+ - Coverage gaps
184
+
185
+ ### Approach Issues (Loop to Approach)
186
+ - Design was fundamentally flawed
187
+ - Wrong pattern chosen
188
+ - Architecture needs rethinking
189
+
190
+ ## Update State
191
+
192
+ ### Update Task Document
193
+
194
+ ```yaml
195
+ status: in-progress:review
196
+ ```
197
+
198
+ Add review findings to task document.
199
+
200
+ ## Next Steps
201
+
202
+ Proceed to `@forge-validate` when:
203
+ - All automated checks pass
204
+ - No critical or high issues
205
+ - Minor issues are acceptable (user decision)
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: forge-summarise
3
+ description: Feature Dev sub-phase 8 - Document accomplishments
4
+ mode: subagent
5
+ permission:
6
+ skill:
7
+ "forge-*": allow
8
+ "documents-*": allow
9
+ "*": deny
10
+ tools:
11
+ read: true
12
+ write: true
13
+ edit: true
14
+ ---
15
+
16
+ # Feature Dev: 8. Summarise
17
+
18
+ Document what was accomplished and complete the feature development lifecycle.
19
+
20
+ ## Load Skills
21
+
22
+ Use these skills:
23
+ - `@forge-state-manager` - Update task and project state
24
+
25
+ ## Summary Content
26
+
27
+ ### 1. Review Task Document
28
+
29
+ Read the complete task document to understand:
30
+ - What was planned
31
+ - What was implemented
32
+ - Any deviations from the plan
33
+
34
+ ### 2. Document Changes Made
35
+
36
+ Create a summary of all changes:
37
+
38
+ ```markdown
39
+ ## Summary
40
+
41
+ ### What Was Built
42
+
43
+ Brief description of the feature and its purpose.
44
+
45
+ ### Changes Made
46
+
47
+ | File | Action | Lines | Description |
48
+ |------|--------|-------|-------------|
49
+ | src/auth.ts | Created | +120 | Authentication module |
50
+ | src/auth.test.ts | Created | +85 | Unit tests |
51
+ | src/middleware/auth.ts | Modified | +30 | Added auth middleware |
52
+
53
+ ### Decisions Made During Implementation
54
+
55
+ | Decision | Original Plan | Actual | Reason for Change |
56
+ |----------|--------------|--------|-------------------|
57
+ | Token format | JWT | PASETO | Better security properties |
58
+
59
+ ### Test Coverage
60
+
61
+ | Metric | Value |
62
+ |--------|-------|
63
+ | Lines Covered | 85% |
64
+ | Branches Covered | 78% |
65
+ | Functions Covered | 100% |
66
+
67
+ ### Quality Gates
68
+
69
+ | Gate | Status |
70
+ |------|--------|
71
+ | Lint | ✓ Pass |
72
+ | Type Check | ✓ Pass |
73
+ | Security Audit | ✓ Pass |
74
+ | Tests | ✓ Pass (42/42) |
75
+ | Coverage | ✓ Pass (85% >= 80%) |
76
+
77
+ ### Known Limitations
78
+
79
+ - [Any intentionally deferred items]
80
+ - [Known issues not fixed]
81
+ - [Technical debt introduced]
82
+
83
+ ### Next Steps
84
+
85
+ 1. Manual testing by QA
86
+ 2. Deploy to staging
87
+ 3. User acceptance testing
88
+ 4. Documentation updates
89
+ ```
90
+
91
+ ## Final Task Document Update
92
+
93
+ ### Update Frontmatter
94
+
95
+ ```yaml
96
+ ---
97
+ title: [Task Title]
98
+ status: complete
99
+ mode: brownfield # or greenfield
100
+ completed: 2026-03-22T18:00:00Z
101
+ ---
102
+ ```
103
+
104
+ ### Add Summary Section
105
+
106
+ Append completed summary to the task document body.
107
+
108
+ ## State Updates
109
+
110
+ ### Update Feature State
111
+
112
+ In `.forge/state.yaml`:
113
+
114
+ ```yaml
115
+ features:
116
+ feature-slug:
117
+ phase: 3
118
+ status: complete
119
+ completed: 2026-03-22T18:00:00Z
120
+ sub_phase_history:
121
+ - sub_phase: 1_discover
122
+ status: complete
123
+ - sub_phase: 2_explore
124
+ status: complete
125
+ - sub_phase: 3_clarify
126
+ status: complete
127
+ - sub_phase: 4_approach
128
+ status: complete
129
+ - sub_phase: 5_implement
130
+ status: complete
131
+ - sub_phase: 6_review
132
+ status: complete
133
+ - sub_phase: 7_validate
134
+ status: complete
135
+ - sub_phase: 8_summarise
136
+ status: complete
137
+ ```
138
+
139
+ ## Lifecycle Complete
140
+
141
+ Feature Development Lifecycle is complete when:
142
+ - ✓ All 8 sub-phases completed
143
+ - ✓ Task document updated with summary
144
+ - ✓ State file updated
145
+ - ✓ Quality gates passed
146
+
147
+ ## Next Actions
148
+
149
+ After lifecycle completion:
150
+
151
+ 1. **Run full test suite** - Ensure nothing was broken
152
+ 2. **Manual testing** - Verify feature works as expected
153
+ 3. **Code review** - Peer review by team member
154
+ 4. **Documentation** - Update API docs, README if needed
155
+ 5. **Next feature** - Start next task or propose Phase 4 (Testing)
156
+
157
+ ## Propose Phase Transition
158
+
159
+ After completing features:
160
+
161
+ ```
162
+ Feature Development complete.
163
+
164
+ Completed features:
165
+ - implement-user-auth ✓
166
+ - session-management ✓
167
+
168
+ Ready to proceed to:
169
+ - Next feature: [task-name]
170
+ - Phase 4: Testing (forge 4:test)
171
+
172
+ What would you like to do?
173
+ ```
174
+
175
+ ## Output
176
+
177
+ ### Confirm Completion
178
+
179
+ ```
180
+ ✓ Feature Development Lifecycle Complete
181
+
182
+ Task: [Task Title]
183
+ Duration: [Time spent]
184
+ Status: Complete
185
+
186
+ Next: Choose next action
187
+ ```