/memtrace-quality
Find dead code, complexity hotspots, and refactoring candidates in indexed source code. Use when the user asks about source-code quality, dead code, unused functions, zero callers, complexity, cyclomatic complexity, hotspots, refactoring candidates, or code smell questions. Do
$ npx -y skills add syncable-dev/memtrace-public --skill memtrace-quality --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/memtrace-quality
Context preview
The summary Claude sees to decide when to auto-load this skill.
Find dead code, complexity hotspots, and refactoring candidates in indexed source code. Use when the user asks about source-code quality, dead code, unused functions, zero callers, complexity, cyclomatic complexity, hotspots, refactoring candidates, or code smell questions. Do
SKILL.md
memtrace-quality.SKILL.mdname: memtrace-quality
description: "Find dead code, complexity hotspots, and refactoring candidates in indexed source code. Use when the user asks about source-code quality, dead code, unused functions, zero callers, complexity, cyclomatic complexity, hotspots, refactoring candidates, or code smell questions. Do not use Grep, Glob, rg, or manual reference search for unused code; Memtrace uses graph reachability and complexity metrics."
Overview
Code quality via graph analysis — dead code, complexity hotspots, repository stats.
Quick Reference
| Tool | Purpose | Required | Key optional | |------|---------|----------|--------------| | `find_dead_code` | Zero-caller symbols | `repo_id` | `include_tests`, `limit`, `kinds[]` | | `find_most_complex_functions` | Ranked complexity hotspots | `repo_id` | **`top_n`** (def 20) — not `limit` | | `calculate_cyclomatic_complexity` | Score one symbol | `repo_id`, **`target`** | — | | `get_repository_stats` | Repository overview | `repo_id` | `branch` |
> **Parameter types:** numbers must be JSON numbers — `limit: 20`, never `"20"` (MCP error -32602).
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
Steps
1. Repository overview
{ "repo_id": "memdb" }2. Dead code
{ "repo_id": "memdb", "include_tests": false, "limit": 50 }Exported symbols and entry points excluded by default. Results are candidates, not proof — callers via dynamic dispatch or reflection are invisible to the graph; verify before deleting.
3. Complexity hotspots
{ "repo_id": "memdb", "top_n": 10 }Ordered by call-graph out-degree.
| Score | Rating | Action | |-------|--------|--------| | <5 | Low | Fine | | 5-10 | Medium | Consider simplifying | | 10-20 | High | Refactor candidate | | >20 | Critical | Refactor priority |
4. Single symbol complexity
{ "repo_id": "memdb", "target": "processOrder" }Output
| Result | Carries | |--------|---------| | Dead-code entry (`find_dead_code`) | Symbol name + kind with zero graph callers — e.g. `format_legacy` (Function) | | Complexity row (`find_most_complex_functions`) | Symbol, complexity score, risk level — e.g. `processOrder` — 27, Critical | | Single score (`calculate_cyclomatic_complexity`) | Cyclomatic complexity for `target` | | Stats (`get_repository_stats`) | Node counts by kind, edge counts, community and process counts for `repo_id`/`branch` |
Common Mistakes
| Mistake | Reality | |---------|---------| | `find_most_complex_functions(limit: 10)` | Param is **`top_n`** | | `calculate_cyclomatic_complexity(symbol_id=...)` | Required param is **`target`** | | Only looking at the highest complexity | Medium-complexity functions that are growing (check `get_evolution`) are often more urgent |
Read more
name: memtrace-quality description: "Find dead code, complexity hotspots, and refactoring candidates in indexed source code. Use when the user asks about source-code quality, dead code, unused functions, zero callers, complexity, cyclomatic complexity, hotspots, refactoring candidates, or code smell questions. Do not use Grep, Glob, rg, or manual reference search for unused code; Memtrace uses graph reachability and complexity metrics."
Overview
Code quality via graph analysis — dead code, complexity hotspots, repository stats.
Quick Reference
| Tool | Purpose | Required | Key optional | |------|---------|----------|--------------| | `find_dead_code` | Zero-caller symbols | `repo_id` | `include_tests`, `limit`, `kinds[]` | | `find_most_complex_functions` | Ranked complexity hotspots | `repo_id` | **`top_n`** (def 20) — not `limit` | | `calculate_cyclomatic_complexity` | Score one symbol | `repo_id`, **`target`** | — | | `get_repository_stats` | Repository overview | `repo_id` | `branch` |
> **Parameter types:** numbers must be JSON numbers — `limit: 20`, never `"20"` (MCP error -32602).
Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
Steps
1. Repository overview
{ "repo_id": "memdb" }2. Dead code
{ "repo_id": "memdb", "include_tests": false, "limit": 50 }Exported symbols and entry points excluded by default. Results are candidates, not proof — callers via dynamic dispatch or reflection are invisible to the graph; verify before deleting.
3. Complexity hotspots
{ "repo_id": "memdb", "top_n": 10 }Ordered by call-graph out-degree.
| Score | Rating | Action | |-------|--------|--------| | <5 | Low | Fine | | 5-10 | Medium | Consider simplifying | | 10-20 | High | Refactor candidate | | >20 | Critical | Refactor priority |
4. Single symbol complexity
{ "repo_id": "memdb", "target": "processOrder" }Output
| Result | Carries | |--------|---------| | Dead-code entry (`find_dead_code`) | Symbol name + kind with zero graph callers — e.g. `format_legacy` (Function) | | Complexity row (`find_most_complex_functions`) | Symbol, complexity score, risk level — e.g. `processOrder` — 27, Critical | | Single score (`calculate_cyclomatic_complexity`) | Cyclomatic complexity for `target` | | Stats (`get_repository_stats`) | Node counts by kind, edge counts, community and process counts for `repo_id`/`branch` |
Common Mistakes
| Mistake | Reality | |---------|---------| | `find_most_complex_functions(limit: 10)` | Param is **`top_n`** | | `calculate_cyclomatic_complexity(symbol_id=...)` | Required param is **`target`** | | Only looking at the highest complexity | Medium-complexity functions that are growing (check `get_evolution`) are often more urgent |
Structural memory for AI coding agents. Bi-temporal graph, MCP-native, zero LLM calls. Cursor · Claude Code · Codex · Hermes · VS Code · Windsurf.
Repo: syncable-dev/memtrace-public
Other skills on memtrace-public.
- /memtrace-api-topology
Map API endpoints, outbound HTTP calls, and cross-repo service topology in indexed source code. Use when the user asks about API endpoints, HTTP routes, fetch/client calls, REST surface, service dependencies, cross-repo dependencies, or API topology. Do not use Grep, Glob, rg,
Open skill - /memtrace-change-impact-analysis
Compute what a planned source-code change will break — blast radius, affected processes, cross-repo callers, temporal stability, and Cortex decision-memory constraints — and produce a risk-rated change plan. Use for multi-symbol or multi-part edits, refactors, API changes,
Open skill - /memtrace-cochange
Find files that historically co-change with a target symbol or file, ranked by co-occurrence across git episodes. Use when the user asks about historical coupling, co-change, what changes with this, hidden dependencies, or what else needs to move for source code. Do not use git
Open skill - /memtrace-code-review
Review GitHub pull requests with Memtrace's local graph-backed review engine. Use when the user asks to review a GitHub pull request, run Memtrace code review, post Memtrace review comments, create a PR with a review step, or publish local graph-backed review findings to GitHub.
Open skill - /memtrace-codebase-exploration
Map an indexed source-code repo into a structured overview — scale, communities, central symbols, execution flows, API surface, recent activity. Use when the user wants to explore, understand, onboard to, map, or get an overview of an indexed source-code repo, architecture,
Open skill - /memtrace-continuous-memory
Keep the Memtrace index fresh while editing by watching a repo for live, incremental re-indexing. Use when the user asks to keep Memtrace fresh while editing, watch a repo, enable live or incremental indexing, set up always-on memory (meaning Memtrace index watching, not generic
Open skill

