agentleFS
majiayu000majiayu000/test-loop/.agents/skills/init-loop/SKILL.md

init-loop

Skill0 starsChanged 37 days agoMITView on GitHub

Install the closed test loop into a fresh project. Copies the pre-commit hook, the CI workflow, the render script, the drift check script, the failure classifier, and the knowledge-base templates, then prepares the drill handoff that verifies the loop reacts.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After forking a project that you want to bring up to the same standard as the rest of your fleet.

    line 23
  2. Very specific:

    Do not use this skill to install a single piece of the loop.

    line 26
  3. Distinctive:

    After writing, the skill prepares the drill procedure that verifies the loop reacts to a real injected failure.

    line 57
  4. Very specific:

    Refuse: if the project already has the loop and existing_loop_check=true.

    line 66
  5. Very specific:

    Overwriting an existing loop: Always run with existing_loop_check=true unless you know the existing loop is broken beyond repair.

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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-loop

Stand up the closed test loop in a project that does not have it.

When to use

  • Once, at the start of a new project, after the build system works.
  • Once, in an existing project that has a test suite but no loop.
  • After forking a project that you want to bring up to the same standard as the rest of your fleet.

Do not use this skill to install a single piece of the loop. If you only want the drift check, copy scripts/check_drift.sh directly and move on.

Inputs

NameRequiredDefaultDescription
target_pathyesnonePath to the project root. The skill refuses to write outside this directory.
languageyesnoneOne of swift, python, go, rust. Picks the source glob and the failure-classify patterns.
ci_providernogithubCurrently only github is supported. gitlab and circleci are tracked for v0.3.
knowledge_base_pathnodocs/knowledge/Where the L0/L1/L2 Markdown lives. The skill will create the directory if it does not exist.
existing_loop_checknotrueWhen true, the skill aborts if it finds an existing .githooks/pre-commit or .github/workflows/test.yml to avoid clobbering.

Output

The skill writes into target_path:

PathContents
bin/check_drift.shThe drift check script.
bin/classify_failures.pyThe failure classifier.
bin/render_report.shThe report renderer.
.githooks/pre-commitThe drift guardrail.
.github/workflows/test.ymlThe CI workflow.
docs/knowledge/L0_overview.mdA starter L0 file the user is expected to fill in.
docs/knowledge/L1_modules.mdA starter L1 file.
docs/knowledge/L2_equivalence_classes.mdA starter L2 file.
docs/spec/closed-loop.mdA reference spec explaining the loop.
.gitignore (append)docs/reports/ if not already ignored.

After writing, the skill prepares the drill procedure that verifies the loop reacts to a real injected failure. v0.1 agents should ask before injecting failures into a target project.

Algorithm

  1. Detect the language from the project: Package.swift for Swift, pyproject.toml for Python, go.mod for Go, Cargo.toml for Rust.
  2. Refuse if the project already has the loop and existing_loop_check=true.
  3. Copy each file in the table above from bin/, templates/, and templates/knowledge/. If the target file already exists, skip it. Do not overwrite user-edited files.
  4. Configure git config core.hooksPath .githooks in the target project, so the pre-commit hook is active.
  5. Prepare the drill handoff by naming the command and files the drill skill will touch. Run the drill only after the user approves the injected failure.

Worked example

# Add the loop to a Swift project.
test-loop init --target /path/to/project --language swift

# Or, since v0.1 ships skills rather than a CLI, the equivalent
# agent-driven flow:
# 1. /init-loop target=/path/to/project language=swift
# 2. /drill target=/path/to/project

Anti-patterns

  • Overwriting an existing loop. Always run with existing_loop_check=true unless you know the existing loop is broken beyond repair.
  • Treating the starter L0/L1/L2 files as a finished knowledge base. They are scaffolding. Fill them in based on the project's actual modules and contracts.
  • Skipping the drill. The drill is the only way to know the loop actually reacts. A loop that was copied but never drilled is a loop that may not work.

Cross-references

  • drill — the next step, run automatically by this skill.
  • drift-check — one of the pieces this skill installs.
  • report-render — another piece.
  • test-loop-bootstrap — for users who do not know which skill to start with.

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.