dk-close-the-loop

Automate iterative refinement of AI outputs with an observe-hypothesize-change-rerun loop.

87|12|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/deepklarity/harness-kit --skill dk-close-the-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dk-close-the-loop
Source: https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/dk-close-the-loop
Command: npx skills add https://github.com/deepklarity/harness-kit --skill dk-close-the-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Iterative output refinement can be tedious and error-prone when done manually; this skill provides a structured loop to systematically observe, hypothesize, change, and rerun to improve results while keeping context organized on disk.

Core Features & Use Cases

  • Structured observe-hypothesize-change-rerun workflow that preserves all intermediate states in a dedicated scratch directory.
  • Phase-driven iteration with built-in guidance for critique, hypothesis, and verdict decisions.
  • Use cases include improving prompts, refining plans or models, and debugging complex AI pipelines with auditable history.

Quick Start

Create the scratch directory, seed the baseline work, and run the close-the-loop process to begin iterations.

Frequently Asked Questions about dk-close-the-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate iterative refinement of AI outputs?

Automate iterative refinement by enforcing a structured observe, hypothesize, change, and rerun loop. This skill systematically processes prompts, plans, or model results while preserving all intermediate states to improve outcomes.

What is a structured loop for debugging complex AI pipelines?

A structured loop for debugging AI pipelines applies reproducible phases including Observe, Hypothesize, Change, Run, Compare, and Verdict. This process systematically critiques artifacts and stores state on disk to prevent context bleed.

How do I keep context organized when refining prompts across multiple iterations?

Keep context organized during prompt refinement by storing state in a dedicated scratch directory. This workflow preserves all intermediate artifacts on disk, preventing context bleed and maintaining an auditable history of changes.

Can I use a scratch-directory workflow to compare model results?

Yes, you can use a scratch-directory workflow to compare model results. The process evaluates changes by running new iterations against baselines, applying a structured verdict phase to determine if the refinement improved the output.

What's the best way to systematically critique and improve plans generated by AI?

Systematically critique and improve AI-generated plans by applying a phase-driven iteration process. You observe the baseline, hypothesize improvements, implement changes, and rerun to compare results, ensuring reproducible refinement.

Does iterative AI refinement require a specific framework to manage loop state?

Iterative AI refinement requires a scratch-directory workflow to manage loop state rather than a specific framework. The process stores intermediate phases and artifacts on disk to ensure reproducibility and prevent context bleed.