Vercel Composition Patterns
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
Iteratively improve any output by running a structured observe-hypothesize-change-rerun loop.
$ npx skills add deepklarity/harness-kit --skill hk-refine -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install deepklarity/harness-kit hk-refine --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/deepklarity/harness-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/hk-refine .claude/skills/hk-refine && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "hk-refine" agent skill from https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/hk-refine into .claude/skills/hk-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hk-refine", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/hk-refineType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add deepklarity/harness-kit --skill hk-refine -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install deepklarity/harness-kit hk-refine --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/deepklarity/harness-kit.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/hk-refine .agents/skills/hk-refine && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "hk-refine" agent skill from https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/hk-refine into .agents/skills/hk-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hk-refine", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add deepklarity/harness-kit --skill hk-refine -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install deepklarity/harness-kit hk-refine --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/deepklarity/harness-kit.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/hk-refine .cursor/skills/hk-refine && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "hk-refine" agent skill from https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/hk-refine into .cursor/skills/hk-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hk-refine", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/deepklarity/harness-kit.git --path .claude/skills/hk-refine--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add deepklarity/harness-kit --skill hk-refine -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install deepklarity/harness-kit hk-refine --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/deepklarity/harness-kit.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/hk-refine .gemini/skills/hk-refine && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "hk-refine" agent skill from https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/hk-refine into .gemini/skills/hk-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hk-refine", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install deepklarity/harness-kit hk-refineInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add deepklarity/harness-kit --skill hk-refine -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/deepklarity/harness-kit.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/hk-refine .github/skills/hk-refine && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "hk-refine" agent skill from https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/hk-refine into .github/skills/hk-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hk-refine", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add deepklarity/harness-kit --skill hk-refine -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install deepklarity/harness-kit hk-refine --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/deepklarity/harness-kit.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/hk-refine .opencode/skills/hk-refine && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "hk-refine" agent skill from https://github.com/deepklarity/harness-kit/tree/main/.claude/skills/hk-refine into .opencode/skills/hk-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "hk-refine", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
hk-refineIteratively improve any output by running a structured observe-hypothesize-change-rerun loop.
Hk Refine is an agent skill from deepklarity/harness-kit. Iteratively improve any output by running a structured observe-hypothesize-change-rerun loop. Uses an organized scratch directory to prevent context blowup — the conversation stays thin while iterations accumulate on disk. Use when an output (reflection, plan, prompt, pipeline result) isn't good enough and needs systematic refinement. Triggers on: 'close the loop', 'this output isn't good enough', 'iterate on this', 'refine this output', 'improve this reflection', or /hk-refine.
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development. The repository describes itself as: A kit for building with AI agents and also the engineering patterns around it. The licence is MIT.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 87305cd. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
BashReadEditWriteTaskGrepGlobFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Hk Refine loads about 2.4k tokens when it runs. Until then it costs about 123 tokens; SKILL.md has 716 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
allowed-tools: Bash, Read, Edit, Write, Task, Grep, GlobAutomated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from deepklarity/harness-kit at commit 87305cd, republished under its MIT licence (© deepklarity). 716 words, ~2,371 tokens.
.claude/skills/hk-refine/SKILL.md (or your agent's skills folder).You have an open loop: something produced output, the output isn't good enough, and you need to systematically improve it. This skill closes that loop.
The core discipline: everything lives on disk, not in conversation context. The scratch directory is the organized record of what was tried, what worked, and why. Subagents read from disk, write to disk, and report back in 2-3 line summaries. The main conversation only holds the current hypothesis and verdict — never full outputs.
<loop_context> $ARGUMENTS </loop_context>
If the context above is empty or unclear, ask the user:
temp_reflections/ or temp_loop/)This is the product. Not temp files — the organized log of the refinement process.
<scratch_dir>/
├── loop.md # Live loop state (see template below)
├── baseline/
│ ├── output.md # Original output that needs improvement
│ ├── critique.md # Structured critique of what's wrong
│ └── run_command.txt # Exact command/process that produced the output
├── iter-1/
│ ├── hypothesis.md # What to change and why
│ ├── changes.md # What was actually changed (with file paths and diffs)
│ ├── output.md # New output after changes
│ ├── comparison.md # Before vs after, structured
│ └── verdict.md # Better / worse / mixed — with evidence
├── iter-2/
│ └── ...
└── summary.md # Written when loop closesThis file is the single source of truth for where the loop is. Read it at the start of every iteration. Update it after every verdict.
# Close-the-Loop: [short description]
## Target
What we're improving: [one line]
Run command: [the exact command to re-run]
Quality signal: [how we know it's better — specific, measurable if possible]
## Current State
Iteration: [N]
Best so far: [baseline | iter-N]
Status: [observing | hypothesizing | changing | running | comparing | closed]
## Hypothesis Log
- iter-1: [hypothesis] → [verdict: better/worse/mixed]
- iter-2: [hypothesis] → [verdict]
- ...
## What We've Learned
- [Accumulated insights that carry forward — things that definitely help or definitely don't]
## Next
[What to try next, or "CLOSED: [reason]"]run_command.txt with the exact command that produces the outputloop.md with initial stateDelegate critique to a subagent (sonnet). The subagent reads the current output and produces a structured critique. The main conversation does NOT read the full output — only the critique summary.
Task(model: sonnet, subagent_type: general-purpose)
Read <scratch_dir>/[baseline or iter-N]/output.md
Produce a structured critique:
1. STRENGTHS: What's working well (keep these)
2. WEAKNESSES: What's not working, ranked by impact
3. MISSING: What should be there but isn't
4. EXCESS: What's there but shouldn't be (noise, fluff, wrong focus)
5. ROOT ISSUE: The single biggest thing to fix (not a list — pick one)
Write your critique to <scratch_dir>/[baseline or iter-N]/critique.md
Return a 3-line summary: the root issue, the top weakness, and one strength to preserve.Based on the critique summary (not the full output), form a hypothesis. This happens in the main conversation — it's a judgment call, not mechanical work.
Write to <scratch_dir>/iter-N/hypothesis.md:
# Hypothesis for Iteration N
## What to change
[Specific change — which file, which prompt section, which config value]
## Why this should help
[Connect the change to the root issue from the critique]
## What to watch for
[Side effects — things that might get worse when this gets better]
## Estimated impact
[High / Medium / Low — on the specific quality signal defined in loop.md]The hypothesis must be specific enough that someone else could apply the change without seeing the conversation. "Make the prompt better" is not a hypothesis. "Add a structured output format requirement to the reflection prompt because the current output is unstructured prose that's hard to evaluate" is a hypothesis.
Apply the changes described in the hypothesis. This could be:
Log what changed in <scratch_dir>/iter-N/changes.md:
# Changes for Iteration N
## Files modified
- `path/to/file.py` — [what changed, 1 line]
- `path/to/prompt.md` — [what changed, 1 line]
## Diffs
[Actual diffs or before/after snippets for each change]Execute the command from run_command.txt to produce new output. Capture the output to <scratch_dir>/iter-N/output.md.
If the run command involves odin exec, odin reflect, or similar commands that can't run inside Claude Code, provide the user with copy-paste commands and wait for them to paste the output back. Note this in loop.md's status.
If the run command is something that CAN run (a Python script, a test, an API call), run it directly.
Delegate comparison to a subagent (sonnet). The subagent reads ONLY the two outputs — it does not see the hypothesis or changes. This keeps the comparison unbiased.
Task(model: sonnet, subagent_type: general-purpose)
Compare these two outputs for quality. You do not know which is "old" or "new."
Output A: <scratch_dir>/[previous best]/output.md
Output B: <scratch_dir>/iter-N/output.md
Quality signal: [from loop.md]
Produce:
1. WINNER: A or B or TIE (on the specific quality signal)
2. EVIDENCE: 3-5 specific examples showing why
3. TRADE-OFFS: Did anything get worse in the winner?
4. CONFIDENCE: How clear is the difference? (obvious / marginal / unclear)
Write to <scratch_dir>/iter-N/comparison.md
Return: winner + confidence + one-line evidence summaryBased on the comparison summary, update loop state:
Write <scratch_dir>/iter-N/verdict.md:
# Verdict: Iteration N
Result: [BETTER / WORSE / MIXED]
Confidence: [obvious / marginal / unclear]
Evidence: [1-2 lines from comparison]
Keep: [what to preserve from this iteration]
Revert: [what to undo if anything]Update loop.md:
Close when any of these are true:
Write <scratch_dir>/summary.md:
# Loop Summary: [description]
## Result
Started: [date]
Iterations: [N]
Best: [iter-N]
Status: [closed — quality met / closed — diminishing returns / closed — user stopped]
## What worked
- [Changes that improved output, with evidence]
## What didn't work
- [Changes that didn't help or made things worse]
## Final state
Run command: [the command with all improvements applied]
Output quality: [assessment against the original quality signal]
## If reopening later
Read iter-[best]/output.md for the current best.
The key changes that got us here: [1-2 sentences].
The remaining weakness: [if any].These are non-negotiable — they're the entire point of using a scratch directory:
Never paste full outputs into the conversation. They live on disk. Subagents read them from disk. The main conversation sees only summaries.
Never hold more than one iteration's hypothesis + verdict in conversation. If you need to reference earlier iterations, re-read loop.md — it has the condensed history.
Subagents are stateless. Each subagent gets pointed at specific files on disk. They don't inherit conversation context. This is a feature — it prevents context buildup.
loop.md is the resumption point. If the conversation compacts or a new session starts, loop.md + the iteration folders contain everything needed to continue.
The user sees summaries, not data. After each phase, report to the user in 2-3 lines: what happened, what the verdict was, what's next. They can dig into the scratch directory if they want details.
© deepklarity, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/hk-refine of deepklarity/harness-kit.
Open the folder on GitHubat commit 87305cd
Hk Refine next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Hk Refine this skilldeepklarity/harness-kit | 100 | — | ~2.4k | Automated safety check: Notes | MIT | |
| Vercel Composition Patternssupabase/supabase | 111k | 58 repos | ~726 | Automated safety check: Pass | MIT | |
| Finishing a Development Branchobra/superpowers | 297k | 5 repos | ~1.9k | Automated safety check: Pass | MIT | |
| Typescript Advanced Typesrolling-scopes/rsschool-app | 10k | 25 repos | ~4.2k | Automated safety check: Pass | MPL-2.0 | |
| PR Babysitteropeninterpreter/openinterpreter | 69k | 3 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Code Review ChecklistshareAI-lab/learn-claude-code | 78k | 4 repos | ~1.1k | Automated safety check: Pass | MIT |
supabase/supabase
React composition patterns that scale. An agent skill from supabase/supabase.
obra/superpowers
Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.
rolling-scopes/rsschool-app
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.
openinterpreter/openinterpreter
Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.
shareAI-lab/learn-claude-code
Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.
onyx-dot-app/onyx
Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.
deepklarity/harness-kit
Create new skills, modify and improve existing skills, and measure skill performance.
deepklarity/harness-kit
Run comprehensive agent-native architecture review with scored principles.
deepklarity/harness-kit
Mock-first, layer-by-layer feature development. An agent skill from deepklarity/harness-kit.
deepklarity/harness-kit
Audit whether an AI agent can autonomously close the loop on problems in a given area — from discovering a symptom to verifying a fix — without human intervention.
deepklarity/harness-kit
Traces a workflow end-to-end through the harness-kit monorepo and creates a breadcrumb analysis doc in docs/breadcrumbanalysis/.
deepklarity/harness-kit
Generate changelog entries from git diffs, prepend to CHANGELOG.md, and optionally commit + PR.
Categories
Iteratively improve any output by running a structured observe-hypothesize-change-rerun loop. Hk Refine is an agent skill from deepklarity/harness-kit. Iteratively improve any output by running a structured observe-hypothesize-change-rerun loop.
Hk Refine fits situations like: an output (reflection; pipeline result) isnt good enough and needs systematic refinement; : close the loop; this output isnt good enough.
Run `npx skills add deepklarity/harness-kit --skill hk-refine -a claude-code`. Or copy the skill folder (.claude/skills/hk-refine in deepklarity/harness-kit) into .claude/skills/hk-refine in your project. Claude Code loads it when a task matches its description.
Run `npx skills add deepklarity/harness-kit --skill hk-refine -a codex`. Or copy the skill folder (.claude/skills/hk-refine in deepklarity/harness-kit) into .agents/skills/hk-refine in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add deepklarity/harness-kit --skill hk-refine -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hk-refine, .gemini/skills/hk-refine, .github/skills/hk-refine and .opencode/skills/hk-refine in your project.
SKILL.md names no scripts, command-line tools or credentials: Hk Refine is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Bash, Read, Edit, Write, Task, Grep, Glob.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Hk Refine is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Hk Refine: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
deepklarity (a GitHub organization) maintains it in deepklarity/harness-kit, which has 100 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on July 15, 2026.
Source: deepklarity/harness-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.