devforgeai 1.0.7 → 1.0.9
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/docs/CNAME +1 -0
- package/docs/NPM-Publish.md +341 -0
- package/docs/api/API.md +1054 -0
- package/docs/architecture/ARCHITECTURE.md +724 -0
- package/docs/guides/DEVELOPER-GUIDE.md +398 -0
- package/docs/guides/ROADMAP.md +48 -0
- package/docs/guides/TROUBLESHOOTING.md +631 -0
- package/docs/index.html +2045 -0
- package/package.json +2 -2
- package/src/cli/commands/install.js +7 -2
- package/src/cli/lib/components.js +5 -9
- package/src/cli/lib/ide/claude-code.js +24 -9
- package/src/cli/lib/settings-merger.js +160 -0
- package/devforgeai/specs/context/.gitkeep +0 -0
- package/devforgeai/specs/context/anti-patterns.md +0 -285
- package/devforgeai/specs/context/architecture-constraints.md +0 -323
- package/devforgeai/specs/context/coding-standards.md +0 -472
- package/devforgeai/specs/context/dependencies.md +0 -208
- package/devforgeai/specs/context/source-tree.md +0 -1217
- package/devforgeai/specs/context/tech-stack.md +0 -560
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
# Architecture Constraints - DevForgeAI Framework
|
|
2
|
-
|
|
3
|
-
**Status**: LOCKED
|
|
4
|
-
**Last Updated**: 2025-10-30
|
|
5
|
-
**Version**: 1.0
|
|
6
|
-
|
|
7
|
-
## Framework Architecture Patterns
|
|
8
|
-
|
|
9
|
-
### Three-Layer Architecture (LOCKED)
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
Layer 1: Skills (Framework Implementation)
|
|
13
|
-
↓ invokes
|
|
14
|
-
Layer 2: Subagents (Parallel Execution)
|
|
15
|
-
↓ uses
|
|
16
|
-
Layer 3: Slash Commands (User Workflows)
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Dependency Rules**:
|
|
20
|
-
- ✅ Commands can invoke Skills
|
|
21
|
-
- ✅ Commands can invoke Subagents via Task tool
|
|
22
|
-
- ✅ Skills can invoke other Skills
|
|
23
|
-
- ✅ Skills can invoke Subagents via Task tool
|
|
24
|
-
- ❌ Skills CANNOT invoke Commands
|
|
25
|
-
- ❌ Subagents CANNOT invoke Skills or Commands
|
|
26
|
-
- ❌ Circular dependencies forbidden (Skill A → Skill B → Skill A)
|
|
27
|
-
|
|
28
|
-
### Skill Design Constraints (LOCKED)
|
|
29
|
-
|
|
30
|
-
**Single Responsibility Principle**:
|
|
31
|
-
- Each skill handles ONE phase of development lifecycle
|
|
32
|
-
- ✅ implementing-stories: TDD implementation only (ADR-017 naming)
|
|
33
|
-
- ✅ validating-quality: Quality validation only (ADR-017 naming)
|
|
34
|
-
- ✅ designing-systems: Architecture and context file creation only (ADR-017 naming)
|
|
35
|
-
- ✅ discovering-requirements: Requirements discovery and elicitation only (ADR-017 naming)
|
|
36
|
-
- ❌ implementing-and-validating: Multiple responsibilities
|
|
37
|
-
|
|
38
|
-
**Context Isolation**:
|
|
39
|
-
- Each skill invocation has separate context window
|
|
40
|
-
- Skills MUST NOT assume state from previous invocations
|
|
41
|
-
- Skills MUST read context files explicitly
|
|
42
|
-
|
|
43
|
-
**Progressive Disclosure**:
|
|
44
|
-
- Main SKILL.md: Core instructions (<1000 lines)
|
|
45
|
-
- references/: Deep documentation (loaded on demand)
|
|
46
|
-
- MUST use "see references/[file].md" pattern
|
|
47
|
-
|
|
48
|
-
### Subagent Design Constraints (LOCKED)
|
|
49
|
-
|
|
50
|
-
**Domain Specialization**:
|
|
51
|
-
- Each subagent specialized in single domain
|
|
52
|
-
- ✅ test-automator: Test generation only
|
|
53
|
-
- ✅ backend-architect: Backend implementation only
|
|
54
|
-
- ❌ full-stack-developer: Too broad
|
|
55
|
-
|
|
56
|
-
**Tool Restrictions**:
|
|
57
|
-
- Principle of least privilege
|
|
58
|
-
- Only grant tools needed for subagent's domain
|
|
59
|
-
- Example: test-automator gets Read, Write, Edit, Bash (for running tests)
|
|
60
|
-
- Example: code-reviewer gets Read, Grep, Glob only (read-only)
|
|
61
|
-
|
|
62
|
-
**Parallel Execution Support**:
|
|
63
|
-
- Subagents MUST be designed for parallel invocation
|
|
64
|
-
- No shared state between subagents
|
|
65
|
-
- No dependencies between parallel subagents
|
|
66
|
-
|
|
67
|
-
### Command Design Constraints (LOCKED)
|
|
68
|
-
|
|
69
|
-
**User-Facing Workflows**:
|
|
70
|
-
- Commands orchestrate skills and subagents
|
|
71
|
-
- Commands provide user-friendly parameters
|
|
72
|
-
- Commands handle user ambiguity via AskUserQuestion
|
|
73
|
-
|
|
74
|
-
**Size Constraints**:
|
|
75
|
-
- Keep under 500 lines (<20K characters)
|
|
76
|
-
- If exceeding 500 lines → extract to skill
|
|
77
|
-
|
|
78
|
-
**Parameter Handling**:
|
|
79
|
-
- Use $ARGUMENTS for user input
|
|
80
|
-
- Provide argument-hint in frontmatter
|
|
81
|
-
- Validate parameters before processing
|
|
82
|
-
|
|
83
|
-
### Context File Enforcement (LOCKED)
|
|
84
|
-
|
|
85
|
-
**Immutability Principle**:
|
|
86
|
-
- Context files are THE LAW
|
|
87
|
-
- Development skill MUST read ALL 6 context files
|
|
88
|
-
- AI agents MUST follow constraints or HALT
|
|
89
|
-
|
|
90
|
-
**Validation Pattern**:
|
|
91
|
-
```markdown
|
|
92
|
-
## Phase 1: Context Validation
|
|
93
|
-
Read context files in PARALLEL:
|
|
94
|
-
- Read(file_path="devforgeai/context/tech-stack.md")
|
|
95
|
-
- Read(file_path="devforgeai/context/source-tree.md")
|
|
96
|
-
- Read(file_path="devforgeai/context/dependencies.md")
|
|
97
|
-
- Read(file_path="devforgeai/context/coding-standards.md")
|
|
98
|
-
- Read(file_path="devforgeai/context/architecture-constraints.md")
|
|
99
|
-
- Read(file_path="devforgeai/context/anti-patterns.md")
|
|
100
|
-
|
|
101
|
-
HALT if ANY file missing: "Context incomplete. Run /create-context"
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Quality Gate Pattern (LOCKED)
|
|
105
|
-
|
|
106
|
-
**Gate Enforcement**:
|
|
107
|
-
- Quality gates MUST block progression on violations
|
|
108
|
-
- Gates validated in sequence (no skipping)
|
|
109
|
-
- HALT pattern for gate failures
|
|
110
|
-
|
|
111
|
-
**Example**:
|
|
112
|
-
```markdown
|
|
113
|
-
HALT if tests fail: "Tests must pass before proceeding"
|
|
114
|
-
HALT if coverage < threshold: "Coverage below 95%/85%/80%"
|
|
115
|
-
HALT if CRITICAL violations: "Fix critical issues before release"
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Error Handling Pattern (LOCKED)
|
|
119
|
-
|
|
120
|
-
**AskUserQuestion for Ambiguity**:
|
|
121
|
-
```markdown
|
|
122
|
-
IF ambiguity detected:
|
|
123
|
-
Use AskUserQuestion with specific options
|
|
124
|
-
Document decision in context file or ADR
|
|
125
|
-
Proceed with chosen option
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**HALT for Constraint Violations**:
|
|
129
|
-
```markdown
|
|
130
|
-
IF constraint violated:
|
|
131
|
-
HALT with clear error message
|
|
132
|
-
Provide resolution steps
|
|
133
|
-
Request user confirmation before retry
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Token Efficiency Pattern (LOCKED)
|
|
137
|
-
|
|
138
|
-
**Parallel Tool Invocation**:
|
|
139
|
-
```markdown
|
|
140
|
-
✅ CORRECT: Parallel reads
|
|
141
|
-
Read(file_path="file1.md")
|
|
142
|
-
Read(file_path="file2.md")
|
|
143
|
-
Read(file_path="file3.md")
|
|
144
|
-
|
|
145
|
-
❌ WRONG: Sequential narrative
|
|
146
|
-
First read file1, then read file2, then read file3...
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**Native Tools Over Bash**:
|
|
150
|
-
- 40-73% token savings documented
|
|
151
|
-
- MUST use Read/Write/Edit/Glob/Grep instead of Bash equivalents
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
### Parallel Execution Rules (LOCKED)
|
|
156
|
-
|
|
157
|
-
**Three Parallel Patterns Available:**
|
|
158
|
-
|
|
159
|
-
| Pattern | Use Case | Max Concurrent | Time Savings |
|
|
160
|
-
|---------|----------|----------------|--------------|
|
|
161
|
-
| Parallel Subagents | Multiple Task() calls | 4-6 (10 max) | 30-40% |
|
|
162
|
-
| Background Tasks | Long-running Bash | 3-4 | 50-80% |
|
|
163
|
-
| Parallel Tools | Multiple Read/Grep | Automatic | 15-25% |
|
|
164
|
-
|
|
165
|
-
**Task Count Limits (LOCKED):**
|
|
166
|
-
- **Recommended**: 4-6 parallel subagents per batch
|
|
167
|
-
- **Maximum**: 10 concurrent tasks (framework limit)
|
|
168
|
-
- **Beyond 10**: Implement explicit batching with synchronization points
|
|
169
|
-
|
|
170
|
-
**Dependency Rules (LOCKED):**
|
|
171
|
-
- ✅ Parallel tasks MUST be independent (no cross-task dependencies)
|
|
172
|
-
- ✅ If task B uses output of task A: execute sequentially
|
|
173
|
-
- ✅ Synchronization points required between dependent batches
|
|
174
|
-
- ❌ Never parallelize dependent operations
|
|
175
|
-
|
|
176
|
-
**Background Task Rules:**
|
|
177
|
-
- Timeout required for all background tasks (60-600 seconds)
|
|
178
|
-
- Results MUST be retrieved before next phase
|
|
179
|
-
- Cleanup on error or deferral
|
|
180
|
-
|
|
181
|
-
**Failure Recovery (LOCKED):**
|
|
182
|
-
- Primary: Attempt parallel execution
|
|
183
|
-
- Fallback: Silently retry as sequential if parallel fails
|
|
184
|
-
- Threshold: Continue if >= 50% success rate (configurable)
|
|
185
|
-
|
|
186
|
-
**Reference:** See `docs/guides/parallel-orchestration-guide.md` for full patterns
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Installer Architecture Patterns (EPIC-012, EPIC-013, EPIC-014)
|
|
191
|
-
|
|
192
|
-
### Installation State Machine (LOCKED)
|
|
193
|
-
|
|
194
|
-
**States**:
|
|
195
|
-
```
|
|
196
|
-
┌─────────────┐
|
|
197
|
-
│ Fresh │ ← No previous installation detected
|
|
198
|
-
└──────┬──────┘
|
|
199
|
-
│ detect existing
|
|
200
|
-
▼
|
|
201
|
-
┌─────────────┐
|
|
202
|
-
│ Upgrade │ ← Previous version detected, upgrade path valid
|
|
203
|
-
└──────┬──────┘
|
|
204
|
-
│ upgrade fails
|
|
205
|
-
▼
|
|
206
|
-
┌─────────────┐
|
|
207
|
-
│ Rollback │ ← Restore previous version from backup
|
|
208
|
-
└──────┬──────┘
|
|
209
|
-
│ success
|
|
210
|
-
▼
|
|
211
|
-
┌─────────────┐
|
|
212
|
-
│ Validated │ ← Installation verified complete
|
|
213
|
-
└─────────────┘
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
**State Transitions**:
|
|
217
|
-
- ✅ Fresh → Validated (successful fresh install)
|
|
218
|
-
- ✅ Upgrade → Validated (successful upgrade)
|
|
219
|
-
- ✅ Upgrade → Rollback → Validated (failed upgrade, rollback succeeded)
|
|
220
|
-
- ✅ Fix → Validated (repair completed)
|
|
221
|
-
- ❌ Validated → Fresh (no overwriting valid installation without user consent)
|
|
222
|
-
- ❌ Rollback → Rollback (no recursive rollback)
|
|
223
|
-
|
|
224
|
-
### Validation Pipeline Pattern (LOCKED)
|
|
225
|
-
|
|
226
|
-
**Chain of Responsibility** for pre-flight checks:
|
|
227
|
-
|
|
228
|
-
```
|
|
229
|
-
PreFlightValidation
|
|
230
|
-
├── PythonVersionCheck → WARN if Python < 3.10
|
|
231
|
-
├── DiskSpaceCheck → ERROR if < 100MB available
|
|
232
|
-
├── PermissionCheck → ERROR if target not writable
|
|
233
|
-
├── ExistingInstallCheck → INFO prompts for upgrade/fresh choice
|
|
234
|
-
├── GitStatusCheck → WARN if uncommitted changes (optional)
|
|
235
|
-
└── ConflictCheck → WARN lists files that would be overwritten
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
**Rules**:
|
|
239
|
-
- ✅ Checks run in sequence (each check passes before next)
|
|
240
|
-
- ✅ ERROR checks block installation (must fix before proceeding)
|
|
241
|
-
- ✅ WARN checks allow continuation with --force flag
|
|
242
|
-
- ✅ INFO checks are informational only (don't block)
|
|
243
|
-
- ❌ No skipping ERROR checks (even with --force)
|
|
244
|
-
- ❌ No partial validation (all checks must run)
|
|
245
|
-
|
|
246
|
-
### Atomic Installation Pattern (LOCKED)
|
|
247
|
-
|
|
248
|
-
**All-or-Nothing Principle**:
|
|
249
|
-
|
|
250
|
-
```
|
|
251
|
-
1. Create backup of existing files (if any)
|
|
252
|
-
2. Create transaction log
|
|
253
|
-
3. Execute installation steps
|
|
254
|
-
- If any step fails → Rollback to backup
|
|
255
|
-
- If all steps succeed → Commit (delete backup marker)
|
|
256
|
-
4. Validate installation
|
|
257
|
-
- If validation fails → Rollback
|
|
258
|
-
5. Update version metadata
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
**Rules**:
|
|
262
|
-
- ✅ Backup MUST be created before ANY modifications
|
|
263
|
-
- ✅ Transaction log tracks all file operations
|
|
264
|
-
- ✅ Rollback restores EXACTLY to pre-installation state
|
|
265
|
-
- ✅ No partial installations allowed
|
|
266
|
-
- ❌ No modifications without backup
|
|
267
|
-
- ❌ No deleting backup until validation passes
|
|
268
|
-
|
|
269
|
-
### CLAUDE.md Merge Strategy (LOCKED)
|
|
270
|
-
|
|
271
|
-
**4 Merge Strategies**:
|
|
272
|
-
|
|
273
|
-
```
|
|
274
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
275
|
-
│ AUTO-MERGE (default) │
|
|
276
|
-
│ - Parse user sections vs DevForgeAI sections │
|
|
277
|
-
│ - Preserve user content, update DevForgeAI content │
|
|
278
|
-
│ - Merge result = User + Updated Framework │
|
|
279
|
-
├─────────────────────────────────────────────────────────────┤
|
|
280
|
-
│ REPLACE │
|
|
281
|
-
│ - Backup existing CLAUDE.md │
|
|
282
|
-
│ - Overwrite with DevForgeAI template │
|
|
283
|
-
│ - User must manually re-add custom content │
|
|
284
|
-
├─────────────────────────────────────────────────────────────┤
|
|
285
|
-
│ SKIP │
|
|
286
|
-
│ - Don't modify CLAUDE.md │
|
|
287
|
-
│ - User manually integrates DevForgeAI instructions │
|
|
288
|
-
├─────────────────────────────────────────────────────────────┤
|
|
289
|
-
│ MANUAL │
|
|
290
|
-
│ - Create CLAUDE.mddevforgeai (new content) │
|
|
291
|
-
│ - User merges manually with existing CLAUDE.md │
|
|
292
|
-
└─────────────────────────────────────────────────────────────┘
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
**Rules**:
|
|
296
|
-
- ✅ Always backup before merge (regardless of strategy)
|
|
297
|
-
- ✅ Auto-merge uses section markers to identify boundaries
|
|
298
|
-
- ✅ Conflict detection prompts user for resolution
|
|
299
|
-
- ✅ Merge result validated for syntax errors
|
|
300
|
-
- ❌ No silent overwrites (always inform user)
|
|
301
|
-
- ❌ No merge without user consent on conflict
|
|
302
|
-
|
|
303
|
-
### Version Compatibility Matrix (LOCKED)
|
|
304
|
-
|
|
305
|
-
**Upgrade Paths**:
|
|
306
|
-
|
|
307
|
-
| From Version | To Version | Allowed? | Migration Required? |
|
|
308
|
-
|--------------|------------|----------|---------------------|
|
|
309
|
-
| v1.x.x | v1.y.z (y>x) | ✅ Yes | Minor migration |
|
|
310
|
-
| v1.x.x | v2.0.0 | ⚠️ With warning | Major migration |
|
|
311
|
-
| v2.x.x | v1.x.x | ❌ No (downgrade) | N/A |
|
|
312
|
-
| None | Any | ✅ Yes (fresh) | None |
|
|
313
|
-
|
|
314
|
-
**Rules**:
|
|
315
|
-
- ✅ Minor version upgrades always allowed (1.0 → 1.1)
|
|
316
|
-
- ✅ Patch version upgrades always allowed (1.0.0 → 1.0.1)
|
|
317
|
-
- ⚠️ Major version upgrades require user confirmation (1.x → 2.x)
|
|
318
|
-
- ❌ Downgrades blocked by default (require --force)
|
|
319
|
-
- ❌ Skip-version upgrades require sequential migrations (1.0 → 1.1 → 1.2, not 1.0 → 1.2)
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
**REMEMBER**: Projects using DevForgeAI will have their own architecture-constraints.md defining layer boundaries, patterns, and design rules specific to their architecture (Clean Architecture, N-Tier, etc.).
|