Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
A comprehensive collection of Agent Skills for context engineering, multi-agent architectures, and production agent systems.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
examples/x-to-book-system/SKILLS-MAPPING.md
1# Skills Mapping: X-to-Book System23This document provides a detailed mapping between the Agent Skills for Context Engineering and the design decisions in the X-to-Book system PRD.45## Skill: multi-agent-patterns67### Concepts Applied89| Concept | Skill Reference | PRD Application |10|---------|-----------------|-----------------|11| Supervisor pattern | "The supervisor pattern places a central agent in control, delegating to specialists and synthesizing results." | Orchestrator agent coordinates Scraper, Analyzer, Synthesizer, Writer, Editor agents |12| Context isolation | "Sub-agents exist primarily to isolate context, not to anthropomorphize role division." | Each agent operates in clean context focused on its phase |13| Telephone game problem | "LangGraph benchmarks found supervisor architectures initially performed 50% worse due to the 'telephone game' problem where supervisors paraphrase sub-agent responses incorrectly." | Phase outputs stored in file system, not passed through Orchestrator for synthesis |14| File system coordination | "For complex tasks requiring shared state, agents read and write to persistent storage." | All inter-agent data flows through file system |15| Supervisor bottleneck mitigation | "Implement output schema constraints so workers return only distilled summaries." | Orchestrator receives phase summaries, never raw data |1617### Pattern Selection Rationale1819The skill describes three patterns:20211. **Supervisor/Orchestrator**: "When to use: Complex tasks with clear decomposition, tasks requiring coordination across domains."222. **Peer-to-Peer/Swarm**: "When to use: Tasks requiring flexible exploration, tasks where rigid planning is counterproductive."233. **Hierarchical**: "When to use: Large-scale projects with clear hierarchical structure."2425**Selected**: Supervisor/Orchestrator2627**Rationale**: Book production has clear sequential phases (scrape → analyze → synthesize → write → edit). Quality gates between phases require central coordination. Human oversight is important for content quality.2829---3031## Skill: context-fundamentals3233### Concepts Applied3435| Concept | Skill Reference | PRD Application |36|---------|-----------------|-----------------|37| Context as finite resource | "Context must be treated as a finite resource with diminishing marginal returns." | Explicit token budgets per agent (Orchestrator 50k, Writer 80k, etc.) |38| Progressive disclosure | "Progressive disclosure manages context efficiently by loading information only as needed." | Book outline loads first; chapter content loads only when Writer works on that chapter |39| Attention budget | "Models develop attention patterns from training data distributions where shorter sequences predominate." | Context limits set conservatively below model maximums |40| Tool output volume | "Tool outputs comprise the majority of tokens in typical agent trajectories, with research showing observations can reach 83.9% of total context usage." | Tweet data processed separately, never enters main agent contexts |4142### Context Budget Allocation4344From skill: "Design with explicit context budgets in mind. Know the effective context limit for your model and task."4546PRD implementation:4748```yaml49context_limits:50orchestrator: 50000 # Routing only, no raw data51scraper: 20000 # One account at a time52analyzer: 80000 # Pattern extraction53synthesizer: 100000 # Cross-account synthesis54writer: 80000 # Per-chapter drafting55editor: 60000 # Per-chapter review56```5758---5960## Skill: memory-systems6162### Concepts Applied6364| Concept | Skill Reference | PRD Application |65|---------|-----------------|-----------------|66| Vector store limitations | "Vector stores lose relationship information... cannot answer 'What products did customers who purchased Product Y also buy?'" | Selected knowledge graph for relationship queries between accounts |67| Temporal validity | "Temporal knowledge graphs add validity periods to facts. Each fact has a 'valid from' and optionally 'valid until' timestamp." | All relationships have temporal validity for tracking position evolution |68| Entity memory | "Entity memory specifically tracks information about entities to maintain consistency." | Account, Tweet, Theme, Book, Chapter entity types defined |6970### Memory Architecture Decision7172From skill: "Choose memory architecture based on requirements: Simple persistence needs → File-system memory; Semantic search needs → Vector RAG; Relationship reasoning needs → Knowledge graph; Temporal validity needs → Temporal knowledge graph."7374**Query requirements identified**:75- "What has @account said about AI in the last 30 days?" → Temporal + entity filtering76- "Which accounts disagree on crypto?" → Relationship traversal77- "How has @account's position evolved?" → Temporal queries7879**Selected**: Temporal Knowledge Graph8081---8283## Skill: context-optimization8485### Concepts Applied8687| Concept | Skill Reference | PRD Application |88|---------|-----------------|-----------------|89| Observation masking | "Observation masking replaces verbose tool outputs with compact references." | Raw tweet data stored in file system, not passed through context |90| Compaction triggers | "Trigger compaction after significant memory accumulation, when retrieval returns too many outdated results." | 70% context utilization triggers compaction |91| KV-cache optimization | "Place stable elements first (system prompt, tool definitions), then frequently reused elements, then unique elements last." | Context ordering: system prompt → tools → account config → daily outline → current task |9293### Optimization Strategy9495From skill: "When to optimize: Context utilization exceeds 70%, Response quality degrades as conversations extend."9697PRD implementation:98```python99COMPACTION_THRESHOLD = 0.7 # 70% context utilization100101if context_utilization > COMPACTION_THRESHOLD:102phase_outputs = compact_phase_outputs(phase_outputs)103```104105From skill: "What to apply: Tool outputs dominate → observation masking"106107PRD implementation: All raw tweet data (potentially 100k+ tokens/day) is masked by:1081. Scraper writes to file system1092. Analyzer reads from file system, produces summaries1103. Summaries (not raw data) flow to subsequent phases111112---113114## Skill: tool-design115116### Concepts Applied117118| Concept | Skill Reference | PRD Application |119|---------|-----------------|-----------------|120| Consolidation principle | "If a human engineer cannot definitively say which tool should be used in a given situation, an agent cannot be expected to do better." | 3 consolidated tools instead of 15+ narrow tools |121| Description structure | "Effective tool descriptions answer four questions: What does the tool do? When should it be used? What inputs does it accept? What does it return?" | All tools have explicit usage triggers and error recovery |122| Response format options | "Implementing response format options gives agents control over verbosity." | Tools support "concise" and "detailed" format parameters |123| Error message design | "Error messages must be actionable. They must tell the agent what went wrong and how to correct it." | Errors include recovery guidance (RATE_LIMITED includes retry_after) |124125### Tool Consolidation126127From skill: "Instead of implementing list_users, list_events, and create_event, implement schedule_event that handles the full workflow internally."128129PRD implementation:130131**Before consolidation** (what we avoided):132- `fetch_timeline`133- `fetch_thread`134- `fetch_engagement`135- `search_tweets`136- `store_entity`137- `query_entities`138- `update_validity`139- etc.140141**After consolidation**:142- `x_data_tool` - all X data operations143- `memory_tool` - all knowledge graph operations144- `writing_tool` - all content operations145146---147148## Skill: evaluation149150### Concepts Applied151152| Concept | Skill Reference | PRD Application |153|---------|-----------------|-----------------|154| Multi-dimensional rubrics | "Agent quality is not a single dimension. It includes factual accuracy, completeness, coherence, tool efficiency, and process quality." | 5 weighted dimensions: Source Accuracy, Thematic Coherence, Completeness, Insight Quality, Readability |155| LLM-as-judge | "LLM-based evaluation scales to large test sets and provides consistent judgments." | Automated evaluation for coherence and insight quality |156| Human evaluation | "Human evaluation catches what automation misses." | Trigger human review when score < 0.7 or source accuracy < 0.8 |157| Outcome-focused evaluation | "The solution is outcome-focused evaluation that judges whether agents achieve right outcomes while following reasonable processes." | Evaluate final book quality, not intermediate steps |158159### Evaluation Rubric160161From skill: "Effective rubrics cover key dimensions with descriptive levels."162163PRD implementation:164165| Dimension | Weight | Measurement |166|-----------|--------|-------------|167| Source Accuracy | 30% | Automated quote verification against original tweets |168| Thematic Coherence | 25% | LLM-as-judge for narrative flow |169| Completeness | 20% | Theme coverage calculation |170| Insight Quality | 15% | LLM-as-judge for synthesis beyond restating |171| Readability | 10% | Automated metrics + LLM judge |172173---174175## Cross-Skill Integration176177The skills are designed to work together. This example demonstrates integration patterns:178179| Integration | Skills Combined | Application |180|-------------|-----------------|-------------|181| Agent context budgets | multi-agent-patterns + context-fundamentals | Each agent has explicit limits based on role |182| File system coordination | multi-agent-patterns + context-optimization | Avoids context passing, enables masking |183| Memory-aware synthesis | memory-systems + context-optimization | Query relevant facts without loading full history |184| Quality-driven routing | evaluation + multi-agent-patterns | Orchestrator uses quality scores for phase gates |185186This integration is the core value proposition of the skills collection: they provide complementary patterns that address different aspects of context engineering while working together cohesively.187188