synaptiai/agent-capability-standard/audit
Claude Code and agent skill by synaptiai/agent-capability-standard
- community
Checking that the SKILL.md file is still in the repository.
Produce a comprehensive audit trail of actions, tools used, changes made, and decision rationale. Use when recording compliance evidence, tracking changes, or documenting decision lineage.
Install
npx vskill@latest install synaptiai/agent-capability-standard/auditSKILL.md
Live Context
Current audit context:
- Recent git commits: !
git log --oneline -10 2>/dev/null || echo "No git history" - Git authors today: !
git log --since="midnight" --format="%an" 2>/dev/null | sort | uniq -c || echo "None" - Uncommitted changes: !
git status --short 2>/dev/null || echo "Not a git repo" - Recent file modifications: !
find . -type f -mtime -1 -not -path './.git/*' 2>/dev/null | wc -l | tr -d ' 'files in last 24h - Audit log exists: !
ls -la .audit/ 2>/dev/null | head -5 || echo "No .audit/ directory" - Audit records exist: !
wc -l "${CLAUDE_PROJECT_DIR:-.}/.claude/audit/records.jsonl" 2>/dev/null || echo "No .claude/audit/records.jsonl" - Checkpoint log exists: !
ls -la .checkpoints/ 2>/dev/null | head -5 || echo "No .checkpoints/ directory"
Intent
Execute audit to create a structured record of actions taken, tools invoked, changes made, and the reasoning behind decisions. This provides accountability, enables investigation of issues, and supports compliance requirements.
Success criteria:
- Complete chronological record of relevant actions
- Every action linked to actor, timestamp, and rationale
- Changes documented with before/after state
- Provenance chain for all outputs
Compatible schemas:
schemas/output_schema.yaml
Inputs
| Parameter | Required | Type | Description | |
|---|---|---|---|---|
event | Yes | object | Event to record | |
context | No | object | Event context | |
retention | No | string | How long to retain |
Inputs not listed here are outside the capability's contract: a workflow step that binds them gets W604 (STANDARD v1.1 §5.5).
Procedure
1) Define audit scope: Determine what to include in the audit
- Record the
eventitself: what happened, by whom, when - Read the report scope from
context.scopeto identify targets - Apply the time window in
context.time_windowif provided - Identify relevant log sources (git log, tool invocations, file changes)
2) Collect action records: Gather all actions within scope
- Read git log for commits and their messages
- Review tool invocation history if available
- Identify file changes (created, modified, deleted)
- Record timestamps for each action
3) Extract decision rationale: Document the "why" for each action
- Link actions to plans or goals that motivated them
- Capture assumptions stated before action
- Record any constraints that influenced decisions
4) Build provenance chain: Track inputs to outputs
- For each output, identify its source inputs
- Document transformations applied
- List dependencies between artifacts
5) Ground claims: Attach evidence for all audit entries
- Format:
file:line,tool:git:commit_hash,timestamp - Include actual command outputs where relevant
6) Write the record (append-only): Persist the audit record before returning
- Build one compact JSON line:
audit_id,timestamp, theevent, thecontext,retentionif given, and the collectedaudit_record,changesandprovenance(redact credentials and PII first) - Append it with Bash to
"${CLAUDE_PROJECT_DIR:-.}/.claude/audit/records.jsonl"(mkdir -p "${CLAUDE_PROJECT_DIR:-.}/.claude/audit", then>>), so the record lands in the same project.claude/directory the plugin's hooks use rather than under whatever the working directory is; refuse if the file is a symlink, and never rewrite, truncate or reorder existing lines - Do not write to
.claude/audit.log: the plugin's PostToolUse hook keeps it as an HMAC-chained log of skill invocations (checked bytools/verify_audit_log.py), and a foreign line would break the chain. The hook appends this skill's own invocation only after the skill finishes, so there is no line for it yet: cite earlier lines (the invocations being audited) as evidence, not this one - The plugin's PreToolUse hook blocks a Bash command that matches its mutation pattern (
rm,mv,sed,git,curl,chmod, … anywhere in the command, record text included) while there is no valid checkpoint marker (.claude/checkpoint.ok); a plainmkdir/printf >>append whose text matches none of them is not blocked. If the append is blocked or fails, setrecorded: false, return the record in the output anyway, and say why inassumptions
7) Format output: Structure per audit contract; recorded is true only when step 6 appended the line
Output Contract
Return a structured object:
Field Definitions
| Field | Type | Description | |
|---|---|---|---|
recorded | boolean | Whether the record was appended to .claude/audit/records.jsonl (false when the write was blocked or failed) | |
audit_id | string | Unique identifier for this audit record | |
timestamp | string | ISO 8601 date-time the audit record was generated | |
audit_record.actor | string | Who performed the actions | |
audit_record.outcome | enum | Overall result of audited actions | |
changes | array | List of all changes with before/after | |
tool_usage | array | Summary of tools invoked | |
decision_rationale | string | Explanation of why actions were taken | |
provenance | object | Input/output/dependency lineage | |
confidence | number | 0.0-1.0 completeness of audit trail | |
evidence_anchors | array | References to source evidence | |
assumptions | array | What was assumed during audit collection |
Examples
Example 1: Audit Code Change Session
Input:
Output:
Evidence pattern: Git commit history, tool invocation logs, file diffs.
Example 2: Audit Specific File Changes
Input:
Output:
Verification
Apply the following verification patterns:
- [ ] Evidence Grounding: All changes linked to evidence_anchors
- [ ] Contract Validation: Output has
recorded,audit_idandevidence_anchorsper the output schema - [ ] Completeness Check: No gaps in timeline for the specified time window
- [ ] Provenance Valid: All inputs and outputs are verifiable
Verification tools: Read (for log files and the appended record), Grep (for searching history), Bash (to append the record)
Safety Constraints
mutation: true (it writes an audit record);mutation_overridable, so a step that only reads may declaremutation: falserequires_checkpoint: falserequires_approval: falserisk: low
Capability-specific rules:
- Never modify audited artifacts during audit
- Preserve original timestamps (do not alter history)
- Include failed actions, not just successes
- Redact sensitive information (credentials, PII) from audit output
- Store audit records append-only: only ever append to
"${CLAUDE_PROJECT_DIR:-.}/.claude/audit/records.jsonl"; never edit or delete earlier lines, and never write to the hook-maintained.claude/audit.log
Composition Patterns
Commonly follows:
verify- After verify passes (passed: true), audit the successful changes (CAVR pattern)execute/mutate- Audit what was executedrollback- Audit the rollback event itself
Commonly precedes:
explain- Summarize audit for stakeholder reportingpersist- Store audit record for compliance
Anti-patterns:
- Never skip audit after
executeormutate(breaks accountability) - Never modify artifacts during audit (breaks integrity)
- Never omit failed actions from audit trail
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/audit/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/synaptiai/agent-capability-standard/audit)