| name | diagnose-substrate |
| description | Audit an existing Claude Code workspace for canon-substrate gaps โ the failure mode where users build sophisticated agent stacks without a CORPUS_MAP / SCHEMA / decisions/ layer underneath, leaving every agent's "consult on demand" reference list resolving to nothing. Reports ship-blocking issues, fragile-but-working issues, and noise. Use when invited into someone's `.claude/agents/` directory to do an audit-and-recommend pass. |
| disable-model-invocation | true |
| allowed-tools | Bash(node *) |
| argument-hint | <path to workspace root containing .claude/agents/> |
Liminal Agents โ Substrate Diagnostic
You are auditing a Claude Code workspace for canon-substrate gaps. The workspace may have an existing agent layer (subagents in .claude/agents/) that runs on prompt-only context with no canonical substrate underneath. This audit identifies what's broken, fragile, or noisy โ and proposes the foundation pack shape that would fix it.
The audit is read-only. It does NOT modify the workspace. It produces a structured report.
When to invoke
- User has a working
.claude/agents/ directory and asks "is my setup right?"
- User shares a snapshot zip of their Claude config and wants a review
- User reports "Claude doesn't remember things between sessions" โ high-probability symptom of memory-path mismatch or empty memory dir
- Before offering canon-substrate templates from
liminal-agents/templates/canon-substrate/, run this diagnostic first so the templates are tuned to actual gaps
Flow
1. Validate input
User provides a workspace root path. Verify:
- Path exists and is a directory
.claude/agents/ exists under it (or .claude/ somewhere reachable)
- If neither, abort with "no agent layer found at /.claude/agents/"
2. Run the diagnostic
Invoke:
node ~/liminal/liminal-agents/skills/diagnose-substrate/diagnose.js <workspace-path>
The script produces a JSON report with sections:
broken[] โ ship-blocking issues (memory-path mismatch, missing CLAUDE.md, no CORPUS_MAP)
fragile[] โ works but risky (quarantine model relies only on system-prompt-only declarations, settings flags that disable safety prompts, agent overlap)
noise[] โ cosmetic issues (inert JSON-comment-string entries in allow arrays, etc.)
agent_summary โ count of agents, average lines, models used, tools granted
recommended_foundation_pack โ which template files would address each broken/fragile issue
3. Present the report
Render the report in this order:
- Headline โ one line summarizing severity (e.g. "3 ship-blocking, 4 fragile, 1 noise")
- Broken issues โ for each, name the issue + the canonical fix
- Fragile issues โ for each, name the issue + the risk vector
- Noise โ flagged but not blocking
- Foundation-pack recommendation โ link to
liminal-agents/templates/canon-substrate/ with which template files address which gaps
4. Offer next step
Ask the user: would they like the foundation pack deployed to their workspace? If yes, do NOT auto-deploy โ produce a paste-into-Claude landing prompt (similar to the one Shruti shipped to Sam on 2026-05-19) that lands the templates without disturbing the existing agent layer.
Output principles
- Read-only. Never modify the workspace.
- Honest severity. Don't soften broken-โ-fragile. Memory-path mismatch is broken, even if "the agents still respond." They respond on empty context.
- No upsell. The diagnostic is the deliverable. Foundation-pack deployment is a separate action, surfaced only if the user asks.
- Specific, not generic. "Your memory dir resolves to ; the agents reference ; the difference is the project-name mismatch from a prior CWD" โ not "your memory might not work."
Related canon
- Architectural rationale:
liminal-agents/SPEC.md ยง14 "Canon Substrate as Agent-Layer Prerequisite"
- Foundation pack templates:
liminal-agents/templates/canon-substrate/
- Reference instance (Shruti's own canon):
~/liminal/founder-brain/CLAUDE.md + ~/liminal/founder-brain/meta/CORPUS_MAP.md
- Original live audit that produced this skill:
~/liminal/founder-brain/retros/2026-05-19-helping-sam-shape-of-help.md