Skip to content
audit-protocol-compliance logo

Audit Protocol Compliance Skill

audit-protocol-compliance

Systematic audit of session for task protocol compliance violations with documentation fix recommendations

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

Audit Protocol Compliance Skill

Purpose: Systematically audit conversation sessions for ALL task protocol compliance violations and recommend preventive documentation changes.

When to Use:

  • After completing a task to verify protocol adherence
  • When investigating protocol violations
  • To validate that mandatory checkpoints were followed
  • Before committing to identify and fix violations

Skill Workflow

Overview: Parse timeline → Execute compliance checks → Report violations → Recommend fixes

Phase 1: Get Structured Timeline

Invoke parse-conversation-timeline skill:

Skill: parse-conversation-timeline

This produces structured timeline JSON with:

  • session_metadata
  • timeline (chronological events)
  • git_status
  • task_state
  • statistics

Phase 2: Execute Category 1 Checks (CRITICAL - MANDATORY FIRST)

Check 1.0: User Approval Checkpoints (CRITICAL)

jq '.statistics.approval_checkpoints' timeline.json

# Rule: User MUST approve after SYNTHESIS before IMPLEMENTATION
# Rule: User MUST approve after REVIEW before COMPLETE

# FOR EACH checkpoint:
#   IF checkpoint.required == true AND checkpoint.found == false:
#     → CRITICAL VIOLATION

Check 1.1: Task Merge to Main Before COMPLETE (CRITICAL)

jq '.task_state.task_json.state' timeline.json
jq '.git_status.branches[] | select(.task_complete_but_not_merged == true)' timeline.json

# Rule: Task branch MUST be merged to main BEFORE marking state as COMPLETE

# IF task_state == "COMPLETE" AND merged_to_main == false:
#   → CRITICAL VIOLATION

Check 1.2: Main Agent Source File Creation (CRITICAL)

jq '.timeline[] | select(.type == "tool_use" and .actor == "main" and (.tool.name == "Edit" or .tool.name == "Write") and .file_classification.type == "source_file")' timeline.json

# Rule: Main agent MUST NOT create/​edit source files during IMPLEMENTATION state
# Exception: Infrastructure files (module-info.java, pom.xml) allowed in any state

# FOR EACH tool_use in results:
#   IF file_classification.type == "source_file":
#     IF file_classification.worktree_type != "main_worktree":
#       → CRITICAL VIOLATION

Check 1.3: Working Directory Violations (CRITICAL)

jq '.timeline[] | select(.type == "tool_use" and .actor == "main" and (.tool.name == "Edit" or .tool.name == "Write") and .file_classification.worktree_type == "agent_worktree")' timeline.json

# Rule: Main agent MUST NOT perform Edit/​Write in agent worktrees

# IF any results found:
#   → CRITICAL VIOLATION

Phase 3: Execute Additional Checks (Categories 2-8)

Check 2.1: Main Agent Implementation (CRITICAL)

# Rule: Main agent MUST coordinate via Task tool, NOT implement directly
# Query timeline for Write/​Edit on .java/​.ts/​.py during IMPLEMENTATION state

Check 2.2: Agent Invocation Pattern (HIGH)

# Rule: Launch independent agents in parallel (single message)
# Query: Count Task tool invocations per message
# IF Task tools spread across multiple messages: VIOLATION

Check 3.1: Worktree Structure (CRITICAL)

# Rule: Each agent must have own worktree before invocation
# Query: Check worktree creation before Task tool calls

Check 3.2: Working Directory (CRITICAL)

# Rule: Agents work in their assigned worktrees
# Query: Verify cwd matches expected worktree for each agent

Check 4.1: Parallel Execution (MEDIUM)

# Rule: Independent operations should run in parallel
# Query: Identify sequential Task calls that could be parallel

Check 4.2: Iterative Validation (HIGH)

# Rule: Implementation uses review mode + implementation mode iterations
# Query: Verify agents in review mode (opus) validate agents in implementation mode (haiku)

Check 4.3: Agent Integration (CRITICAL)

# Rule: Agent work must merge to task branch
# Query: Verify git merge operations after agent completion

Phase 4: Generate Recommendations

For EACH violation, recommend specific protocol changes:

{
  "type": "CLARIFICATION|EXAMPLE|WARNING|EDGE_CASE",
  "file": "/​workspace/​main/​CLAUDE.md",
  "section": "Multi-Agent Architecture",
  "change": "Add explicit warning: 'VIOLATION: Main agent creating .java files directly'",
  "rationale": "Make prohibition more visible"
}

Output Format

{
  "audit_timestamp": "2025-11-01T...",
  "overall_verdict": "PASSED|FAILED",
  "violations": [
    {
      "check_id": "0.2",
      "severity": "CRITICAL",
      "rule": "Main agent MUST NOT use Write/​Edit on source files during IMPLEMENTATION state",
      "actual_behavior": "Main agent used Edit tool on FormattingRule.java while state == IMPLEMENTATION",
      "evidence": {
        "task_state": "IMPLEMENTATION",
        "tool_used": "Edit",
        "target_file": "FormattingRule.java",
        "target_type": "source_file",
        "actor": "main",
        "timestamp": "2025-11-01T15:02:00Z"
      },
      "verdict": "VIOLATION",
      "protocol_reference": "CLAUDE.md § Multi-Agent Architecture",
      "recommended_changes": [
        {
          "type": "CLARIFICATION",
          "file": "CLAUDE.md",
          "section": "Multi-Agent Architecture",
          "change": "Add explicit warning about source file creation prohibition",
          "rationale": "Make violation more obvious"
        }
      ]
    }
  ],
  "compliant_checks": [
    {
      "check_id": "1.1",
      "rule": "Main agent must coordinate stakeholder agents",
      "verdict": "COMPLIANT",
      "evidence": "Task tool invoked for architect, engineer, formatter"
    }
  ],
  "summary": {
    "total_checks": 25,
    "violations": 1,
    "compliant": 24,
    "overall_verdict": "FAILED",
    "critical_violations": 1,
    "high_violations": 0,
    "medium_violations": 0
  }
}

CRITICAL RULES (ZERO TOLERANCE)

Rule 1: Check 1.0-1.3 Execute FIRST

  • Do NOT skip to other checks
  • Do NOT assume state is correct
  • Read timeline data, don't infer

Rule 2: Binary Verdicts Only

  • Output: "VIOLATION" or "COMPLIANT"
  • NO "would be OK if..."
  • NO "technically a violation, but..."
  • NO gray areas

Rule 3: No Rationalization

PROHIBITED PATTERNS:

  • ❌ "Main agent implemented code, BUT this would be OK in VALIDATION state"
  • ❌ "Technically a violation, but the work is good quality"
  • ❌ "The agent was trying to fix violations, so it's reasonable"

REQUIRED PATTERN:

  • ✅ "Check 1.2: VIOLATION - Main agent used Edit during IMPLEMENTATION state"
  • ✅ "Evidence: task.json state == IMPLEMENTATION, Edit tool on source file"
  • ✅ "Verdict: VIOLATION (no exceptions)"

Rule 4: State-Based Rule Application

Rules apply based on actual task_state, NOT:

  • TodoWrite state
  • What state "should" be
  • What main agent thinks state is
  • What would make behavior acceptable

Rule 5: Evidence Required

  • Every violation must cite timeline evidence
  • Include: actual state, tool used, target file, actor, timestamp
  • No assumptions or inferences

Check Execution Matrix

Check IDCategorySeverityDescription
1.0Approval checkpointsCRITICALUser approval after SYNTHESIS
1.1State verificationCRITICALMerge before COMPLETE
1.2Implementation boundariesCRITICALMain agent source file creation
1.3Working directoryCRITICALAgent worktree isolation
2.1CoordinationCRITICALMain agent delegates via Task tool
2.2Invocation patternHIGHParallel agent launch
2.3Role clarityHIGHClear mode specification (opus/​haiku)
3.1Worktree structureCRITICALAgent worktrees exist
3.2Working directoryCRITICALAgents in correct worktrees
4.1Parallel executionMEDIUMIndependent operations parallel
4.2Iterative validationHIGHReview/​implementation iterations
4.3Agent integrationCRITICALWork merged to task branch

Verification Checklist

Before outputting audit results:

  • Check 1.0-1.3 executed FIRST
  • All checks attempted
  • Each violation has timeline evidence
  • Binary verdicts only (no rationalizations)
  • Overall verdict calculated (ANY violation = FAILED)
  • Recommended changes provided for each violation
  • JSON is valid

Related Skills

  • parse-conversation-timeline: Get structured timeline for auditing
  • learn-from-mistakes: Fix specific mistake after identifying it
  • audit-protocol-efficiency: Optimize execution patterns (run after compliance passes)

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View