[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758P2AEBS36YNBTF68YQTNM":3,"skill-same:01M758P2AEBS36YNBTF68YQTNM":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M758P2AEBS36YNBTF68YQTNM","context-budget",null,"Token optimization, context budgeting, and memory management for AI agents. Includes thresholds, warnings, and compaction strategies.","davidcoachdev\u002Fdcfiles","davidcoachdev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F69812733?v=4","01M758C4BR16TAV1N47W319E9V","David H. Caycedo Blum.","01M758C4CCZA2ZYGA0BGMXCDRH",1,"MIT","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: context-budget\ndescription: Token optimization, context budgeting, and memory management for AI agents. Includes thresholds, warnings, and compaction strategies.\n---\n\n# Context Budget\n\nToken optimization, context budgeting, and memory management. Keeps AI agents efficient within context limits.\n\n## Context Limits\n\n| Model | Context | Warning | Critical |\n|-------|---------|---------|----------|\n| Haiku | 200K | 160K | 180K |\n| Sonnet | 200K | 160K | 180K |\n| Opus | 200K | 160K | 180K |\n| GPT-4 | 128K | 100K | 115K |\n| Claude 3.5 | 200K | 160K | 180K |\n\n## Budget Strategy\n\n### Conservative (Minimal)\n- System prompt: \u003C 5K tokens\n- Context: \u003C 50K tokens\n- Use for: Simple tasks, single-file changes\n\n### Balanced (Standard)\n- System prompt: \u003C 10K tokens\n- Context: \u003C 80K tokens\n- Use for: Most tasks, multi-file changes\n\n### Aggressive (Full)\n- System prompt: \u003C 15K tokens\n- Context: \u003C 150K tokens\n- Use for: Complex tasks, architectural decisions\n\n## Workflow\n\n### Phase 1 — Measure\n\n```bash\n# Count tokens (approximate)\necho \"$CONTEXT\" | wc -c | awk '{print $1\u002F4}'\n\n# Or use API\nopencode --token-count\n```\n\n### Phase 2 — Budget\n\nIf context > warning threshold:\n1. Enable throttling\n2. Use tail sampling (last N messages)\n3. Trigger compaction warning\n\nIf context > critical threshold:\n1. Force compaction\n2. Disable non-essential hooks\n3. Warn user\n\n### Phase 3 — Optimize\n\n```bash\n# Slim system prompt\n\u002Fcontext-budget --slim\n\n# Compact context\n\u002Fcontext-budget --compact\n\n# Archive old messages\n\u002Fcontext-budget --archive\n```\n\n## Token Optimization Techniques\n\n### 1. Slim Prompts\n\n**Before (bloated):**\n```\nYou are a senior software architect with 15+ years experience.\nYou have worked at Google, Meta, Amazon. You specialize in\nclean architecture, testing, and best practices. You're\nhelpful but also challenging when needed...\n```\n\n**After (concise):**\n```\nSenior Architect. 15+ yrs exp. Clean architecture, testing.\nHelpful, challenging when needed.\n```\n\n### 2. Lazy Loading\n\nOnly load what's needed:\n- Load skills on-demand\n- Use skill resolver\n- Don't pre-load everything\n\n### 3. Short References\n\n**Before:**\n```\nAs defined in our architecture decision record at \u002Fdocs\u002Fadr\u002F001.md:\n- We use hexagonal architecture\n- Ports and adapters pattern\n- Domain driven design\n```\n\n**After:**\n```\n(Ref: \u002Fdocs\u002Fadr\u002F001.md - hexagonal architecture, ports\u002Fadapters, DDD)\n```\n\n### 4. Compact History\n\nTail sampling (keep last N messages):\n```bash\n# Keep last 20 messages\ntail -n 20 conversation.json > compacted.json\n```\n\n## Warning Levels\n\n| Level | Threshold | Action |\n|-------|-----------|--------|\n| Green | \u003C 70% | Normal |\n| Yellow | 70-80% | Enable throttling |\n| Orange | 80-90% | Suggest compaction |\n| Red | > 90% | Force compaction |\n\n## Usage\n\n```bash\n# Check budget\n\u002Fcontext-budget --check\n\n# Slim prompts\n\u002Fcontext-budget --slim\n\n# Compact context\n\u002Fcontext-budget --compact\n\n# Set threshold\n\u002Fcontext-budget --threshold=100000\n```\n\n## Output Format\n\n```markdown\n## Context Budget\n\n### Current: 85,000 \u002F 200,000 tokens (43%)\n\n### Breakdown\n- System prompt: 12,000 tokens (6%)\n- Conversation: 65,000 tokens (33%)\n- Tools output: 8,000 tokens (4%)\n\n### Warning Level: GREEN ✅\n\n### Recommendations\n1. No action needed\n2. Context is well within limits\n```\n\n## Compaction Strategies\n\n### 1. Summarize Old Messages\nReplace old messages with summary.\n\n### 2. Archive\nMove old context to external storage.\n\n### 3. Prune Tool Outputs\nKeep only relevant tool outputs.\n\n### 4. Inline Small Files\nFor small files, inline directly instead of tool references.\n\n## Best Practices\n\n1. **Monitor continuously** - Check every N messages\n2. **Slim prompts** - Keep system prompt minimal\n3. **Lazy load** - Only load what's needed\n4. **Tail sampling** - Keep recent, archive old\n5. **Compact early** - Don't wait for critical\n","# Context Budget\n\nToken optimization, context budgeting, and memory management. Keeps AI agents efficient within context limits.\n\n## Context Limits\n\n| Model | Context | Warning | Critical |\n|-------|---------|---------|----------|\n| Haiku | 200K | 160K | 180K |\n| Sonnet | 200K | 160K | 180K |\n| Opus | 200K | 160K | 180K |\n| GPT-4 | 128K | 100K | 115K |\n| Claude 3.5 | 200K | 160K | 180K |\n\n## Budget Strategy\n\n### Conservative (Minimal)\n- System prompt: \u003C 5K tokens\n- Context: \u003C 50K tokens\n- Use for: Simple tasks, single-file changes\n\n### Balanced (Standard)\n- System prompt: \u003C 10K tokens\n- Context: \u003C 80K tokens\n- Use for: Most tasks, multi-file changes\n\n### Aggressive (Full)\n- System prompt: \u003C 15K tokens\n- Context: \u003C 150K tokens\n- Use for: Complex tasks, architectural decisions\n\n## Workflow\n\n### Phase 1 — Measure\n\n```bash\n# Count tokens (approximate)\necho \"$CONTEXT\" | wc -c | awk '{print $1\u002F4}'\n\n# Or use API\nopencode --token-count\n```\n\n### Phase 2 — Budget\n\nIf context > warning threshold:\n1. Enable throttling\n2. Use tail sampling (last N messages)\n3. Trigger compaction warning\n\nIf context > critical threshold:\n1. Force compaction\n2. Disable non-essential hooks\n3. Warn user\n\n### Phase 3 — Optimize\n\n```bash\n# Slim system prompt\n\u002Fcontext-budget --slim\n\n# Compact context\n\u002Fcontext-budget --compact\n\n# Archive old messages\n\u002Fcontext-budget --archive\n```\n\n## Token Optimization Techniques\n\n### 1. Slim Prompts\n\n**Before (bloated):**\n```\nYou are a senior software architect with 15+ years experience.\nYou have worked at Google, Meta, Amazon. You specialize in\nclean architecture, testing, and best practices. You're\nhelpful but also challenging when needed...\n```\n\n**After (concise):**\n```\nSenior Architect. 15+ yrs exp. Clean architecture, testing.\nHelpful, challenging when needed.\n```\n\n### 2. Lazy Loading\n\nOnly load what's needed:\n- Load skills on-demand\n- Use skill resolver\n- Don't pre-load everything\n\n### 3. Short References\n\n**Before:**\n```\nAs defined in our architecture decision record at \u002Fdocs\u002Fadr\u002F001.md:\n- We use hexagonal architecture\n- Ports and adapters pattern\n- Domain driven design\n```\n\n**After:**\n```\n(Ref: \u002Fdocs\u002Fadr\u002F001.md - hexagonal architecture, ports\u002Fadapters, DDD)\n```\n\n### 4. Compact History\n\nTail sampling (keep last N messages):\n```bash\n# Keep last 20 messages\ntail -n 20 conversation.json > compacted.json\n```\n\n## Warning Levels\n\n| Level | Threshold | Action |\n|-------|-----------|--------|\n| Green | \u003C 70% | Normal |\n| Yellow | 70-80% | Enable throttling |\n| Orange | 80-90% | Suggest compaction |\n| Red | > 90% | Force compaction |\n\n## Usage\n\n```bash\n# Check budget\n\u002Fcontext-budget --check\n\n# Slim prompts\n\u002Fcontext-budget --slim\n\n# Compact context\n\u002Fcontext-budget --compact\n\n# Set threshold\n\u002Fcontext-budget --threshold=100000\n```\n\n## Output Format\n\n```markdown\n## Context Budget\n\n### Current: 85,000 \u002F 200,000 tokens (43%)\n\n### Breakdown\n- System prompt: 12,000 tokens (6%)\n- Conversation: 65,000 tokens (33%)\n- Tools output: 8,000 tokens (4%)\n\n### Warning Level: GREEN ✅\n\n### Recommendations\n1. No action needed\n2. Context is well within limits\n```\n\n## Compaction Strategies\n\n### 1. Summarize Old Messages\nReplace old messages with summary.\n\n### 2. Archive\nMove old context to external storage.\n\n### 3. Prune Tool Outputs\nKeep only relevant tool outputs.\n\n### 4. Inline Small Files\nFor small files, inline directly instead of tool references.\n\n## Best Practices\n\n1. **Monitor continuously** - Check every N messages\n2. **Slim prompts** - Keep system prompt minimal\n3. **Lazy load** - Only load what's needed\n4. **Tail sampling** - Keep recent, archive old\n5. **Compact early** - Don't wait for critical\n",{"name":5,"description":7},"main","5dc86f90a5cbe45db3acd917825461b3ed6937fb","config\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget",0,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev","🌐 Apasionado por crear soluciones web escalables y eficientes. \r\n🧑‍🏫 Coach Dev.\r\n💻 Frontend Dev. \r\n🎚️Backend Dev.\r\n📊 Agile\u002FScrum.\r\n🚀100% remoto.","2026-08-26 07:28:05",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add davidcoachdev\u002Fdcfiles --skill context-budget",{"tool":38,"command":39},"bunx","bunx skills add davidcoachdev\u002Fdcfiles --skill context-budget",{"tool":41,"command":42},"pnpm","pnpm dlx skills add davidcoachdev\u002Fdcfiles --skill context-budget","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget\u002FSKILL.md",true,[46,52,58,62,66],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},".skill-meta.json","REFERENCE","参考文档",371,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget\u002F.skill-meta.json",{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"assets\u002F01-template.md","ASSET","资产文件",30,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget\u002Fassets\u002F01-template.md",{"path":59,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":60,"sourceHtmlUrl":61},"README.md",431,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget\u002FREADME.md",{"path":63,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002F01-overview.md",32,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget\u002Freferences\u002F01-overview.md",{"path":67,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002F02-usage.md",24,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fcontext-budget\u002Freferences\u002F02-usage.md",[71,79,86,93,100,107],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7740FETMZY1VTYAEFY1TWY7","zustand-5","Zustand 5 state management patterns. Trigger: When managing React state with Zustand.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fzustand-5\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M773ZZM9V68SA1AKP4WF4J29","zod-4","Zod 4 schema validation patterns. Trigger: When using Zod for validation - breaking changes from v3.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fzod-4\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M773ZJFR90CQAY0N9QR40QVP","x-bookmark-quote-posts","Workflow para revisar bookmarks de X\u002FTwitter y convertirlos en drafts de quote posts. Accede a la sección de bookmarks vía browser headless, extrae posts recientes, y genera drafts con voz personal del usuario. No publica ni muta X — solo genera contenido para revisión. Trigger: X bookmarks, Twitter bookmarks, quote posts, bookmark automation, crear quote posts, revisar bookmarks, growth content X.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fx-bookmark-quote-posts\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M773Z2RGV3786FV310SDB0YD","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M773YJH3KDSW467CSS63CSRJ","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":75,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":19},"01M773Y3S3H2CPRK5S8YFHWB5C","work-unit-commits","Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwork-unit-commits\u002FSKILL.md",[],[]]