From kanso
Use when the user asks to update, prune, audit, or create AGENTS.md, CLAUDE.md, or other agent context files. Also use when the user says their AI agents keep making the same mistakes and they want to fix it at the context level.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kanso:kanso-context [optional: prune|audit|init|sync][optional: prune|audit|init|sync]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Curates agent context files to improve AI-agent reliability on this codebase. Primary target is `AGENTS.md` (cross-tool standard). CLAUDE.md is only updated when guidance is genuinely Claude-specific.
Curates agent context files to improve AI-agent reliability on this codebase. Primary target is AGENTS.md (cross-tool standard). CLAUDE.md is only updated when guidance is genuinely Claude-specific.
The principles from kanso-principles apply. This skill is biased toward deletion.
This skill's design is pinned to the empirical record as of 2026:
Three practical implications:
$ARGUMENTS selects the mode:
audit (default) — review existing context files, produce a findings report. No edits.prune — act on audit findings to remove stale, redundant, or noisy content. Edits with approval.init — bootstrap a minimal AGENTS.md for a repo that doesn't have one. Interactive; asks the user for inputs.sync — compare context files against recent PRs (last 20-30 merged) to find drift: instructions that no longer match how the code actually works.If no argument is given, default to audit.
Based on the Vercel + empirical studies, ordered by impact:
pnpm dev:firefox. The agent needs these to verify its own output.When pruning:
For Claude-specific guidance only:
~/.claude/CLAUDE.md — user-level, personal, all projects. Treat as a dotfile.CLAUDE.md at repo root — team-level, committed..local/CLAUDE.md — local overrides, gitignored.More specific scopes take precedence. The @filepath import syntax lets CLAUDE.md stay lean while linking to heavier docs on demand.
If AGENTS.md covers the need, don't duplicate it in CLAUDE.md. Recommend a symlink or a one-line CLAUDE.md that references AGENTS.md.
Produce a findings report without editing:
.cursor/rules/*.mdc, .github/copilot-instructions.md.Output format:
# AGENTS.md audit
**Files reviewed:** AGENTS.md (187 lines), CLAUDE.md (42 lines)
## Summary
AGENTS.md is 37 lines over the recommended ceiling. ~40% of content
is Tier 3 (skippable). Security and performance sections are absent.
## Deletion candidates
- Lines 34-52: codebase overview. Doesn't help agent navigation (ETH
Zurich research). Remove.
- Lines 78-91: duplicates README "Getting started" section. Remove.
- Lines 145-167: explains JavaScript import syntax. Model knows. Remove.
- Lines 180-187: "Be careful with concurrency". Vague. Replace with
a specific rule or remove.
## Gaps to fill
- No security section. This project handles user auth — worth adding
a few lines on session handling rules.
- No "do not modify" section. You mentioned migrations are manually
managed — that belongs here.
- Build commands present but test commands missing.
## Drift detected
- Line 23 says "use Jest for testing". Recent PRs show Vitest is now
used. Update.
- Line 67 references `src/legacy/` — deleted in PR #412. Remove.
## Recommended next action
Run `/kanso-context prune` to act on the deletion candidates, then
I'll walk you through filling the gaps.
Acts on a prior audit. Shows each proposed deletion with line references, waits for approval (bulk or per-item), then removes. Never silently edits.
After pruning, show the new line count. Target is under 150 lines for AGENTS.md, under 300 for CLAUDE.md.
Interactive. Bootstraps a minimal AGENTS.md (target: ~80 lines).
The starting skeleton:
# AGENTS.md
## Project overview
<One paragraph — what this is, primary tech, deployment context.>
## Build, test, run
- Install: `<exact command>`
- Dev: `<exact command>`
- Test: `<exact command>`
- Lint: `<exact command>`
- Type check: `<exact command>`
## Architecture
<Module-by-module. Keep it to one line each.>
## Conventions
<Naming, error handling, forbidden deps, deprecated patterns.
Bullet list. Specific.>
## Do not
<What the agent should never modify or do. Specific.>
## Development process
<Branching, commit format, PR requirements. Short.>
## References
<Links to deeper docs. Use @filepath imports in Claude Code.>
Compare AGENTS.md against recent merged PRs:
!git log main --merges -n 30 --format="%H %s" to find recent merges.src/domains/ subfolders. Is this a new convention worth documenting?"Context files decay. The cheapest way to keep one alive is to let the agent itself propose updates the moment a mistake recurs — but only on the user's command, never silently. Two halves: the in-file footer, and the workflow the user runs when an agent slips up.
Append this to AGENTS.md:
## Maintenance
When you (the agent) learn a durable project-specific fact during a
session — a gotcha, a convention, a "do not" — propose an update to
this file. Do not edit without the user's approval.
This invites the agent to participate in maintenance. The user still holds the pen.
When the agent makes a mistake that would be cheaper to prevent than to keep correcting, the user can fix it at the context layer in one move. Surface this prompt to the user in audit output and in the init / prune wrap-up — verbatim, so they can paste it:
Update AGENTS.md so you do not repeat this. Add the rule in the
correct section, keep it specific (not "be careful"), and show me
the diff before saving.
The result is a context file that learns from its own failures. The user gates every change; the agent does the drafting.
Same instruction works for CLAUDE.md when the mistake is genuinely Claude-specific (tool use, slash command behaviour, IDE quirks). Default target is AGENTS.md.
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub blakecyze/kanso --plugin kanso