@iservu-inc/adf-cli 0.1.6 → 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.
Files changed (31) hide show
  1. package/.project/chats/complete/2025-10-03_ADF-CLI-QUALITY-BASED-PROGRESS-AND-RESUME.md +399 -0
  2. package/.project/chats/current/2025-10-03_AGENTS-MD-AND-TOOL-GENERATORS.md +699 -0
  3. package/.project/docs/architecture/SYSTEM-DESIGN.md +369 -0
  4. package/.project/docs/frameworks/FRAMEWORK-METHODOLOGIES.md +449 -0
  5. package/.project/docs/goals/PROJECT-VISION.md +112 -0
  6. package/.project/docs/tool-integrations/IDE-CUSTOMIZATIONS.md +578 -0
  7. package/.project/docs/tool-integrations/RESEARCH-FINDINGS.md +828 -0
  8. package/CHANGELOG.md +292 -0
  9. package/jest.config.js +20 -0
  10. package/lib/commands/deploy.js +122 -3
  11. package/lib/commands/init.js +41 -113
  12. package/lib/frameworks/answer-quality-analyzer.js +216 -0
  13. package/lib/frameworks/interviewer.js +447 -0
  14. package/lib/frameworks/output-generators.js +345 -0
  15. package/lib/frameworks/progress-tracker.js +239 -0
  16. package/lib/frameworks/questions.js +664 -0
  17. package/lib/frameworks/session-manager.js +100 -0
  18. package/lib/generators/agents-md-generator.js +388 -0
  19. package/lib/generators/cursor-generator.js +374 -0
  20. package/lib/generators/index.js +98 -0
  21. package/lib/generators/tool-config-generator.js +188 -0
  22. package/lib/generators/vscode-generator.js +403 -0
  23. package/lib/generators/windsurf-generator.js +596 -0
  24. package/package.json +10 -5
  25. package/tests/agents-md-generator.test.js +245 -0
  26. package/tests/answer-quality-analyzer.test.js +173 -0
  27. package/tests/cursor-generator.test.js +326 -0
  28. package/tests/progress-tracker.test.js +205 -0
  29. package/tests/session-manager.test.js +162 -0
  30. package/tests/vscode-generator.test.js +436 -0
  31. package/tests/windsurf-generator.test.js +320 -0
@@ -0,0 +1,100 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const chalk = require('chalk');
4
+ const inquirer = require('inquirer');
5
+
6
+ /**
7
+ * Session Manager
8
+ * Manages interview sessions - list, resume, delete
9
+ */
10
+
11
+ class SessionManager {
12
+ constructor(projectPath) {
13
+ this.projectPath = projectPath;
14
+ this.sessionsDir = path.join(projectPath, '.adf', 'sessions');
15
+ }
16
+
17
+ async listSessions() {
18
+ await fs.ensureDir(this.sessionsDir);
19
+ const sessions = await fs.readdir(this.sessionsDir);
20
+
21
+ const sessionDetails = [];
22
+
23
+ for (const sessionId of sessions) {
24
+ const sessionPath = path.join(this.sessionsDir, sessionId);
25
+ const progressFile = path.join(sessionPath, '_progress.json');
26
+
27
+ if (await fs.pathExists(progressFile)) {
28
+ const progress = await fs.readJson(progressFile);
29
+ sessionDetails.push({
30
+ sessionId,
31
+ sessionPath,
32
+ progress
33
+ });
34
+ }
35
+ }
36
+
37
+ return sessionDetails;
38
+ }
39
+
40
+ async getResumableSessions() {
41
+ const sessions = await this.listSessions();
42
+ return sessions.filter(s => s.progress.status === 'in-progress' && s.progress.canResume);
43
+ }
44
+
45
+ async promptToResume() {
46
+ const resumableSessions = await this.getResumableSessions();
47
+
48
+ if (resumableSessions.length === 0) {
49
+ return null; // No sessions to resume
50
+ }
51
+
52
+ console.log(chalk.cyan.bold('\nšŸ“‚ Found Previous Interview Sessions\n'));
53
+
54
+ const choices = resumableSessions.map(s => {
55
+ const framework = s.sessionId.split('_').pop();
56
+ const date = new Date(s.progress.lastUpdated).toLocaleString();
57
+ const completion = Math.round((s.progress.completedBlocks.length / s.progress.totalBlocks) * 100);
58
+
59
+ return {
60
+ name: `${framework.toUpperCase()} | ${date} | ${completion}% complete (${s.progress.totalQuestionsAnswered} questions)`,
61
+ value: s.sessionId,
62
+ short: s.sessionId
63
+ };
64
+ });
65
+
66
+ choices.push({
67
+ name: chalk.gray('Start a new interview'),
68
+ value: 'new',
69
+ short: 'New interview'
70
+ });
71
+
72
+ const { choice } = await inquirer.prompt([
73
+ {
74
+ type: 'list',
75
+ name: 'choice',
76
+ message: 'Resume previous interview or start new?',
77
+ choices
78
+ }
79
+ ]);
80
+
81
+ if (choice === 'new') {
82
+ return null;
83
+ }
84
+
85
+ const session = resumableSessions.find(s => s.sessionId === choice);
86
+ return session;
87
+ }
88
+
89
+ async deleteSession(sessionId) {
90
+ const sessionPath = path.join(this.sessionsDir, sessionId);
91
+ await fs.remove(sessionPath);
92
+ }
93
+
94
+ async deleteAllSessions() {
95
+ await fs.remove(this.sessionsDir);
96
+ await fs.ensureDir(this.sessionsDir);
97
+ }
98
+ }
99
+
100
+ module.exports = SessionManager;
@@ -0,0 +1,388 @@
1
+ const ToolConfigGenerator = require('./tool-config-generator');
2
+
3
+ /**
4
+ * Generator for AGENTS.md - Universal AI coding agent instructions
5
+ * Supported by: OpenAI Codex, Cursor, Windsurf, Google Jules, Factory, and more
6
+ *
7
+ * AGENTS.md is the industry standard open format for AI agent configuration
8
+ * See: https://agents.md/ and https://github.com/openai/agents.md
9
+ */
10
+ class AgentsMdGenerator extends ToolConfigGenerator {
11
+ /**
12
+ * Generate AGENTS.md from framework outputs
13
+ */
14
+ async generate() {
15
+ await this.initialize();
16
+
17
+ let content;
18
+ if (this.framework === 'rapid') {
19
+ content = this.generateFromPRP();
20
+ } else if (this.framework === 'balanced') {
21
+ content = this.generateFromBalanced();
22
+ } else if (this.framework === 'comprehensive') {
23
+ content = this.generateFromBMAD();
24
+ } else {
25
+ throw new Error(`Unknown framework: ${this.framework}`);
26
+ }
27
+
28
+ const filePath = await this.writeToProject('AGENTS.md', content);
29
+ return filePath;
30
+ }
31
+
32
+ /**
33
+ * Generate AGENTS.md from PRP framework
34
+ */
35
+ generateFromPRP() {
36
+ const projectName = this.getProjectName();
37
+ const sections = this.outputs.sections || {};
38
+
39
+ return `# ${projectName}
40
+
41
+ ## Overview
42
+
43
+ ${sections['1._goal_definition'] || sections['goal_definition'] || 'AI-powered software development project'}
44
+
45
+ ## Tech Stack
46
+
47
+ ${this.extractTechStack(sections)}
48
+
49
+ ## Build Commands
50
+
51
+ \`\`\`bash
52
+ # Install dependencies
53
+ npm install
54
+
55
+ # Build project
56
+ npm run build
57
+ \`\`\`
58
+
59
+ ## Test Commands
60
+
61
+ \`\`\`bash
62
+ # Run tests
63
+ npm test
64
+
65
+ # Run tests with coverage
66
+ npm run test:coverage
67
+ \`\`\`
68
+
69
+ ## Implementation Blueprint
70
+
71
+ ${sections['4._implementation_blueprint'] || sections['implementation_blueprint'] || ''}
72
+
73
+ ## Success Criteria
74
+
75
+ ${sections['5._validation'] || sections['validation'] || ''}
76
+
77
+ ## Development Workflow
78
+
79
+ 1. Review the goal and requirements
80
+ 2. Check the implementation blueprint
81
+ 3. Write tests first (if applicable)
82
+ 4. Implement feature following the blueprint
83
+ 5. Verify against success criteria
84
+ 6. Test thoroughly before committing
85
+
86
+ ## Key Context
87
+
88
+ All project requirements and context are documented in:
89
+ - Framework outputs: \`.adf/sessions/${this.getSessionId()}/outputs/\`
90
+ - Q&A responses: \`.adf/sessions/${this.getSessionId()}/qa-responses/\`
91
+
92
+ ## AI Agent Instructions
93
+
94
+ When working on this project:
95
+ 1. **Read the full context** in \`.adf/sessions/${this.getSessionId()}/outputs/prp.md\`
96
+ 2. **Follow the implementation blueprint** exactly as specified
97
+ 3. **Validate against success criteria** before marking tasks complete
98
+ 4. **Ask clarifying questions** if requirements are unclear
99
+ 5. **Maintain consistency** with the tech stack and architecture
100
+
101
+ ---
102
+
103
+ *Generated by [ADF CLI](https://www.npmjs.com/package/@iservu-inc/adf-cli) v${this.getADFVersion()}*
104
+ `;
105
+ }
106
+
107
+ /**
108
+ * Generate AGENTS.md from Balanced framework
109
+ */
110
+ generateFromBalanced() {
111
+ const projectName = this.getProjectName();
112
+ const constitution = this.outputs.constitution || '';
113
+ const specification = this.outputs.specification || '';
114
+ const plan = this.outputs.plan || '';
115
+
116
+ const principles = this.extractSection(constitution, 'Core Principles');
117
+ const constraints = this.extractSection(constitution, 'Constraints');
118
+ const architecture = this.extractSection(specification, 'Architecture');
119
+ const techStack = this.extractSection(plan, 'Technology Stack');
120
+
121
+ return `# ${projectName}
122
+
123
+ ## Overview
124
+
125
+ ${this.extractSection(specification, 'Overview') || this.extractSection(specification, 'Purpose')}
126
+
127
+ ## Constitution
128
+
129
+ ### Core Principles
130
+
131
+ ${principles || 'Follow best practices for software development'}
132
+
133
+ ### Constraints
134
+
135
+ ${constraints || 'No specific constraints defined'}
136
+
137
+ ## Tech Stack
138
+
139
+ ${techStack || 'See technical plan for details'}
140
+
141
+ ## Architecture
142
+
143
+ ${architecture || 'See specification.md for complete architecture'}
144
+
145
+ ## Build Commands
146
+
147
+ \`\`\`bash
148
+ # Install dependencies
149
+ npm install
150
+
151
+ # Build project
152
+ npm run build
153
+
154
+ # Run in development mode
155
+ npm run dev
156
+ \`\`\`
157
+
158
+ ## Test Commands
159
+
160
+ \`\`\`bash
161
+ # Run tests
162
+ npm test
163
+
164
+ # Run tests with coverage
165
+ npm run test:coverage
166
+
167
+ # Run linter
168
+ npm run lint
169
+ \`\`\`
170
+
171
+ ## Development Workflow
172
+
173
+ 1. Review the constitution and principles
174
+ 2. Check the specification for requirements
175
+ 3. Consult the technical plan for architecture decisions
176
+ 4. Review tasks.md for implementation breakdown
177
+ 5. Write tests first (TDD approach)
178
+ 6. Implement following architecture patterns
179
+ 7. Verify against acceptance criteria
180
+ 8. Run tests and linter before committing
181
+
182
+ ## Code Style
183
+
184
+ See technical plan for detailed coding standards.
185
+
186
+ **Key Points:**
187
+ - Follow the architecture patterns defined in specification.md
188
+ - Adhere to the constraints in constitution.md
189
+ - Implement tasks as outlined in tasks.md
190
+
191
+ ## Key Context Files
192
+
193
+ - **Constitution**: \`.adf/sessions/${this.getSessionId()}/outputs/constitution.md\` - Principles and constraints
194
+ - **Specification**: \`.adf/sessions/${this.getSessionId()}/outputs/specification.md\` - Detailed requirements
195
+ - **Technical Plan**: \`.adf/sessions/${this.getSessionId()}/outputs/plan.md\` - Architecture and decisions
196
+ - **Tasks**: \`.adf/sessions/${this.getSessionId()}/outputs/tasks.md\` - Implementation breakdown
197
+
198
+ ## AI Agent Instructions
199
+
200
+ When working on this project:
201
+
202
+ 1. **Read the constitution first** - Understand principles and constraints
203
+ 2. **Review the specification** - Know what needs to be built
204
+ 3. **Check the technical plan** - Follow architectural decisions
205
+ 4. **Reference tasks.md** - Understand implementation phases
206
+ 5. **Never violate constraints** - These are non-negotiable
207
+ 6. **Ask before deviating** - If architecture changes are needed
208
+ 7. **Maintain consistency** - With established patterns and decisions
209
+
210
+ ---
211
+
212
+ *Generated by [ADF CLI](https://www.npmjs.com/package/@iservu-inc/adf-cli) v${this.getADFVersion()}*
213
+ `;
214
+ }
215
+
216
+ /**
217
+ * Generate AGENTS.md from BMAD framework
218
+ */
219
+ generateFromBMAD() {
220
+ const projectName = this.getProjectName();
221
+ const prd = this.outputs.prd || '';
222
+ const architecture = this.outputs.architecture || '';
223
+
224
+ const overview = this.extractSection(prd, 'Executive Summary') ||
225
+ this.extractSection(prd, 'Overview');
226
+ const goals = this.extractSection(prd, 'Goals and Objectives');
227
+ const techRequirements = this.extractSection(prd, 'Technical Requirements') ||
228
+ this.extractSection(prd, 'Technical Architecture');
229
+ const archOverview = this.extractSection(architecture, 'System Overview') ||
230
+ this.extractSection(architecture, 'Architecture Overview');
231
+
232
+ return `# ${projectName}
233
+
234
+ ## Product Overview
235
+
236
+ ${overview || 'Comprehensive software development project'}
237
+
238
+ ## Goals and Objectives
239
+
240
+ ${goals || 'See PRD for detailed goals'}
241
+
242
+ ## Technical Requirements
243
+
244
+ ${techRequirements || 'See PRD for complete technical requirements'}
245
+
246
+ ## Architecture
247
+
248
+ ${archOverview || 'See architecture.md for complete system design'}
249
+
250
+ ## Build Commands
251
+
252
+ \`\`\`bash
253
+ # Install dependencies
254
+ npm install
255
+
256
+ # Build project
257
+ npm run build
258
+
259
+ # Run in development mode
260
+ npm run dev
261
+
262
+ # Run production build
263
+ npm run build:production
264
+ \`\`\`
265
+
266
+ ## Test Commands
267
+
268
+ \`\`\`bash
269
+ # Run all tests
270
+ npm test
271
+
272
+ # Run tests with coverage
273
+ npm run test:coverage
274
+
275
+ # Run integration tests
276
+ npm run test:integration
277
+
278
+ # Run e2e tests
279
+ npm run test:e2e
280
+
281
+ # Run linter
282
+ npm run lint
283
+ \`\`\`
284
+
285
+ ## Development Workflow
286
+
287
+ 1. Review the PRD (Product Requirements Document)
288
+ 2. Understand the system architecture
289
+ 3. Review relevant user stories
290
+ 4. Plan implementation approach
291
+ 5. Write tests first (TDD)
292
+ 6. Implement following architecture patterns
293
+ 7. Verify against acceptance criteria
294
+ 8. Run full test suite
295
+ 9. Create pull request with description
296
+
297
+ ## Code Quality Standards
298
+
299
+ - Maintain test coverage >= 80%
300
+ - Follow architectural patterns defined in architecture.md
301
+ - Implement user stories as specified in stories.md
302
+ - Write clean, maintainable, documented code
303
+ - Handle errors gracefully
304
+ - Consider scalability and performance
305
+
306
+ ## Key Context Files
307
+
308
+ - **PRD**: \`.adf/sessions/${this.getSessionId()}/outputs/prd.md\` - Complete product requirements
309
+ - **Architecture**: \`.adf/sessions/${this.getSessionId()}/outputs/architecture.md\` - System design and technical architecture
310
+ - **User Stories**: \`.adf/sessions/${this.getSessionId()}/outputs/stories.md\` - Detailed user stories with acceptance criteria
311
+
312
+ ## AI Agent Instructions
313
+
314
+ When working on this project:
315
+
316
+ 1. **Read the PRD thoroughly** - Understand the complete product vision
317
+ 2. **Study the architecture** - Know the system design and component structure
318
+ 3. **Review user stories** - Understand user needs and acceptance criteria
319
+ 4. **Follow architectural patterns** - Maintain consistency with established design
320
+ 5. **Implement with quality** - Tests, documentation, error handling
321
+ 6. **Think long-term** - Consider scalability, maintainability, performance
322
+ 7. **Validate against requirements** - Ensure implementation matches PRD
323
+ 8. **Ask before major changes** - Architectural decisions should be discussed
324
+
325
+ ## Security Notes
326
+
327
+ - Never commit sensitive data (API keys, passwords, tokens)
328
+ - Use environment variables for configuration
329
+ - Validate all user input
330
+ - Follow security best practices
331
+ - See PRD for specific security requirements
332
+
333
+ ## Performance Considerations
334
+
335
+ - Follow performance requirements in PRD
336
+ - Optimize critical paths
337
+ - Monitor resource usage
338
+ - See architecture.md for performance patterns
339
+
340
+ ---
341
+
342
+ *Generated by [ADF CLI](https://www.npmjs.com/package/@iservu-inc/adf-cli) v${this.getADFVersion()}*
343
+ `;
344
+ }
345
+
346
+ /**
347
+ * Extract tech stack from PRP sections
348
+ */
349
+ extractTechStack(sections) {
350
+ const contextualIntelligence = sections['3._contextual_intelligence'] ||
351
+ sections['contextual_intelligence'] || '';
352
+
353
+ // Look for tech stack mentions
354
+ const lines = contextualIntelligence.split('\n');
355
+ const techLines = [];
356
+ let inTechSection = false;
357
+
358
+ for (const line of lines) {
359
+ if (line.toLowerCase().includes('tech') ||
360
+ line.toLowerCase().includes('stack') ||
361
+ line.toLowerCase().includes('technology')) {
362
+ inTechSection = true;
363
+ }
364
+ if (inTechSection && line.trim()) {
365
+ techLines.push(line);
366
+ }
367
+ if (line.startsWith('##') && inTechSection && techLines.length > 0) {
368
+ break;
369
+ }
370
+ }
371
+
372
+ return techLines.length > 0 ? techLines.join('\n') : 'See framework outputs for tech stack details';
373
+ }
374
+
375
+ /**
376
+ * Get ADF CLI version
377
+ */
378
+ getADFVersion() {
379
+ try {
380
+ const packageJson = require('../../package.json');
381
+ return packageJson.version;
382
+ } catch (error) {
383
+ return '0.2.0';
384
+ }
385
+ }
386
+ }
387
+
388
+ module.exports = AgentsMdGenerator;