@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,436 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const VSCodeGenerator = require('../lib/generators/vscode-generator');
4
+
5
+ const TEST_PROJECT_PATH = path.join(__dirname, 'test-project-vscode');
6
+ const TEST_SESSION_PATH = path.join(TEST_PROJECT_PATH, '.adf', 'sessions', 'test-session');
7
+
8
+ describe('VSCodeGenerator', () => {
9
+ beforeEach(async () => {
10
+ // Clean up test directories
11
+ await fs.remove(TEST_PROJECT_PATH);
12
+ await fs.ensureDir(TEST_PROJECT_PATH);
13
+ await fs.ensureDir(TEST_SESSION_PATH);
14
+ await fs.ensureDir(path.join(TEST_SESSION_PATH, 'outputs'));
15
+ });
16
+
17
+ afterEach(async () => {
18
+ // Clean up after tests
19
+ await fs.remove(TEST_PROJECT_PATH);
20
+ });
21
+
22
+ describe('PRP Framework', () => {
23
+ it('should generate VS Code configurations from PRP output', async () => {
24
+ // Create mock PRP output
25
+ const prpContent = `# Product Requirement Prompt (PRP)
26
+
27
+ ## 1. Goal Definition
28
+ Build a React dashboard that displays real-time analytics from PostgreSQL database.
29
+
30
+ ## 2. Business Justification
31
+ This will help users make data-driven decisions and improve productivity.
32
+
33
+ ## 3. Contextual Intelligence
34
+ ### Technology Stack
35
+ - Frontend: React 18, TypeScript
36
+ - Backend: Node.js, Express
37
+ - Database: PostgreSQL
38
+
39
+ ## 4. Implementation Blueprint
40
+ ### File Structure
41
+ - src/components/Dashboard/
42
+ - src/api/analytics/
43
+
44
+ ### Core Logic
45
+ 1. Fetch data from analytics API
46
+ 2. Process and aggregate
47
+ 3. Render charts
48
+
49
+ ## 5. Validation
50
+ ### Success Criteria
51
+ - Dashboard loads in <2s
52
+ - All charts render correctly
53
+ `;
54
+
55
+ await fs.writeFile(
56
+ path.join(TEST_SESSION_PATH, 'outputs', 'prp.md'),
57
+ prpContent,
58
+ 'utf-8'
59
+ );
60
+
61
+ // Create metadata
62
+ await fs.writeJson(path.join(TEST_SESSION_PATH, '_metadata.json'), {
63
+ framework: 'rapid',
64
+ projectName: 'Test Analytics Dashboard'
65
+ });
66
+
67
+ // Generate VS Code configs
68
+ const generator = new VSCodeGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
69
+ const generated = await generator.generate();
70
+
71
+ // Verify .github/copilot-instructions.md was created
72
+ const copilotPath = path.join(TEST_PROJECT_PATH, '.github', 'copilot-instructions.md');
73
+ expect(await fs.pathExists(copilotPath)).toBe(true);
74
+
75
+ const copilotContent = await fs.readFile(copilotPath, 'utf-8');
76
+ expect(copilotContent).toContain('Copilot Instructions for Test Analytics Dashboard');
77
+ expect(copilotContent).toContain('Project Overview');
78
+ expect(copilotContent).toContain('React dashboard');
79
+ expect(copilotContent).toContain('Tech Stack');
80
+ expect(copilotContent).toContain('Implementation Blueprint');
81
+ expect(copilotContent).toContain('Success Criteria');
82
+ expect(copilotContent).toContain('When Generating Code');
83
+ expect(copilotContent).toContain('.adf/sessions/test-session/outputs/prp.md');
84
+
85
+ // Verify .vscode/settings.json was created
86
+ const settingsPath = path.join(TEST_PROJECT_PATH, '.vscode', 'settings.json');
87
+ expect(await fs.pathExists(settingsPath)).toBe(true);
88
+
89
+ const settingsContent = await fs.readFile(settingsPath, 'utf-8');
90
+ const settings = JSON.parse(settingsContent);
91
+
92
+ expect(settings['github.copilot.chat.modes']).toBeDefined();
93
+ expect(settings['github.copilot.chat.modes'].architect).toBeDefined();
94
+ expect(settings['github.copilot.chat.modes'].implementer).toBeDefined();
95
+ expect(settings['github.copilot.chat.modes'].reviewer).toBeDefined();
96
+
97
+ // Verify architect mode
98
+ expect(settings['github.copilot.chat.modes'].architect.instructions).toContain('architecture');
99
+ expect(settings['github.copilot.chat.modes'].architect.context).toContain('.adf/sessions/test-session/outputs/prp.md');
100
+
101
+ // Verify generated structure
102
+ expect(generated.copilot).toHaveLength(1);
103
+ expect(generated.vscode).toHaveLength(1);
104
+ });
105
+ });
106
+
107
+ describe('Balanced Framework', () => {
108
+ it('should generate VS Code configurations from Balanced outputs', async () => {
109
+ // Create mock outputs
110
+ const constitutionContent = `# Constitution
111
+
112
+ ## Core Principles
113
+ 1. User privacy is paramount
114
+ 2. Performance over features
115
+
116
+ ## Constraints
117
+ - No third-party analytics
118
+ - WCAG 2.1 AA compliance
119
+ `;
120
+
121
+ const specificationContent = `# Specification
122
+
123
+ ## Overview
124
+ A comprehensive user management system.
125
+
126
+ ## Purpose
127
+ Manage users across multiple tenants.
128
+
129
+ ## Architecture
130
+ Microservices architecture with API gateway.
131
+ `;
132
+
133
+ const planContent = `# Technical Plan
134
+
135
+ ## Technology Stack
136
+ - React 18
137
+ - Node.js 20
138
+ - PostgreSQL 15
139
+
140
+ ## Code Style
141
+ - Use TypeScript strict mode
142
+ - Follow Airbnb style guide
143
+
144
+ ## Coding Standards
145
+ - Write tests first
146
+ - Document public APIs
147
+
148
+ ## Testing
149
+ - Unit tests with Jest
150
+ - E2E tests with Playwright
151
+ `;
152
+
153
+ await fs.writeFile(
154
+ path.join(TEST_SESSION_PATH, 'outputs', 'constitution.md'),
155
+ constitutionContent,
156
+ 'utf-8'
157
+ );
158
+
159
+ await fs.writeFile(
160
+ path.join(TEST_SESSION_PATH, 'outputs', 'specification.md'),
161
+ specificationContent,
162
+ 'utf-8'
163
+ );
164
+
165
+ await fs.writeFile(
166
+ path.join(TEST_SESSION_PATH, 'outputs', 'plan.md'),
167
+ planContent,
168
+ 'utf-8'
169
+ );
170
+
171
+ await fs.writeJson(path.join(TEST_SESSION_PATH, '_metadata.json'), {
172
+ framework: 'balanced',
173
+ projectName: 'User Management System'
174
+ });
175
+
176
+ // Generate VS Code configs
177
+ const generator = new VSCodeGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'balanced');
178
+ await generator.generate();
179
+
180
+ // Verify .github/copilot-instructions.md
181
+ const copilotPath = path.join(TEST_PROJECT_PATH, '.github', 'copilot-instructions.md');
182
+ const copilotContent = await fs.readFile(copilotPath, 'utf-8');
183
+
184
+ expect(copilotContent).toContain('User Management System');
185
+ expect(copilotContent).toContain('Core Principles');
186
+ expect(copilotContent).toContain('User privacy is paramount');
187
+ expect(copilotContent).toContain('Constraints (Non-Negotiable)');
188
+ expect(copilotContent).toContain('WCAG 2.1 AA compliance');
189
+ expect(copilotContent).toContain('Microservices architecture');
190
+ expect(copilotContent).toContain('Code Standards');
191
+ expect(copilotContent).toContain('Testing Requirements');
192
+ expect(copilotContent).toContain('constitution.md');
193
+ expect(copilotContent).toContain('specification.md');
194
+ expect(copilotContent).toContain('plan.md');
195
+
196
+ // Verify .vscode/settings.json has balanced-specific context
197
+ const settingsContent = await fs.readFile(
198
+ path.join(TEST_PROJECT_PATH, '.vscode', 'settings.json'),
199
+ 'utf-8'
200
+ );
201
+ const settings = JSON.parse(settingsContent);
202
+
203
+ const architectContext = settings['github.copilot.chat.modes'].architect.context.join(' ');
204
+ const implementerContext = settings['github.copilot.chat.modes'].implementer.context.join(' ');
205
+ const reviewerContext = settings['github.copilot.chat.modes'].reviewer.context.join(' ');
206
+
207
+ expect(architectContext).toContain('specification.md');
208
+ expect(architectContext).toContain('plan.md');
209
+ expect(implementerContext).toContain('specification.md');
210
+ expect(implementerContext).toContain('tasks.md');
211
+ expect(reviewerContext).toContain('constitution.md');
212
+ });
213
+ });
214
+
215
+ describe('BMAD Framework', () => {
216
+ it('should generate VS Code configurations from BMAD outputs', async () => {
217
+ // Create mock outputs
218
+ const prdContent = `# Product Requirements Document
219
+
220
+ ## Executive Summary
221
+ A complete e-commerce platform for small businesses.
222
+
223
+ ## Goals and Objectives
224
+ - Enable online sales
225
+ - Provide analytics
226
+
227
+ ## Technical Requirements
228
+ - RESTful API
229
+ - Payment gateway integration
230
+ - Secure checkout flow
231
+
232
+ ## Security
233
+ - PCI DSS compliance
234
+ - Data encryption at rest and in transit
235
+
236
+ ## Performance
237
+ - Sub-100ms response times
238
+ - Handle 10,000 concurrent users
239
+ `;
240
+
241
+ const architectureContent = `# System Architecture
242
+
243
+ ## System Overview
244
+ Modular monolith architecture with separate domains.
245
+
246
+ ## Architecture Overview
247
+ Clean architecture with domain-driven design.
248
+
249
+ ## Components
250
+ - Order Management
251
+ - Inventory System
252
+ - Payment Processing
253
+ `;
254
+
255
+ await fs.writeFile(
256
+ path.join(TEST_SESSION_PATH, 'outputs', 'prd.md'),
257
+ prdContent,
258
+ 'utf-8'
259
+ );
260
+
261
+ await fs.writeFile(
262
+ path.join(TEST_SESSION_PATH, 'outputs', 'architecture.md'),
263
+ architectureContent,
264
+ 'utf-8'
265
+ );
266
+
267
+ await fs.writeJson(path.join(TEST_SESSION_PATH, '_metadata.json'), {
268
+ framework: 'comprehensive',
269
+ projectName: 'E-commerce Platform'
270
+ });
271
+
272
+ // Generate VS Code configs
273
+ const generator = new VSCodeGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'comprehensive');
274
+ await generator.generate();
275
+
276
+ // Verify .github/copilot-instructions.md
277
+ const copilotPath = path.join(TEST_PROJECT_PATH, '.github', 'copilot-instructions.md');
278
+ const copilotContent = await fs.readFile(copilotPath, 'utf-8');
279
+
280
+ expect(copilotContent).toContain('E-commerce Platform');
281
+ expect(copilotContent).toContain('Product Overview');
282
+ expect(copilotContent).toContain('e-commerce platform');
283
+ expect(copilotContent).toContain('Goals and Objectives');
284
+ expect(copilotContent).toContain('Enable online sales');
285
+ expect(copilotContent).toContain('Technical Requirements');
286
+ expect(copilotContent).toContain('System Architecture');
287
+ expect(copilotContent).toContain('Security Requirements');
288
+ expect(copilotContent).toContain('PCI DSS compliance');
289
+ expect(copilotContent).toContain('Performance Considerations');
290
+ expect(copilotContent).toContain('Sub-100ms response times');
291
+ expect(copilotContent).toContain('prd.md');
292
+ expect(copilotContent).toContain('architecture.md');
293
+
294
+ // Verify .vscode/settings.json has BMAD-specific context
295
+ const settingsContent = await fs.readFile(
296
+ path.join(TEST_PROJECT_PATH, '.vscode', 'settings.json'),
297
+ 'utf-8'
298
+ );
299
+ const settings = JSON.parse(settingsContent);
300
+
301
+ const architectContext = settings['github.copilot.chat.modes'].architect.context.join(' ');
302
+ const implementerContext = settings['github.copilot.chat.modes'].implementer.context.join(' ');
303
+
304
+ expect(architectContext).toContain('architecture.md');
305
+ expect(architectContext).toContain('prd.md');
306
+ expect(implementerContext).toContain('stories.md');
307
+ });
308
+ });
309
+
310
+ describe('Settings.json Enhancement', () => {
311
+ it('should preserve existing settings when enhancing .vscode/settings.json', async () => {
312
+ // Create existing settings.json
313
+ const existingSettings = {
314
+ 'editor.formatOnSave': true,
315
+ 'editor.tabSize': 2,
316
+ 'files.exclude': {
317
+ '**/.git': true
318
+ }
319
+ };
320
+
321
+ await fs.ensureDir(path.join(TEST_PROJECT_PATH, '.vscode'));
322
+ await fs.writeJson(
323
+ path.join(TEST_PROJECT_PATH, '.vscode', 'settings.json'),
324
+ existingSettings,
325
+ { spaces: 2 }
326
+ );
327
+
328
+ // Create PRP
329
+ const prpContent = '# PRP\n\n## 1. Goal Definition\nTest project';
330
+ await fs.writeFile(
331
+ path.join(TEST_SESSION_PATH, 'outputs', 'prp.md'),
332
+ prpContent,
333
+ 'utf-8'
334
+ );
335
+
336
+ // Generate VS Code configs
337
+ const generator = new VSCodeGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
338
+ await generator.generate();
339
+
340
+ // Verify existing settings are preserved
341
+ const settingsContent = await fs.readFile(
342
+ path.join(TEST_PROJECT_PATH, '.vscode', 'settings.json'),
343
+ 'utf-8'
344
+ );
345
+ const settings = JSON.parse(settingsContent);
346
+
347
+ expect(settings['editor.formatOnSave']).toBe(true);
348
+ expect(settings['editor.tabSize']).toBe(2);
349
+ expect(settings['files.exclude']).toEqual({ '**/.git': true });
350
+ expect(settings['github.copilot.chat.modes']).toBeDefined();
351
+ });
352
+ });
353
+
354
+ describe('Custom Chat Modes', () => {
355
+ it('should create architect, implementer, and reviewer modes', async () => {
356
+ const prpContent = '# PRP\n\n## 1. Goal Definition\nTest project';
357
+ await fs.writeFile(
358
+ path.join(TEST_SESSION_PATH, 'outputs', 'prp.md'),
359
+ prpContent,
360
+ 'utf-8'
361
+ );
362
+
363
+ const generator = new VSCodeGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
364
+ await generator.generate();
365
+
366
+ const settingsContent = await fs.readFile(
367
+ path.join(TEST_PROJECT_PATH, '.vscode', 'settings.json'),
368
+ 'utf-8'
369
+ );
370
+ const settings = JSON.parse(settingsContent);
371
+
372
+ const modes = settings['github.copilot.chat.modes'];
373
+
374
+ // Verify all three modes exist
375
+ expect(modes).toHaveProperty('architect');
376
+ expect(modes).toHaveProperty('implementer');
377
+ expect(modes).toHaveProperty('reviewer');
378
+
379
+ // Verify each mode has instructions and context
380
+ expect(modes.architect).toHaveProperty('instructions');
381
+ expect(modes.architect).toHaveProperty('context');
382
+ expect(Array.isArray(modes.architect.context)).toBe(true);
383
+
384
+ expect(modes.implementer).toHaveProperty('instructions');
385
+ expect(modes.implementer).toHaveProperty('context');
386
+ expect(Array.isArray(modes.implementer.context)).toBe(true);
387
+
388
+ expect(modes.reviewer).toHaveProperty('instructions');
389
+ expect(modes.reviewer).toHaveProperty('context');
390
+ expect(Array.isArray(modes.reviewer.context)).toBe(true);
391
+ });
392
+ });
393
+
394
+ describe('Template Variables', () => {
395
+ it('should replace session ID in paths', async () => {
396
+ const prpContent = '# PRP\n\n## 1. Goal Definition\nTest project';
397
+ await fs.writeFile(
398
+ path.join(TEST_SESSION_PATH, 'outputs', 'prp.md'),
399
+ prpContent,
400
+ 'utf-8'
401
+ );
402
+
403
+ const generator = new VSCodeGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
404
+ await generator.generate();
405
+
406
+ const copilotContent = await fs.readFile(
407
+ path.join(TEST_PROJECT_PATH, '.github', 'copilot-instructions.md'),
408
+ 'utf-8'
409
+ );
410
+
411
+ // Should contain the actual session ID, not a template variable
412
+ expect(copilotContent).toContain('test-session');
413
+ expect(copilotContent).not.toContain('{SESSION_ID}');
414
+ });
415
+
416
+ it('should include ADF CLI version', async () => {
417
+ const prpContent = '# PRP\n\n## 1. Goal Definition\nTest';
418
+ await fs.writeFile(
419
+ path.join(TEST_SESSION_PATH, 'outputs', 'prp.md'),
420
+ prpContent,
421
+ 'utf-8'
422
+ );
423
+
424
+ const generator = new VSCodeGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
425
+ await generator.generate();
426
+
427
+ const copilotContent = await fs.readFile(
428
+ path.join(TEST_PROJECT_PATH, '.github', 'copilot-instructions.md'),
429
+ 'utf-8'
430
+ );
431
+
432
+ expect(copilotContent).toContain('Generated by');
433
+ expect(copilotContent).toContain('ADF CLI');
434
+ });
435
+ });
436
+ });