Skip to content

stevesolun/ctx / docs

skill-router

Flagged

Repo-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.

FileKindSize
SKILL.mdskill md9.3 KB
assets/javascripts/catalog.jsscript2.5 KB
assets/javascripts/repo-stats-refresh.jsscript3.2 KB
backup-hook-install.mdmarkdown9.2 KB
catalog.mdmarkdown10.3 KB
ctx-fit/ARCHITECTURE_CANDIDATES.mdmarkdown12.9 KB
ctx-fit/ARCHITECTURE_GAP_ANALYSIS.mdmarkdown10.7 KB
ctx-fit/CTX_AUDIT.mdmarkdown11.6 KB
ctx-fit/CURRENT_STATE.mdmarkdown16.3 KB
ctx-fit/DECISIONS.mdmarkdown15.7 KB
ctx-fit/GOOD_FIRST_ISSUES.mdmarkdown20.6 KB
ctx-fit/IMPLEMENTATION_TRACKER.mdmarkdown697 B
ctx-fit/MAP.mdmarkdown7.8 KB
ctx-fit/PRD.mdmarkdown9.7 KB
ctx-fit/STATE.mdmarkdown60.9 KB
ctx-fit/milestones/M1_SPIKE_FRICTION_LOG.mdmarkdown5.5 KB
ctx-fit/milestones/MILESTONE_00_AUDIT.mdmarkdown5.1 KB
ctx-fit/planned_tasks.mdmarkdown17.7 KB
dashboard.mdmarkdown24.7 KB
enterprise-readiness-review.mdmarkdown8.7 KB
entity-onboarding.mdmarkdown18.0 KB
harness/attaching-to-hosts.mdmarkdown16.2 KB
harness/clean-host-contract.mdmarkdown4.5 KB
harness/loopflow-adapter-demo.mdmarkdown11.1 KB
huggingface-publish.mdmarkdown3.3 KB
index.mdmarkdown22.4 KB
knowledge-graph.mdmarkdown22.7 KB
marketplace-registry.mdmarkdown4.0 KB
memory-anchor.mdmarkdown2.7 KB
plans/ctx-agent-reviewer-workbench.mdmarkdown12.4 KB
plans/unified-capability-engine.mdmarkdown59.0 KB
qa/dashboard-user-story-status.csvother26.0 KB
qa/feature-user-story-status.csvother92.5 KB
research/context-engineering-guidance-audit.mdmarkdown10.4 KB
services/macos/com.claude.backup.watchdog.plistother1.7 KB
services/systemd/claude-backup-watchdog.serviceother1.3 KB
skill-lifecycle-and-dashboard.mdmarkdown6.2 KB
skill-quality-install.mdmarkdown6.2 KB
skill-router/index.mdmarkdown2.5 KB
skill-stack-matrix.mdmarkdown5.5 KB
skills-health.mdmarkdown3.5 KB
stack-signatures.mdmarkdown6.2 KB
telemetry.mdmarkdown24.7 KB
threat-model.mdmarkdown15.0 KB
toolbox/behavior-miner.mdmarkdown2.6 KB
toolbox/configuration.mdmarkdown4.0 KB
toolbox/council-runner.mdmarkdown2.4 KB
toolbox/hooks.mdmarkdown2.6 KB
toolbox/index.mdmarkdown3.0 KB
toolbox/intent-interview.mdmarkdown3.0 KB
toolbox/starters.mdmarkdown3.0 KB
toolbox/templates/docs-review.jsonconfig599 B
toolbox/templates/fresh-repo-init.jsonconfig533 B
toolbox/templates/refactor-safety.jsonconfig634 B
toolbox/templates/security-sweep.jsonconfig636 B
toolbox/templates/ship-it.jsonconfig676 B
toolbox/verdicts.mdmarkdown4.0 KB

memory-anchor.md

View on GitHub
# Memory anchoring

[`src/memory_anchor.py`](https://github.com/stevesolun/ctx/blob/main/src/memory_anchor.py)
walks the auto-memory store and flags references that no longer
resolve against the current repository.

## Why it exists

Claude's auto-memory accumulates notes that look like:

> Fixed the `add_skill()` bug in `src/skill_loader.py:42`. See also
> `docs/intent-interview.md`.

Those backtick references rot as the codebase moves. A renamed file, a
deleted module, a moved doc — and the memory silently points at
nothing. `memory_anchor` turns that silent rot into a loud dashboard.

## Where it looks

Memory files live under:

```text
~/.claude/projects/<slug>/memory/*.md
```

The module recursively scans that tree. You can override the root with
`--memory-root` (useful for tests or multi-project setups).

## What counts as a reference

Only tokens inside **backtick code spans** qualify. The heuristic is
deliberately conservative to keep false positives low:

- known extension (`.py`, `.md`, `.json`, `.yml`, `.ts`, `.rs`, …), or
- contains a `/` with a dotted final segment.

Tokens with whitespace, `()` suffixes, `http(s)://` prefixes, or leading
`-` are rejected up front. A trailing `:<digits>` is parsed as a line
suffix — `:` without digits is preserved (keeps Windows drive letters
intact).

## How resolution works

For each extracted reference, the module asks whether it resolves:

1. tilde-expand, if `~/…`
2. if absolute, does the path exist?
3. does `repo_root / path` exist?
4. does `repo_root / src / path` exist?

If any candidate hits, the ref is *live*; otherwise *dead*.

## CLI

```bash
# JSON report for downstream tooling
python -m memory_anchor scan

# Human dashboard
python -m memory_anchor dashboard

# CI gate: exit 2 if any dead references remain
python -m memory_anchor check --strict

# Override repo / memory roots
python -m memory_anchor check --strict \
  --repo-root /path/to/repo \
  --memory-root /path/to/project/memory
```

When `--repo-root` is omitted, the module walks upward from the current
directory to the nearest `.git/` ancestor.

## Data model

```python
@dataclass(frozen=True)
class AnchorRef:
    raw: str          # exactly the backtick contents
    path: str         # path sans trailing :<line>
    line: int | None
    exists: bool

@dataclass(frozen=True)
class MemoryAnchorFile:
    memory_path: str
    refs: tuple[AnchorRef, ...]
    # derived: .live, .dead

@dataclass(frozen=True)
class AnchorReport:
    generated_at: float
    repo_root: str
    memory_root: str
    files: tuple[MemoryAnchorFile, ...]
    # derived: .all_refs, .live_count, .dead_count, .has_dead
```

## Related

- [Skill health dashboard](skills-health.md) — structural and drift
  checks for the skill + agent catalog.
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: 472kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall