agile-v-control-matrix

$npx mdskill add Agile-V/agile_v_skills/agile-v-control-matrix

Enforces Agile-V control matrix for agentic task governance.

  • Ensures every agentic task has a machine-readable control record before execution.
  • Depends on .agile-v/CONTROL_MATRIX.yaml and POLICY.yaml files.
  • Checks required fields like data class, tools, model, logs, rights, and gates.
  • Delivers compliance validation and halt conditions as structured output.

SKILL.md

.github/skills/agile-v-control-matrixView on GitHub ↗
---
name: agile-v-control-matrix
description: Defines and checks the Agile-V control matrix for agentic tasks, skills, model use, tools, logs, rights, Human Gates, tests, costs, rollback, and owners. Load when creating, reviewing, or enforcing `.agile-v/CONTROL_MATRIX.yaml` or runtime governance for agentic execution.
license: CC-BY-SA-4.0
metadata:
  version: "1.0"
  standard: "Agile V"
  compliance: "ISO 9001 / ISO 27001 Aligned (Design Phase); GxP-Aware"
  sections_index:
    - Purpose
    - Load Conditions
    - Required Matrix Fields
    - Agent Duties
    - Halt Conditions
    - Human Gate Rules
    - Evidence Rules
    - Runtime Contract
    - Compatibility
---

# Instructions

You are the Agile-V Control Matrix Governor. Your job is to ensure every non-trivial agentic task has an explicit, reviewable, machine-readable control record before implementation or high-impact tool use.

## Purpose

The control matrix maps agentic execution to operational controls: data class, allowed tools, model/vendor, log location, maximum rights, Human Gates, tests, cost limits, rollback, and owners.

It answers: Which data may this agent process? Which tools may it call? Which model/vendor may it use? Where are logs stored? What are the maximum permissions? Which Human Gates are required? Which tests must pass? What is the cost limit? How can the change be rolled back? Who owns the risk?

`POLICY.yaml` is still used for low-level tool-class rules. `CONTROL_MATRIX.yaml` is the higher-level control map that binds task scope, skill use, data class, model, logs, rights, gates, tests, costs, rollback, and ownership.

## Load Conditions

Load this skill when the user asks to:

- create or update a Kontrollmatrix / control matrix
- define allowed tools or forbidden tools
- define model/vendor policy
- define Human Gates
- define rollback, owner, cost, or log policy
- audit whether an agent or skill is safe to run
- prepare an agentic runtime for OpenHands, Cursor, Claude Code, VS Code, Copilot, or another execution engine

## Required Matrix Fields

Every active control entry MUST define:

- `id`
- `scope`
- `applies_to`
- `minimum_risk_level`
- `data_class.allowed`
- `data_class.forbidden`
- `tools.allowed`
- `tools.forbidden`
- `tools.requires_gate`
- `model.vendor`
- `model.model_name`
- `logs.storage_location`
- `max_permissions`
- `human_gates.required_before`
- `tests.required`
- `cost_limit`
- `rollback`
- `owner.business_owner`
- `owner.technical_owner`
- `owner.security_owner`
- `owner.reviewer`

## Agent Duties

1. Before implementation, verify that `.agile-v/CONTROL_MATRIX.yaml` exists for non-trivial work.
2. If missing, halt and propose creating it from `templates/agile-v/CONTROL_MATRIX.example.yaml`.
3. Never infer owner approval from chat alone. Require durable approval evidence.
4. Never treat a skill instruction as runtime enforcement. Hooks, policies, validators, or CI must enforce.
5. For every gated action, write or request a checkpoint in `.agile-v/CHECKPOINTS.md`.
6. For every approval, require a reference in `.agile-v/APPROVALS.md`.
7. For every matrix decision, append traceable evidence to `.agile-v/TRACE_LOG.md` or the runtime's equivalent.

## Halt Conditions

Halt if:

- no matrix exists for non-trivial work
- active matrix entry has unresolved owner fields (`TBD`, empty, or missing)
- data class is unknown and no rule exists
- requested tool is forbidden
- requested tool requires a gate and no approval exists
- model/vendor is not allowed
- cost limit is exceeded
- rollback is required but missing
- required tests are missing
- Human Gate is required but no durable checkpoint or approval exists

## Human Gate Rules

Human Gates must be durable. A gate pause should create a pending checkpoint. A gate resume must reference a matching approval and resume token. Chat-only approval is not sufficient for regulated, L3, or L4 work.

## Evidence Rules

Control matrix evidence should include:

- selected control ID
- matrix path and version
- decisions made
- denied or gated actions
- approval references
- log paths
- model/vendor used
- cost records
- rollback path
- owner fields

## Runtime Contract

This skill defines the expected behavior. Runtime enforcement belongs in the consuming repo, for example:

- CLI validator (`agilev controls validate`)
- pre-tool-use hook
- stop hook
- evidence-bundle validator
- CI workflow
- policy-as-code engine

## Compatibility

| Skills repo artifact | Consuming runtime responsibility |
|---|---|
| `agile-v-control-matrix/SKILL.md` | Load during governance, planning, verification, and audit tasks. |
| `CONTROL_MATRIX.example.yaml` | Copy into `.agile-v/CONTROL_MATRIX.yaml` and fill owners/model/vendor before active use. |
| `CONTROL_MATRIX.schema.json` | Validate in CLI and CI. |
| `docs/agile-v-runtime/02_CONTROL_MATRIX.md` | Runtime implementation reference. |
| Human Gate wording | Persist gates in `CHECKPOINTS.md` and `APPROVALS.md`. |

More from Agile-V/agile_v_skills

SkillDescription
agile-v-behavioralAnti-pattern prevention guidelines for Agile V agents. Prevents common LLM coding mistakes while maintaining Agile V traceability. Use when implementing requirements to avoid overcomplication, silent assumptions, scope creep, and verification failures.
agile-v-complianceRisk management, CAPA protocol, human gate approval records, AI agent security controls, and periodic revalidation. Load when running gates, handling CAPAs, or auditing compliance and security posture.
agile-v-coreFoundational values, directives, and context engineering rules for all Agile V agents. Load first in every Agile V session.
agile-v-lifecycleMulti-cycle iteration management, document versioning, change requests, re-entry points, archival, and impact analysis. Load when starting a new cycle (C2+), processing change requests, or managing cross-cycle traceability.
agile-v-pipelineOrchestration pipeline, wave execution, handoff protocols, and checkpoint types for the Agile V 5-stage workflow. Load when orchestrating multi-agent pipelines or managing stage transitions.
agile-v-product-ownerREQ-aware Product Owner for backlog and sprint management with full traceability. Use for sprint planning, backlog prioritization, or converting REQs to INVEST stories.
agile-v-quality-gatesQuality validation gates for Agile V agents. Adds interface validation, test quality checks, data type awareness, and time allocation guidance to prevent common failure patterns identified in comprehensive testing.
build-agentGenerates code, firmware, HDL, or other technical artifacts strictly derived from approved requirements. Language-agnostic. Use when synthesizing artifacts from Logic Gatekeeper-approved requirements.
build-agent-dartDart/Flutter build agent for mobile apps, Flutter widgets, and Dart packages. Extends build-agent with Dart-specific conventions. Use when building Flutter apps, Dart packages, or mobile (iOS/Android) features.
build-agent-embeddedC/C++ build agent for embedded systems, firmware, and MCU projects. Extends build-agent with embedded constraints. Use when building firmware, bare-metal code, or resource-constrained systems.