|
| 1 | +--- |
| 2 | +name: audit |
| 3 | +description: >- |
| 4 | + Run a comprehensive code quality audit across extensible dimensions. Use when |
| 5 | + asked to "audit the code", "run a code audit", "check code quality", "audit |
| 6 | + this project", or when the /awos:audit command is invoked. Discovers dimension |
| 7 | + files automatically — drop a new .md in dimensions/ to extend. Each dimension |
| 8 | + runs in its own context window for thorough analysis. |
| 9 | +disable-model-invocation: true |
| 10 | +argument-hint: '[dimension-name] or blank for full audit' |
| 11 | +--- |
| 12 | + |
| 13 | +# Code Audit — Orchestrator |
| 14 | + |
| 15 | +You are the audit orchestrator. Your job is to coordinate dimension-specific auditors, each running in their own context window, and compile results into a final report. |
| 16 | + |
| 17 | +## Step 1 — Discover Dimensions |
| 18 | + |
| 19 | +1. Read all `*.md` files from the `dimensions/` directory (relative to this SKILL.md) |
| 20 | +2. Parse YAML frontmatter from each file to extract: `name`, `title`, `severity`, `depends-on` |
| 21 | +3. If `$ARGUMENTS` is provided and non-empty, filter to only the dimension whose `name` matches `$ARGUMENTS`. If no match, list available dimensions and stop. |
| 22 | + |
| 23 | +## Step 2 — Build Dependency DAG |
| 24 | + |
| 25 | +1. Build a dependency graph from the `depends-on` fields |
| 26 | +2. Group dimensions into execution phases: |
| 27 | + - **Phase 1:** Dimensions with no `depends-on` (roots of the DAG) |
| 28 | + - **Phase N:** Dimensions whose `depends-on` are all completed in prior phases |
| 29 | +3. Phases are computed dynamically — adding or removing dimension files automatically updates the DAG |
| 30 | + |
| 31 | +## Step 3 — Prepare Artifacts Directory |
| 32 | + |
| 33 | +``` |
| 34 | +context/audits/YYYY-MM-DD/ |
| 35 | +``` |
| 36 | + |
| 37 | +Create this directory. If it already exists, results will be overwritten. |
| 38 | + |
| 39 | +## Step 4 — Check for Previous Audit |
| 40 | + |
| 41 | +1. Scan `context/audits/` for previous audit directories (date-named folders other than today) |
| 42 | +2. If a previous audit exists, read its `report.md` to extract per-dimension scores for delta comparison later |
| 43 | + |
| 44 | +## Step 5 — Execute Dimensions |
| 45 | + |
| 46 | +For each execution phase, launch all dimensions in the phase **in parallel** using the Task tool with the `dimension-auditor` agent. |
| 47 | + |
| 48 | +For each dimension, provide the agent with: |
| 49 | + |
| 50 | +1. **The full dimension file content** (read from `dimensions/{name}.md`) |
| 51 | +2. **The output format** (read from `output-format.md` in this skill directory — the "Per-Dimension Artifact Format" section) |
| 52 | +3. **The scoring rules** (read from `scoring.md` in this skill directory) |
| 53 | +4. **The output path:** `context/audits/YYYY-MM-DD/{name}.md` |
| 54 | +5. **Topology summary** (for Phase 2+ dimensions): read from `context/audits/YYYY-MM-DD/project-topology.md` — the "Topology Summary" section written by the topology auditor |
| 55 | + |
| 56 | +Wait for all dimensions in a phase to complete before starting the next phase. |
| 57 | + |
| 58 | +### Important |
| 59 | + |
| 60 | +- Launch each dimension as a **separate Task** with `subagent_type: "dimension-auditor"` so each gets its own context window |
| 61 | +- Within a phase, launch all Tasks in a **single message** (parallel execution) |
| 62 | +- The dimension-auditor agent is read-only — it will not modify project files |
| 63 | + |
| 64 | +## Step 6 — Compile Report |
| 65 | + |
| 66 | +After all dimensions complete: |
| 67 | + |
| 68 | +1. Read all per-dimension artifacts from `context/audits/YYYY-MM-DD/` |
| 69 | +2. Compute the overall score: average of all dimension percentages (using the scoring algorithm from `scoring.md`) |
| 70 | +3. If a previous audit was found in Step 4, compute per-dimension deltas |
| 71 | +4. Compile the full report using the report template from `output-format.md` |
| 72 | +5. Write the report to `context/audits/YYYY-MM-DD/report.md` |
| 73 | +6. Write prioritized recommendations to `context/audits/YYYY-MM-DD/recommendations.md` |
| 74 | +7. Present the full report to the user |
| 75 | + |
| 76 | +## Step 7 — What's Next? |
| 77 | + |
| 78 | +After presenting the report, check the project context and offer next steps using `AskUserQuestion` with `multiSelect: true`. |
| 79 | + |
| 80 | +### Detect context |
| 81 | + |
| 82 | +- **AWOS installed:** `.awos/commands/` directory exists |
| 83 | +- **Roadmap exists:** `context/product/roadmap.md` file exists |
| 84 | + |
| 85 | +### Build options |
| 86 | + |
| 87 | +**Always include:** |
| 88 | + |
| 89 | +- "Generate HTML report" — create a standalone HTML version of the audit report |
| 90 | + |
| 91 | +**If AWOS installed + roadmap exists, also include:** |
| 92 | + |
| 93 | +- "Update roadmap with audit findings" — incorporate recommendations into the existing product roadmap |
| 94 | + |
| 95 | +**If AWOS installed + no roadmap, also include:** |
| 96 | + |
| 97 | +- "Create a roadmap informed by audit findings" — start a new roadmap using audit results as input |
| 98 | + |
| 99 | +**If AWOS is NOT installed**, append this note after the question: |
| 100 | + |
| 101 | +> Tip: install AWOS (`npx @provectusinc/awos`) — the best way to make your repo AI-friendly and act on these findings. |
| 102 | +
|
| 103 | +### Execute selected options |
| 104 | + |
| 105 | +- **HTML report:** Read the HTML report specification from `report-template.md` in this skill directory. Generate `context/audits/YYYY-MM-DD/report.html` — a single self-contained HTML file (inline CSS, no external dependencies). Include: overall score/grade, per-dimension summary table, detailed checklists, recommendations, issue-only filter toggle. |
| 106 | +- **Roadmap (update or create):** Tell the user to run `/awos:roadmap` and reference the audit recommendations at `context/audits/YYYY-MM-DD/recommendations.md` as input. |
| 107 | + |
| 108 | +## Adding New Dimensions |
| 109 | + |
| 110 | +Drop a `.md` file in `dimensions/` with this structure: |
| 111 | + |
| 112 | +```markdown |
| 113 | +--- |
| 114 | +name: my-dimension |
| 115 | +title: My Dimension |
| 116 | +description: What this dimension measures |
| 117 | +severity: high |
| 118 | +depends-on: [project-topology] |
| 119 | +--- |
| 120 | + |
| 121 | +# My Dimension |
| 122 | + |
| 123 | +Brief description. |
| 124 | + |
| 125 | +## Checks |
| 126 | + |
| 127 | +### CHECK-01: Short name |
| 128 | + |
| 129 | +- **What:** What to verify |
| 130 | +- **How:** Glob/Grep/Read instructions to evaluate |
| 131 | +- **Pass:** Criteria for PASS |
| 132 | +- **Fail:** Criteria for FAIL |
| 133 | +- **Warn:** (optional) Partial compliance |
| 134 | +- **Skip-When:** (optional) Condition to auto-skip |
| 135 | +- **Severity:** critical | high | medium | low |
| 136 | +``` |
| 137 | + |
| 138 | +### Frontmatter Fields |
| 139 | + |
| 140 | +| Field | Required | Description | |
| 141 | +| ------------- | -------- | ---------------------------------------------------------------------- | |
| 142 | +| `name` | yes | Unique identifier, used for CLI filtering (`/awos:audit my-dimension`) | |
| 143 | +| `title` | yes | Human-readable display name | |
| 144 | +| `description` | yes | One-line purpose | |
| 145 | +| `severity` | yes | Default severity for all checks. Individual checks can override. | |
| 146 | +| `depends-on` | no | Dimension `name`s that must complete first. Omit if no dependencies. | |
0 commit comments