@patricksardinha/agentkit-cli 0.3.0 → 0.4.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.
@@ -63,27 +63,30 @@ describe('generateClaudeMd with blueprint', () => {
63
63
  expect(generateClaudeMd(REACT_STACK)).toBe(generateClaudeMd(REACT_STACK, undefined))
64
64
  })
65
65
 
66
- it('includes a Features section when blueprint is provided', () => {
66
+ it('adds the blueprint note when blueprint is provided', () => {
67
67
  const result = generateClaudeMd(REACT_STACK, BLUEPRINT)
68
- expect(result).toContain('## Features (Blueprint)')
69
- expect(result).toContain('Authentication')
70
- expect(result).toContain('Dashboard')
71
- expect(result).toContain('API')
68
+ expect(result).toContain('PROJECT_BLUEPRINT.md is present')
69
+ expect(result).toContain('Phase 0')
72
70
  })
73
71
 
74
- it('includes blueprint sub-items', () => {
72
+ it('does NOT include a Features (Blueprint) section', () => {
75
73
  const result = generateClaudeMd(REACT_STACK, BLUEPRINT)
76
- expect(result).toContain('JWT tokens')
77
- expect(result).toContain('User statistics')
74
+ expect(result).not.toContain('## Features (Blueprint)')
78
75
  })
79
76
 
80
- it('places Features section before Conventions', () => {
77
+ it('does NOT include blueprint sub-items as feature bullets', () => {
81
78
  const result = generateClaudeMd(REACT_STACK, BLUEPRINT)
82
- const featIdx = result.indexOf('## Features (Blueprint)')
79
+ expect(result).not.toContain('JWT tokens')
80
+ expect(result).not.toContain('User statistics')
81
+ })
82
+
83
+ it('places blueprint note before Conventions', () => {
84
+ const result = generateClaudeMd(REACT_STACK, BLUEPRINT)
85
+ const noteIdx = result.indexOf('PROJECT_BLUEPRINT.md is present')
83
86
  const convIdx = result.indexOf('## Conventions')
84
- expect(featIdx).toBeGreaterThan(-1)
87
+ expect(noteIdx).toBeGreaterThan(-1)
85
88
  expect(convIdx).toBeGreaterThan(-1)
86
- expect(featIdx).toBeLessThan(convIdx)
89
+ expect(noteIdx).toBeLessThan(convIdx)
87
90
  })
88
91
 
89
92
  it('still contains stack-specific content', () => {
@@ -98,33 +101,35 @@ describe('generateWorkflow with blueprint', () => {
98
101
  expect(generateWorkflow(REACT_STACK)).toBe(generateWorkflow(REACT_STACK, undefined))
99
102
  })
100
103
 
101
- it('generates one agent per blueprint feature plus a CI agent', () => {
104
+ it('returns a Phase 0 placeholder instead of agent blocks', () => {
102
105
  const result = generateWorkflow(REACT_STACK, BLUEPRINT)
103
- expect(result).toContain('Agent 1 · Authentication')
104
- expect(result).toContain('Agent 2 · Dashboard')
105
- expect(result).toContain('Agent 3 · API')
106
- expect(result).toContain('Agent 4 · Tests & CI')
106
+ expect(result).toContain('AGENT_WORKFLOW.md')
107
+ expect(result).toContain('Phase 0')
108
+ expect(result).toContain('PROJECT_BLUEPRINT.md')
109
+ expect(result).toContain('Waiting for Phase 0 decomposition')
107
110
  })
108
111
 
109
- it('each agent block is parseable by extractAgentsFromWorkflow', () => {
112
+ it('does NOT generate agent blocks from blueprint sections', () => {
110
113
  const result = generateWorkflow(REACT_STACK, BLUEPRINT)
111
- const agents = extractAgentsFromWorkflow(result)
112
- expect(agents).toHaveLength(4)
113
- expect(agents[0].name).toBe('Authentication')
114
- expect(agents[0].slug).toBe('authentication')
115
- expect(agents[3].name).toBe('Tests & CI')
116
- expect(agents[3].slug).toBe('tests-ci')
114
+ expect(result).not.toContain('Agent 1')
115
+ expect(result).not.toContain('Authentication')
116
+ expect(result).not.toContain('Dashboard')
117
+ expect(result).not.toContain('Tests & CI')
117
118
  })
118
119
 
119
- it('includes blueprint feature items as outputs', () => {
120
+ it('does NOT include blueprint feature items as outputs', () => {
120
121
  const result = generateWorkflow(REACT_STACK, BLUEPRINT)
121
- expect(result).toContain('JWT tokens')
122
- expect(result).toContain('User statistics')
122
+ expect(result).not.toContain('JWT tokens')
123
+ expect(result).not.toContain('User statistics')
124
+ })
125
+
126
+ it('uses projectName in heading when provided', () => {
127
+ const result = generateWorkflow(REACT_STACK, BLUEPRINT, 'my-app')
128
+ expect(result).toContain('AGENT_WORKFLOW.md — my-app')
123
129
  })
124
130
 
125
- it('includes stack information in the header', () => {
131
+ it('falls back to framework name when projectName is omitted', () => {
126
132
  const result = generateWorkflow(REACT_STACK, BLUEPRINT)
127
- expect(result).toContain('react')
128
- expect(result).toContain('typescript')
133
+ expect(result).toContain('AGENT_WORKFLOW.md — react')
129
134
  })
130
135
  })
@@ -83,4 +83,52 @@ describe('generateClaudeMd', () => {
83
83
  expect(typeof result).toBe('string')
84
84
  expect(result.length).toBeGreaterThan(0)
85
85
  })
86
+
87
+ describe('blueprint note', () => {
88
+ const blueprint = `# My Project\n\n## Goal\nBuild something\n\n## Features\n- Auth\n- Dashboard\n`
89
+
90
+ it('adds the blueprint note when blueprintContent is provided', () => {
91
+ const result = generateClaudeMd(makeStack('react'), blueprint)
92
+ expect(result).toContain('PROJECT_BLUEPRINT.md is present')
93
+ expect(result).toContain('Phase 0')
94
+ })
95
+
96
+ it('does NOT list blueprint sections as features', () => {
97
+ const result = generateClaudeMd(makeStack('react'), blueprint)
98
+ expect(result).not.toContain('Features (Blueprint)')
99
+ expect(result).not.toContain('**Goal**')
100
+ expect(result).not.toContain('**Features**')
101
+ })
102
+
103
+ it('still contains the stack-based template content', () => {
104
+ const result = generateClaudeMd(makeStack('react'), blueprint)
105
+ expect(result).toContain('React')
106
+ expect(result).toContain('## Stack')
107
+ expect(result).toContain('## Commands')
108
+ })
109
+
110
+ it('adds blueprint note for unknown stack with blueprint', () => {
111
+ const result = generateClaudeMd(makeStack('unknown'), blueprint)
112
+ expect(result).toContain('PROJECT_BLUEPRINT.md is present')
113
+ expect(result).toContain('Phase 0')
114
+ })
115
+
116
+ it('returns base template unchanged when blueprintContent is absent', () => {
117
+ const withBlueprint = generateClaudeMd(makeStack('react'), blueprint)
118
+ const withoutBlueprint = generateClaudeMd(makeStack('react'))
119
+ expect(withBlueprint).not.toBe(withoutBlueprint)
120
+ expect(withoutBlueprint).not.toContain('PROJECT_BLUEPRINT.md is present')
121
+ })
122
+
123
+ it('adds blueprint note for every framework', () => {
124
+ const frameworks: StackInfo['framework'][] = [
125
+ 'react', 'nextjs', 'tauri', 'fastapi', 'express', 'node', 'unknown',
126
+ ]
127
+ for (const framework of frameworks) {
128
+ const result = generateClaudeMd(makeStack(framework), blueprint)
129
+ expect(result).toContain('PROJECT_BLUEPRINT.md is present')
130
+ expect(result).not.toContain('Features (Blueprint)')
131
+ }
132
+ })
133
+ })
86
134
  })
@@ -81,4 +81,44 @@ describe('generateWorkflow', () => {
81
81
  expect(typeof result).toBe('string')
82
82
  expect(result.length).toBeGreaterThan(0)
83
83
  })
84
+
85
+ describe('blueprint placeholder', () => {
86
+ const blueprint = `# My Project\n\n## Goal\nBuild something\n\n## Features\n- Auth\n- Dashboard\n`
87
+
88
+ it('returns a placeholder when blueprintContent is provided', () => {
89
+ const result = generateWorkflow(makeStack('react'), blueprint)
90
+ expect(result).toContain('AGENT_WORKFLOW.md')
91
+ expect(result).toContain('Phase 0')
92
+ expect(result).toContain('PROJECT_BLUEPRINT.md')
93
+ expect(result).toContain('Waiting for Phase 0 decomposition')
94
+ })
95
+
96
+ it('uses projectName in heading when provided', () => {
97
+ const result = generateWorkflow(makeStack('react'), blueprint, 'my-app')
98
+ expect(result).toContain('AGENT_WORKFLOW.md — my-app')
99
+ })
100
+
101
+ it('falls back to framework name when projectName is omitted', () => {
102
+ const result = generateWorkflow(makeStack('react'), blueprint)
103
+ expect(result).toContain('AGENT_WORKFLOW.md — react')
104
+ })
105
+
106
+ it('does NOT parse blueprint sections as agents', () => {
107
+ const result = generateWorkflow(makeStack('react'), blueprint, 'my-app')
108
+ expect(result).not.toContain('Agent · Goal')
109
+ expect(result).not.toContain('Agent · Features')
110
+ expect(result).not.toContain('Agent 1')
111
+ })
112
+
113
+ it('returns the placeholder for every framework when blueprint is provided', () => {
114
+ const frameworks: StackInfo['framework'][] = [
115
+ 'react', 'nextjs', 'tauri', 'fastapi', 'express', 'node', 'unknown',
116
+ ]
117
+ for (const framework of frameworks) {
118
+ const result = generateWorkflow(makeStack(framework), blueprint, 'proj')
119
+ expect(result).toContain('Phase 0')
120
+ expect(result).not.toContain('Agent 1')
121
+ }
122
+ })
123
+ })
84
124
  })