بنقرة واحدة
audit-process
Run a comprehensive multi-stage automation audit with parallel agents
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Run a comprehensive multi-stage automation audit with parallel agents
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Structured discovery-first planning for complex tasks. Ask exhaustive categorized questions, build a standalone decision record, then produce a step-by-step implementation plan with audit checkpoints and convergence-loop verification of diagnosis and plan claims for user approval before any code is written.
Multi-agent research engine that decomposes questions, dispatches parallel searcher agents, synthesizes findings with citations and confidence levels, runs mandatory contrarian/OTB challenges, gap-pursuit verification, and cross-model verification via Gemini CLI, and produces structured output with downstream adapters, research index, and management commands.
Pre-flight checklist for work sessions — loads context, runs health scripts, surfaces warnings, and gates on acknowledgment before work begins.
PR Review Retrospective -- actionable analysis of a PR's review cycle with convergence-loop deliverable verification, interactive findings walkthrough, and dashboard for missing retros
Process external PR code review feedback (CodeRabbit, Qodo, SonarCloud, Gemini) through a structured 8-step protocol. Parses all items, categorizes by severity and origin, fixes in priority order, tracks deferred items to TDMS, and captures learnings. This skill processes review feedback — it does not generate reviews.
Query the Content Analysis System (CAS) knowledge base. Search extraction candidates, filter by tags/type/source, search across all analyzed sources.
| name | audit-process |
| description | Run a comprehensive multi-stage automation audit with parallel agents |
Version: 2.5 Last Updated: 2026-04-03 Status: ACTIVE
This audit covers 16 automation types across 12 audit categories using a 7-stage approach with parallel agent execution.
/audit-process| Stage | Name | Parallel Agents | Output |
|---|---|---|---|
| 1 | Inventory & Dependency Map | 6 | stage-1-inventory.md |
| 2 | Redundancy & Dead Code | 3 | stage-2-redundancy.jsonl |
| 3 | Effectiveness & Functionality | 4 | stage-3-effectiveness.jsonl |
| 4 | Performance & Bloat | 3 | stage-4-performance.jsonl |
| 5 | Quality & Consistency | 3 | stage-5-quality.jsonl |
| 6 | Coverage Gaps & Improvements | 3 | stage-6-improvements.jsonl |
| 7 | Synthesis & Prioritization | 1 (sequential) | Final report + action plan |
Total: 22 parallel agents across 6 stages + 1 synthesis stage
EVERY agent MUST write outputs directly to files. NEVER rely on conversation context.
Write findings to: ${AUDIT_DIR}/[filename].jsonl<result> text and write it to the expected stage JSONL
file using the Write tool. Do NOT proceed to the next stage until all current
stage output files are non-empty. Empty results must never be silently
accepted -- report failure to user if no output available via any channel.| # | Type | Location | Count |
|---|---|---|---|
| 1 | Claude Code Hooks | .claude/hooks/ | ~29 |
| 2 | Claude Code Skills | .claude/skills/ | ~49 |
| 3 | Claude Code Commands | .claude/commands/ | ~12 |
| 4 | npm Scripts | package.json | ~60 |
| 5 | Standalone Scripts | scripts/ | ~61 |
| 6 | Script Libraries | scripts/lib/ | ~4 |
| 7 | GitHub Actions Workflows | .github/workflows/ | ~10 |
| 8 | Git Hooks (Husky) | .husky/ | 2 |
| 9 | lint-staged | package.json | 1 config |
| 10 | ESLint | eslint.config.mjs | 1 config |
| 11 | Prettier | .prettierrc | 1 config |
| 12 | Firebase Cloud Functions | functions/src/ | ~8 |
| 13 | Firebase Scheduled Jobs | functions/src/jobs.ts | ~3+ |
| 14 | Firebase Rules | *.rules | 2 |
| 15 | MCP Servers | mcp.json / scripts/mcp/ | ~6 |
| 16 | TypeScript Configs | tsconfig*.json | 2+ |
| # | Category | Focus |
|---|---|---|
| 1 | Redundancy & Duplication | Same thing in multiple places |
| 2 | Dead/Orphaned Code | Never called, does nothing |
| 3 | Effectiveness | Too weak, always passes |
| 4 | Performance & Bloat | Slow, unnecessary work |
| 5 | Error Handling | Silent failures, wrong severity |
| 6 | Dependency & Call Chain | What triggers what |
| 7 | Consistency | Mixed patterns, naming |
| 8 | Coverage Gaps | Missing checks |
| 9 | Maintainability | Complex, undocumented |
| 10 | Functionality | Does it actually work? |
| 11 | Improvements | Could be better |
| 12 | Code Quality | Bugs, security, bad patterns |
Read
.claude/skills/_shared/AUDIT_TEMPLATE.mdfor standard audit procedures.
Read
.claude/skills/audit-process/prompts.mdfor full agent prompt specifications.
| ID | Name | Type | Stage |
|---|---|---|---|
| 1A | Hooks Inventory | Explore | 1 |
| 1B | Scripts Inventory | Explore | 1 |
| 1C | Skills & Commands | Explore | 1 |
| 1D | CI & Config | Explore | 1 |
| 1E | Firebase | Explore | 1 |
| 1F | MCP Servers | Explore | 1 |
| 2A | Orphan Detection | Explore | 2 |
| 2B | Duplication Detection | Explore | 2 |
| 2C | Unused & Never-Triggered | Explore | 2 |
| 3A | Hook Effectiveness | code-reviewer | 3 |
| 3B | CI Workflow Effectiveness | code-reviewer | 3 |
| 3C | Script Functionality | code-reviewer | 3 |
| 3D | Skill/Command Functionality | code-reviewer | 3 |
| 4A | Git Hook Performance | Explore | 4 |
| 4B | CI Performance | Explore | 4 |
| 4C | Script Performance | code-reviewer | 4 |
| 5A | Error Handling | code-reviewer | 5 |
| 5B | Code Quality | code-reviewer | 5 |
| 5C | Consistency | Explore | 5 |
| 6A | Coverage Gap Analysis | Explore | 6 |
| 6B | Improvement Opportunities | general-purpose | 6 |
| 6C | Documentation & Maint. | Explore | 6 |
Search for context from past sessions before running:
mcp__plugin_episodic -
memory_episodic -
memory__search({
query: ["process audit", "automation", "hooks"],
limit: 5,
});
npm run review:check
AUDIT_DATE=$(date +%Y-%m-%d)
AUDIT_DIR="docs/audits/single-session/process/audit-${AUDIT_DATE}"
mkdir -p "${AUDIT_DIR}"
echo "AUDIT_DIR is: ${AUDIT_DIR}"
ls -la "${AUDIT_DIR}" || echo "ERROR: AUDIT_DIR does not exist"
AUDIT_PATH=$(realpath "${AUDIT_DIR}" 2>/dev/null || echo "${AUDIT_DIR}")
REPO_ROOT=$(realpath "." 2>/dev/null || echo ".")
if [ -z "${AUDIT_DIR}" ] || [ "${AUDIT_PATH}" = "/" ] || [ "${AUDIT_PATH}" = "${REPO_ROOT}" ]; then
echo "FATAL: AUDIT_DIR must be a proper subdirectory under the repo, not root"
exit 1
fi
Read docs/technical-debt/FALSE_POSITIVES.jsonl and note patterns to exclude.
Run agents 1A-1F in parallel. After completion, merge into
stage-1-inventory.md, build dependency graph, identify orphans. No JSONL
findings yet -- discovery only.
STAGE1_FILES="stage-1a-hooks.md stage-1b-scripts.md stage-1c-skills.md stage-1d-ci-config.md stage-1e-firebase.md stage-1f-mcp.md"
for f in $STAGE1_FILES; do
if [ ! -s "${AUDIT_DIR}/$f" ]; then
echo "ERROR: Missing or empty: ${AUDIT_DIR}/$f"
exit 1
fi
done
Each stage follows the same pattern:
stage-2-redundancy.jsonl)node scripts/debt/intake-audit.js ${AUDIT_DIR}/stage-N-*.jsonlStage verification template (run before proceeding to next stage):
# Check for misplaced files in root (context compaction recovery)
ROOT_AUDIT_FILES=$(ls *.jsonl 2>/dev/null | grep -E "stage-N" | wc -l)
if [ "$ROOT_AUDIT_FILES" -gt 0 ]; then
echo "WARNING: Found stage files in root directory!"
mv stage-N*.jsonl "${AUDIT_DIR}/" 2>/dev/null || true
fi
all-findings-raw.jsonlMASTER_DEBT.jsonlAUTOMATION_AUDIT_REPORT.mdDo NOT present findings for review until cross-referenced against MASTER_DEBT.jsonl. Classify each finding as: Already Tracked (skip), New Finding (review), or Possibly Related (flag). Present only New and Possibly Related findings.
Present findings in batches of 3-5 items, grouped by severity (S0 first). Each item shows: title, severity, effort, confidence, current state, suggested fix, acceptance tests, counter-argument, and recommendation.
Create ${AUDIT_DIR}/REVIEW_DECISIONS.md after first batch to track decisions.
Process: ACCEPTED -> TDMS intake, DECLINED -> remove, DEFERRED -> keep as NEW.
node scripts/validate-audit.js ${AUDIT_DIR}/all-findings-raw.jsonlnode scripts/reset-audit-triggers.js --type=single --category=process --applynode scripts/debt/validate-schema.js docs/technical-debt/MASTER_DEBT.jsonlnode scripts/debt/generate-views.jsgit add docs/audits/single-session/process/ docs/technical-debt//audit-process stage 1 - Run only Stage 1 (Inventory)/audit-process stage 2 - Run only Stage 2 (Redundancy)/audit-process stage 3-4 - Run Stages 3 and 4/audit-process full - Run all 7 stages (default)Note: Stages 2-6 depend on Stage 1 inventory.
Process audit triggers: ANY CI/hook/script file changed since last audit, OR 75+ commits since last audit.
All findings MUST include: file, line, title, description, recommendation, severity, category. S0/S1 require HIGH or MEDIUM confidence, dual-pass verification, and tool validation where possible.
If the session is interrupted:
.claude/state/audit-process-<date>.state.json${AUDIT_DIR}/for stage in 1 2 3 4 5 6; do
count=$(ls ${AUDIT_DIR}/stage-${stage}*.* 2>/dev/null | wc -l)
if [ "$count" -gt 0 ]; then
echo "Stage $stage: FOUND ($count files)"
else
echo "Stage $stage: MISSING"
fi
done
| Version | Date | Changes |
|---|---|---|
| 2.5 | 2026-04-03 | Windows output fallback for 0-byte agent files (claude-code#39791) |
| 2.4 | 2026-02-24 | Extract 22 agent prompts to prompts.md (68% size reduction) |
| 2.3 | 2026-02-23 | Add mandatory MASTER_DEBT cross-reference step before interactive review |
| 2.2 | 2026-01-31 | Added recovery procedures, root check safeguards, Step 2.5 |
| 2.1 | 2026-01-31 | Added CRITICAL persistence rules: agents MUST write to files |
| 2.0 | 2026-01-31 | Expanded: 16 types, 12 categories, 7 stages, parallel agents |
| 1.0 | 2026-01-17 | Initial single-session process audit |