skill-loop-mcp
OfficialThis server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
@stylusnexus/skill-loop
Self-improving skills for AI coding tools.
Skills are static prompt files. Codebases are not. skill-loop closes the feedback loop so skills improve automatically when they degrade.
SKILL --> RUN --> OBSERVE --> INSPECT --> FIX
^ |
+---------------------------------------+What it does
Observe -- Automatically detects and logs skill usage via tiered confidence scoring -- no explicit logging required
Inspect -- Detects failure patterns, staleness (dead file references), content drift, routing errors, and usage trends
Amend -- Proposes targeted SKILL.md patches grounded in evidence from past runs
Evaluate -- Tests amendments against recent failure cases on a git branch before any human sees a PR
Update/Rollback -- Merges improvements via PR; rolls back if post-merge monitoring shows regression
Related MCP server: Mother MCP Skills
Packages
There are two packages. Most users only need the CLI.
Package | What it is | When to use it |
CLI + MCP server | Most users. Install this to use skill-loop from the command line or as an MCP server in any AI tool. | |
Core library | Building a custom integration or plugin on top of skill-loop. Not needed if you're using the CLI. |
skill-loop-cli depends on skill-loop (core), so installing the CLI gives you everything.
Quick start
npm install -g @stylusnexus/skill-loop-cliThen initialize -- this is required before anything else works:
skill-loop initThis scans for skills, creates .skill-telemetry/, offers to configure Claude Code hooks, and installs the /sl slash command.
Once initialized:
/sl status # Health dashboard (slash command)
/sl review # Inspect for problems
/sl fix # Auto-fix degraded skillsOr from the CLI:
skill-loop status # Health dashboard
skill-loop inspect # Find problems
skill-loop amend # Auto-fix degraded skillsInstallation by tool
Claude Code
Option A: MCP server (recommended)
Add to .mcp.json in your project root:
{
"mcpServers": {
"skill-loop": {
"command": "npx",
"args": ["-y", "-p", "@stylusnexus/skill-loop-cli", "skill-loop-mcp"]
}
}
}Then ask Claude: "Initialize skill-loop" and you'll see:
❯ Run skill-loop init
⏺ skill-loop - skill_loop_init (MCP)
⏺ Skill-loop initialized successfully. 27 skills registered in
.skill-telemetry/ with file and tool references indexed.
The output suggests adding pre/post hooks to .claude/settings.json
for auto-detection. Want me to set those up, or are you just
initializing the registry for now?Say "Yes, set those up" and Claude configures the hooks automatically:
❯ Yes, set those up
⏺ Update(.claude/settings.json)
Added skill-loop hooks:
- PreToolUse (.*): npx --package=@stylusnexus/skill-loop skill-loop-claude pre-hook
- PostToolUse (.*): npx --package=@stylusnexus/skill-loop skill-loop-claude post-hook
⏺ Done. These will run on every tool invocation, enabling
skill-loop's auto-detection and telemetry collection.From there, Claude can run skill-loop status, skill-loop review, or skill-loop fix conversationally.
Option B: Hooks (automatic observation)
For automatic skill run tracking, run init and say yes when it offers to configure hooks:
npx skill-loop init
# Auto-detection hooks are not configured.
# Add auto-detection hooks to .claude/settings.json? [Y/n]Or configure manually in .claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "npx --package=@stylusnexus/skill-loop skill-loop-claude pre-hook" }]
}],
"PostToolUse": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "npx --package=@stylusnexus/skill-loop skill-loop-claude post-hook" }]
}]
}
}The hooks auto-detect skill usage via confidence scoring -- no explicit Skill tool call required.
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"skill-loop": {
"command": "npx",
"args": ["-y", "-p", "@stylusnexus/skill-loop-cli", "skill-loop-mcp"]
}
}
}Windsurf
Add to your Windsurf MCP config:
{
"mcpServers": {
"skill-loop": {
"command": "npx",
"args": ["-y", "-p", "@stylusnexus/skill-loop-cli", "skill-loop-mcp"]
}
}
}Any MCP-compatible tool
The MCP server works with any tool that supports the Model Context Protocol. The config is always the same:
{
"command": "npx",
"args": ["-y", "-p", "@stylusnexus/skill-loop-cli", "skill-loop-mcp"]
}Codex / Copilot (programmatic)
For tools without MCP support, use the core library directly:
npm install @stylusnexus/skill-loopimport { logSkillRun } from '@stylusnexus/skill-loop';
await logSkillRun({
skillName: 'my-skill',
platform: 'codex', // or 'copilot'
outcome: 'success',
taskContext: 'refactor auth module',
});Commands
Use the /sl slash command or talk to skill-loop in natural language:
Command | What happens |
| Scans for SKILL.md files and registers them |
| Health dashboard: skill count, runs, failure rate |
| Analyzes skills for failure patterns, staleness, and trends |
| Proposes fixes -- shows a summary, you pick which to apply |
| Undo a fix by restoring from backup |
| Shows all registered skills with source (local/installed) |
| Shows recent skill run activity |
| Lists past amendments and their status |
| Shows detection stats and active sessions |
| Prunes old run data |
Fix workflow
The fix command uses a two-phase conversational flow that works across all AI tools:
Phase 1 -- Diagnose (read-only):
/sl fix
Found 3 skills that need fixes:
[HIGH] deploy-aws — 2 broken file references (67% failure rate)
[MED] test-runner — high failure rate (45%)
[LOW] lint-config — 1 broken reference
Apply all, specific ones, or see details first?Phase 2 -- Apply (you choose):
"Apply all" -- fixes all proposed skills in-place
"Fix deploy-aws and test-runner" -- fixes only those two
"Show me the deploy-aws diff" -- see full diff before deciding
"Skip" -- no changes made
Fixes are applied directly to SKILL.md files with automatic backups. No git branches, no commands to remember. To undo any fix:
/sl rollback deploy-awsIndividual MCP tools
For programmatic use, individual tools are also available:
Tool | Description |
| Initialize: scan skills, create registry |
| Health dashboard: skill count, run totals, failure rates |
| List all registered skills with metadata and broken references |
| Record a skill run outcome (success/failure/partial) |
| Query run history, filter by skill name or outcome |
| Analyze run patterns, detect staleness, flag degrading skills |
| Propose SKILL.md fixes (legacy branch mode) |
| Score an amendment against baseline and accept/reject |
| List amendment history with status filter |
How it works
1. Scan your skills
skill-loop reads SKILL.md files from your configured paths (default: .claude/skills/ and .claude/agents/). It extracts:
Name and description from YAML frontmatter
Referenced files (backtick-quoted paths in the skill body)
Referenced tools (Claude Code tool names like Bash, Grep, Read)
Each skill gets a stable UUID that persists across rescans.
2. Detect and log runs automatically
skill-loop auto-detects skill usage via a tiered confidence scoring system. Every tool call is evaluated against multiple signals:
Signal | Confidence | Description |
| 1.0 | Direct invocation via the Skill tool |
| 0.9 | Agent reads a skill file before executing |
Tool call matches | 0.6 | Tool usage fingerprint matches a registered skill |
Files touched overlap | 0.5 | Reserved for future use |
Runs are only logged when composite confidence exceeds a configurable threshold (default: 0.6).
3. Detect problems
The inspector analyzes run history to find:
Skills with high failure rates
Skills that get selected for wrong tasks (negative feedback)
Stale references to files/tools that no longer exist
Content drift -- referenced directories have changed significantly since the skill was last modified, suggesting the skill's domain knowledge may be outdated
Dead skills with zero recent invocations
4. Fix conversationally
When problems are detected, /sl fix shows you what's wrong and proposes fixes:
Shows a summary of flagged skills with severity and proposed changes
You pick which to apply (all, specific ones, or none)
Approved fixes are written directly to SKILL.md files with automatic backups
You can undo any fix with
/sl rollback <name>
No git branches, no commands to memorize. Works in Claude Code, Claude.ai, Cursor, Codex, Copilot -- anywhere skill-loop's MCP server runs.
Configuration
Create skill-loop.config.json in your project root (all fields optional):
{
"skillPaths": [".claude/skills", ".claude/agents"],
"telemetryDir": ".skill-telemetry",
"thresholds": {
"failureRateAlert": 0.2,
"deadSkillDays": 30
},
"retention": {
"maxRunAgeDays": 90
},
"detection": {
"enabled": true,
"confidenceThreshold": 0.6,
"sessionWindowMs": 300000,
"enabledMethods": ["explicit", "read_skill_file", "tool_fingerprint"]
}
}Detection tuning
Option | Default | Description |
|
| Master switch for auto-detection |
|
| Minimum composite score to log a run |
|
| How long (ms) a detection session stays open |
|
| Which detection methods are active |
|
| Confidence per method |
|
| Log sub-threshold detections to |
CLI reference
npx skill-loop --helpCommand | Description |
| Scan for skills, create |
| Health dashboard (skill count, run totals, failure rate, storage) |
| Manually log a skill run |
| Full analysis with pattern detection and staleness scoring |
| Generate amendments for flagged skills |
| Test a proposed amendment against recent failures |
| Revert a merged amendment via |
| Prune runs older than |
| Show active detection sessions |
| Dry-run detection against a hypothetical tool call |
| Audit cross-file referential integrity |
| Push buffered events to external services |
| Start MCP server (stdio) |
Data storage
All data lives in .skill-telemetry/ (gitignored):
File | Format | Purpose |
| JSON | Skill definitions with stable UUIDs |
| JSONL (append-only) | Every skill run with outcome, context, and detection metadata |
| JSON (derived) | Compact index for fast queries |
| JSONL (append-only) | Proposed and applied skill changes |
| JSON (ephemeral) | Active detection sessions, auto-pruned on TTL expiry |
Safe to delete: cache files, sync queue. Loses history: runs, amendments.
Architecture
@stylusnexus/skill-loop (core engine + adapters - pure TS, zero runtime deps)
└── @stylusnexus/skill-loop-cli (CLI + MCP server - the "install and go" package)Security
Everything is local
skill-loop runs entirely on your machine. There are no network calls, no telemetry, no analytics, and no cloud dependencies.
What | Where | Who can access |
Skill registry |
| You |
Run logs |
| You |
Amendments |
| You |
Pattern cache |
| You |
No data leaves your machine unless you explicitly configure a sync plugin.
What skill-loop can read
SKILL.md files in your configured
skillPaths(default:.claude/skills/,.claude/agents/)File existence checks for referenced paths (to detect staleness)
Your
skill-loop.config.json(if it exists)Git branch and commit state (for amendments)
It does not read your source code, environment variables, secrets, or any files outside the skill paths and telemetry directory.
What skill-loop can write
Files in
.skill-telemetry/(run logs, registry, cache, reports)SKILL.md files only during amendments (on a new git branch, never on your working branch)
.gitignore(adds.skill-telemetry/entry duringinit)
Git safety
skill-loop never pushes to a remote. All git operations are local.
skill-loop never force-pushes or runs
git reset --hard.Rollback uses
git revert(creates a new commit) instead of destructive operations.Amendment branches use a predictable naming convention (
skill-loop/amend-*) so they're easy to identify and clean up.
Troubleshooting
"could not determine executable to run"
npx can't resolve binaries from scoped package names directly. Use the -p flag:
# Wrong
npx @stylusnexus/skill-loop-cli skill-loop init
# Right
npx -y -p @stylusnexus/skill-loop-cli skill-loop initMCP server not picking up new version
npx caches packages aggressively. Pin the version to force a re-fetch:
npx -y -p @stylusnexus/skill-loop-cli@0.2.3 skill-loop initOr re-run skill-loop init after updating -- it detects version mismatches in .mcp.json and offers to update.
"Invalid Settings" / hook format errors
Claude Code hooks require the { matcher, hooks: [{ type, command }] } format. If you configured hooks manually with the old format, update to:
{
"hooks": {
"PreToolUse": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "npx --package=@stylusnexus/skill-loop skill-loop-claude pre-hook" }]
}],
"PostToolUse": [{
"matcher": ".*",
"hooks": [{ "type": "command", "command": "npx --package=@stylusnexus/skill-loop skill-loop-claude post-hook" }]
}]
}
}Or re-run skill-loop init to have it set up hooks correctly.
Only finding some skills (not all)
skill-loop scans both project-local (.claude/skills/) and global (~/.claude/skills/, ~/.claude/agents/) paths. If skills are missing:
Re-run
skill-loop initor/sl scanto rescanCheck that the MCP server is running the latest version (see above)
Skills need either a
dir/SKILL.mdstructure or a standalone.mdfile with YAML frontmatter
Hook errors on every tool call
PreToolUse:* hook error messages usually mean the hooks are running but .skill-telemetry/ hasn't been initialized. Run skill-loop init first.
/skill-loop triggers the wrong skill
If you have a skill named loop, Claude may match skill-loop as Skill(loop). Use /sl instead -- it's the official slash command and avoids this collision.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Research-backed lint + generation for agent context files (CLAUDE.md, AGENTS.md) + prompt enhancer.
Adaptive plan/build/review cycles for AI coding assistants, persisted across sessions.
Search, read and install Agent Skills (SKILL.md) for Claude Code, Cursor, Codex and Copilot.
61FixMyPrompt is a remote MCP server for coding agents. It saves the steps your agent worked out as project memories and fetches them in later sessions, scores and rewrites prompts, and checks CLAUDE.md and AGENTS.md files. Works with Claude Code, Codex and Cursor. Free plan available.
Related MCP Servers
- AlicenseAqualityDmaintenanceIntegrates with the skills.sh ecosystem to allow AI coding agents to discover, install, and manage reusable instruction sets. It enables autonomous agents to extend their capabilities with structured skill discovery and full lifecycle management through the Model Context Protocol.627 npm1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceAutomatically discovers and installs AI skills for your project's tech stack, supporting Claude, Copilot, Codex, and other MCP-compatible agents.13 npm4MIT
- AlicenseNot gradedqualityDmaintenanceEnables automatic knowledge capture and injection of guardrails for AI assistants like Claude and Cursor, improving code quality and preventing recurring mistakes.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding providers to run structured multi-agent development workflows, coordinating lead, explorer, consultant, builder, and reviewer roles through server-owned task claims, action logs, handoffs, and health-gated completion. Also provides read-only skills for use cases, specs, triage, consultation, test writing, reviews, and product documentation across Claude Code, Codex CLI, Cursor, Grok Build, and OpenCode.29 npmMIT