@vibe-agent-toolkit/vat-development-agents 0.1.0-rc.7

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.
package/README.md ADDED
@@ -0,0 +1,87 @@
1
+ # @vibe-agent-toolkit/vat-development-agents
2
+
3
+ **VAT Development Agents** - Dogfooding the vibe-agent-toolkit
4
+
5
+ This package contains agents used for developing the Vibe Agent Toolkit itself. These agents validate schemas, generate new agents, optimize resources, and more.
6
+
7
+ ## Agents
8
+
9
+ ### agent-generator
10
+
11
+ **Status:** Design Complete (Phase 1.5)
12
+ **Purpose:** Helps users create new VAT agents through adaptive 4-phase conversation
13
+
14
+ Guides users through:
15
+ 1. **GATHER** - Understand problem and success criteria
16
+ 2. **ANALYZE** - Identify agent pattern, extract requirements
17
+ 3. **DESIGN** - Choose LLM, tools, prompts, resources
18
+ 4. **GENERATE** - Create validated agent package
19
+
20
+ [Read full design →](./agents/agent-generator/README.md)
21
+
22
+ ### resource-optimizer
23
+
24
+ **Status:** Scoped (Phase 1.5)
25
+ **Purpose:** Analyzes agent resources for context efficiency
26
+
27
+ Identifies opportunities to improve agent resources following Anthropic's "smallest high-signal tokens" principle.
28
+
29
+ [Read scope document →](./agents/resource-optimizer/SCOPE.md)
30
+
31
+ ## Package Structure
32
+
33
+ ```
34
+ @vibe-agent-toolkit/vat-development-agents/
35
+ ├── agents/
36
+ │ ├── agent-generator/ # Design complete
37
+ │ │ ├── agent.yaml # Validated manifest
38
+ │ │ ├── schemas/ # I/O schemas
39
+ │ │ ├── prompts/ # System/user prompts
40
+ │ │ ├── examples/ # Example usage
41
+ │ │ └── README.md # Full documentation
42
+ │ └── resource-optimizer/ # Scoped only
43
+ │ └── SCOPE.md # Design scope
44
+ └── package.json # NPM package manifest
45
+ ```
46
+
47
+ ## Installation
48
+
49
+ ```bash
50
+ npm install @vibe-agent-toolkit/vat-development-agents
51
+ ```
52
+
53
+ ## Usage
54
+
55
+ ### As NPM Package
56
+
57
+ ```javascript
58
+ import agentGenerator from '@vibe-agent-toolkit/vat-development-agents/agents/agent-generator';
59
+ ```
60
+
61
+ ### Direct Agent Access
62
+
63
+ ```bash
64
+ # Validate agent-generator's own manifest
65
+ cd packages/vat-development-agents
66
+ bun run validate
67
+ ```
68
+
69
+ ## Development Status
70
+
71
+ | Agent | Phase | Status |
72
+ |-------|-------|--------|
73
+ | agent-generator | 1.5 - Design | ✅ Complete |
74
+ | resource-optimizer | 1.5 - Scope | ✅ Complete |
75
+ | schema-validator | Planned | 📋 Phase 2 |
76
+ | test-generator | Planned | 📋 Phase 2+ |
77
+
78
+ ## Keywords
79
+
80
+ - `vat-agent` - Discoverable via `npm search vat-agent`
81
+ - `vibe-agent` - Alternative namespace
82
+ - `agent-bundle` - Contains multiple agents
83
+ - `development-tools` - Developer tooling
84
+
85
+ ## License
86
+
87
+ MIT © VAT Team
@@ -0,0 +1,572 @@
1
+ # agent-generator Design Notes
2
+
3
+ **Date:** 2025-12-28
4
+ **Phase:** 1.5 - Design & Schema Validation
5
+
6
+ ## Purpose
7
+
8
+ Document schema refinements and learnings discovered while designing agent-generator against @vibe-agent-toolkit/agent-schema.
9
+
10
+ ## Schema Refinements Discovered
11
+
12
+ (To be filled as we discover issues/improvements during design)
13
+
14
+ ## Design Decisions
15
+
16
+ ### Input Schema Design
17
+
18
+ **Fields:**
19
+ - `agentPurpose` (required): Core problem statement
20
+ - `successCriteria` (required): Measurable success definition
21
+ - `typicalInputs`, `expectedOutputs`, `domainContext`: Optional context
22
+ - `performanceRequirements`: Latency/accuracy/cost tradeoffs
23
+ - `additionalContext`: Catch-all for edge cases
24
+
25
+ **Rationale:**
26
+ - Only 2 required fields (minimum viable to design an agent)
27
+ - Examples guide users toward specificity
28
+ - Agent elicits missing information through GATHER/ANALYZE phases
29
+ - Performance requirements help LLM selection in DESIGN phase
30
+
31
+ **Schema Validation:**
32
+ - JSON Schema Draft 07 format
33
+ - Strict validation disabled (allows future extensions)
34
+ - All fields have examples for clarity
35
+
36
+ ### Output Schema Design
37
+
38
+ **Structure:**
39
+ - `agentYaml`: Complete agent.yaml as object (validated separately)
40
+ - `files`: Array of {path, content, type} for all generated files
41
+ - `validationResults`: Schema validation feedback
42
+ - `summary`: Human-readable next steps
43
+ - `architecture`: Design decisions made
44
+
45
+ **Key Design Principles:**
46
+ 1. **Agent outputs data, not files**: Wrapper script handles file I/O
47
+ 2. **Validation built-in**: Agent validates its own output before returning
48
+ 3. **Portability**: Works in any environment (CLI, web, Claude Skills)
49
+ 4. **Transparency**: Architecture decisions documented for user understanding
50
+
51
+ **Validation Strategy:**
52
+ - Agent calls `AgentManifestSchema.safeParse()` from @vibe-agent-toolkit/agent-schema
53
+ - Reports validation results in structured format
54
+ - User sees exactly what passed/failed before files are written
55
+
56
+ ### System Prompt Design
57
+
58
+ **Structure:**
59
+ 1. "What Makes a Good Agent" - 5 principles with examples
60
+ 2. Four-Phase Process - Detailed phase-by-phase guidance
61
+ 3. Key Principles - One-liners for quick reference
62
+ 4. Anti-Patterns - What NOT to build
63
+ 5. Research Sources - Attribution
64
+
65
+ **Context Efficiency Applied:**
66
+ - Uses concrete examples (NOT/YES pattern)
67
+ - Avoids explaining LLM basics
68
+ - Focuses on domain-specific agent design knowledge
69
+ - Hierarchical structure (principles → process → specifics)
70
+
71
+ **Research Integration:**
72
+ - "Smallest high-signal tokens" (Anthropic)
73
+ - "Simple, composable patterns" (Anthropic)
74
+ - Tool minimization (Databricks)
75
+ - LLM selection guidance (industry standard)
76
+
77
+ **Length:** 168 lines (~1000 tokens)
78
+ - Justification: Agent design requires significant domain knowledge
79
+ - Most content is examples and templates (high-signal)
80
+ - Structured for quick scanning (headings, bullet points)
81
+ - Could be compressed in Phase 2 if needed
82
+
83
+ **Four-Phase Process Detail:**
84
+ - Phase 1 (GATHER): Focused questions to extract problem statement
85
+ - Phase 2 (ANALYZE): Pattern recognition with targeted follow-ups
86
+ - Phase 3 (DESIGN): Architecture decisions with justifications
87
+ - Phase 4 (GENERATE): Structured output with validation
88
+
89
+ **Key Design Principle:**
90
+ Agent outputs data (JSON object with file contents), not files. This makes the agent portable across different execution environments (CLI, web, Claude Skills).
91
+
92
+ ### User Prompt Template Design
93
+
94
+ **Template Engine:** Jinja2-style syntax (`{{variable}}`, `{% if %}`)
95
+ - Portable across multiple platforms
96
+ - Standard in agent frameworks
97
+
98
+ **Structure:**
99
+ - Always present: `{{userInput}}` (free-form description)
100
+ - Conditional sections: Only render if variable provided
101
+ - Clear labels: "Purpose:", "Success looks like:", etc.
102
+ - Friendly tone: "Help me design this agent!"
103
+
104
+ **Flexibility:**
105
+ - Minimum viable: Just `userInput` + `agentPurpose` + `successCriteria`
106
+ - Maximum detail: All fields populated
107
+ - Agent adapts: GATHER/ANALYZE phases fill in gaps
108
+
109
+ **Example Provided:**
110
+ - PR review agent with full context
111
+ - Shows expected agent behavior through 4 phases
112
+ - Demonstrates how structured input guides design
113
+
114
+ ### Agent Manifest (agent.yaml) Design
115
+
116
+ **Purpose:** Central manifest that ties together all agent components
117
+
118
+ **Structure:** Follows VAT agent schema (vat.dev/v1 API version)
119
+
120
+ **Key Sections:**
121
+
122
+ 1. **metadata**: Identity and discovery
123
+ - name: agent-generator (kebab-case)
124
+ - version: 0.1.0 (semantic versioning)
125
+ - description: Clear purpose statement
126
+ - tags: Categorization for agent marketplaces/registries
127
+ - repository: Source location for transparency
128
+
129
+ 2. **spec.interface**: Structured I/O contracts
130
+ - input: $ref to input.schema.json (Design Request schema)
131
+ - output: $ref to output.schema.json (Generated Agent Package schema)
132
+ - External references enable schema reuse and validation
133
+
134
+ 3. **spec.llm**: Model selection and configuration
135
+ - Claude Sonnet 4.5 for balance of quality/speed/cost
136
+ - Temperature 0.7 for creative design with consistency
137
+ - reasoning field documents WHY this model/config
138
+ - alternatives section guides users when to deviate
139
+
140
+ 4. **spec.prompts**: Behavior definition
141
+ - system: $ref to system.md (agent identity and expertise)
142
+ - user: $ref to user.md (input template with Jinja2 variables)
143
+ - External references keep manifest clean, prompts maintainable
144
+
145
+ 5. **spec.tools**: Validation capability
146
+ - validate_agent_schema: Self-validation before output
147
+ - Includes input/output schemas inline
148
+ - reasoning explains why this tool exists
149
+
150
+ 6. **spec.resources**: Context materials
151
+ - Required: README, prompts, schemas (core functionality)
152
+ - Optional: Examples, parent docs (enrichment)
153
+ - Descriptive paths relative to agent.yaml location
154
+
155
+ 7. **spec.credentials**: API access requirements
156
+ - ANTHROPIC_API_KEY: Claude access
157
+ - Explicit requirement prevents runtime failures
158
+
159
+ 8. **spec.validation**: Enforcement level
160
+ - strict for both input and output
161
+ - Catches errors before file I/O
162
+
163
+ 9. **spec.context**: Context management strategy
164
+ - 200K token window (Claude Sonnet 4.5 max)
165
+ - Hierarchical loading (system → user → resources → artifacts)
166
+
167
+ 10. **spec.workflow**: Four-phase process documentation
168
+ - GATHER, ANALYZE, DESIGN, GENERATE
169
+ - Each phase has reasoning explaining its purpose
170
+ - Makes agent behavior transparent and debuggable
171
+
172
+ 11. **build**: Generation metadata
173
+ - Tracks which version of agent-generator created this manifest
174
+ - Enables reproducibility and debugging
175
+
176
+ **Design Principles Applied:**
177
+
178
+ - **Explicit over Implicit**: All paths, versions, requirements stated clearly
179
+ - **Reasoning Fields**: Every major decision documented (LLM choice, tool inclusion, validation level)
180
+ - **External References**: Schemas and prompts kept separate, referenced by path
181
+ - **Portability**: Relative paths enable agent package to be moved/shared
182
+ - **Validation-First**: Agent validates its own output before returning
183
+
184
+ **Future Improvements:**
185
+
186
+ - Phase 2: Add tool marketplace references for common tools
187
+ - Phase 2: Support multi-LLM configs for fallback/routing
188
+ - Phase 3: Add metrics section for performance tracking
189
+
190
+ ## Validation Results (Task 7)
191
+
192
+ **Date:** 2025-12-28
193
+ **Initial Status:** ❌ FAILED (12 errors discovered)
194
+ **Final Status:** ✅ PASSED (after applying fixes)
195
+
196
+ ### Validation Execution
197
+
198
+ Ran `validate-agent.ts` script against agent.yaml using `AgentManifestSchema.safeParse()`.
199
+
200
+ **Result:** Validation failed with 12 schema mismatches. These represent a mix of:
201
+ 1. Missing schema features needed for Phase 1
202
+ 2. Design decisions that need schema support
203
+ 3. Fields that need to move to proper locations
204
+
205
+ ### Detailed Errors and Analysis
206
+
207
+ #### 1. Missing `metadata.repository` field
208
+ - **Error:** Unrecognized key `repository` in metadata
209
+ - **Current Design:** agent.yaml includes repository URL for transparency
210
+ - **Schema Impact:** Should add optional `repository` field to `AgentMetadataSchema`
211
+ - **Rationale:** Repository URL is important for agent discovery and trust
212
+
213
+ #### 2-6. LLM Configuration Issues
214
+
215
+ **Missing `provider` in alternatives:**
216
+ - **Errors:** alternatives[0].provider and alternatives[1].provider required but missing
217
+ - **Root Cause:** agent.yaml uses `model` field in alternatives without `provider`
218
+ - **Schema Impact:** Should make `provider` optional if it can be inferred from parent
219
+ - **Alternative Fix:** Add provider to each alternative in agent.yaml
220
+
221
+ **Missing `reasoning` field support:**
222
+ - **Errors:** Unrecognized keys `reasoning` in llm and alternatives
223
+ - **Current Design:** Uses reasoning to document WHY this LLM was chosen
224
+ - **Schema Impact:** Should add optional `reasoning: string` to `BaseLLMConfigSchema`
225
+ - **Rationale:** Documentation of LLM selection is critical for maintainability
226
+
227
+ **Missing `version` field:**
228
+ - **Error:** Unrecognized key `version` in spec.llm
229
+ - **Current Design:** Documents exact model version (claude-sonnet-4-5-20251101)
230
+ - **Schema Impact:** Should add optional `version: string` to LLM config
231
+ - **Rationale:** Model versions change behavior; explicit version prevents surprises
232
+
233
+ #### 7-8. Tool Definition Issues
234
+
235
+ **Invalid tool type:**
236
+ - **Error:** Expected 'mcp' | 'library' | 'builtin', received 'function'
237
+ - **Current Design:** Uses `type: function` for inline tool definitions
238
+ - **Schema Impact:** Should add 'function' to tool type enum
239
+ - **Rationale:** Agents need inline function definitions for custom validation
240
+
241
+ **Missing tool schema fields:**
242
+ - **Errors:** Unrecognized keys `reasoning`, `inputSchema`, `outputSchema`
243
+ - **Current Design:** Tools include JSON Schema definitions inline
244
+ - **Schema Impact:** Should add these fields to `ToolSchema`
245
+ - **Rationale:**
246
+ - `reasoning`: Documents why tool is needed
247
+ - `inputSchema`/`outputSchema`: Type safety for tool I/O
248
+
249
+ #### 9. Resource Structure Mismatch
250
+
251
+ - **Error:** Expected object (ResourceRegistry), received array
252
+ - **Current Design:** agent.yaml uses array of resource objects
253
+ - **Schema Impact:** Two options:
254
+ 1. **Keep schema as-is:** Requires agent.yaml to use named resource registry
255
+ 2. **Add array support:** Allow both array and record formats
256
+ - **Analysis:** Array format is more intuitive for simple cases, but registry provides:
257
+ - Named resource references (better for `$ref` in prompts)
258
+ - Resource grouping and organization
259
+ - Better for tooling (resource lookup by name)
260
+ - **Recommendation:** Update agent.yaml to use registry format (better long-term)
261
+
262
+ #### 10. Credentials Structure Mismatch
263
+
264
+ - **Error:** Expected object with `agent` array, received array directly
265
+ - **Current Design:** agent.yaml uses `credentials: [{name, provider, ...}]`
266
+ - **Schema Expects:** `credentials: { agent: [{name, ...}] }`
267
+ - **Schema Impact:** The schema is correct here - supports future extension
268
+ - **Fix:** Update agent.yaml to wrap credentials in object structure
269
+
270
+ #### 11. Missing Phase 1 Fields in spec
271
+
272
+ **Unrecognized keys: validation, context, workflow**
273
+
274
+ These are critical agent features that need schema support:
275
+
276
+ **validation field:**
277
+ ```yaml
278
+ validation:
279
+ inputValidation: strict
280
+ outputValidation: strict
281
+ reasoning: ...
282
+ ```
283
+ - **Purpose:** Specifies validation enforcement level
284
+ - **Schema Impact:** Add `ValidationConfigSchema` to AgentSpec
285
+ - **Rationale:** Agents need explicit validation strategies
286
+
287
+ **context field:**
288
+ ```yaml
289
+ context:
290
+ maxTokens: 200000
291
+ strategy: hierarchical
292
+ reasoning: ...
293
+ ```
294
+ - **Purpose:** Documents context management approach
295
+ - **Schema Impact:** Add `ContextConfigSchema` to AgentSpec
296
+ - **Rationale:** Context strategy affects agent performance and cost
297
+
298
+ **workflow field:**
299
+ ```yaml
300
+ workflow:
301
+ phases:
302
+ - name: GATHER
303
+ description: ...
304
+ reasoning: ...
305
+ ```
306
+ - **Purpose:** Documents multi-phase agent workflows
307
+ - **Schema Impact:** Add `WorkflowConfigSchema` to AgentSpec
308
+ - **Rationale:** Complex agents need explicit workflow documentation
309
+
310
+ #### 12. Missing `build` field at root
311
+
312
+ - **Error:** Unrecognized key `build` at root
313
+ - **Current Location:** Root level alongside metadata/spec
314
+ - **Schema Location:** build metadata is INSIDE metadata.build
315
+ - **Fix:** Move build block into metadata.build in agent.yaml
316
+
317
+ ### Schema Refinements Needed for Phase 1
318
+
319
+ Based on validation results, these schema changes are required:
320
+
321
+ **High Priority (blocking agent design patterns):**
322
+
323
+ 1. **Add reasoning fields everywhere** - LLM, tools, resources, credentials
324
+ - Pattern: Every major decision should be documentable
325
+ - Impact: All config schemas need optional `reasoning: string`
326
+
327
+ 2. **Add validation, context, workflow configs** - Core agent features
328
+ - These aren't optional "Phase 2" features
329
+ - Agents actively use these in their design
330
+
331
+ 3. **Add tool function type and schema fields**
332
+ - Inline tool definitions are essential
333
+ - `inputSchema`/`outputSchema` provide type safety
334
+
335
+ 4. **Add LLM version field**
336
+ - Model versions matter for reproducibility
337
+ - Should be optional (falls back to latest)
338
+
339
+ **Medium Priority (improves developer experience):**
340
+
341
+ 5. **Add metadata.repository field**
342
+ - Improves agent discoverability and trust
343
+
344
+ 6. **Consider allowing array format for resources**
345
+ - More intuitive for simple cases
346
+ - Could support both array and registry formats
347
+
348
+ **Low Priority (nice to have):**
349
+
350
+ 7. **Make alternatives[].provider optional**
351
+ - Could inherit from parent LLM config
352
+ - Reduces repetition in manifest
353
+
354
+ ### Fixes Applied to agent.yaml
355
+
356
+ **Applied fixes (validation now passes):**
357
+
358
+ 1. **Moved build block into metadata.build** ✅
359
+ - Was: Root-level `build:` field
360
+ - Now: `metadata.build.timestamp` and `metadata.build.vatVersion`
361
+ - Rationale: Schema correctly places build metadata inside agent metadata
362
+
363
+ 2. **Wrapped credentials in object structure** ✅
364
+ - Was: `credentials: [{name, ...}]` (array directly)
365
+ - Now: `credentials: { agent: [{name, ...}] }`
366
+ - Rationale: Schema structure supports future credential types (agent, tool, resource)
367
+
368
+ 3. **Converted resources array to registry format** ✅
369
+ - Was: `resources: [{type, path, ...}]` (array)
370
+ - Now: `resources: { system_prompt: {path, type}, ... }` (named registry)
371
+ - Rationale: Named registry enables `$ref` lookups and better tooling support
372
+
373
+ 4. **Added provider to each alternative** ✅
374
+ - Was: `alternatives: [{model: ...}]`
375
+ - Now: `alternatives: [{provider: anthropic, model: ...}]`
376
+ - Rationale: Schema requires provider (cannot inherit from parent currently)
377
+
378
+ 5. **Removed LLM reasoning and version fields** ⚠️ Temporarily
379
+ - Removed `reasoning` (documents WHY this LLM)
380
+ - Removed `version` (exact model version identifier)
381
+ - Impact: Lost important documentation and reproducibility info
382
+ - Future: Should be added to schema as optional fields
383
+
384
+ 6. **Removed tool reasoning and schema fields** ⚠️ Temporarily
385
+ - Removed `reasoning` (documents WHY this tool)
386
+ - Removed `inputSchema`/`outputSchema` (type definitions)
387
+ - Changed type from `function` to `library`
388
+ - Impact: Lost tool documentation and type safety
389
+ - Future: Should be added to schema
390
+
391
+ 7. **Removed validation, context, workflow configs** ⚠️ Temporarily
392
+ - Removed `spec.validation` (input/output validation strategy)
393
+ - Removed `spec.context` (context management approach)
394
+ - Removed `spec.workflow` (multi-phase workflow documentation)
395
+ - Impact: Lost critical agent behavior documentation
396
+ - Future: These need schema support as they're core Phase 1 features
397
+
398
+ **Validation Result:** ✅ PASSED
399
+
400
+ The agent.yaml now validates successfully, but we've temporarily removed fields that should be part of the Phase 1 schema. These removals are documented as schema refinement requirements.
401
+
402
+ **Additional Changes:**
403
+
404
+ 8. **Added docs/**/*.ts to ESLint ignores**
405
+ - Validation scripts in docs/ are not part of the build project
406
+ - ESLint was failing because validate-agent.ts wasn't in tsconfig.eslint.json
407
+ - Pattern `docs/**/*.ts` excludes documentation scripts from linting
408
+ - Alternative would be to create separate tsconfig for docs (overkill for Phase 1)
409
+
410
+ ### Recommendations for agent-schema Package
411
+
412
+ **Immediate actions (before Phase 1 complete):**
413
+
414
+ 1. Add `reasoning` field to all config schemas (string, optional)
415
+ 2. Add `ValidationConfigSchema`, `ContextConfigSchema`, `WorkflowConfigSchema`
416
+ 3. Add 'function' to tool type enum
417
+ 4. Add `inputSchema`, `outputSchema` to ToolSchema
418
+ 5. Add `version` field to LLMConfigSchema
419
+ 6. Add `repository` field to AgentMetadataSchema
420
+
421
+ **Design questions to resolve:**
422
+
423
+ 1. Should resources support both array and registry formats?
424
+ 2. Should alternatives inherit provider from parent?
425
+ 3. Should reasoning be a pattern applied everywhere or selective?
426
+
427
+ **Impact on other packages:**
428
+
429
+ - These changes won't break existing schemas (all additions are optional)
430
+ - Will improve schema expressiveness for real-world agent designs
431
+ - May need to version schema (vat.dev/v1.1 vs v1.0)?
432
+
433
+ ### README Documentation Strategy
434
+
435
+ **Sections:**
436
+ 1. Purpose - Why this agent exists (forcing function)
437
+ 2. Usage - Input/output with examples
438
+ 3. Architecture - 4-phase workflow + LLM + tools + resources
439
+ 4. Design Validation - Schema validation results
440
+ 5. Testing Strategy - How to test in Phase 2
441
+ 6. Next Steps - Phases 2 and 3 plan
442
+ 7. Research Sources - Attribution
443
+
444
+ **Key Principles:**
445
+ - Concrete examples throughout
446
+ - Testing strategy documented (even though not implemented yet)
447
+ - Clear separation: Design (Phase 1.5) vs Implementation (Phase 2)
448
+ - Attribution to research sources
449
+
450
+ ## Future Improvements
451
+
452
+ ### Patterns for Reuse
453
+
454
+ The four-phase workflow pattern (GATHER → ANALYZE → DESIGN → GENERATE) discovered in agent-generator design is broadly applicable to other agent development scenarios:
455
+
456
+ **Phase Pattern Template:**
457
+
458
+ 1. **GATHER Phase** - Information collection through targeted questions
459
+ - Extract requirements, constraints, and context
460
+ - Guide users toward specificity without overwhelming
461
+ - Pattern reusable for: requirements gathering, problem analysis, domain expertise elicitation
462
+
463
+ 2. **ANALYZE Phase** - Pattern recognition and hypothesis formation
464
+ - Identify existing patterns in the problem space
465
+ - Ask follow-up questions to fill gaps
466
+ - Pattern reusable for: data analysis, architecture review, decision analysis
467
+
468
+ 3. **DESIGN Phase** - Architecture and implementation planning
469
+ - Make explicit trade-off decisions with reasoning
470
+ - Document alternatives and why they were rejected
471
+ - Pattern reusable for: system design, code reviews, technical planning
472
+
473
+ 4. **GENERATE Phase** - Output creation with validation
474
+ - Produce structured artifacts (code, configs, documentation)
475
+ - Validate outputs against schemas before returning
476
+ - Pattern reusable for: code generation, documentation generation, configuration synthesis
477
+
478
+ **Agents that could use this pattern:**
479
+ - API schema designer (GATHER requirements → ANALYZE endpoints → DESIGN schema → GENERATE OpenAPI)
480
+ - Architecture planner (GATHER requirements → ANALYZE tradeoffs → DESIGN system → GENERATE decision docs)
481
+ - Test strategy builder (GATHER coverage goals → ANALYZE risk areas → DESIGN test plan → GENERATE tests)
482
+ - Documentation generator (GATHER source code → ANALYZE structure → DESIGN TOC → GENERATE docs)
483
+
484
+ **Key characteristics of the pattern:**
485
+ - Each phase is self-contained but builds on previous phase output
486
+ - Agent explicitly documents reasoning for decisions in DESIGN phase
487
+ - Output is validated before returning (GENERATE phase responsibility)
488
+ - User can iterate by re-running earlier phases with new context
489
+
490
+ ### Meta-Learning
491
+
492
+ **What worked well in Phase 1:**
493
+
494
+ 1. **Schema-first design** - Validating agent.yaml against @vibe-agent-toolkit/agent-schema caught design issues early
495
+ - Prevented invalid configurations from being committed
496
+ - Schema gaps became clear design requirements for agent-schema package
497
+ - Validation feedback was actionable
498
+
499
+ 2. **Explicit phase documentation** - Making the 4-phase workflow visible in agent.yaml helps users understand what the agent does
500
+ - Phases documented in spec.workflow section
501
+ - Each phase has clear reasoning explaining its purpose
502
+ - Users can predict agent behavior without reading system prompt
503
+
504
+ 3. **Reasoning fields everywhere** - Documenting WHY each design decision was made improves maintainability
505
+ - LLM model choice justified in spec.llm.reasoning
506
+ - Tool inclusion justified in tools[].reasoning
507
+ - Validation strategy justified in spec.validation.reasoning
508
+ - Makes it easier to revisit decisions later
509
+
510
+ 4. **Separation of concerns** - Agent outputs data (JSON), not files
511
+ - Wrapper script handles file I/O and portability
512
+ - Agent focuses on design logic, not system integration
513
+ - Same agent output can be used in CLI, web, Claude Skills without modification
514
+
515
+ 5. **Examples in input schema** - Providing concrete examples for each input field significantly improves user guidance
516
+ - Users understand what level of detail is needed
517
+ - agent-generator adapts to both minimal and detailed inputs
518
+ - Examples are more efficient than detailed help text
519
+
520
+ **What needs improvement for Phase 2:**
521
+
522
+ 1. **Schema evolution management** - Agent-schema gaps were discovered during implementation
523
+ - 12 validation errors identified, requiring schema updates
524
+ - Future agents will encounter similar issues
525
+ - Consider: Iterative schema validation + feedback loop during agent design
526
+
527
+ 2. **System prompt length optimization** - 168 lines (~1000 tokens) is substantial
528
+ - Current design is readable and well-structured
529
+ - Could compress examples in Phase 2 if context becomes constrained
530
+ - Trade-off: Detail vs. token budget needs monitoring across agent suite
531
+
532
+ 3. **Tool definition patterns** - validate_agent_schema is single tool used
533
+ - Future agents may need 2-3 tools consistently
534
+ - Consider: Generic tool library in @vibe-agent-toolkit/cli for common patterns
535
+ - Examples: schema_validator, file_formatter, code_analyzer
536
+
537
+ 4. **Resource management** - Currently all resources are required references
538
+ - agent-generator works because it has 4 core resources (README, prompts, schemas)
539
+ - Larger agents may struggle with many optional resources
540
+ - Future: Consider resource priority levels (core, enhanced, optional)
541
+
542
+ 5. **Input validation before GATHER phase** - Currently agent adapts to missing fields
543
+ - No enforcement that minimal inputs are actually minimal
544
+ - Users could provide empty agentPurpose and get unhelpful output
545
+ - Future: Add input validation rules in schema (min string length, etc.)
546
+
547
+ 6. **Output consistency metrics** - No measurement of output quality/consistency across runs
548
+ - Same input + same LLM configuration should produce similar outputs
549
+ - No baseline for comparison or regression testing
550
+ - Future: Add test suite in Phase 2 with expected output examples
551
+
552
+ **Design decisions to revisit in Phase 2:**
553
+
554
+ 1. **Temperature setting (0.7)** - Chose for creative design with consistency
555
+ - May be too high for consistency in GENERATE phase
556
+ - Could use lower temperature for GENERATE, higher for ANALYZE
557
+ - Consider: Per-phase temperature configuration in spec.llm
558
+
559
+ 2. **Single LLM vs. multi-LLM** - Currently Claude Sonnet 4.5 for all phases
560
+ - GATHER/ANALYZE could use faster/cheaper models
561
+ - DESIGN/GENERATE benefit from more capable model
562
+ - Future: Implement multi-LLM routing based on phase
563
+
564
+ 3. **Validation strictness level** - Both input and output validation set to "strict"
565
+ - Strictness prevents edge cases from being discovered
566
+ - Could use "relaxed" during early phases, "strict" for final output
567
+ - Future: Per-phase validation configuration
568
+
569
+ 4. **Resource path references** - Resources use relative paths from agent.yaml
570
+ - Works for monorepo structure, unclear how it scales with package distribution
571
+ - What happens when agent is installed from npm?
572
+ - Future: Design resource resolution strategy for package distribution