@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.
- package/.adf/feature-audit.md +208 -0
- package/.adf/final-summary.md +347 -0
- package/.adf/implementation-plan.md +244 -0
- package/.adf/implementation-progress.md +203 -0
- package/.adf/learning/answer-history.json +995 -0
- package/.adf/learning/config.json +25 -0
- package/.adf/learning/learned-rules.json +59 -0
- package/.adf/learning/patterns.json +277 -0
- package/.adf/learning/skip-history.json +1451 -0
- package/.adf/learning/stats.json +9 -0
- package/.claude/settings.local.json +12 -5
- package/CHANGELOG.md +110 -0
- package/CLAUDE.md +479 -0
- package/bin/adf.js +339 -1
- package/lib/ai/ai-client.js +161 -44
- package/lib/ai/ai-config.js +249 -105
- package/lib/commands/deploy.js +73 -6
- package/lib/generators/agents-md-generator.js +431 -161
- package/lib/generators/antigravity-generator.js +140 -0
- package/lib/generators/deepagent-generator.js +144 -0
- package/lib/generators/gemini-cli-generator.js +241 -0
- package/lib/generators/index.js +55 -0
- package/lib/generators/opencode-generator.js +153 -0
- package/lib/generators/zed-generator.js +252 -0
- package/lib/templates/shared/agents/architect.md +24 -24
- package/lib/templates/shared/agents/dev.md +25 -20
- package/lib/templates/shared/agents/pm.md +14 -4
- package/lib/templates/shared/agents/sm.md +18 -14
- package/lib/templates/shared/templates/openspec-delta.md +16 -0
- package/lib/templates/shared/templates/openspec-proposal.md +18 -0
- package/lib/templates/shared/templates/openspec-tasks.md +21 -0
- package/lib/utils/context-manager.js +484 -0
- package/package.json +6 -1
- package/tests/agents-md-generator.test.js +47 -10
|
@@ -2,15 +2,22 @@
|
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
4
|
"Bash(npm test:*)",
|
|
5
|
-
"Bash(
|
|
6
|
-
"Bash(npm publish)",
|
|
7
|
-
"mcp__archon__find_projects",
|
|
8
|
-
"mcp__archon__find_tasks",
|
|
5
|
+
"Bash(npm publish:*)",
|
|
9
6
|
"Bash(npm view:*)",
|
|
7
|
+
"Bash(npm config:*)",
|
|
10
8
|
"Bash(git add:*)",
|
|
11
9
|
"Bash(git commit:*)",
|
|
12
10
|
"Bash(git tag:*)",
|
|
13
|
-
"Bash(git push:*)"
|
|
11
|
+
"Bash(git push:*)",
|
|
12
|
+
"mcp__archon__find_projects",
|
|
13
|
+
"mcp__archon__find_tasks",
|
|
14
|
+
"Bash(adf doctor:*)",
|
|
15
|
+
"Bash(adf --help:*)",
|
|
16
|
+
"Bash(claude doctor)",
|
|
17
|
+
"WebFetch(domain:openrouter.ai)",
|
|
18
|
+
"WebFetch(domain:github.com)",
|
|
19
|
+
"WebFetch(domain:antigravity.google)",
|
|
20
|
+
"WebSearch"
|
|
14
21
|
],
|
|
15
22
|
"deny": [],
|
|
16
23
|
"ask": []
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,116 @@ All notable changes to `@iservu-inc/adf-cli` will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.12.0] - 2025-12-22
|
|
9
|
+
|
|
10
|
+
### 🎯 Agent-Native Development Framework (ANDF) Standard Implementation
|
|
11
|
+
|
|
12
|
+
**MAJOR FEATURE:** Complete implementation of the ANDF specification, bringing industry-standard AI agent configuration to ADF CLI with enhanced IDE support.
|
|
13
|
+
|
|
14
|
+
#### What's New
|
|
15
|
+
|
|
16
|
+
**AGENTS.md Standard Compliance:**
|
|
17
|
+
- **YAML Frontmatter** - Agent metadata with `name`, `description`, and `tools` fields
|
|
18
|
+
- **MCP Tools Configuration** - Model Context Protocol server integration (project_context, archon)
|
|
19
|
+
- **Structured Sections** - 8 ANDF-compliant sections for consistent AI agent guidance
|
|
20
|
+
- § 1: Operational Rules (High Priority)
|
|
21
|
+
- § 2: Build & Test Commands
|
|
22
|
+
- § 3: Project Structure
|
|
23
|
+
- § 4: Workflow Directives
|
|
24
|
+
- § 5-8: Framework-specific content (PRP/Balanced/BMAD)
|
|
25
|
+
- **Auto-Discovery** - Next-generation AI tools automatically detect and consume AGENTS.md
|
|
26
|
+
|
|
27
|
+
**.context/ Directory Support:**
|
|
28
|
+
- **Context Manager** - New utility for managing agent-accessible deep context
|
|
29
|
+
- **architecture.md** - Auto-generated system architecture from session outputs
|
|
30
|
+
- PRP: Extracts goal, context intelligence, and blueprint
|
|
31
|
+
- Balanced: Combines specification, plan, and constitution
|
|
32
|
+
- BMAD: Uses existing architecture or generates from PRD
|
|
33
|
+
- **glossary.md** - Automatically extracts domain terminology from interview transcripts
|
|
34
|
+
- **MCP Access** - Files accessible via Model Context Protocol filesystem server
|
|
35
|
+
|
|
36
|
+
**Zed Editor Support (NEW):**
|
|
37
|
+
- **Full Generator** - Complete Zed editor configuration generation
|
|
38
|
+
- **MCP Integration** - Context servers configured (project_context, archon)
|
|
39
|
+
- **Agent Configuration** - Model selection based on framework complexity
|
|
40
|
+
- Rapid: Claude Sonnet + Gemini Flash
|
|
41
|
+
- Balanced: Mixed models for optimization
|
|
42
|
+
- Comprehensive: Premium models (Claude Sonnet, Gemini Exp)
|
|
43
|
+
- **Keymap Support** - Agent switching shortcuts (Ctrl+Shift+A, Ctrl+Enter, etc.)
|
|
44
|
+
- **Symlink Strategy** - `.zed/rules -> ../AGENTS.md` (Unix/Mac) with Windows fallback
|
|
45
|
+
|
|
46
|
+
**Google Antigravity Support (NOW IMPLEMENTED):**
|
|
47
|
+
- **Full Generator** - Complete Antigravity agent configuration
|
|
48
|
+
- **YAML Configuration** - `.antigravity/agents.yaml` with AGENTS.md mount
|
|
49
|
+
- **File System Access** - Read-only access to AGENTS.md, .context/, and sessions
|
|
50
|
+
- **Security** - Excludes sensitive files (.env, node_modules, .git)
|
|
51
|
+
- **Smart System Prompt** - Instructs agent to read AGENTS.md immediately on startup
|
|
52
|
+
- **Model Selection** - Gemini models based on framework (Flash/Thinking/Exp)
|
|
53
|
+
|
|
54
|
+
#### Enhanced Features
|
|
55
|
+
|
|
56
|
+
**All Original IDE Support Maintained:**
|
|
57
|
+
- ✅ Windsurf - Full generator (unchanged)
|
|
58
|
+
- ✅ Cursor - Full generator (unchanged)
|
|
59
|
+
- ✅ VS Code / VS Code Insider - Full generator (unchanged)
|
|
60
|
+
- ✅ Kiro, Trae, Claude Code, Gemini CLI, Codex CLI - Generic configs (unchanged)
|
|
61
|
+
- ✅ **Zed** - NEW full generator
|
|
62
|
+
- ✅ **Antigravity** - NEW full generator (previously listed, now implemented)
|
|
63
|
+
|
|
64
|
+
**Deployment Enhancements:**
|
|
65
|
+
- `.context/` directory created automatically on all deployments
|
|
66
|
+
- AGENTS.md generated with ANDF compliance for all frameworks
|
|
67
|
+
- Architecture and glossary populated from interview data
|
|
68
|
+
- All 11 IDE tools supported with enhanced configurations
|
|
69
|
+
|
|
70
|
+
#### Technical Details
|
|
71
|
+
|
|
72
|
+
**New Files:**
|
|
73
|
+
- `lib/utils/context-manager.js` - Context directory management (500+ lines)
|
|
74
|
+
- `lib/generators/zed-generator.js` - Zed editor configurations (250+ lines)
|
|
75
|
+
- `lib/generators/antigravity-generator.js` - Antigravity configurations (150+ lines)
|
|
76
|
+
|
|
77
|
+
**Modified Files:**
|
|
78
|
+
- `lib/generators/agents-md-generator.js` - ANDF compliance implementation (~250 lines added)
|
|
79
|
+
- `lib/generators/index.js` - Export new generators
|
|
80
|
+
- `lib/commands/deploy.js` - Integrate context manager and new generators
|
|
81
|
+
- `tests/agents-md-generator.test.js` - Updated for ANDF format
|
|
82
|
+
|
|
83
|
+
**Documentation:**
|
|
84
|
+
- `CLAUDE.md` - Added comprehensive ANDF architecture section
|
|
85
|
+
- `.adf/feature-audit.md` - Feature comparison and gaps analysis
|
|
86
|
+
- `.adf/implementation-plan.md` - Implementation roadmap
|
|
87
|
+
- `.adf/final-summary.md` - Complete implementation summary
|
|
88
|
+
|
|
89
|
+
#### Keywords Added
|
|
90
|
+
- `zed` - Zed Editor support
|
|
91
|
+
- `antigravity` - Google Antigravity support
|
|
92
|
+
- `andf` - Agent-Native Development Framework
|
|
93
|
+
- `agents-md` - AGENTS.md standard
|
|
94
|
+
- `mcp` - Model Context Protocol
|
|
95
|
+
|
|
96
|
+
#### Backward Compatibility
|
|
97
|
+
- ✅ **100% Backward Compatible** - All changes are additive
|
|
98
|
+
- ✅ All existing IDE deployments continue to work
|
|
99
|
+
- ✅ No breaking changes to API or CLI commands
|
|
100
|
+
- ✅ Existing sessions and learning data unaffected
|
|
101
|
+
|
|
102
|
+
#### Upgrade Path
|
|
103
|
+
No migration needed. Simply upgrade and run:
|
|
104
|
+
```bash
|
|
105
|
+
npm update -g @iservu-inc/adf-cli
|
|
106
|
+
adf deploy <tool> # Now includes ANDF features
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Benefits
|
|
110
|
+
- **Industry Standard** - AGENTS.md follows emerging ANDF specification
|
|
111
|
+
- **Better AI Guidance** - Structured operational rules and workflow directives
|
|
112
|
+
- **Deep Context** - Architecture and terminology preserved for AI agents
|
|
113
|
+
- **Expanded IDE Support** - 11 total IDEs (2 new full generators)
|
|
114
|
+
- **MCP Ready** - Integrated with Model Context Protocol for next-gen tools
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
8
118
|
## [0.11.0] - 2025-11-04
|
|
9
119
|
|
|
10
120
|
### 📊 Learning Analytics Dashboard - Phase 6.2
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
ADF CLI (`@iservu-inc/adf-cli`) is a Node.js CLI tool for AgentDevFramework - an AI-assisted development framework that helps developers gather requirements through intelligent AI-guided interviews. It supports multiple AI providers (Anthropic, OpenAI, Google Gemini, OpenRouter) and deploys workflow configurations to various development tools (Windsurf, Cursor, VS Code, Claude Code, etc.).
|
|
8
|
+
|
|
9
|
+
**Key Features:**
|
|
10
|
+
- Multi-provider AI integration for intelligent requirements gathering
|
|
11
|
+
- Three workflow levels: Rapid (PRP), Balanced (Spec-Kit), Comprehensive (BMAD)
|
|
12
|
+
- Learning system that adapts to user preferences over time with pattern decay
|
|
13
|
+
- Dynamic question pipeline that extracts knowledge and reorders questions
|
|
14
|
+
- Smart question filtering based on project context
|
|
15
|
+
- Multi-IDE deployment support
|
|
16
|
+
- Session management with resume capability
|
|
17
|
+
- Analytics dashboard for learning system insights
|
|
18
|
+
|
|
19
|
+
## Development Commands
|
|
20
|
+
|
|
21
|
+
### Testing
|
|
22
|
+
```bash
|
|
23
|
+
# Run all tests with coverage
|
|
24
|
+
npm test
|
|
25
|
+
|
|
26
|
+
# Run tests in watch mode
|
|
27
|
+
npm run test:watch
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Test Configuration:**
|
|
31
|
+
- Tests located in `tests/` directory
|
|
32
|
+
- Test files use pattern `*.test.js`
|
|
33
|
+
- Jest configuration in `jest.config.js`
|
|
34
|
+
- Coverage thresholds: 60% branches, 70% functions/lines/statements
|
|
35
|
+
- Test timeout: 10 seconds
|
|
36
|
+
|
|
37
|
+
### Local Development
|
|
38
|
+
```bash
|
|
39
|
+
# Install dependencies
|
|
40
|
+
npm install
|
|
41
|
+
|
|
42
|
+
# Link globally for local testing
|
|
43
|
+
npm link
|
|
44
|
+
|
|
45
|
+
# Test CLI commands locally
|
|
46
|
+
adf init
|
|
47
|
+
adf config
|
|
48
|
+
adf deploy --list
|
|
49
|
+
adf update --check
|
|
50
|
+
|
|
51
|
+
# Unlink when done
|
|
52
|
+
npm unlink -g @iservu-inc/adf-cli
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Publishing
|
|
56
|
+
```bash
|
|
57
|
+
# Pre-publish validation runs automatically
|
|
58
|
+
npm publish
|
|
59
|
+
|
|
60
|
+
# Dry run to see what would be published
|
|
61
|
+
npm publish --dry-run
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Note:** The `prepublishOnly` script runs `lib/utils/pre-publish-check.js` to validate the package before publishing.
|
|
65
|
+
|
|
66
|
+
## Architecture
|
|
67
|
+
|
|
68
|
+
### Core System Flow
|
|
69
|
+
|
|
70
|
+
1. **Entry Point** (`bin/adf.js`)
|
|
71
|
+
- Commander.js-based CLI with 4 main commands: init, config, deploy, update
|
|
72
|
+
- Routes to command handlers in `lib/commands/`
|
|
73
|
+
|
|
74
|
+
2. **Commands** (`lib/commands/`)
|
|
75
|
+
- `init.js` - Initialize framework, detect project, start interview session
|
|
76
|
+
- `config.js` - Configure AI provider, analysis settings, learning system
|
|
77
|
+
- `deploy.js` - Deploy to development tools (Windsurf, Cursor, VS Code, etc.)
|
|
78
|
+
- `update.js` - Check for and install CLI updates
|
|
79
|
+
|
|
80
|
+
3. **Interview System** (`lib/frameworks/`)
|
|
81
|
+
- `interviewer.js` - Main interview orchestrator with AI integration
|
|
82
|
+
- `questions.js` - Framework-specific question definitions (PRP, Balanced, BMAD)
|
|
83
|
+
- `session-manager.js` - Session persistence and resume capability
|
|
84
|
+
- `progress-tracker.js` - Quality-based progress tracking
|
|
85
|
+
- `answer-quality-analyzer.js` - Real-time answer quality scoring
|
|
86
|
+
- `output-generators.js` - Generate PRD, specs, stories from answers
|
|
87
|
+
|
|
88
|
+
4. **AI Layer** (`lib/ai/`)
|
|
89
|
+
- `ai-client.js` - Unified interface for Anthropic, OpenAI, Google, OpenRouter
|
|
90
|
+
- `ai-config.js` - AI provider configuration and API key management
|
|
91
|
+
- `analysis-config.js` - Performance modes (Fast/Balanced/Comprehensive) and feature toggles
|
|
92
|
+
|
|
93
|
+
5. **Analysis Pipeline** (`lib/analysis/`)
|
|
94
|
+
- `dynamic-pipeline.js` - Orchestrates intelligent question system
|
|
95
|
+
- `answer-analyzer.js` - Extracts structured information from answers
|
|
96
|
+
- `knowledge-graph.js` - Builds knowledge graph from extracted info
|
|
97
|
+
- `question-mapper.js` - Maps knowledge to questions for filtering/reordering
|
|
98
|
+
|
|
99
|
+
6. **Learning System** (`lib/learning/`)
|
|
100
|
+
- `skip-tracker.js` - Tracks user skip behavior across sessions
|
|
101
|
+
- `pattern-detector.js` - Detects patterns in skip/answer history
|
|
102
|
+
- `decay-manager.js` - Applies time-based decay to pattern confidence
|
|
103
|
+
- `rule-generator.js` - Converts patterns to learned rules
|
|
104
|
+
- `learning-manager.js` - Orchestrates learning system operations
|
|
105
|
+
- `analytics.js` - Generates comprehensive analytics (680 lines)
|
|
106
|
+
- `analytics-view.js` - CLI dashboard for analytics visualization (530 lines)
|
|
107
|
+
- `analytics-exporter.js` - Export analytics to JSON/CSV (240 lines)
|
|
108
|
+
- `storage.js` - Persistent storage for learning data
|
|
109
|
+
|
|
110
|
+
7. **Filters & Analyzers** (`lib/filters/`, `lib/analyzers/`)
|
|
111
|
+
- `question-filter.js` - AI-powered smart filtering based on project context
|
|
112
|
+
- `project-analyzer.js` - Analyzes project type, tech stack, patterns
|
|
113
|
+
|
|
114
|
+
8. **Generators** (`lib/generators/`)
|
|
115
|
+
- `tool-config-generator.js` - Base class for IDE configuration generation
|
|
116
|
+
- `windsurf-generator.js` - Windsurf `.windsurfrules` generation
|
|
117
|
+
- `cursor-generator.js` - Cursor `.cursorrules` generation
|
|
118
|
+
- `vscode-generator.js` - VS Code `settings.json` generation
|
|
119
|
+
- `agents-md-generator.js` - Agent markdown file deployment
|
|
120
|
+
|
|
121
|
+
### Data Storage Structure
|
|
122
|
+
|
|
123
|
+
Projects using ADF CLI have this structure:
|
|
124
|
+
```
|
|
125
|
+
project-root/
|
|
126
|
+
├── .adf/ # Main ADF directory
|
|
127
|
+
│ ├── .env # API keys (gitignored)
|
|
128
|
+
│ ├── context.json # Workflow configuration
|
|
129
|
+
│ ├── analysis-config.json # AI analysis settings
|
|
130
|
+
│ ├── sessions/ # Interview sessions
|
|
131
|
+
│ │ └── {timestamp}_{workflow}/
|
|
132
|
+
│ │ ├── _metadata.json # Session metadata
|
|
133
|
+
│ │ ├── _progress.json # Progress state
|
|
134
|
+
│ │ ├── _transcript.json # Interview transcript
|
|
135
|
+
│ │ ├── knowledge-graph.json # Extracted knowledge
|
|
136
|
+
│ │ └── outputs/ # Generated docs (PRD, specs, etc.)
|
|
137
|
+
│ ├── learning/ # Learning system data
|
|
138
|
+
│ │ ├── skip-history.json # Skip events
|
|
139
|
+
│ │ ├── answer-history.json # Answer metadata
|
|
140
|
+
│ │ ├── patterns.json # Detected patterns
|
|
141
|
+
│ │ ├── learned-rules.json # Active rules
|
|
142
|
+
│ │ ├── config.json # Learning settings
|
|
143
|
+
│ │ └── stats.json # Statistics
|
|
144
|
+
│ └── shared/ # Framework templates & agents
|
|
145
|
+
│ ├── agents/ # Agent definitions (PM, Dev, QA, etc.)
|
|
146
|
+
│ ├── templates/ # PRP, BMAD, Spec-Kit templates
|
|
147
|
+
│ └── memory/ # Framework memory
|
|
148
|
+
└── .framework/ # Deployed to development tool
|
|
149
|
+
└── agents/ # Tool-specific agent files
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### AI Provider Integration
|
|
153
|
+
|
|
154
|
+
The `AIClient` class (`lib/ai/ai-client.js`) provides a unified interface across providers:
|
|
155
|
+
|
|
156
|
+
**Supported Providers:**
|
|
157
|
+
- `anthropic` - Claude models via `@anthropic-ai/sdk`
|
|
158
|
+
- `openai` - GPT models via `openai` SDK
|
|
159
|
+
- `google` - Gemini models via `@google/generative-ai`
|
|
160
|
+
- `openrouter` - 100+ models via OpenRouter (OpenAI-compatible API)
|
|
161
|
+
|
|
162
|
+
**Key Methods:**
|
|
163
|
+
- `sendMessage(prompt, options)` - Unified message interface
|
|
164
|
+
- Provider-specific methods: `anthropicRequest()`, `openaiRequest()`, `googleRequest()`, `openrouterRequest()`
|
|
165
|
+
|
|
166
|
+
**API Keys:**
|
|
167
|
+
- Stored in `.adf/.env` (never committed)
|
|
168
|
+
- Environment variables: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `OPENROUTER_API_KEY`
|
|
169
|
+
- Loaded via `loadEnvIntoProcess()` in `ai-config.js`
|
|
170
|
+
|
|
171
|
+
### Learning System Architecture
|
|
172
|
+
|
|
173
|
+
**Pattern Lifecycle:**
|
|
174
|
+
1. **Tracking** - `SkipTracker` records skip/answer events per session
|
|
175
|
+
2. **Detection** - `PatternDetector` analyzes history for consistent patterns (≥75% confidence, ≥3 sessions)
|
|
176
|
+
3. **Decay** - `DecayManager` applies exponential decay to inactive patterns
|
|
177
|
+
4. **Rules** - `RuleGenerator` converts high-confidence patterns to learned rules
|
|
178
|
+
5. **Application** - Rules auto-filter questions (with user approval)
|
|
179
|
+
6. **Analytics** - Dashboard visualizes performance and insights
|
|
180
|
+
|
|
181
|
+
**Pattern Types:**
|
|
182
|
+
- `consistent_skip` - Same question skipped repeatedly
|
|
183
|
+
- `category_pattern` - Most questions in category skipped
|
|
184
|
+
- `framework_pattern` - Framework-specific skip patterns
|
|
185
|
+
- `user_preference` - Answer style preferences
|
|
186
|
+
|
|
187
|
+
**Decay Algorithm:**
|
|
188
|
+
- Exponential decay: `newConfidence = currentConfidence * e^(-λt)`
|
|
189
|
+
- High confidence (≥90%): λ = 0.001 (slower decay)
|
|
190
|
+
- Medium confidence (75-89%): λ = 0.002
|
|
191
|
+
- Low confidence (<75%): λ = 0.005 (faster decay)
|
|
192
|
+
- User-approved patterns: decay at half rate
|
|
193
|
+
- Patterns <40% confidence or inactive 6+ months removed automatically
|
|
194
|
+
|
|
195
|
+
### Question Pipeline
|
|
196
|
+
|
|
197
|
+
The dynamic pipeline (`DynamicPipeline` class) orchestrates intelligent question flow:
|
|
198
|
+
|
|
199
|
+
1. **Answer Processing:**
|
|
200
|
+
- `AnswerAnalyzer` extracts structured info (tech stack, patterns, constraints)
|
|
201
|
+
- `KnowledgeGraph` stores extracted knowledge with confidence scores
|
|
202
|
+
- Saves knowledge graph to session for resume capability
|
|
203
|
+
|
|
204
|
+
2. **Question Filtering:**
|
|
205
|
+
- `QuestionMapper` maps knowledge items to relevant questions
|
|
206
|
+
- Questions auto-skipped when knowledge confidence ≥75%
|
|
207
|
+
- Reduces redundant questions dynamically
|
|
208
|
+
|
|
209
|
+
3. **Question Reordering:**
|
|
210
|
+
- Fundamental questions prioritized first
|
|
211
|
+
- Questions reordered based on extracted knowledge
|
|
212
|
+
- Ensures logical flow adapted to user's answers
|
|
213
|
+
|
|
214
|
+
**Performance Impact:**
|
|
215
|
+
- Fast Mode: All features disabled (~0.5s per answer)
|
|
216
|
+
- Balanced Mode: Quality + Filtering + Patterns (~2-3s per answer)
|
|
217
|
+
- Comprehensive Mode: All features enabled (~4-6s per answer)
|
|
218
|
+
|
|
219
|
+
### Workflow Levels
|
|
220
|
+
|
|
221
|
+
Three workflow tiers with different agents and templates:
|
|
222
|
+
|
|
223
|
+
**Level 1: Rapid (PRP)**
|
|
224
|
+
- Agents: dev, qa
|
|
225
|
+
- Templates: PRP story, PRP task
|
|
226
|
+
- Questions: 20 core questions
|
|
227
|
+
- Output: `prp.md` (single document)
|
|
228
|
+
|
|
229
|
+
**Level 2: Balanced (Spec-Kit)**
|
|
230
|
+
- Agents: analyst, pm, dev, qa
|
|
231
|
+
- Templates: Full PRP suite, spec templates
|
|
232
|
+
- Questions: 30+ questions
|
|
233
|
+
- Outputs: `constitution.md`, `specification.md`, `plan.md`, `tasks.md`
|
|
234
|
+
|
|
235
|
+
**Level 3: Comprehensive (BMAD)**
|
|
236
|
+
- Agents: analyst, pm, architect, sm, dev, qa
|
|
237
|
+
- Templates: Complete BMAD framework
|
|
238
|
+
- Questions: 40+ questions
|
|
239
|
+
- Outputs: `prd.md`, `architecture.md`, `stories.md`
|
|
240
|
+
|
|
241
|
+
### Deployment System
|
|
242
|
+
|
|
243
|
+
**Tool Generators:**
|
|
244
|
+
Each tool has a generator that transforms session outputs into tool-specific configs:
|
|
245
|
+
|
|
246
|
+
- **Windsurf** (`.windsurfrules`) - Single markdown file with all context
|
|
247
|
+
- **Cursor** (`.cursorrules`) - Single markdown file with all context
|
|
248
|
+
- **VS Code** (`settings.json`) - JSON with custom instructions and file attachments
|
|
249
|
+
- **Generic Tools** - Deploy agent markdown files to `.framework/agents/`
|
|
250
|
+
|
|
251
|
+
**Deployment Flow:**
|
|
252
|
+
1. Find latest completed session
|
|
253
|
+
2. Load session outputs (PRP/BMAD/Spec-Kit)
|
|
254
|
+
3. Generate tool-specific config
|
|
255
|
+
4. Write to project root (`.windsurfrules`, `.cursorrules`, etc.)
|
|
256
|
+
5. Copy agent files to `.framework/agents/` if needed
|
|
257
|
+
|
|
258
|
+
## Agent-Native Architecture & AGENTS.md Standard
|
|
259
|
+
|
|
260
|
+
### The Emerging Standard
|
|
261
|
+
|
|
262
|
+
`AGENTS.md` is emerging as the de-facto standard for "Agent-Native" repositories - a single, predictable manifest that next-generation AI development tools (GitHub Copilot, Cursor, Google Antigravity, Zed) are trained to look for automatically.
|
|
263
|
+
|
|
264
|
+
**Key Principles:**
|
|
265
|
+
- **Single Source of Truth** - One manifest file instead of scattered tool-specific configs
|
|
266
|
+
- **Manifest-Driven Architecture** - The `AGENTS.md` acts as "the kernel" that IDEs "mount" or "ingest"
|
|
267
|
+
- **Standardized Interface** - Predictable format replaces ad-hoc rule files
|
|
268
|
+
- **Auto-Discovery** - Tools automatically detect and consume the manifest
|
|
269
|
+
|
|
270
|
+
### Current ADF Architecture vs. AGENTS.md Pattern
|
|
271
|
+
|
|
272
|
+
**Current State (v0.11.0):**
|
|
273
|
+
```
|
|
274
|
+
project-root/
|
|
275
|
+
├── .windsurfrules # Tool-specific file
|
|
276
|
+
├── .cursorrules # Tool-specific file
|
|
277
|
+
├── .vscode/settings.json # Tool-specific file
|
|
278
|
+
└── .adf/ # Framework storage
|
|
279
|
+
├── sessions/
|
|
280
|
+
└── shared/
|
|
281
|
+
└── agents/ # Agent definitions
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Agent-Native Pattern:**
|
|
285
|
+
```
|
|
286
|
+
project-root/
|
|
287
|
+
├── AGENTS.md # [KERNEL] Single source of truth
|
|
288
|
+
├── .context/ # [DEEP STORAGE] Referenced by AGENTS.md
|
|
289
|
+
│ ├── memory/
|
|
290
|
+
│ │ ├── architecture.md
|
|
291
|
+
│ │ └── glossary.md
|
|
292
|
+
│ └── skills/ # Executable agent tools
|
|
293
|
+
├── .zed/
|
|
294
|
+
│ └── rules # SYMLINK -> ../AGENTS.md
|
|
295
|
+
├── .antigravity/
|
|
296
|
+
│ └── agents.yaml # Mounts AGENTS.md
|
|
297
|
+
└── .vscode/
|
|
298
|
+
└── settings.json # References AGENTS.md
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Relationship to ADF's `.adf/` Directory
|
|
302
|
+
|
|
303
|
+
The `.adf/` directory serves a different purpose than `AGENTS.md`:
|
|
304
|
+
|
|
305
|
+
**`.adf/` - Framework Internal Storage:**
|
|
306
|
+
- Interview sessions and transcripts
|
|
307
|
+
- Learning system data (patterns, rules, analytics)
|
|
308
|
+
- AI configuration and API keys
|
|
309
|
+
- Session-specific outputs (PRDs, specs, stories)
|
|
310
|
+
- This is ADF's "brain" - not meant for AI agent consumption
|
|
311
|
+
|
|
312
|
+
**`AGENTS.md` - Agent Manifest:**
|
|
313
|
+
- Operational rules and directives for AI assistants
|
|
314
|
+
- Build/test/deploy commands
|
|
315
|
+
- Project structure and conventions
|
|
316
|
+
- References to deep context (`.context/memory/`)
|
|
317
|
+
- This is what AI coding assistants read during development
|
|
318
|
+
|
|
319
|
+
### Potential Evolution Path
|
|
320
|
+
|
|
321
|
+
ADF CLI could evolve to support the AGENTS.md standard:
|
|
322
|
+
|
|
323
|
+
**Phase 1: Generate AGENTS.md Alongside Tool Configs**
|
|
324
|
+
- Keep current `.windsurfrules`, `.cursorrules` generation
|
|
325
|
+
- Additionally generate root-level `AGENTS.md` with consolidated rules
|
|
326
|
+
- Populate from session outputs and agent definitions
|
|
327
|
+
|
|
328
|
+
**Phase 2: AGENTS.md as Primary, Tool Configs Reference It**
|
|
329
|
+
- Generate `AGENTS.md` as the source of truth
|
|
330
|
+
- Tool-specific configs become thin wrappers that reference it
|
|
331
|
+
- Use symlinks for tools that support it (Zed: `.zed/rules -> ../AGENTS.md`)
|
|
332
|
+
|
|
333
|
+
**Phase 3: Standardized Context Structure**
|
|
334
|
+
- Move deep context to `.context/memory/` (architecture, glossary)
|
|
335
|
+
- Keep `.adf/` for ADF-internal data (sessions, learning)
|
|
336
|
+
- `AGENTS.md` references `.context/` for detailed info
|
|
337
|
+
|
|
338
|
+
### AGENTS.md Template Structure
|
|
339
|
+
|
|
340
|
+
Based on the emerging standard, an `AGENTS.md` should contain:
|
|
341
|
+
|
|
342
|
+
```markdown
|
|
343
|
+
---
|
|
344
|
+
name: Project Architect
|
|
345
|
+
description: Expert in [tech stack]
|
|
346
|
+
tools:
|
|
347
|
+
- name: archon
|
|
348
|
+
url: http://[mcp-server]/mcp
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
# AGENTS.md - The Agent Manifest
|
|
352
|
+
|
|
353
|
+
## 1. Operational Rules (High Priority)
|
|
354
|
+
- **Source of Truth**: Consult `.context/memory/architecture.md`
|
|
355
|
+
- **Security**: Never output `.env` secrets
|
|
356
|
+
- **Testing**: All changes must pass test suite
|
|
357
|
+
|
|
358
|
+
## 2. Build & Test Commands
|
|
359
|
+
- **Build**: npm run build
|
|
360
|
+
- **Test**: npm test
|
|
361
|
+
- **Lint**: npm run lint
|
|
362
|
+
|
|
363
|
+
## 3. Project Structure
|
|
364
|
+
- `/.context`: Deep memory and shared context
|
|
365
|
+
- `/src`: Application source code
|
|
366
|
+
- `/.adf`: Framework data (do not modify)
|
|
367
|
+
|
|
368
|
+
## 4. Workflow Directives
|
|
369
|
+
- **Commits**: Use Conventional Commits
|
|
370
|
+
- **Refactoring**: Prioritize readability
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Integration with MCP Servers
|
|
374
|
+
|
|
375
|
+
The AGENTS.md pattern works well with Model Context Protocol (MCP) servers:
|
|
376
|
+
|
|
377
|
+
**Context Servers Referenced in AGENTS.md:**
|
|
378
|
+
```yaml
|
|
379
|
+
tools:
|
|
380
|
+
- name: archon
|
|
381
|
+
url: http://archon.ad.iservu.cc:8051/mcp
|
|
382
|
+
description: Internal API documentation and RAG
|
|
383
|
+
- name: project_context
|
|
384
|
+
command: npx @modelcontextprotocol/server-filesystem
|
|
385
|
+
args: [".context"]
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
**IDE Configuration (Zed Example):**
|
|
389
|
+
```json
|
|
390
|
+
{
|
|
391
|
+
"context_servers": {
|
|
392
|
+
"archon": {
|
|
393
|
+
"url": "http://archon.ad.iservu.cc:8051/mcp"
|
|
394
|
+
},
|
|
395
|
+
"project_context": {
|
|
396
|
+
"command": "npx",
|
|
397
|
+
"args": ["@modelcontextprotocol/server-filesystem", ".context"]
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Implementation Considerations for ADF
|
|
404
|
+
|
|
405
|
+
When adding AGENTS.md support to ADF CLI:
|
|
406
|
+
|
|
407
|
+
1. **Preserve Backward Compatibility** - Continue supporting existing tool configs
|
|
408
|
+
2. **Opt-In Initially** - Make AGENTS.md generation optional via flag or config
|
|
409
|
+
3. **Smart Merging** - If user has existing `AGENTS.md`, merge ADF content intelligently
|
|
410
|
+
4. **Context Mapping** - Map `.adf/shared/memory/` to `.context/memory/` structure
|
|
411
|
+
5. **Template Customization** - Allow users to customize AGENTS.md template per project type
|
|
412
|
+
6. **Symlink Support** - Create symlinks for tools that support it (check OS compatibility)
|
|
413
|
+
|
|
414
|
+
### Future Direction
|
|
415
|
+
|
|
416
|
+
The industry is moving toward:
|
|
417
|
+
- **Standardized Manifests** - `AGENTS.md` as the universal entry point
|
|
418
|
+
- **MCP Integration** - Tools reference context via Model Context Protocol
|
|
419
|
+
- **Declarative Agent Behavior** - YAML/frontmatter for structured agent config
|
|
420
|
+
- **Tool Agnostic** - One manifest works across all AI coding assistants
|
|
421
|
+
|
|
422
|
+
ADF CLI is well-positioned to support this evolution while maintaining its core value: intelligent requirements gathering and workflow scaffolding.
|
|
423
|
+
|
|
424
|
+
## Important Patterns
|
|
425
|
+
|
|
426
|
+
### Session Resumption
|
|
427
|
+
- Sessions saved incrementally to `_progress.json`
|
|
428
|
+
- Graceful exit via Ctrl+C or typing "exit"
|
|
429
|
+
- Resume picks up from last answered question
|
|
430
|
+
- Knowledge graph and transcript preserved
|
|
431
|
+
|
|
432
|
+
### Error Handling
|
|
433
|
+
- AI requests wrapped in try/catch with descriptive errors
|
|
434
|
+
- File operations use `fs-extra` for atomic writes
|
|
435
|
+
- Graceful degradation when AI features disabled
|
|
436
|
+
- Configuration validation with auto-reset on corruption
|
|
437
|
+
|
|
438
|
+
### Configuration Validation
|
|
439
|
+
- AI config validates API keys and model availability
|
|
440
|
+
- Analysis config has sensible defaults (Balanced mode)
|
|
441
|
+
- Learning config has feature toggles and thresholds
|
|
442
|
+
- Auto-reset corrupted configs with user notification
|
|
443
|
+
|
|
444
|
+
### Testing Approach
|
|
445
|
+
- Unit tests for analyzers, generators, learning modules
|
|
446
|
+
- Mock AI client for deterministic testing
|
|
447
|
+
- Jest with 70% coverage threshold
|
|
448
|
+
- Test files mirror source structure (`tests/` directory)
|
|
449
|
+
|
|
450
|
+
## Key Constraints & Design Decisions
|
|
451
|
+
|
|
452
|
+
1. **No External Databases** - All data stored in JSON files in `.adf/` directory for portability
|
|
453
|
+
2. **Privacy First** - Learning data never leaves user's machine, all stored locally
|
|
454
|
+
3. **API Keys Security** - Never stored in session files, only in `.adf/.env` (gitignored)
|
|
455
|
+
4. **Provider Agnostic** - Unified AI interface allows easy provider switching
|
|
456
|
+
5. **Graceful Degradation** - All AI features can be disabled (Fast mode)
|
|
457
|
+
6. **Idempotent Deploys** - Deploying multiple times is safe (overwrites configs)
|
|
458
|
+
7. **Session Isolation** - Each interview session independent, supports multiple concurrent projects
|
|
459
|
+
|
|
460
|
+
## Agent Templates
|
|
461
|
+
|
|
462
|
+
Agent files in `lib/templates/shared/agents/` define AI agent behaviors:
|
|
463
|
+
- `analyst.md` - Business analyst (Balanced/BMAD)
|
|
464
|
+
- `architect.md` - Solutions architect (BMAD)
|
|
465
|
+
- `dev.md` - Developer (all workflows)
|
|
466
|
+
- `pm.md` - Product manager (Balanced/BMAD)
|
|
467
|
+
- `qa.md` - QA engineer (all workflows)
|
|
468
|
+
- `sm.md` - Scrum master (BMAD)
|
|
469
|
+
|
|
470
|
+
These are deployed to development tools as context for AI assistants.
|
|
471
|
+
|
|
472
|
+
## OpenSpec Templates
|
|
473
|
+
|
|
474
|
+
New OpenSpec templates added in v0.11.0+ for AI-driven change management:
|
|
475
|
+
- `openspec-proposal.md` - Change proposal template
|
|
476
|
+
- `openspec-delta.md` - Change impact analysis
|
|
477
|
+
- `openspec-tasks.md` - Implementation tasks
|
|
478
|
+
|
|
479
|
+
Located in `lib/templates/shared/templates/`.
|