stevesolun/ctx / docs
skill-router
FlaggedRepo-aware recommendation manager for ctx. Scans the active repository, identifies stack and workflow signals, recommends a capped set of skills, agents, and MCP servers, and unloads helpers that no longer match the current work after user confirmation. Harnesses are recommended by the custom-model onboarding flow or loop adapters and then attach to the same recommendation layer.
skills-health.md
View on GitHub# Skill health dashboard
[`src/ctx/adapters/claude_code/skill_health.py`](https://github.com/stevesolun/ctx/blob/main/src/ctx/adapters/claude_code/skill_health.py)
scans `~/.claude/skills/` and `~/.claude/agents/` for structural and
catalog issues, then produces a JSON or human-readable dashboard. It
also self-heals catalog drift — without ever modifying a SKILL.md.
## What it checks
For each skill (`~/.claude/skills/<name>/SKILL.md`) and each agent
(`~/.claude/agents/<name>.md`):
| Code | Severity | Condition |
|---|---|---|
| `missing-file` | error | Skill directory has no SKILL.md |
| `unreadable` | error | File exists but can't be decoded as UTF-8 |
| `no-frontmatter` | error | Missing or malformed `---` YAML fence |
| `frontmatter-missing-name` | error | Frontmatter has no `name:` field |
| `frontmatter-missing-description` | warning | Missing `description:` (router relevance suffers) |
| `empty-body` | error | Fewer than `min_body_lines` non-blank lines |
| `over-threshold` | warning | Line count exceeds `skill_transformer.line_threshold`; the packaged default is 180 and users can override it in `~/.claude/skill-system-config.json` |
## Drift detection
`DriftReport` cross-references three sources:
- on-disk entities (skills + agents),
- `~/.claude/skill-manifest.json` → `load[].skill` entries,
- `~/.claude/pending-skills.json` → `graph_suggestions[].name` and
`unmatched_signals[]`.
Anything in the manifest or pending file that doesn't exist on disk
becomes an *orphan*. Orphans are the only thing `heal` is allowed to
touch.
## Self-healing
```bash
python -m ctx.adapters.claude_code.skill_health heal
```
- drops orphaned entries from `skill-manifest.json`
- drops orphaned entries from `pending-skills.json`
- writes atomically (`tempfile.mkstemp` + `os.replace`)
- never modifies SKILL.md files or agent .md files
If nothing needs healing, prints `[heal] nothing to do.` and exits 0.
## CLI
```bash
# Emit a full JSON report
python -m ctx.adapters.claude_code.skill_health scan
# Pretty dashboard
python -m ctx.adapters.claude_code.skill_health dashboard
# CI gate: exit 2 if any error-severity issue or drift is present
python -m ctx.adapters.claude_code.skill_health check --strict
# Apply safe autofixes to manifest + pending
python -m ctx.adapters.claude_code.skill_health heal
```
## Data model
```python
@dataclass(frozen=True)
class Issue:
code: str
severity: str # "warning" | "error"
message: str
@dataclass(frozen=True)
class EntityHealth:
name: str
kind: str # "skill" | "agent"
path: str
lines: int
has_frontmatter: bool
issues: tuple[Issue, ...] = ()
@dataclass(frozen=True)
class DriftReport:
orphaned_manifest: tuple[str, ...] = ()
orphaned_pending: tuple[str, ...] = ()
@dataclass(frozen=True)
class HealthReport:
generated_at: float
entities: tuple[EntityHealth, ...]
drift: DriftReport
totals: dict[str, int]
```
`HealthReport.has_errors` is true when any entity has severity `error`
*or* drift is non-empty — that's the single predicate behind
`check --strict`'s exit code.
## Related
- [Memory anchoring](memory-anchor.md) — dead-reference detection for
auto-memory notes.
- `src/skill_quality.py` (v0.5.0+) — the four-signal quality scorer
(telemetry 0.40, intake 0.20, graph 0.25, routing 0.15) that writes
per-entity sidecars and surfaces A/B/C/D/F grades. The `skill_health`
CLI above focuses on *structural* correctness; `skill_quality`
focuses on *behavioral* quality over time.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |