packages/skills/skills/ct-ivt-looper/SKILL.md
Runs a project-agnostic autonomous Implement-then-Validate-then-Test compliance loop on any git worktree. Detects the project's test framework (vitest, jest, mocha, pytest, unittest, go-test, cargo-test, rspec, phpunit, bats, or other) and iterates until the implementation satisfies its specification, recording convergence metrics to the manifest. Use when given an implementation task that must ship verified: the IVT loop is the autonomous compliance layer enforced before any release or PR. Triggers on phrases like 'implement and verify', 'run the IVT loop', 'ship this task', 'complete implementation with tests', 'verify against spec', or any implementation task with acceptance criteria. Works in any git worktree regardless of language or framework, never hardcoded to one project's tooling.
npx skillsauth add kryptobaseddev/cleo ct-ivt-looperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Runs an autonomous Implement-then-Validate-then-Test loop against any git worktree, detects the test framework in use, and iterates until the implementation converges on its specification. This skill is the autonomous compliance layer: no task ships, no release runs, and no PR opens until the loop has recorded a converged result to the manifest.
The loop converges on the spec, not on 'tests pass'. Passing tests that don't cover the spec is a failure.
| ID | Rule | Enforcement |
|----|------|-------------|
| IVT-001 | Test framework MUST be detected or declared before the loop starts. | validateTestingProtocol rejects entries without a framework; deducts 20 from score. |
| IVT-002 | Loop MUST cap iterations at MAX_ITERATIONS (default 5). | Hard counter in the loop; unreachable convergence forces HITL escalation. |
| IVT-003 | Every MUST requirement in the spec MUST map to at least one passing test. | Spec-to-test traceability matrix; gaps block convergence. |
| IVT-004 | Final manifest entry MUST record framework, testsRun, testsPassed, testsFailed, ivtLoopConverged, ivtLoopIterations. | validateTestingProtocol requires these fields; ivtLoopConverged: false fails validation. |
| IVT-005 | Framework detection MUST NOT be hardcoded to one project's tooling. | Detection walks the project tree; no vitest/jest-only code paths. |
| IVT-006 | Loop MUST NOT run on the main branch. | Check git branch --show-current; stop if on main/master/trunk. |
| IVT-007 | Non-convergence after MAX_ITERATIONS MUST escalate to HITL (exit code 65). | Agent stops, writes manifest with ivtLoopConverged: false, exits. |
| IVT-008 | Final manifest entry MUST set agent_type: "testing". | Validator rejects any other value. |
load_spec(task_id) # read acceptance criteria from canon
detect_framework(worktree) # see references/frameworks.md
branch_check() # abort if on main/master/trunk
iteration = 0
while iteration < MAX_ITERATIONS: # IVT-002
iteration += 1
# ----- I : Implement -----
apply_patch(current_diff) # patch generated by the implementer
ensure_provenance_tags(new_code) # IMPL-003 tags on new functions
# ----- V : Validate -----
lint_result = run_project_linter()
type_result = run_type_checker() # tsc / mypy / go vet / rustc
if lint_result.failed or type_result.failed:
regenerate_fix_for(lint_result, type_result)
continue # back to top, same iteration count
# ----- T : Test -----
test_result = run_framework_tests() # framework-specific command
trace = spec_to_test_trace(spec) # IVT-003: every MUST has a test
if test_result.all_passed and trace.complete:
write_manifest(
framework=framework,
iterations=iteration,
converged=True,
agent_type="testing",
)
return CONVERGED # exit loop, exit skill with code 0
# ----- Analyze and regenerate fix -----
failure = diagnose(test_result, trace)
current_diff = regenerate_fix_for(failure)
# MAX_ITERATIONS reached without convergence
write_manifest(
framework=framework,
iterations=MAX_ITERATIONS,
converged=False,
agent_type="testing",
)
escalate_to_hitl() # IVT-007: exit code 65
The loop is a single stage from the lifecycle's point of view. Implement, Validate, and Test are not three separate tasks — they are three phases of one autonomous run that either converges or escalates.
Framework detection is project-agnostic: the skill walks the worktree, inspects config files, and selects the correct test command. No language or framework is special-cased above another. The full detection table lives in references/frameworks.md. In summary: detection reads the project manifest (package.json, pyproject.toml, Cargo.toml, go.mod, Gemfile, composer.json, or .cleo/project-context.json#testing.command) and selects one of: vitest, jest, mocha, pytest, unittest, go-test, cargo-test, rspec, phpunit, bats, other.
The loop has converged when all of the following hold:
testsFailed == 0, testsRun > 0, and testsPassed == testsRun.pnpm run build, cargo build, go build ./...).A loop that makes tests pass by deleting assertions, narrowing scope, or mocking the thing under test is not converged — that is a spec violation dressed up as a green run. See references/loop-anatomy.md for worked examples.
Before iteration 1, the skill MUST verify the current branch:
branch=$(git branch --show-current)
if [[ "$branch" == "main" || "$branch" == "master" || "$branch" == "trunk" ]]; then
echo "Refusing to run IVT loop on protected branch: $branch"
exit 65 # HANDOFF_REQUIRED: ask HITL for a feature branch
fi
The loop is destructive in the sense that it rewrites code on failed iterations. It MUST run on a feature branch or worktree. If the user invoked it on a protected branch, stop and request a feature branch.
When the loop exhausts MAX_ITERATIONS without converging, the skill MUST:
ivtLoopConverged: false and the iteration count.key_findings.HANDOFF_REQUIRED).The human reviewer picks up the worktree, reads the diagnostics, and either raises the iteration cap, rewrites the spec, or manually corrects the implementation before rerunning the skill. The full escalation handoff protocol is in references/escalation.md.
Record the loop outcome through cleo check protocol:
# Success case: loop converged on iteration 3.
cleo check protocol \
--protocolType testing \
--framework vitest \
--testsRun 142 \
--testsPassed 142 \
--testsFailed 0 \
--ivtLoopConverged true \
--ivtLoopIterations 3
# Failure case: loop exhausted iterations, HITL escalation.
cleo check protocol \
--protocolType testing \
--framework pytest \
--testsRun 87 \
--testsPassed 84 \
--testsFailed 3 \
--ivtLoopConverged false \
--ivtLoopIterations 5
Exit code 0 = loop converged and protocol is valid. Exit code 65 = HANDOFF_REQUIRED (non-convergence).
This skill MUST also chain a validation check against the spec before its own testing check:
cleo check protocol \
--protocolType validation \
--specMatchConfirmed true \
--testSuitePassed true \
--protocolComplianceChecked true
| Pattern | Problem | Solution |
|---------|---------|----------|
| Hardcoding vitest or jest | Violates IVT-005; breaks on any non-JS project | Walk the worktree and pick the framework per project |
| Running the loop on main/master | Violates IVT-006; pollutes shared branch | Check git branch --show-current and refuse protected branches |
| No iteration cap | Infinite loop on unreachable convergence; context burn | Enforce MAX_ITERATIONS (default 5); escalate to HITL on exhaustion |
| Deleting assertions to force green | Tests pass but the spec is not met | The skill requires spec-to-test traceability; gaps block convergence |
| Skipping the validation phase | Lint or type errors slip through | The loop MUST run lint and type check before the test phase every iteration |
| Treating testing as "just run the tests" | Misses the loop; one-shot runs are not compliant | Testing is a loop, not a single call; record ivtLoopIterations |
| Exiting without writing the manifest | Downstream skills cannot see the outcome | Always write the manifest entry — converged or not — before exiting |
| Reverting the worktree on escalation | Destroys diagnostic evidence | Leave the failed state; the human reviewer needs it |
MAX_ITERATIONS (default 5); escalate on exhaustion.main, master, or trunk — stop and request a feature branch.framework, testsRun, testsPassed, testsFailed, ivtLoopConverged, ivtLoopIterations in the manifest.cleo check protocol --protocolType testing.tools
Connect any AI agent to SignalDock for agent-to-agent messaging. Use when an agent needs to: (1) register on api.signaldock.io, (2) install the signaldock runtime CLI, (3) send/receive messages to other agents, (4) set up SSE real-time streaming, (5) poll for messages, (6) check inbox, or (7) connect to the SignalDock platform. Triggers on: "connect to signaldock", "register agent", "send message to agent", "agent messaging", "signaldock setup", "install signaldock", "agent-to-agent".
development
Compliance validation for verifying systems, documents, or code against requirements, schemas, or standards. Performs schema validation, code compliance checks, document validation, and protocol compliance verification with detailed pass/fail reporting. Use when validating compliance, checking schemas, verifying code standards, or auditing protocol implementations. Triggers on validation tasks, compliance checks, or quality verification needs.
testing
General implementation task execution for completing assigned CLEO tasks by following instructions and producing concrete deliverables. Handles coding, configuration, documentation work with quality verification against acceptance criteria and progress reporting. Use when executing implementation tasks, completing assigned work, or producing task deliverables. Triggers on implementation tasks, general execution needs, or task completion work.
tools
Quick ephemeral sticky notes for project-wide capture before formal classification