@iservu-inc/adf-cli 0.1.6 → 0.2.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,578 @@
1
+ # IDE Tool Customizations
2
+
3
+ ## Overview
4
+
5
+ ADF CLI generates tool-specific configurations to integrate framework outputs directly into IDE workflows.
6
+
7
+ **Supported Tools:**
8
+ 1. Windsurf (Codeium)
9
+ 2. Cursor
10
+ 3. VS Code (GitHub Copilot / Claude Code)
11
+
12
+ ---
13
+
14
+ ## 1. Windsurf Customizations
15
+
16
+ ### File Structure
17
+
18
+ ```
19
+ project/
20
+ ├── .windsurfrules # Main rules file
21
+ ├── .windsurfrules/
22
+ │ ├── memories/
23
+ │ │ ├── project-context.md
24
+ │ │ ├── architecture.md
25
+ │ │ └── coding-standards.md
26
+ │ ├── slash-commands/
27
+ │ │ ├── review-prd.md
28
+ │ │ ├── implement-story.md
29
+ │ │ └── check-requirements.md
30
+ │ └── workflows/
31
+ │ ├── feature-development.yaml
32
+ │ └── code-review.yaml
33
+ ```
34
+
35
+ ### .windsurfrules Format
36
+
37
+ ```markdown
38
+ # Project Rules
39
+
40
+ ## Context
41
+ [From PRP/BMAD outputs]
42
+
43
+ ## Constraints
44
+ [From Constitution]
45
+
46
+ ## Code Standards
47
+ [From Technical Plan]
48
+
49
+ ## AI Behavior
50
+ - Always reference PRD before implementing
51
+ - Follow architecture patterns defined in architecture.md
52
+ - Validate against success criteria
53
+ - Ask clarifying questions if requirements unclear
54
+ ```
55
+
56
+ ### Memories
57
+
58
+ **Purpose:** Long-term context retention
59
+
60
+ **project-context.md:**
61
+ ```markdown
62
+ # Project Context
63
+
64
+ ## Goal
65
+ [PRP Goal section]
66
+
67
+ ## Tech Stack
68
+ [PRP Context section]
69
+
70
+ ## User Personas
71
+ [BMAD Personas]
72
+
73
+ ## Key Principles
74
+ [Constitution principles]
75
+ ```
76
+
77
+ **architecture.md:**
78
+ ```markdown
79
+ # System Architecture
80
+
81
+ [C4 diagrams from BMAD]
82
+ [Component breakdown from Spec-Kit]
83
+ [Data flow from PRP]
84
+ ```
85
+
86
+ ### Slash Commands
87
+
88
+ **Purpose:** Quick actions within Cascade chat
89
+
90
+ **/review-prd:**
91
+ ```markdown
92
+ Review the current code against the PRD requirements.
93
+ Check for:
94
+ - [ ] All acceptance criteria met
95
+ - [ ] Edge cases handled
96
+ - [ ] Performance requirements satisfied
97
+ ```
98
+
99
+ **/implement-story [ID]:**
100
+ ```markdown
101
+ Implement user story {ID} following:
102
+ 1. Review story acceptance criteria
103
+ 2. Check architecture for component location
104
+ 3. Follow code standards
105
+ 4. Write tests first
106
+ 5. Implement feature
107
+ 6. Verify against success criteria
108
+ ```
109
+
110
+ ### Workflows
111
+
112
+ **Purpose:** Multi-step automations
113
+
114
+ **feature-development.yaml:**
115
+ ```yaml
116
+ name: Feature Development
117
+ steps:
118
+ - name: Review Requirements
119
+ action: load_prd
120
+ - name: Create Branch
121
+ action: git_branch
122
+ pattern: "feature/{story-id}-{description}"
123
+ - name: Implement
124
+ action: cascade_chat
125
+ context: [prd, architecture, story]
126
+ - name: Test
127
+ action: run_tests
128
+ - name: Review
129
+ action: self_review
130
+ ```
131
+
132
+ ### Flow System Integration
133
+
134
+ **Purpose:** Real-time AI assistance
135
+
136
+ **Configuration:**
137
+ ```json
138
+ {
139
+ "flow": {
140
+ "enabled": true,
141
+ "context": [
142
+ ".windsurfrules/memories/project-context.md",
143
+ ".windsurfrules/memories/architecture.md"
144
+ ],
145
+ "rules": ".windsurfrules",
146
+ "autoComplete": {
147
+ "checkRequirements": true,
148
+ "suggestPatterns": true
149
+ }
150
+ }
151
+ }
152
+ ```
153
+
154
+ ---
155
+
156
+ ## 2. Cursor Customizations
157
+
158
+ ### File Structure
159
+
160
+ ```
161
+ project/
162
+ ├── .cursorrules # Main rules (alternative)
163
+ ├── .cursor/
164
+ │ ├── rules # Main rules (primary)
165
+ │ ├── commands/
166
+ │ │ ├── check-requirements.md
167
+ │ │ └── implement-feature.md
168
+ │ ├── modes/
169
+ │ │ ├── architect.md
170
+ │ │ └── reviewer.md
171
+ │ ├── hooks/
172
+ │ │ ├── pre-commit.js
173
+ │ │ └── post-generate.js
174
+ │ └── notepads/
175
+ │ ├── current-task.md
176
+ │ └── decisions-log.md
177
+ ```
178
+
179
+ ### .cursor/rules Format
180
+
181
+ ```markdown
182
+ # Project Rules
183
+
184
+ You are a senior developer working on {PROJECT_NAME}.
185
+
186
+ ## Context Files
187
+ - PRD: .adf/sessions/{session}/outputs/prd.md
188
+ - Architecture: .adf/sessions/{session}/outputs/architecture.md
189
+ - Constitution: .adf/sessions/{session}/outputs/constitution.md
190
+
191
+ ## Always Follow
192
+ 1. Read PRD before implementing features
193
+ 2. Follow architecture patterns
194
+ 3. Validate against acceptance criteria
195
+ 4. Write tests first
196
+ 5. Check constitution for constraints
197
+
198
+ ## Code Style
199
+ [From technical plan]
200
+
201
+ ## Forbidden
202
+ [From constitution non-negotiables]
203
+ ```
204
+
205
+ ### Custom Modes
206
+
207
+ **Purpose:** Different AI personalities for different tasks
208
+
209
+ **architect.md:**
210
+ ```markdown
211
+ You are a system architect. When reviewing code:
212
+ - Focus on architectural patterns
213
+ - Check component boundaries
214
+ - Validate data flow
215
+ - Ensure scalability
216
+ - Review performance implications
217
+
218
+ Reference: .adf/sessions/{session}/outputs/architecture.md
219
+ ```
220
+
221
+ **reviewer.md:**
222
+ ```markdown
223
+ You are a code reviewer. Check for:
224
+ - Requirements compliance (against PRD)
225
+ - Code quality and standards
226
+ - Test coverage
227
+ - Edge case handling
228
+ - Security vulnerabilities
229
+ - Performance issues
230
+
231
+ Be thorough but constructive.
232
+ ```
233
+
234
+ ### MCP (Model Context Protocol) Integration
235
+
236
+ **Purpose:** Extend Cursor with custom tools
237
+
238
+ **tools/requirements-checker.js:**
239
+ ```javascript
240
+ // MCP tool to validate code against requirements
241
+ export default {
242
+ name: "check_requirements",
243
+ description: "Validate implementation against PRD requirements",
244
+ parameters: {
245
+ feature_id: "string"
246
+ },
247
+ async execute({ feature_id }) {
248
+ const prd = await loadPRD();
249
+ const feature = prd.features[feature_id];
250
+ const code = await getCurrentFile();
251
+
252
+ return validateAgainstRequirements(code, feature);
253
+ }
254
+ }
255
+ ```
256
+
257
+ ### Hooks
258
+
259
+ **Purpose:** Automated checks during development
260
+
261
+ **pre-commit.js:**
262
+ ```javascript
263
+ // Check if code meets requirements before commit
264
+ const { loadPRD, validateCode } = require('./utils');
265
+
266
+ async function preCommit(files) {
267
+ const prd = await loadPRD();
268
+ const results = await validateCode(files, prd);
269
+
270
+ if (results.missingRequirements.length > 0) {
271
+ console.log("Missing requirements:", results.missingRequirements);
272
+ return false; // Block commit
273
+ }
274
+
275
+ return true;
276
+ }
277
+ ```
278
+
279
+ ### Notepads
280
+
281
+ **Purpose:** Persistent context within Cursor
282
+
283
+ **current-task.md:**
284
+ ```markdown
285
+ # Current Task: Implement User Dashboard
286
+
287
+ ## Story
288
+ [User story from BMAD]
289
+
290
+ ## Requirements
291
+ - [ ] Requirement 1
292
+ - [ ] Requirement 2
293
+
294
+ ## Decisions Made
295
+ - Using React Query for data fetching
296
+ - Chart.js for visualizations
297
+ - Daily aggregation in backend
298
+
299
+ ## Questions
300
+ - Max data points to display?
301
+ ```
302
+
303
+ ---
304
+
305
+ ## 3. VS Code Customizations
306
+
307
+ ### File Structure
308
+
309
+ ```
310
+ project/
311
+ ├── .github/
312
+ │ └── copilot-instructions.md # GitHub Copilot
313
+ ├── .vscode/
314
+ │ ├── settings.json
315
+ │ └── tasks.json
316
+ ├── .claude/
317
+ │ ├── commands/
318
+ │ │ ├── review.md
319
+ │ │ └── implement.md
320
+ │ └── context/
321
+ │ └── project.md
322
+ ```
323
+
324
+ ### GitHub Copilot Instructions
325
+
326
+ **Purpose:** Guide Copilot's code generation
327
+
328
+ **.github/copilot-instructions.md:**
329
+ ```markdown
330
+ # Copilot Instructions for {PROJECT_NAME}
331
+
332
+ ## Project Context
333
+ [PRP Goal + Context]
334
+
335
+ ## Architecture
336
+ [Component structure from Spec-Kit]
337
+
338
+ ## Code Style
339
+ - TypeScript strict mode
340
+ - Functional components (React)
341
+ - Async/await (no callbacks)
342
+ - Descriptive variable names
343
+
344
+ ## Patterns to Use
345
+ - Custom hooks for logic reuse
346
+ - Context for global state
347
+ - Error boundaries for error handling
348
+
349
+ ## Patterns to Avoid
350
+ - Class components
351
+ - Inline styles
352
+ - Direct DOM manipulation
353
+
354
+ ## Testing
355
+ - Jest + React Testing Library
356
+ - Test files: *.test.ts
357
+ - Coverage minimum: 80%
358
+
359
+ ## When Generating Code
360
+ 1. Check PRD in .adf/sessions/{session}/outputs/
361
+ 2. Follow architecture patterns
362
+ 3. Include error handling
363
+ 4. Add TypeScript types
364
+ 5. Write accompanying tests
365
+ ```
366
+
367
+ ### Custom Chat Modes
368
+
369
+ **Purpose:** Different Copilot behaviors
370
+
371
+ **VS Code settings.json:**
372
+ ```json
373
+ {
374
+ "github.copilot.chat.modes": {
375
+ "architect": {
376
+ "instructions": "Focus on system design and architecture patterns. Reference architecture.md.",
377
+ "context": [
378
+ ".adf/sessions/{session}/outputs/architecture.md"
379
+ ]
380
+ },
381
+ "implementer": {
382
+ "instructions": "Implement features according to PRD. Write tests first.",
383
+ "context": [
384
+ ".adf/sessions/{session}/outputs/prd.md",
385
+ ".adf/sessions/{session}/outputs/specification.md"
386
+ ]
387
+ },
388
+ "reviewer": {
389
+ "instructions": "Review code against requirements and best practices.",
390
+ "context": [
391
+ ".adf/sessions/{session}/outputs/constitution.md"
392
+ ]
393
+ }
394
+ }
395
+ }
396
+ ```
397
+
398
+ ### Claude Code Integration
399
+
400
+ **Purpose:** Claude-specific configurations
401
+
402
+ **.claude/commands/review.md:**
403
+ ```markdown
404
+ # Review Command
405
+
406
+ Review the current file against:
407
+ 1. PRD requirements (.adf/sessions/{session}/outputs/prd.md)
408
+ 2. Architecture patterns (.adf/sessions/{session}/outputs/architecture.md)
409
+ 3. Constitution constraints (.adf/sessions/{session}/outputs/constitution.md)
410
+
411
+ Provide:
412
+ - Compliance status
413
+ - Missing requirements
414
+ - Improvement suggestions
415
+ ```
416
+
417
+ ### Language Model Tools API
418
+
419
+ **Purpose:** Extend VS Code AI with custom tools
420
+
421
+ **tools/requirement-lookup.ts:**
422
+ ```typescript
423
+ import * as vscode from 'vscode';
424
+
425
+ export function registerTools(context: vscode.ExtensionContext) {
426
+ const tool = vscode.lm.registerTool('requirement-lookup', {
427
+ description: 'Look up requirements from PRD',
428
+ async invoke(parameters: { feature_id: string }) {
429
+ const prdPath = '.adf/sessions/{session}/outputs/prd.md';
430
+ const content = await vscode.workspace.fs.readFile(
431
+ vscode.Uri.file(prdPath)
432
+ );
433
+
434
+ // Parse PRD and return relevant requirement
435
+ return parseRequirement(content.toString(), parameters.feature_id);
436
+ }
437
+ });
438
+
439
+ context.subscriptions.push(tool);
440
+ }
441
+ ```
442
+
443
+ ---
444
+
445
+ ## Output Generation Strategy
446
+
447
+ ### Per Framework
448
+
449
+ **PRP → Simple Integration**
450
+ - Single .windsurfrules file
451
+ - Single .cursorrules file
452
+ - Single copilot-instructions.md
453
+ - Reference prp.md for all context
454
+
455
+ **Balanced → Structured Integration**
456
+ - Separate memory files per output
457
+ - Multiple slash commands
458
+ - Custom modes for each phase
459
+ - Reference constitution, specification, plan
460
+
461
+ **BMAD → Comprehensive Integration**
462
+ - Full workflow automation
463
+ - MCP tools for requirement validation
464
+ - Hooks for compliance checking
465
+ - Multiple notepads for tracking
466
+ - Reference all BMAD outputs
467
+
468
+ ### Template Variables
469
+
470
+ All generated files use variables:
471
+
472
+ ```
473
+ {PROJECT_NAME} - From session metadata
474
+ {SESSION_ID} - Current session ID
475
+ {FRAMEWORK} - rapid/balanced/comprehensive
476
+ {OUTPUT_PATH} - Path to outputs directory
477
+ {TECH_STACK} - From PRP context
478
+ {PRINCIPLES} - From constitution
479
+ ```
480
+
481
+ ### Example Generated File
482
+
483
+ **.windsurfrules (from PRP):**
484
+ ```markdown
485
+ # Rules for {PROJECT_NAME}
486
+
487
+ ## Project Goal
488
+ {PRP_GOAL}
489
+
490
+ ## Tech Stack
491
+ {PRP_TECH_STACK}
492
+
493
+ ## Implementation Guidelines
494
+ {PRP_IMPLEMENTATION_BLUEPRINT}
495
+
496
+ ## Success Criteria
497
+ {PRP_VALIDATION}
498
+
499
+ ## AI Instructions
500
+ When implementing features:
501
+ 1. Read the full PRP: .adf/sessions/{SESSION_ID}/outputs/prp.md
502
+ 2. Follow the implementation blueprint exactly
503
+ 3. Validate against success criteria
504
+ 4. Ask if requirements are unclear
505
+ ```
506
+
507
+ ---
508
+
509
+ ## Future Enhancements
510
+
511
+ ### Planned
512
+
513
+ 1. **JetBrains IDEs** (IntelliJ, WebStorm, etc.)
514
+ 2. **Neovim** with Copilot.vim
515
+ 3. **Zed Editor**
516
+ 4. **Sublime Text** with AI plugins
517
+
518
+ ### Advanced Features
519
+
520
+ 1. **Real-time Requirement Sync**
521
+ - Update IDE rules when PRD changes
522
+ - Hot reload configurations
523
+
524
+ 2. **Requirement Traceability**
525
+ - Link code to specific requirements
526
+ - Show coverage in IDE
527
+
528
+ 3. **AI Pair Programming**
529
+ - Step-by-step feature implementation
530
+ - Guided by framework outputs
531
+
532
+ 4. **Automated Testing**
533
+ - Generate tests from acceptance criteria
534
+ - Validate against success metrics
535
+
536
+ ---
537
+
538
+ ## Tool Comparison
539
+
540
+ | Feature | Windsurf | Cursor | VS Code |
541
+ |---------|----------|--------|---------|
542
+ | Custom Rules | ✅ | ✅ | ✅ |
543
+ | Memories | ✅ | ❌ | ❌ |
544
+ | Slash Commands | ✅ | ✅ | ❌ |
545
+ | Custom Modes | ❌ | ✅ | ✅ |
546
+ | Workflows | ✅ | ❌ | ⚠️ (tasks) |
547
+ | Hooks | ❌ | ✅ | ⚠️ (extensions) |
548
+ | MCP Support | ❌ | ✅ | ❌ |
549
+ | Notepads | ❌ | ✅ | ❌ |
550
+ | Tools API | ❌ | ⚠️ (MCP) | ✅ |
551
+
552
+ ✅ = Native support
553
+ ⚠️ = Partial/alternative support
554
+ ❌ = Not available
555
+
556
+ ---
557
+
558
+ ## Implementation Priority
559
+
560
+ ### Phase 2A: Basic Integration
561
+ 1. Generate .windsurfrules (simple format)
562
+ 2. Generate .cursorrules (simple format)
563
+ 3. Generate copilot-instructions.md
564
+
565
+ ### Phase 2B: Advanced Features
566
+ 1. Windsurf memories
567
+ 2. Cursor custom modes
568
+ 3. VS Code custom chat modes
569
+
570
+ ### Phase 2C: Automation
571
+ 1. Windsurf workflows
572
+ 2. Cursor hooks
573
+ 3. VS Code tools API
574
+
575
+ ### Phase 2D: All Tools
576
+ 1. JetBrains
577
+ 2. Neovim
578
+ 3. Zed
package/CHANGELOG.md CHANGED
@@ -7,6 +7,121 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.0] - 2025-10-03
11
+
12
+ ### 🚀 MAJOR RELEASE: Quality-Based Progress Tracking & Resume Capability
13
+
14
+ This is a **paradigm shift** in how ADF CLI measures progress. Instead of counting questions, we now measure **information richness** - recognizing that 3 thorough answers can be worth more than 20 shallow ones.
15
+
16
+ ### Added
17
+
18
+ **Quality-Based Progress System:**
19
+ - Information Richness Score (0-100%) - weighted metric combining completion and quality
20
+ - Real-time answer quality analysis with 0-100 scoring
21
+ - Quality metrics tracking: word count, keywords, required elements, detail level, technical depth
22
+ - Automatic follow-up question skipping for high-quality answers (score >= 85)
23
+ - Quality feedback displayed to users after each answer
24
+
25
+ **Resume Capability:**
26
+ - Full session save/quit/resume from exact point of interruption
27
+ - Session Manager to detect and list resumable sessions
28
+ - User prompted to resume or start new on `adf init`
29
+ - All context preserved: answers, transcript, quality metrics, current block
30
+
31
+ **Triple-Redundant Auto-Save:**
32
+ - Main progress file: `_progress.json`
33
+ - Backup file: `_progress.backup.json`
34
+ - Append-only log: `_progress-log.md`
35
+ - Emergency fallback: `_emergency-{timestamp}.json` (if all else fails)
36
+ - Auto-save after every answer, block completion, and state change
37
+
38
+ **Comprehensive Testing:**
39
+ - 33 unit tests with 78% code coverage
40
+ - Test coverage: 78% statements, 63% branches, 77% functions, 79% lines
41
+ - Tests for quality analyzer, progress tracker, session manager
42
+ - Emergency recovery scenarios tested
43
+
44
+ **Project Documentation:**
45
+ - Complete `.project/` documentation structure
46
+ - Chat history tracking (current and completed)
47
+ - Architecture documentation (system design, data flow)
48
+ - Framework methodologies documentation
49
+ - Tool integrations specification
50
+ - Project vision and goals
51
+
52
+ ### New Files
53
+
54
+ - `lib/frameworks/answer-quality-analyzer.js` - Comprehensive quality scoring engine
55
+ - `lib/frameworks/progress-tracker.js` - Real-time progress with quality metrics
56
+ - `lib/frameworks/session-manager.js` - Session listing and resume prompts
57
+ - `tests/answer-quality-analyzer.test.js` - 16 unit tests
58
+ - `tests/progress-tracker.test.js` - 12 unit tests
59
+ - `tests/session-manager.test.js` - 5 unit tests
60
+ - `jest.config.js` - Jest testing configuration
61
+ - `.project/chats/` - Chat history tracking
62
+ - `.project/docs/` - Complete project documentation
63
+
64
+ ### Changed
65
+
66
+ **Interviewer Engine:**
67
+ - Integrated quality analyzer - evaluates every answer
68
+ - Auto-save after each answer with quality metrics
69
+ - Block start/complete/skip tracking
70
+ - Quality feedback display to users
71
+ - Smart follow-up skipping based on quality
72
+
73
+ **Init Command:**
74
+ - Session resume detection on startup
75
+ - Prompts user to resume or start new
76
+ - Framework parameter tracking for resume
77
+
78
+ **Progress Display:**
79
+ - Old: `"3/20 questions (15%)"`
80
+ - New: `"📊 Information Richness: ✨ 75% | Avg Quality: 82%"`
81
+ - Shows blocks, questions, words, and quality metrics
82
+ - Emoji indicators for richness levels (🌟 ✨ 💫 ⭐)
83
+
84
+ ### Quality Scoring System
85
+
86
+ **Metrics (0-100 total):**
87
+ - Word count: up to 30 points (50+ words = max)
88
+ - Keyword presence: up to 20 points
89
+ - Required elements: up to 25 points (platform, tech, user interaction, etc.)
90
+ - Detail level: up to 15 points (bullets, examples, multiple sentences)
91
+ - Technical depth: up to 10 points (tech stack, versions, tools)
92
+
93
+ **Thresholds:**
94
+ - Score >= 70: Comprehensive answer
95
+ - Score >= 85: Can skip follow-up questions
96
+
97
+ **Information Richness Formula:**
98
+ ```
99
+ informationRichness = (completionFactor * 0.4) + (qualityFactor * 0.6) * 100
100
+ ```
101
+ Weighted 60% toward quality, 40% toward completion.
102
+
103
+ ### Breaking Changes
104
+
105
+ None - fully backward compatible with v0.1.x
106
+
107
+ ### Technical Debt Addressed
108
+
109
+ - Bulletproof data persistence (zero data loss)
110
+ - Comprehensive error recovery
111
+ - Test coverage for core components
112
+ - Project documentation structure
113
+
114
+ ### Next Steps
115
+
116
+ - **Option B (Phase 2)**: IDE Tool Integrations
117
+ - Windsurf customizations (.windsurfrules, memories, workflows)
118
+ - Cursor customizations (.cursorrules, modes, MCP, hooks)
119
+ - VS Code customizations (copilot-instructions, chat modes, tools API)
120
+
121
+ ### Migration Guide
122
+
123
+ No migration needed. Existing sessions from v0.1.x will continue to work. New features will be available for new sessions created with v0.2.0.
124
+
10
125
  ## [0.1.6] - 2025-10-02
11
126
 
12
127
  ### Fixed
package/jest.config.js ADDED
@@ -0,0 +1,20 @@
1
+ module.exports = {
2
+ testEnvironment: 'node',
3
+ testMatch: ['**/tests/**/*.test.js'],
4
+ collectCoverageFrom: [
5
+ 'lib/frameworks/answer-quality-analyzer.js',
6
+ 'lib/frameworks/progress-tracker.js',
7
+ 'lib/frameworks/session-manager.js',
8
+ '!lib/**/*.test.js',
9
+ '!**/node_modules/**'
10
+ ],
11
+ coverageThreshold: {
12
+ global: {
13
+ branches: 60,
14
+ functions: 70,
15
+ lines: 70,
16
+ statements: 70
17
+ }
18
+ },
19
+ testTimeout: 10000
20
+ };