بنقرة واحدة
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 المهني
Run a single-session AI optimization audit on the codebase
Run a single-session code review audit on the codebase
Run a single-session engineering productivity audit on the codebase
Run a comprehensive enhancement audit across the entire project - code, product, UX, content, workflows, infrastructure, external services, and meta-tooling.
Run a single-session performance audit on the codebase
Run a single-session refactoring audit on the codebase
| name | audit-process |
| description | Run a comprehensive multi-stage automation audit with parallel agents |
Version: 2.4 Last Updated: 2026-02-24 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| # | Type | Location |
|---|---|---|
| 1 | Claude Code Hooks | .claude/hooks/ |
| 2 | Claude Code Skills | .claude/skills/ |
| 3 | Claude Code Commands | .claude/commands/ |
| 4 | npm Scripts | package.json |
| 5 | Standalone Scripts | scripts/ |
| 6 | Script Libraries | scripts/lib/ |
| 7 | GitHub Actions Workflows | .github/workflows/ |
| 8 | Git Hooks (Husky) | .husky/ |
| 9 | lint-staged | package.json |
| 10 | ESLint | eslint.config.mjs |
| 11 | Prettier | .prettierrc |
| 12 | Backend Functions | functions/src/ (if any) |
| 13 | Scheduled Jobs | Backend job configs (if any) |
| 14 | Infrastructure Rules | Config rule files (if any) |
| 15 | MCP Servers | mcp.json / scripts/mcp/ |
| 16 | TypeScript Configs | tsconfig*.json |
| # | 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
CANON/templates/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 | Backend Services | 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-backend.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-02-25 | Ported to framework: generalized backend/infrastructure scope entries |
| 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 |