بنقرة واحدة
codebase-audit
Use when: deep per-crate code audit, Chinese documentation generation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when: deep per-crate code audit, Chinese documentation generation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when: full dev cycle branch->plan->implement->review->PR->merge
Use when: executing tasks via csa run/review/debate, session mgmt
Use when: iterative review-fix loop until csa review --diff is clean
Use when: running CSA-driven code review, independent model selection
Use when: three-layer manager-employee orchestration for delegation
Use when: legacy alias, redirects to dev2merge pipeline
| name | codebase-audit |
| description | Use when: deep per-crate code audit, Chinese documentation generation |
| allowed-tools | Bash, Read, Grep, Glob, Write |
| triggers | ["codebase-audit","/codebase-audit","audit codebase","analyze codebase","deep code analysis"] |
Role MUST be determined by explicit mode marker, not fragile natural-language substring matching.
Treat the run as executor ONLY when initial prompt contains:
<skill-mode>executor</skill-mode>.
YOU ARE THE EXECUTOR. Follow these rules:
../../PATTERN.md relative to this SKILL.md. Execute Tool: bash
steps directly. Steps marked Tool: csa are dispatched by the orchestrator — skip them
and report that they require orchestrator dispatch.csa run, csa review, csa debate, or ANY csa command.Only if you are the main agent (Claude Code / human user):
Perform a systematic, bottom-up deep analysis of an entire codebase (or scoped subset), generating three types of Chinese documentation per crate:
Plus a machine-readable facts.toml sidecar per crate containing exported APIs, key types, constraints, risks, and dependency summaries.
Crates are processed in topological order (leaf dependencies first) so downstream analysis inherits upstream facts. Large crates are automatically sharded to stay within the 163,840 token context budget. A dual CSA Writer+Reviewer pipeline ensures factual accuracy.
scripts/crate-topo.sh must exist (generates topological crate order)csa run --sa-mode true --skill codebase-audit "Analyze all crates in the workspace"
csa plan run currently skips loop_var steps (unsupported in the plan executor).
The orchestrator (this skill's executor) MUST implement the FOR loop manually:
# Step 1: Get crate list
CRATE_LIST=$(bash scripts/crate-topo.sh)
# Step 2-3: Prepare and estimate
# Step 4-7: FOR each crate — orchestrator iterates manually
IFS=',' read -ra CRATES <<< "$CRATE_LIST"
for crate in "${CRATES[@]}"; do
# Run Writer CSA
csa run --sa-mode true --tier tier-4-critical --timeout 3600 \
"Analyze crate ${crate} at crates/${crate}/src/ ..."
# Run Reviewer CSA
csa run --sa-mode true --tier tier-4-critical --timeout 2400 \
"Review drafts/crates/${crate}/ against crates/${crate}/src/ ..."
done
The workflow.toml remains the authoritative step definition; the orchestrator translates loop steps into sequential CSA calls.
When operating under SA mode, ALL csa invocations MUST include --sa-mode true.
scripts/crate-topo.sh produces comma-separated crate list in dependency order.drafts/crates/{crate}/chapters/ directories and progress.toml.tokuin estimate per crate, mark large crates for sharding (>80K tokens).Fully resumable. If interrupted:
grep 'status = "pending"' drafts/crates/progress.toml shows remaining work| Command | Effect |
|---|---|
/codebase-audit | Analyze all crates in topological order |
scripts/crate-topo.sh, cargo metadata, jqfile-audit (AGENTS.md compliance), codebase-blog (blog generation from audit)drafts/crates/ directory with per-crate documentation + global SUMMARY.mdcargo metadata (not file-level topo).drafts/crates/ mirroring crate structure.progress.toml shows all crates completed.SUMMARY.md generated with cross-crate analysis and Mermaid diagram.