Harness Map
Map the repository's actual harness: the mechanical checks, policies, workflows, and artifacts that make change safe.
This skill is narrower than generic codebase research. It is specifically for answering questions like:
- "What is the harness in this repo?"
- "What does
check actually run?"
- "Which layers are local vs CI vs docs vs evidence?"
- "How is architecture enforced here?"
- "What operator surfaces teach agents how to use the harness?"
Core Principle
Map the harness as implemented, not as imagined.
Prefer:
- commands that actually run
- config files that actually enforce policy
- CI workflows that actually gate merges
- docs and playbooks that actually structure investigations
- agent/operator files that actually expose the workflow
Avoid:
- aspirational architecture prose without enforcement
- recommendations before the map exists
- broad codebase summaries that skip the gate structure
What Counts as Harness
A repo harness usually includes some or all of these layers:
- Canonical local command
just check, make check, task check, npm test, etc.
- Architecture boundaries
- Import Linter, dependency-cruiser, Bazel visibility, custom dependency tests
- Structural rules
- ast-grep, semgrep, custom lint rules, codemod rule tests
- Behavioral verification
- unit/integration tests, snapshots, goldens, deterministic checks, build verification
- Docs ratchets
- docs link checks, nav checks, metadata/frontmatter checks, allowlists
- CI decomposition
- matrix jobs or separate workflows that mirror harness gates
- Evidence workflows
- session logs, diff reports, chunk docs, experiment records, replay/debug artifacts
- Operator surface
AGENTS.md, .codex/, environment files, repo-local skills, slash commands
When to Use
Use this skill when the user asks to:
- map or explain the harness
- identify all gate layers in a repo
- compare local checks with CI checks
- document how architectural constraints are enforced
- understand how agents/operators are expected to use the repo safely
Workflow
1. Find the canonical local entrypoint
Inspect common entrypoint files first:
justfile
Makefile
package.json
pyproject.toml
- task runner config files
Capture:
- the canonical command name
- every subcommand it runs
- whether it chains all gates or only a subset
2. Find CI gate execution
Inspect CI workflows:
.github/workflows/*.yml
- other CI configs (
.gitlab-ci.yml, buildkite, etc.)
Capture:
- job names
- matrix dimensions
- whether
fail-fast is enabled
- which local gates are mirrored in CI
- which gates only exist in CI
3. Find architecture enforcement
Look for:
- Import Linter / grimp
- dependency-cruiser
- layering tests
- package-boundary configs
- forbidden import tests
Capture:
- contract names
- source and forbidden modules
- ignore lists / allowed exceptions
- exact config path
4. Find structural rule enforcement
Look for:
sgconfig.yml, ast-grep rule directories
- semgrep configs
- custom lint rule packages
- rule tests and snapshots
Capture:
- rule config files
- rule directories
- test directories
- snapshot/baseline locations
- any custom parser or language extensions
5. Find behavioral verification layers
Look for:
- test commands
- snapshot directories
- golden outputs
- deterministic helpers
- numerical equivalence docs
- build verification steps
Capture:
- exact commands
- test conventions docs
- locations of snapshots/goldens
- special validation steps outside the main test runner
6. Find docs ratchets
Look for:
- docs check scripts
- nav validation
- broken-link validation
- frontmatter/tag checks
- allowlists / baselines
Capture:
- categories of docs failures
- allowlist file paths
- whether the check behaves as a ratchet
7. Find evidence workflows
Look for:
- chunk docs
- debugging session logs
- replay/trace diff playbooks
- benchmark result docs
- evidence indexes
Capture:
- index files
- per-session or per-chunk docs
- required evidence fields
- exact commands recorded in those artifacts
8. Find operator-facing surfaces
Look for:
AGENTS.md
.codex/environments/*
.codex/skills/*
- command docs
- plugin manifests
Capture:
- setup / run / test actions
- repo-local skills that wrap harness flows
- operator instructions that point to real commands
9. Synthesize the harness map
Write a research artifact to:
memory-bank/research/YYYY-MM-DD_HH-MM-SS_<repo>-harness-map.md
Recommended structure:
---
title: "<repo> – Harness Map"
phase: Research
date: "YYYY-MM-DD HH:MM:SS"
owner: "<agent_or_user>"
tags: [research, harness, <repo>]
---
## Canonical Entry Point
- `path:line-line` → command and subcommands
## Harness Layers
### Layer 1: Local checks
### Layer 2: Architecture boundaries
### Layer 3: Structural rules
### Layer 4: Behavioral verification
### Layer 5: Docs ratchet
### Layer 6: CI matrix
### Layer 7: Evidence workflow
### Layer 8: Operator surface
## Source Index
- `path:line-line` → what this file contributes
## Observed Command Chain
- ordered list of checks from the main command
Output Requirements
Your harness map must:
- identify the single best local entrypoint if one exists
- show where each layer is enforced
- distinguish between enforced config and descriptive docs
- include exact file paths
- include line numbers when they materially improve traceability
- describe what exists before suggesting changes
Good Output Example
## Canonical Entry Point
- `justfile:22-29` defines `check *args:` and runs Ruff, Import Linter, ty, docs checks, ast-grep, pytest, and Zig checks.
## Layer 2: Architecture Boundaries
- `pyproject.toml:80-110` defines four Import Linter forbidden contracts.
## Layer 6: CI Matrix
- `.github/workflows/ci.yml:13-79` runs seven matrix tasks with `fail-fast: false`.
Bad Output Example
The repo appears to care about quality and uses several tools.
It has some tests and some linting.
Handoff
Common next steps after this skill:
- generate a condensed harness summary for operators
- compare two repos' harnesses
- use
plan-phase if the user wants to add or improve a harness layer
1---2name: harness-map3description: Map a repository's mechanical harness layers: canonical check command, local and CI gates, architecture boundaries, structural rules, behavioral verification, docs ratchets, evidence workflows, and operator-facing surfaces. Use when you need to understand how a repo keeps change safe.4---56# Harness Map78Map the repository's **actual harness**: the mechanical checks, policies, workflows, and artifacts that make change safe.910This skill is narrower than generic codebase research. It is specifically for answering questions like:1112- "What is the harness in this repo?"13- "What does `check` actually run?"14- "Which layers are local vs CI vs docs vs evidence?"15- "How is architecture enforced here?"16- "What operator surfaces teach agents how to use the harness?"1718## Core Principle1920**Map the harness as implemented, not as imagined.**2122Prefer:23- commands that actually run24- config files that actually enforce policy25- CI workflows that actually gate merges26- docs and playbooks that actually structure investigations27- agent/operator files that actually expose the workflow2829Avoid:30- aspirational architecture prose without enforcement31- recommendations before the map exists32- broad codebase summaries that skip the gate structure3334## What Counts as Harness3536A repo harness usually includes some or all of these layers:37381. **Canonical local command**39 - `just check`, `make check`, `task check`, `npm test`, etc.402. **Architecture boundaries**41 - Import Linter, dependency-cruiser, Bazel visibility, custom dependency tests423. **Structural rules**43 - ast-grep, semgrep, custom lint rules, codemod rule tests444. **Behavioral verification**45 - unit/integration tests, snapshots, goldens, deterministic checks, build verification465. **Docs ratchets**47 - docs link checks, nav checks, metadata/frontmatter checks, allowlists486. **CI decomposition**49 - matrix jobs or separate workflows that mirror harness gates507. **Evidence workflows**51 - session logs, diff reports, chunk docs, experiment records, replay/debug artifacts528. **Operator surface**53 - `AGENTS.md`, `.codex/`, environment files, repo-local skills, slash commands5455## When to Use5657Use this skill when the user asks to:5859- map or explain the harness60- identify all gate layers in a repo61- compare local checks with CI checks62- document how architectural constraints are enforced63- understand how agents/operators are expected to use the repo safely6465## Workflow6667### 1. Find the canonical local entrypoint6869Inspect common entrypoint files first:7071- `justfile`72- `Makefile`73- `package.json`74- `pyproject.toml`75- task runner config files7677Capture:78- the canonical command name79- every subcommand it runs80- whether it chains all gates or only a subset8182### 2. Find CI gate execution8384Inspect CI workflows:8586- `.github/workflows/*.yml`87- other CI configs (`.gitlab-ci.yml`, `buildkite`, etc.)8889Capture:90- job names91- matrix dimensions92- whether `fail-fast` is enabled93- which local gates are mirrored in CI94- which gates only exist in CI9596### 3. Find architecture enforcement9798Look for:99100- Import Linter / grimp101- dependency-cruiser102- layering tests103- package-boundary configs104- forbidden import tests105106Capture:107- contract names108- source and forbidden modules109- ignore lists / allowed exceptions110- exact config path111112### 4. Find structural rule enforcement113114Look for:115116- `sgconfig.yml`, ast-grep rule directories117- semgrep configs118- custom lint rule packages119- rule tests and snapshots120121Capture:122- rule config files123- rule directories124- test directories125- snapshot/baseline locations126- any custom parser or language extensions127128### 5. Find behavioral verification layers129130Look for:131132- test commands133- snapshot directories134- golden outputs135- deterministic helpers136- numerical equivalence docs137- build verification steps138139Capture:140- exact commands141- test conventions docs142- locations of snapshots/goldens143- special validation steps outside the main test runner144145### 6. Find docs ratchets146147Look for:148149- docs check scripts150- nav validation151- broken-link validation152- frontmatter/tag checks153- allowlists / baselines154155Capture:156- categories of docs failures157- allowlist file paths158- whether the check behaves as a ratchet159160### 7. Find evidence workflows161162Look for:163164- chunk docs165- debugging session logs166- replay/trace diff playbooks167- benchmark result docs168- evidence indexes169170Capture:171- index files172- per-session or per-chunk docs173- required evidence fields174- exact commands recorded in those artifacts175176### 8. Find operator-facing surfaces177178Look for:179180- `AGENTS.md`181- `.codex/environments/*`182- `.codex/skills/*`183- command docs184- plugin manifests185186Capture:187- setup / run / test actions188- repo-local skills that wrap harness flows189- operator instructions that point to real commands190191### 9. Synthesize the harness map192193Write a research artifact to:194195`memory-bank/research/YYYY-MM-DD_HH-MM-SS_<repo>-harness-map.md`196197Recommended structure:198199```markdown200---201title: "<repo> – Harness Map"202phase: Research203date: "YYYY-MM-DD HH:MM:SS"204owner: "<agent_or_user>"205tags: [research, harness, <repo>]206---207208## Canonical Entry Point209- `path:line-line` → command and subcommands210211## Harness Layers212### Layer 1: Local checks213### Layer 2: Architecture boundaries214### Layer 3: Structural rules215### Layer 4: Behavioral verification216### Layer 5: Docs ratchet217### Layer 6: CI matrix218### Layer 7: Evidence workflow219### Layer 8: Operator surface220221## Source Index222- `path:line-line` → what this file contributes223224## Observed Command Chain225- ordered list of checks from the main command226```227228## Output Requirements229230Your harness map must:231232- identify the **single best local entrypoint** if one exists233- show where each layer is enforced234- distinguish between **enforced config** and **descriptive docs**235- include exact file paths236- include line numbers when they materially improve traceability237- describe what exists before suggesting changes238239## Good Output Example240241```markdown242## Canonical Entry Point243- `justfile:22-29` defines `check *args:` and runs Ruff, Import Linter, ty, docs checks, ast-grep, pytest, and Zig checks.244245## Layer 2: Architecture Boundaries246- `pyproject.toml:80-110` defines four Import Linter forbidden contracts.247248## Layer 6: CI Matrix249- `.github/workflows/ci.yml:13-79` runs seven matrix tasks with `fail-fast: false`.250```251252## Bad Output Example253254```markdown255The repo appears to care about quality and uses several tools.256It has some tests and some linting.257```258259## Handoff260261Common next steps after this skill:262263- generate a condensed harness summary for operators264- compare two repos' harnesses265- use `plan-phase` if the user wants to add or improve a harness layer