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.
@@ -1,560 +0,0 @@
1
- # Technology Stack - DevForgeAI Framework
2
-
3
- **Status**: LOCKED
4
- **Last Updated**: 2026-01-31
5
- **Version**: 1.4 (Added: Treelint as approved AST-aware code search tool - STORY-350)
6
-
7
- ## CRITICAL RULE: Framework-Agnostic Design
8
-
9
- **LOCKED PRINCIPLE**: DevForgeAI is a **meta-framework** that works with ANY technology stack. This file documents the framework's own implementation constraints, NOT the constraints of projects using the framework.
10
-
11
- ---
12
-
13
- ## Framework Implementation Technologies
14
-
15
- ### Core Platform
16
-
17
- **Platform**: Claude Code Terminal
18
- - **Version**: 1.0+
19
- - **Constraint**: Framework MUST work within Claude Code Terminal capabilities
20
- - **Documentation**: https://docs.claude.com/en/docs/claude-code/
21
-
22
- **CRITICAL**: Framework components are implemented as:
23
- - **Skills** (`.claude/skills/[skill-name]/SKILL.md`) - Markdown with YAML frontmatter
24
- - **Subagents** (`.claude/agents/[agent-name].md`) - Markdown with YAML frontmatter
25
- - **Slash Commands** (`.claude/commands/[command-name].md`) - Markdown with YAML frontmatter
26
-
27
- ### Documentation Format
28
-
29
- **Primary Format**: Markdown
30
- - **ALL** skills, subagents, commands, context files, ADRs use Markdown
31
- - **YAML frontmatter** for metadata only
32
- - **JSON** only for structured data exchange (NOT documentation)
33
-
34
- **PROHIBITED**:
35
- ❌ HTML files for framework documentation
36
- ❌ JSON/YAML files for instructions (Markdown only)
37
- ❌ Language-specific code in framework docs (must be framework-agnostic)
38
-
39
- **Exception - Workflow Hook Scripts (EPIC-048):**
40
- ✅ `.claude/hooks/*.sh` - Shell scripts for workflow event hooks
41
- - **Rationale:** Hooks require executable logic for exit codes and workflow control
42
- - **Naming convention:** `post-{workflow}-{action}.sh` (e.g., `post-qa-debt-detection.sh`)
43
- - **Registration:** Must be registered in `devforgeai/config/hooks.yaml`
44
- - **Exit codes:** 0=proceed, 1=warn, 2=halt
45
-
46
- **Rationale**: Claude interprets natural language (Markdown) better than structured formats. Research shows 60-80% token savings with progressive disclosure in Markdown.
47
-
48
- ### Version Control
49
-
50
- **System**: Git
51
- - **Required**: All framework components version controlled
52
- - **Branching**: Feature branches for development
53
- - **Commits**: Conventional commit format
54
-
55
- ### Framework Validation Tools (EPIC-015)
56
-
57
- **Epic Coverage Validation System**:
58
- - **Language**: Bash scripting (Claude Code native)
59
- - **Parsing**: Grep patterns for YAML frontmatter and markdown headers
60
- - **Matching**: Exact `epic:` field matching via `grep "^epic: EPIC-XXX"`
61
- - **Data Model**: JSON files or Bash associative arrays
62
- - **Reporting**: Write tool for JSON/markdown generation
63
- - **CLI**: Slash command `/validate-epic-coverage` in `.claude/commands/`
64
-
65
- **Rationale** (ADR-005): Uses only Claude Code native tools (Grep, Read, Write, Bash) to achieve 95% coverage without external dependencies. Evidence: 60/63 stories (95%) have `epic:` field.
66
-
67
- **PROHIBITED for framework validation**:
68
- ❌ External Python libraries (RapidFuzz, PyYAML, mistune)
69
- ❌ npm packages for framework tooling
70
- ❌ Any dependencies requiring `pip install` or `npm install`
71
-
72
- ---
73
-
74
- ## Static Analysis Tools (Code Quality & Security)
75
-
76
- ### REMOVED: ast-grep (ADR-007)
77
-
78
- **Status**: ❌ REMOVED (2025-12-21)
79
- **Decision**: ADR-007 - Remove ast-grep and Evaluate Tree-sitter
80
-
81
- **Reason for Removal**: After comprehensive evaluation (EPIC-018, STORY-115-118), ast-grep was found to have fundamental limitations:
82
-
83
- 1. **Multi-line Pattern Matching Fails** - Patterns with comments/type annotations between statements don't match
84
- 2. **Cannot Count/Accumulate** - "Detect classes with >20 methods" impossible with pattern matching
85
- 3. **Whitespace Sensitivity** - Python indentation breaks pattern matching
86
- 4. **No Semantic Analysis** - Cannot detect duplicate code, unused variables, or cross-file issues
87
- 5. **C# AST Issues** - Access modifiers and catch blocks don't match expected patterns
88
-
89
- **Evidence**: 52/59 tests passing (88.1%) despite comprehensive remediation - 6 tests failed due to tool limitations, NOT implementation issues.
90
-
91
- **PROHIBITED**:
92
- ❌ ast-grep for static analysis (REMOVED)
93
- ❌ Pattern-based tools that cannot handle real-world code
94
- ❌ Tools without proper Python/C# AST support
95
-
96
- ---
97
-
98
- ## AST-Aware Code Search Tools
99
-
100
- This section documents AST-aware code analysis tools approved for DevForgeAI subagents. These tools provide semantic understanding of code structure beyond simple text matching.
101
-
102
- ---
103
-
104
- ### APPROVED: Treelint (ADR-013)
105
-
106
- **Status**: ✅ APPROVED
107
- **Decision**: ADR-013 - Treelint Integration for AST-Aware Code Search
108
- **Version**: v0.12.0+ (LOCKED)
109
-
110
- **Why v0.12.0+ Required** (minimum version rationale):
111
- - v0.12 introduces daemon mode support for improved performance
112
- - v0.12 stabilizes JSON output format for AI consumption
113
- - v0.12 adds full language support for Python, TypeScript, JavaScript, Rust, Markdown
114
- - Required minimum 0.12 for subagent integration via `--format json` flag
115
-
116
- **Purpose**: AST-aware code search for DevForgeAI subagents, replacing text-based Grep for semantic code navigation.
117
-
118
- **Installation**:
119
- ```bash
120
- # Via pip (recommended)
121
- pip install treelint>=0.12.0
122
-
123
- # Via cargo
124
- cargo install treelint
125
- ```
126
-
127
- **Subagent Usage Examples** (all require `--format json` for AI consumption):
128
- ```bash
129
- # Search for functions by name or type
130
- treelint search --type function --name "validate*" --format json
131
-
132
- # Generate ranked file importance map
133
- treelint map --ranked --format json
134
-
135
- # Analyze function call dependencies
136
- treelint deps --calls --format json
137
- ```
138
-
139
- **Language Support Table**:
140
-
141
- | Language | File Extensions | Status |
142
- |----------|-----------------|--------|
143
- | Python | `.py` | ✅ Supported |
144
- | TypeScript | `.ts`, `.tsx` | ✅ Supported |
145
- | JavaScript | `.js`, `.jsx` | ✅ Supported |
146
- | Rust | `.rs` | ✅ Supported |
147
- | Markdown | `.md` | ✅ Supported |
148
-
149
- **Fallback Behavior**:
150
- When Treelint is unavailable or file type is unsupported:
151
- - Use `Grep(pattern="...")` as fallback for text-based search
152
- - Grep provides text matching without AST awareness
153
- - Subagents SHOULD attempt Treelint first, fallback to Grep on error
154
-
155
- **Integration Pattern**:
156
- ```markdown
157
- # Subagent should use Bash for Treelint invocation
158
- Bash(command="treelint search --type function --format json")
159
-
160
- # Fallback if Treelint fails
161
- IF treelint command fails:
162
- Grep(pattern="def |function |class ", glob="**/*.py")
163
- ```
164
-
165
- **Reference**: [ADR-013](../adrs/ADR-013-treelint-integration.md)
166
-
167
- ---
168
-
169
- ## Project Technology Stack Pattern
170
-
171
- When creating context files for **projects using DevForgeAI**, the architecture skill MUST use AskUserQuestion to determine:
172
-
173
- ### Backend Technology Options
174
-
175
- Framework supports (but does not mandate) any of:
176
- - C# with .NET 6.0+
177
- - Python 3.9+ with FastAPI/Django/Flask
178
- - Node.js 18+ with Express/Nest.js
179
- - Java 11+ with Spring Boot
180
- - Go 1.20+ with Gin/Echo
181
- - Rust 1.70+ with Actix/Rocket
182
-
183
- **Pattern**: designing-systems skill asks user to select backend technology, then LOCKS it in project's tech-stack.md.
184
-
185
- ### Frontend Framework Options
186
-
187
- Framework supports (but does not mandate) any of:
188
- - React 18+ with TypeScript
189
- - Vue.js 3+ with TypeScript
190
- - Angular 15+
191
- - Svelte 4+
192
- - Solid.js
193
- - Next.js 14+ (React meta-framework)
194
-
195
- **Pattern**: designing-systems skill asks user to select frontend framework, then LOCKS it in project's tech-stack.md.
196
-
197
- ### Database Options
198
-
199
- Framework supports (but does not mandate) any of:
200
- - PostgreSQL 13+
201
- - MySQL 8+
202
- - Microsoft SQL Server 2019+
203
- - MongoDB 6+
204
- - SQLite 3+
205
- - Oracle Database 19c+
206
-
207
- **Pattern**: designing-systems skill asks user to select database, then LOCKS it in project's tech-stack.md.
208
-
209
- ### Testing Framework Options
210
-
211
- Framework supports (but does not mandate) any of:
212
-
213
- **For .NET**:
214
- - xUnit
215
- - NUnit
216
- - MSTest
217
-
218
- **For Node.js/TypeScript**:
219
- - Jest
220
- - Vitest
221
- - Mocha + Chai
222
-
223
- **For Python**:
224
- - pytest
225
- - unittest
226
- - nose2
227
-
228
- **For Java**:
229
- - JUnit 5
230
- - TestNG
231
-
232
- **For Go**:
233
- - testing (standard library)
234
- - Testify
235
-
236
- **Pattern**: designing-systems skill asks user to select testing framework for their language, then LOCKS it in project's tech-stack.md.
237
-
238
- ---
239
-
240
- ## Framework Constraint Enforcement
241
-
242
- ### LOCKED: Claude Code Terminal Tools
243
-
244
- Framework skills and subagents MUST use Claude Code native tools:
245
-
246
- **File Operations**:
247
- - ✅ `Read(file_path="...")` - Reading files
248
- - ✅ `Write(file_path="...")` - Creating files
249
- - ✅ `Edit(file_path="...", old_string="...", new_string="...")` - Modifying files
250
- - ✅ `Glob(pattern="...")` - Finding files by pattern
251
- - ✅ `Grep(pattern="...")` - Searching file contents
252
-
253
- **PROHIBITED**:
254
- ❌ `Bash(command="cat file.txt")` - Use Read() instead
255
- ❌ `Bash(command="echo 'content' > file.txt")` - Use Write() instead
256
- ❌ `Bash(command="find . -name *.md")` - Use Glob() instead
257
- ❌ `Bash(command="grep 'pattern' file.txt")` - Use Grep() instead
258
- ❌ `Bash(command="sed -i 's/old/new/' file.txt")` - Use Edit() instead
259
-
260
- **Rationale**: Native tools are 40-73% more token-efficient than Bash commands.
261
-
262
- **Exception**: Bash MUST be used for:
263
- - Running tests: `Bash(command="npm test")`, `Bash(command="dotnet test")`
264
- - Running builds: `Bash(command="npm run build")`, `Bash(command="dotnet build")`
265
- - Git operations: `Bash(command="git status")`, `Bash(command="git commit")`
266
- - Package managers: `Bash(command="npm install")`, `Bash(command="pip install")`
267
-
268
- ### LOCKED: Skill Invocation Pattern
269
-
270
- **Skills invoke other skills**:
271
- ```markdown
272
- Skill(command="validating-quality --mode=light --story=STORY-001")
273
- ```
274
-
275
- **Skills invoke subagents**:
276
- ```markdown
277
- Task(subagent_type="test-automator",
278
- prompt="Generate tests for acceptance criteria in STORY-001.md")
279
- ```
280
-
281
- **PROHIBITED**:
282
- ❌ Skills directly calling Bash to invoke other skills
283
- ❌ Circular skill dependencies (Skill A calls Skill B calls Skill A)
284
-
285
- ### LOCKED: Context File Format
286
-
287
- All project context files MUST follow this structure:
288
-
289
- ```markdown
290
- # [Context File Title]
291
-
292
- **Status**: LOCKED
293
- **Last Updated**: YYYY-MM-DD
294
- **Version**: X.Y
295
-
296
- ## [Section 1]
297
- Content with ✅ CORRECT and ❌ FORBIDDEN examples
298
-
299
- ## [Section 2]
300
- ...
301
-
302
- ## Ambiguity Resolution Protocol
303
- When ambiguity is encountered, AI agents MUST use AskUserQuestion...
304
- ```
305
-
306
- **PROHIBITED**:
307
- ❌ Context files in JSON format
308
- ❌ Context files in YAML format (except frontmatter)
309
- ❌ Context files without "LOCKED" status marker
310
- ❌ Context files without version and date
311
-
312
- ---
313
-
314
- ## Technical Debt Threshold Configuration
315
-
316
- **Status**: LOCKED (as of 2026-01-21, STORY-289)
317
-
318
- **Purpose**: The threshold alerting system enforces technical debt limits during `/dev` workflow pre-flight validation.
319
-
320
- ### Configuration Location
321
-
322
- Thresholds are configured in `devforgeai/technical-debt-register.md` YAML frontmatter:
323
-
324
- ```yaml
325
- ---
326
- thresholds:
327
- warning_count: 5 # Display warning at 5-9 open items
328
- critical_count: 10 # Display CRITICAL warning at 10-14 open items
329
- blocking_count: 15 # Block /dev workflow at 15+ open items
330
- ---
331
- ```
332
-
333
- ### Threshold Behavior
334
-
335
- | Level | Count Range | Behavior |
336
- |-------|-------------|----------|
337
- | **Normal** | 0-4 items | No alert, workflow proceeds |
338
- | **Warning** | 5-9 items | Display warning, workflow proceeds |
339
- | **Critical** | 10-14 items | Display CRITICAL warning, workflow proceeds |
340
- | **Blocking** | 15+ items | HALT workflow, require override or debt reduction |
341
-
342
- ### Customization
343
-
344
- Projects can customize thresholds by editing the YAML frontmatter in `technical-debt-register.md`:
345
-
346
- ```yaml
347
- thresholds:
348
- warning_count: 3 # More aggressive warning (default: 5)
349
- critical_count: 7 # More aggressive critical (default: 10)
350
- blocking_count: 12 # More aggressive blocking (default: 15)
351
- ```
352
-
353
- **Validation Rules:**
354
- - `warning_count < critical_count < blocking_count` (must be in ascending order)
355
- - All values must be positive integers
356
- - If thresholds section is missing or invalid, defaults (5/10/15) are used
357
-
358
- ### Override Mechanism
359
-
360
- When blocked (15+ items), users can override with `--ignore-debt-threshold` flag:
361
- - Triggers `AskUserQuestion` consent prompt
362
- - Override is logged to `devforgeai/workflows/{STORY-ID}-phase-state.json`
363
- - Persistent warning banner displayed throughout workflow
364
-
365
- **Reference:** STORY-289 (Threshold Alerting System), `src/claude/skills/implementing-stories/phases/phase-01-preflight.md` Step 10
366
-
367
- ---
368
-
369
- ## Token Budget Constraints
370
-
371
- ### LOCKED: Component Size Limits
372
-
373
- These limits enforce Claude Code Terminal's character budget constraint:
374
-
375
- **Skills**:
376
- - Target: 500-800 lines (~20,000-30,000 characters)
377
- - Maximum: 1,000 lines (~40,000 characters)
378
- - Rationale: Skills have separate context windows
379
-
380
- **Slash Commands**:
381
- - Target: 200-400 lines (~8,000-15,000 characters)
382
- - Maximum: 500 lines (~20,000 characters)
383
- - Rationale: 15,000 character budget for command context
384
-
385
- **Subagents**:
386
- - Target: 100-300 lines (~4,000-12,000 characters)
387
- - Maximum: 500 lines (~20,000 characters)
388
- - Rationale: Separate context window per subagent
389
-
390
- **Context Files**:
391
- - Target: 200-400 lines (~8,000-15,000 characters)
392
- - Maximum: 600 lines (~24,000 characters)
393
- - Rationale: Read into development skill context
394
-
395
- **ENFORCEMENT**:
396
- When components exceed targets:
397
- 1. Extract reference documentation to separate files
398
- 2. Use progressive disclosure (load references on demand)
399
- 3. Split into sub-components if necessary
400
-
401
- ---
402
-
403
- ## Framework Extension Pattern
404
-
405
- ### Adding New Skills
406
-
407
- **Process**:
408
- 1. Create `.claude/skills/[skill-name]/` directory
409
- 2. Create `SKILL.md` with YAML frontmatter
410
- 3. Add `references/` subdirectory for deep documentation
411
- 4. Update CLAUDE.md with skill description
412
- 5. Test skill invocation
413
-
414
- **PROHIBITED**:
415
- ❌ Adding skills without SKILL.md file
416
- ❌ Hardcoding logic in skills (use AskUserQuestion for decisions)
417
- ❌ Skills that work only for specific languages
418
-
419
- ### Adding New Subagents
420
-
421
- **Process**:
422
- 1. Create `.claude/agents/[agent-name].md`
423
- 2. Add YAML frontmatter with name, description, tools, model
424
- 3. Write system prompt focused on single responsibility
425
- 4. Test subagent in isolation and with skills
426
- 5. Update documentation
427
-
428
- **PROHIBITED**:
429
- ❌ Subagents with multiple responsibilities
430
- ❌ Subagents that overlap with existing agents
431
- ❌ Subagents without tool restrictions (use principle of least privilege)
432
-
433
- ### Adding New Slash Commands
434
-
435
- **Process**:
436
- 1. Create `.claude/commands/[command-name].md`
437
- 2. Add YAML frontmatter with description, argument-hint
438
- 3. Write command instructions with $ARGUMENTS placeholder
439
- 4. Keep under 500 lines (<20K characters)
440
- 5. Test with real arguments
441
-
442
- **PROHIBITED**:
443
- ❌ Commands exceeding 500 lines (extract to skills)
444
- ❌ Commands without argument hints
445
- ❌ Commands that duplicate skill functionality
446
-
447
- ---
448
-
449
- ## Ambiguity Resolution Protocol
450
-
451
- **CRITICAL**: When framework implementation encounters ambiguity:
452
-
453
- 1. **Check this file** for LOCKED decisions
454
- 2. **Check other context files** for related constraints
455
- 3. **If still ambiguous** → STOP and use AskUserQuestion
456
- 4. **After resolution** → Update context file or create ADR
457
-
458
- **Example Ambiguity**:
459
- "Should the development skill invoke QA skill automatically or wait for user command?"
460
-
461
- **Resolution**:
462
- ```
463
- Question: "Should development skill invoke QA skill automatically after implementation?"
464
- Header: "QA invocation"
465
- Options:
466
- - "Automatic - Always invoke light QA after each phase"
467
- - "Manual - Wait for user to run /qa command"
468
- - "Configurable - Allow user to set preference"
469
- multiSelect: false
470
- ```
471
-
472
- After resolution → Document decision in this file or create ADR.
473
-
474
- ---
475
-
476
- ## Migration and Versioning
477
-
478
- ### Framework Version Upgrades
479
-
480
- **Semantic Versioning**: MAJOR.MINOR.PATCH
481
-
482
- **MAJOR** (Breaking changes):
483
- - Context file format changes
484
- - Skill/subagent interface changes
485
- - Tool usage pattern changes
486
- - Requires project migration
487
-
488
- **MINOR** (New features):
489
- - New skills added
490
- - New subagents added
491
- - New slash commands added
492
- - Backward compatible
493
-
494
- **PATCH** (Bug fixes):
495
- - Documentation corrections
496
- - Reference file updates
497
- - Minor optimizations
498
- - Fully compatible
499
-
500
- ### Project Migration Strategy
501
-
502
- When upgrading projects to new framework version:
503
- 1. Check CHANGELOG for breaking changes
504
- 2. Update context files if format changed
505
- 3. Regenerate context files with new architecture skill
506
- 4. Test with sample story before full migration
507
-
508
- ---
509
-
510
- ## Installer/Distribution Technologies
511
-
512
- ### NPM Package Distribution (EPIC-012)
513
-
514
- **Status**: LOCKED (as of 2025-11-25)
515
-
516
- **Purpose**: DevForgeAI installer is distributed as an NPM package for easy installation.
517
-
518
- **Package Distribution**:
519
- - **Registry**: NPM (public)
520
- - **Package Name**: `devforgeai` (or `@devforgeai/installer` if scoped)
521
- - **Installation**: `npm install -g devforgeai`
522
- - **Entry Point**: `devforgeai` command available globally
523
-
524
- **CLI Framework (Node.js wrapper)**:
525
- - **Commander.js 11+** OR **Yargs 17+** - LOCKED (command-line argument parsing)
526
- - **Inquirer.js 9+** - LOCKED (interactive wizard prompts)
527
- - **Ora 7+** - LOCKED (spinner/progress indicators)
528
- - **Chalk 5+** - LOCKED (terminal colors/formatting)
529
- - **Semver 7+** - LOCKED (semantic version parsing/comparison)
530
- - **Boxen 7+** - LOCKED (bordered message boxes)
531
-
532
- **Core Installer (Python - existing)**:
533
- - Reuses existing `installer/install.py` and related modules
534
- - Node.js CLI wrapper invokes Python subprocess
535
- - Python 3.10+ required for CLI tools (devforgeai validators)
536
-
537
- **Integration Points**:
538
- - **NPM Registry**: Package publishing via `npm publish` with provenance
539
- - **GitHub API**: Version checking, release notes (optional, online mode)
540
- - **PyPI**: devforgeai CLI installed via pip (optional dependency)
541
-
542
- **PROHIBITED**:
543
- ❌ Replacing Python installer with pure Node.js (reuse existing code)
544
- ❌ Bundling alternative CLI frameworks (one choice only)
545
- ❌ External network calls during installation (offline mode required)
546
-
547
- **Rationale**: NPM provides widest reach for Node.js developers (primary target audience). Python installer core already exists and is well-tested.
548
-
549
- ---
550
-
551
- ## References
552
-
553
- - [Claude Code Documentation](https://docs.claude.com/en/docs/claude-code/)
554
- - [Native Tools Best Practices](.claude/skills/claude-code-terminal-expert/references/best-practices.md) - Token efficiency guidelines
555
- - [Claude Code Terminal Expert Skill](.claude/skills/claude-code-terminal-expert/SKILL.md) - Complete terminal feature reference
556
- - [Framework Design Rationale](README.md)
557
-
558
- ---
559
-
560
- **REMEMBER**: This tech-stack.md defines the **framework's own constraints**. Projects using DevForgeAI will have their own tech-stack.md files created by the designing-systems skill based on user technology choices.