@iservu-inc/adf-cli 0.11.0 → 0.12.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.
Files changed (34) hide show
  1. package/.adf/feature-audit.md +208 -0
  2. package/.adf/final-summary.md +347 -0
  3. package/.adf/implementation-plan.md +244 -0
  4. package/.adf/implementation-progress.md +203 -0
  5. package/.adf/learning/answer-history.json +995 -0
  6. package/.adf/learning/config.json +25 -0
  7. package/.adf/learning/learned-rules.json +59 -0
  8. package/.adf/learning/patterns.json +277 -0
  9. package/.adf/learning/skip-history.json +1451 -0
  10. package/.adf/learning/stats.json +9 -0
  11. package/.claude/settings.local.json +12 -5
  12. package/CHANGELOG.md +110 -0
  13. package/CLAUDE.md +479 -0
  14. package/bin/adf.js +339 -1
  15. package/lib/ai/ai-client.js +161 -44
  16. package/lib/ai/ai-config.js +249 -105
  17. package/lib/commands/deploy.js +73 -6
  18. package/lib/generators/agents-md-generator.js +431 -161
  19. package/lib/generators/antigravity-generator.js +140 -0
  20. package/lib/generators/deepagent-generator.js +144 -0
  21. package/lib/generators/gemini-cli-generator.js +241 -0
  22. package/lib/generators/index.js +55 -0
  23. package/lib/generators/opencode-generator.js +153 -0
  24. package/lib/generators/zed-generator.js +252 -0
  25. package/lib/templates/shared/agents/architect.md +24 -24
  26. package/lib/templates/shared/agents/dev.md +25 -20
  27. package/lib/templates/shared/agents/pm.md +14 -4
  28. package/lib/templates/shared/agents/sm.md +18 -14
  29. package/lib/templates/shared/templates/openspec-delta.md +16 -0
  30. package/lib/templates/shared/templates/openspec-proposal.md +18 -0
  31. package/lib/templates/shared/templates/openspec-tasks.md +21 -0
  32. package/lib/utils/context-manager.js +484 -0
  33. package/package.json +6 -1
  34. package/tests/agents-md-generator.test.js +47 -10
@@ -0,0 +1,244 @@
1
+ # ANDF Implementation Plan
2
+
3
+ **Status:** In Progress
4
+ **Started:** 2025-12-22
5
+ **Target Completion:** TBD
6
+
7
+ ## Implementation Phases
8
+
9
+ ### ✅ Phase 0: Audit & Planning (COMPLETED)
10
+ - [x] Audit current codebase
11
+ - [x] Identify feature gaps
12
+ - [x] Create implementation plan
13
+ - [x] Assess backward compatibility
14
+
15
+ ---
16
+
17
+ ### 🔄 Phase 1: AGENTS.md Standard Compliance
18
+
19
+ **Priority:** HIGH
20
+ **Estimated Effort:** 3-4 hours
21
+ **Files to Modify:**
22
+ - `lib/generators/agents-md-generator.js`
23
+
24
+ #### Tasks
25
+
26
+ **1.1 Add YAML Frontmatter Support**
27
+ - [ ] Add YAML parsing library (js-yaml) or use native string generation
28
+ - [ ] Create frontmatter template with `name`, `description`, `tools`
29
+ - [ ] Extract agent name/description from session metadata
30
+ - [ ] Configure MCP tools (Archon, project_context)
31
+ - **Validation:** YAML parses correctly, frontmatter renders in AGENTS.md
32
+
33
+ **1.2 Add MCP Tools Configuration**
34
+ - [ ] Create MCP tools template
35
+ - [ ] Support Archon MCP server configuration
36
+ - [ ] Support filesystem context server
37
+ - [ ] Make MCP servers configurable per project
38
+ - **Validation:** Tools section properly formatted in YAML
39
+
40
+ **1.3 Restructure Content Sections**
41
+ - [ ] Section 1: Operational Rules (High Priority)
42
+ - [ ] Section 2: Build & Test Commands
43
+ - [ ] Section 3: Project Structure
44
+ - [ ] Section 4: Workflow Directives
45
+ - [ ] Reference `.context/memory/architecture.md`
46
+ - **Validation:** All sections present, properly formatted
47
+
48
+ **Success Criteria:**
49
+ - AGENTS.md follows ANDF standard format exactly
50
+ - YAML frontmatter validates
51
+ - All required sections present
52
+ - References `.context/` directory
53
+ - Backward compatible (no breaking changes)
54
+
55
+ ---
56
+
57
+ ### Phase 2: .context/ Directory Support
58
+
59
+ **Priority:** HIGH
60
+ **Estimated Effort:** 2-3 hours
61
+ **Files to Modify:**
62
+ - New: `lib/utils/context-manager.js`
63
+ - `lib/generators/agents-md-generator.js`
64
+ - `lib/commands/init.js`
65
+
66
+ #### Tasks
67
+
68
+ **2.1 Create .context/ Directory Structure**
69
+ - [ ] Create `lib/utils/context-manager.js` utility
70
+ - [ ] Implement `createContextStructure(projectPath)` function
71
+ - [ ] Create `.context/memory/` directory
72
+ - [ ] Create `.context/skills/` directory
73
+ - [ ] Add `.gitignore` entries if needed
74
+ - **Validation:** Directories created successfully
75
+
76
+ **2.2 Generate architecture.md**
77
+ - [ ] Extract architecture from PRP outputs
78
+ - [ ] Extract architecture from Balanced spec
79
+ - [ ] Extract architecture from BMAD architecture.md
80
+ - [ ] Write to `.context/memory/architecture.md`
81
+ - [ ] Include system overview, tech stack, patterns
82
+ - **Validation:** architecture.md contains relevant content
83
+
84
+ **2.3 Generate glossary.md**
85
+ - [ ] Extract domain terms from session outputs
86
+ - [ ] Format as glossary (term: definition)
87
+ - [ ] Write to `.context/memory/glossary.md`
88
+ - **Validation:** glossary.md created with terms
89
+
90
+ **Success Criteria:**
91
+ - `.context/` directory created on `adf deploy`
92
+ - architecture.md contains extracted architecture info
93
+ - glossary.md contains domain terms
94
+ - AGENTS.md references `.context/memory/architecture.md`
95
+
96
+ ---
97
+
98
+ ### Phase 3: Zed Editor Support
99
+
100
+ **Priority:** MEDIUM
101
+ **Estimated Effort:** 3-4 hours
102
+ **Files to Create:**
103
+ - `lib/generators/zed-generator.js`
104
+ **Files to Modify:**
105
+ - `lib/generators/index.js`
106
+ - `lib/commands/deploy.js`
107
+
108
+ #### Tasks
109
+
110
+ **3.1 Create Zed Generator**
111
+ - [ ] Create `lib/generators/zed-generator.js`
112
+ - [ ] Extend `ToolConfigGenerator` base class
113
+ - [ ] Implement `generate()` method
114
+ - [ ] Generate `.zed/settings.json` with:
115
+ - Agent configuration (default_model, feature_specific_models)
116
+ - Context servers (archon, project_context)
117
+ - Model parameters (temperature settings)
118
+ - Terminal environment variables
119
+ - **Validation:** settings.json generates correctly
120
+
121
+ **3.2 Generate Keymap**
122
+ - [ ] Create keymap template
123
+ - [ ] Generate `.zed/keymap.json`
124
+ - [ ] Add agent switching shortcuts
125
+ - **Validation:** keymap.json valid JSON
126
+
127
+ **3.3 Implement Symlink Support**
128
+ - [ ] Cross-platform symlink creation
129
+ - [ ] Create `.zed/rules -> ../AGENTS.md`
130
+ - [ ] Handle Windows vs Unix differences
131
+ - [ ] Graceful fallback if symlinks fail (copy file instead)
132
+ - **Validation:** Symlink works on Unix, copy works on Windows
133
+
134
+ **3.4 Integration**
135
+ - [ ] Add 'zed' to TOOLS in `deploy.js`
136
+ - [ ] Export generator in `index.js`
137
+ - [ ] Add tests for Zed generator
138
+ - **Validation:** `adf deploy zed` works
139
+
140
+ **Success Criteria:**
141
+ - `adf deploy zed` creates complete configuration
142
+ - Symlink created on Unix systems
143
+ - File copy fallback on Windows
144
+ - MCP servers configured
145
+ - Agent switching keys mapped
146
+
147
+ ---
148
+
149
+ ### Phase 4: Antigravity Support
150
+
151
+ **Priority:** MEDIUM
152
+ **Estimated Effort:** 2 hours
153
+ **Files to Create:**
154
+ - `lib/generators/antigravity-generator.js`
155
+ **Files to Modify:**
156
+ - `lib/generators/index.js`
157
+ - `lib/commands/deploy.js`
158
+
159
+ #### Tasks
160
+
161
+ **4.1 Create Antigravity Generator**
162
+ - [ ] Create `lib/generators/antigravity-generator.js`
163
+ - [ ] Extend `ToolConfigGenerator` base class
164
+ - [ ] Implement `generate()` method
165
+ - [ ] Generate `.antigravity/agents.yaml` with:
166
+ - Agent name and model
167
+ - Capabilities (file_system access to AGENTS.md and .context)
168
+ - System prompt referencing AGENTS.md
169
+ - **Validation:** agents.yaml generates correctly
170
+
171
+ **4.2 Integration**
172
+ - [ ] Update TOOLS in `deploy.js` (already listed)
173
+ - [ ] Add actual generator call
174
+ - [ ] Export generator in `index.js`
175
+ - [ ] Add tests
176
+ - **Validation:** `adf deploy antigravity` works
177
+
178
+ **Success Criteria:**
179
+ - `adf deploy antigravity` creates `.antigravity/agents.yaml`
180
+ - Configuration mounts AGENTS.md
181
+ - File system access configured for .context/
182
+ - System prompt instructs to read AGENTS.md on startup
183
+
184
+ ---
185
+
186
+ ### Phase 5: Testing & Validation
187
+
188
+ **Priority:** HIGH
189
+ **Estimated Effort:** 2-3 hours
190
+
191
+ #### Tasks
192
+
193
+ **5.1 Unit Tests**
194
+ - [ ] Test AGENTS.md YAML frontmatter generation
195
+ - [ ] Test .context/ directory creation
196
+ - [ ] Test Zed generator
197
+ - [ ] Test Antigravity generator
198
+ - [ ] Test symlink creation/fallback
199
+
200
+ **5.2 Integration Tests**
201
+ - [ ] Test full deployment workflow
202
+ - [ ] Test backward compatibility
203
+ - [ ] Test on Windows/Linux/macOS
204
+
205
+ **5.3 Manual Testing**
206
+ - [ ] Create test project
207
+ - [ ] Run `adf init --rapid`
208
+ - [ ] Run `adf deploy zed`
209
+ - [ ] Verify AGENTS.md format
210
+ - [ ] Verify .context/ structure
211
+ - [ ] Verify .zed/ configuration
212
+ - [ ] Test in actual Zed editor
213
+
214
+ **Success Criteria:**
215
+ - All tests pass
216
+ - No regressions in existing functionality
217
+ - New features work as expected
218
+ - Cross-platform compatibility verified
219
+
220
+ ---
221
+
222
+ ## Implementation Order
223
+
224
+ 1. **Start:** Phase 1.1 (YAML frontmatter) - Foundation for everything else
225
+ 2. **Next:** Phase 1.2 & 1.3 (Complete AGENTS.md standard)
226
+ 3. **Then:** Phase 2 (Create .context/ structure)
227
+ 4. **Then:** Phase 3 (Zed support)
228
+ 5. **Then:** Phase 4 (Antigravity support)
229
+ 6. **Finally:** Phase 5 (Testing & validation)
230
+
231
+ ## Rollback Plan
232
+
233
+ If issues arise:
234
+ 1. All changes are in generators - easy to revert
235
+ 2. Feature flag: `ENABLE_ANDF=true` environment variable
236
+ 3. Existing AGENTS.md generation still works
237
+ 4. No changes to core interview/learning systems
238
+
239
+ ## Notes
240
+
241
+ - All changes are backward compatible
242
+ - Existing deployments continue to work
243
+ - ANDF features are additive, not replacements
244
+ - Can be released incrementally (phase by phase)
@@ -0,0 +1,203 @@
1
+ # ANDF Implementation Progress
2
+
3
+ **Last Updated:** 2025-12-22
4
+ **Status:** Phase 1 & 2 Complete ✅
5
+
6
+ ## Completed Work
7
+
8
+ ### ✅ Phase 0: Audit & Planning
9
+ - [x] Audited current codebase against AGENTS.md specification
10
+ - [x] Identified feature gaps
11
+ - [x] Created comprehensive implementation plan
12
+ - [x] Assessed backward compatibility (all changes are additive)
13
+
14
+ ### ✅ Phase 1: AGENTS.md Standard Compliance
15
+ **Status:** COMPLETE & TESTED
16
+ **Files Modified:**
17
+ - `lib/generators/agents-md-generator.js` (major update)
18
+ - `tests/agents-md-generator.test.js` (updated for new format)
19
+
20
+ **What Was Implemented:**
21
+ 1. **YAML Frontmatter Support**
22
+ - Added `generateFrontmatter()` method
23
+ - Includes `name`, `description`, and `tools` fields
24
+ - Agent name varies by framework (Developer, Project Architect, Solutions Architect)
25
+ - Description extracted from tech stack
26
+
27
+ 2. **MCP Tools Configuration**
28
+ - `project_context` tool - accesses `.context/` via filesystem MCP server
29
+ - Optional `archon` tool - configurable via env var or metadata
30
+ - Proper YAML formatting with tool descriptions
31
+
32
+ 3. **Restructured Content Sections (ANDF-Compliant)**
33
+ - Section 1: Operational Rules (High Priority)
34
+ - Section 2: Build & Test Commands
35
+ - Section 3: Project Structure
36
+ - Section 4: Workflow Directives
37
+ - Section 5: Project Context/Constitution/Product Vision (varies by framework)
38
+ - Section 6: Key Context Files
39
+ - Section 7: AI Agent Instructions (detailed, numbered)
40
+
41
+ **Format Example:**
42
+ ```markdown
43
+ ---
44
+ name: Project Name Developer
45
+ description: Expert developer specializing in...
46
+ tools:
47
+ - name: project_context
48
+ command: npx
49
+ args: ["@modelcontextprotocol/server-filesystem",".context"]
50
+ description: Access project context files
51
+ ---
52
+
53
+ # AGENTS.md - The Agent Manifest
54
+
55
+ ## 1. Operational Rules (High Priority)
56
+ ...
57
+ ```
58
+
59
+ **Test Results:**
60
+ ```
61
+ PASS tests/agents-md-generator.test.js
62
+ ✓ PRP Framework
63
+ ✓ Balanced Framework
64
+ ✓ BMAD Framework
65
+ ✓ Template Variables (2 tests)
66
+
67
+ All 5 tests passing
68
+ ```
69
+
70
+ ### ✅ Phase 2: .context/ Directory Support
71
+ **Status:** COMPLETE
72
+ **Files Created:**
73
+ - `lib/utils/context-manager.js` (new utility, 500+ lines)
74
+
75
+ **Files Modified:**
76
+ - `lib/commands/deploy.js` (integrated ContextManager)
77
+
78
+ **What Was Implemented:**
79
+ 1. **ContextManager Utility Class**
80
+ - Creates `.context/` directory structure
81
+ - Generates `.context/memory/architecture.md`
82
+ - Generates `.context/memory/glossary.md`
83
+ - Creates `.context/README.md` explaining the structure
84
+
85
+ 2. **Architecture.md Generation**
86
+ - **PRP (Rapid):** Extracts from PRP sections (goal, context, blueprint)
87
+ - **Balanced:** Combines spec, plan, and constitution
88
+ - **BMAD:** Copies existing architecture.md or extracts from PRD
89
+ - Includes: Overview, Tech Stack, Design Decisions, Components, Security, Performance
90
+
91
+ 3. **Glossary.md Generation**
92
+ - Automatically extracts domain terms from interview transcripts
93
+ - Identifies capitalized terms and acronyms
94
+ - Generates alphabetically sorted glossary
95
+ - Supports manual additions
96
+
97
+ 4. **Integration with Deploy Command**
98
+ - `.context/` created before AGENTS.md generation
99
+ - Runs automatically on `adf deploy`
100
+ - Graceful error handling with warnings
101
+
102
+ **Directory Structure Created:**
103
+ ```
104
+ project-root/
105
+ ├── AGENTS.md # With YAML frontmatter & ANDF sections
106
+ └── .context/ # NEW!
107
+ ├── README.md # Explains the directory
108
+ ├── memory/
109
+ │ ├── architecture.md # Generated from session outputs
110
+ │ └── glossary.md # Extracted from transcripts
111
+ └── skills/ # (empty, for future use)
112
+ ```
113
+
114
+ **Integration Points:**
115
+ - `deploy.js` now calls ContextManager before generating AGENTS.md
116
+ - AGENTS.md references `.context/memory/architecture.md` in operational rules
117
+ - All three frameworks (PRP, Balanced, BMAD) supported
118
+
119
+ ## Backward Compatibility
120
+
121
+ ✅ **100% Backward Compatible**
122
+ - All changes are ADDITIVE
123
+ - Existing `.windsurfrules`, `.cursorrules`, `.vscode/settings.json` unchanged
124
+ - `.adf/` structure unchanged
125
+ - Existing sessions/learning data unaffected
126
+ - New features only activate on `adf deploy`
127
+
128
+ ## Pending Work
129
+
130
+ ### 🔄 Phase 3: Zed Editor Support (TODO)
131
+ **Priority:** Medium
132
+ **Estimated:** 3-4 hours
133
+
134
+ **Tasks:**
135
+ - [ ] Create `lib/generators/zed-generator.js`
136
+ - [ ] Generate `.zed/settings.json` with MCP config
137
+ - [ ] Generate `.zed/keymap.json`
138
+ - [ ] Implement cross-platform symlink support (`.zed/rules -> ../AGENTS.md`)
139
+ - [ ] Add 'zed' to TOOLS in deploy.js
140
+ - [ ] Write tests
141
+
142
+ ### 🔄 Phase 4: Antigravity Support (TODO)
143
+ **Priority:** Medium
144
+ **Estimated:** 2 hours
145
+
146
+ **Tasks:**
147
+ - [ ] Create `lib/generators/antigravity-generator.js`
148
+ - [ ] Generate `.antigravity/agents.yaml`
149
+ - [ ] Configure to mount AGENTS.md
150
+ - [ ] Update deploy.js to call generator
151
+ - [ ] Write tests
152
+
153
+ ### 🔄 Phase 5: Final Testing (TODO)
154
+ **Priority:** High
155
+ **Estimated:** 2-3 hours
156
+
157
+ **Tasks:**
158
+ - [ ] Write unit tests for ContextManager
159
+ - [ ] Integration tests for full deployment flow
160
+ - [ ] Test on Windows/Linux/macOS
161
+ - [ ] Manual testing in actual IDEs
162
+ - [ ] Documentation updates
163
+
164
+ ## Impact Summary
165
+
166
+ ### New Capabilities
167
+ 1. **AGENTS.md Standard Compliance**
168
+ - Industry-standard format
169
+ - Auto-discovered by next-gen AI tools
170
+ - MCP server integration ready
171
+
172
+ 2. **.context/ Directory**
173
+ - Agent-accessible deep context
174
+ - Architectural knowledge preserved
175
+ - Domain terminology documented
176
+
177
+ 3. **Better AI Agent Guidance**
178
+ - Structured operational rules
179
+ - Clear build/test commands
180
+ - Explicit workflow directives
181
+ - Security and performance guidelines
182
+
183
+ ### Benefits
184
+ - **For Users:** Better AI assistant behavior, more consistent code generation
185
+ - **For AI Tools:** Standard format, predictable structure, MCP integration
186
+ - **For Teams:** Shared architectural knowledge, documented terminology
187
+ - **For Framework:** Future-proof, industry-aligned, extensible
188
+
189
+ ## Technical Debt
190
+ None introduced. All code follows existing patterns and conventions.
191
+
192
+ ## Next Steps
193
+ 1. Complete Phase 3 (Zed) if Zed support is priority
194
+ 2. Complete Phase 4 (Antigravity) if Antigravity support is priority
195
+ 3. OR skip to Phase 5 (Testing) to validate and ship Phase 1 & 2
196
+ 4. Update CHANGELOG.md and README.md
197
+ 5. Release as v0.12.0 (minor version bump for new features)
198
+
199
+ ## Notes
200
+ - All changes validated with syntax checks
201
+ - AGENTS.md generator tests updated and passing
202
+ - Deploy command tested for syntax errors
203
+ - Ready for integration testing with actual ADF sessions