agents/skills/improve/SKILL.md
Improve skills, capture context & knowledge. Use for skill iteration, capturing learnings, or upgrading agent context.
npx skillsauth add drn/dots improveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze the current conversation to improve skills, fix codebase gaps, capture durable knowledge, and generate handoff prompts for skills managed outside this repository.
Run /improve at the end of any session where:
git rev-parse --show-toplevel 2>/dev/null | head -1find agents/skills -maxdepth 2 -name SKILL.md 2>/dev/null | head -30ls context/knowledge/index.md 2>/dev/null | head -1cat context/knowledge/index.md 2>/dev/null | head -30find context -type f 2>/dev/null | head -20find . -maxdepth 3 -name 'voice-profile.md' -o -name 'VOICE.md' -o -name 'voice.md' 2>/dev/null | head -5command -v argus 2>/dev/null | head -1argus kb list 2>/dev/null | head -200tail -30 ~/.dots/sys/kb-changes/changes.jsonl 2>/dev/null | head -30When /improve is invoked:
If the dynamic context above shows argus is on PATH and the KB index is non-empty, the Argus KB is the primary durable store. Load it before doing anything else.
See references/argus-kb.md for the full load procedure (which docs to read, MCP tool name fallbacks, search heuristics). Summary: always-load memory/user/ + memory/feedback/ (or rely on the SessionStart hook), then kb_search on session-relevant keywords and read top matches.
If argus is NOT available, skip this step and continue with project-local context/ only.
Check whether the current repo has a context/ directory at the repo root.
If context/ does not exist, prompt the user:
This repo has no
context/directory. Want me to create one? This gives you a durable, gitignored place to store operational context, knowledge, research, and plans across sessions.I'll create:
context/ ├── knowledge/ │ └── index.md # Knowledge graph index ├── research/ # Investigation notes, spikes, evaluations └── plans/ # Strategic plans, proposals, roadmapsI'll also add a reference in CLAUDE.md. The
context/directory is checked into git so it persists across clones.
If the user approves:
context/knowledge/index.md with an empty knowledge table:
# Knowledge Index
Structured knowledge for cross-session persistence. Each file covers a topic/domain.
| File | Topic | Key Entities | Last Updated |
|------|-------|-------------|-------------|
## Coverage Map
Which context files are captured in knowledge:
| Context File | Knowledge File(s) | Coverage |
|-------------|-------------------|----------|
## Context Directory section to CLAUDE.md (or the repo's agent guidance file) explaining:
context/ is gitignored and stores durable cross-session knowledgecontext/knowledge/index.md is the knowledge graph indexcontext/research/ holds investigation notes and spike resultscontext/plans/ holds strategic plans and proposalscontext/knowledge/index.md when they need project history or domain contextIf the user declines, proceed without it — Steps 8B and 8C will be skipped (no knowledge base to update).
If context/ already exists, proceed to Step 1.
Scan the full conversation for:
/pdf, /review, /test, etc.)/pdf, data export workflows)List each skill used with a brief note on what it did in this session.
Note: If improvements were already applied earlier in the same session (e.g., from manual fixes or a prior /improve run), skip those and only propose net-new changes.
For each skill identified, analyze:
For each skill with proposed changes, determine where it lives:
~/.claude/skills/<name>/SKILL.md)readlink -f <path> to get the real path. Skill directories like ~/.claude/skills/ are often symlinks into a separate repo (e.g., ~/.dots/agents/skills/). The apparent path is not reliable; always use the resolved path.git rev-parse --show-toplevel. The resolved path must be a descendant of the worktree root to be local.Symlink trap: ~/.claude/skills/ commonly symlinks to a separate dotfiles repo. Editing a file through that path writes to the symlink target repo, not the current worktree — even if the edit appears to succeed. Always resolve with readlink -f before classifying.
Default: local project. All improvements and new skills target the current project unless there is a strong reason to modify an external skill. When an external skill needs changes, generate a handoff prompt (Step 5) — do not edit it even if you have write access.
For each skill with learnings, draft specific changes:
--input flag for existing files")Code-over-skills check: Before proposing any change that adds inline scripts (bash, Ruby, Python, data transformations, API calls, or parsing logic) to a SKILL.md, check whether the project's CLAUDE.md has rules about where logic should live (e.g., "code over skills", "capture reusable logic in CLI commands"). If it does, do NOT add the script to the skill. Instead, route it to Step 7 (Fix Codebase Gaps) as a missing CLI command. The skill improvement becomes: "reference the new CLI command" rather than "embed the script."
Present each proposed change as a before/after diff for the user to review.
For local skills (default path):
For external skills (handoff only — never edit directly): Generate a copy-pasteable handoff prompt for each external skill with changes. The prompt should:
Format:
## Skill Improvement Handoff: /<skill-name>
**Skill location:** <real path to SKILL.md>
**Source repo:** <git repo that owns the skill>
### Proposed Changes
1. **<change type>: <title>** — <description>
- Before: <relevant excerpt>
- After: <proposed replacement>
2. ...
### Context
<1-3 sentences explaining what session behavior motivated these changes>
Print each handoff prompt inside a fenced code block so the user can copy it into a session working in the skill's source repo.
Review the full session for patterns that are not covered by any existing skill but would benefit from one. Look for:
/improve itself — if the user described a capability gap when invoking /improve, treat that as a direct signalOnly propose a skill if it passes at least two of these criteria:
For each new skill opportunity, present:
**Proposed Skill: /<name>**
- **What it does:** <1-2 sentence description>
- **Trigger:** When would a user invoke this? What keywords or situations?
- **Key steps:** <numbered list of what the skill would instruct the agent to do>
- **Dynamic context needed:** <what live data the skill would inject, if any>
- **Cross-project or local?** <local (default) or cross-project with rationale>
After the user approves a proposal:
/write-skill <name> — <description> to create it following established patterns and validation rules. If /write-skill is not available, create the SKILL.md directly in the repo skills directory./write-skill there.New skills default to the local project. Only propose creating a skill in an external repo (like ~/.dots) if the skill is clearly cross-project and not specific to the current codebase — and in that case, generate a handoff prompt instead of creating it directly.
Review the session for codebase gaps that were discovered or worked around but not fixed. These are issues in the project itself (not in skills):
Missing or outdated documentation — CLAUDE.md, AGENTS.md, or README sections that are wrong, incomplete, or missing components that were used during the session
Missing tests — code paths that were exercised manually but have no test coverage
Missing error handling — failures that surfaced during the session because a code path had no guard
Configuration gaps — env vars, CI steps, linter rules, or build config that caused friction
Undocumented patterns — conventions the codebase follows implicitly that tripped up work during the session
Manual workarounds bypassing existing abstractions — raw shell commands, curl calls, or inline scripts that hit APIs or services the project already has clients/CLI for, but lacked the specific operation needed. Scan the session for:
curl or Bash tool calls that hit APIs the project already has clients for (e.g., curl to Prowlarr when a Prowlarr client exists)For each detected workaround, propose:
For each gap found:
Worktree safety: Before writing any file, resolve the target path against git rev-parse --show-toplevel (shown in the Context section above as "Current repo"). Never hardcode absolute paths like ~/Development/repo/ or ~/project/. In a git worktree session, git rev-parse --show-toplevel returns the worktree root — edits to a hardcoded main repo path land on the wrong branch and will not be included in the current PR.
Only fix gaps that were actually encountered during the session. Do not speculatively audit the codebase.
After completing the gap analysis above, also review the learnings from Steps 2-6 for improvements that should be propagated into CLAUDE.md, AGENTS.md, or other agent guidance files. Skills capture how to do a specific task, but agent guidance captures cross-cutting conventions, patterns, and rules that affect all tasks.
Specifically, check whether any of these emerged during the session:
For each agent guidance update:
Do NOT duplicate into agent guidance anything that is already captured in a skill's SKILL.md. Only promote learnings that are cross-cutting — relevant beyond the scope of a single skill.
Part 0: Argus KB Capture (inbox-first)
If argus is available (see dynamic context), the Argus KB is the primary durable store. Capture there before falling back to project-local context/. Read references/argus-kb.md for the detailed capture procedure (search-first, frontmatter schema, routing rules). Summary: search the KB for an existing entry; if found, merge into it at the same path; otherwise write a raw capture to memory/inbox/<YYYY-MM-DD>-<slug>.md and let /dream triage it.
Part A: Operational Context
Review the session for extractable operational context:
Update existing context files in context/ directory as appropriate (requires context/ to exist from Step 0b):
context/research/, context/plans/)memory/ directories or memory/memory.md — local project context goes in context/. The Argus KB's memory/ namespace (Part 0 above) is separate and handled via mcp__argus__kb_ingest, not filesystem writes.git rev-parse --show-toplevel (shown in the Context section as "Current repo"). Never hardcode absolute paths like ~/Development/repo/. In a worktree session, the worktree root is the correct write target — hardcoded paths write to a different branch.Part B: Knowledge Graph
Check whether the current project has a knowledge base by looking for context/knowledge/index.md (shown in the Context section above).
If no knowledge base exists (and the user declined to create one in Step 0b), skip Part B entirely. Do not fall back to auto memory or any alternative. Just move on.
If a knowledge base exists, review the session for durable knowledge worth preserving:
The knowledge base uses structured topic files with an index. To add knowledge:
context/knowledge/index.md to see existing topics and coveragePart C: Knowledge Graph Gap Analysis
Proactively identify knowledge graph gaps — entities, topic files, or categories the session revealed that don't yet exist. This goes beyond "capture what was discussed" to "suggest what should be tracked."
Scan for uncaptured entities: Compare entities mentioned in this session against the knowledge index. Flag any that were discussed substantively but have no entry (e.g., a merchant with GMV data, a new integration partner, a person with a defined role).
Suggest new topic files: If session content doesn't fit cleanly into existing knowledge files, propose a new topic file. Include:
Identify missing entity types or relationship types: The current taxonomy (from /capture) defines:
service, company, integration, system, process, policyintegrates_with, routes_through, hosted_on, owned_by, manages, replaces, depends_on, provides, consumesIf the session surfaced entities or relationships that don't fit these categories, propose additions to /capture's taxonomy. Common gaps that have emerged in practice:
product (a product offering), strategy (a strategic direction), market_context (competitive landscape), partner (vs generic company), case_study (customer success story with metrics)migrated_from, competes_with, evaluated_by, implemented_by, fills_gap_for, displacesFor each proposed addition, include the entity/relationship name, a one-line definition, and 2-3 examples from the session or knowledge base that demonstrate the need.
Check coverage map staleness: Scan the Coverage Map section of index.md for:
context/ but aren't listed in the coverage mapReport as a "Knowledge Gaps" section in the improvement report:
## Knowledge Gaps Identified
### Uncaptured Entities
- **[Entity Name]** — mentioned as [role/context], no knowledge entry exists
- Suggested file: [existing-file.md] or [new-file.md]
### New Topic File Proposals
- **[filename.md]** — [description]. Seed entities: [list].
- Why: [why existing files aren't the right home]
### Taxonomy Gaps
- New entity type: `[type]` — [definition]. Examples: [from session or KB]
- New relationship type: `[type]` — [definition]. Examples: [from session or KB]
### Stale Coverage
- `context/[file].md` — exists but not in coverage map
- `knowledge/[file].md` — last updated [date], touched in this session → update date
Only report gaps that are actionable and non-trivial. Don't flag every passing mention — focus on entities with enough substance to warrant a knowledge entry (verified facts, defined relationships, business significance).
Do NOT capture:
Part D: Voice Profile
Check whether the repo has a voice profile by looking at the dynamic context above (Voice profile field). Common locations: voice-profile.md, VOICE.md, or voice.md at the repo root or in context/.
If no voice profile exists, skip Part D entirely. Do not suggest creating one.
If a voice profile exists, review the session for patterns that should refine it:
Do not overwrite existing voice profile entries — add to or refine them. If a session observation contradicts an existing entry, flag the conflict for the user to resolve rather than silently changing it.
Note: The /improve skill itself is in scope for improvement. If this session revealed friction in the improve workflow, include it in the report.
context/ directory pattern — use Step 0b to initializememory/ directories or memory/memory.md. Argus KB captures (Step 8 Part 0) go through mcp__argus__kb_ingest to the KB's memory/ namespace; project-local context goes in context/# Session Improvement Report
## Skills Used
1. `/review` — Ran code review on authentication refactor (2 iterations)
2. `/test` — Ran tests, discovered missing edge case coverage
3. `/pdf` — Exported summary to PDF
## Proposed Improvements
### /review — 1 change (local, applying directly)
1. **Add: Retry on lint timeout** — Review step stalled when linter timed out.
Add a 60-second timeout with retry.
### /pdf — 2 changes (external: ~/.dots/agents/skills/pdf/)
Handoff prompt generated below.
### New Skill Proposal: /coverage-report
**Proposed Skill: /coverage-report**
- **What it does:** Run tests, parse coverage output, and highlight untested lines in changed files.
- **Trigger:** After writing code, when checking test coverage for a PR or branch.
- **Key steps:** 1. Identify changed files on branch. 2. Run test suite with coverage. 3. Parse coverage report. 4. Show untested lines in changed files only.
- **Dynamic context needed:** Changed files list, test runner config.
- **Cross-project or local?** Cross-project (handoff to ~/.dots).
Create with /write-skill? (y/n)
## Codebase Gaps Fixed
1. **AGENTS.md: Missing `agents` component** — `dots install agents`
was used but not listed in the Component Reference table.
Added row to the table.
## External Skill Handoffs
[copy-pasteable handoff prompt for /pdf]
## Knowledge Captured
Added to context/knowledge/thanx-infrastructure.md:
- Authentication service requires `X-Request-ID` header for all endpoints
Updated context/knowledge/index.md:
- thanx-infrastructure.md Last Updated → 2026-02-26
## Knowledge Gaps Identified
### Uncaptured Entities
- **[Customer Name]** — mentioned as case study with metrics, no entry
- Suggested file: customer-accounts.md
### Taxonomy Gaps
- New entity type: `case_study` — A customer success story with quantified outcomes.
Examples: [Customer A] (38% activation, 3x active members), [Customer B] ($125M+ loyalty revenue)
### Stale Coverage
- `context/thanx/ordering-positioning.md` — exists but not in coverage map
## Voice Profile Updated
Updated `voice-profile.md`:
- Added: Prefer short, direct sentences. Avoid hedging language ("might", "perhaps").
- Refined: Technical depth → "assume reader knows Ruby/Rails; skip basic explanations"
## Apply all? (y/n)
Each /improve run should leave the system measurably better than it found it. The goal is not just fixing today's friction — it is building a system that compounds: each session's learnings reduce friction in all future sessions.
development
Walk every unresolved review thread on a PR, triage each one, reply with a rationale of whether or not the comment will be acted upon, make the code change if warranted, and mark the thread resolved. Use when the user asks to address only the open PR comments without re-running CI, respond to review feedback, resolve review threads, or clear bot comments on a PR.
tools
Iteratively run /rereview, fix the findings, and loop until reviewers approve clean. Use for iterative automated review, when you want /rereview to loop until clean, or for a paranoid pre-merge review that auto-addresses every blocker.
development
Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide decks, and any visual explanation of technical concepts. Plans and PR explainers follow Plannotator's prescriptive approach; all other visual content delegates to nicobailon/visual-explainer.
development
Create reviewed Codex goal setup packages for long-running /goal work. Use when the user wants to turn an idea, backlog, project mission, or vague objective into durable goal files under a project goals slug folder, with Plannotator review gates for brief, narrative plan with acceptance criteria, verification, blockers, and the final /goal prompt.