Agent skill

harness-map

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.

Stars 85
Forks 13

Install this agent skill to your Project

npx add-skill https://github.com/alchemiststudiosDOTai/harness-engineering/tree/main/skills/harness-map

SKILL.md

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:

  1. Canonical local command
    • just check, make check, task check, npm test, etc.
  2. Architecture boundaries
    • Import Linter, dependency-cruiser, Bazel visibility, custom dependency tests
  3. Structural rules
    • ast-grep, semgrep, custom lint rules, codemod rule tests
  4. Behavioral verification
    • unit/integration tests, snapshots, goldens, deterministic checks, build verification
  5. Docs ratchets
    • docs link checks, nav checks, metadata/frontmatter checks, allowlists
  6. CI decomposition
    • matrix jobs or separate workflows that mirror harness gates
  7. Evidence workflows
    • session logs, diff reports, chunk docs, experiment records, replay/debug artifacts
  8. 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:

markdown
---
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

markdown
## 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

markdown
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

Expand your agent's capabilities with these related and highly-rated skills.

alchemiststudiosDOTai/harness-engineering

differential-session-runner

Run or continue a differential debugging session between two implementations, traces, captures, or outputs. Record artifact identity, exact commands, first mismatch progression, findings, validation, and next probe in a durable session log.

85 13
Explore
alchemiststudiosDOTai/harness-engineering

agents-md-mapper

This skill should be used when creating, refreshing, or validating a repository `AGENTS.md` so it stays concise, current, and grounded in repository evidence. Use when `AGENTS.md` is missing or stale, after refactors or tooling changes, when new docs become the system of record, or when adding lightweight drift checks.

85 13
Explore
alchemiststudiosDOTai/harness-engineering

ast-grep-setup

Set up ast-grep for a codebase with common TypeScript rules for detecting anti-patterns, enforcing best practices, and preventing bugs. Creates sgconfig.yml, rule files, and rule tests. Use when adding structural linting, banning legacy patterns, or implementing ratchet gates.

85 13
Explore
alchemiststudiosDOTai/harness-engineering

research-phase

This skill should be used when mapping or researching a codebase to understand its structure, patterns, and architecture. Use when the user asks to "map the codebase", "research how X works", "find all Y patterns", or needs to understand code organization. Produces factual structural maps in .artifacts/research/—no suggestions, no recommendations, just what exists. Uses ast-grep for structural pattern matching.

85 13
Explore
alchemiststudiosDOTai/harness-engineering

plan-phase

Generate execution-ready implementation plans from research docs - planning ONLY, no fixing or verifying. North Star is whether a JR developer can execute the plan with zero additional context.

85 13
Explore
alchemiststudiosDOTai/harness-engineering

execute-phase

Execute implementation plans from .artifacts/plan/. Focus on EXECUTING ONLY - no planning, no fixes outside plan scope. Uses gated checks, atomic commits, and maintains a single execution log in .artifacts/execute/. Use when the user says "execute this plan" or provides a plan path.

85 13
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results