@iservu-inc/adf-cli 0.2.0 → 0.3.0

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.
@@ -0,0 +1,699 @@
1
+ # ADF CLI - AGENTS.md and Tool Generators Implementation
2
+
3
+ **Date:** 2025-10-03
4
+ **Status:** In Progress - Building Tool-Specific Generators
5
+ **Phase:** Option B - Tool Integrations (Phase 2A → 2B)
6
+
7
+ ---
8
+
9
+ ## Session Summary
10
+
11
+ ### What We've Accomplished
12
+
13
+ **Phase 1 (Complete):**
14
+ - ✅ Quality-based progress tracking
15
+ - ✅ Triple-redundant auto-save
16
+ - ✅ Resume capability
17
+ - ✅ Answer quality analyzer
18
+ - ✅ Session manager
19
+ - ✅ 33 unit tests (78% coverage)
20
+ - ✅ Published v0.2.0 to npm
21
+
22
+ **Phase 2A (Complete):**
23
+ - ✅ Research: AGENTS.md, Windsurf, Cursor, VS Code
24
+ - ✅ Base ToolConfigGenerator class
25
+ - ✅ AGENTS.md generator (PRP, Balanced, BMAD)
26
+ - ✅ Integration into deploy command
27
+ - ✅ 5 new tests for generators
28
+ - ✅ Comprehensive research documentation
29
+
30
+ **Phase 2B (Current):**
31
+ - 🔄 Building Windsurf generator
32
+ - 🔄 Building Cursor generator
33
+ - 🔄 Building VS Code generator
34
+ - ⏳ Testing all generators
35
+ - ⏳ Version 0.3.0 release
36
+
37
+ ---
38
+
39
+ ## Project Structure
40
+
41
+ ```
42
+ adf-cli/
43
+ ├── lib/
44
+ │ ├── commands/
45
+ │ │ ├── init.js # Interview system
46
+ │ │ ├── deploy.js # Deploy + generate configs
47
+ │ │ └── update.js
48
+ │ ├── frameworks/
49
+ │ │ ├── interviewer.js # AI-driven interview
50
+ │ │ ├── progress-tracker.js # Quality-based progress
51
+ │ │ ├── answer-quality-analyzer.js
52
+ │ │ ├── session-manager.js # Resume capability
53
+ │ │ ├── questions.js # Question database
54
+ │ │ └── output-generators.js # PRP/Balanced/BMAD outputs
55
+ │ └── generators/ # NEW: Tool config generators
56
+ │ ├── tool-config-generator.js # Base class
57
+ │ ├── agents-md-generator.js # ✅ AGENTS.md (universal)
58
+ │ ├── windsurf-generator.js # 🔄 In progress
59
+ │ ├── cursor-generator.js # 🔄 In progress
60
+ │ ├── vscode-generator.js # 🔄 In progress
61
+ │ └── index.js
62
+ ├── tests/
63
+ │ ├── answer-quality-analyzer.test.js # 16 tests
64
+ │ ├── progress-tracker.test.js # 12 tests
65
+ │ ├── session-manager.test.js # 5 tests
66
+ │ └── agents-md-generator.test.js # 5 tests
67
+ └── .project/
68
+ ├── chats/
69
+ │ ├── current/ # This file
70
+ │ └── complete/ # Archived chats
71
+ └── docs/
72
+ ├── goals/PROJECT-VISION.md
73
+ ├── architecture/SYSTEM-DESIGN.md
74
+ ├── frameworks/FRAMEWORK-METHODOLOGIES.md
75
+ └── tool-integrations/
76
+ ├── IDE-CUSTOMIZATIONS.md
77
+ └── RESEARCH-FINDINGS.md # 500+ line spec
78
+ ```
79
+
80
+ ---
81
+
82
+ ## AGENTS.md Generator (Completed)
83
+
84
+ ### What It Does
85
+
86
+ Generates **AGENTS.md** - the universal open standard for AI coding agent instructions.
87
+
88
+ **Supported by:**
89
+ - OpenAI Codex/Copilot
90
+ - Google Gemini/Jules
91
+ - Cursor
92
+ - Windsurf
93
+ - Factory
94
+ - 20,000+ open-source projects
95
+
96
+ ### Implementation
97
+
98
+ **Base Class:** `tool-config-generator.js`
99
+ - Loads framework outputs
100
+ - Parses markdown sections
101
+ - Template variable substitution
102
+ - File operations
103
+
104
+ **Generator:** `agents-md-generator.js`
105
+ - `generateFromPRP()` - PRP framework
106
+ - `generateFromBalanced()` - Balanced framework
107
+ - `generateFromBMAD()` - BMAD framework
108
+
109
+ **Output Structure:**
110
+ ```markdown
111
+ # Project Name
112
+
113
+ ## Overview
114
+ [From framework outputs]
115
+
116
+ ## Tech Stack
117
+ [Detected from outputs]
118
+
119
+ ## Build Commands
120
+ npm install
121
+ npm run build
122
+
123
+ ## Test Commands
124
+ npm test
125
+
126
+ ## Implementation Blueprint
127
+ [PRP: blueprint section]
128
+ [Balanced: technical plan]
129
+ [BMAD: architecture]
130
+
131
+ ## Success Criteria
132
+ [Validation requirements]
133
+
134
+ ## Development Workflow
135
+ 1. Review requirements
136
+ 2. Check implementation blueprint
137
+ 3. Write tests first
138
+ 4. Implement following blueprint
139
+ 5. Verify against criteria
140
+
141
+ ## Key Context
142
+ - Framework outputs: .adf/sessions/{session}/outputs/
143
+ - Q&A responses: .adf/sessions/{session}/qa-responses/
144
+
145
+ ## AI Agent Instructions
146
+ [Framework-specific guidance]
147
+ ```
148
+
149
+ ### Integration with Deploy Command
150
+
151
+ **Enhanced deploy.js:**
152
+ ```javascript
153
+ // Find latest session
154
+ const sessionPath = await findLatestSession(cwd);
155
+
156
+ // Get framework type
157
+ const framework = await getFrameworkFromSession(sessionPath);
158
+
159
+ // Generate AGENTS.md automatically
160
+ await generateAgentsMd(sessionPath, cwd, framework);
161
+
162
+ // Then deploy tool-specific configs
163
+ ```
164
+
165
+ ---
166
+
167
+ ## Tool Generators To Build
168
+
169
+ ### 1. Windsurf Generator
170
+
171
+ **Files to Generate:**
172
+
173
+ **`.windsurfrules`** (Legacy compatibility)
174
+ ```markdown
175
+ # {PROJECT_NAME}
176
+
177
+ ## Context
178
+ {GOAL or OVERVIEW}
179
+
180
+ ## Tech Stack
181
+ {TECH_STACK}
182
+
183
+ ## Core Principles
184
+ {CONSTITUTION_PRINCIPLES}
185
+
186
+ ## Architecture
187
+ {ARCHITECTURE_SUMMARY}
188
+
189
+ ## Code Standards
190
+ {CODE_STYLE}
191
+ ```
192
+
193
+ **`.windsurf/rules/project-context.md`** (Modern)
194
+ ```markdown
195
+ # Project Context
196
+
197
+ ## Goal
198
+ {PRP_GOAL or PRD_OVERVIEW}
199
+
200
+ ## Tech Stack
201
+ {TECH_STACK}
202
+
203
+ ## Key Principles
204
+ {CONSTITUTION_PRINCIPLES}
205
+ ```
206
+
207
+ **`.windsurf/rules/architecture.md`**
208
+ ```markdown
209
+ # Architecture
210
+
211
+ {ARCHITECTURE_CONTENT}
212
+
213
+ Reference: .adf/sessions/{SESSION}/outputs/architecture.md
214
+ ```
215
+
216
+ **`.windsurf/rules/coding-standards.md`**
217
+ ```markdown
218
+ # Coding Standards
219
+
220
+ {CODE_STYLE from Technical Plan}
221
+
222
+ ## Patterns to Use
223
+ {RECOMMENDED_PATTERNS}
224
+
225
+ ## Patterns to Avoid
226
+ {ANTI_PATTERNS}
227
+ ```
228
+
229
+ **`.windsurf/workflows/implement-story.md`**
230
+ ```markdown
231
+ # Implement Story Workflow
232
+
233
+ 1. Review story in stories.md
234
+ 2. Check architecture for component location
235
+ 3. Follow code standards
236
+ 4. Write tests first
237
+ 5. Implement feature
238
+ 6. Verify against acceptance criteria
239
+ ```
240
+
241
+ **`.windsurf/workflows/review-requirements.md`**
242
+ ```markdown
243
+ # Review Requirements Workflow
244
+
245
+ 1. Load PRD: .adf/sessions/{SESSION}/outputs/prd.md
246
+ 2. Check user stories
247
+ 3. Verify against current implementation
248
+ 4. Identify gaps
249
+ ```
250
+
251
+ **Character Limits:** 12,000 per file
252
+ **Activation:** Manual (@mention), Model Decision, Always On, File Glob
253
+
254
+ ### 2. Cursor Generator
255
+
256
+ **Files to Generate:**
257
+
258
+ **`.cursor/rules`** (Primary)
259
+ ```markdown
260
+ # {PROJECT_NAME} - Cursor Rules
261
+
262
+ ## Project Context
263
+ {PRP_GOAL or PRD_OVERVIEW}
264
+
265
+ ## Technical Stack
266
+ {TECH_STACK}
267
+
268
+ ## Core Principles
269
+ {CONSTITUTION_PRINCIPLES}
270
+
271
+ ## Architecture
272
+ Reference: .adf/sessions/{SESSION}/outputs/architecture.md
273
+
274
+ {ARCHITECTURE_SUMMARY}
275
+
276
+ ## Coding Standards
277
+ {CODE_STYLE}
278
+
279
+ ## Before Writing Code
280
+ 1. Review PRD: .adf/sessions/{SESSION}/outputs/prd.md
281
+ 2. Check architecture patterns
282
+ 3. Verify constraints
283
+
284
+ ## Forbidden
285
+ {CONSTITUTION_NON_NEGOTIABLES}
286
+
287
+ ## Reference Documents
288
+ - PRD: .adf/sessions/{SESSION}/outputs/prd.md
289
+ - Architecture: .adf/sessions/{SESSION}/outputs/architecture.md
290
+ - Constitution: .adf/sessions/{SESSION}/outputs/constitution.md
291
+ ```
292
+
293
+ **`.cursor/mcp.json`** (Optional - MCP servers)
294
+ ```json
295
+ {
296
+ "mcpServers": {
297
+ "requirement-checker": {
298
+ "command": "node",
299
+ "args": ["./tools/requirement-checker.js"],
300
+ "env": {
301
+ "PRD_PATH": ".adf/sessions/{SESSION}/outputs/prd.md"
302
+ }
303
+ }
304
+ }
305
+ }
306
+ ```
307
+
308
+ **Legacy Support:**
309
+ - Create `.cursorrules` with deprecation notice
310
+ - Point to `.cursor/rules`
311
+
312
+ ### 3. VS Code Generator
313
+
314
+ **Files to Generate:**
315
+
316
+ **`.github/copilot-instructions.md`** (GitHub Copilot)
317
+ ```markdown
318
+ # Copilot Instructions for {PROJECT_NAME}
319
+
320
+ ## Project Context
321
+ {PRP_GOAL or PRD_OVERVIEW}
322
+
323
+ ## Tech Stack
324
+ {TECH_STACK}
325
+
326
+ ## Architecture
327
+ {ARCHITECTURE_SUMMARY}
328
+
329
+ See full architecture: .adf/sessions/{SESSION}/outputs/architecture.md
330
+
331
+ ## Code Standards
332
+ {CODE_STYLE}
333
+
334
+ ## Patterns to Use
335
+ {RECOMMENDED_PATTERNS}
336
+
337
+ ## Patterns to Avoid
338
+ {ANTI_PATTERNS}
339
+
340
+ ## Testing Requirements
341
+ {TESTING_APPROACH}
342
+
343
+ ## Security Requirements
344
+ {SECURITY_NOTES}
345
+
346
+ ## When Generating Code
347
+ 1. Review requirements: .adf/sessions/{SESSION}/outputs/
348
+ 2. Follow architecture patterns
349
+ 3. Include error handling
350
+ 4. Add type definitions
351
+ 5. Write tests
352
+
353
+ ## Reference Documents
354
+ - PRD: .adf/sessions/{SESSION}/outputs/prd.md
355
+ - Architecture: .adf/sessions/{SESSION}/outputs/architecture.md
356
+ - Constitution: .adf/sessions/{SESSION}/outputs/constitution.md
357
+ ```
358
+
359
+ **`.vscode/settings.json`** (Enhancement)
360
+ ```json
361
+ {
362
+ "github.copilot.chat.modes": {
363
+ "architect": {
364
+ "instructions": "Focus on system design. Reference architecture.md",
365
+ "context": [".adf/sessions/{SESSION}/outputs/architecture.md"]
366
+ },
367
+ "implementer": {
368
+ "instructions": "Implement per PRD. Write tests first.",
369
+ "context": [
370
+ ".adf/sessions/{SESSION}/outputs/prd.md",
371
+ ".adf/sessions/{SESSION}/outputs/specification.md"
372
+ ]
373
+ },
374
+ "reviewer": {
375
+ "instructions": "Review against requirements and best practices.",
376
+ "context": [".adf/sessions/{SESSION}/outputs/constitution.md"]
377
+ }
378
+ }
379
+ }
380
+ ```
381
+
382
+ ---
383
+
384
+ ## Template Variables System
385
+
386
+ All generators use these variables:
387
+
388
+ ```javascript
389
+ {
390
+ PROJECT_NAME, // From metadata or directory
391
+ SESSION_ID, // Session identifier
392
+ FRAMEWORK, // rapid/balanced/comprehensive
393
+
394
+ // PRP
395
+ PRP_GOAL,
396
+ PRP_CONTEXT,
397
+ PRP_TECH_STACK,
398
+ PRP_IMPLEMENTATION,
399
+ PRP_VALIDATION,
400
+
401
+ // Balanced
402
+ CONSTITUTION_PRINCIPLES,
403
+ CONSTITUTION_CONSTRAINTS,
404
+ SPECIFICATION_OVERVIEW,
405
+ SPECIFICATION_ARCHITECTURE,
406
+ PLAN_TECH_STACK,
407
+ PLAN_CODE_STYLE,
408
+ TASKS_BREAKDOWN,
409
+
410
+ // BMAD
411
+ PRD_OVERVIEW,
412
+ PRD_GOALS,
413
+ PRD_TECH_REQUIREMENTS,
414
+ ARCHITECTURE_OVERVIEW,
415
+ ARCHITECTURE_COMPONENTS,
416
+ STORIES_LIST,
417
+
418
+ // Common
419
+ TECH_STACK,
420
+ CODE_STYLE,
421
+ TESTING_APPROACH,
422
+ SECURITY_NOTES,
423
+ RECOMMENDED_PATTERNS,
424
+ ANTI_PATTERNS
425
+ }
426
+ ```
427
+
428
+ ---
429
+
430
+ ## Generator Architecture
431
+
432
+ ```javascript
433
+ class ToolConfigGenerator {
434
+ constructor(sessionPath, projectPath, framework) {
435
+ this.sessionPath = sessionPath;
436
+ this.projectPath = projectPath;
437
+ this.framework = framework;
438
+ }
439
+
440
+ async initialize() {
441
+ // Load framework outputs
442
+ await this.loadFrameworkOutputs();
443
+ }
444
+
445
+ async generate() {
446
+ // Override in subclass
447
+ }
448
+
449
+ // Utilities
450
+ replaceVariables(template, variables)
451
+ extractSection(content, sectionName)
452
+ writeToProject(fileName, content)
453
+ ensureDir(dirPath)
454
+ }
455
+
456
+ class WindsurfGenerator extends ToolConfigGenerator {
457
+ async generate() {
458
+ await this.initialize();
459
+
460
+ // Generate .windsurfrules
461
+ await this.generateLegacyRules();
462
+
463
+ // Generate .windsurf/rules/*.md
464
+ await this.generateModernRules();
465
+
466
+ // Generate .windsurf/workflows/*.md
467
+ await this.generateWorkflows();
468
+
469
+ return {
470
+ legacy: ['.windsurfrules'],
471
+ rules: ['.windsurf/rules/...'],
472
+ workflows: ['.windsurf/workflows/...']
473
+ };
474
+ }
475
+ }
476
+
477
+ class CursorGenerator extends ToolConfigGenerator {
478
+ async generate() {
479
+ await this.initialize();
480
+
481
+ // Generate .cursor/rules
482
+ await this.generateRules();
483
+
484
+ // Generate .cursor/mcp.json (optional)
485
+ await this.generateMCP();
486
+
487
+ // Generate .cursorrules deprecation notice
488
+ await this.generateLegacyNotice();
489
+
490
+ return {
491
+ rules: ['.cursor/rules'],
492
+ mcp: ['.cursor/mcp.json'],
493
+ legacy: ['.cursorrules']
494
+ };
495
+ }
496
+ }
497
+
498
+ class VSCodeGenerator extends ToolConfigGenerator {
499
+ async generate() {
500
+ await this.initialize();
501
+
502
+ // Generate .github/copilot-instructions.md
503
+ await this.generateCopilotInstructions();
504
+
505
+ // Generate/enhance .vscode/settings.json
506
+ await this.generateVSCodeSettings();
507
+
508
+ return {
509
+ copilot: ['.github/copilot-instructions.md'],
510
+ vscode: ['.vscode/settings.json']
511
+ };
512
+ }
513
+ }
514
+ ```
515
+
516
+ ---
517
+
518
+ ## Integration Strategy
519
+
520
+ ### Deploy Command Flow
521
+
522
+ ```javascript
523
+ async function deployToTool(tool, options = {}) {
524
+ // Find latest session
525
+ const sessionPath = await findLatestSession(cwd);
526
+ const framework = await getFrameworkFromSession(sessionPath);
527
+
528
+ // ALWAYS generate AGENTS.md (universal)
529
+ await generateAgentsMd(sessionPath, cwd, framework);
530
+
531
+ // Generate tool-specific configs
532
+ if (tool === 'windsurf') {
533
+ const windsurf = new WindsurfGenerator(sessionPath, cwd, framework);
534
+ await windsurf.generate();
535
+ }
536
+
537
+ if (tool === 'cursor') {
538
+ const cursor = new CursorGenerator(sessionPath, cwd, framework);
539
+ await cursor.generate();
540
+ }
541
+
542
+ if (tool === 'vscode') {
543
+ const vscode = new VSCodeGenerator(sessionPath, cwd, framework);
544
+ await vscode.generate();
545
+ }
546
+
547
+ // Legacy agent deployment
548
+ await deployAgents(workflow);
549
+ await createToolConfig(tool);
550
+ }
551
+ ```
552
+
553
+ ### Generated File Structure
554
+
555
+ ```
556
+ project/
557
+ ├── AGENTS.md # ✅ Universal (ALWAYS)
558
+ ├── .windsurfrules # Windsurf (legacy)
559
+ ├── .windsurf/
560
+ │ ├── rules/
561
+ │ │ ├── project-context.md
562
+ │ │ ├── architecture.md
563
+ │ │ └── coding-standards.md
564
+ │ └── workflows/
565
+ │ ├── implement-story.md
566
+ │ └── review-requirements.md
567
+ ├── .cursor/
568
+ │ ├── rules # Cursor (primary)
569
+ │ ├── mcp.json # MCP servers
570
+ │ └── .cursorrules # Deprecation notice
571
+ ├── .github/
572
+ │ └── copilot-instructions.md # GitHub Copilot
573
+ ├── .vscode/
574
+ │ └── settings.json # Custom chat modes
575
+ └── .adf/
576
+ └── sessions/
577
+ └── {session-id}/
578
+ └── outputs/ # Source framework outputs
579
+ ```
580
+
581
+ ---
582
+
583
+ ## Current Task List
584
+
585
+ ### Immediate (Phase 2B)
586
+
587
+ - [ ] **Build Windsurf Generator**
588
+ - [ ] WindsurfGenerator class
589
+ - [ ] .windsurfrules generation
590
+ - [ ] .windsurf/rules/*.md generation
591
+ - [ ] .windsurf/workflows/*.md generation
592
+ - [ ] Template for each framework (PRP, Balanced, BMAD)
593
+ - [ ] Tests
594
+
595
+ - [ ] **Build Cursor Generator**
596
+ - [ ] CursorGenerator class
597
+ - [ ] .cursor/rules generation
598
+ - [ ] .cursor/mcp.json generation
599
+ - [ ] .cursorrules deprecation notice
600
+ - [ ] Template for each framework
601
+ - [ ] Tests
602
+
603
+ - [ ] **Build VS Code Generator**
604
+ - [ ] VSCodeGenerator class
605
+ - [ ] .github/copilot-instructions.md generation
606
+ - [ ] .vscode/settings.json enhancement
607
+ - [ ] Custom chat modes
608
+ - [ ] Template for each framework
609
+ - [ ] Tests
610
+
611
+ ### Testing & Polish
612
+
613
+ - [ ] Test all generators with real session data
614
+ - [ ] Test PRP framework outputs
615
+ - [ ] Test Balanced framework outputs
616
+ - [ ] Test BMAD framework outputs
617
+ - [ ] Verify all tools recognize generated configs
618
+ - [ ] End-to-end integration test
619
+
620
+ ### Release (v0.3.0)
621
+
622
+ - [ ] Update package.json to 0.3.0
623
+ - [ ] Update CHANGELOG.md
624
+ - [ ] Commit all generators
625
+ - [ ] Run full test suite
626
+ - [ ] Publish to npm
627
+ - [ ] Push to GitHub
628
+ - [ ] Test global install
629
+
630
+ ---
631
+
632
+ ## Key Insights
633
+
634
+ ### Why This Matters
635
+
636
+ 1. **User Uses All 3 IDEs**: Windsurf, Cursor, VS Code all need configs
637
+ 2. **AGENTS.md Foundation**: Universal standard works everywhere
638
+ 3. **Tool-Specific Enhancement**: Each tool gets optimized configs
639
+ 4. **Zero Manual Work**: Automatic from framework outputs
640
+ 5. **Consistency**: Same source (framework outputs) → multiple formats
641
+
642
+ ### Design Decisions
643
+
644
+ **Priority Order:**
645
+ 1. AGENTS.md (universal) - ALWAYS
646
+ 2. Tool-specific (if tool selected)
647
+
648
+ **Template Strategy:**
649
+ - Shared variables across all generators
650
+ - Framework-specific content extraction
651
+ - Fallbacks for missing sections
652
+
653
+ **File Organization:**
654
+ - Modern formats preferred (.windsurf/rules vs .windsurfrules)
655
+ - Legacy compatibility maintained
656
+ - Deprecation notices for old formats
657
+
658
+ **Character Limits:**
659
+ - Windsurf: 12,000 chars per rule file
660
+ - Split into multiple files if needed
661
+
662
+ ---
663
+
664
+ ## Success Criteria
665
+
666
+ ### For Each Generator
667
+
668
+ - [ ] Generates valid config files
669
+ - [ ] Tool recognizes and uses config
670
+ - [ ] All framework types supported (PRP, Balanced, BMAD)
671
+ - [ ] Template variables substituted correctly
672
+ - [ ] Files written to correct locations
673
+ - [ ] Tests passing
674
+
675
+ ### For Overall System
676
+
677
+ - [ ] `adf deploy windsurf` generates all Windsurf configs
678
+ - [ ] `adf deploy cursor` generates all Cursor configs
679
+ - [ ] `adf deploy vscode` generates all VS Code configs
680
+ - [ ] AGENTS.md generated regardless of tool
681
+ - [ ] No conflicts between generated files
682
+ - [ ] User can customize after generation
683
+ - [ ] Works on Windows, Mac, Linux
684
+
685
+ ---
686
+
687
+ ## Next Steps
688
+
689
+ 1. **Build WindsurfGenerator** (highest priority - user uses it)
690
+ 2. **Build CursorGenerator** (user uses it)
691
+ 3. **Build VSCodeGenerator** (user uses it)
692
+ 4. **Test with real project**
693
+ 5. **Version 0.3.0 release**
694
+
695
+ ---
696
+
697
+ **Status:** Ready to build tool generators
698
+ **Chat Active:** Yes
699
+ **Next Action:** Create WindsurfGenerator class