Scoped Project Audit Workflow

Run an evidence-backed read-only audit over a configurable project scope and prepare issue-tracker candidates.

How to use

Pass an optional scope such as authentication, manifest write paths, or admin controls. An empty scope audits all live project domains.

Prompt

Scoped project audit

Scope

$ARGUMENTS

Empty scope = all live project domains. Never widen scope silently. Report relevant boundary finding as OUT-OF-SCOPE-ADJACENT; no investigation past needed evidence.

Mission

Find reproducible problems in scope + prep evidence for issue tracker. Strictly read-only:

  • no source/test/doc/config/generated file/data mods;
  • no create/update/close/comment on issues;
  • no stage/commit/push/deploy/release/mutate external systems;
  • no auto-fix/cleanup/migration/seed/write/watch commands.

Output: audit report + issue candidates. Pub/impl require explicit follow-up via PRD/triage/issue workflow.

1. Establish authority and safety

Before reading code:

  1. Read repo instructions, main README, domain glossary, current-state docs, ADRs, issue-tracker rules, test/build config.
  2. Identify current authorities, historical docs, generated sources, external repos, prod data, write boundaries.
  3. Inspect Git status, preserve existing user changes.
  4. Read existing in-scope issues. No duplicate reports.
  5. Determine read-only diagnostic commands. Tests allowed only with isolated disposable fixtures without writing state.

Historical claims = hypotheses until verified against code/tests.

2. Route tools and skills deliberately

Use capabilities available in environment relevant to scope:

  • zoom-out: unfamiliar architecture/unclear boundaries.
  • improve-codebase-architecture: duplicated authorities, coupling, dependency direction, testability issues.
  • grill-with-docs: code/docs conflict or unresolved domain semantics.
  • ponytail-audit: over-engineering review; style pref not finding.
  • diagnose: concrete bug/perf regression requiring reproduce-minimise-hypothesise-instrument analysis.
  • modern-web-guidance: before HTML/CSS/client JS analysis.
  • chrome-devtools, a11y-debugging, debug-optimize-lcp, memory-leak-debugging: runtime evidence matching scope without data mutation.

No to-prd, to-issues, triage, tdd, or impl workers during audit. Read-only explorer maps bounded domain. Independent reviewer adversarially verifies proposed P0/P1 findings.

Fallow for TypeScript and JavaScript

Fallow = optional deterministic structural evidence, not finding authority.

  • Prefer repo-pinned Fallow via package manager, e.g. pnpm exec fallow.
  • If not installed, no pnpm dlx fallow without permission (downloads package, writes cache).
  • Fallow writes .fallow/cache; change audit creates temp Git worktree. Record Git status before/after. Use --no-cache for fallow audit; skip if tree/Git metadata changes.
  • Full repo scan: read-only pipeline with machine output, e.g. pnpm exec fallow --format json --quiet.
  • Change-scoped audit: pnpm exec fallow audit --no-cache --format json --quiet.
  • Exit 0 & 1 = complete (1 = findings). Exit 2 = tool error.
  • No fallow fix, init, hooks install, watch, config/baseline writes.
  • Verify entry points, generated files, public reachability, config before promoting result to finding.

Graphify for orientation

Graphify = optional navigation support for large/unfamiliar systems. Not proof of bug/dead code/safety/contract coverage.

  • Never run pnpm dlx graphify (npm package not codebase graph tool).
  • If graphify-out exists, report/wiki/queries guide file selection.
  • Graph creation/update writes artifacts & installs deps; out of scope. Recommend authorised /graphify <path> preflight if useful.
  • EXTRACTED edges = navigation evidence. INFERRED & AMBIGUOUS = hypotheses. Verify claimed problems in raw source/tests.

3. Map the in-scope system

Map one layer above/below scope with domain vocab:

  • public entry points & user flows;
  • callers, callees, state transitions, async boundaries;
  • frontend, API, CLI, worker, storage, filesystem, external service edges;
  • sources of truth, validation, auth, persistence, rollback, recovery, logging, observability;
  • build, deploy, release boundaries;
  • unit, integration, browser, end-to-end evidence.

Every state/derived value needs single authority. Multiple writers/derivations = candidates, not automatic findings.

4. Evidence rules

  1. Evidence or silence. Every finding cites exact path:line evidence & deciding expression/result.
  2. Read complete reachable path before claiming behavior.
  3. Verify named APIs & actual signatures.
  4. Passing test proves only assertions. Read test & demonstrate failure for proposed regression.
  5. Reproduce safely via public interface/isolated fixture. Never mutate prod/user data.
  6. Separate CONFIRMED, STRONG, INFERRED confidence. Only confirmed/strong become issue candidates.
  7. No style/naming/line count/missing abstraction/age/tool output alone as problem.
  8. No re-reporting existing issues. Reference & state if current evidence confirms/narrows/supersedes/invalidates.

5. Coverage and priority

Mark relevant domain status:

  • covered: code & sensitive test evidence;
  • active: confirmed gap needs work;
  • parked: missing product decision/target/repro/scope;
  • wontfix: explicitly accepted with rationale;
  • unaudited: insufficient evidence.

Priorities:

  • P0: data loss, corruption, auth/privacy breach, wrong tenant/env, unsafe recovery/deploy.
  • P1: confirmed public behavior failure, nondeterminism, race, broken contract, accessibility barrier.
  • P2: test gap, domain authority ambiguity, perf issue, arch drift, operational friction.

P0 requires repro/code path proof + independent review.

6. Deliverables

A. Executive summary

Scope, current state, finding counts, top risks, limitations.

B. System and coverage map

Authorities, critical flows, domain statuses, unexamined boundaries.

C. Findings

Per finding (ordered P0 → P1 → P2):

  • stable candidate ID & concise title;
  • priority & type;
  • concrete broken public behavior;
  • exact evidence & reachable trigger;
  • blast radius & self-healing status;
  • test coverage & missing assertion;
  • confidence & review verdict;
  • smallest safe direction (no impl design);
  • suitable public regression test;
  • dependencies & AFK or HITL;
  • explicit non-goals.

D. Issue-tracker evidence ledger

Per finding:

  • existing issue ref/relationship, or NEW CANDIDATE;
  • proposed parent workstream;
  • recommended triage status;
  • issue-ready title, behavior statement, criteria, deps, evidence links;
  • duplicate/superseded/parked/wontfix disposition.

Do not publish ledger. Input for separate to-prd/to-issues/triage step.

E. Systemic causes

Only failure classes supported by multiple findings. Recommend smallest authority/boundary change making class harder/impossible.

F. Rejected hypotheses and unknowns

Record false positives, rejection reasons, open questions, needed artifacts/decisions.

Final stop

Return report + short approval block for next PRD/issue phase. Stop. No fixes, issue mutations, file changes, or commits.

Attachments

View Detail
View Detail
View Detail
View Detail
View Detail
View Detail
View Detail
View Detail
View Detail
View Detail
View Detail
View Detail