Closed Loop logo

Closed Loop

CommunityPopular
huytieu
closed-loop

Run one task through the V-model verification loop: CP-2 plan → CP-3 build → CP-3v component verify → CP-4 integration verify (full lane) → CP-5 acceptance. The worker never grades its own homework; evidence rows trace back to AC-n. Opt-in: invoke with /closed-loop or by asking for the closed loop, proper verification, or an evidence trail. Ordinary work does not run this.

Overview

Publisherhuytieu
RepositoryCOG-second-brain
Skill nameclosed-loop
Stars
1.2K
Forks
138
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by huytieu on GitHub. Read the source before you install it.

Installation

Install the Closed Loop AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/huytieu/COG-second-brain.git /tmp/COG-second-brain
mkdir -p .claude/skills
cp -r /tmp/COG-second-brain/skills/closed-loop .claude/skills/closed-loop
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Closed Loop in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Closed Loop on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Closed Loop is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Closed-loop execute (V-model right arm)

Mechanical verification pipeline. Every verify step emits evidence rows tied to acceptance criterion IDs (AC-n).

When to use

The harness is opt-in. Run it when:

  • Invoked as /closed-loop <task> or /closed-loop <spec-path>.
  • The user asks for the closed loop, proper verification, or an evidence trail.
  • verification_harness: on in 00-inbox/MY-PROFILE.md and this is a build task.
  • Another skill that declares a normal+ lane reaches its verify step.

Do not run it on a request that did not ask for it. Notes, briefs, research, drafts, and ordinary edits are not harness runs, and a checkpoint ledger on those is pure overhead.

Phase 0 — Lane + run folder

bash
bash .claude/lib/lane-classify.sh explain "<task>"
bash .claude/lib/checkpoint.sh init 04-projects/harness/runs/<YYYY-MM-DD-HHmm>
LaneCheckpoints
tinyCP-3 → CP-5 (if mutating)
normalCP-1 → CP-2 → CP-3 → CP-3v → CP-5
full+ CP-4 + claim-verifier + CP-6
bugroot-cause ledger (CP-0) before CP-3

Record: checkpoint.sh record <run-dir> CP-0 PASS|SKIP "<lane>"

Phase 1 — CP-1 Spec (acceptance criteria)

If spec exists, use its ## Acceptance criteria + traceability matrix. Else write:

04-projects/harness/runs/<id>/criteria.md using references/spec-template.md (criteria + matrix sections only).

Each criterion: falsifiable + AC-n ID + verify method.

Record: checkpoint.sh record <run-dir> CP-1 PASS "N criteria"

Phase 2 — CP-2 Plan

Map tasks → AC IDs in evidence/CP-2-plan.md. Update matrix status to pending.

Record: checkpoint.sh record <run-dir> CP-2 PASS

Phase 3 — CP-3 Build

Worker implements. Returns deliverable path only.

Phase 4 — CP-3v Component verify

retry=0
loop:
  spawn task-verifier (fresh context, read-only)
  merge EVIDENCE rows into evidence/ledger.md
  if PASS → break
  if FAIL:escalate → record CP-3v FAIL, escalate
  if FAIL:fixable && retry < 2 → fix-agent → retry++
  else → escalate

Copy verifier EVIDENCE rows into evidence/CP-3v-component.md.

Record: checkpoint.sh record <run-dir> CP-3v PASS|FAIL

Phase 5 — CP-4 Integration verify (full or multi-task)

Spawn integration-verifier (read-only). Append rows to ledger.

Skip for single-task normal.

Record: checkpoint.sh record <run-dir> CP-4 PASS|SKIP

Phase 6 — CP-5 Acceptance (post-condition)

For each mutation, observe artifact (curl, screenshot, re-fetch). Emit:

EVIDENCE AC-n | CP-5 | PASS | <observation> | <artifact>

UI/UX flow changes: the post-condition is visual. Screenshot every meaningful state with whatever browser tooling the environment has, then read the image and confirm no overflow, misalignment, clipping, wrong color, or broken responsive layout before PASS. The Observation must describe what you saw; the artifact is the screenshot/GIF in evidence/. Fix any visual defect and re-capture. See CLAUDE.md → Visual Verification.

Write evidence/CP-5-acceptance.md. Traceability closure: every AC in matrix has ≥1 PASS row in ledger.

Record: checkpoint.sh record <run-dir> CP-5 PASS|FAIL

Phase 7 — Record + handoff

  • Append to .claude/logs/loop-ledger.tsv
  • Update spec traceability matrix statuses to verified
  • full lane / big task: generate an HTML rollup from references/report-template.html04-projects/harness/runs/<id>/report.html, filled from criteria.md + evidence/ledger.md (criteria, AC traceability, verifier verdicts, post-condition observations). Self-contained; SendUserFile it or publish as an Artifact. Skip for normal/tiny.
  • Suggest /retro <run-dir> for CP-7

Integration

SkillLaneCP-4
ultragoalfull per phase (never downgraded)integration-verifier + north-star acceptance
team-brieffullclaim-verifier
comprehensive-analysis, auto-researchfullclaim-verifier on cited claims
content-factorynormalskip
review-cockpitnormalskip; CP-6 is the user's approval per card

Escalation template

ESCALATED — <task>
Lane: <lane> | Last CP: <CP-n>
Evidence bundle: 04-projects/harness/runs/<id>/evidence/
Open AC IDs: <list without PASS rows>
Decision needed: <one question>

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Closed Loop AI skill do?

Run one task through the V-model verification loop: CP-2 plan → CP-3 build → CP-3v component verify → CP-4 integration verify (full lane) → CP-5 acceptance. The worker never grades its own homework; evidence rows trace back to AC-n. Opt-in: invoke with /closed-loop or by asking for the closed loop, proper verification, or an evidence trail. Ordinary work does not run this.

Why use Closed Loop on TypingMind?

Because you install it once and use it with any model. Closed Loop is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Closed Loop in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/huytieu/COG-second-brain/tree/main/skills/closed-loop. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Closed Loop?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Closed Loop?

As many as you like. As long as a model supports skills, you can use Closed Loop with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Closed Loop AI skill free?

Yes. It is published on GitHub by huytieu under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇