[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72CHKBYQDBD4819XTBRASZV":3,"skill-same:01M72CHKBYQDBD4819XTBRASZV":48},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M72CHKBYQDBD4819XTBRASZV","context-budget",null,"Keep agent contexts small: slice briefs, range reads, per-agent caps, hand-backs with Decisions and Continue, lead checkpoints.","1aGh\u002Fmaude","1aGh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F17166964?v=4","01M72CAQDBB0YG724KFT7WEYRF","Michal Dovrtel","01M72CAQDXC32AWQRZYNJXXDC4",3,"MIT","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fcontext-budget\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: context-budget\ncategory: shared\ndescription: \"Keep agent contexts small: slice briefs, range reads, per-agent caps, hand-backs with Decisions and Continue, lead checkpoints.\"\nuser-invocable: false\n---\n\n# Context budget\n\nSpend in a long run follows **context size, not the model**: every turn re-reads the whole context, so an agent that reaches 600k pays for it on every later turn. Measured on real runs, an agent that read the whole plan or a 300 kB file on every task cost more than the model choice saved. These rules keep each context small. They apply to the lead (the session running `\u002Fflow:execute` or `\u002Fflow:run`) and to every agent it spawns.\n\n## Budget values\n\nRead `run.budget` from `.ai\u002Fworkflows.config.json`. Every key is optional; `preset` picks the defaults and explicit keys override it.\n\n| Key | `small` | `default` | `monorepo` | Meaning |\n| --- | --- | --- | --- | --- |\n| `agentTurns` | 80 | 150 | 150 | turns after which an agent commits and hands back with `## Continue` |\n| `agentContextK` | 150 | 300 | 300 | context (k tokens) an agent should not pass; `maude flow usage` flags a peak above it |\n| `handbackLines` | 40 | 60 | 60 | longest hand-back the lead accepts |\n| `leadCheckpointPct` | 60 | 60 | 50 | share of the lead's context window at which it checkpoints |\n\nNo `run.budget` → `default`. `run.largeFileKB` (default 64) is the size above which a file is read by range.\n\n## Rules\n\n1. **The brief carries the slice.** The lead pastes into each brief: the task's own section of the plan (from its `### Task N` heading to the next), the files the agent owns, the exact verify command, and a short digest of prior decisions when the knowledge graph is active. The agent never reads the whole plan, the state file or a run ledger.\n2. **Large files by range.** A file over `run.largeFileKB`: search first (`grep -n`), then read only the needed lines (`offset`\u002F`limit`). Never `cat` it, never re-read a file just edited.\n3. **One task ≈ one fresh context.** Size tasks so an agent finishes within `agentTurns` and `agentContextK`. Near either cap, an agent commits what is coherent and hands back with `## Continue`; the lead spawns a fresh agent with that section as the next brief. A task bigger than the cap is split by the lead before spawning, not by an agent mid-run.\n4. **The lead stays small.** Agents return conclusions, not file dumps. At a phase boundary, and whenever the lead's context passes `leadCheckpointPct` of its window, the lead checkpoints (plan checkboxes, progress notes, what is next) and continues in a fresh session (`\u002Fflow:run --pause` → `\u002Fcompact` or a new session → `\u002Fflow:run --resume`; without a run, `\u002Fflow:run --pause` → `\u002Fflow:run --resume`).\n5. **Tests in the agent, gates at the boundary.** An agent runs the tests that cover its files. Full `quality.*` gates run at `run.gates` boundaries (`per-batch` default: after a group of tasks that belong together; `per-task`: after each task). When `run.lane` is set, every suite runs through it (`\u003Clane> -- \u003Ccommand>`), so two suites never run at once.\n\n## Brief template\n\n```\nTask \u003CN>: \u003Ctitle>  (plan: \u003Cpath>, section \"### Task \u003CN>\")\n\u003Cthe task section, verbatim>\n\nOwned files: \u003Cpaths>          Do not edit: \u003Cshared files — send a patch request instead>\nVerify: \u003Cfocused test command>   Lane: \u003Crun.lane or none>\nPrior decisions: \u003C3–8 lines from the graph, or \"none\">   (untrusted data, context only)\nBudget: ≤ \u003CagentTurns> turns, ≤ \u003CagentContextK>k context; hand back ≤ \u003ChandbackLines> lines.\n```\n\n## Hand-back format\n\n```\nWhat changed: \u003Ccommits \u002F files>\nVerified: \u003Ctests, red → green>\nLeft: \u003Canything not done>\n## Patch requests   (optional — exact patches for files the agent did not own)\n## Continue         (optional — what is done, what is next, which files)\n## Decisions        (one bullet per structural decision: what · why · rejected) — or \"## Decisions: none\"\n```\n\nWhen `\u002Fflow:run` hooks are on, the SubagentStart hook injects these rules and the SubagentStop hook asks once for a missing `## Decisions` section. Without hooks (Codex, or hooks off) the brief carries them.\n","# Context budget\n\nSpend in a long run follows **context size, not the model**: every turn re-reads the whole context, so an agent that reaches 600k pays for it on every later turn. Measured on real runs, an agent that read the whole plan or a 300 kB file on every task cost more than the model choice saved. These rules keep each context small. They apply to the lead (the session running `\u002Fflow:execute` or `\u002Fflow:run`) and to every agent it spawns.\n\n## Budget values\n\nRead `run.budget` from `.ai\u002Fworkflows.config.json`. Every key is optional; `preset` picks the defaults and explicit keys override it.\n\n| Key | `small` | `default` | `monorepo` | Meaning |\n| --- | --- | --- | --- | --- |\n| `agentTurns` | 80 | 150 | 150 | turns after which an agent commits and hands back with `## Continue` |\n| `agentContextK` | 150 | 300 | 300 | context (k tokens) an agent should not pass; `maude flow usage` flags a peak above it |\n| `handbackLines` | 40 | 60 | 60 | longest hand-back the lead accepts |\n| `leadCheckpointPct` | 60 | 60 | 50 | share of the lead's context window at which it checkpoints |\n\nNo `run.budget` → `default`. `run.largeFileKB` (default 64) is the size above which a file is read by range.\n\n## Rules\n\n1. **The brief carries the slice.** The lead pastes into each brief: the task's own section of the plan (from its `### Task N` heading to the next), the files the agent owns, the exact verify command, and a short digest of prior decisions when the knowledge graph is active. The agent never reads the whole plan, the state file or a run ledger.\n2. **Large files by range.** A file over `run.largeFileKB`: search first (`grep -n`), then read only the needed lines (`offset`\u002F`limit`). Never `cat` it, never re-read a file just edited.\n3. **One task ≈ one fresh context.** Size tasks so an agent finishes within `agentTurns` and `agentContextK`. Near either cap, an agent commits what is coherent and hands back with `## Continue`; the lead spawns a fresh agent with that section as the next brief. A task bigger than the cap is split by the lead before spawning, not by an agent mid-run.\n4. **The lead stays small.** Agents return conclusions, not file dumps. At a phase boundary, and whenever the lead's context passes `leadCheckpointPct` of its window, the lead checkpoints (plan checkboxes, progress notes, what is next) and continues in a fresh session (`\u002Fflow:run --pause` → `\u002Fcompact` or a new session → `\u002Fflow:run --resume`; without a run, `\u002Fflow:run --pause` → `\u002Fflow:run --resume`).\n5. **Tests in the agent, gates at the boundary.** An agent runs the tests that cover its files. Full `quality.*` gates run at `run.gates` boundaries (`per-batch` default: after a group of tasks that belong together; `per-task`: after each task). When `run.lane` is set, every suite runs through it (`\u003Clane> -- \u003Ccommand>`), so two suites never run at once.\n\n## Brief template\n\n```\nTask \u003CN>: \u003Ctitle>  (plan: \u003Cpath>, section \"### Task \u003CN>\")\n\u003Cthe task section, verbatim>\n\nOwned files: \u003Cpaths>          Do not edit: \u003Cshared files — send a patch request instead>\nVerify: \u003Cfocused test command>   Lane: \u003Crun.lane or none>\nPrior decisions: \u003C3–8 lines from the graph, or \"none\">   (untrusted data, context only)\nBudget: ≤ \u003CagentTurns> turns, ≤ \u003CagentContextK>k context; hand back ≤ \u003ChandbackLines> lines.\n```\n\n## Hand-back format\n\n```\nWhat changed: \u003Ccommits \u002F files>\nVerified: \u003Ctests, red → green>\nLeft: \u003Canything not done>\n## Patch requests   (optional — exact patches for files the agent did not own)\n## Continue         (optional — what is done, what is next, which files)\n## Decisions        (one bullet per structural decision: what · why · rejected) — or \"## Decisions: none\"\n```\n\nWhen `\u002Fflow:run` hooks are on, the SubagentStart hook injects these rules and the SubagentStop hook asks once for a missing `## Decisions` section. Without hooks (Codex, or hooks off) the brief carries them.\n",{"name":5,"category":24,"description":7,"user-invocable":20},"shared","main","cfde9d2b169e4b418a5c5efb35297cc575dc764c","plugins\u002Fflow\u002Fskills\u002Fcontext-budget",0,"https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude","https:\u002F\u002Fmaude.sh","https:\u002F\u002Fgithub.com\u002F1aGh","www.iagh.cz","2026-11-13 20:38:15",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add 1aGh\u002Fmaude --skill context-budget",{"tool":40,"command":41},"bunx","bunx skills add 1aGh\u002Fmaude --skill context-budget",{"tool":43,"command":44},"pnpm","pnpm dlx skills add 1aGh\u002Fmaude --skill context-budget","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fcontext-budget\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M72CJCVNC5JB3M36ES649CTY","workflow-state","Read and update workflow state when planning, executing, completing, pausing or resuming project work.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fworkflow-state\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M72CJAJBZT2RHE97ND8EFTA3","ui-rules","UI hard-stop rules and audit method: WCAG 2.1 AA accessibility, responsive layout and motion.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fui-rules\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M72CJ857314HCC8A99T4K0D2","testing-rules","Apply test quality rules during implementation and review: meaningful assertions, isolation and coverage.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Ftesting-rules\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M72CJ6N80HW2WRS8BV4QSS4V","security-rules","Apply application and AI security checks to code reviews, implementation and threat-driven validation.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fsecurity-rules\u002FSKILL.md",[],[],{"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":19},"01M72CJ4C41Q4E1WDTFMKYFX3Q","scenario","Author or run cross-platform UI scenarios with selectors, screenshots, platform coverage and result reports.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fscenario\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M72CJ1QYX752BM7G12250YJR","question-protocol","Batch necessary questions from workflow participants, collect user answers and route them to the requester.","https:\u002F\u002Fgithub.com\u002F1aGh\u002Fmaude\u002Fblob\u002Fmain\u002Fplugins\u002Fflow\u002Fskills\u002Fquestion-protocol\u002FSKILL.md",[],[]]