agentleFS
RedtropigRedtropig/harness-anchor/skills/init-verification/SKILL.md

init-verification

Skill13 starsChanged 4 months agoMITView on GitHub

Use at start of work, after env changes (deps/branch/OS), or when something stops working. Runs init.sh health check; treats failures as blocking.

  • Installs packages

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before writing any code, prove the environment is healthy.

    line 8
  2. Distinctive:

    After git checkout to a different branch

    line 13
  3. Very specific:

    After dependency changes (package.json / Cargo.toml / etc.

    line 14
  4. Distinctive:

    After OS / toolchain updates

    line 15
  5. Distinctive:

    When a previously-working command suddenly fails

    line 16
  6. Distinctive:

    Before claiming a feature done (re-verify in case of drift)

    line 17
  7. Distinctive:

    Do not silently rewrite someone's operating manual.

    line 66
  8. Very specific:

    Keep init.sh fast — under 30 seconds.

    line 95
  9. Very specific:

    When init.sh reports OK, the agent's claim is *"environment looks healthy as of <timestamp>"*.

    line 99
  10. Distinctive:

    When it fails, list the specific failed step, not "init failed" alone.

    line 101
  11. Very specific:

    When init.sh fails with a cryptic toolchain message (e.g., CMake "could not find compiler", npm ENOENT, cargo "linker not found") — invoke …

    line 120

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Init Verification

Before writing any code, prove the environment is healthy. Anthropic's Nov 2025 harness guidance: the initializer agent runs init.sh, then the coding agent picks up — health is verified BEFORE work begins.

When to invoke

  • First action of every fresh session
  • After git checkout to a different branch
  • After dependency changes (package.json / Cargo.toml / etc. modified)
  • After OS / toolchain updates
  • When a previously-working command suddenly fails
  • Before claiming a feature done (re-verify in case of drift)

Procedure

  1. Locate init.sh in project root.
    • Missing → tell the user to run /anchor to scaffold one. Do not proceed.
  2. Run it.

    bash init.sh

    Capture stdout+stderr.

  3. Interpret exit code.

    ExitMeaningAction
    0All checks passedProceed with work
    1One or more checks failedStop. Fix the reported issues before doing anything else.
    otherUnexpectedRead output; either fix init.sh itself or report to user
  4. On failure: list the specific missing files/tools, propose fixes one at a time:

    • Missing tool (e.g. cmake not found) → suggest install command appropriate to platform (brew install cmake on macOS)
    • Missing state file (e.g. feature_list.json missing) → suggest /anchor
    • Missing build artifact (e.g. compile_commands.json missing) → suggest correct configure command
  5. After fix: re-run init.sh. Repeat until exit 0. Then continue work.
  6. Re-check inherited NEGATIVE capability conclusions.

    A line in AGENTS.md shaped like searched <scope>, not found (as of <date>) records what a past session observed. It is not a current fact. Re-check each one. This step, by construction, only ever re-checks conclusions already recorded as absent, so it always takes the discovery chain's NOT_FOUND path — the slower, full-ladder search, not the fast PATH hit — and that path measures ~1.6s for two tools (51-entry PATH):

    bash ${CLAUDE_PLUGIN_ROOT}/scripts/cpp-tool-discovery.sh <tool>

    For non-C/C++ ecosystems, the equivalent is command -v <tool> plus that platform's known install locations — command -v alone is the check that produced the wrong conclusion in the first place.

    • Tool now present → report it to the user and propose updating that line. Do not silently rewrite someone's operating manual.
    • Still absent → refresh the date, or leave it; either is fine. What is not fine is citing the old conclusion as if it were fresh evidence.

    Only negative conclusions get re-checked, and that asymmetry is deliberate:

    ConclusionHow it fails once staleNeeds a proactive re-check?
    Negative ("clang-tidy not found")Silently. The tool gets installed, the note never updates, and the capability is skipped for the rest of the project's life. This is the observed failure mode.Yes
    Positive ("clang-tidy at /usr/bin/clang-tidy")Loudly. The next invocation is command not found.No

    Residual blind spot: this step only reaches lines written in the mandated form above. A capability conclusion phrased freehand — or written before v0.17.0 — is invisible to it. A clean re-check means "the dated conclusions are current", never "the manual contains nothing stale".

What init.sh should check (project-specific)

The template provides scaffolding for:

  • harness state files (AGENTS.md, feature_list.json, progress.md, session-handoff.md, PROJECT-TOC.md)
  • presence of git

The user edits init.sh to add project-specific checks:

  • Build commands (cmake -S . -B .build / npm install / cargo check)
  • Dependency presence (node --version, python --version)
  • Service availability (db ping, external API reachability) — only if needed at agent-start

Keep init.sh fast — under 30 seconds. Heavyweight checks (full test suite) belong in /verify, not init.

Calibrated reporting

When init.sh reports OK, the agent's claim is "environment looks healthy as of <timestamp>". Don't oversell — env can drift mid-session if commands modify it.

When it fails, list the specific failed step, not "init failed" alone.

Anti-patterns

  • Skipping init.sh because "I think the env is fine" → you don't know until you check
  • Editing init.sh to make a failing check pass without fixing the underlying issue → masking
  • Running init.sh once at session start, then assuming the env stays healthy 4 hours later — re-run after meaningful environment changes

When NOT to run

  • Inside a subagent that was already given verified-healthy context
  • For trivial single-file edits where build/test aren't needed (rare; usually init still cheap enough to run)

Worktree setup (superpowers:using-git-worktrees)

When superpowers:using-git-worktrees sets up an isolated workspace, its Step 2 (Project Setup) is init.sh — run it as the baseline instead of re-deriving ad-hoc npm install / cargo build; its Step 3 (Verify Clean Baseline) is the project's test command / /verify (the heavier pass init.sh deliberately defers). The git-tracked state trio travels with the branch checkout, so a worktree is already anchored — don't re-run /anchor. But .harness-anchor/ is gitignored, so a fresh worktree starts with no prior verify/coverage/drift evidence: that is expected, not un-anchored — it is recreated on demand when a sensor first writes to it.

Looking up toolchain errors

When init.sh fails with a cryptic toolchain message (e.g., CMake "could not find compiler", npm ENOENT, cargo "linker not found") — invoke the docs-lookup skill. Context7 is best for stable tool behavior; WebSearch surfaces recent platform-specific changes; calibrated uncertainty when neither helps.

Typical entry query: paste the exact error string in quotes + the tool name.

Related

  • /anchor — scaffolds the initial init.sh
  • /verify — heavier-weight full verification (different scope)
  • feature-state-keeper — init.sh failure is captured in session-handoff.md "Risks"

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.