@iservu-inc/adf-cli 0.10.0 → 0.12.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.
Files changed (40) 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 +10 -1
  12. package/.project/chats/current/SESSION-STATUS.md +102 -73
  13. package/.project/docs/ROADMAP.md +47 -32
  14. package/.project/docs/designs/LEARNING-ANALYTICS-DASHBOARD.md +1383 -0
  15. package/CHANGELOG.md +341 -0
  16. package/CLAUDE.md +479 -0
  17. package/README.md +7 -1
  18. package/lib/commands/deploy.js +42 -2
  19. package/lib/generators/agents-md-generator.js +431 -161
  20. package/lib/generators/antigravity-generator.js +140 -0
  21. package/lib/generators/index.js +22 -0
  22. package/lib/generators/zed-generator.js +252 -0
  23. package/lib/learning/analytics-exporter.js +241 -0
  24. package/lib/learning/analytics-view.js +508 -0
  25. package/lib/learning/analytics.js +681 -0
  26. package/lib/learning/learning-manager.js +19 -6
  27. package/lib/templates/shared/agents/architect.md +24 -24
  28. package/lib/templates/shared/agents/dev.md +25 -20
  29. package/lib/templates/shared/agents/pm.md +14 -4
  30. package/lib/templates/shared/agents/sm.md +18 -14
  31. package/lib/templates/shared/templates/openspec-delta.md +16 -0
  32. package/lib/templates/shared/templates/openspec-proposal.md +18 -0
  33. package/lib/templates/shared/templates/openspec-tasks.md +21 -0
  34. package/lib/utils/context-manager.js +484 -0
  35. package/package.json +6 -1
  36. package/scripts/generate-test-data.js +557 -0
  37. package/tests/agents-md-generator.test.js +47 -10
  38. package/tests/analytics-exporter.test.js +477 -0
  39. package/tests/analytics-view.test.js +466 -0
  40. package/tests/analytics.test.js +712 -0
@@ -4,6 +4,7 @@ const storage = require('./storage');
4
4
  const { analyzeSkipPatterns } = require('./skip-tracker');
5
5
  const { detectPatterns, getPatternSummary } = require('./pattern-detector');
6
6
  const { getActiveRules, toggleRule, removeRule } = require('./rule-generator');
7
+ const { showAnalyticsDashboard } = require('./analytics-view');
7
8
 
8
9
  /**
9
10
  * Learning Manager - CLI interface for managing learning data
@@ -70,9 +71,10 @@ class LearningManager {
70
71
  console.log(chalk.cyan(`│ 1. View Skip History`));
71
72
  console.log(chalk.cyan(`│ 2. Review Detected Patterns`));
72
73
  console.log(chalk.cyan(`│ 3. Manage Learned Rules`));
73
- console.log(chalk.cyan(`│ 4. Learning Settings ${config.enabled ? chalk.green('(✓ Enabled)') : chalk.yellow('(○ Disabled)')}`));
74
- console.log(chalk.cyan(`│ 5. Clear Learning Data`));
75
- console.log(chalk.cyan(`│ 6. Back to Main Menu`));
74
+ console.log(chalk.cyan(`│ 4. ${chalk.green('📊 Analytics Dashboard')} ${chalk.gray('(NEW)')}`));
75
+ console.log(chalk.cyan(`│ 5. Learning Settings ${config.enabled ? chalk.green('(✓ Enabled)') : chalk.yellow('(○ Disabled)')}`));
76
+ console.log(chalk.cyan(`│ 6. Clear Learning Data`));
77
+ console.log(chalk.cyan(`│ 7. Back to Main Menu`));
76
78
  console.log(chalk.cyan('│'));
77
79
  console.log(chalk.cyan.bold('└─────────────────────────────────────────────────────┘\n'));
78
80
 
@@ -85,9 +87,10 @@ class LearningManager {
85
87
  { name: '1. View Skip History', value: 'history' },
86
88
  { name: '2. Review Detected Patterns', value: 'patterns' },
87
89
  { name: '3. Manage Learned Rules', value: 'rules' },
88
- { name: '4. Learning Settings', value: 'settings' },
89
- { name: '5. Clear Learning Data', value: 'clear' },
90
- { name: '6. Back to Main Menu', value: 'back' }
90
+ { name: chalk.green('4. 📊 Analytics Dashboard') + chalk.gray(' (NEW)'), value: 'analytics' },
91
+ { name: '5. Learning Settings', value: 'settings' },
92
+ { name: '6. Clear Learning Data', value: 'clear' },
93
+ { name: '7. Back to Main Menu', value: 'back' }
91
94
  ]
92
95
  }
93
96
  ]);
@@ -102,6 +105,9 @@ class LearningManager {
102
105
  case 'rules':
103
106
  await this.manageRules();
104
107
  break;
108
+ case 'analytics':
109
+ await this.showAnalytics();
110
+ break;
105
111
  case 'settings':
106
112
  await this.manageSettings();
107
113
  break;
@@ -398,6 +404,13 @@ class LearningManager {
398
404
  await this.pressEnterToContinue();
399
405
  }
400
406
 
407
+ /**
408
+ * Show analytics dashboard
409
+ */
410
+ async showAnalytics() {
411
+ await showAnalyticsDashboard(this.projectPath);
412
+ }
413
+
401
414
  /**
402
415
  * Clear all learning data
403
416
  */
@@ -9,9 +9,12 @@ dependencies:
9
9
  templates:
10
10
  - architecture-template.md
11
11
  - tech-stack-template.md
12
+ - openspec-proposal.md
13
+ - openspec-delta.md
12
14
  tasks:
13
15
  - design-architecture.md
14
16
  - validate-tech-stack.md
17
+ - create-openspec-proposal.md
15
18
  data:
16
19
  - constitution.md
17
20
  - technical-preferences.md
@@ -222,32 +225,29 @@ Document all key decisions:
222
225
 
223
226
  ### Phase 6: Validation
224
227
 
225
- ```
226
- 1. Technical Feasibility
227
- - Can we build this?
228
- - Do we have the expertise?
229
- - Are there unknown unknowns?
228
+ ...
229
+
230
+ ## OpenSpec Brownfield Workflow
230
231
 
231
- 2. Performance Validation
232
- - Will it meet NFR performance targets?
233
- - Scalability headroom adequate?
234
- - Bottlenecks identified?
232
+ Use this workflow when modifying existing systems (1 -> n) to maintain a source of truth.
233
+
234
+ ```
235
+ 1. Initialize OpenSpec (if first time)
236
+ npx openspec init
235
237
 
236
- 3. Security Validation
237
- - OWASP Top 10 addressed?
238
- - Data protection adequate?
239
- - Compliance requirements met?
238
+ 2. Create Change Proposal
239
+ - Create directory: openspec/changes/<feature-name>/
240
+ - Create proposal.md using openspec-proposal.md template
241
+ - Create tasks.md using openspec-tasks.md template
240
242
 
241
- 4. Cost Validation
242
- - Infrastructure costs projected
243
- - Third-party service costs
244
- - Development effort estimated
243
+ 3. Create Spec Deltas
244
+ - Identify existing specs in openspec/specs/
245
+ - Create delta files in openspec/changes/<feature-name>/specs/
246
+ - Use ## ADDED / ## MODIFIED / ## REMOVED markers
245
247
 
246
- 5. Constitutional Compliance
247
- - Article 1: Spec-first
248
- - Article 3: Simplicity first
249
- - Article 8: Security by design ✓
250
- - Article 9: Performance as requirement ✓
248
+ 4. Review & Align
249
+ - Present proposal and deltas to the team/user
250
+ - Iterate based on feedback until agreed
251
251
  ```
252
252
 
253
253
  ## Architecture Patterns
@@ -553,5 +553,5 @@ Ready for SM to create stories.
553
553
  ---
554
554
 
555
555
  **Agent Version**: 1.0.0
556
- **Framework**: AgentDevFramework-Claude
557
- **Methodology**: BMAD-METHOD + Software Architecture Best Practices
556
+ **Framework**: AgentDevFramework
557
+ **Methodology**: BMAD-METHOD + Software Architecture Best Practices
@@ -9,9 +9,11 @@ dependencies:
9
9
  templates:
10
10
  - story-template.md
11
11
  - code-review-template.md
12
+ - openspec-tasks.md
12
13
  tasks:
13
14
  - implement-story.md
14
15
  - run-tests.md
16
+ - implement-openspec-change.md
15
17
  data:
16
18
  - constitution.md
17
19
  - technical-preferences.md
@@ -221,24 +223,27 @@ You are a Senior Full-Stack Developer focused on implementing features from deta
221
223
 
222
224
  ### Phase 4: Handoff
223
225
 
226
+ ...
227
+
228
+ ## OpenSpec Implementation Workflow
229
+
230
+ Use this when working on an OpenSpec change proposal.
231
+
224
232
  ```
225
- 1. Mark story as "Ready for QA"
226
- - Update story status
227
- - Add completion notes
228
-
229
- 2. Document any deviations from spec
230
- - Why deviation was necessary
231
- - Impact analysis
232
- - Approval obtained
233
-
234
- 3. Provide test evidence
235
- - Test coverage report
236
- - All tests passing
237
- - Performance benchmarks (if applicable)
238
-
239
- 4. Update progress tracking
240
- - Update sprint board
241
- - Notify team
233
+ 1. Load Change Context
234
+ - Read openspec/changes/<change>/proposal.md
235
+ - Review tasks.md for implementation steps
236
+ - Study spec deltas in openspec/changes/<change>/specs/
237
+
238
+ 2. Execute Tasks
239
+ - Follow the TDD process for each task
240
+ - Mark tasks as complete [x] in openspec/changes/<change>/tasks.md
241
+ - Save implementation decisions to mem0
242
+
243
+ 3. Finalize & Archive
244
+ - Ensure all deltas are satisfied
245
+ - Run: npx openspec archive <change>
246
+ - Verify specs in openspec/specs/ are updated
242
247
  ```
243
248
 
244
249
  ## Code Quality Standards
@@ -618,7 +623,7 @@ Before marking story complete:
618
623
 
619
624
  ## Remember
620
625
 
621
- You work from detailed story files with complete context. Your job is **disciplined execution**, not interpretation. When ambiguity exists, ask for clarification rather than assuming intent.
626
+ You work from detailed story files with complete context. Your job is **disciplined execution**, not interpretation. When ambiguity exists, ask for clarification rather than assuming intent.
622
627
 
623
628
  **Success Metrics**:
624
629
  - Tests pass on first QA review
@@ -630,5 +635,5 @@ You work from detailed story files with complete context. Your job is **discipli
630
635
  ---
631
636
 
632
637
  **Agent Version**: 1.0.0
633
- **Framework**: AgentDevFramework-Claude
634
- **Last Updated**: 2025-01-XX
638
+ **Framework**: AgentDevFramework
639
+ **Last Updated**: 2025-01-XX
@@ -10,10 +10,12 @@ dependencies:
10
10
  - prd-template.md
11
11
  - epic-template.md
12
12
  - user-story-template.md
13
+ - openspec-proposal.md
13
14
  tasks:
14
15
  - create-prd.md
15
16
  - define-epics.md
16
17
  - write-stories.md
18
+ - create-proposal.md
17
19
  data:
18
20
  - constitution.md
19
21
  - technical-preferences.md
@@ -48,7 +50,7 @@ You are a Product Manager focused on creating comprehensive Product Requirements
48
50
 
49
51
  ## Primary Responsibilities
50
52
 
51
- ### 1. PRD Creation
53
+ ### 1. PRD Creation (Path A: Greenfield)
52
54
 
53
55
  **Create comprehensive Product Requirements Document**:
54
56
  - Executive Summary
@@ -62,7 +64,15 @@ You are a Product Manager focused on creating comprehensive Product Requirements
62
64
  - Success Metrics
63
65
  - Out of Scope
64
66
 
65
- ### 2. Requirements Definition
67
+ ### 2. Change Proposal (Path B: OpenSpec)
68
+
69
+ **Create Change Proposal in `openspec/changes/<name>/proposal.md`**:
70
+ - **Why**: The problem or opportunity.
71
+ - **What**: The specific changes required.
72
+ - **Success**: How we know it worked.
73
+ - **Impact**: User impact analysis.
74
+
75
+ ### 3. Requirements Definition
66
76
 
67
77
  **Define clear, testable requirements**:
68
78
  - Functional Requirements (what the system does)
@@ -661,5 +671,5 @@ PRD complete. Ready for architect review.
661
671
  ---
662
672
 
663
673
  **Agent Version**: 1.0.0
664
- **Framework**: AgentDevFramework-Claude
665
- **Methodology**: BMAD-METHOD + Agile Best Practices
674
+ **Framework**: AgentDevFramework
675
+ **Methodology**: BMAD-METHOD + Agile Best Practices
@@ -9,10 +9,12 @@ dependencies:
9
9
  templates:
10
10
  - story-template.md
11
11
  - epic-shard-template.md
12
+ - openspec-tasks.md
12
13
  tasks:
13
14
  - draft-story.md
14
15
  - validate-story.md
15
16
  - coordinate-handoff.md
17
+ - create-openspec-tasks.md
16
18
  data:
17
19
  - constitution.md
18
20
  - prd.md
@@ -65,7 +67,7 @@ You are Samira, a Scrum Master focused on creating implementation-ready stories
65
67
 
66
68
  ## Story Creation Workflow
67
69
 
68
- ### Phase 1: Context Gathering
70
+ ### 1. Context Gathering (Path A: Greenfield)
69
71
 
70
72
  ```
71
73
  1. Read Planning Phase Outputs
@@ -73,21 +75,23 @@ You are Samira, a Scrum Master focused on creating implementation-ready stories
73
75
  - Architecture doc (from Architect)
74
76
  - Epic definition
75
77
  - Related stories
78
+ ```
76
79
 
77
- 2. Shard Epic if Needed
78
- - If epic > 40 story points: shard into smaller epics
79
- - Each shard: 20-40 points (1-2 weeks)
80
- - Save shards to epic-shards/{epic}-shard-{N}.md
80
+ ### 2. Task Breakdown (Path B: OpenSpec)
81
81
 
82
- 3. Query mem0 for Context
83
- /mem0 retrieve story context <epic>
84
- /mem0 retrieve implementation notes <feature>
82
+ ```
83
+ 1. Read Change Context
84
+ - Proposal (from PM) in `openspec/changes/<name>/proposal.md`
85
+ - Spec Deltas (from Architect) in `openspec/changes/<name>/specs/delta.md`
85
86
 
86
- 4. Use Context7 for Patterns
87
- @context7 <relevant technology>
87
+ 2. Create Implementation Tasks
88
+ - Create/Update `openspec/changes/<name>/tasks.md`
89
+ - Break down deltas into atomic TDD steps
90
+ - Ensure specific test guidance for each task
91
+ - Validate against Constitutional principles
88
92
  ```
89
93
 
90
- ### Phase 2: Story Drafting
94
+ ### 3. Story Drafting
91
95
 
92
96
  ```
93
97
  1. Story Structure
@@ -722,7 +726,7 @@ test('complete login flow', async () => {
722
726
  - [ ] Risk assessment included
723
727
  - [ ] Dependencies identified
724
728
  - [ ] Performance requirements defined
725
- - [ ] Security requirements included
729
+ - [ ] Security requirements defined
726
730
  - [ ] Definition of Done complete
727
731
  - [ ] Story points estimated
728
732
  - [ ] Constitutional compliance verified
@@ -780,5 +784,5 @@ Would you like me to:
780
784
  ---
781
785
 
782
786
  **Agent Version**: 1.0.0
783
- **Framework**: AgentDevFramework-Claude
784
- **Methodology**: BMAD-METHOD + Context Engineering + Agile Best Practices
787
+ **Framework**: AgentDevFramework
788
+ **Methodology**: BMAD-METHOD + Context Engineering + Agile Best Practices
@@ -0,0 +1,16 @@
1
+ # OpenSpec Delta: [Spec Name]
2
+
3
+ ## ➕ ADDED Requirements
4
+ ### Requirement: [Name]
5
+ Description using SHALL/MUST.
6
+ #### Scenario: [Context]
7
+ - WHEN [Action]
8
+ - THEN [Outcome]
9
+
10
+ ## 🔄 MODIFIED Requirements
11
+ ### Requirement: [Name]
12
+ *Original requirement reference*
13
+ Updated description.
14
+
15
+ ## ➖ REMOVED Requirements
16
+ - [Requirement Name]
@@ -0,0 +1,18 @@
1
+ # OpenSpec Change Proposal: [Feature Name]
2
+
3
+ ## 🎯 Purpose
4
+ Briefly describe WHY this change is needed and what problem it solves.
5
+
6
+ ## 📝 Proposed Changes
7
+ High-level summary of the functional changes.
8
+
9
+ ## 🗄️ Technical Approach
10
+ - Architecture decisions
11
+ - Impacted components
12
+ - New dependencies (if any)
13
+
14
+ ## 🚧 Verification Plan
15
+ - [ ] Syntax check
16
+ - [ ] Unit tests
17
+ - [ ] Integration tests
18
+ - [ ] Manual verification
@@ -0,0 +1,21 @@
1
+ # OpenSpec Implementation Tasks: [Feature Name]
2
+
3
+ ## 🛠️ Task Breakdown
4
+
5
+ ### Phase 1: Setup & Infrastructure
6
+ - [ ] 1.1 Task Description
7
+ - [ ] 1.2 Task Description
8
+
9
+ ### Phase 2: Implementation
10
+ - [ ] 2.1 Task Description
11
+ - [ ] 2.2 Task Description
12
+
13
+ ### Phase 3: Testing & Validation
14
+ - [ ] 3.1 Task Description
15
+ - [ ] 3.2 Task Description
16
+
17
+ ## ✅ Definition of Done
18
+ - All tasks marked complete
19
+ - Tests passing (>80% coverage)
20
+ - Documentation updated
21
+ - Change ready for archive