skills/self-improving-agent/SKILL.md
Always-on lightweight observer. After EVERY user message, silently check: (1) did the user correct me or express a preference? (2) did the user express frustration about repetition? (3) is this a rule I've seen before in a different project? If ANY are true, run `uv run improve.py observe "<rule>" --project <name> [--domain <domain>]` to record it. Do NOT load the full skill for observation — this description is sufficient. Load the full SKILL.md body only when: checking escalation thresholds, writing to AGENTS.md, or running /improve. Manages ~/.agent-improvement/rules.yaml via improve.py CLI.
npx skillsauth add ericmjl/skills self-improving-agentInstall 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.
An always-on observer that captures user corrections and preferences, tracks repetition across projects, and escalates behavioral rules to the appropriate AGENTS.md file.
The YAML description above is loaded every session. It contains everything needed for the lightweight per-message check:
The sections below are loaded only when the agent needs to:
/improve due)/improve commandRecord an observation when the user:
uv run <skill-dir>/scripts/improve.py observe "<rule>" --project <name> [--domain <domain>] [--context "<what happened>"] [--explicit-scope global|local]
Rule phrasing: Write rules as imperatives. Bad: "user doesn't like pip". Good: "Use uv tool for Python CLI tools, never pip3 install".
Domain: Pick from the taxonomy below. If unsure, omit it (defaults to "unknown").
Explicit scope: Use --explicit-scope global when the user says "always", "everywhere", "in all projects". Use --explicit-scope local when the user says "in this project", "just here".
Project detection: If --project is omitted, the CLI auto-detects from git remote get-url origin.
At the start of each session, run:
uv run <skill-dir>/scripts/improve.py status
This loads all active rules into your context. Apply them during the session. Rules with written_to entries are confirmed — treat them as hard rules. Rules without are tentative — apply them but don't enforce rigidly.
Domains determine whether a rule should escalate to global or stay project-local.
| Domain | Examples |
|--------|----------|
| python-tooling | Package managers, virtualenvs, linting |
| git-practices | Commit messages, branching, PR conventions |
| security | Input validation, secret handling, permissions |
| code-style | Naming, formatting, comment style |
| error-handling | Try/catch patterns, error messages |
| testing | Test frameworks, coverage, test structure |
| documentation | Docstrings, README style, API docs |
| communication | Response length, tone, formatting |
| tool-usage | Which tools to use, search patterns |
| search-patterns | Grep vs glob, code navigation |
| Domain | Examples |
|--------|----------|
| auth-architecture | Auth middleware, JWT patterns, session handling |
| import-patterns | Module structure, barrel exports, aliases |
| file-structure | Directory layout, naming conventions |
| api-design | REST patterns, endpoint naming, response format |
| database-queries | ORM patterns, migration style, query conventions |
| ui-components | Component patterns, state management, styling |
| config-management | Environment variables, config files, secrets |
| deployment | CI/CD, Docker, infrastructure |
If a rule's domain is unknown, treat it as project-specific until the domain is identified.
After recording an observation, the CLI prints the recommended action. The full logic:
IF explicit_scope == "global":
→ Write to global AGENTS.md immediately (any count)
ELSIF explicit_scope == "local":
→ Never escalate beyond project AGENTS.md (any count)
→ Write to project AGENTS.md at count >= 2
ELSIF total_count == 1:
→ Apply in-session only, no file write
ELSIF total_count >= 2 AND cross_project == false:
→ Write to project AGENTS.md
ELSIF total_count >= 2 AND cross_project == true AND domain is general:
→ Write to global AGENTS.md
ELSIF total_count >= 2 AND cross_project == true AND domain is project-specific:
→ Write to each affected project's local AGENTS.md
ELSIF domain == "unknown":
→ Treat as project-specific, do not escalate until domain is identified
At session end (or when the user runs /improve):
uv run <skill-dir>/scripts/improve.py due
This shows all rules that have reached their escalation threshold but haven't been written yet.
uv run <skill-dir>/scripts/improve.py escalate --dry-run
This prints exactly what should be written to which file. After reviewing, run without --dry-run to mark them as escalated in rules.yaml.
When a rule is ready for escalation, write it into the appropriate AGENTS.md file.
| Scope | Path |
|-------|------|
| Global | ~/.config/opencode/AGENTS.md (or equivalent for the agent harness) |
| Local | <project-root>/AGENTS.md |
uv run <skill-dir>/scripts/improve.py confirm <rule-id> --scope global|local
Write rules as concise, actionable instructions:
## Python Tool Management
- Use `uv tool` for installing Python CLI tools (never `pip3 install`).
- Use `uv run -- python -c "..."` for one-off Python commands (never `python3` or `python`).
Not like:
- The user has corrected me 3 times about pip. I should use uv instead.
Not every message is a correction. A user saying "try the other approach" is exploration, not a rule. Only record when the intent is clearly "do it this way from now on."
A rule said once is NOT a rule. Wait for repetition (count >= 2) unless the user explicitly says "always" or "everywhere."
"I prefer clean code" is not actionable. Translate to specific behaviors: "Write functions under 20 lines. Extract helpers when logic exceeds 3 levels of nesting."
If a new rule contradicts an existing one:
"retired": true to its entry in rules.yamlAlways run confirm after writing to AGENTS.md. Otherwise the system thinks the rule is still pending and will try to escalate it again.
All commands use the improve.py script:
uv run <skill-dir>/scripts/improve.py <command>
| Command | When | Purpose |
|---------|------|---------|
| observe <rule> | After user correction/preference | Record a new observation |
| status | Session start | Show all rules and counts |
| due | Session end or /improve | Show pending escalations |
| escalate [--dry-run] | When escalation is due | Mark rules for escalation |
| confirm <id> --scope | After writing to AGENTS.md | Mark rule as written |
| history <id> | Debugging | Full observation history |
| domains | Reference | List domain taxonomy |
| seed --from-agents-md | First-time setup | Import rules from existing AGENTS.md |
| init [--force] | First-time setup | Initialize rules.yaml |
The CLI is located at <skill-dir>/scripts/improve.py. The skill directory is:
.claude/skills/self-improving-agent/scripts/improve.py~/.claude/skills/self-improving-agent/scripts/improve.py~/.config/opencode/skill/self-improving-agent/scripts/improve.pyIf unsure, search for improve.py within the skill directory.
All data is stored at ~/.agent-improvement/rules.yaml. Override with AGENT_IMPROVEMENT_HOME environment variable.
$ uv run improve.py status
use-uv-not-pip
rule: Use uv tool for Python CLI tools, never pip3 install
count: 3 (cross-project, domain=python-tooling [general])
escalation: global, written_to: 1 files
check-pyproject-first
rule: Check pyproject.toml before assuming library availability
count: 1 (single-project, domain=tool-usage [general])
escalation: none, written_to: 0 files
User says: "Stop using grep for finding files, use glob instead."
$ uv run improve.py observe "Use glob for file pattern matching, not grep" \
--project my-app --domain search-patterns \
--context "user corrected grep usage for file search"
RECORDED (count=1) → apply in-session only
Same correction in another project, next week:
$ uv run improve.py observe "Use glob for file pattern matching, not grep" \
--project other-project --domain search-patterns \
--context "user repeated same correction about grep vs glob"
RECORDED (count=2, cross-project, general domain) → candidate for GLOBAL AGENTS.md
$ uv run improve.py due
use-glob-for-file-pattern-matching-not-grep
rule: Use glob for file pattern matching, not grep
count: 2, projects: my-app, other-project
→ ESCALATE TO: global AGENTS.md
Agent reads global AGENTS.md, adds the rule, then confirms:
$ uv run improve.py confirm use-glob-for-file-pattern-matching-not-grep --scope global
Confirmed: use-glob-for-file-pattern-matching-not-grep written to ~/.config/opencode/AGENTS.md
development
Create animated videos using Remotion from topics, product URLs, Google reviews, talking-head videos, or CSV data. Supports 5 video types: educational explainers, product launch demos, testimonial/social proof, avatar video overlays, and data visualization dashboards. Each follows a 2-step workflow: research/scrape/analyze then design and animate with spring animations, SVG diagrams, and count-up effects. Requires the Remotion best practices skill (install with `npx skills add remotion-dev/skills`). Use when the user asks to create a Remotion video, explainer video, educational video, product demo video, testimonial video, video with animated overlays, data visualization video, animated dashboard, or short-form vertical video for mobile.
development
Comprehensive YouTube operations using yt-dlp - download videos/audio, extract transcripts and subtitles, get metadata, work with playlists, download thumbnails, and inspect available formats. Use this for any YouTube content processing task.
data-ai
Ingest YouTube videos into the vault. Triggers when user pastes a YouTube URL (youtube.com/watch or youtu.be). Fetches transcript using yt-dlp, extracts metadata, creates transcript note and summary note. User may provide additional context about the video.
tools
Advanced negotiation and communication advisor grounded in Chris Voss's tactical empathy methodology (Never Split the Difference, The Black Swan Group). Use this skill whenever the user needs help with any interpersonal situation involving influence, persuasion, or navigating difficult dynamics. This includes but is not limited to: analyzing conversations, call transcripts, or email threads; preparing for negotiations (salary, vendor, client, partner); drafting tactful responses; handling pushback, objections, or conflict; navigating difficult workplace conversations; preparing for performance reviews or raises; buying a car, house, or any big purchase; dealing with landlords, contractors, or service providers; resolving personal disagreements; practicing negotiation through role-play; or any situation where the user says things like "how should I respond to this", "they're pushing back", "I need to have a tough conversation", "how do I ask for...", "they ghosted me", "I'm not sure how to handle this person", "counter-offer", "pricing", "deal", "objection", or "difficult conversation". Activate broadly — most interpersonal communication benefits from tactical empathy whether or not the user frames it as "negotiation." This skill integrates FBI hostage negotiation techniques (93% success rate) with behavioral economics (Kahneman's Prospect Theory) and neuroscience (amygdala hijacking, loss aversion).