From knowzcode
Run read-only quality audits on the existing codebase — spec completeness, architecture health, OWASP security scanning, integration consistency. Use when the user wants to AUDIT or SCAN existing code, not build new features.
How this skill is triggered — by the user, by Claude, or both
Slash command
/knowzcode:auditThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Run specialized audit workflows.
Run specialized audit workflows.
Usage: /knowzcode:audit [audit_type]
Example: /knowzcode:audit spec or /knowzcode:audit security
Audit Type: $ARGUMENTS
/knowzcode:work/knowzcode:fix/knowzcode:explore/knowz saveThese phrases indicate /knowzcode:audit intent:
| Type | Focus |
|---|---|
| spec | Specification quality and completeness |
| architecture | Architecture health and drift |
| security | OWASP vulnerability scanning |
| integration | Cross-component consistency |
| compliance | Enterprise guideline compliance (if configured, experimental) |
| (no argument) | Full parallel audit of all types |
Read:
knowzcode/knowzcode_tracker.mdknowzcode/knowzcode_architecture.mdknowzcode/knowzcode_project.mdknowzcode/knowzcode_orchestration.md (if exists)If knowzcode/knowzcode_orchestration.md exists, parse its YAML blocks:
DEFAULT_SPECIALISTS = default_specialists value (default: [])MCP_AGENTS_ENABLED = mcp_agents_enabled value (default: true)Apply flag overrides (flags win over config):
--no-specialists in $ARGUMENTS → override DEFAULT_SPECIALISTS = []--no-mcp in $ARGUMENTS → override MCP_AGENTS_ENABLED = falseIf the file doesn't exist, use hardcoded defaults (current behavior).
Attempt TeamCreate(team_name="kc-audit-{timestamp}"):
If TeamCreate succeeds → Agent Teams mode:
**Execution Mode: Agent Teams** — created team kc-audit-{timestamp}knowzcode/claude_code_execution.md for team conventions.If TeamCreate fails (error, unrecognized tool, timeout) → Subagent Delegation:
**Execution Mode: Subagent Delegation** — Agent Teams not available, using Task() fallbackThe user MUST see the execution mode announcement before audit work begins.
Before spawning agents, determine vault availability:
knowz-vaults.md from project root — parse vault IDs. If file not found, call list_vaults(includeStats=true) to discover vaults.list_vaults() fails AND no knowz-vaults.md exists → MCP_ACTIVE = false, VAULTS_CONFIGURED = false. Announce: **MCP Status: Not connected**list_vaults() fails BUT knowz-vaults.md has vault IDs → MCP_ACTIVE = true, VAULTS_CONFIGURED = true. Announce: **MCP Status: Lead probe failed — vault agents will verify independently**knowz-vaults.md exists → suggest "Run /knowz setup to configure vault routing." Set VAULTS_CONFIGURED = true (use discovered IDs for baseline).MCP_ACTIVE and VAULTS_CONFIGURED based on results. Announce: **MCP Status: Connected — N vault(s) available** or **MCP Status: Connected — no vaults configured (knowledge capture disabled)**If no vaults are configured, suggest /knowz setup.
Vault research is mandatory when available. If
VAULTS_CONFIGURED = trueandMCP_AGENTS_ENABLED = true, theknowz:readerdispatch MUST execute in both Exploration and Planning modes. The 10-tool-call budget in Exploration Mode is a scope limit, not a reason to skip. Only skip when MCP is genuinely unavailable (MCP_ACTIVE = false).
TaskCreate("Audit: {audit_type}") → TaskUpdate(owner: "reviewer").
Spawn a single reviewer teammate:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are the reviewer running a {audit_type} audit. Readagents/reviewer.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions.Audit scope: {audit_type} Context files: knowzcode_tracker.md, knowzcode_architecture.md, knowzcode_project.md Specs directory: knowzcode/specs/
Deliverable: Audit report with health scores, critical issues, recommendations.
Wait for completion. Shut down teammate. Clean up the team.
The reviewer focuses on the requested type with type-specific depth:
Create tasks first, pre-assign, then spawn with task IDs:
TaskCreate("Audit: spec + architecture") → TaskUpdate(owner: "reviewer-spec-arch")TaskCreate("Audit: security + integration") → TaskUpdate(owner: "reviewer-sec-int")TaskCreate("Audit: compliance") → TaskUpdate(owner: "reviewer-compliance") (if enterprise configured)knowz:reader for vault standards (if VAULTS_CONFIGURED = true)Spawn reviewers with their task IDs:
Spawn reviewer teammate (name: reviewer-spec-arch):
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are the reviewer running a targeted audit. Readagents/reviewer.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions.Audit scope: Specification quality AND architecture health ONLY. Do NOT audit security or integration — another reviewer handles those. Context files: knowzcode_tracker.md, knowzcode_architecture.md, knowzcode_project.md Specs directory: knowzcode/specs/
Deliverable: Audit report with spec quality scores, architecture health, critical issues.
Spawn reviewer teammate (name: reviewer-sec-int):
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are the reviewer running a targeted audit. Readagents/reviewer.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions.Audit scope: Security vulnerability scan AND integration consistency ONLY. Do NOT audit specs or architecture — another reviewer handles those. Context files: knowzcode_tracker.md, knowzcode_architecture.md, knowzcode_project.md Specs directory: knowzcode/specs/
Deliverable: Audit report with security posture, integration health, critical issues.
(Optional) If enterprise compliance configured, spawn reviewer (name: reviewer-compliance):
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. Audit scope: Enterprise compliance ONLY. Check against guidelines inknowzcode/enterprise/compliance_manifest.md.
If VAULTS_CONFIGURED = true AND MCP_AGENTS_ENABLED = true, dispatch knowz:reader for standards lookup in parallel with reviewers:
Read
knowz-vaults.md(project root) to discover configured vaults — their IDs, types, descriptions. Query for team standards: search ecosystem-type vaults for standards, conventions, and past audit decisions. Return synthesized findings.
Wait for all to complete.
Initialize AUDIT_SPECIALISTS = DEFAULT_SPECIALISTS (from orchestration config, default: []).
If $ARGUMENTS contains --specialists (or --specialists=security, --specialists=test, --specialists=security,test):
--specialists → enable all applicable: [security-officer, test-advisor]--specialists=csv → enable specified subset--no-specialists → clear to [] (overrides config defaults)If neither --specialists nor --no-specialists is present, use DEFAULT_SPECIALISTS from config.
Parse which specialists to enable. Then spawn alongside reviewers:
security-officer (if enabled) — spawn alongside reviewer-sec-int for deeper security scanning:
TaskCreate("Security officer: deep security audit") → TaskUpdate(owner: "security-officer")security-officer teammate:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are the security-officer running a deep security audit. Readagents/security-officer.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions.Audit scope: Full codebase security scan — vulnerability patterns, hardcoded secrets, injection vectors, auth bypass, SSRF, path traversal. Context files: knowzcode_tracker.md, knowzcode_architecture.md, knowzcode_project.md Specs directory: knowzcode/specs/
Deliverable: Security finding report with severity ratings. Tag CRITICAL/HIGH findings with
[SECURITY-BLOCK]. Ifknowzcode/enterprise/compliance_manifest.mdexists andcompliance_enabled: true, also cross-reference findings with enterprise guideline IDs.
test-advisor (if enabled) — spawn alongside reviewers for test quality assessment:
TaskCreate("Test advisor: test quality audit") → TaskUpdate(owner: "test-advisor")test-advisor teammate:
Your Task: #{task-id} — claim immediately (
TaskUpdate(status: "in_progress")). Mark completed with summary when done. You are the test-advisor running a test quality audit. Readagents/test-advisor.mdfor your role definition. Readknowzcode/claude_code_execution.mdfor team conventions.Audit scope: Test coverage, TDD compliance, assertion quality, edge case coverage, test isolation. Context files: knowzcode_tracker.md, knowzcode_project.md
Deliverable: Test quality report with coverage metrics, TDD compliance, and improvement recommendations. If
knowzcode/enterprise/compliance_manifest.mdexists andcompliance_enabled: true, also check enterprise ARC criteria for test coverage.
Wait for all reviewers and specialists to complete. Synthesize results in Step 4.
Launch knowledge-liaison + reviewer in parallel via Task():
knowledge-liaison — Local context + vault knowledge:
Task(subagent_type="knowzcode:knowledge-liaison", description="Liaison: audit context", prompt="Research audit scope: {audit_type}. Gather local context (specs, workgroups, tracker, log, architecture) and vault knowledge (standards, conventions, past audit decisions). Push Context Briefing with findings. Max 15 tool calls. Write findings to a concise summary.")reviewer — The audit itself:
subagent_type: "reviewer"prompt: Task-specific context only (role definition is auto-loaded from agents/reviewer.md):
Audit scope: {audit_type} Context files: knowzcode_tracker.md, knowzcode_architecture.md, knowzcode_project.md Specs directory: knowzcode/specs/
Deliverable: Audit report with health scores, critical issues, recommendations.
description: "Audit: {audit_type}"All launched in parallel. Synthesize knowledge-liaison context alongside reviewer results.
Launch knowledge-liaison + parallel reviewers via Task():
knowledge-liaison — Local context + vault knowledge:
Task(subagent_type="knowzcode:knowledge-liaison", description="Liaison: audit context", prompt="Research for comprehensive audit. Gather local context (specs, workgroups, tracker, log, architecture) and vault knowledge (standards, conventions, security policies, compliance requirements). Push Context Briefing with findings. Max 15 tool calls. Write findings to a concise summary.")Parallel reviewers:
Task(subagent_type="reviewer", description="Audit: spec + architecture", prompt="Audit scope: Specification quality AND architecture health ONLY. ...")Task(subagent_type="reviewer", description="Audit: security + integration", prompt="Audit scope: Security vulnerability scan AND integration consistency ONLY. ...")Task(subagent_type="reviewer", description="Audit: compliance", prompt="Audit scope: Enterprise compliance ONLY. ...") (if enterprise configured)Synthesize knowledge-liaison context alongside reviewer results.
Initialize AUDIT_SPECIALISTS = DEFAULT_SPECIALISTS (from orchestration config, default: []).
If $ARGUMENTS contains --specialists (or --specialists=security, --specialists=test, --specialists=security,test):
--specialists → enable all applicable--specialists=csv → enable specified subset--no-specialists → clear to []If AUDIT_SPECIALISTS is non-empty, launch specialist Task() calls in parallel with reviewers:
security-officer (if enabled):
Task(subagent_type="security-officer", description="Security officer: deep security audit", prompt="Audit scope: Full codebase security scan. Context files: knowzcode_tracker.md, knowzcode_architecture.md. Specs: knowzcode/specs/. Deliverable: Security finding report with severity ratings. Tag CRITICAL/HIGH with [SECURITY-BLOCK]. If knowzcode/enterprise/compliance_manifest.md exists and compliance_enabled: true, also cross-reference findings with enterprise guideline IDs.")test-advisor (if enabled):
Task(subagent_type="test-advisor", description="Test advisor: test quality audit", prompt="Audit scope: Test coverage, TDD compliance, assertion quality, edge cases. Context files: knowzcode_tracker.md. Deliverable: Test quality report with coverage metrics and recommendations. If knowzcode/enterprise/compliance_manifest.md exists and compliance_enabled: true, also check enterprise ARC criteria for test coverage.")Synthesize specialist findings alongside reviewer results.
## KnowzCode Audit Results
**Timestamp**: {timestamp}
**Audit Type**: {type or "Comprehensive"}
### Summary Scores
| Area | Health Score | Critical Issues |
|------|-------------|-----------------|
| Spec Quality | {score}% | {count} |
| Architecture | {score}% | {count} |
| Security | {score}% | {count} |
| Integration | {score}% | {count} |
### Critical Issues
{sorted by severity}
### Recommendations
{prioritized action items}
### Specialist Reports [only when --specialists active]
**Security Officer**: {finding count, severity breakdown, SECURITY-BLOCK tags}
**Test Advisor**: {coverage %, TDD compliance, quality assessment}
If VAULTS_CONFIGURED = true AND MCP_ACTIVE = true, present after audit results:
**Save to vault?** These audit findings can be captured to Knowz for future reference.
**A) Save all findings** (scores + issues + recommendations)
**B) Select which to save**
**C) Skip**
Handling:
knowz:writer with a self-contained prompt summarizing all findings, tagged with the topic. Read knowz-vaults.md (project root) to resolve the target vault (use ecosystem-type vault). Check for duplicates via search_knowledge before writing.knowz:writer with selected content.If VAULTS_CONFIGURED = false or MCP_ACTIVE = false, skip this step silently.
Log to knowzcode/knowzcode_log.md:
| {timestamp} | AUDIT | {audit_type} | {summary} |
If MCP is configured and enterprise vault exists: push audit results via create_knowledge for team audit trail.
/knowzcode:work — Build features (not audit)/knowzcode:fix — Fix a specific bug found during audit/knowz save — Capture audit findings to vault/knowzcode:telemetry — Investigate production errorsnpx claudepluginhub knowz-io/knowz-skills --plugin knowzcodeRuns codebase audits (health, evaluation, documentation) with parallel agents, producing intake docs for a pipeline run.
Runs mechanical checks (build, typecheck, lint, tests, secrets scan) then dispatches specialist reviewers and produces a scored codebase health report. Use for code quality, security, or performance audits.
Audits a codebase across 29 dimensions — security, privacy, compliance (HIPAA/PCI/SOC 2), architecture, testing, performance, DevOps, UX, SEO, AI/ML, and more. Generates structured docs and files remediation tickets.