@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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,183 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.0] - 2025-10-03
11
+
12
+ ### šŸš€ MAJOR RELEASE: Tool Configuration Generators
13
+
14
+ This release adds comprehensive tool configuration generation for all major AI coding environments. The ADF CLI now automatically generates optimized configurations for Windsurf, Cursor, VS Code, and the universal AGENTS.md standard.
15
+
16
+ ### Added
17
+
18
+ **Universal Standard:**
19
+ - **AGENTS.md Generator** - Universal AI agent configuration standard
20
+ - Works with OpenAI Codex, Cursor, Windsurf, Google Gemini/Jules, Factory
21
+ - Supported by 20,000+ open-source projects
22
+ - Automatically generated from framework outputs (PRP, Balanced, BMAD)
23
+ - Nested file support for monorepos
24
+
25
+ **Windsurf (Codeium) Generator:**
26
+ - `.windsurfrules` - Legacy format with 12,000 character limit compliance
27
+ - `.windsurf/rules/` - Modern modular rules system
28
+ - `project-context.md` - Project overview and tech stack
29
+ - `architecture.md` - System architecture patterns
30
+ - `coding-standards.md` - Code style and best practices
31
+ - `.windsurf/workflows/` - Cascade AI workflows
32
+ - `review-requirements.md` - Requirements review workflow
33
+ - `implement-feature.md` - Feature implementation workflow (Balanced/BMAD)
34
+
35
+ **Cursor AI Generator:**
36
+ - `.cursor/rules` - Modern primary configuration format
37
+ - `.cursorrules` - Legacy deprecation notice with migration path
38
+ - `.cursor/mcp.json` - Model Context Protocol support (optional, prepared for future)
39
+ - Custom modes: architect, implementer, reviewer
40
+ - Framework-specific context and instructions
41
+
42
+ **VS Code Generator:**
43
+ - `.github/copilot-instructions.md` - GitHub Copilot instructions
44
+ - `.vscode/settings.json` - Custom chat modes
45
+ - Architect mode - Focus on system design
46
+ - Implementer mode - Feature implementation with TDD
47
+ - Reviewer mode - Code review against requirements
48
+ - Preserves existing settings while adding chat modes
49
+ - Language Model API integration ready
50
+
51
+ **Base Architecture:**
52
+ - `ToolConfigGenerator` - Base class with shared utilities
53
+ - Framework output loading (PRP, Balanced, BMAD)
54
+ - Section extraction and parsing
55
+ - Template variable substitution
56
+ - Project metadata detection
57
+
58
+ **Integration:**
59
+ - Enhanced `adf deploy` command to generate all configurations
60
+ - `adf deploy windsurf` - Generates Windsurf configs + AGENTS.md
61
+ - `adf deploy cursor` - Generates Cursor configs + AGENTS.md
62
+ - `adf deploy vscode` - Generates VS Code configs + AGENTS.md
63
+ - AGENTS.md always generated (universal standard)
64
+ - Automatic session detection and framework identification
65
+ - Error recovery with warning messages
66
+
67
+ **Comprehensive Testing:**
68
+ - 24 new unit tests for generators (57 total tests)
69
+ - Test coverage maintained at 78%
70
+ - Tests for all 3 frameworks (PRP, Balanced, BMAD)
71
+ - Tests for all 3 tool generators
72
+ - Template variable substitution tests
73
+ - File preservation tests (VS Code settings)
74
+
75
+ ### New Files
76
+
77
+ **Generators:**
78
+ - `lib/generators/tool-config-generator.js` - Base class for all generators
79
+ - `lib/generators/agents-md-generator.js` - Universal AGENTS.md standard
80
+ - `lib/generators/windsurf-generator.js` - Windsurf configuration generator
81
+ - `lib/generators/cursor-generator.js` - Cursor configuration generator
82
+ - `lib/generators/vscode-generator.js` - VS Code configuration generator
83
+ - `lib/generators/index.js` - Generator exports and unified API
84
+
85
+ **Tests:**
86
+ - `tests/agents-md-generator.test.js` - 5 tests for AGENTS.md
87
+ - `tests/windsurf-generator.test.js` - 7 tests for Windsurf
88
+ - `tests/cursor-generator.test.js` - 6 tests for Cursor
89
+ - `tests/vscode-generator.test.js` - 6 tests for VS Code
90
+
91
+ **Documentation:**
92
+ - `.project/docs/tool-integrations/RESEARCH-FINDINGS.md` - 500+ line research document
93
+ - `.project/docs/tool-integrations/IDE-CUSTOMIZATIONS.md` - Tool customization guide
94
+ - `.project/chats/current/2025-10-03_AGENTS-MD-AND-TOOL-GENERATORS.md` - Session documentation
95
+
96
+ ### Changed
97
+
98
+ **Deploy Command:**
99
+ - Enhanced to call tool-specific generators based on selected tool
100
+ - Added progress messages for each generation phase
101
+ - Improved error handling with graceful fallbacks
102
+ - Displays generated file counts and paths
103
+
104
+ **Framework Support:**
105
+ - All generators support PRP (Rapid) framework
106
+ - All generators support Balanced framework
107
+ - All generators support BMAD (Comprehensive) framework
108
+ - Automatic framework detection from session metadata
109
+
110
+ ### Generated File Structure
111
+
112
+ When running `adf deploy <tool>`, the following files are created:
113
+
114
+ **Always Generated:**
115
+ ```
116
+ AGENTS.md # Universal standard
117
+ ```
118
+
119
+ **Windsurf:**
120
+ ```
121
+ .windsurfrules # Legacy format
122
+ .windsurf/
123
+ ā”œā”€ā”€ rules/
124
+ │ ā”œā”€ā”€ project-context.md
125
+ │ ā”œā”€ā”€ architecture.md
126
+ │ └── coding-standards.md
127
+ └── workflows/
128
+ ā”œā”€ā”€ review-requirements.md
129
+ └── implement-feature.md # Balanced/BMAD only
130
+ ```
131
+
132
+ **Cursor:**
133
+ ```
134
+ .cursor/
135
+ ā”œā”€ā”€ rules # Primary config
136
+ └── mcp.json # Optional (prepared)
137
+ .cursorrules # Deprecation notice
138
+ ```
139
+
140
+ **VS Code:**
141
+ ```
142
+ .github/
143
+ └── copilot-instructions.md # GitHub Copilot
144
+ .vscode/
145
+ └── settings.json # Custom chat modes
146
+ ```
147
+
148
+ ### Technical Details
149
+
150
+ **Template Variables:**
151
+ - `PROJECT_NAME` - Project name from metadata
152
+ - `SESSION_ID` - Unique session identifier
153
+ - `FRAMEWORK` - rapid/balanced/comprehensive
154
+ - Framework-specific variables (PRP_GOAL, CONSTITUTION_PRINCIPLES, PRD_OVERVIEW, etc.)
155
+ - Automatic tech stack extraction
156
+ - Code style and testing approach detection
157
+
158
+ **Character Limits:**
159
+ - Windsurf rules: 12,000 characters per file (enforced via file splitting)
160
+ - Other tools: No enforced limits
161
+
162
+ **Context Awareness:**
163
+ - Architect mode: References architecture and specification
164
+ - Implementer mode: References implementation details and tasks
165
+ - Reviewer mode: References constitution and quality standards
166
+ - All modes: Full access to framework outputs via file paths
167
+
168
+ ### Breaking Changes
169
+
170
+ None - fully backward compatible with v0.2.x
171
+
172
+ ### Migration Guide
173
+
174
+ Existing projects can immediately benefit from the new generators:
175
+
176
+ 1. Run `adf deploy <tool>` in your project directory
177
+ 2. Configurations will be generated from existing `.adf/sessions/` data
178
+ 3. All tools will recognize and use the new configurations
179
+ 4. No manual migration needed
180
+
181
+ ### Next Steps
182
+
183
+ - **Phase 3**: Enhanced MCP integration for all tools
184
+ - **Phase 4**: Live project monitoring and real-time updates
185
+ - **Phase 5**: Multi-framework project support
186
+
10
187
  ## [0.2.0] - 2025-10-03
11
188
 
12
189
  ### šŸš€ MAJOR RELEASE: Quality-Based Progress Tracking & Resume Capability
@@ -2,6 +2,12 @@ const fs = require('fs-extra');
2
2
  const path = require('path');
3
3
  const chalk = require('chalk');
4
4
  const ora = require('ora');
5
+ const {
6
+ generateAgentsMd,
7
+ generateWindsurf,
8
+ generateCursor,
9
+ generateVSCode
10
+ } = require('../generators');
5
11
 
6
12
  const TOOLS = {
7
13
  windsurf: { name: 'Windsurf', configFile: '.windsurfrules' },
@@ -15,6 +21,60 @@ const TOOLS = {
15
21
  'codex-cli': { name: 'Codex CLI', configFile: '.codex/config.json' }
16
22
  };
17
23
 
24
+ /**
25
+ * Find the latest completed session
26
+ */
27
+ async function findLatestSession(cwd) {
28
+ const sessionsDir = path.join(cwd, '.adf', 'sessions');
29
+
30
+ if (!await fs.pathExists(sessionsDir)) {
31
+ return null;
32
+ }
33
+
34
+ const sessions = await fs.readdir(sessionsDir);
35
+ if (sessions.length === 0) {
36
+ return null;
37
+ }
38
+
39
+ // Find most recent session with outputs
40
+ let latestSession = null;
41
+ let latestTime = 0;
42
+
43
+ for (const sessionId of sessions) {
44
+ const sessionPath = path.join(sessionsDir, sessionId);
45
+ const outputsPath = path.join(sessionPath, 'outputs');
46
+
47
+ if (await fs.pathExists(outputsPath)) {
48
+ const stats = await fs.stat(sessionPath);
49
+ if (stats.mtimeMs > latestTime) {
50
+ latestTime = stats.mtimeMs;
51
+ latestSession = sessionPath;
52
+ }
53
+ }
54
+ }
55
+
56
+ return latestSession;
57
+ }
58
+
59
+ /**
60
+ * Get framework type from session metadata
61
+ */
62
+ async function getFrameworkFromSession(sessionPath) {
63
+ const metadataPath = path.join(sessionPath, '_metadata.json');
64
+ if (await fs.pathExists(metadataPath)) {
65
+ const metadata = await fs.readJson(metadataPath);
66
+ return metadata.framework;
67
+ }
68
+
69
+ const progressPath = path.join(sessionPath, '_progress.json');
70
+ if (await fs.pathExists(progressPath)) {
71
+ const progress = await fs.readJson(progressPath);
72
+ return progress.framework;
73
+ }
74
+
75
+ return 'balanced'; // Default fallback
76
+ }
77
+
18
78
  async function deployToTool(tool, options = {}) {
19
79
  const cwd = process.cwd();
20
80
  const adfDir = path.join(cwd, '.adf');
@@ -26,22 +86,80 @@ async function deployToTool(tool, options = {}) {
26
86
  process.exit(1);
27
87
  }
28
88
 
29
- // Read context to get workflow
89
+ // Find latest session
90
+ const sessionPath = await findLatestSession(cwd);
91
+ if (!sessionPath) {
92
+ console.error(chalk.red('\nāŒ Error: No completed sessions found.'));
93
+ console.log(chalk.yellow('Run "adf init" to create requirements first.\n'));
94
+ process.exit(1);
95
+ }
96
+
97
+ const framework = await getFrameworkFromSession(sessionPath);
98
+
99
+ // Read context to get workflow (legacy support)
30
100
  const contextPath = path.join(adfDir, 'context.json');
31
101
  let context = {};
32
102
  if (await fs.pathExists(contextPath)) {
33
103
  context = await fs.readJson(contextPath);
34
104
  }
35
105
 
36
- const workflow = context.workflow || 'balanced';
106
+ const workflow = framework || context.workflow || 'balanced';
37
107
 
38
- // Deploy logic (simplified - will be implemented based on actual deploy script)
39
108
  const spinner = options.silent ? null : ora(`Deploying to ${TOOLS[tool]?.name || tool}...`).start();
40
109
 
41
110
  try {
111
+ // Generate AGENTS.md (universal standard)
112
+ if (!options.silent) {
113
+ if (spinner) spinner.text = 'Generating AGENTS.md...';
114
+ }
115
+
116
+ try {
117
+ await generateAgentsMd(sessionPath, cwd, framework);
118
+ if (!options.silent && !spinner) {
119
+ console.log(chalk.green('āœ“ Generated AGENTS.md'));
120
+ }
121
+ } catch (error) {
122
+ console.warn(chalk.yellow(`\nāš ļø Warning: Could not generate AGENTS.md: ${error.message}`));
123
+ }
124
+
125
+ // Generate tool-specific configurations
126
+ if (spinner) spinner.text = `Generating ${TOOLS[tool]?.name || tool} configurations...`;
127
+
128
+ try {
129
+ let generatedFiles = {};
130
+
131
+ if (tool === 'windsurf') {
132
+ generatedFiles = await generateWindsurf(sessionPath, cwd, framework);
133
+ if (!options.silent && !spinner) {
134
+ console.log(chalk.green('āœ“ Generated Windsurf configurations'));
135
+ console.log(chalk.gray(` - .windsurfrules (legacy)`));
136
+ console.log(chalk.gray(` - .windsurf/rules/*.md (${generatedFiles.rules?.length || 0} files)`));
137
+ console.log(chalk.gray(` - .windsurf/workflows/*.md (${generatedFiles.workflows?.length || 0} files)`));
138
+ }
139
+ } else if (tool === 'cursor') {
140
+ generatedFiles = await generateCursor(sessionPath, cwd, framework);
141
+ if (!options.silent && !spinner) {
142
+ console.log(chalk.green('āœ“ Generated Cursor configurations'));
143
+ console.log(chalk.gray(` - .cursor/rules`));
144
+ console.log(chalk.gray(` - .cursorrules (deprecation notice)`));
145
+ }
146
+ } else if (tool === 'vscode' || tool === 'vscode-insider') {
147
+ generatedFiles = await generateVSCode(sessionPath, cwd, framework);
148
+ if (!options.silent && !spinner) {
149
+ console.log(chalk.green('āœ“ Generated VS Code configurations'));
150
+ console.log(chalk.gray(` - .github/copilot-instructions.md`));
151
+ console.log(chalk.gray(` - .vscode/settings.json (custom chat modes)`));
152
+ }
153
+ }
154
+ } catch (error) {
155
+ console.warn(chalk.yellow(`\nāš ļø Warning: Could not generate ${TOOLS[tool]?.name || tool} configurations: ${error.message}`));
156
+ }
157
+
42
158
  // Get agents based on workflow
43
159
  const agentsList = getAgentsForWorkflow(workflow);
44
160
 
161
+ if (spinner) spinner.text = `Deploying to ${TOOLS[tool]?.name || tool}...`;
162
+
45
163
  // Copy agents
46
164
  const agentsDir = path.join(cwd, '.framework', 'agents');
47
165
  await fs.ensureDir(agentsDir);
@@ -82,6 +200,7 @@ async function deployToTool(tool, options = {}) {
82
200
  }
83
201
 
84
202
  if (!options.silent) {
203
+ console.log(chalk.gray(` Generated: AGENTS.md (universal AI agent config)`));
85
204
  console.log(chalk.gray(` Agents: ${agentsList.join(', ')}`));
86
205
  console.log(chalk.gray(` Config: ${toolConfig?.configFile || 'N/A'}\n`));
87
206
  }