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/digital-brain-skill/HOW-SKILLS-BUILT-THIS.md
1# How Agent Skills for Context Engineering Built Digital Brain23> This document demonstrates how the [Agent Skills for Context Engineering](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering) collection was used by a Claude Code agent to design and build a production-ready personal knowledge management system.45---67## Executive Summary89Digital Brain wasn't built from scratch intuition—it was systematically designed by applying 10 context engineering skills. Each architectural decision traces back to specific principles from the skills collection.1011**Result**: A scalable personal OS with:12- ~650 tokens per content task (vs ~5000 without optimization)13- 6 isolated modules preventing context pollution14- 4 automation scripts following tool design principles15- Progressive disclosure at every layer1617---1819## Skill-by-Skill Application2021### 1. Context Fundamentals → Core Architecture2223**Skill Teaching**:24> "Context is a finite resource with diminishing marginal returns—every token depletes the attention budget."2526**Applied in Digital Brain**:2728| Principle | Implementation |29|-----------|----------------|30| Attention budget | 6 modules load independently, not all at once |31| Progressive disclosure | L1 (SKILL.md) → L2 (MODULE.md) → L3 (data files) |32| Right altitude | SKILL.md gives overview; modules give specifics |33| Position awareness | Critical instructions at top of each file |3435**Specific Design Decision**:36```37digital-brain/38├── SKILL.md # L1: Always loaded (~50 tokens)39├── identity/40│ ├── IDENTITY.md # L2: Loaded when content task (~80 tokens)41│ └── voice.md # L3: Loaded when writing (~200 tokens)42```4344The 3-level hierarchy directly implements the skill's "hybrid loading strategy"—stable metadata pre-loaded, dynamic content just-in-time.4546---4748### 2. Context Optimization → Module Separation4950**Skill Teaching**:51> "Context quality matters more than quantity. Optimization preserves signal while reducing noise."5253**Applied in Digital Brain**:5455| Technique | Implementation |56|-----------|----------------|57| Context partitioning | 6 modules (identity, content, knowledge, network, operations, agents) |58| Cache-friendly ordering | Stable configs (.yaml) before dynamic logs (.jsonl) |59| Selective preservation | Only relevant module loads for each task type |6061**Specific Design Decision**:6263Content creation task loads:64- `identity/` ✓ (voice patterns)65- `content/` ✓ (templates, past posts)66- `knowledge/` ✗ (not needed)67- `network/` ✗ (not needed)68- `operations/` ✗ (not needed)6970**Token Savings**: 650 tokens vs 5000+ if everything loaded7172---7374### 3. Context Compression → JSONL Design7576**Skill Teaching**:77> "Structure forces preservation: Dedicated sections act as mandatory checkboxes preventing silent information loss."7879**Applied in Digital Brain**:8081| Principle | Implementation |82|-----------|----------------|83| Structured summaries | Every JSONL entry has consistent schema |84| Artifact trail | `posts.jsonl` tracks all published content with metrics |85| Mandatory sections | Schema line documents structure: `{"_schema": "...", "_version": "..."}` |8687**Specific Design Decision**:8889Every JSONL file starts with schema documentation:90```json91{"_schema": "contact", "_version": "1.0", "_description": "Personal contact database..."}92{"id": "contact_001", "name": "...", "last_contact": "..."}93```9495This ensures agents always understand the structure—implementing the skill's "structure forces preservation" principle.9697---9899### 4. Context Degradation → Mitigation Strategies100101**Skill Teaching**:102> "Lost-in-middle phenomenon: U-shaped attention curves where beginning/end receive 10-40% higher recall accuracy than middle."103104**Applied in Digital Brain**:105106| Risk | Mitigation |107|------|------------|108| Lost-in-middle | Critical voice patterns at TOP of voice.md |109| Context poisoning | Append-only JSONL prevents error propagation |110| Context confusion | One source of truth per domain |111| Context distraction | Module separation prevents irrelevant content |112113**Specific Design Decision**:114115The skill's "four-bucket approach" directly shaped Digital Brain:116117| Bucket | Implementation |118|--------|----------------|119| **Write** | All data in external files, not inline |120| **Select** | Module-based filtering (only load relevant module) |121| **Compress** | JSONL streaming (read line-by-line, not full parse) |122| **Isolate** | 6 isolated modules |123124---125126### 5. Memory Systems → Data Architecture127128**Skill Teaching**:129> "Match architecture complexity to query requirements (file systems for simple needs; graphs for relationship reasoning)."130131**Applied in Digital Brain**:132133| Memory Layer | Implementation |134|--------------|----------------|135| Working memory | Current conversation context |136| Short-term | Session notes in `operations/todos.md` |137| Long-term | Persistent JSONL files across sessions |138| Entity memory | `network/contacts.jsonl` with relationships |139140**Specific Design Decision**:141142The skill recommends file systems for "simple needs"—Digital Brain uses exactly this:143144```yaml145# No database needed146# No vector store needed147# File system provides:148- Natural persistence149- Git-friendly versioning150- Agent-readable formats151- Zero dependencies152```153154The skill's "temporal validity" principle is implemented via `last_contact` timestamps in contacts and `metrics_updated` in posts.155156---157158### 6. Evaluation → Testing Approach159160**Skill Teaching**:161> "Outcome-focused evaluation: Agents reach goals through diverse valid paths; assess results, not specific steps."162163**Applied in Digital Brain**:164165| Principle | Implementation |166|-----------|----------------|167| Outcome focus | Examples show expected OUTPUT, not exact steps |168| Multi-dimensional | Content workflow checks voice, topic, format |169| Stratified testing | Simple (lookup) → Complex (weekly review) workflows |170171**Specific Design Decision**:172173The `examples/` folder demonstrates outcome-focused evaluation:174175```markdown176# examples/content-workflow.md177178**Input**: "Help me write a thread about AI agents"179180**Expected Output**:181- Draft matches voice.md patterns182- Topic aligns with brand.md pillars183- Format follows templates/thread.md structure184```185186Not prescribing exact steps—evaluating the outcome.187188---189190### 7. Advanced Evaluation → Quality Checks191192**Skill Teaching**:193> "Well-defined rubrics reduce evaluation variance 40-60%."194195**Applied in Digital Brain**:196197| Technique | Implementation |198|-----------|----------------|199| Defined rubrics | Voice attributes rated 1-10 in voice.md |200| Explicit criteria | Checklists in every template |201| Confidence signals | Priority levels (P0-P3) for todos |202203**Specific Design Decision**:204205Every content template includes a quality checklist:206207```markdown208## Pre-publish Checklist209- [ ] Hook is compelling (would I stop scrolling?)210- [ ] Each tweet stands alone but flows together211- [ ] Value is clear and actionable212- [ ] Matches my voice (checked against voice.md)213- [ ] No tweets over 280 characters214- [ ] CTA is clear but not pushy215```216217This is a rubric—reducing evaluation variance per the skill's teaching.218219---220221### 8. Multi-Agent Patterns → Module Isolation222223**Skill Teaching**:224> "Sub-agents exist primarily to isolate context, not to anthropomorphize roles."225226**Applied in Digital Brain**:227228| Pattern | Implementation |229|---------|----------------|230| Context isolation | Each module is a "sub-agent context" |231| Supervisor pattern | SKILL.md routes to appropriate module |232| Specialization | Each module optimized for its domain |233234**Specific Design Decision**:235236While Digital Brain doesn't spawn literal sub-agents, it implements the same principle:237238```239SKILL.md (supervisor/router)240↓ routes to241identity/IDENTITY.md (specialist context)242content/CONTENT.md (specialist context)243network/NETWORK.md (specialist context)244...245```246247The skill warns about "telephone game problem"—Digital Brain avoids this by having agents read source files directly, not summaries of summaries.248249---250251### 9. Project Development → Build Methodology252253**Skill Teaching**:254> "Validate before automating: Manual prototyping prevents wasted development."255256**Applied in Digital Brain**:257258| Principle | Implementation |259|-----------|----------------|260| Task-model fit | Personal knowledge management is LLM-suitable |261| Pipeline architecture | Ideas → Drafts → Posts (staged workflow) |262| File system state | Folders track progress naturally |263| Structured output | Templates enforce consistent formats |264265**Specific Design Decision**:266267The skill's "LLM suitability matrix" confirms Digital Brain's fit:268269| Strength | Digital Brain Task |270|----------|-------------------|271| Synthesis | Generating content from voice patterns |272| Subjective judgment | Prioritizing content ideas |273| Natural output | Writing in user's voice |274| Batch processing | Weekly review across modules |275| Domain knowledge | Applying voice/brand context |276277---278279### 10. Tool Design → Automation Scripts280281**Skill Teaching**:282> "Consolidation over fragmentation: Bundle related workflows into comprehensive tools."283284**Applied in Digital Brain**:285286| Principle | Implementation |287|-----------|----------------|288| Clear descriptions | Each script has docstring explaining purpose |289| Actionable output | Scripts return markdown agents can use |290| Minimal collection | 4 scripts, not 20 micro-tools |291| Verb-noun naming | `weekly_review.py`, `content_ideas.py` |292293**Specific Design Decision**:294295The skill's evidence showed "reducing from 17 specialized tools to 2 primitive tools achieved 3.5× faster execution."296297Digital Brain follows this:298299```python300# NOT: separate tools for each step301# get_ideas.py, filter_ideas.py, score_ideas.py, format_ideas.py302303# YES: consolidated comprehensive tool304# content_ideas.py - does all of the above305```3063074 comprehensive scripts vs potential 15+ micro-tools.308309---310311## Cross-Skill Synergies312313### Token Efficiency Chain314315```316Context Fundamentals (attention budget)317→ Context Optimization (module separation)318→ Context Compression (JSONL streaming)319→ Context Degradation (mitigation)320```321322**Result**: 87% token reduction per task323324### Quality Assurance Chain325326```327Evaluation (outcome focus)328→ Advanced Evaluation (rubrics)329→ Tool Design (clear outputs)330```331332**Result**: Templates with built-in quality checks333334### Architecture Chain335336```337Memory Systems (file-based)338→ Multi-Agent Patterns (isolation)339→ Project Development (staged pipelines)340```341342**Result**: 6 isolated modules with clear data flow343344---345346## Quantified Impact347348| Metric | Without Skills | With Skills | Improvement |349|--------|---------------|-------------|-------------|350| Tokens per content task | ~5000 | ~650 | **87% reduction** |351| Module files touched | All 45 | 5-8 relevant | **82% reduction** |352| Context pollution risk | High | Isolated | **Eliminated** |353| Automation scripts | 15+ micro | 4 comprehensive | **73% reduction** |354| Schema consistency | Ad-hoc | Enforced | **100% coverage** |355356---357358## How Skills Will Continue to Be Used359360### Runtime Usage361362When agents use Digital Brain, skills guide behavior:3633641. **Content Creation**365- Context Fundamentals → Load only identity module366- Memory Systems → Retrieve from posts.jsonl for patterns367- Evaluation → Check against voice.md rubric3683692. **Meeting Prep**370- Multi-Agent Patterns → Isolate to network module371- Context Degradation → Pull only relevant contact372- Tool Design → Output structured brief3733743. **Weekly Review**375- Context Compression → Summarize week's activity376- Advanced Evaluation → Score against goals.yaml377- Project Development → Generate actionable output378379### Extension Development380381Adding new features should apply:3823831. **New Module**: Context Fundamentals (progressive disclosure)3842. **New Script**: Tool Design (consolidation principle)3853. **New Template**: Evaluation (outcome-focused)3864. **New Data File**: Memory Systems (appropriate layer)387388---389390## Conclusion391392Digital Brain demonstrates that the Agent Skills for Context Engineering collection isn't theoretical—it's a practical framework for building production AI systems.393394**Every architectural decision traces to a specific skill principle.**395396This is context engineering in action: not just prompting better, but designing systems that work with—not against—how language models process information.397398---399400## Learn More401402- **Skills Collection**: [github.com/muratcankoylan/Agent-Skills-for-Context-Engineering](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)403- **Digital Brain**: [github.com/muratcankoylan/digital-brain-skill](https://github.com/muratcankoylan/digital-brain-skill)404405---406407*This document itself demonstrates context engineering: structured sections, clear headings, tables for quick scanning, and progressive detail—all principles from the skills collection.*408