Role aware context slimming

From ychampion/cskill-agents · View interactive version

Role aware context slimming is an AI agent skill from the GitHub repository ychampion/cskill-agents. Trim user and system context based on the agent\u2019s role so read-only helpers don\u2019t inherit stale git or CLAUDE metadata.

How to use this skill

Skill file

SKILL: Role-Aware Context Slimming

Domain: context-management

Trigger: When an agent declares omitClaudeMd or runs as an Explore/Plan helper, slim the context before handing it to runAgent.

Source Pattern: Distilled from reviewed context, compaction, and memory-governance patterns.

Core Method

Use 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.

Key Rules

Example Application

When 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.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.