@iservu-inc/adf-cli 0.12.0 → 0.12.10

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,241 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const ToolConfigGenerator = require('./tool-config-generator');
4
+
5
+ /**
6
+ * Generator for Gemini CLI configurations
7
+ * Creates GEMINI.md with project-specific context
8
+ */
9
+ class GeminiCLIGenerator extends ToolConfigGenerator {
10
+ /**
11
+ * Generate Gemini CLI configuration
12
+ * @returns {Object} Generated file path
13
+ */
14
+ async generate() {
15
+ await this.initialize();
16
+
17
+ const geminiMdPath = path.join(this.projectPath, 'GEMINI.md');
18
+
19
+ // Generate GEMINI.md content
20
+ const content = await this.generateGeminiMd();
21
+
22
+ await fs.writeFile(geminiMdPath, content, 'utf-8');
23
+
24
+ return { config: geminiMdPath };
25
+ }
26
+
27
+ /**
28
+ * Generate GEMINI.md markdown content
29
+ */
30
+ async generateGeminiMd() {
31
+ const projectContext = await this.getProjectContext();
32
+ const frameworkContext = await this.getFrameworkContext();
33
+ const outputSummary = await this.getOutputSummary();
34
+
35
+ return `# GEMINI.md - Project Context for Gemini CLI
36
+
37
+ > Generated by ADF CLI v${this.getADFVersion()}
38
+ > Framework: **${this.getFrameworkName()}**
39
+ > Session: ${this.getSessionId()}
40
+
41
+ ---
42
+
43
+ ## 🎯 Project Overview
44
+
45
+ **${projectContext.name || 'Project'}**
46
+
47
+ ${projectContext.overview || 'AI-assisted development project using AgentDevFramework.'}
48
+
49
+ ## 📋 Role & Responsibilities
50
+
51
+ You are **${this.getAgentRole()}** for this project. Your responsibilities include:
52
+
53
+ - Understanding and implementing requirements from session outputs
54
+ - Following the ${this.framework} workflow methodology
55
+ - Maintaining code quality and test coverage
56
+ - Adhering to project structure and conventions
57
+
58
+ ## 🚀 Quick Reference
59
+
60
+ ### Build & Test Commands
61
+
62
+ \`\`\`bash
63
+ # Build
64
+ ${projectContext.buildCommand || 'npm run build'}
65
+
66
+ # Test
67
+ ${projectContext.testCommand || 'npm test'}
68
+
69
+ # Lint
70
+ ${projectContext.lintCommand || 'npm run lint'}
71
+ \`\`\`
72
+
73
+ ### Key Directories
74
+
75
+ - **Requirements**: \`.adf/sessions/${this.getSessionId()}/outputs/\`
76
+ - **Source**: \`${projectContext.sourceDir || 'src/'}\`
77
+ - **Tests**: \`${projectContext.testDir || 'tests/'}\`
78
+ - **Docs**: \`${projectContext.docsDir || 'docs/'}\`
79
+
80
+ ## 📚 Documentation Structure
81
+
82
+ ${this.getDocumentationStructure()}
83
+
84
+ ## 🎨 Workflow Level: ${this.framework.toUpperCase()}
85
+
86
+ ${this.getWorkflowDescription()}
87
+
88
+ ## ⚡ Key Requirements
89
+
90
+ ${frameworkContext.keyPoints || this.getDefaultRequirements()}
91
+
92
+ ## 🔧 Development Guidelines
93
+
94
+ ### Code Quality Standards
95
+
96
+ 1. **Testing**: All features must have corresponding tests
97
+ 2. **Documentation**: Public APIs must be documented
98
+ 3. **Type Safety**: Use TypeScript/JSDoc where applicable
99
+ 4. **Error Handling**: Gracefully handle edge cases
100
+ 5. **Security**: Never commit secrets or API keys
101
+
102
+ ### Commit Convention
103
+
104
+ Follow Conventional Commits:
105
+ - \`feat:\` - New features
106
+ - \`fix:\` - Bug fixes
107
+ - \`docs:\` - Documentation changes
108
+ - \`refactor:\` - Code refactoring
109
+ - \`test:\` - Test additions/changes
110
+ - \`chore:\` - Build/tooling changes
111
+
112
+ ### Code Review Checklist
113
+
114
+ - [ ] Tests pass (\`${projectContext.testCommand || 'npm test'}\`)
115
+ - [ ] Lint passes (\`${projectContext.lintCommand || 'npm run lint'}\`)
116
+ - [ ] Documentation updated
117
+ - [ ] No sensitive data in code
118
+ - [ ] Follows project structure
119
+
120
+ ## 🛡️ Security Considerations
121
+
122
+ - API keys stored in \`.adf/.env\` (gitignored)
123
+ - Never log sensitive information
124
+ - Validate all user inputs
125
+ - Follow OWASP security guidelines
126
+
127
+ ## 📖 Additional Context
128
+
129
+ For complete requirements and detailed specifications:
130
+ - Session outputs: \`.adf/sessions/${this.getSessionId()}/outputs/\`
131
+ - Framework shared resources: \`.adf/shared/\`
132
+ ${outputSummary ? `\n${outputSummary}` : ''}
133
+
134
+ ## 💡 Tips for Working with This Project
135
+
136
+ 1. **Read the requirements first** - Check session outputs before making changes
137
+ 2. **Follow the workflow level** - ${this.framework} has specific methodologies
138
+ 3. **Test thoroughly** - This project values quality over speed
139
+ 4. **Ask clarifying questions** - Better to ask than assume
140
+ 5. **Document as you go** - Future you will thank present you
141
+
142
+ ---
143
+
144
+ *This file is automatically generated and deployed by ADF CLI.*
145
+ *Manual modifications are preserved but may be overwritten on next deployment.*
146
+ `;
147
+ }
148
+
149
+ /**
150
+ * Get agent role based on framework
151
+ */
152
+ getAgentRole() {
153
+ const roles = {
154
+ 'rapid': 'Rapid Development Engineer',
155
+ 'balanced': 'Senior Software Engineer',
156
+ 'comprehensive': 'Principal Solutions Architect'
157
+ };
158
+ return roles[this.framework] || 'AI Coding Assistant';
159
+ }
160
+
161
+ /**
162
+ * Get workflow description
163
+ */
164
+ getWorkflowDescription() {
165
+ const descriptions = {
166
+ 'rapid': `**Rapid Development (PRP)** - Fast iteration with core features
167
+ - Quick prototyping and MVP development
168
+ - ~20 core questions during requirements gathering
169
+ - Focus on getting something working quickly
170
+ - Agents: Developer, QA`,
171
+
172
+ 'balanced': `**Balanced (Spec-Kit)** - Specification-driven development
173
+ - Standard project approach with detailed specs
174
+ - ~30+ questions for comprehensive requirements
175
+ - Balance between speed and thoroughness
176
+ - Agents: Analyst, PM, Developer, QA`,
177
+
178
+ 'comprehensive': `**BMAD Comprehensive** - Enterprise-grade development
179
+ - Full Business Model & Architecture Documentation
180
+ - ~40+ questions for complete understanding
181
+ - Detailed planning and architectural decisions
182
+ - Agents: Analyst, PM, Architect, SM, Developer, QA`
183
+ };
184
+ return descriptions[this.framework] || 'Standard development workflow';
185
+ }
186
+
187
+ /**
188
+ * Get documentation structure based on workflow
189
+ */
190
+ getDocumentationStructure() {
191
+ if (this.framework === 'rapid') {
192
+ return '- **PRP Document**: \`outputs/prp.md\` - Complete project requirements';
193
+ } else if (this.framework === 'balanced') {
194
+ return `- **Constitution**: \`outputs/constitution.md\` - Core principles
195
+ - **Specification**: \`outputs/specification.md\` - Technical specs
196
+ - **Plan**: \`outputs/plan.md\` - Development plan
197
+ - **Tasks**: \`outputs/tasks.md\` - Implementation tasks`;
198
+ } else {
199
+ return `- **PRD**: \`outputs/prd.md\` - Product Requirements Document
200
+ - **Architecture**: \`outputs/architecture.md\` - System design
201
+ - **Stories**: \`outputs/stories.md\` - User stories and epics`;
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Get default requirements
207
+ */
208
+ getDefaultRequirements() {
209
+ return `- Follow the ${this.framework} workflow methodology
210
+ - Maintain high code quality and test coverage
211
+ - Document all public APIs and complex logic
212
+ - Follow project structure and naming conventions
213
+ - Write meaningful commit messages`;
214
+ }
215
+
216
+ /**
217
+ * Get framework display name
218
+ */
219
+ getFrameworkName() {
220
+ const names = {
221
+ 'rapid': 'Rapid Development (PRP)',
222
+ 'balanced': 'Balanced (Specification-Driven)',
223
+ 'comprehensive': 'BMAD Comprehensive (Enterprise)'
224
+ };
225
+ return names[this.framework] || this.framework;
226
+ }
227
+
228
+ /**
229
+ * Get ADF CLI version
230
+ */
231
+ getADFVersion() {
232
+ try {
233
+ const packageJson = require('../../package.json');
234
+ return packageJson.version;
235
+ } catch (error) {
236
+ return '0.12.0';
237
+ }
238
+ }
239
+ }
240
+
241
+ module.exports = GeminiCLIGenerator;
@@ -9,6 +9,9 @@ const CursorGenerator = require('./cursor-generator');
9
9
  const VSCodeGenerator = require('./vscode-generator');
10
10
  const ZedGenerator = require('./zed-generator');
11
11
  const AntigravityGenerator = require('./antigravity-generator');
12
+ const OpenCodeGenerator = require('./opencode-generator');
13
+ const GeminiCLIGenerator = require('./gemini-cli-generator');
14
+ const DeepAgentGenerator = require('./deepagent-generator');
12
15
  const ToolConfigGenerator = require('./tool-config-generator');
13
16
 
14
17
  /**
@@ -102,6 +105,30 @@ async function generateAntigravity(sessionPath, projectPath, framework) {
102
105
  return await generator.generate();
103
106
  }
104
107
 
108
+ /**
109
+ * Generate OpenCode CLI configurations
110
+ */
111
+ async function generateOpenCode(sessionPath, projectPath, framework) {
112
+ const generator = new OpenCodeGenerator(sessionPath, projectPath, framework);
113
+ return await generator.generate();
114
+ }
115
+
116
+ /**
117
+ * Generate Gemini CLI configurations
118
+ */
119
+ async function generateGeminiCLI(sessionPath, projectPath, framework) {
120
+ const generator = new GeminiCLIGenerator(sessionPath, projectPath, framework);
121
+ return await generator.generate();
122
+ }
123
+
124
+ /**
125
+ * Generate DeepAgent (Abacus.ai) configurations
126
+ */
127
+ async function generateDeepAgent(sessionPath, projectPath, framework) {
128
+ const generator = new DeepAgentGenerator(sessionPath, projectPath, framework);
129
+ return await generator.generate();
130
+ }
131
+
105
132
  module.exports = {
106
133
  generateAll,
107
134
  generateAgentsMd,
@@ -110,11 +137,17 @@ module.exports = {
110
137
  generateVSCode,
111
138
  generateZed,
112
139
  generateAntigravity,
140
+ generateOpenCode,
141
+ generateGeminiCLI,
142
+ generateDeepAgent,
113
143
  AgentsMdGenerator,
114
144
  WindsurfGenerator,
115
145
  CursorGenerator,
116
146
  VSCodeGenerator,
117
147
  ZedGenerator,
118
148
  AntigravityGenerator,
149
+ OpenCodeGenerator,
150
+ GeminiCLIGenerator,
151
+ DeepAgentGenerator,
119
152
  ToolConfigGenerator
120
153
  };
@@ -0,0 +1,153 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const ToolConfigGenerator = require('./tool-config-generator');
4
+
5
+ /**
6
+ * Generator for OpenCode CLI configurations
7
+ * Creates .opencode.json with project-specific configuration
8
+ */
9
+ class OpenCodeGenerator extends ToolConfigGenerator {
10
+ /**
11
+ * Generate OpenCode configuration
12
+ * @returns {Object} Generated file path
13
+ */
14
+ async generate() {
15
+ await this.initialize();
16
+
17
+ const configPath = path.join(this.projectPath, '.opencode.json');
18
+
19
+ // Generate configuration
20
+ const config = await this.generateConfig();
21
+
22
+ await fs.writeJson(configPath, config, { spaces: 2 });
23
+
24
+ return { config: configPath };
25
+ }
26
+
27
+ /**
28
+ * Generate .opencode.json configuration
29
+ */
30
+ async generateConfig() {
31
+ const projectContext = await this.getProjectContext();
32
+ const frameworkContext = await this.getFrameworkContext();
33
+
34
+ return {
35
+ data: {
36
+ directory: ".opencode"
37
+ },
38
+ agents: {
39
+ coder: {
40
+ model: this.getCoderModel(),
41
+ maxTokens: 8000
42
+ },
43
+ task: {
44
+ model: this.getTaskModel(),
45
+ maxTokens: 4000
46
+ }
47
+ },
48
+ systemPrompt: this.generateSystemPrompt(projectContext, frameworkContext),
49
+ projectContext: {
50
+ framework: this.getFrameworkName(),
51
+ session: this.getSessionId(),
52
+ outputsPath: `.adf/sessions/${this.getSessionId()}/outputs/`
53
+ },
54
+ mcpServers: {
55
+ filesystem: {
56
+ command: "npx",
57
+ args: ["-y", "@modelcontextprotocol/server-filesystem", this.projectPath],
58
+ env: {}
59
+ }
60
+ },
61
+ debug: false,
62
+ autoCompact: true
63
+ };
64
+ }
65
+
66
+ /**
67
+ * Generate system prompt for OpenCode
68
+ */
69
+ generateSystemPrompt(projectContext, frameworkContext) {
70
+ const agentRole = this.getAgentRole();
71
+
72
+ return `You are ${agentRole} for the ${projectContext.name} project.
73
+
74
+ FRAMEWORK: ${this.getFrameworkName()}
75
+
76
+ PROJECT OVERVIEW:
77
+ ${projectContext.overview || 'AI-assisted development project'}
78
+
79
+ KEY REQUIREMENTS:
80
+ ${frameworkContext.keyPoints || '- Follow project structure\n- Maintain code quality\n- Write comprehensive tests'}
81
+
82
+ OPERATIONAL RULES:
83
+ 1. Read project documentation in .adf/sessions/${this.getSessionId()}/outputs/
84
+ 2. Follow the workflow level: ${this.framework}
85
+ 3. All code changes must pass tests
86
+ 4. Never commit secrets or API keys
87
+ 5. Follow conventional commits format
88
+
89
+ BUILD & TEST:
90
+ - Build: ${projectContext.buildCommand || 'npm run build'}
91
+ - Test: ${projectContext.testCommand || 'npm test'}
92
+ - Lint: ${projectContext.lintCommand || 'npm run lint'}
93
+
94
+ Generated by ADF CLI v${this.getADFVersion()}`;
95
+ }
96
+
97
+ /**
98
+ * Get agent role based on framework
99
+ */
100
+ getAgentRole() {
101
+ const roles = {
102
+ 'rapid': 'a Rapid Development Engineer',
103
+ 'balanced': 'a Senior Software Engineer',
104
+ 'comprehensive': 'a Principal Solutions Architect'
105
+ };
106
+ return roles[this.framework] || 'an AI Coding Assistant';
107
+ }
108
+
109
+ /**
110
+ * Get model for coder agent based on framework
111
+ */
112
+ getCoderModel() {
113
+ const models = {
114
+ 'rapid': 'anthropic/claude-3-5-sonnet-20241022',
115
+ 'balanced': 'anthropic/claude-sonnet-4-5-20250929',
116
+ 'comprehensive': 'anthropic/claude-opus-4-5-20251101'
117
+ };
118
+ return models[this.framework] || 'anthropic/claude-3-5-sonnet-20241022';
119
+ }
120
+
121
+ /**
122
+ * Get model for task agent
123
+ */
124
+ getTaskModel() {
125
+ return 'anthropic/claude-3-5-haiku-20241022';
126
+ }
127
+
128
+ /**
129
+ * Get framework display name
130
+ */
131
+ getFrameworkName() {
132
+ const names = {
133
+ 'rapid': 'Rapid Development (PRP)',
134
+ 'balanced': 'Balanced (Specification-Driven)',
135
+ 'comprehensive': 'BMAD Comprehensive (Enterprise)'
136
+ };
137
+ return names[this.framework] || this.framework;
138
+ }
139
+
140
+ /**
141
+ * Get ADF CLI version
142
+ */
143
+ getADFVersion() {
144
+ try {
145
+ const packageJson = require('../../package.json');
146
+ return packageJson.version;
147
+ } catch (error) {
148
+ return '0.12.0';
149
+ }
150
+ }
151
+ }
152
+
153
+ module.exports = OpenCodeGenerator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservu-inc/adf-cli",
3
- "version": "0.12.0",
3
+ "version": "0.12.10",
4
4
  "description": "CLI tool for AgentDevFramework - AI-assisted development framework with multi-provider AI support",
5
5
  "main": "index.js",
6
6
  "bin": {