compile_bundle
Compile relevant team knowledge, conventions, and project context into a token-budgeted bundle before coding. Give a task sentence to get deduplicated, sourced sections within max_tokens.
Instructions
Compile what the team's knowledge base says about a task into one context block within a token budget. Call it once at the start of a task, before code that rules, conventions or past decisions could govern; describe the task in a sentence, not keywords. Sections are deduplicated, ordered domain → conventions → project, each with a source line (path, heading, last-updated date, and a note when the code it governs changed later). Read-only, deterministic, cached: same task, scopes and budget give the same bundle_id and content. Never exceeds max_tokens; a too-small budget truncates the top section with a marker. Afterwards, report which sections helped via report_usage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scopes | No | Knowledge scopes to draw from, e.g. ["domain","conventions","projects/ledger-service"]. Default: domain and conventions. Add the project scope when working inside a project. | |
| max_tokens | No | Token budget for the whole bundle including its header and source lines (default 2000, must be positive). Never exceeded. | |
| task_description | Yes | What you are about to do, in one or two sentences, in any language (e.g. 'add partial refunds to the merchant portal'). Required; a sentence retrieves better than keywords. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget | Yes | ||
| cached | Yes | ||
| scopes | Yes | ||
| tokens | Yes | ||
| content | Yes | ||
| sections | Yes | ||
| bundle_id | Yes | ||
| truncated | Yes |