Copilot Governance Docs
Docs Home GitHub
Feature Catalog

Platform Features

Capabilities the Copilot Governance Platform ships today — governance authoring, PR distribution, local validation, and evidence-based prompt interception. Hook delivery is counted as governed only where the exact client path has a recorded canary. Each feature below links to its implementation.

Governance Authoring Prompt Interception PR-Based Sync Skill Registry

Looking for phases, metrics and rollout status instead? See the platform documentation.

9Instruction Packs
14Approved Workflows
7Curated Skills
238Automated Tests
Source Content

Governance Authoring

The content every governed repository receives, and the model that lets a repo extend it locally without weakening it.

Central Baseline

Repo-wide rules synced to .github/copilot-instructions.md in every governed repository.

9 Path-Specific Instruction Packs

Each matched by an applyTo glob, so only the relevant stack rules are injected.

Override Model

A central managed section repos can't edit, and a repo-owned section that's always preserved on sync.

CODEOWNERS Template

Shipped to every governed repo so governance-file changes always get the right reviewers.

Slash Commands

Approved Workflows

14 reusable prompt workflows in prompts/*.prompt.md. Each one is pinned to the exact instruction packs it must use, so the fix always follows an approved pattern instead of an invented one.

WorkflowWhat it does
/fix-pr-reviewAddress review feedback with the smallest safe change.
/fix-security-findingFix a security issue using only approved patterns.
/fix-console-logsRemove debug code, keep approved logging.
/fix-sonarqube-issueFix code-quality issues using root-cause fixes only, never suppress.
/fix-eslint-issueFix linting errors, trying auto-fix first.
/fix-test-failureFix the root cause of a failing test, never skip it.
/fix-build-failureFix the root cause of a broken build, never the gate.
/fix-typescript-errorFix type errors using type-safe patterns only.
/fix-angular-migrationMigrate Angular code incrementally while preserving behavior.
/fix-react-code-qualityFix a React code-quality issue, following existing patterns.
/fix-java-springboot-securityFix a Spring Boot security finding using Spring Security, never custom code.
/generate-unit-testsAdd behavior-focused unit tests with good coverage.
/document-repoWrite or update developer documentation — document what's there, mark what isn't.
/explain-legacy-codeExplain what selected legacy code does, not what it should do.

Run any of them locally with scripts/copilot-gov.sh prompt <workflow>, or trigger them the same way inside VS Code, Copilot CLI or Claude Code once a repo is synced.

Distribution

Sync & Automation

Governance content reaches downstream repos only through pull requests — never a direct commit to a default branch.

Sync Script
Clones each target repo and updates copilot-instructions.md, instructions/*, prompts/*, prompt-core/* and hooks/*, then opens or updates a PR. scripts/sync-copilot-instructions.sh
Target List
The repos a sync run ships to. repos.json
Manifest Tracking
Records exactly what was shipped, so a file removed centrally is removed downstream on the next sync — without touching content the repo added itself. scripts/sync-manifest.mjs
GitHub Actions Workflow
Runs on every push to a governed path, on manual dispatch with an optional single-repo filter, and on a weekly Monday 03:00 UTC cron as a safety net for closed or ignored PRs. .github/workflows/sync-copilot-instructions.yml
Review Gate
Governance file changes always route to the governance team. .github/CODEOWNERS
Local Tooling

Local CLI

One command surface, two implementations with full parity — bash for macOS/Linux/WSL/Git Bash, PowerShell for Windows without WSL.

CommandWhat it does
doctorShow local tool readiness.
validateValidate governance repository assets — see Content Enforcement below.
auditScan the current repo for common quality issues.
prompt <workflow>Print an approved prompt workflow.
rewrite "<text>"Preview how the interception kernel would govern a given prompt.
simulate "<text>"Replay the hook on every surface — no IDE required.
reportSummarize local prompt-interception telemetry.
sync --dry-runPreview a governance sync without opening a PR.
sync --applyApply governance sync through PR automation (needs GH_TOKEN + GH_ORG).
install-hooksInstall the local pre-commit validation hook.
Guardrails, Locally

Content Enforcement

validate, and the pre-commit hook it powers, enforce every file that gets auto-injected into a Copilot request before it can ship.

Word Budget

300 words per file by default (override with TOKEN_BUDGET_WORDS). security.instructions.md and code-quality.instructions.md carry documented higher ceilings since exhaustive coverage is their purpose.

Placeholder Detection

Blocks unresolved template placeholders from ever shipping to a governed repo.

Secret Detection

Blocks literal-looking hardcoded secrets in governance content itself.

Duplicate Phrasing Warning

The bash validator warns on verbatim duplicate phrasing across instruction files, to keep the injected content lean.

Pre-commit hookscripts/hooks/pre-commit, installed with copilot-gov.sh install-hooks, runs validate before every commit so a budget or secret violation never leaves a developer's machine. See docs/demo.md for what it caught the first time it ran.

Phase 5

Prompt Interception Kernel

PIK v2 verifies signed policy pack v3.2.0, evaluates 28 independent contracts, composes surface-specific output and writes metadata-only audit records. Twenty-one approved mandatory rules are source-configured for enforce mode; seven legacy rules remain evidence-gated in shadow. Full engineering status is on the docs home.

core.md

The governance core: non-negotiable rules injected into every governed prompt, regardless of intent.

router.json

Intent classifier — weighted regex signal scoring picks the matched workflow; ties break by file order.

deny.json

Twenty-eight versioned policy contracts: 21 mandatory blockers in enforce mode and seven legacy broad-signal rules retained in shadow.

rewrite.mjs

Zero-package engine: verify the policy pack → create an envelope → evaluate independent rules → classify → compose → write metadata-only local audit.

context-optimizer.mjs

Trims the composed prompt to fit the target surface's character budget without dropping required sections.

repo-profile.mjs

Detects the repo's real stack — Node runtime deps, framework signals — so only relevant instructions get matched.

skill-selector.mjs

Matches governed skills to intent + repo profile, verifying each against skill-lock.json before inclusion — fails closed on any mismatch.

surfaces.json

Capability records for VS Code, Claude Code, Copilot SDK and configured Copilot CLI hooks — including observe-only and unsupported paths.

Signed Policy Pack

Ed25519 signature verification, checksums, validity windows, anti-downgrade logic, background refresh and a 24-hour last-known-good grace.

Evidence-Gated Promotion

Requires 206 true positives from 210 independent reviews, Wilson lower bound, fixture, latency, degraded-rate, disagreement and game-day gates.

Privacy-Safe Event Buffer

Asynchronous bounded rotation, concurrent append locking, stale-lock recovery, strict metadata allowlists and optional AES-256-GCM encryption.

Feedback & Review Labels

Structured agree/disagree/uncertain feedback, safe reason codes, two independent reviewers, adjudication and conservative local sanitization.

Shipped Hook Configs

prompt-interceptor.json — VS Code copilot-cli-interceptor.json — Copilot CLI claude-code-settings.fragment.json — Claude Code
Reusable Expertise

Skill Registry

A governed catalog of reusable skills Copilot may pull into a prompt — scoped by stack and intent, and integrity-locked so nothing unapproved gets injected.

Approved Catalog
Per-skill status, risk level, allowed stacks and intents, a character budget, and a requiresHumanReview flag. At most 2 skills are injected into any one prompt. skill-registry/approved-skills.json
Integrity Lock
A SHA-256 hash, approver and approval date for every skill. skill-selector.mjs fails closed — rejecting all skills — if the lock file is missing or a hash doesn't match. skill-registry/skill-lock.json
7 Curated Skills
Internally reviewed content for code-review-and-quality, context-engineering, debugging-and-error-recovery, deprecation-and-migration, incremental-implementation, security-and-hardening, and test-driven-development. skill-registry/compact/
Upstream Attribution
Externally sourced skill content, kept with its license and source recorded. skill-registry/ATTRIBUTION.md · skill-registry/upstream/
Registry Validator
Checks every registry entry against the lock file before it can ship. scripts/validate-skill-registry.mjs
Quality Bar

Testing

The complete Node suite executes 238 tests: 237 pass and one Windows symlink case is skipped when administrator privileges are unavailable. It covers the 21-rule mandatory baseline, remediation-safe negatives, cross-platform signed-policy integrity, rollback, audit privacy, evidence gates, hook contracts and sync lifecycle.

This Site

Documentation Site

The platform documents itself — a static, dependency-free docs shell published straight from /docs on GitHub Pages.

Docs Home
Architecture, MVP phases, the Phase 5 kernel brief, guardrails and rollout metrics — searchable sidebar, scrollspy, and light/dark theme with no build step. docs/index.html
Feature Catalog
This page — every feature, linked to its implementing file. docs/features.html
PDF Generator
Renders a documentation page to PDF for offline/approval submission. scripts/generate-docs-pdf.mjs
Diagrams & Source Docs
Architecture diagrams plus repository-truth records for PIK v2 delivery, topology, privacy, thresholds, pilot risk and task effectiveness. PIK v2 delivery status