cognitives/skills/analytics/audit/SKILL.md
Multi-domain codebase audit: security, contracts, patterns, observability, and ops. Invoke as `/audit [domain?]` where domain is one of: security | contracts | patterns | observability | ops | all (default). Use whenever the user asks to audit or review a codebase for issues, wants a security review, asks what's wrong with the code, requests a pre-release or pre-merge quality check, or wants a comprehensive inspection across quality dimensions. Trigger proactively on "audit", "security review", "code review", "what issues does this codebase have", or "check before we ship".
npx skillsauth add synapsync/synapse_registry auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run a structured, evidence-based audit of a codebase. Two phases always run in order: first detect context, then apply the requested domains.
Usage: /audit [domain?]
security | contracts | patterns | observability | ops | allDo not run destructive operations (DB resets, production deploys, mass deletes, git push --force, etc.) unless the user explicitly asks in the same session. Use read-only inspection: read files, Glob, Grep, and read-only git commands (git log -1, git grep) — no history rewrites.
Always runs first. Read the project to understand what you're working with. Identify and state explicitly:
Read at least:
go.mod, package.json, pyproject.toml, Cargo.toml)cmd/, main.go, src/index.ts)config.toml, docker-compose.yml, etc.)If the repo is large or a monorepo:
gateway/, services/profile/, contracts/) with its own mini-context if stacks differ.proto, OpenAPI), CI workflows, infrastructure that defines secrets and CORS/TLS.Output findings in a Context block (see Output Format). If the project is ambiguous, split by component.
Do not proceed to Phase 2 until Phase 1 is complete.
Apply each requested domain using the context from Phase 1. Adapt every check to what actually exists — skip checks for components that are not present (e.g. don't require a GraphQL schema if there is no GraphQL).
Core questions:
.env with real values, hardcoded production keys, etc.govulncheck, osv-scanner, npm audit). Otherwise state: NOTE: Dependency CVE posture not verified in this run (no scanner executed). — this is an explicit gap, not a PASS.Optional when relevant: CORS correctness (credentials + allowlist), admin/docs exposure in production, idempotency of sensitive operations.
Core questions:
Core questions:
getenv calls in domain logic.Core questions:
Core questions:
go mod verify, lockfile install) where applicable.make), or is it tribal knowledge?INFERRED (needs confirmation) and state what file would confirm it.[DOMAIN] PASS and continue.path/to/file:line. If the issue is process-wide (missing CI job, no policy), use Location: (process / CI / policy) and name the artifact that should exist.AUDIT PASSED or AUDIT FAILED, with counts.Verdict rule: AUDIT FAILED if any BLOCKER exists. Optionally fail on HIGH if the user instructed stricter gates in the chat.
## Context
Date: YYYY-MM-DD
Domains audited: ...
Language(s): ...
Runtime / framework: ...
Auth: ...
Data layer: ...
Infra: ...
API surface: ...
Tests: ...
CI: ...
Sampling notes (if large repo): ...
## Audit Report — [domains] — YYYY-MM-DD
### SECURITY
[BLOCKER|HIGH|MEDIUM|LOW] Short title
Location: path:line OR (process / CI / policy)
Impact: one concrete sentence (what breaks, what leaks, what drifts)
Fix: actionable steps; optional code block if helpful
### CONTRACTS
(same pattern)
### PATTERNS
(same pattern)
### OBSERVABILITY
(same pattern)
### OPS
(same pattern)
---
## Verdict: AUDIT PASSED | AUDIT FAILED
Blockers: N | High: M | Medium: K | Low: J
| Domain | Typical artifacts |
|--------|-------------------|
| security | auth middleware, routes, secrets, CORS, headers, dependency scan (if run) |
| contracts | proto, OpenAPI, GraphQL schema, generated clients, CI *-check jobs |
| patterns | layers, errors, config loading, module boundaries |
| observability | logging, metrics, health checks, tracing |
| ops | Dockerfile, compose, CI YAML, migration docs, lockfiles |
development
Rigorous dead code audit for any module, folder, or file in any programming language. Detects orphan files never imported anywhere, classes/functions/ methods declared but never called, constructor parameters received but never consumed, unused imports/requires, private fields with no references, and commented-out code blocks. Use this skill whenever the user asks to: review unused code, clean up a feature after a refactor, find dead code, detect orphan files or classes, audit what can be deleted, find what's left over after a big change, or any variation of "what's not being used / what can I remove". Also triggers when the user says they made large changes and wants to know what became obsolete. IMPORTANT: This skill only reports — it never deletes anything. At the end it always offers to generate a removal plan with /plan.
tools
Registers new cognitives (skills, agents, prompts, workflows, tools) into the SynapSync Registry with proper structure, manifest, and registry index. Trigger: When the user says "GUARDA", "REGISTRA", "AGREGA" followed by a cognitive type and name, or asks to save/register/add a cognitive to the registry.
testing
Adaptive sprint workflow: deep analysis, evolving roadmap, one-at-a-time sprints, formal debt tracking, and re-entry prompts for context persistence. Trigger: When the user wants to analyze a project, create a roadmap, generate/execute sprints iteratively, or check project status and technical debt.
documentation
Session memory for AI agents — load context at the start, save sessions at the end, evolve knowledge across sessions. Like a professional's notebook: open before work, write a summary when done, persist between sessions. Trigger: When starting a session and need to recover context, or ending a session and want to save what happened.