[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7591N58DTK3MZX4SVGC9CTP":3,"skill-same:01M7591N58DTK3MZX4SVGC9CTP":76},{"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":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M7591N58DTK3MZX4SVGC9CTP","context-engineering",null,"Context design for agents: pre-fetch, compaction, envelopes.","lukemcqueen\u002Fsteadfaste-fleet","lukemcqueen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F405240?v=4","01M757MHPAGRXTJAT46SKZP98R","Luke McQueen","01M757MHPZ573KP8DT9GB8SBQ7",4,"MIT","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcontext-engineering\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: context-engineering\ndescription: \"Context design for agents: pre-fetch, compaction, envelopes.\"\nversion: 1.0.0\nauthor: Steadfaste Fleet (Esther, from verified 12-Factor Agents research, 2026-08-24)\nlicense: MIT\nplatforms: [linux, macos]\nmetadata:\n  hermes:\n    tags: [context-engineering, agents, pre-fetch, compaction, context-window, 12-factor, prompt-design]\n    related_skills: [software-factory, session-manager, memory-architecture, autonomous-ai-agents]\n---\n\n# Context Engineering for Coding Agents\n\nThe context window is the ONLY primitive: tokens in → tokens out. Get the\nbest inputs to get the best outputs. This skill captures the verified\npatterns from Dex Horthy's 12-Factor Agents (F3 own-your-context-window,\nF13 pre-fetch) and how they were implemented in Steadfaste Fleet.\n\nFull research bank: `references\u002F12-factor-agents.md`.\n\n## When to Use\n\n- Designing what context an agent receives before\u002Fduring a task (dispatch\n  envelopes, cron prompts, subagent delegation).\n- Adding pre-fetch of likely-needed context (repo rules, plans, history).\n- Choosing what to compact vs keep when a session grows long.\n- Building docs\u002Fadr + docs\u002Fexternal so context lives in the codebase.\n\n## Core principles (F3 — own your context window)\n\n1. **Information density over message shape.** XML\u002FYAML tagged blocks in a\n   single user message often beat standard chat turns — same info, fewer\n   tokens, more attention.\n2. **Compact at ~50% (\"dumb zone\").** Decide the hard things EARLY in the\n   context window, write them to docs, restart fresh. Don't let a session\n   run to 90% full before compacting.\n3. **Own the format.** If the default message format wastes tokens, build\n   your own. You want the flexibility to try EVERYTHING.\n4. **Hide resolved errors.** Once a failure is handled, don't keep it in\n   the window — it distracts and invites re-derivation loops.\n\n## Core principle (F13 — pre-fetch deterministically)\n\n> \"If you already know what tools you'll want the model to call, call them\n> DETERMINISTICALLY and let the model do the hard part of figuring out how\n> to use their outputs.\"\n\nDon't tell the agent \"you may want to fetch X\" — fetch X and include the\noutput. Free CPU ≠ inference tokens; pre-fetching costs CPU, letting the\nmodel fetch costs tokens + round-trips + drift.\n\n## Implemented pattern (Steadfaste Fleet, 2026-08-24)\n\n`ops\u002Fscripts\u002Fexecutor_context_builder.py` — deterministic pre-fetch into\nthe execution_request envelope before dispatch. Sections in priority order,\nbudget-capped (~6000 chars, F3):\n\n1. REPOSITORY RULES (AGENTS.md) + AGENT GOVERNANCE (CLAUDE.md)\n2. PLAN (orchestrator-written slice plan)\n3. TASK\n4. RECENT GIT HISTORY\n5. WORKTREE CHANGES (uncommitted diff stat)\n\nPitfalls learned building it:\n- **Budget enforcement packs sections in priority order until full** —\n  truncate the last block, never drop high-value rules.\n- **Missing repo → return an error marker, never raise** (fail-open for\n  the caller).\n- **Missing\u002Finvalid plan is fine** — task alone still builds an envelope.\n- **Never invent env names** — survey the registry (docs\u002Fenv-vars.md)\n  before introducing a variable.\n\n## Context-in-the-codebase (point 7)\n\nFiles on disk are free context. `docs\u002Fadr\u002F` for durable decisions\n(context\u002Fdecision\u002Fconsequences, never rewrite — supersede), `docs\u002Fexternal\u002F`\nfor env var NAMES (never values) + third-party services. A fresh session\nshould read these instead of re-deriving or asking.\n\n## Pitfalls\n\n- **parse_pass_pct-style regex traps**: when parsing tool output for\n  context\u002Fscoring, search each token independently ('N passed', 'N failed',\n  'N errors') — junk tokens between them ('69 warnings') break\n  single-regex parsers and silently score wrong (errors scored as 100%\n  pass, 2026-08-24).\n- **Compaction is not free**: each micro-compact pass is a real model call\n  and can break the provider prompt-cache prefix (bills as new input).\n  Weigh cache-hit value vs compaction frequency (F3 + F13 tradeoff).\n- **Pre-fetch is a bonus, never a blocker**: if the context builder fails,\n  the dispatch must still proceed with empty context — wrap in try\u002Fexcept,\n  never fail the request.\n\n## References\n\n- `references\u002F12-factor-agents.md` — full verified research: 13 factors,\n  video points (software-factory model, program design, benchmarks-vs-\n  maintainability), the HC implementation map.\n","# Context Engineering for Coding Agents\n\nThe context window is the ONLY primitive: tokens in → tokens out. Get the\nbest inputs to get the best outputs. This skill captures the verified\npatterns from Dex Horthy's 12-Factor Agents (F3 own-your-context-window,\nF13 pre-fetch) and how they were implemented in Steadfaste Fleet.\n\nFull research bank: `references\u002F12-factor-agents.md`.\n\n## When to Use\n\n- Designing what context an agent receives before\u002Fduring a task (dispatch\n  envelopes, cron prompts, subagent delegation).\n- Adding pre-fetch of likely-needed context (repo rules, plans, history).\n- Choosing what to compact vs keep when a session grows long.\n- Building docs\u002Fadr + docs\u002Fexternal so context lives in the codebase.\n\n## Core principles (F3 — own your context window)\n\n1. **Information density over message shape.** XML\u002FYAML tagged blocks in a\n   single user message often beat standard chat turns — same info, fewer\n   tokens, more attention.\n2. **Compact at ~50% (\"dumb zone\").** Decide the hard things EARLY in the\n   context window, write them to docs, restart fresh. Don't let a session\n   run to 90% full before compacting.\n3. **Own the format.** If the default message format wastes tokens, build\n   your own. You want the flexibility to try EVERYTHING.\n4. **Hide resolved errors.** Once a failure is handled, don't keep it in\n   the window — it distracts and invites re-derivation loops.\n\n## Core principle (F13 — pre-fetch deterministically)\n\n> \"If you already know what tools you'll want the model to call, call them\n> DETERMINISTICALLY and let the model do the hard part of figuring out how\n> to use their outputs.\"\n\nDon't tell the agent \"you may want to fetch X\" — fetch X and include the\noutput. Free CPU ≠ inference tokens; pre-fetching costs CPU, letting the\nmodel fetch costs tokens + round-trips + drift.\n\n## Implemented pattern (Steadfaste Fleet, 2026-08-24)\n\n`ops\u002Fscripts\u002Fexecutor_context_builder.py` — deterministic pre-fetch into\nthe execution_request envelope before dispatch. Sections in priority order,\nbudget-capped (~6000 chars, F3):\n\n1. REPOSITORY RULES (AGENTS.md) + AGENT GOVERNANCE (CLAUDE.md)\n2. PLAN (orchestrator-written slice plan)\n3. TASK\n4. RECENT GIT HISTORY\n5. WORKTREE CHANGES (uncommitted diff stat)\n\nPitfalls learned building it:\n- **Budget enforcement packs sections in priority order until full** —\n  truncate the last block, never drop high-value rules.\n- **Missing repo → return an error marker, never raise** (fail-open for\n  the caller).\n- **Missing\u002Finvalid plan is fine** — task alone still builds an envelope.\n- **Never invent env names** — survey the registry (docs\u002Fenv-vars.md)\n  before introducing a variable.\n\n## Context-in-the-codebase (point 7)\n\nFiles on disk are free context. `docs\u002Fadr\u002F` for durable decisions\n(context\u002Fdecision\u002Fconsequences, never rewrite — supersede), `docs\u002Fexternal\u002F`\nfor env var NAMES (never values) + third-party services. A fresh session\nshould read these instead of re-deriving or asking.\n\n## Pitfalls\n\n- **parse_pass_pct-style regex traps**: when parsing tool output for\n  context\u002Fscoring, search each token independently ('N passed', 'N failed',\n  'N errors') — junk tokens between them ('69 warnings') break\n  single-regex parsers and silently score wrong (errors scored as 100%\n  pass, 2026-08-24).\n- **Compaction is not free**: each micro-compact pass is a real model call\n  and can break the provider prompt-cache prefix (bills as new input).\n  Weigh cache-hit value vs compaction frequency (F3 + F13 tradeoff).\n- **Pre-fetch is a bonus, never a blocker**: if the context builder fails,\n  the dispatch must still proceed with empty context — wrap in try\u002Fexcept,\n  never fail the request.\n\n## References\n\n- `references\u002F12-factor-agents.md` — full verified research: 13 factors,\n  video points (software-factory model, program design, benchmarks-vs-\n  maintainability), the HC implementation map.\n",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"platforms":40,"description":7},"Steadfaste Fleet (Esther, from verified 12-Factor Agents research, 2026-08-24)","1.0.0",{"hermes":27},{"tags":28,"related_skills":35},[5,29,30,31,32,33,34],"agents","pre-fetch","compaction","context-window","12-factor","prompt-design",[36,37,38,39],"software-factory","session-manager","memory-architecture","autonomous-ai-agents",[41,42],"linux","macos","main","2e6aa8d15ab0a366c90be54f61bf9c6e97015e83","skills\u002Fsoftware-development\u002Fcontext-engineering",1,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet","steadfaste.com","https:\u002F\u002Fgithub.com\u002Flukemcqueen","AI Architect | Building Hermes Cortex: governed multi-agent AI for autonomous software engineering | Enterprise Tech Consultant","2026-11-14 22:33:34",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add lukemcqueen\u002Fsteadfaste-fleet --skill context-engineering",{"tool":58,"command":59},"bunx","bunx skills add lukemcqueen\u002Fsteadfaste-fleet --skill context-engineering",{"tool":61,"command":62},"pnpm","pnpm dlx skills add lukemcqueen\u002Fsteadfaste-fleet --skill context-engineering","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcontext-engineering\u002FSKILL.md",true,[66,72],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002F12-factor-agents.md","REFERENCE","参考文档",4676,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcontext-engineering\u002Freferences\u002F12-factor-agents.md",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fmessaging-gateway-envelope.md",4104,"https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fcontext-engineering\u002Freferences\u002Fmessaging-gateway-envelope.md",[77,85,92,99,106,113],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":84},"01M7DXY4G8NSVB59K8B6S2AQNP","macbook-linux-maintenance","Legacy MacBook Linux fixes: GPU wedge, reboot hang, thermal.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fmacbook-linux-maintenance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":84},"01M7DXXYJCXFJ3TGB84ZQ8KFE6","governance-regression-triage","Triage a host's governance issues: what changed.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fgovernance-regression-triage\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":84},"01M7DXXSAP1G8FDRJAMXQGBBMK","enforcement-immutability","Use when enforcement files lose their immutable flag.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fenforcement-immutability\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":84},"01M78SSDQVRYX64Y16X32TC0NS","steadfaste-fleet-repo-deploy","Use when committing to the steadfaste-fleet repo.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-repo-deploy\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":84},"01M78SS928F3R2RJAYVW4E30CE","steadfaste-fleet-maintenance","Maintain an installed Steadfaste Fleet instance — update both the upstream Hermes Agent and the fleet repo layer, merge diverged histories, sync skills safely, and troubleshoot common issues. Covers the dual-update workflow (hermes update + fleet-update.sh), encrypted brain data backup, mycortex import, and recovery techniques.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Fsteadfaste-fleet-maintenance\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":84},"01M78SP1CHW0T0BWE5ZT6JBPX8","fleet-preflight","DEPRECATED alias — merged into survey-before-action (2026-08-20). Load survey-before-action instead; its \"Repo-Specific Pre-Flight\" section covers git search, Hermes boundary, and deployment verification.","https:\u002F\u002Fgithub.com\u002Flukemcqueen\u002Fsteadfaste-fleet\u002Fblob\u002Fmain\u002Fskills\u002Fdevops\u002Ffleet-preflight\u002FSKILL.md",[],[]]