一键导入
audit-code
Query the skill registry to find relevant architectural skills matching the user codebase, then audit the code against matched skill recommendations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Query the skill registry to find relevant architectural skills matching the user codebase, then audit the code against matched skill recommendations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Query the skill registry to find relevant architectural skills matching what the user wants to build. Searches across configured registries with graceful fallback to local sources.
Run a deep architectural analysis of an agentic AI codebase using a phased approach — index, parallel clustered analysis, and synthesis.
Extract reusable, framework-agnostic skills from an agent codebase analysis report and generate registry-ready skill files. TRIGGER when: a full_report.md has been generated by `/analyze-agent-codebase` (Claude Code) or `@analyze-agent-codebase` (Cursor), the user runs `/extract-skills` (Claude Code) or `@extract-skills` (Cursor), the user asks to extract skills from an analysis.
Extract design decisions, trade-offs, and non-obvious behaviors from a codebase's current source code. TRIGGER when: starting the design analysis pipeline, running `/mine-design` (Claude Code) or `@mine-design` (Cursor) before `/synthesize-decisions` (Claude Code) or `@synthesize-decisions` (Cursor), capturing the reasoning behind current architectural choices, analyzing a codebase snapshot for patterns that would surprise a developer arriving cold.
Run the codebase analysis pipeline — routes to agentic or general path, one step at a time, clearing context between steps (`/clear` in Claude Code, or clear context in Cursor) to prevent context blowup.
Promote design decisions from _analysis/design.md into normative practice skills — guidance that loads before a developer makes the wrong choice. TRIGGER when: _analysis/design.md exists and is ready to promote, running `/synthesize-decisions` (Claude Code) or `@synthesize-decisions` (Cursor) after `/mine-design` (Claude Code) or `@mine-design` (Cursor), extracting design-decision practices from a codebase snapshot analysis.
| name | audit-code |
| description | Query the skill registry to find relevant architectural skills matching the user codebase, then audit the code against matched skill recommendations. |
Use when the user wants to improve their codebase architecture by checking it against skills present in the registry. Invoked as /audit-code (Claude Code) or @audit-code (Cursor).
~/.prism/registries.json (with per-registry caching and source tagging)skill-registry.json in the current project directory_analysis/extracted_skills_codebase/ skill directoriesREGISTRY_TOKEN environment variable (global override) or per-registry token from registries.jsonSkills from multiple registries are merged and each result is tagged with
[registry-name](e.g.,[team],[community]) to identify the source.
Read ~/.prism/skills/_shared/registry-fetch.md and follow its instructions. It resolves all configured registries with ETag caching and local fallbacks, returning a skills array where each entry is tagged with _registry.
Outcomes:
REGISTRY_EMPTY → registry reached but empty, proceed to Step 2NO_REGISTRIES → no registry reachable, stop (the shared file handles the user message)If the skills array from the resolved source is empty, respond with: "No skills have been published to the registry yet." and stop.
Check which analysis files exist:
for f in _analysis/full_report.md _analysis/design.md _analysis/directives.md _analysis/incidents.md; do
test -f "$f" && echo "FOUND: $f" || echo "MISSING: $f"
done
If at least one file is found, list them and ask the user:
"Found existing analysis files in
_analysis/: {list found files}Use these for matching, or run a fresh codebase scan?"
What to extract from each found file:
| File | Extract |
|---|---|
full_report.md | Tech stack, all architectural clusters, patterns present and absent |
design.md | Design decisions, trade-offs, non-obvious behaviors, structural anti-patterns |
directives.md | Known failure modes and rules derived from git history |
incidents.md | Incident patterns and what has broken historically |
Path A — Targeted scan (user chose to use existing files in Step 2.5)
Each _analysis/ file covers specific scan sections. Only scan sections whose covering file is missing.
| Missing file | Scan sections required |
|---|---|
full_report.md | Sections 1 and 5 (always) |
full_report.md AND design.md both missing | Also sections 2, 3, 4 — and sections 6–9 if agentic |
directives.md | Nothing to scan — this file comes from git history, not code |
incidents.md | Nothing to scan — this file comes from git history, not code |
Run only the sections indicated. Ask the user whether the codebase is agentic before running sections 6–9.
Section definitions:
Path B — Full scan (no existing files, or user chose fresh scan)
Ask the user:
"Is this an agentic codebase (uses LLMs, tools, or AI orchestration)?"
Wait for the user's response, then run all sections:
Section definitions are the same as Path A above.
After reading files (Path A) and running any required scan sections, produce a concise internal codebase summary: what the code does, which architectural patterns are present, and which concerns are addressed or absent. This summary is not shown to the user -- it is used in Step 4 for matching.
For each skill in the registry:
TRIGGER when: clause from its description field.If few or no skills match that is ok. It is better to match few highly relevant skills than many loosely related ones.
Rank matched skills by impact: skills addressing gaps or anti-patterns in the codebase rank higher than skills that would refine already-adequate implementations.
Review the ranked list from Step 4 and apply a strict relevance check to each skill. For every matched skill, answer these two questions:
Drop any skill that fails either question. Do not try to preserve a minimum number of results -- zero matches is a valid outcome.
For each surviving skill, classify it into one of two categories:
For each matched skill, try to load its full SKILL.md content.
If the skill was loaded from a remote registry: Fetch the individual skill's SKILL.md using the path field from the registry entry:
python3 << 'PYEOF'
import json, os, urllib.request, urllib.error
registry_url = "" # <-- from Step 1
skill_path = "" # <-- path field from registry entry
# Resolve token: env var override → registries.json entry for this registry
token = os.environ.get("REGISTRY_TOKEN", "")
if not token:
try:
reg_path = os.path.expanduser("~/.prism/registries.json")
with open(reg_path) as f:
regs = json.load(f)
for r in regs.get("registries", []):
if r.get("url", "").rstrip("/") == registry_url.rstrip("/"):
token = r.get("token", "")
break
except Exception:
pass
req = urllib.request.Request(
f"{registry_url}/file/{skill_path}/SKILL.md",
headers={"User-Agent": "Prism/1.0"},
)
if token:
req.add_header("Authorization", f"Bearer {token}")
try:
with urllib.request.urlopen(req) as resp:
content = resp.read().decode()
print(content)
except urllib.error.HTTPError as e:
print(f"FETCH_FAILED: HTTP {e.code}")
except urllib.error.URLError as e:
print(f"FETCH_FAILED: {e.reason}")
PYEOF
If the skill was loaded from local sources: Read _analysis/extracted_skills_codebase/{name}/SKILL.md directly.
If a fetch succeeds for a remote skill, cache it and link it into the project: read ~/.prism/skills/_shared/cache-skill.md and follow its steps. This saves the content to ~/.prism/skills/{name}/SKILL.md and creates the .claude/skills/{name} symlink so the skill is immediately usable and fetchable.
If a fetch fails, note the failure in the output but continue processing other matched skills.
Output the results to _analysis/registry-audit.md, replacing it if it already exists.
Auto-detect repo name and date:
git remote get-url origin 2>/dev/null | sed 's/.*\///;s/\.git$//'
date +%d-%m-%Y
Use this format:
# /audit-code (Claude Code) or @audit-code (Cursor) Results
# {repository} -- {DD-MM-YYYY}
## Immediate attention
| Skill Name | Repository | Why and how the skill can improve the current code |
|---|---|---|
| [registry-name] {name} | {repository} | {gap or anti-pattern it addresses} |
## Long-term improvements
| Skill Name | Repository | Why and how the skill can improve the current code |
|---|---|---|
| [registry-name] {name} | {repository} | {improvement it enables} |
Do not write a section entirely if it has no entries. If no skills are matched, state that the codebase does not exhibit patterns addressed by the registry and stop -- do not write a file.
name field. Do not embed links, repository URLs, or any other markup in the Skill Name column.