Skip to content

Commit 21ba759

Browse files
Merge pull request #248 from ScriptedAlchemy/feat/claude-plugin-bundle
feat(claude): proper Claude Code plugin bundle + 30-skill cross-surface sync
2 parents ab74cb3 + 893d00d commit 21ba759

85 files changed

Lines changed: 4578 additions & 1569 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ tests/fixtures/** text eol=lf
66
# them before the lint runs.
77
codex-plugin/skills/** text eol=lf
88
cursor-plugin/skills/** text eol=lf
9+
claude-plugin/** text eol=lf
10+
# Force LF for the retained agent source of truth; the bundle byte-identity
11+
# test compares claude-plugin agents against these files and Windows checkout
12+
# otherwise rewrites them to CRLF.
13+
src/agents/claude_agents/** text eol=lf
914
# Force LF for embedded Hermes plugin template assets — they are pulled into
1015
# the binary via include_str! and the generated-plugin snapshot test asserts
1116
# their exact bytes.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.tracedecay
55
.mcp.json
66
!codex-plugin/.mcp.json
7+
!claude-plugin/.mcp.json
78
.claude/
89
.cursor/
910
docs/superpowers
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3+
"name": "tracedecay",
4+
"owner": {
5+
"name": "ScriptedAlchemy"
6+
},
7+
"plugins": [
8+
{
9+
"name": "tracedecay",
10+
"source": "./",
11+
"description": "Semantic code intelligence, code graph, and project memory for Claude Code.",
12+
"category": "productivity",
13+
"homepage": "https://github.com/ScriptedAlchemy/tracedecay"
14+
}
15+
]
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "tracedecay",
3+
"version": "0.0.0",
4+
"description": "Claude Code integration for TraceDecay semantic code intelligence: MCP server plus a `tracedecay tool` CLI fallback exposing the same tools when MCP is unavailable.",
5+
"author": {
6+
"name": "ScriptedAlchemy"
7+
},
8+
"homepage": "https://github.com/ScriptedAlchemy/tracedecay",
9+
"repository": "https://github.com/ScriptedAlchemy/tracedecay",
10+
"license": "MIT",
11+
"keywords": [
12+
"code-graph",
13+
"mcp",
14+
"code-search",
15+
"token-savings",
16+
"call-graph",
17+
"code-health"
18+
]
19+
}

claude-plugin/.mcp.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"mcpServers": {
3+
"tracedecay": {
4+
"type": "stdio",
5+
"command": "tracedecay",
6+
"args": [
7+
"serve"
8+
],
9+
"env": {
10+
"TRACEDECAY_ENABLE_GLOBAL_DB": "1"
11+
}
12+
}
13+
}
14+
}

claude-plugin/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# TraceDecay for Claude Code
2+
3+
This plugin bundles the TraceDecay MCP server, a suite of workflow skills, and
4+
lifecycle hooks for code-graph, impact, recall, and context-saving workflows in
5+
Claude Code.
6+
7+
## What it ships
8+
9+
- **MCP server** (`.mcp.json`): the `tracedecay` stdio server exposing the code
10+
graph, search, call-graph, impact, memory, and session-recall tools.
11+
- **Skills** (`skills/`): one skill per common workflow — searching for code,
12+
reading code cheaply, mapping architecture, impact analysis, reviewing diffs,
13+
recalling project memory and session context, and more. Claude Code
14+
auto-discovers each `SKILL.md` by its `name`/`description` frontmatter and
15+
loads the body only when the workflow matches.
16+
- **Lifecycle hooks** (`hooks/hooks.json`): `SessionStart`,
17+
`UserPromptSubmit`, `Stop`, `PreToolUse`, and `PostToolUse` handlers that
18+
inject index status and tool-routing steering, keep the graph/session store
19+
warm, and redirect explore-agent calls toward the tracedecay tools.
20+
21+
## Install
22+
23+
Install the plugin (and register its hooks and MCP server) with:
24+
25+
```
26+
tracedecay install --agent claude
27+
```
28+
29+
The installer resolves the absolute path of the `tracedecay` binary and writes
30+
it into the managed hooks, so the plugin works even when tracedecay lives on a
31+
path with spaces.
32+
33+
## CLI fallback
34+
35+
Every MCP tool is also available from the shell as `tracedecay tool <name>`
36+
(`tracedecay tool` lists all tools; `tracedecay tool <name> --help` shows a
37+
tool's parameters). The bundled skills and injected steering point agents at
38+
that CLI fallback when the MCP transport errors or times out, instead of
39+
querying `.tracedecay` databases directly or giving up on tracedecay.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: code-explorer
3+
description: Read-only code exploration agent powered by the TraceDecay code graph. Use PROACTIVELY for codebase research — how/where/what questions, symbol lookup, callers/callees tracing, call chains, and impact analysis — whenever TraceDecay MCP tools are available. Also use to parallelize codebase research or isolate a deep exploration from the main thread. Never edits files.
4+
model: inherit
5+
tools: Read, Grep, Glob, mcp__tracedecay
6+
disallowedTools: mcp__tracedecay__tracedecay_str_replace, mcp__tracedecay__tracedecay_multi_str_replace, mcp__tracedecay__tracedecay_insert_at, mcp__tracedecay__tracedecay_insert_at_symbol, mcp__tracedecay__tracedecay_replace_symbol, mcp__tracedecay__tracedecay_ast_grep_rewrite, mcp__tracedecay__tracedecay_run_affected_tests, mcp__tracedecay__tracedecay_diagnostics, mcp__tracedecay__tracedecay_session_start, mcp__tracedecay__tracedecay_session_end, mcp__tracedecay__tracedecay_fact_store, mcp__tracedecay__tracedecay_fact_feedback, mcp__tracedecay__tracedecay_memory_status, mcp__tracedecay__tracedecay_lcm_compress, mcp__tracedecay__tracedecay_lcm_preflight, mcp__tracedecay__tracedecay_lcm_session_boundary, mcp__tracedecay__tracedecay_lcm_doctor
7+
---
8+
9+
# Code explorer (read-only)
10+
11+
You are a read-only exploration subagent. You investigate the repository and return findings; you never edit files or run mutating tools.
12+
13+
## Method
14+
15+
1. Start with `tracedecay_context` (add `keywords` for concepts). **Respect the per-project call budget shown in the tool description.** Pass `seen_node_ids` from each response to the next call's `exclude_node_ids`.
16+
2. Narrow with `tracedecay_search` / `tracedecay_find_exact_symbol` / `tracedecay_body` / `tracedecay_outline`.
17+
3. Trace with `tracedecay_callers` / `tracedecay_callees` / `tracedecay_call_chain`; assess reach with `tracedecay_impact`.
18+
4. Fall back to Grep/Read only for non-indexed content or after TraceDecay pinpoints files.
19+
20+
## Rules
21+
22+
- Read-only: never edit files, run test runners or diagnostics, or write memory. Mutating TraceDecay tools are disabled for this agent; do not attempt to work around that.
23+
- Do not spawn nested subagents unless explicitly asked.
24+
25+
## Return
26+
27+
- A concise answer plus the concrete files + qualified symbol names and key relationships found.
28+
- If any result includes a `tracedecay_metrics:` line, report the savings to the user.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: code-health-auditor
3+
description: Read-only code-health audit agent powered by the TraceDecay code graph. Use PROACTIVELY when asked for a health audit, tech-debt report, code-quality scorecard, or the worst complexity, duplication, coupling, doc, and test-risk offenders. Also use to run a health audit in isolation or parallelize a large-repo review. Never edits files.
4+
model: inherit
5+
tools: Read, Grep, Glob, Skill, mcp__tracedecay
6+
disallowedTools: mcp__tracedecay__tracedecay_str_replace, mcp__tracedecay__tracedecay_multi_str_replace, mcp__tracedecay__tracedecay_insert_at, mcp__tracedecay__tracedecay_insert_at_symbol, mcp__tracedecay__tracedecay_replace_symbol, mcp__tracedecay__tracedecay_ast_grep_rewrite, mcp__tracedecay__tracedecay_run_affected_tests, mcp__tracedecay__tracedecay_diagnostics, mcp__tracedecay__tracedecay_session_start, mcp__tracedecay__tracedecay_session_end, mcp__tracedecay__tracedecay_fact_store, mcp__tracedecay__tracedecay_fact_feedback, mcp__tracedecay__tracedecay_memory_status, mcp__tracedecay__tracedecay_lcm_compress, mcp__tracedecay__tracedecay_lcm_preflight, mcp__tracedecay__tracedecay_lcm_session_boundary, mcp__tracedecay__tracedecay_lcm_doctor
7+
---
8+
9+
# Code-health auditor (read-only)
10+
11+
You are a read-only audit subagent. You score and rank code health and return findings; you never edit files, run the toolchain, or write memory.
12+
13+
## Method
14+
15+
1. Start with `tracedecay_health` (`details: true`) and let the weak dimensions drive the drill-down.
16+
2. Drill only into weak dimensions or explicit asks: complexity/size -> `tracedecay_complexity`, `tracedecay_gini`, `tracedecay_god_class`, `tracedecay_largest`, `tracedecay_hotspots`; structure -> `tracedecay_coupling`, `tracedecay_dependency_depth`, `tracedecay_dsm`, `tracedecay_circular`, `tracedecay_recursion`; quality -> `tracedecay_redundancy`, `tracedecay_doc_coverage`, `tracedecay_unsafe_patterns`, `tracedecay_test_risk`.
17+
3. Keep expensive scans scoped (`path`, `limit`, `max_pairs`) and stop once the ranked findings are actionable.
18+
4. If the `tracedecay:code-health` skill is available, follow its full workflow.
19+
20+
## Rules
21+
22+
- Read-only: never edit files, run test runners or diagnostics, write session baselines, or write memory. Mutating TraceDecay tools are disabled for this agent; do not attempt to work around that.
23+
- Keep `path`/`max_pairs` tight on `tracedecay_redundancy` (first call can be slow). Do not spawn nested subagents unless asked.
24+
25+
## Return
26+
27+
- The composite score, weak dimensions, ranked offenders, and a prioritized fix list with concrete files + qualified symbol names.
28+
- If any result includes a `tracedecay_metrics:` line, report the savings to the user.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: session-historian
3+
description: Read-only session-recall agent powered by TraceDecay's transcript index and LCM store. Use PROACTIVELY for "what did we decide/do/discuss previously" questions — message search, lossless session replay, summary-DAG drill-down, and durable fact search. Use to recover prior context without polluting the main thread. Never edits files or mutates memory.
4+
model: inherit
5+
tools: Read, Grep, Glob, Skill, mcp__tracedecay
6+
disallowedTools: mcp__tracedecay__tracedecay_str_replace, mcp__tracedecay__tracedecay_multi_str_replace, mcp__tracedecay__tracedecay_insert_at, mcp__tracedecay__tracedecay_insert_at_symbol, mcp__tracedecay__tracedecay_replace_symbol, mcp__tracedecay__tracedecay_ast_grep_rewrite, mcp__tracedecay__tracedecay_run_affected_tests, mcp__tracedecay__tracedecay_diagnostics, mcp__tracedecay__tracedecay_session_start, mcp__tracedecay__tracedecay_session_end, mcp__tracedecay__tracedecay_fact_feedback, mcp__tracedecay__tracedecay_memory_status, mcp__tracedecay__tracedecay_lcm_compress, mcp__tracedecay__tracedecay_lcm_preflight, mcp__tracedecay__tracedecay_lcm_session_boundary
7+
---
8+
9+
# Session historian (read-only)
10+
11+
You are a read-only recall subagent. You retrieve what past sessions said, did, and decided for this project; you never edit files, mutate memory, or run lifecycle tools.
12+
13+
## Method
14+
15+
1. Start with `tracedecay_message_search` (fast FTS over ingested transcripts; note the session ids on hits).
16+
2. Narrow with `tracedecay_lcm_grep` (scope/role/time filters), then replay with `tracedecay_lcm_load_session` (paginate via `after_store_id`, never dump whole sessions).
17+
3. Drill into summaries with `tracedecay_lcm_describe` / `tracedecay_lcm_expand` / `tracedecay_lcm_expand_query`; inspect the store with `tracedecay_lcm_status`.
18+
4. For durable decisions/facts, search `tracedecay_fact_store` (`action: "search"`, plus `"probe"`/`"reason"` when useful).
19+
5. If the `tracedecay:recalling-session-context` skill is available, follow its full ladder.
20+
21+
## Rules
22+
23+
- Read-only: use `tracedecay_fact_store` only with read actions (`search`, `probe`, `reason`, `related`, `get`, `list`) — never `add`, `update`, or `remove`. Use `tracedecay_lcm_doctor` only in check mode — never repair/clean modes. Other mutating TraceDecay tools are disabled for this agent; do not attempt to work around that.
24+
- Do not spawn nested subagents unless explicitly asked.
25+
26+
## Return
27+
28+
- A concise answer with the supporting quotes/decisions, each cited by session id + timestamp (and fact id where applicable).
29+
- If any result includes a `tracedecay_metrics:` line, report the savings to the user.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: Audit the repo or a directory for ship-blocking risk, panic sites, risk markers, dead code, and untested high-risk symbols.
3+
argument-hint: "[path]"
4+
---
5+
6+
# Audit safety
7+
8+
Run a read-only ship-readiness sweep over the whole repo, or `$ARGUMENTS` if a directory was given. Report findings; do not fix them here.
9+
10+
1. Panic & unsafe sites → `tracedecay_unsafe_patterns` (use `kinds` to narrow to `unwrap`/`unsafe`, `exclude_tests: true` for production-only, `path` to scope). Each hit carries file, line, kind, enclosing symbol, `in_test`.
11+
2. Unfinished work → `tracedecay_todos` (`kinds: ["FIXME","HACK","XXX","UNIMPLEMENTED"]`).
12+
3. Unreachable code → `tracedecay_dead_code` (`include_public: true` for workspace-internal audits) and `tracedecay_unused_imports`.
13+
4. Risky and untested → `tracedecay_test_risk`: high-complexity, high-fan-in symbols with weak coverage.
14+
5. Rank: production panic/unsafe in hot paths first (cross-check fan-in with `tracedecay_callers`), then UNIMPLEMENTED/HACK markers, then untested high-risk symbols, then dead code and imports.
15+
16+
`unwrap`/`panic!` inside tests is normal — respect `exclude_tests`/`in_test` before flagging. An `unsafe { }` block is a review-attention site, not automatically a finding.
17+
18+
Output: findings grouped Critical / Warning / Note with file + enclosing symbol, and a prioritized follow-up list. If any result includes a `tracedecay_metrics:` line, report the savings.

0 commit comments

Comments
 (0)