/compliance-trestle:trestle-governancefrom compliance-trestle
Validates document structure, YAML headers, and folder layouts using Compliance Trestle governance commands. Useful for enforcing document standards and CI/CD validation.
Ships in compliance-trestle. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Trestle has three governance commands. The commands check document structure against templates. Teams can keep a standard document format. Teams can add structure validation to CI/CD pipelines.
| Command | Scope | What It Checks |
|---|---|---|
trestle author headers | YAML frontmatter only | Header field names, types, and required values |
trestle author docs | Full markdown documents | Headers + document structure (headings, sections) |
trestle author folders | Directory structure | Headers + docs + folder layout (same files in each instance) |
Each governance command supports four modes:
| Mode | Purpose | Example |
|---|---|---|
setup | Create template directory and initial templates | trestle author docs setup -tn my-task |
create-sample | Generate new instances from templates | trestle author docs create-sample -tn my-task |
template-validate | Validate the template files themselves | trestle author docs template-validate -tn my-task |
validate | Validate instance documents against templates | trestle author docs validate -tn my-task |
Templates are stored in the trestle workspace under:
.trestle/author/<task-name>/
├── template.md # For docs governance
├── a_template.md # For folders governance
├── another_template.md # Additional folder templates
└── architecture.drawio # Non-markdown templates
Instance documents live at the workspace root:
<task-name>/
├── document_001.md # Created by create-sample
├── document_002.md
└── subfolder/ # For folders governance
├── a_template.md
└── another_template.md
Templates use x-trestle-template-version in their YAML header to track versions:
---
x-trestle-template-version: 1.0.0
title: ""
description: ""
status: draft
---
If you set --template-version during validation, Trestle checks only documents with that template version.
You can migrate templates in steps.
The -gh / --governed-heading flag requires specific markdown headings in documents:
trestle author docs validate -tn my-task -gh "Purpose" -gh "Scope"
This check requires every document under my-task/ to contain ## Purpose and ## Scope sections.
| Flag | Commands | Description |
|---|---|---|
-tn, --task-name | All | Task name (maps to directory names) |
-gh, --governed-heading | docs, folders | Required heading in documents |
-hv, --header-validate | docs, folders | Validate YAML header structure |
-hov, --header-only-validate | docs, folders | Only validate headers, skip body |
-r, --recurse | headers, docs | Recurse into subdirectories |
-rv, --readme-validate | All | Include README.md in validation |
-tv, --template-version | All | Target specific template version |
-ig, --ignore | All | Regex to ignore files/folders |
-g, --global | headers | Use global template at __global__/ |
-vtt, --validate-template-type | docs, folders | Use x-trestle-template-type field |
Use governance commands in CI/CD pipelines. Common patterns follow.
- name: Validate compliance docs
run: |
trestle author docs validate -tn policies -hv -gh "Purpose" -gh "Scope"
trestle author headers validate -tn standards -r
- repo: local
hooks:
- id: trestle-docs-validate
name: Validate governed docs
entry: trestle author docs validate -tn my-task -hv
language: system
pass_filenames: false
Create templates:
trestle author docs setup -tn security-policies
Customize the template at .trestle/author/security-policies/template.md:
x-trestle-template-version.Generate samples:
trestle author docs create-sample -tn security-policies
Validate:
trestle author docs validate -tn security-policies -hv -gh "Purpose"
Add the check to CI/CD. Keep the check in place.
Choose the right governance level:
Located at .trestle/author/security-policies/template.md:
---
x-trestle-template-version: 1.0.0
title: ""
status: draft
owner: ""
review-date: ""
---
# [Policy Title]
## Purpose
[Describe why this policy exists and what it aims to achieve.]
## Scope
[Describe who and what this policy applies to.]
## Policy Statement
[The actual policy requirements and mandates.]
## Enforcement
[Describe consequences for non-compliance and how the policy is enforced.]
## Exceptions
[Process for requesting exceptions and who approves them.]
An actual policy at security-policies/access-control-policy.md:
---
x-trestle-template-version: 1.0.0
title: Access Control Policy
status: approved
owner: Chief Information Security Officer
review-date: 2025-06-15
---
# Access Control Policy
## Purpose
This policy establishes requirements for managing access to organizational
information systems to ensure only authorized users can access sensitive
resources.
## Scope
This policy applies to all employees, contractors, and third-party users
who access organizational information systems.
## Policy Statement
All access to information systems must follow the principle of least
privilege. Users shall be granted only the minimum access necessary to
perform their job functions. Privileged access requires additional approval
from the system owner and ISSO.
## Enforcement
Violations are handled through the organizational disciplinary process.
Automated monitoring detects unauthorized access attempts and triggers
incident response procedures.
## Exceptions
Exception requests must be submitted to the ISSO with business justification.
Exceptions are reviewed quarterly and expire after 12 months unless renewed.
trestle author docs validate -tn security-policies -hv \
-gh "Purpose" -gh "Scope" -gh "Policy Statement" \
-gh "Enforcement" -gh "Exceptions"
Global templates apply organization-wide header standards across all task names.
Location: .trestle/author/__global__/
.trestle/author/
├── __global__/
│ └── template.md # Global header template
├── security-policies/
│ └── template.md # Task-specific template (extends global)
└── procedures/
└── template.md
status, owner, review-date.-g flag:
trestle author headers validate -tn security-policies -g
trestle author headers validate -tn security-policies -g
trestle author docs validate -tn security-policies -hv -gh "Purpose"
You can require organization-wide metadata. Each document type can still have its own structure rules.
When templates change, use template versioning. Example: you add a required heading or header field.
Update the template with the new requirements and bump the version:
---
x-trestle-template-version: 2.0.0 # was 1.0.0
title: ""
status: draft
owner: ""
review-date: ""
risk-level: "" # new required field
---
Add the new governed heading (if applicable):
## Risk Assessment
[New required section for v2.0.0]
Validate old documents against the old version (existing documents still pass):
trestle author docs validate -tn security-policies -hv --template-version 1.0.0
Migrate documents in steps. Update each document to the v2.0.0 format. Add the new field and section. Then change x-trestle-template-version to 2.0.0.
Validate migrated documents against the new version:
trestle author docs validate -tn security-policies -hv --template-version 2.0.0
Drop the old version after all documents migrate. Remove the --template-version flag. Trestle then validates all documents against the current template.
Governed folders require every instance of a folder-based document package to use the same structure.
.trestle/author/assessment-evidence/
├── overview.md
├── test-results.md
└── screenshots/
└── placeholder.md
Each assessment creates a folder matching this structure:
assessment-evidence/
├── 2024-q1-assessment/
│ ├── overview.md
│ ├── test-results.md
│ └── screenshots/
│ └── placeholder.md
├── 2024-q3-assessment/
│ ├── overview.md
│ ├── test-results.md
│ └── screenshots/
│ └── placeholder.md
# Set up the governed folder template
trestle author folders setup -tn assessment-evidence
# Create a new instance from the template
trestle author folders create-sample -tn assessment-evidence -on 2025-q1-assessment
# Validate all instances have the required structure
trestle author folders validate -tn assessment-evidence -hv
Validation checks each instance folder. Each folder must contain all template files. Those files must match the template headers and governed headings.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub oscal-compass-lab/compliance-trestle-skills --plugin compliance-trestle11 skills in this plugin
/trestle-assessmentUse this skill for OSCAL assessment plans and assessment results models in Compliance Trestle. Use it for assessment plans, assessment results, security assessments, SAP, SAR, assessment activities, findings, observations, or assessment-related OSCAL models./trestle-authoring-workflowUse this skill for the Compliance Trestle authoring workflow. The workflow is the generate-edit-assemble cycle that converts OSCAL documents to markdown and back. Use it for authoring catalogs, profiles, SSPs, or component definitions. Use it for editing control markdown, YAML headers, or the roundtrip workflow between JSON and markdown./trestle-compliance-pipelineUse this skill for end-to-end compliance pipelines with Compliance Trestle. Topics include GRC personas, artifact ownership, multi-repository coordination, two-phase component definition authoring, CI/CD pipeline integration, and the Compliance-to-Policy (C2P) bridge. Use it for compliance pipelines, personas, artifact ownership, multi-repo workflows, component definition dual-mapping (control-to-rule, rule-to-check), C2P, or end-to-end workflow design./trestle-control-implementationUse this skill to write control implementation responses, rules, parameters, and component-level responses. Use it for inheritance and leveraged SSPs in Compliance Trestle. Use it for control responses, implementation status, rules, parameters, component definitions, SSP implementation details, or compliance documentation content./trestle-jinja-templatingUse this skill for the Compliance Trestle Jinja2 templating system for compliance documents. Use it for Jinja templates, document generation from OSCAL data, and custom trestle Jinja tags. Tags include mdsection_include, md_clean_include, and md_datestamp. Filters include as_list, get_party, parties_for_role, and diagram_href. Use it for SSP document rendering, lookup tables, or bracket formatting./trestle-oscal-modelsUse this skill for OSCAL model types, their relationships, and how Compliance Trestle manages them. Use it for OSCAL documents, model types, catalogs, profiles, SSPs, and component definitions. Use it when users ask how compliance models relate to each other.Other plugins' skills for the same job