prompt-audit
Skill3 starsChanged 5 months agoMITView on GitHub
Discover, audit, and rewrite LLM prompts using the R/T/S/C/E/N framework
- Reads credentials
5 other projects use a version of this.
Adopted by
Most recently taken up by
- fedecaccia/prompt-audittheir own version, first seen Nov 8, 2026
- ejoliet/claude-skillstheir own version, first seen Oct 11, 2026
- Megaprompting/torque-looptheir own version, first seen Jul 3, 2026
- Sharan0516/claude-token-optimizertheir own version, first seen Apr 13, 2026
- JWhiteUX/ClaudeSkills-Librarytheir own version, first seen Apr 2, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- Megaprompting/torque-loop★ 10same name
- JWhiteUX/ClaudeSkills-Library★ 4same name
- fedecaccia/prompt-audit★ 2same name
- ejoliet/claude-skills★ 0same name
- Sharan0516/claude-token-optimizer★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository67 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- optimize-contextSkill
- a11y-checkSkill
- api-contractSkill
- backend-patternsSkill
- build-fixSkill
- checkpointSkill
- clickhouse-ioSkill
- code-review-eccSkill
- code-reviewSkill
- coding-standardsSkill
- config-auditSkill
- continuous-learning-v2Skill
- create-prdSkill
- deps-auditSkill
- e2eSkill
- eval-harnessSkill
- evalSkill
- evolveSkill
- executeSkill
- execution-reportSkill
- extract-sharedSkill
- firecrawlSkill
- frontend-designSkill
- frontend-patternsSkill
- golang-patternsSkill
- golang-testingSkill
- implement-fixSkill
- init-projectSkill
- instinct-exportSkill
- instinct-importSkill
- instinct-statusSkill
- iterative-retrievalSkill
- lazySkill
- learnSkill
- orchestrateSkill
- perf-profileSkill
- plan-eccSkill
- plan-featureSkill
- postgres-patternsSkill
- primeSkill
- project-guidelines-exampleSkill
- projectSkill
- python-patternsSkill
- python-reviewSkill
- python-testingSkill
- rcaSkill
- refactor-cleanSkill
- releaseSkill
- security-reviewSkill
- seo-kitSkill
- set-working-dirSkill
- skill-createSkill
- strategic-compactSkill
- supadataSkill
- system-reviewSkill
- tddSkill
- tdd-workflowSkill
- test-coverageSkill
- testSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 11 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Read the framework reference before any audit or rewrite work: {skill_base_dir}/references/framework.md
- Distinctive: line 48
Read the content of each discovered prompt and classify using framework.md signals:
- Distinctive: line 56
When signals are ambiguous, default to Structured.
- Very specific: line 60
If the same prompt appears in multiple tiers (e.g., a standalone .md file AND a register_default() call), show it once with the …
- Distinctive: line 90
Limit output to 50 results: If more are found, show the first 50 and note: "{X} additional prompts found.
- Distinctive: line 98
If discover has not been run in this session, run it first automatically.
- Very specific: line 100
Read {skill_base_dir}/references/framework.md for the grading criteria.
- Distinctive: line 192
If discover and audit have not been run, run them first automatically.
- Distinctive: line 203
If the inventory contains inline prompts, note:
- Distinctive: line 213
If well-structured: "No changes needed — this prompt is appropriately simple."
- Distinctive: line 214
If improvements possible: propose lightweight fixes only (clearer role, explicit format in Notes)
- Distinctive: line 215
Wait for: accept / modify / skip
- Distinctive: line 234
If the project already has a prompt loader or directory, use that path
- Very specific: line 248
Preserve the project's variable syntax: If the project uses {var}, ${var}, Jinja {{ var }}, or any other convention, match it.
- Distinctive: line 249
Never modify code structure around inline prompts: Only touch the prompt string content (in extract mode) or add comments (in in-place …
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Base directory for this skill: {injected by Claude Code at runtime}
Parse $ARGUMENTS for mode and optional path. If $ARGUMENTS starts with discover, audit, or rewrite, use that mode. Otherwise default to discover. If a path is provided after the mode, use it; otherwise use the current working directory.
Read the framework reference before any audit or rewrite work:
{skill_base_dir}/references/framework.md
where {skill_base_dir} is the base directory shown above.
Mode 1: Discover
Scan the project for all LLM prompts. Present an inventory with purpose classification.
Step 1: Scan using tiered detection
Tier 1 — Standalone template files (high confidence):
- Glob for
**/*.mdin directories namedprompts/,templates/,prompt*/,system_messages/,ai/,llm/,ai_prompts/,llm_prompts/ - Glob for
**/*.txtor**/*.jinja2in the same directories - Grep YAML/YML files for keys:
prompt:,system_prompt:,system_message: - Content-based fallback: any
.mdfile containing BOTH# RoleAND (# TaskOR# System Prompt) headers - Standalone files matching
**/system_prompt*.*,**/prompt_template*.*
Tier 2 — Inline prompt strings (medium confidence):
- Python:
system_prompt\s*=,system\s*=,SYSTEM_PROMPT,_PROMPT\s*=,register_default(, multiline"""strings containingYou are - JS/TS:
const.*[Pp]rompt,system:,role:\s*["']system["'], template literals containingYou are - Go:
prompt\s*:=,systemPrompt,const.*Prompt - Ruby:
SYSTEM_PROMPT,prompt =, heredocs containingYou are - Rust:
SYSTEM_PROMPT,let.*prompt,system_prompt - Java/Kotlin:
SYSTEM_PROMPT,systemPrompt, multiline"""containingYou are
Tier 3 — Config-embedded prompts (lower confidence):
- JSON files with
prompt,system_prompt,system_messagekeys - YAML files with same keys
.envfiles with*_PROMPT=variables (flag existence only, do not read values)
Exclusions: Skip node_modules/, .venv/, dist/, build/, vendor/, .git/, __pycache__/, *.min.js
Step 2: Classify each prompt
Read the content of each discovered prompt and classify using framework.md signals:
| Signal | Class |
| < 100 words, no variables, single output format | Directive |
| Scoring rubric, JSON schema, multi-step analysis, multi-field output | Structured |
| Audience/tone spec, creative output, multiple variants/segments | Generative |
When signals are ambiguous, default to Structured.
Step 3: Deduplicate
If the same prompt appears in multiple tiers (e.g., a standalone .md file AND a register_default() call), show it once with the highest-confidence tier. Note the duplicate in the Format column: "Standalone MD (also registered inline at path:line)".
Step 4: Present inventory
# Prompt Inventory — {project name}
Found {N} prompts across {M} files
| # | Name/Purpose | File | Format | Tier | Class |
|---|-------------|------|--------|------|-------|
| 1 | JSON format enforcer | utils/format.py:12 | Inline Python | 2 | Directive |
| 2 | Lead scoring prompt | prompts/scoring.md | Standalone MD | 1 | Structured |
| 3 | Email outreach template | prompts/outreach.md | Standalone MD | 1 | Generative |
Summary: {D} Directive, {S} Structured, {G} Generative
- Directive prompts: lightweight review only (Role + Task + Notes)
- Structured/Generative prompts: full R/T/S/C/E/N audit recommendedIf zero prompts found:
No LLM prompts found in {path}. This could mean:
- Prompts are in an unusual location — try
/prompt-audit discover path/to/specific/dir- Prompts are embedded in code patterns not covered by current heuristics
- This project doesn't use LLM prompts
Search patterns used: {list the Tier 1/2/3 patterns tried}
If prompts found, ask: "Proceed to audit these prompts? (yes / select specific numbers / adjust scope)"
Limit output to 50 results. If more are found, show the first 50 and note: "{X} additional prompts found. Show next page? (yes / filter by tier / filter by class)"
Mode 2: Audit
Grade each discovered prompt against the R/T/S/C/E/N framework, adapted to its class.
If discover has not been run in this session, run it first automatically.
Read {skill_base_dir}/references/framework.md for the grading criteria.
Scoring Rubric
Structured and Generative prompts — qualitative tiers:
| Tier | Meaning | Criteria |
| Strong | Follows recommended structure well | All required sections present and substantive; best practices followed |
| Needs Work | Foundation exists but gaps are clear | 1-2 required sections missing or weak; some best practices missing |
| Major Gaps | Significant restructuring needed | 3+ sections missing; no chain-of-thought; constraints scattered or absent |
Directive prompts — pass/fail: clear role, clear instruction, output format specified? Pass. Otherwise fail with specific recommendation.
Per-prompt audit (stepped, one at a time)
For each prompt, present and wait for user acknowledgment before proceeding to the next:
Header:
## Prompt {N} of {total}: {name} ({Class})
File: {path}:{line}
Classification: {Class} — {reasoning}
Recommended structure: {sections list}For Directive prompts:
| Section | Status | Note |
| Role | Present / Weak / Missing | Has identity + purpose? |
| Task | Present / Weak / Missing | Clear instruction? |
| Notes | Present / Weak / Missing | Output format specified? |
| Full R/T/S/C/E/N | Not recommended | This prompt is appropriately simple |
Verdict: Pass / Fail + specific lightweight recommendations.
For Structured prompts:
| Section | Grade | Criteria |
| Role | Present / Weak / Missing | Identity + stakes + tone? |
| Task | Present / Weak / Missing | Numbered analytical steps + variables? |
| Specifics | Present / Weak / Missing | Quantified constraints / rubric? |
| Context | Present / Weak / Missing | Relevant background? |
| Examples | Present / Weak / Missing | 2+ labeled examples? |
| Notes | Present / Weak / Missing | Output format + constraints at end? |
Additional checks:
- Chain-of-thought steps (yes/no)
- Variable system (detected/none)
- Constraint placement (beginning/middle/end — end is correct)
- Few-shot examples (count)
- Anti-pattern list (yes/no)
- Output format specification (yes/no)
- Scoring guidance: conservative defaults stated? (scoring prompts only)
Verdict: Strong / Needs Work / Major Gaps + specific recommendations.
For Generative prompts:
Same grading table as Structured, plus:
- Tone specification (yes/no)
- Audience definition (yes/no)
- Banned phrases / anti-patterns (yes/no)
- Example variety (single variant / multiple segments or styles)
Verdict: Strong / Needs Work / Major Gaps + specific recommendations.
Aggregate summary (after all prompts)
# Audit Summary
| Class | Count | Strong | Needs Work | Major Gaps |
|-------|-------|--------|------------|------------|
| Directive | {n} | {n} pass | {n} fail | — |
| Structured | {n} | {n} | {n} | {n} |
| Generative | {n} | {n} | {n} | {n} |
Top recommendations:
1. {Most common gap across all prompts}
2. {Second most common}
3. {Third most common}Mode 3: Rewrite
Propose R/T/S/C/E/N rewrites with user review for each prompt.
If discover and audit have not been run, run them first automatically.
Step 1: Choose rewrite mode
Present the choice with context about the prompt inventory:
Rewrite mode: Choose how to handle rewrites:
- Extract — Write restructured prompts to a
prompts/directory as standalone.mdfiles. Works for all prompt types. Recommended for inline prompts.- In-place — Rewrite standalone
.mdfiles directly. For inline code strings, adds annotated recommendations above the prompt (rewriting inline strings risks breaking code structure).- Hybrid — Extract for inline prompts, in-place for standalone files. (Recommended when inventory contains both types)
If the inventory contains inline prompts, note:
Note: {N} prompts are inline code strings. Extract mode is recommended for these — it creates standalone files you can load at runtime. In-place mode can only annotate inline strings, not restructure them.
For extract mode, ask for the target directory on first prompt (default: {project}/prompts/). If the project already has a prompt directory, suggest using it.
Step 2: Step through prompts (one at a time)
For Directive prompts:
- Show current prompt
- State: "Classified as Directive. Full R/T/S/C/E/N restructuring is not recommended."
- If well-structured: "No changes needed — this prompt is appropriately simple."
- If improvements possible: propose lightweight fixes only (clearer role, explicit format in Notes)
- Wait for: accept / modify / skip
For Structured and Generative prompts:
- Show the current prompt (summary if > 50 lines)
- Present the proposed R/T/S/C/E/N rewrite with all recommended sections
- Highlight what changed and why (referencing framework.md):
- Sections added (with rationale)
- Content moved (e.g., constraints moved from middle to Notes)
- Chain-of-thought steps introduced
- Examples added (with labeled headers)
- Wait for: accept / modify / skip
- accept — apply the rewrite (extract to file or edit in place)
- modify — user provides feedback, Claude revises and re-presents (max 3 rounds per prompt; after 3, present current version as final)
- skip — leave unchanged, move to next
Rewrite behaviors
Extract mode:
- Write to
{target_dir}/{name}.md - If the project already has a prompt loader or directory, use that path
- For inline prompts being extracted: warn the user that they'll need to update the calling code to load from the file. Do NOT auto-modify the calling code.
In-place mode:
- Standalone
.mdfiles: rewrite the file directly - Inline code strings: add a
# PROMPT-AUDIT: Restructure to R/T/S/C/E/Ncomment block above the prompt with specific recommendations. Do NOT modify the prompt string itself. - Directive prompts with no changes needed: skip silently
Hybrid mode:
- Apply extract behavior to inline prompts
- Apply in-place behavior to standalone files
Critical rules for rewrites
- Preserve the project's variable syntax. If the project uses
{var},${var}, Jinja{{ var }}, or any other convention, match it. Do not impose{{var}}. - Never modify code structure around inline prompts. Only touch the prompt string content (in extract mode) or add comments (in in-place mode).
- When extracting inline prompts to files, warn the user that they'll need to update the calling code. Do not auto-modify code.
- Preserve domain-specific content. The rewrite restructures sections and adds framework elements; it should not change the prompt's business logic, scoring criteria, or domain rules.
Quick Reference
| Command | What it does |
/prompt-audit | Discover mode (default) on current directory |
/prompt-audit discover | Scan and classify all prompts |
/prompt-audit discover path/to/dir | Scan a specific directory |
/prompt-audit audit | Grade prompts against framework (runs discover first if needed) |
/prompt-audit rewrite | Propose rewrites with user review (runs discover + audit first if needed) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

