@vibe-agent-toolkit/vat-example-cat-agents 0.2.0-rc.5 → 0.2.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.
@@ -95,157 +95,8 @@ Use when decision requires human judgment.
95
95
 
96
96
  ## Detailed Workflow Orchestration
97
97
 
98
- ### Workflow A: Breed Selection (Conversational)
99
-
100
- **When:** User wants help finding the right cat breed.
101
-
102
- **Agent:** breed-advisor
103
-
104
- **Orchestration strategy:**
105
- 1. **Phase 1 - Gathering** (see Conversation Strategy)
106
- - Collect ≥4 factors including music preference
107
- - ONE question at a time (don't bombard)
108
- - Extract factors after each turn
109
- - Monitor readiness: `factorsCollected >= 4 && musicPreference != null`
110
-
111
- 2. **Phase 2 - Recommendation**
112
- - Present 3-5 matched breeds
113
- - Allow exploration, questions, comparisons
114
- - Use conversational formatting (not data dump)
115
-
116
- 3. **Phase 3 - Selection**
117
- - Detect selection signals ("I'll take", "sounds good")
118
- - Conclude gracefully
119
- - Provide next steps or exit instruction
120
-
121
- **Critical factor:** Music preference is the PRIMARY compatibility factor. Ask early, use as conversation anchor. See Music Preference Insight for mappings.
122
-
123
- **Reference implementation:** See cat-breed-selection.md for detailed breed selection orchestration.
124
-
125
- ### Workflow B: Photo Analysis Pipeline
126
-
127
- **When:** User provides a cat photo and wants analysis, name, or haiku.
128
-
129
- **Agents:** photo-analyzer → name-generator OR haiku-generator
130
-
131
- **Orchestration strategy:**
132
-
133
- ```
134
- Step 1: Analyze Photo
135
- - Input: Image path/URL
136
- - Agent: photo-analyzer
137
- - Output: CatCharacteristics
138
- - Note: Supports mock mode (reads EXIF) for testing
139
-
140
- Step 2: Generate Content
141
- - Input: CatCharacteristics from Step 1
142
- - Agent: name-generator OR haiku-generator
143
- - Output: NameSuggestion OR Haiku
144
-
145
- Optional Step 3: Validate
146
- - Input: Generated content + original characteristics
147
- - Agent: name-validator OR haiku-validator (pure functions)
148
- - Output: Validation result
149
- - If invalid: Retry Step 2 with feedback
150
- ```
151
-
152
- **Mockable behavior:** photo-analyzer reads EXIF metadata in mock mode. For production, set `mockable: false` to use real vision API.
153
-
154
- ### Workflow C: Text Description Pipeline
155
-
156
- **When:** User describes a cat in text (no photo).
157
-
158
- **Agents:** description-parser → name-generator OR haiku-generator
159
-
160
- **Orchestration strategy:**
161
-
162
- ```
163
- Step 1: Parse Description
164
- - Input: Text description
165
- - Agent: description-parser
166
- - Output: CatCharacteristics (same schema as photo-analyzer!)
167
-
168
- Step 2-3: Same as Workflow B
169
- - Multi-modal convergence: photo and text produce same schema
170
- - Downstream agents (name-gen, haiku-gen) work with either
171
- ```
172
-
173
- **Key insight:** Photo and text paths converge at `CatCharacteristics` schema. This enables multi-modal workflows without agent changes.
174
-
175
- ### Workflow D: Generate-Validate-Retry Loop
176
-
177
- **When:** Generator produces content that must pass validation rules.
178
-
179
- **Pattern:** Generator (LLM) + Validator (pure function) + Retry logic
180
-
181
- **Implementation:**
182
-
183
- ```typescript
184
- // Pseudo-code for orchestration
185
- let attempts = 0;
186
- const maxAttempts = 3;
187
-
188
- while (attempts < maxAttempts) {
189
- // Generate content
190
- const suggestion = await generator(characteristics);
191
-
192
- // Validate (pure function, instant)
193
- const validation = validator(suggestion, characteristics);
194
-
195
- if (validation.status === 'valid') {
196
- return suggestion; // Success!
197
- }
198
-
199
- // Retry with feedback
200
- attempts++;
201
- // Optional: Adjust approach based on validation.reason
202
- }
203
-
204
- throw new Error('Could not generate valid content after 3 attempts');
205
- ```
206
-
207
- **Why this pattern works:**
208
- - Generator has NO knowledge of validation rules (isolated concerns)
209
- - Validator is deterministic (pure function, fast)
210
- - Feedback loop tests multi-turn orchestration
211
- - ~60-70% initial rejection rate forces iteration
212
-
213
- **Agents using this pattern:**
214
- - name-generator + name-validator
215
- - haiku-generator + haiku-validator
216
-
217
- ### Workflow E: HITL Approval Gate
218
-
219
- **When:** Decision requires human judgment (compliance, taste, ethics).
220
-
221
- **Agent:** human-approval
222
-
223
- **Orchestration strategy:**
224
-
225
- ```
226
- Step 1: Prepare Request
227
- - Gather all necessary context
228
- - Format clearly for human reviewer
229
- - Include relevant data (characteristics, generated content, reasoning)
230
-
231
- Step 2: Emit Approval Request
232
- - Agent: human-approval
233
- - Input: Request payload
234
- - Behavior: Blocks waiting for response
235
- - Timeout: Configurable (default: 60s)
236
-
237
- Step 3: Handle Response
238
- - Approved: Continue workflow
239
- - Rejected: Handle gracefully (retry, inform user, etc.)
240
- - Timeout: Fall back to safe default or escalate
241
- ```
242
-
243
- **Mockable behavior:** Set `mockable: true` to auto-approve without human (useful for testing).
244
-
245
- **Real-world uses:**
246
- - Breeding application approval
247
- - Name selection from alternatives
248
- - Content moderation decisions
98
+ Step-by-step orchestration for each archetype — inputs, hand-offs and failure handling — is in
99
+ [workflow-orchestration.md](resources/workflow-orchestration.md).
249
100
 
250
101
  ## CLI Exposure for Pure Functions
251
102
 
@@ -526,9 +377,7 @@ Good: "What's your favorite type of music?" → [response] → "Great! Tell me a
526
377
  - Human Approval - HITL approval gate
527
378
 
528
379
  ### Related Documentation
529
- - Cat Breed Selection Skill - Detailed breed advisor orchestration
530
- - Package README - Human-facing documentation
531
- - Package Structure - Technical organization
380
+ - [Cat Breed Selection Skill](resources/cat-breed-selection.md) - Detailed breed advisor orchestration
532
381
 
533
382
  ## Success Criteria
534
383
 
@@ -565,166 +414,7 @@ Your orchestration is successful when:
565
414
  - Approval/rejection handled appropriately
566
415
  - User understands what happened
567
416
 
568
- ## Advanced Orchestration Patterns
569
-
570
- ### Pattern: Parallel Execution
571
-
572
- When agents don't depend on each other, run them in parallel.
573
-
574
- **Example:** Generate both name and haiku from same characteristics
575
-
576
- ```typescript
577
- const [name, haiku] = await Promise.all([
578
- generateCatName(characteristics),
579
- generateCatHaiku(characteristics),
580
- ]);
581
- ```
582
-
583
- **Benefits:** Faster execution, better user experience
584
-
585
- ### Pattern: Fallback Chain
586
-
587
- When one agent fails, try alternatives.
588
-
589
- **Example:** Photo analysis with text description fallback
590
-
591
- ```typescript
592
- let characteristics;
593
- try {
594
- characteristics = await analyzePhoto(imagePath);
595
- } catch {
596
- // Fallback to text description
597
- const description = await getUserDescription();
598
- characteristics = await parseDescription(description);
599
- }
600
- ```
601
-
602
- **Benefits:** Resilience, better error handling
603
-
604
- ### Pattern: Conditional Routing
605
-
606
- Choose agent path based on user input type.
607
-
608
- **Example:** Multi-modal input handling
609
-
610
- ```typescript
611
- if (input.type === 'image') {
612
- characteristics = await analyzePhoto(input.imagePath);
613
- } else if (input.type === 'text') {
614
- characteristics = await parseDescription(input.description);
615
- } else {
616
- // Conversational gathering
617
- characteristics = await breedAdvisor.gather();
618
- }
619
- ```
620
-
621
- **Benefits:** Flexible input handling, better UX
622
-
623
- ### Pattern: Staged Approval
624
-
625
- Break complex workflows into approval stages.
626
-
627
- **Example:** Multi-stage breeding application
628
-
629
- ```typescript
630
- // Stage 1: Basic info approval
631
- const basicApproval = await humanApproval({ stage: 'basic', data });
632
- if (!basicApproval.approved) return;
633
-
634
- // Stage 2: Detailed questionnaire
635
- const detailApproval = await humanApproval({ stage: 'detail', data });
636
- if (!detailApproval.approved) return;
637
-
638
- // Stage 3: Final review
639
- const finalApproval = await humanApproval({ stage: 'final', data });
640
- ```
641
-
642
- **Benefits:** Checkpoints prevent wasted work, clearer decision points
643
-
644
- ## CLI Integration Examples
645
-
646
- ### Example 1: Validate Name via CLI
647
-
648
- ```bash
649
- # Input
650
- echo '{
651
- "name": "Mr. Whiskers",
652
- "characteristics": {
653
- "physical": {
654
- "furColor": "Orange",
655
- "furPattern": "Tabby",
656
- "size": "medium"
657
- },
658
- "behavioral": {
659
- "personality": ["Playful", "Curious"]
660
- }
661
- }
662
- }' | vat agents validate-name
663
-
664
- # Output (stdout)
665
- {
666
- "status": "valid",
667
- "reason": "Name meets all quirky validation rules",
668
- "confidence": 0.95
669
- }
670
- ---
671
- # (stderr - empty if no errors)
672
- ```
673
-
674
- ### Example 2: Validate Haiku via CLI
675
-
676
- ```bash
677
- # Input
678
- echo '{
679
- "lines": [
680
- "Orange sunset fur",
681
- "Paws dance across the tatami",
682
- "Zen master purrs"
683
- ]
684
- }' | vat agents validate-haiku
685
-
686
- # Output (stdout)
687
- {
688
- "status": "valid",
689
- "syllableCounts": [5, 7, 5],
690
- "hasKigo": true,
691
- "kigo": "sunset",
692
- "hasKireji": false,
693
- "errors": []
694
- }
695
- ---
696
- # (stderr - empty if no errors)
697
- ```
698
-
699
- ### Example 3: Error Handling
700
-
701
- ```bash
702
- # Invalid input
703
- echo '{"invalid": "schema"}' | vat agents validate-name
704
-
705
- # Output
706
- # (stdout - empty)
707
- ---
708
- Error: Invalid input schema. Expected 'name' and 'characteristics' fields.
709
- Schema validation failed:
710
- - Missing required field: name
711
- - Missing required field: characteristics
712
- # (exit code: 2)
713
- ```
714
-
715
- ## Next Steps
716
-
717
- Once you've successfully orchestrated agents:
718
-
719
- 1. **Explore Combinations** - Try chaining agents in new ways
720
- 2. **Add Custom Validation** - Create your own quirky validation rules
721
- 3. **Build New Workflows** - Combine agents for complex use cases
722
- 4. **Contribute Patterns** - Share successful orchestration strategies
723
- 5. **Package Skills** - Create distributable skill packages with pure functions
724
-
725
- ## Questions?
417
+ ## Advanced Patterns and CLI Integration
726
418
 
727
- - **For orchestration patterns:** This file (SKILL.md)
728
- - **For agent-specific details:** See individual agent resources
729
- - **For implementation examples:** See examples/ directory
730
- - **For archetype theory:** See package README.md
419
+ Parallel, conditional and checkpointed orchestration, plus worked CLI request/response pairs,
420
+ are in [orchestration-patterns.md](resources/orchestration-patterns.md).
@@ -0,0 +1,233 @@
1
+ # Cat Breed Selection Skill
2
+
3
+ Guide for Claude Code to help users select cat breeds through conversational interaction.
4
+
5
+ ## Purpose: For Claude Code, Not the LLM
6
+
7
+ **Key distinction:**
8
+ - **This file** = Guidance for Claude Code (how to orchestrate)
9
+ - **Agent resources** = Content for the LLM (what to say/know)
10
+
11
+ This skill references agent resources via markdown links but doesn't duplicate LLM prompts.
12
+
13
+ ## When to Use This Skill
14
+
15
+ Trigger this skill when:
16
+ - User asks "What cat breed should I get?"
17
+ - User wants help finding a cat that fits their lifestyle
18
+ - User mentions getting a cat and needs guidance
19
+ - User asks about cat breed compatibility
20
+
21
+ ## High-Level Approach
22
+
23
+ Use the breed-advisor agent which implements a two-phase conversational pattern:
24
+
25
+ 1. **Gathering Phase**: Collect user preferences through natural conversation
26
+ 2. **Recommendation Phase**: Present matched breeds
27
+ 3. **Refinement Phase**: Answer questions, compare options
28
+ 4. **Selection Phase**: Help user make final choice
29
+
30
+ ## Key Factors to Gather
31
+
32
+ The agent needs these factors (see Factor Definitions for LLM-facing details):
33
+
34
+ ### Critical Factor: Music Preference 🎵
35
+
36
+ **Why this matters for orchestration:**
37
+ - This is the PRIMARY compatibility factor (novelty hook)
38
+ - Ask about it EARLY in the conversation
39
+ - If user seems confused, explain the music-breed connection
40
+ - See Music Preference Insight for the mapping
41
+
42
+ **Orchestration tip:** Don't just pass this through - use it as the conversation anchor. The quirky music angle makes the interaction memorable.
43
+
44
+ ### Other Factors
45
+ - Living Space (apartment → large house)
46
+ - Activity Level (couch-companion → high-energy-athlete)
47
+ - Grooming Tolerance (minimal → daily)
48
+ - Family Composition (single → multi-pet household)
49
+ - Allergies (boolean)
50
+
51
+ ## Conversation Orchestration
52
+
53
+ ### Phase 1: Gathering (Natural Dialogue)
54
+
55
+ **Goal:** Collect ≥4 factors including music preference
56
+
57
+ **Orchestration strategy:**
58
+ - ONE question at a time (don't bombard user)
59
+ - Start with music (it's unique and engaging)
60
+ - Use natural language (user says "big house" not "large-house")
61
+ - Extract factors after each turn (background process)
62
+
63
+ **Example flow:**
64
+ ```
65
+ Claude: [Welcome Message from agent resources]
66
+ User: "I like jazz"
67
+ Claude: [Acknowledges, asks about living space]
68
+ User: "I have a small apartment"
69
+ Claude: [Acknowledges, asks about activity level]
70
+ ...
71
+ ```
72
+
73
+ **When to transition:** ≥4 factors collected AND music preference known
74
+
75
+ ### Phase 2: Recommendations (Structured Presentation)
76
+
77
+ **Goal:** Present matched breeds, allow exploration
78
+
79
+ **Orchestration strategy:**
80
+ - Present 3-5 breed recommendations (from matchBreeds algorithm)
81
+ - Format conversationally (not a data dump)
82
+ - Allow user to ask questions about specific breeds
83
+ - User can request more details, compare breeds
84
+
85
+ **Example interaction:**
86
+ ```
87
+ Claude: [Presents 3 breeds with reasoning]
88
+ User: "Tell me more about Maine Coons"
89
+ Claude: [Detailed info about Maine Coons from breed database]
90
+ User: "How do they compare to Persians?"
91
+ Claude: [Comparison highlighting differences]
92
+ ```
93
+
94
+ ### Phase 3: Selection (Confirmation)
95
+
96
+ **Goal:** Detect final choice, conclude gracefully
97
+
98
+ **Orchestration strategy:**
99
+ - Watch for selection signals ("I'll take", "I want", "sounds good")
100
+ - Extract selection in background
101
+ - Conclude enthusiastically when selection detected
102
+ - Provide exit instruction (`/quit`)
103
+
104
+ ## What Claude Code Does vs What the LLM Does
105
+
106
+ ### Claude Code's Role (This Skill):
107
+ - **Orchestrates** the multi-turn conversation
108
+ - **Monitors** session state (which factors collected)
109
+ - **Triggers** phase transitions (gathering → recommendations → selection)
110
+ - **Manages** context (conversation history, extracted profile)
111
+ - **Calls** the breed-advisor agent at each turn
112
+
113
+ ### LLM's Role (Agent Resources):
114
+ - **Says** the actual prompts (Welcome Message, etc.)
115
+ - **Uses** the domain knowledge (Music Insight)
116
+ - **Follows** the extraction formats (Factor Extraction)
117
+ - **Applies** the conversation strategy (Conversation Strategy)
118
+
119
+ **Insight:** Skills provide meta-guidance on orchestration. Agents provide actual LLM content.
120
+
121
+ ## Shared vs Separate Content
122
+
123
+ ### What Belongs in Agent Resources (LLM-Facing):
124
+ ✅ System prompts and LLM instructions
125
+ ✅ Domain knowledge (music-breed mappings, factor definitions)
126
+ ✅ Extraction prompts (JSON schemas, format instructions)
127
+ ✅ Example conversations (few-shot learning)
128
+ ✅ Natural language mappings ("lazy" → "couch-companion")
129
+
130
+ ### What Belongs in Skills (Claude Code-Facing):
131
+ ✅ When to use the agent (trigger conditions)
132
+ ✅ How to orchestrate multi-turn flow (phase transitions)
133
+ ✅ What to monitor (readiness criteria, selection signals)
134
+ ✅ Debugging guidance (common issues, pitfalls)
135
+ ✅ Meta-strategy (why music first, one question at a time)
136
+
137
+ ### Overlap (Appears in Both):
138
+ ⚠️ Conversation flow structure (both need to understand phases)
139
+ ⚠️ Factor list (skill explains orchestration, agent explains to LLM)
140
+ ⚠️ Readiness criteria (skill monitors, agent implements)
141
+
142
+ **Resolution:** Keep agent resources authoritative for LLM content. Skills REFERENCE agent resources via links, don't duplicate.
143
+
144
+ ## Example: Music Preference Handling
145
+
146
+ ### In Agent Resources (breed-advisor.md):
147
+ ```markdown
148
+ ## Music Preference Insight
149
+ CRITICAL: Music preference is the MOST IMPORTANT factor...
150
+ - Classical: Calm, regal breeds (Persian, Ragdoll)
151
+ - Jazz: Intelligent, unpredictable breeds (Siamese, Bengal)
152
+ ...
153
+ ```
154
+ **Usage:** Injected into LLM system prompt
155
+
156
+ ### In Skills (This File):
157
+ ```markdown
158
+ ### Critical Factor: Music Preference
159
+ **Why this matters for orchestration:**
160
+ - Primary compatibility factor (novelty hook)
161
+ - Ask EARLY in conversation
162
+ - Use as conversation anchor
163
+ - See [Music Insight](../agents/breed-advisor.md#music-preference-insight) for mapping
164
+ ```
165
+ **Usage:** Guides Claude Code on HOW to orchestrate
166
+
167
+ **Key difference:** Agent says WHAT (the mappings), Skill says WHY and WHEN (orchestration strategy).
168
+
169
+ ## Common Pitfalls
170
+
171
+ ### ❌ Don't: Ask All Questions at Once
172
+ ```
173
+ Bad: "Tell me your music taste, living space, activity level, and family composition"
174
+ ```
175
+
176
+ ### ✅ Do: One Question at a Time
177
+ ```
178
+ Good: "What's your favorite type of music?"
179
+ [User responds]
180
+ Good: "Great! Tell me about your living space..."
181
+ ```
182
+
183
+ ### ❌ Don't: Skip Music Preference
184
+ Music is the hook! Don't forget to ask about it.
185
+
186
+ ### ✅ Do: Make Music Central
187
+ Start with music, emphasize its importance, use it as the anchor.
188
+
189
+ ## Debugging: When Things Go Wrong
190
+
191
+ **User provides unmappable music genre:**
192
+ - Don't silently map hip-hop → rock
193
+ - Ask user: "Hip-hop is great! Which category feels closest: rock, electronic, or pop?"
194
+ - Refer to Factor Definitions for clarification guidance
195
+
196
+ **User is vague about factors:**
197
+ - Push for specificity (see Conversation Strategy)
198
+ - Don't accept "I'm flexible" for all factors
199
+ - Need at least 4 concrete factors
200
+
201
+ **Conversation stalls:**
202
+ - Check if enough factors collected (≥4 + music)
203
+ - Transition to recommendations even if not all factors known
204
+ - User can refine later
205
+
206
+ ## Related Agent Resources
207
+
208
+ - Breed Advisor Agent - Complete agent specification
209
+ - Welcome Message - First turn greeting
210
+ - Music Preference Insight - Music-breed mappings
211
+ - Factor Definitions - All 6 factors explained
212
+ - Conversation Strategy - LLM guidance
213
+ - Factor Extraction Prompt - JSON extraction format
214
+ - Transition Message - Readiness announcement
215
+ - Recommendation Presentation - How to present breeds
216
+ - Selection Extraction - Detect final choice
217
+ - Conclusion Prompt - End conversation
218
+
219
+ ## Success Criteria
220
+
221
+ Conversation is successful when:
222
+ - User feels heard (not interrogated)
223
+ - Music preference made the conversation memorable
224
+ - At least 4 factors collected
225
+ - Breed recommendations feel personalized
226
+ - User makes a confident selection (or knows they want to research more)
227
+
228
+ ## Additional Resources
229
+
230
+ Once user selects a breed, you can optionally:
231
+ - Help them name their cat using Name Generator
232
+ - Provide care tips (future skill)
233
+ - Connect with breeders (future skill)