Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .agents/skills/harness/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: harness
description: >
Set up or run the long-running-agent harness: initialize the durable state
files (.agents/features.json, .agents/progress.md), then run the fixed
startup and end-of-session loop. Use when the user says "/harness", "init the
harness", "start a session", "hand off", or when .agents/progress.md or
.agents/features.json exists and a session starts or ends.
---

The repository is the system of record. Chat is not. State that must survive a session lives in files; a fresh session recovers it by reading them, not by guessing. Based on [Learn Harness Engineering](https://github.com/walkinglabs/learn-harness-engineering).

## Init (once per repo, skip files that already exist)

Copy from `templates/` next to this file, then adapt — never leave placeholders:

1. `.agents/progress.md` — session log + current verified state.
2. `.agents/features.json` — every user-visible feature with `id`, `priority`, `status`, `verification` steps and `evidence`. Write real features from the repo's README/issues/code; all start `not_started`.
3. Optional for large sessions: `templates/session-handoff.md` → `.agents/handoff.md`.

Dependencies are installed by the devcontainer features, not here; the baseline is the CI status on the repo's dev forge (GitHub, GitLab, Azure DevOps), which the hook prints. Put each feature's real verification steps in `.agents/features.json`. Commit the files as one change. Once `.agents/progress.md` or `.agents/features.json` exists, the `SessionStart` hook prints the state and the `Stop` hook checks the handoff.

## Session start

1. `pwd` — confirm the repo root.
2. Read the repo's own rules: `CLAUDE.md`, `AGENTS.md`, `.agents/instructions/*.instructions.md` (the `SessionStart` hook lists which exist). They stay authoritative for commit format, PR base/title, scope limits and tooling; the harness adds the loop around them, it never overrides them.
3. Read `.agents/progress.md`, then `.agents/features.json`.
4. `git log --oneline -5`. The `SessionStart` hook already printed the state and the forge CI status of the branch.
5. CI red on the branch? That is the baseline: fix it first. No new work on a broken start.
6. Pick the highest-priority unfinished feature. Set it `in_progress`. One at a time.

## While working

- Follow the repo's rules while working (minimal-change discipline, commit/PR format, CI naming). A rule conflict with the harness: the repo rule wins; record it in the progress log.
- Stay inside the selected feature. A blocker may justify one narrow supporting fix.
- `passing` needs the feature's `verification` steps actually run, with evidence recorded (command + result, not "looks fine").
- Never reword, delete or weaken a feature or test to make it pass. Never loosen verification mid-feature.
- Declared done? Run the `harness-evaluator` agent: fresh context, tries to refute the claim.

## Session end

1. Update `.agents/progress.md`: verified state, what ran, evidence, known risk, next best step.
2. Update `.agents/features.json` statuses and evidence.
3. Walk `templates/clean-state-checklist.md`.
4. Commit once the repo is safe to resume, using the repo's commit and PR conventions from its rules. CI on the branch must be green or explained in the progress log; the next session must start without manual repair.

## Boundaries

Do not invent features, evidence or verification results. Do not mark `passing` without a run. Do not hide unfinished work by editing the list.
7 changes: 7 additions & 0 deletions .agents/skills/harness/templates/clean-state-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Clean State Checklist

- [ ] CI on the branch is green (or red for a reason recorded in the progress log).
- [ ] Progress is recorded in `.agents/progress.md`.
- [ ] `.agents/features.json` shows what is passing versus unverified, with evidence.
- [ ] No half-finished step is left undocumented.
- [ ] Work is committed; the next session continues without manual repair.
28 changes: 28 additions & 0 deletions .agents/skills/harness/templates/features.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"project": "replace-with-project-name",
"last_updated": "YYYY-MM-DD",
"rules": {
"single_active_feature": true,
"passing_requires_evidence": true,
"do_not_skip_verification": true
},
"status_legend": {
"not_started": "Work has not begun.",
"in_progress": "The feature is the current active task.",
"blocked": "Work cannot continue until a documented blocker is resolved.",
"passing": "Required verification has passed and evidence is recorded."
},
"features": [
{
"id": "feat-001",
"priority": 1,
"area": "replace",
"title": "Replace with a user-visible behavior",
"user_visible_behavior": "What a user can do or see when this works.",
"status": "not_started",
"verification": ["Command or steps that prove it works."],
"evidence": [],
"notes": ""
}
]
}
23 changes: 23 additions & 0 deletions .agents/skills/harness/templates/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Progress Log

Agent-agnostic session log. Read at session start, update before handoff. (Course name: `claude-progress.md`; kept generic here.)

## Current Verified State

- Standard startup: `SessionStart` hook (prints this state and the forge CI status)
- Standard verification path:
- Highest-priority unfinished feature:
- Current blocker:

## Session Log

### Session 001

- Date:
- Goal:
- Completed:
- Verification run:
- Evidence captured:
- Commits:
- Known risk or unresolved issue:
- Next best step:
29 changes: 29 additions & 0 deletions .agents/skills/harness/templates/session-handoff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Session Handoff

## Verified Now

- What is working:
- What verification actually ran:

## Changed This Session

- Code or behavior:
- Harness or infrastructure:

## Broken Or Unverified

- Known defect:
- Unverified path:
- Risk for the next session:

## Next Best Step

- Highest-priority unfinished feature:
- What counts as passing:
- What must not change during that step:

## Commands

- Startup:
- Verification:
- Focused debug:
1 change: 1 addition & 0 deletions .claude/skills/harness
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
command -v zz-use >/dev/null 2>&1 || . "$(dirname "$0")/install.sh"
export ZZ_ORIGIN_REF="${ZZ_ORIGIN_REF:-v3}"
zz-use -x git-hook-commitmsg "$@"
7 changes: 7 additions & 0 deletions .husky/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,10 @@ fi
fi
exit 0
)
### Pinned to the tomgrv/scripts major this release was built against, so a
### later breaking rename on main cannot break installs of this release.
### Exported so every zz-use below resolves from the same ref. Override with ZZ_ORIGIN_REF.
export ZZ_ORIGIN_REF="${ZZ_ORIGIN_REF:-v3}"
if curl -fsSL "${ZZ_SCRIPTS_SETUP_URL:-https://raw.githubusercontent.com/tomgrv/scripts/$ZZ_ORIGIN_REF/setup.sh}" -o "$_zz_setup_tmp" &&
zz-use json "json-*" >&2 ||
echo ".husky/install.sh: zz-use json failed" >&2
1 change: 1 addition & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
command -v zz-use >/dev/null 2>&1 || . "$(dirname "$0")/install.sh"
export ZZ_ORIGIN_REF="${ZZ_ORIGIN_REF:-v3}"
zz-use -x git-hook-postcheckout "$@"
1 change: 1 addition & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
command -v zz-use >/dev/null 2>&1 || . "$(dirname "$0")/install.sh"
export ZZ_ORIGIN_REF="${ZZ_ORIGIN_REF:-v3}"
zz-use -x git-hook-postmerge "$@"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
command -v zz-use >/dev/null 2>&1 || . "$(dirname "$0")/install.sh"
export ZZ_ORIGIN_REF="${ZZ_ORIGIN_REF:-v3}"
zz-use -x git-hook-precommit "$@"
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
command -v zz-use >/dev/null 2>&1 || . "$(dirname "$0")/install.sh"
export ZZ_ORIGIN_REF="${ZZ_ORIGIN_REF:-v3}"
zz-use -x git-hook-prepush "$@"
1 change: 1 addition & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
command -v zz-use >/dev/null 2>&1 || . "$(dirname "$0")/install.sh"
export ZZ_ORIGIN_REF="${ZZ_ORIGIN_REF:-v3}"
zz-use -x git-hook-preparecommitmsg "$@"
Loading