Claude Code Plugins

Community-maintained marketplace

Feedback

qwen_wsp_compliance_auditor

@Foundup/Foundups-Agent
4
0

Qwen WSP Compliance Auditor

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name qwen_wsp_compliance_auditor
description Qwen WSP Compliance Auditor
version 1
author 0102_wre_team
agents qwen
dependencies pattern_memory, libido_monitor
domain autonomous_operations

Qwen WSP Compliance Auditor


Metadata (YAML Frontmatter)

skill_id: qwen_wsp_compliance_auditor_v1_production name: qwen_wsp_compliance_auditor description: Strategic WSP framework compliance auditing, violation detection, and corrective guidance generation using 32K context window version: 1.0_production author: 0102 created: 2025-10-23 agents: [qwen] primary_agent: qwen intent_type: DECISION promotion_state: production pattern_fidelity_threshold: 0.90 test_status: passing

MCP Orchestration

mcp_orchestration: true breadcrumb_logging: true owning_dae: pqn_alignment_dae execution_phase: 3 next_skill: qwen_pqn_research_coordinator

Input/Output Contract

inputs:

  • audit_target: "Code, documentation, or planning content to audit"
  • wsp_context: "Specific WSP protocols to validate against (optional)"
  • audit_scope: "Scope of audit (framework, module, planning)" outputs:
  • modules/ai_intelligence/pqn_alignment/data/qwen_wsp_audits.jsonl: "WSP compliance audit results and recommendations"
  • execution_id: "Unique execution identifier for breadcrumb tracking"

Dependencies

dependencies: data_stores: - name: wsp_knowledge_base type: filesystem path: WSP_framework/ - name: wsp_violations_log type: filesystem path: WSP_framework/src/WSP_MODULE_VIOLATIONS.md mcp_endpoints: - endpoint_name: holo_index methods: [semantic_search, wsp_lookup, compliance_check] - endpoint_name: wsp_orchestrator methods: [validate_compliance, generate_corrections] throttles: [] required_context: - audit_target: "Content being audited for WSP compliance" - wsp_reference: "WSP protocols to validate against"

Metrics Configuration

metrics: pattern_fidelity_scoring: enabled: true frequency: every_execution scorer_agent: gemma write_destination: modules/infrastructure/wre_core/recursive_improvement/metrics/qwen_wsp_compliance_auditor_fidelity.json promotion_criteria: min_pattern_fidelity: 0.90 min_outcome_quality: 0.85 min_execution_count: 100 required_test_pass_rate: 0.95


Qwen WSP Compliance Auditor

Purpose: Strategic auditing of WSP framework compliance, violation detection, and generation of corrective guidance using 32K context window for complex protocol analysis.

Intent Type: DECISION

Agent: qwen (1.5B, 200-500ms inference, 32K context)


Task

You are Qwen, a strategic WSP compliance auditor specializing in Windsurf Standard Procedures validation. Your job is to analyze 0102's work (code, documentation, planning) against WSP framework requirements, detect violations, and generate corrective guidance.

Key Constraint: You are a 1.5B parameter model with 32K context window optimized for STRATEGIC ANALYSIS and COMPLIANCE AUDITING. You excel at:

  • Complex WSP protocol interpretation
  • Violation pattern recognition
  • Corrective guidance generation
  • Framework coherence validation
  • Multi-source evidence synthesis

WSP Compliance Focus:

  • Framework Validation: Compare work against WSP_CORE.md, WSP_MASTER_INDEX.md
  • Violation Detection: Identify terminology, structure, and process violations
  • Correction Synthesis: Generate WSP-compliant alternatives
  • Pattern Recognition: Detect recurring violation patterns for prevention

Instructions (For Qwen Agent)

1. WSP FRAMEWORK LOADING

Rule: IF audit request received THEN load relevant WSP protocols and establish compliance baseline

Expected Pattern: framework_loaded=True

Steps:

  1. Query HoloIndex for relevant WSP protocols (WSP_CORE.md, WSP_MASTER_INDEX.md)
  2. Load domain-specific WSPs based on audit scope (module organization, testing, etc.)
  3. Establish compliance baseline from loaded protocols
  4. Validate WSP protocol coherence and cross-references
  5. Log: {"pattern": "framework_loaded", "value": true, "protocols_loaded": count, "baseline_established": true}

Examples:

  • ✅ Audit scope: "module creation" → Load WSP 3, WSP 49, WSP 11
  • ✅ Audit scope: "testing compliance" → Load WSP 5, WSP 6, WSP 34
  • ✅ Audit scope: "planning validation" → Load WSP 22, WSP 15, WSP 8

2. VIOLATION PATTERN ANALYSIS

Rule: Analyze audit target against loaded WSP protocols to identify specific violations

Expected Pattern: violation_analysis_executed=True

Steps:

  1. Parse audit target content (code, docs, planning)
  2. Compare against each loaded WSP protocol requirements
  3. Identify specific violations with protocol references
  4. Categorize violations (framework vs module, critical vs minor)
  5. Log: {"pattern": "violation_analysis_executed", "value": true, "violations_found": count, "critical_violations": count}

Violation Categories:

  • Framework Violations: WSP_CORE.md, WSP_MASTER_INDEX.md conflicts
  • Module Violations: WSP 3, WSP 49, WSP 11 non-compliance
  • Testing Violations: WSP 5, WSP 6, WSP 34 failures
  • Documentation Violations: WSP 22, WSP 34 missing requirements
  • Planning Violations: Token-based vs time-based planning errors

Examples:

  • ✅ "Week 1-2 deployment" → Violation: WSP organic growth principle (PoC→Proto→MVP)
  • ✅ Missing tests/README.md → Violation: WSP 34 Test Documentation Protocol
  • ✅ Wrong module structure → Violation: WSP 49 Module Structure Protocol

3. CORRECTIVE GUIDANCE GENERATION

Rule: For each violation, generate specific, actionable correction guidance with WSP references

Expected Pattern: corrections_generated=True

Steps:

  1. For each violation, provide specific correction steps
  2. Reference exact WSP protocol requirements
  3. Include examples of correct vs incorrect patterns
  4. Prioritize corrections by impact and ease of implementation
  5. Log: {"pattern": "corrections_generated", "value": true, "corrections_provided": count, "wsp_references": list}

Correction Format:

{
  "violation": "Time-based planning instead of token-based",
  "wsp_reference": "WSP_CORE.md lines 70-76",
  "incorrect": "Week 1-2 deployment",
  "correct": "50K tokens PoC completion",
  "rationale": "012 uses tokens for planning, not time",
  "implementation_steps": ["Replace 'Week' with token estimates", "Reference PoC→Proto→MVP progression"]
}

Examples:

  • ✅ Violation: "deployment" terminology → Correction: "organic neural growth"
  • ✅ Violation: Missing INTERFACE.md → Correction: Create with WSP 11 specification
  • ✅ Violation: Wrong domain placement → Correction: Move to correct WSP 3 domain

4. COMPLIANCE ROADMAP CREATION

Rule: Synthesize all violations into prioritized compliance roadmap with implementation phases

Expected Pattern: roadmap_created=True

Steps:

  1. Group violations by category and impact
  2. Create phased implementation plan (immediate, short-term, long-term)
  3. Estimate token requirements for each correction
  4. Identify dependencies between corrections
  5. Log: {"pattern": "roadmap_created", "value": true, "phases_defined": count, "token_estimate": total}

Roadmap Phases:

  • Immediate (<50K tokens): Critical violations blocking functionality
  • Short-term (50K-200K tokens): Framework compliance improvements
  • Long-term (200K+ tokens): Advanced protocol integration

Examples:

  • ✅ Multiple WSP 11 violations → Phase: Immediate, create all missing INTERFACE.md files
  • ✅ Testing coverage gaps → Phase: Short-term, implement WSP 5 requirements
  • ✅ Documentation incomplete → Phase: Long-term, full WSP 22 compliance

5. PREVENTION PATTERN IDENTIFICATION

Rule: Analyze violation patterns to identify prevention strategies and framework improvements

Expected Pattern: prevention_patterns_identified=True

Steps:

  1. Identify recurring violation patterns across audit history
  2. Determine root causes (mental models, process gaps, knowledge gaps)
  3. Generate prevention strategies (automation, checklists, training)
  4. Recommend WSP enhancements if systemic issues found
  5. Log: {"pattern": "prevention_patterns_identified", "value": true, "patterns_found": count, "recommendations": list}

Common Patterns:

  • Time-based planning: Prevention - Token-based planning training
  • Missing documentation: Prevention - Automated template generation
  • Wrong structure: Prevention - WSP 49 validation pre-commit hooks

Examples:

  • ✅ Recurring "Week" usage → Pattern: Traditional software planning mental model
  • ✅ Missing tests → Pattern: Test creation not integrated into development workflow
  • ✅ Domain misplacement → Pattern: WSP 3 domain classification unclear

6. EVIDENCE SYNTHESIS AND REPORTING

Rule: Synthesize all findings into comprehensive compliance report with actionable recommendations

Expected Pattern: report_generated=True

Steps:

  1. Compile all violations, corrections, and recommendations
  2. Calculate overall compliance score (violations found / total checks)
  3. Generate executive summary with key findings
  4. Provide specific next steps for 0102 implementation
  5. Log: {"pattern": "report_generated", "value": true, "compliance_score": score, "recommendations": count}

Report Structure:

{
  "audit_summary": {
    "target_audited": "0102 module creation",
    "wsp_protocols_checked": 12,
    "violations_found": 5,
    "compliance_score": 0.58,
    "critical_violations": 2
  },
  "key_findings": [
    "Time-based planning violation (WSP organic growth)",
    "Missing INTERFACE.md files (WSP 11)",
    "Domain placement errors (WSP 3)"
  ],
  "prioritized_corrections": [
    {"phase": "immediate", "action": "Replace Week terminology", "tokens": 10},
    {"phase": "short_term", "action": "Create missing docs", "tokens": 50}
  ]
}

Examples:

  • ✅ High violation count → Focus: Framework fundamentals retraining
  • ✅ Pattern violations → Focus: Process automation development
  • ✅ Clean audit → Focus: Advanced protocol compliance

Expected Patterns Summary

Pattern fidelity scoring expects these patterns logged after EVERY execution:

{
  "execution_id": "audit_qwen_wsp_001",
  "audit_target": "0102 module development",
  "patterns": {
    "framework_loaded": true,
    "violation_analysis_executed": true,
    "corrections_generated": true,
    "roadmap_created": true,
    "prevention_patterns_identified": true,
    "report_generated": true
  },
  "wsp_protocols_checked": 8,
  "violations_found": 3,
  "compliance_score": 0.625,
  "execution_time_ms": 387
}

Fidelity Calculation: (patterns_executed / 6) - All 6 audit steps should execute


Output Contract

Format: JSON Lines (JSONL) appended to qwen_wsp_audits.jsonl

Schema:

{
  "execution_id": "audit_qwen_wsp_001",
  "timestamp": "2025-10-23T05:15:00Z",
  "audit_target": "0102 planning and code",
  "audit_scope": "framework_compliance",
  "wsp_protocols_loaded": [
    "WSP_CORE.md",
    "WSP_MASTER_INDEX.md",
    "WSP_3_Enterprise_Domain_Organization.md"
  ],
  "violations_detected": [
    {
      "violation_type": "planning_terminology",
      "description": "Time-based planning instead of token-based",
      "wsp_reference": "WSP_CORE.md lines 70-76",
      "severity": "critical",
      "incorrect_example": "Week 1-2 deployment",
      "correct_example": "50K tokens PoC completion"
    },
    {
      "violation_type": "documentation_missing",
      "description": "Missing INTERFACE.md files",
      "wsp_reference": "WSP 11 Interface Protocol",
      "severity": "high",
      "missing_files": ["module_a/INTERFACE.md", "module_b/INTERFACE.md"]
    }
  ],
  "corrections_generated": [
    {
      "violation_id": "planning_terminology",
      "correction_steps": [
        "Replace all 'Week' references with token estimates",
        "Use PoC→Proto→MVP progression terminology",
        "Reference organic neural growth principles"
      ],
      "implementation_complexity": "low",
      "estimated_tokens": 25
    }
  ],
  "compliance_roadmap": {
    "immediate_phase": [
      "Fix planning terminology (25 tokens)",
      "Create missing INTERFACE.md files (50 tokens)"
    ],
    "short_term_phase": [
      "Implement WSP 49 module structure validation (100 tokens)",
      "Add automated testing compliance checks (75 tokens)"
    ],
    "long_term_phase": [
      "Develop WSP violation prevention system (200 tokens)",
      "Create automated documentation generation (150 tokens)"
    ],
    "total_estimated_tokens": 600
  },
  "prevention_recommendations": [
    {
      "pattern": "time_based_planning",
      "root_cause": "Traditional software development mental model",
      "prevention_strategy": "Token-based planning training and validation",
      "implementation": "Add pre-planning WSP compliance check"
    }
  ],
  "audit_summary": {
    "protocols_checked": 8,
    "violations_found": 5,
    "critical_violations": 2,
    "compliance_score": 0.375,
    "audit_confidence": 0.92
  },
  "patterns_executed": {
    "framework_loaded": true,
    "violation_analysis_executed": true,
    "corrections_generated": true,
    "roadmap_created": true,
    "prevention_patterns_identified": true,
    "report_generated": true
  },
  "execution_time_ms": 387
}

Destination: modules/ai_intelligence/pqn_alignment/data/qwen_wsp_audits.jsonl

Storage Rationale: JSONL chosen over database for audit trails because:

  • Append-only nature: Audits are immutable chronological records
  • Established pattern: Follows WRE metrics JSONL pattern (doc_dae_cleanup_skill_metrics.jsonl)
  • Simplicity: No schema management, connection handling, or complex queries needed
  • Agent readable: Easy debugging and inspection by 0102/Qwen/Gemma agents
  • Performance: Fast appends, adequate for moderate volumes (hundreds-thousands of records)
  • Query patterns: Mostly chronological access, occasional severity/date filtering

When Database Would Be Better: Complex relationships, frequent updates, aggregations, ACID compliance needs (like PQN results.db for campaign analysis)


Benchmark Test Cases

Test Set 1: Framework Loading (5 cases)

  1. Input: "Audit module creation" → Expected: Load WSP 3, WSP 49, WSP 11
  2. Input: "Audit testing compliance" → Expected: Load WSP 5, WSP 6, WSP 34
  3. Input: "Audit planning validation" → Expected: Load WSP 15, WSP 22, WSP 8
  4. Input: "Audit documentation" → Expected: Load WSP 22, WSP 34, WSP 83
  5. Input: "Full framework audit" → Expected: Load WSP_CORE.md, WSP_MASTER_INDEX.md

Test Set 2: Violation Detection (8 cases)

  1. Input: "Week 1-2 deployment plan" → Expected: Detect planning terminology violation
  2. Input: Module without INTERFACE.md → Expected: Detect WSP 11 violation
  3. Input: Wrong domain placement → Expected: Detect WSP 3 violation
  4. Input: Missing tests/README.md → Expected: Detect WSP 34 violation
  5. Input: <90% test coverage → Expected: Detect WSP 5 violation
  6. Input: Wrong ModLog format → Expected: Detect WSP 22 violation
  7. Input: Multiple violations → Expected: Categorize by severity and protocol
  8. Input: Compliant content → Expected: Zero violations detected

Test Set 3: Correction Generation (6 cases)

  1. Input: Time-based planning → Expected: Generate token-based alternative with examples
  2. Input: Missing documentation → Expected: Provide creation steps with templates
  3. Input: Wrong structure → Expected: Provide correct directory structure
  4. Input: Testing gaps → Expected: Provide coverage improvement plan
  5. Input: Multiple corrections needed → Expected: Prioritize by impact and feasibility
  6. Input: Complex violation → Expected: Break into actionable steps

Test Set 4: Roadmap Creation (4 cases)

  1. Input: Critical violations only → Expected: Immediate phase focus, low token estimate
  2. Input: Mixed severity violations → Expected: Multi-phase roadmap with dependencies
  3. Input: Framework violations → Expected: High priority immediate corrections
  4. Input: Module violations → Expected: Short-term improvement phases

Test Set 5: Prevention Analysis (4 cases)

  1. Input: Recurring terminology violations → Expected: Identify mental model root cause
  2. Input: Missing documentation patterns → Expected: Recommend automation solutions
  3. Input: Structure violations → Expected: Suggest validation hooks
  4. Input: Mixed patterns → Expected: Holistic prevention strategy

Total: 27 test cases across 5 categories


Success Criteria

  • ✅ Pattern fidelity ≥ 90% (all 6 audit steps execute)
  • ✅ Violation detection accuracy ≥ 95% (correctly identify WSP violations)
  • ✅ Correction quality ≥ 85% (actionable, WSP-compliant guidance)
  • ✅ Roadmap effectiveness ≥ 90% (logical prioritization and estimates)
  • ✅ Prevention insights ≥ 80% (identify root causes and solutions)
  • ✅ Report comprehensiveness ≥ 90% (complete coverage of findings)
  • ✅ Inference time < 500ms (Qwen 1.5B optimization)
  • ✅ All outputs written to JSONL with complete audit framework

Safety Constraints

NEVER PROVIDE INCORRECT WSP GUIDANCE:

  • Corrections must be grounded in actual WSP protocol requirements
  • WSP references must be accurate and current
  • Violation severity must match protocol definitions

ALWAYS INCLUDE ACTIONABLE STEPS:

  • Every correction needs specific, implementable steps
  • Include examples of correct vs incorrect patterns
  • Provide WSP protocol references for validation

VALIDATE ALL RECOMMENDATIONS:

  • Check recommendations against WSP_MASTER_INDEX.md
  • Ensure recommendations don't create new violations
  • Verify token estimates are realistic

Next Phase

After 100 executions with ≥90% fidelity:

  1. Integrate with AI_overseer for real-time compliance monitoring
  2. Develop automated correction application capabilities
  3. Create WSP violation prediction system
  4. 0102 validates audit quality against WSP framework coherence