ck:loop

Execute iterative optimization loops against configurable code metrics with git-based change validation.

Updated Jun 14, 2026
One-click install
npx skills add https://github.com/duy-tung/claude-code-setup --skill ck-loop-duy-tung
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ck:loop
Source: https://github.com/duy-tung/claude-code-setup/tree/main/claude/skills/ck-loop
Command: npx skills add https://github.com/duy-tung/claude-code-setup --skill ck-loop-duy-tung

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jest, jq, typescript, tsc, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of iterative optimization loops for improving measurable code metrics such as coverage, performance, and bundle size.

Core Features & Use Cases

  • Automated Iterative Optimization: Executes a loop of N iterations against a specified metric, learning from git history, and automatically keeping or discarding changes.
  • Use Case: Ideal for improving code quality by running automated tests, applying changes, and verifying improvements iteratively.
  • Features: Configurable scope, verification commands, guard checks, and noise filtering.

Quick Start

To initiate an optimization loop to increase test coverage in the 'src/utils' directory, run the following command: /ck:loop Goal: Increase test coverage in src/utils Scope: src/utils/**/*.ts Verify: npx jest --coverage --json \| jq '.coverageMap \| .. \| .s? \| to_entries \| map(.value) \| (map(select(.>0)) \| length) / length * 100' \| tail -1 Guard: npx tsc --noEmit Direction: higher

Frequently Asked Questions about ck:loop

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

FAQPage Schema
How do I automate iterative code optimization loops for improving test coverage?

Automated iterative code optimization loops execute a sequence of changes and verifications against a metric goal. You configure the optimization scope, verification commands, and guard checks to automatically keep or discard code changes.

Can I use Jest and jq to verify metric improvements during automated code optimization?

Yes, Jest and jq verify metric improvements. The verification command pipes Jest coverage JSON output into jq to calculate the coverage percentage, determining if the optimization loop keeps the changes.

What is autonomous code optimization and how does it learn from git history?

Autonomous code optimization iteratively applies changes and verifies them against a target metric. It learns from git history by keeping verified improvements and discarding changes that fail guard checks or degrade the metric.

Do I need TypeScript and tsc to run automated code quality metrics loops?

TypeScript and tsc are required dependencies for automated code quality metrics loops in TypeScript projects. You use tsc as a guard check to ensure applied changes do not introduce compilation errors during iteration.

How do I configure scope and guard checks for iterative code improvement?

Configure iterative code improvement by defining a scope for file targeting, a verify command to measure the target metric, and a guard command like tsc. Set a direction to specify whether the metric should trend higher or lower.

What are the limitations of automated code optimization loops?

Automated code optimization loops require a measurable verification command and depend on testing frameworks and version control. Effectiveness is limited by metric configuration accuracy and defined guard checks against noise.