{"id":"efde1cda-33e1-4cbb-9485-fa9ee43c4967","shortId":"EP8qrL","kind":"skill","title":"role-aware-context-slimming","tagline":"Trim user and system context based on the agent\\u2019s role so read-only helpers don\\u2019t inherit stale git or CLAUDE metadata.","description":"# SKILL: Role-Aware Context Slimming\n**Domain:** context-management  \n**Trigger:** When an agent declares `omitClaudeMd` or runs as an Explore/Plan helper, slim the context before handing it to `runAgent`.\n**Source Pattern:** Distilled from reviewed context, compaction, and memory-governance patterns.\n\n## Core Method\nUse the `omitClaudeMd` flag (and the `tengu_slim_subagent_claudemd` feature gate) to strip `claudeMd` from the user context unless an override was explicitly provided. For read-only helpers such as Explore or Plan, drop the `gitStatus` entry from the system context because it is stale and bloats the payload. Always compute new context objects instead of mutating the originals so other agents can still read the full metadata set.\n\n## Key Rules\n- Only remove `claudeMd` when `agentDefinition.omitClaudeMd` is true, no user override is present, and the feature flag allows it, so you do not throw away intentional user context edits.\n- Derive `userContextNoClaudeMd` by destructuring the base context and omitting `claudeMd` before assigning `resolvedUserContext`.\n- Drop `gitStatus` from `resolvedSystemContext` any time `agentDefinition.agentType` is `Explore` or `Plan`, while leaving other system keys intact.\n- Preserve the original contexts for the parent agent so they can continue to see the full metadata when needed.\n\n## Example Application\nWhen the CLI launches an Explore subagent, apply this skill to create `resolvedUserContext` without `claudeMd` and `resolvedSystemContext` without `gitStatus`, saving dozens of tokens and preventing stale git information from confusing the helper.\n\n## Anti-Patterns (What NOT to do)\n- Stripping `claudeMd` even though the caller supplied an override user context; that override often carries explicit corrections or clarifications.\n- Forgetting to remove `gitStatus` for Explore/Plan agents, which bloats the prompt with stale files and slows down the API call.","tags":["role","aware","context","slimming","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-role-aware-context-slimming","topic-agent-skills","topic-ai-agents","topic-cli","topic-coding-agents","topic-context-engineering","topic-developer-tools","topic-mcp","topic-multi-agent","topic-terminal-ui"],"categories":["cskill-agents"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/ychampion/cskill-agents/role-aware-context-slimming","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add ychampion/cskill-agents","source_repo":"https://github.com/ychampion/cskill-agents","install_from":"skills.sh"}},"qualityScore":"0.467","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 34 github stars · SKILL.md body (1,932 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:56:55.689Z","embedding":null,"createdAt":"2026-04-18T22:21:11.762Z","updatedAt":"2026-04-22T00:56:55.689Z","lastSeenAt":"2026-04-22T00:56:55.689Z","tsv":"'agent':14,43,137,212,290 'agentdefinition.agenttype':194 'agentdefinition.omitclaudemd':151 'allow':163 'alway':125 'anti':259 'anti-pattern':258 'api':302 'appli':233 'applic':225 'assign':186 'awar':3,33 'away':170 'base':11,180 'bloat':122,292 'call':303 'caller':270 'carri':279 'clarif':283 'claud':28 'claudemd':83,88,149,184,240,266 'cli':228 'compact':66 'comput':126 'confus':255 'context':4,10,34,38,54,65,92,116,128,173,181,208,275 'context-manag':37 'continu':216 'core':72 'correct':281 'creat':237 'declar':44 'deriv':175 'destructur':178 'distil':62 'domain':36 'dozen':246 'drop':109,188 'edit':174 'entri':112 'even':267 'exampl':224 'explicit':97,280 'explor':106,196,231 'explore/plan':50,289 'featur':84,161 'file':297 'flag':77,162 'forget':284 'full':142,220 'gate':85 'git':26,252 'gitstatus':111,189,244,287 'govern':70 'hand':56 'helper':21,51,103,257 'inform':253 'inherit':24 'instead':130 'intact':204 'intent':171 'key':145,203 'launch':229 'leav':200 'manag':39 'memori':69 'memory-govern':68 'metadata':29,143,221 'method':73 'mutat':132 'need':223 'new':127 'object':129 'often':278 'omit':183 'omitclaudemd':45,76 'origin':134,207 'overrid':95,156,273,277 'parent':211 'pattern':61,71,260 'payload':124 'plan':108,198 'present':158 'preserv':205 'prevent':250 'prompt':294 'provid':98 'read':19,101,140 'read-on':18,100 'remov':148,286 'resolvedsystemcontext':191,242 'resolvedusercontext':187,238 'review':64 'role':2,16,32 'role-awar':31 'role-aware-context-slim':1 'rule':146 'run':47 'runag':59 'save':245 'see':218 'set':144 'skill':30,235 'skill-role-aware-context-slimming' 'slim':5,35,52,81 'slow':299 'sourc':60 'source-ychampion' 'stale':25,120,251,296 'still':139 'strip':87,265 'subag':82,232 'suppli':271 'system':9,115,202 'tengu':80 'though':268 'throw':169 'time':193 'token':248 'topic-agent-skills' 'topic-ai-agents' 'topic-cli' 'topic-coding-agents' 'topic-context-engineering' 'topic-developer-tools' 'topic-mcp' 'topic-multi-agent' 'topic-terminal-ui' 'trigger':40 'trim':6 'true':153 'u2019s':15 'u2019t':23 'unless':93 'use':74 'user':7,91,155,172,274 'usercontextnoclaudemd':176 'without':239,243","prices":[{"id":"e07dda6a-df4d-48ed-8ea2-9892e87c61b4","listingId":"efde1cda-33e1-4cbb-9485-fa9ee43c4967","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"ychampion","category":"cskill-agents","install_from":"skills.sh"},"createdAt":"2026-04-18T22:21:11.762Z"}],"sources":[{"listingId":"efde1cda-33e1-4cbb-9485-fa9ee43c4967","source":"github","sourceId":"ychampion/cskill-agents/role-aware-context-slimming","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/role-aware-context-slimming","isPrimary":false,"firstSeenAt":"2026-04-18T22:21:11.762Z","lastSeenAt":"2026-04-22T00:56:55.689Z"}],"details":{"listingId":"efde1cda-33e1-4cbb-9485-fa9ee43c4967","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"role-aware-context-slimming","github":{"repo":"ychampion/cskill-agents","stars":34,"topics":["agent-skills","ai-agents","cli","coding-agents","context-engineering","developer-tools","mcp","multi-agent","terminal-ui"],"license":"mit","html_url":"https://github.com/ychampion/cskill-agents","pushed_at":"2026-04-04T14:13:23Z","description":"Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!","skill_md_sha":"b5f302132b7e4099728c2a98ba5d75f88722f513","skill_md_path":"skills/role-aware-context-slimming/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/role-aware-context-slimming"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"role-aware-context-slimming","description":"Trim user and system context based on the agent\\u2019s role so read-only helpers don\\u2019t inherit stale git or CLAUDE metadata."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/role-aware-context-slimming"},"updatedAt":"2026-04-22T00:56:55.689Z"}}