@iservu-inc/adf-cli 0.16.0 → 0.17.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.
@@ -159,6 +159,20 @@ async function deployToTool(tool, options = {}) {
159
159
  console.warn(chalk.yellow(`\n⚠️ Warning: Could not generate AGENTS.md: ${error.message}`));
160
160
  }
161
161
 
162
+ // Generate A2A agent cards (if not already present)
163
+ const a2aDir = path.join(cwd, '.a2a');
164
+ if (!await fs.pathExists(a2aDir)) {
165
+ try {
166
+ const { generateA2A } = require('../generators');
167
+ await generateA2A(sessionPath, cwd, framework);
168
+ if (!options.silent && !spinner) {
169
+ console.log(chalk.green('✓ Generated A2A agent cards'));
170
+ }
171
+ } catch (error) {
172
+ console.warn(chalk.yellow(`⚠ Could not generate A2A cards: ${error.message}`));
173
+ }
174
+ }
175
+
162
176
  // Generate tool-specific configurations
163
177
  if (spinner) spinner.text = `Generating ${TOOLS[tool]?.name || tool} configurations...`;
164
178
 
@@ -295,6 +295,38 @@ const TOOL_GUIDES = {
295
295
  ]
296
296
  },
297
297
 
298
+ 'a2a': {
299
+ name: 'A2A (Agent-to-Agent) Protocol',
300
+ files: [
301
+ { path: '.a2a/agent-card.json', desc: 'Combined discovery card with all agent skills' },
302
+ { path: '.a2a/agents/*.json', desc: 'Individual agent cards (dev, qa, pm, etc.)' },
303
+ { path: 'AGENTS.md', desc: 'Universal agent manifest' }
304
+ ],
305
+ setup: [
306
+ '1. A2A cards are auto-generated during `adf init`',
307
+ '2. Cards are also created as fallback during `adf deploy <tool>`',
308
+ '3. No additional setup required — cards follow the A2A protocol spec',
309
+ '4. Individual agent cards are in .a2a/agents/',
310
+ '5. Combined discovery card at .a2a/agent-card.json'
311
+ ],
312
+ usage: [
313
+ '• A2A cards enable interoperability with any A2A-compatible tool',
314
+ '• Combined card (.a2a/agent-card.json) lists all agents and skills',
315
+ '• Individual cards (.a2a/agents/<name>.json) per agent role',
316
+ '• Skills are derived from agent markdown frontmatter',
317
+ '• Cards include MCP tool references from agent definitions',
318
+ '• Protocol version: 0.3 (JSONRPC binding)',
319
+ '• Spec: https://google.github.io/A2A/'
320
+ ],
321
+ mcpServers: [],
322
+ troubleshooting: [
323
+ '• Cards not generated? Run `adf init` or `adf deploy <tool>`',
324
+ '• Missing agents? Check workflow level (rapid=2, balanced=4, comprehensive=6)',
325
+ '• Regenerate by deleting .a2a/ directory and running deploy again',
326
+ '• Validate JSON: cat .a2a/agent-card.json | python -m json.tool'
327
+ ]
328
+ },
329
+
298
330
  'deepagent': {
299
331
  name: 'Abacus.ai DeepAgent',
300
332
  files: [
@@ -322,6 +322,15 @@ async function init(options) {
322
322
  console.log(chalk.gray(` ✓ Files saved to: ${sessionPath}/outputs/`));
323
323
  console.log(chalk.gray(` ✓ You can review your requirements anytime\n`));
324
324
 
325
+ // Generate A2A agent cards
326
+ try {
327
+ const { generateA2A } = require('../generators');
328
+ await generateA2A(sessionPath, cwd, workflow);
329
+ console.log(chalk.gray(' ✓ A2A agent cards generated'));
330
+ } catch (error) {
331
+ console.warn(chalk.yellow(` ⚠ Could not generate A2A cards: ${error.message}`));
332
+ }
333
+
325
334
  // Optional: Deploy to tool
326
335
  if (options.tool) {
327
336
  console.log('');
@@ -0,0 +1,289 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const ToolConfigGenerator = require('./tool-config-generator');
4
+
5
+ /**
6
+ * Generator for A2A (Agent-to-Agent) protocol agent cards
7
+ * Creates compliant agent discovery cards for interoperability
8
+ * with any A2A-compatible tool.
9
+ *
10
+ * Output structure:
11
+ * .a2a/
12
+ * ├── agent-card.json # Combined discovery card (all agents)
13
+ * └── agents/
14
+ * ├── dev.json # Individual agent cards
15
+ * ├── qa.json
16
+ * └── ...
17
+ */
18
+ class A2AGenerator extends ToolConfigGenerator {
19
+ /**
20
+ * Generate A2A agent cards for all agents in the current framework
21
+ */
22
+ async generate() {
23
+ await this.initialize();
24
+
25
+ const a2aDir = path.join(this.projectPath, '.a2a');
26
+ const agentsDir = path.join(a2aDir, 'agents');
27
+ await fs.ensureDir(agentsDir);
28
+
29
+ const agentsList = this.getAgentsList();
30
+ const individualCards = [];
31
+
32
+ for (const agentName of agentsList) {
33
+ const card = await this.generateAgentCard(agentName);
34
+ if (card) {
35
+ await fs.writeJson(
36
+ path.join(agentsDir, `${agentName}.json`),
37
+ card,
38
+ { spaces: 2 }
39
+ );
40
+ individualCards.push(card);
41
+ }
42
+ }
43
+
44
+ const combinedCard = this.generateCombinedCard(individualCards);
45
+ await fs.writeJson(
46
+ path.join(a2aDir, 'agent-card.json'),
47
+ combinedCard,
48
+ { spaces: 2 }
49
+ );
50
+
51
+ return {
52
+ agentCard: path.join(a2aDir, 'agent-card.json'),
53
+ agents: agentsList.map(a => path.join(agentsDir, `${a}.json`))
54
+ };
55
+ }
56
+
57
+ /**
58
+ * Generate an individual A2A agent card from agent markdown frontmatter
59
+ */
60
+ async generateAgentCard(agentName) {
61
+ const agentPath = path.join(__dirname, '../templates/shared/agents', `${agentName}.md`);
62
+
63
+ if (!await fs.pathExists(agentPath)) {
64
+ return null;
65
+ }
66
+
67
+ const content = await fs.readFile(agentPath, 'utf-8');
68
+ const frontmatter = this.parseAgentFrontmatter(content);
69
+ const skills = this.mapAgentToSkills(agentName, frontmatter);
70
+
71
+ const agentId = (frontmatter.agent && frontmatter.agent.id) || agentName;
72
+ const agentDisplayName = (frontmatter.agent && frontmatter.agent.name) || agentName;
73
+ const role = (frontmatter.agent && frontmatter.agent.role) || agentName;
74
+ const focus = (frontmatter.agent && frontmatter.agent.focus) || '';
75
+
76
+ const description = focus ? `${role} - ${focus}` : role;
77
+
78
+ return {
79
+ name: `ADF ${agentDisplayName} Agent`,
80
+ description,
81
+ version: this.getADFVersion(),
82
+ url: `local://adf/agents/${agentId}`,
83
+ supportedInterfaces: [{
84
+ url: `local://adf/agents/${agentId}`,
85
+ protocolBinding: 'JSONRPC',
86
+ protocolVersion: '0.3'
87
+ }],
88
+ defaultInputModes: ['text/plain', 'application/json'],
89
+ defaultOutputModes: ['text/plain', 'application/json'],
90
+ capabilities: {
91
+ streaming: false,
92
+ pushNotifications: false
93
+ },
94
+ provider: {
95
+ organization: 'ADF CLI',
96
+ url: 'https://github.com/iservu-inc/adf-cli'
97
+ },
98
+ skills
99
+ };
100
+ }
101
+
102
+ /**
103
+ * Generate combined agent-card.json with all agents' skills merged
104
+ */
105
+ generateCombinedCard(individualCards) {
106
+ const projectName = this.getProjectName();
107
+ const allSkills = [];
108
+
109
+ for (const card of individualCards) {
110
+ if (card.skills) {
111
+ allSkills.push(...card.skills);
112
+ }
113
+ }
114
+
115
+ return {
116
+ name: `ADF ${projectName} Agents`,
117
+ description: `Agent-to-Agent discovery card for ${projectName} (${this.framework} workflow)`,
118
+ version: this.getADFVersion(),
119
+ url: 'local://adf/agents',
120
+ supportedInterfaces: [{
121
+ url: 'local://adf/agents',
122
+ protocolBinding: 'JSONRPC',
123
+ protocolVersion: '0.3'
124
+ }],
125
+ defaultInputModes: ['text/plain', 'application/json'],
126
+ defaultOutputModes: ['text/plain', 'application/json'],
127
+ capabilities: {
128
+ streaming: false,
129
+ pushNotifications: false
130
+ },
131
+ provider: {
132
+ organization: 'ADF CLI',
133
+ url: 'https://github.com/iservu-inc/adf-cli'
134
+ },
135
+ skills: allSkills,
136
+ agents: individualCards.map(card => ({
137
+ name: card.name,
138
+ url: card.url,
139
+ description: card.description
140
+ }))
141
+ };
142
+ }
143
+
144
+ /**
145
+ * Parse YAML frontmatter from agent markdown file
146
+ */
147
+ parseAgentFrontmatter(content) {
148
+ const match = content.match(/^---\n([\s\S]*?)\n---/);
149
+ if (!match) return {};
150
+
151
+ const yaml = match[1];
152
+ return this.simpleYamlParse(yaml);
153
+ }
154
+
155
+ /**
156
+ * Simple YAML parser for agent frontmatter
157
+ * Handles the specific nested structure used in agent files
158
+ */
159
+ simpleYamlParse(yaml) {
160
+ const result = {};
161
+ const lines = yaml.split('\n');
162
+ let currentTopKey = null;
163
+ let currentSubKey = null;
164
+ let currentArray = null;
165
+
166
+ for (const line of lines) {
167
+ // Skip empty lines and comments
168
+ if (!line.trim() || line.trim().startsWith('#')) continue;
169
+
170
+ // Check for top-level key (no indentation)
171
+ const topMatch = line.match(/^(\w[\w_]*):(.*)$/);
172
+ if (topMatch) {
173
+ currentTopKey = topMatch[1];
174
+ const value = topMatch[2].trim();
175
+ if (value && !value.startsWith('|')) {
176
+ result[currentTopKey] = value;
177
+ } else if (!value) {
178
+ result[currentTopKey] = {};
179
+ }
180
+ currentSubKey = null;
181
+ currentArray = null;
182
+ continue;
183
+ }
184
+
185
+ // Check for sub-key (2-space indentation)
186
+ const subMatch = line.match(/^ (\w[\w_]*):(.*)$/);
187
+ if (subMatch && currentTopKey) {
188
+ currentSubKey = subMatch[1];
189
+ const value = subMatch[2].trim();
190
+ if (typeof result[currentTopKey] !== 'object') {
191
+ result[currentTopKey] = {};
192
+ }
193
+ if (value) {
194
+ result[currentTopKey][currentSubKey] = value;
195
+ } else {
196
+ result[currentTopKey][currentSubKey] = [];
197
+ currentArray = result[currentTopKey][currentSubKey];
198
+ }
199
+ continue;
200
+ }
201
+
202
+ // Check for array item (4-space indentation with dash)
203
+ const arrayMatch = line.match(/^ - (.+)$/);
204
+ if (arrayMatch && currentArray) {
205
+ // Strip inline comments
206
+ const val = arrayMatch[1].replace(/#.*$/, '').trim();
207
+ currentArray.push(val);
208
+ continue;
209
+ }
210
+
211
+ // Check for top-level array item (2-space indentation with dash)
212
+ const topArrayMatch = line.match(/^ - (.+)$/);
213
+ if (topArrayMatch && currentTopKey && !currentSubKey) {
214
+ if (!Array.isArray(result[currentTopKey])) {
215
+ result[currentTopKey] = [];
216
+ }
217
+ const val = topArrayMatch[1].replace(/#.*$/, '').trim();
218
+ result[currentTopKey].push(val);
219
+ }
220
+ }
221
+
222
+ return result;
223
+ }
224
+
225
+ /**
226
+ * Map an ADF agent's frontmatter to A2A skills
227
+ */
228
+ mapAgentToSkills(agentName, frontmatter) {
229
+ const AGENT_SKILLS = {
230
+ dev: [
231
+ { id: 'tdd-implementation', name: 'TDD Implementation', description: 'Test-driven development with context engineering', tags: ['development', 'tdd', 'testing'] },
232
+ { id: 'code-review', name: 'Code Review', description: 'Self-review against coding standards', tags: ['development', 'review'] },
233
+ { id: 'refactoring', name: 'Refactoring', description: 'Code refactoring while maintaining tests', tags: ['development', 'refactoring'] }
234
+ ],
235
+ qa: [
236
+ { id: 'risk-assessment', name: 'Risk Assessment', description: 'Identify and score project risks', tags: ['quality', 'risk'] },
237
+ { id: 'test-design', name: 'Test Design', description: 'Comprehensive test strategy creation', tags: ['quality', 'testing'] },
238
+ { id: 'quality-gates', name: 'Quality Gates', description: 'Quality gate management and decisions', tags: ['quality', 'gates'] }
239
+ ],
240
+ pm: [
241
+ { id: 'requirements-gathering', name: 'Requirements Gathering', description: 'Product requirements analysis and documentation', tags: ['product', 'requirements'] },
242
+ { id: 'story-creation', name: 'Story Creation', description: 'User story and specification writing', tags: ['product', 'stories'] },
243
+ { id: 'project-planning', name: 'Project Planning', description: 'Sprint planning and backlog management', tags: ['product', 'planning'] }
244
+ ],
245
+ analyst: [
246
+ { id: 'market-analysis', name: 'Market Analysis', description: 'Market research and competitive analysis', tags: ['analysis', 'market'] },
247
+ { id: 'business-requirements', name: 'Business Requirements', description: 'Business requirements documentation', tags: ['analysis', 'requirements'] }
248
+ ],
249
+ architect: [
250
+ { id: 'system-design', name: 'System Design', description: 'System architecture and technical design', tags: ['architecture', 'design'] },
251
+ { id: 'tech-stack-selection', name: 'Tech Stack Selection', description: 'Technology evaluation and selection', tags: ['architecture', 'technology'] }
252
+ ],
253
+ sm: [
254
+ { id: 'sprint-management', name: 'Sprint Management', description: 'Agile sprint planning and execution', tags: ['agile', 'sprint'] },
255
+ { id: 'ceremony-facilitation', name: 'Ceremony Facilitation', description: 'Scrum ceremony facilitation', tags: ['agile', 'ceremonies'] }
256
+ ]
257
+ };
258
+
259
+ const skills = AGENT_SKILLS[agentName] || [];
260
+
261
+ // Enrich with MCP tools from frontmatter if present
262
+ if (frontmatter.mcp_tools && Array.isArray(frontmatter.mcp_tools)) {
263
+ for (const tool of frontmatter.mcp_tools) {
264
+ skills.push({
265
+ id: `mcp-${tool}`,
266
+ name: `MCP: ${tool}`,
267
+ description: `Integration with ${tool} MCP server`,
268
+ tags: ['mcp', tool]
269
+ });
270
+ }
271
+ }
272
+
273
+ return skills;
274
+ }
275
+
276
+ /**
277
+ * Get ADF CLI version from package.json
278
+ */
279
+ getADFVersion() {
280
+ try {
281
+ const packageJson = require('../../package.json');
282
+ return packageJson.version;
283
+ } catch (error) {
284
+ return '0.16.0';
285
+ }
286
+ }
287
+ }
288
+
289
+ module.exports = A2AGenerator;
@@ -15,6 +15,7 @@ const DeepAgentGenerator = require('./deepagent-generator');
15
15
  const KiroGenerator = require('./kiro-generator');
16
16
  const TraeGenerator = require('./trae-generator');
17
17
  const CodexCLIGenerator = require('./codex-cli-generator');
18
+ const A2AGenerator = require('./a2a-generator');
18
19
  const ToolConfigGenerator = require('./tool-config-generator');
19
20
 
20
21
  /**
@@ -171,6 +172,14 @@ async function generateCodexCLI(sessionPath, projectPath, framework) {
171
172
  return await generator.generate();
172
173
  }
173
174
 
175
+ /**
176
+ * Generate A2A (Agent-to-Agent) protocol agent cards
177
+ */
178
+ async function generateA2A(sessionPath, projectPath, framework) {
179
+ const generator = new A2AGenerator(sessionPath, projectPath, framework);
180
+ return await generator.generate();
181
+ }
182
+
174
183
  module.exports = {
175
184
  generateAll,
176
185
  generateAgentsMd,
@@ -185,6 +194,7 @@ module.exports = {
185
194
  generateKiro,
186
195
  generateTrae,
187
196
  generateCodexCLI,
197
+ generateA2A,
188
198
  AgentsMdGenerator,
189
199
  WindsurfGenerator,
190
200
  CursorGenerator,
@@ -197,5 +207,6 @@ module.exports = {
197
207
  KiroGenerator,
198
208
  TraeGenerator,
199
209
  CodexCLIGenerator,
210
+ A2AGenerator,
200
211
  ToolConfigGenerator
201
212
  };
@@ -536,4 +536,4 @@ Brief ready for PM to create PRD.
536
536
 
537
537
  **Agent Version**: 1.0.0
538
538
  **Framework**: AgentDevFramework
539
- **Methodology**: Agent-Native + Market Research Best Practices
539
+ **Methodology**: BMAD-METHOD + Market Research Best Practices
@@ -550,4 +550,4 @@ Ready for SM to create stories.
550
550
 
551
551
  **Agent Version**: 1.0.0
552
552
  **Framework**: AgentDevFramework
553
- **Methodology**: Agent-Native + Software Architecture Best Practices
553
+ **Methodology**: BMAD-METHOD + Software Architecture Best Practices
@@ -118,7 +118,7 @@ You are a Senior Full-Stack Developer focused on implementing features from deta
118
118
  ### Core Commands
119
119
 
120
120
  ```bash
121
- /implement <story-id> # Implement a feature from requirements
121
+ /implement <story-id> # Implement a story from PRD
122
122
  /test # Run tests and analyze results
123
123
  /review # Perform self-code-review
124
124
  /commit # Create well-formatted commit
@@ -50,7 +50,7 @@ You are a Product Manager focused on creating comprehensive Product Requirements
50
50
 
51
51
  ## Primary Responsibilities
52
52
 
53
- ### 1. PRD Creation (Path A: Agent-Native)
53
+ ### 1. PRD Creation (Path A: Greenfield)
54
54
 
55
55
  **Create comprehensive Product Requirements Document**:
56
56
  - Executive Summary
@@ -672,4 +672,4 @@ PRD complete. Ready for architect review.
672
672
 
673
673
  **Agent Version**: 1.0.0
674
674
  **Framework**: AgentDevFramework
675
- **Methodology**: Agent-Native + Agile Best Practices
675
+ **Methodology**: BMAD-METHOD + Agile Best Practices
@@ -537,4 +537,4 @@ Recommendation: Implement rate limiting and CAPTCHA before beginning development
537
537
 
538
538
  **Agent Version**: 1.0.0
539
539
  **Framework**: AgentDevFramework
540
- **Methodology**: Agent-Native + Risk-Based Testing Best Practices
540
+ **Methodology**: BMAD-METHOD QA + Risk-Based Testing Best Practices
@@ -67,7 +67,7 @@ You are Samira, a Scrum Master focused on creating implementation-ready stories
67
67
 
68
68
  ## Story Creation Workflow
69
69
 
70
- ### 1. Context Gathering (Path A: Agent-Native)
70
+ ### 1. Context Gathering (Path A: Greenfield)
71
71
 
72
72
  ```
73
73
  1. Read Planning Phase Outputs
@@ -77,7 +77,7 @@ You are Samira, a Scrum Master focused on creating implementation-ready stories
77
77
  - Related stories
78
78
  ```
79
79
 
80
- ### 2. Task Breakdown (Level 2: Balanced (OpenSpec))
80
+ ### 2. Task Breakdown (Path B: OpenSpec)
81
81
 
82
82
  ```
83
83
  1. Read Change Context
@@ -785,4 +785,4 @@ Would you like me to:
785
785
 
786
786
  **Agent Version**: 1.0.0
787
787
  **Framework**: AgentDevFramework
788
- **Methodology**: Agent-Native + Agile Best Practices
788
+ **Methodology**: BMAD-METHOD + Context Engineering + Agile Best Practices
@@ -1,6 +1,6 @@
1
1
  # Development Constitution
2
2
 
3
- This document defines the immutable principles governing all development in this project. These principles synthesize best practices from Agent-Native and OpenSpec methodologies.
3
+ This document defines the immutable principles governing all development in this project. These principles synthesize best practices from BMAD-METHOD, Spec-Kit, and Context Engineering methodologies.
4
4
 
5
5
  ## Article 1: Specification-First Development
6
6
 
@@ -287,6 +287,6 @@ This constitution is enforced through:
287
287
 
288
288
  **Version**: 1.0.0
289
289
  **Last Updated**: 2025-01-XX
290
- **Source**: Synthesized from Agent-Native and OpenSpec methodologies
290
+ **Source**: Synthesized from BMAD-METHOD, Spec-Kit, Context Engineering
291
291
 
292
292
  **Living Document**: This constitution evolves with project needs while maintaining core principles.
@@ -1,10 +1,10 @@
1
1
  # Template Library
2
2
 
3
- This directory contains all templates for the AgentDevFramework, synthesizing best practices from Agent-Native and OpenSpec methodologies.
3
+ This directory contains all templates for the AgentDevFramework, synthesizing best practices from BMAD-METHOD, Spec-Kit, Context Engineering, and PRPs Agentic Engineering.
4
4
 
5
5
  ## Template Categories
6
6
 
7
- ### Rapid (Agent-Native) Templates
7
+ ### PRPs Templates (Product Requirement Prompts)
8
8
 
9
9
  **Philosophy**: One-pass implementation success through comprehensive context and validation
10
10
 
@@ -50,7 +50,7 @@ This directory contains all templates for the AgentDevFramework, synthesizing be
50
50
  - **Complexity**: Low-Medium
51
51
  - **Best For**: Quick feature implementation with validation
52
52
 
53
- ### Comprehensive (Agent-Native) Templates
53
+ ### BMAD Templates
54
54
 
55
55
  #### `prd-template.md` - Product Requirements Document
56
56
  - **Use For**: Comprehensive product requirements
@@ -64,7 +64,7 @@ This directory contains all templates for the AgentDevFramework, synthesizing be
64
64
  - **Best For**: Story-driven development, team handoffs
65
65
  - **Includes**: Context, acceptance criteria, technical approach, validation
66
66
 
67
- ### OpenSpec Templates
67
+ ### Spec-Kit Templates
68
68
 
69
69
  #### `spec-template.md` - Formal Specification
70
70
  - **Use For**: Detailed specifications with validation checkpoints
@@ -88,13 +88,13 @@ This directory contains all templates for the AgentDevFramework, synthesizing be
88
88
 
89
89
  | Template | Workflow Level | Use Case | Time | Validation | Complexity |
90
90
  |----------|---------------|----------|------|------------|-----------|
91
- | **prp_task.md** | Level 1 (Rapid (Agent-Native)) | Sprint tasks, bug fixes | 5-10 min | Inline | Low |
92
- | **prp-template.md** | Level 1 (Rapid (Agent-Native)) | Quick features | 10-20 min | Basic | Low-Med |
91
+ | **prp_task.md** | Level 1 (Rapid) | Sprint tasks, bug fixes | 5-10 min | Inline | Low |
92
+ | **prp-template.md** | Level 1 (Rapid) | Quick features | 10-20 min | Basic | Low-Med |
93
93
  | **prp_spec.md** | Level 1-2 | Rapid prototyping | 20-30 min | L1-L2 | Medium |
94
- | **prp_base.md** | Level 2 (Balanced (OpenSpec)) | Feature implementation | 30-45 min | 4-level | Med-High |
95
- | **spec-template.md** | Level 2 (Balanced (OpenSpec)) | Formal specifications | 30-60 min | Gates | Medium |
96
- | **prp_planning.md** | Level 3 (Comprehensive (Agent-Native)) | PRD with diagrams | 1-2 hours | Pre-impl | High |
97
- | **prd-template.md** | Level 3 (Comprehensive (Agent-Native)) | Product requirements | 1-2 hours | - | High |
94
+ | **prp_base.md** | Level 2 (Balanced) | Feature implementation | 30-45 min | 4-level | Med-High |
95
+ | **spec-template.md** | Level 2 (Balanced) | Formal specifications | 30-60 min | Gates | Medium |
96
+ | **prp_planning.md** | Level 3 (Comprehensive) | PRD with diagrams | 1-2 hours | Pre-impl | High |
97
+ | **prd-template.md** | Level 3 (Comprehensive) | Product requirements | 1-2 hours | - | High |
98
98
  | **story-template.md** | Level 2-3 | Story-driven dev | 30-60 min | Context | Medium |
99
99
 
100
100
  ## 4-Level Validation System (From PRPs)
@@ -171,20 +171,20 @@ bandit -r src/
171
171
 
172
172
  ## Template Usage by Workflow
173
173
 
174
- ### Level 1: Rapid (Agent-Native)
174
+ ### Level 1: Rapid Development
175
175
  **Templates**: prp_task.md, prp-template.md
176
176
  **Time**: 5-20 minutes upfront
177
177
  **Best For**: Sprint tasks, bug fixes, solo dev
178
178
 
179
- ### Level 2: Balanced (OpenSpec)
179
+ ### Level 2: Specification-Driven
180
180
  **Templates**: prp_base.md, prp_spec.md, spec-template.md
181
181
  **Time**: 30-60 minutes upfront
182
182
  **Best For**: New features, clear scope, teams
183
183
 
184
- ### Level 3: Comprehensive (Agent-Native)
184
+ ### Level 3: BMAD Comprehensive
185
185
  **Templates**: prp_planning.md, prd-template.md, story-template.md
186
186
  **Time**: 1-4 hours upfront
187
- **Best For**: Complex projects, enterprise, iterative strategic orchestration
187
+ **Best For**: Complex projects, enterprise, unclear requirements
188
188
 
189
189
  ## Related Documentation
190
190
 
@@ -560,4 +560,4 @@ So that [benefit]
560
560
 
561
561
  **Framework**: AgentDevFramework
562
562
  **Template Version**: 1.0.0
563
- **Methodology**: Agent-Native + Product Management Best Practices
563
+ **Methodology**: BMAD-METHOD + Product Management Best Practices
@@ -76,6 +76,12 @@ class ToolFeatureRegistry {
76
76
  status: 'supported',
77
77
  configFiles: ['.deepagent/'],
78
78
  features: ['Full Agent Suite']
79
+ },
80
+ a2a: {
81
+ name: 'A2A Protocol',
82
+ status: 'auto',
83
+ configFiles: ['.a2a/agent-card.json', '.a2a/agents/'],
84
+ features: ['Agent Cards', 'Skills Discovery', 'Protocol Compliance']
79
85
  }
80
86
  };
81
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservu-inc/adf-cli",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "CLI tool for AgentDevFramework - Agent-Native development framework with multi-provider AI support",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -0,0 +1,288 @@
1
+ const fs = require('fs-extra');
2
+ const path = require('path');
3
+ const A2AGenerator = require('../lib/generators/a2a-generator');
4
+
5
+ const TEST_PROJECT_PATH = path.join(__dirname, 'test-project-a2a');
6
+ const TEST_SESSION_PATH = path.join(TEST_PROJECT_PATH, '.adf', 'sessions', 'test-session');
7
+
8
+ describe('A2AGenerator', () => {
9
+ beforeEach(async () => {
10
+ await fs.remove(TEST_PROJECT_PATH);
11
+ await fs.ensureDir(TEST_PROJECT_PATH);
12
+ await fs.ensureDir(TEST_SESSION_PATH);
13
+ await fs.ensureDir(path.join(TEST_SESSION_PATH, 'outputs'));
14
+ });
15
+
16
+ afterEach(async () => {
17
+ await fs.remove(TEST_PROJECT_PATH);
18
+ });
19
+
20
+ async function createPRPOutput() {
21
+ const prpContent = `# Product Requirement Prompt (PRP)
22
+
23
+ ## 1. Goal Definition
24
+ Build a React dashboard for analytics.
25
+
26
+ ## 2. Business Justification
27
+ Improve data-driven decisions.
28
+
29
+ ## 3. Contextual Intelligence
30
+ ### Technology Stack
31
+ - Frontend: React 18, TypeScript
32
+ - Backend: Node.js, Express
33
+ `;
34
+ await fs.writeFile(
35
+ path.join(TEST_SESSION_PATH, 'outputs', 'prp.md'),
36
+ prpContent,
37
+ 'utf-8'
38
+ );
39
+ await fs.writeJson(path.join(TEST_SESSION_PATH, '_metadata.json'), {
40
+ framework: 'rapid',
41
+ projectName: 'Test Dashboard'
42
+ });
43
+ }
44
+
45
+ async function createBalancedOutputs() {
46
+ await fs.writeFile(
47
+ path.join(TEST_SESSION_PATH, 'outputs', 'constitution.md'),
48
+ '# Constitution\n\n## Core Principles\n1. Privacy first',
49
+ 'utf-8'
50
+ );
51
+ await fs.writeFile(
52
+ path.join(TEST_SESSION_PATH, 'outputs', 'specification.md'),
53
+ '# Specification\n\n## Overview\nUser management system.',
54
+ 'utf-8'
55
+ );
56
+ await fs.writeJson(path.join(TEST_SESSION_PATH, '_metadata.json'), {
57
+ framework: 'balanced',
58
+ projectName: 'Test UserMgmt'
59
+ });
60
+ }
61
+
62
+ async function createComprehensiveOutputs() {
63
+ await fs.writeFile(
64
+ path.join(TEST_SESSION_PATH, 'outputs', 'prd.md'),
65
+ '# PRD\n\n## Executive Summary\nE-commerce platform.',
66
+ 'utf-8'
67
+ );
68
+ await fs.writeFile(
69
+ path.join(TEST_SESSION_PATH, 'outputs', 'architecture.md'),
70
+ '# Architecture\n\n## System Overview\nMicroservices.',
71
+ 'utf-8'
72
+ );
73
+ await fs.writeJson(path.join(TEST_SESSION_PATH, '_metadata.json'), {
74
+ framework: 'comprehensive',
75
+ projectName: 'Test Ecommerce'
76
+ });
77
+ }
78
+
79
+ describe('Rapid Framework', () => {
80
+ it('should generate A2A cards for rapid workflow (dev, qa)', async () => {
81
+ await createPRPOutput();
82
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
83
+ const result = await generator.generate();
84
+
85
+ // Check combined card exists
86
+ expect(await fs.pathExists(result.agentCard)).toBe(true);
87
+
88
+ // Check individual agents
89
+ expect(result.agents).toHaveLength(2);
90
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'dev.json'))).toBe(true);
91
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'qa.json'))).toBe(true);
92
+ });
93
+
94
+ it('should include correct fields in individual agent card', async () => {
95
+ await createPRPOutput();
96
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
97
+ await generator.generate();
98
+
99
+ const devCard = await fs.readJson(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'dev.json'));
100
+
101
+ expect(devCard).toHaveProperty('name');
102
+ expect(devCard).toHaveProperty('description');
103
+ expect(devCard).toHaveProperty('version');
104
+ expect(devCard).toHaveProperty('url', 'local://adf/agents/dev');
105
+ expect(devCard).toHaveProperty('supportedInterfaces');
106
+ expect(devCard.supportedInterfaces[0]).toHaveProperty('protocolBinding', 'JSONRPC');
107
+ expect(devCard.supportedInterfaces[0]).toHaveProperty('protocolVersion', '0.3');
108
+ expect(devCard).toHaveProperty('defaultInputModes');
109
+ expect(devCard).toHaveProperty('defaultOutputModes');
110
+ expect(devCard).toHaveProperty('capabilities');
111
+ expect(devCard).toHaveProperty('provider');
112
+ expect(devCard.provider.organization).toBe('ADF CLI');
113
+ expect(devCard).toHaveProperty('skills');
114
+ expect(devCard.skills.length).toBeGreaterThan(0);
115
+ });
116
+ });
117
+
118
+ describe('Balanced Framework', () => {
119
+ it('should generate A2A cards for balanced workflow (analyst, pm, dev, qa)', async () => {
120
+ await createBalancedOutputs();
121
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'balanced');
122
+ const result = await generator.generate();
123
+
124
+ expect(result.agents).toHaveLength(4);
125
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'analyst.json'))).toBe(true);
126
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'pm.json'))).toBe(true);
127
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'dev.json'))).toBe(true);
128
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'qa.json'))).toBe(true);
129
+ });
130
+ });
131
+
132
+ describe('Comprehensive Framework', () => {
133
+ it('should generate A2A cards for comprehensive workflow (all 6 agents)', async () => {
134
+ await createComprehensiveOutputs();
135
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'comprehensive');
136
+ const result = await generator.generate();
137
+
138
+ expect(result.agents).toHaveLength(6);
139
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'architect.json'))).toBe(true);
140
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'sm.json'))).toBe(true);
141
+ });
142
+ });
143
+
144
+ describe('Combined Agent Card', () => {
145
+ it('should contain all agents and merged skills', async () => {
146
+ await createPRPOutput();
147
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
148
+ await generator.generate();
149
+
150
+ const combined = await fs.readJson(path.join(TEST_PROJECT_PATH, '.a2a', 'agent-card.json'));
151
+
152
+ expect(combined.name).toContain('Test Dashboard');
153
+ expect(combined.description).toContain('rapid');
154
+ expect(combined).toHaveProperty('agents');
155
+ expect(combined.agents).toHaveLength(2);
156
+ expect(combined).toHaveProperty('skills');
157
+ expect(combined.skills.length).toBeGreaterThan(0);
158
+
159
+ // Skills from both dev and qa should be present
160
+ const skillIds = combined.skills.map(s => s.id);
161
+ expect(skillIds).toContain('tdd-implementation');
162
+ expect(skillIds).toContain('risk-assessment');
163
+ });
164
+
165
+ it('should have correct A2A protocol fields', async () => {
166
+ await createPRPOutput();
167
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
168
+ await generator.generate();
169
+
170
+ const combined = await fs.readJson(path.join(TEST_PROJECT_PATH, '.a2a', 'agent-card.json'));
171
+
172
+ expect(combined).toHaveProperty('supportedInterfaces');
173
+ expect(combined.supportedInterfaces[0].protocolBinding).toBe('JSONRPC');
174
+ expect(combined).toHaveProperty('defaultInputModes');
175
+ expect(combined.defaultInputModes).toContain('text/plain');
176
+ expect(combined.defaultInputModes).toContain('application/json');
177
+ });
178
+ });
179
+
180
+ describe('Frontmatter Parsing', () => {
181
+ it('should parse agent YAML frontmatter correctly', async () => {
182
+ await createPRPOutput();
183
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
184
+
185
+ const content = `---
186
+ agent:
187
+ id: dev
188
+ name: Dev
189
+ role: Senior Full-Stack Developer
190
+ focus: TDD implementation with context engineering
191
+
192
+ mcp_tools:
193
+ - context7
194
+ - mem0
195
+ ---
196
+
197
+ # Dev Agent`;
198
+
199
+ const frontmatter = generator.parseAgentFrontmatter(content);
200
+
201
+ expect(frontmatter.agent).toBeDefined();
202
+ expect(frontmatter.agent.id).toBe('dev');
203
+ expect(frontmatter.agent.name).toBe('Dev');
204
+ expect(frontmatter.agent.role).toBe('Senior Full-Stack Developer');
205
+ expect(frontmatter.mcp_tools).toContain('context7');
206
+ expect(frontmatter.mcp_tools).toContain('mem0');
207
+ });
208
+
209
+ it('should return empty object for content without frontmatter', async () => {
210
+ await createPRPOutput();
211
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
212
+
213
+ const content = '# Just a heading\nNo frontmatter here.';
214
+ const frontmatter = generator.parseAgentFrontmatter(content);
215
+
216
+ expect(frontmatter).toEqual({});
217
+ });
218
+ });
219
+
220
+ describe('Skills Mapping', () => {
221
+ it('should include MCP tools as skills', async () => {
222
+ await createPRPOutput();
223
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
224
+ await generator.generate();
225
+
226
+ const devCard = await fs.readJson(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'dev.json'));
227
+ const mcpSkills = devCard.skills.filter(s => s.id.startsWith('mcp-'));
228
+
229
+ expect(mcpSkills.length).toBeGreaterThan(0);
230
+ expect(mcpSkills.some(s => s.id === 'mcp-context7')).toBe(true);
231
+ });
232
+
233
+ it('should map dev agent to development skills', async () => {
234
+ await createPRPOutput();
235
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
236
+ await generator.generate();
237
+
238
+ const devCard = await fs.readJson(path.join(TEST_PROJECT_PATH, '.a2a', 'agents', 'dev.json'));
239
+ const coreSkills = devCard.skills.filter(s => !s.id.startsWith('mcp-'));
240
+
241
+ expect(coreSkills.some(s => s.id === 'tdd-implementation')).toBe(true);
242
+ expect(coreSkills.some(s => s.id === 'code-review')).toBe(true);
243
+ });
244
+ });
245
+
246
+ describe('Idempotency', () => {
247
+ it('should safely regenerate without errors', async () => {
248
+ await createPRPOutput();
249
+ const generator1 = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
250
+ await generator1.generate();
251
+
252
+ // Run again — should not throw
253
+ const generator2 = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
254
+ const result = await generator2.generate();
255
+
256
+ expect(await fs.pathExists(result.agentCard)).toBe(true);
257
+ expect(result.agents).toHaveLength(2);
258
+ });
259
+ });
260
+
261
+ describe('Output Structure', () => {
262
+ it('should create .a2a directory with correct structure', async () => {
263
+ await createPRPOutput();
264
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'rapid');
265
+ await generator.generate();
266
+
267
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a'))).toBe(true);
268
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agent-card.json'))).toBe(true);
269
+ expect(await fs.pathExists(path.join(TEST_PROJECT_PATH, '.a2a', 'agents'))).toBe(true);
270
+ });
271
+
272
+ it('should produce valid JSON in all output files', async () => {
273
+ await createComprehensiveOutputs();
274
+ const generator = new A2AGenerator(TEST_SESSION_PATH, TEST_PROJECT_PATH, 'comprehensive');
275
+ await generator.generate();
276
+
277
+ // All files should be parseable JSON
278
+ const agentsDir = path.join(TEST_PROJECT_PATH, '.a2a', 'agents');
279
+ const files = await fs.readdir(agentsDir);
280
+
281
+ for (const file of files) {
282
+ const content = await fs.readJson(path.join(agentsDir, file));
283
+ expect(content).toHaveProperty('name');
284
+ expect(content).toHaveProperty('skills');
285
+ }
286
+ });
287
+ });
288
+ });