Agent skill

Code Coherence Review

by ntorga in ntorga/agent-starter-kit

Reviews code and plans for logic coherence, correctness, and structural integrity.

MITAuto-check passed

Install Code Coherence Review

skills CLI
$ npx skills add ntorga/agent-starter-kit --skill code-coherence-review -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ntorga/agent-starter-kit code-coherence-review --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ntorga/agent-starter-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code-coherence-review .claude/skills/code-coherence-review && rm -rf skills-src

Use ~/.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/

Facts

Skill name
code-coherence-review
GitHub stars
146
Token cost
~2.8k tokens
SKILL.md length
1,440 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Reviews code and plans for logic coherence, correctness, and structural integrity.

  • Works in 7 steps: Initialize the progress file. Create… → Logic coherence. Read the work as a… → Dead code, obsolete artifacts, and… → …
  • SKILL.md covers Purpose, Procedure and Guardrails
  • Calls rg

What it does

Code Coherence Review is an agent skill from ntorga/agent-starter-kit. Reviews code and plans for logic coherence, correctness, and structural integrity.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: The scaffold for your multi-model, personalized Natural Language AI Harness (NLAH) . The licence is MIT.

Example prompts

  • “Use the code-coherence-review skill to review code and plans for logic coherence, correctness, and structural integrity”
  • “/code-coherence-review”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Initialize the progress file. Create .memory/reviews/review-coherence-.md
  2. Logic coherence. Read the work as a narrative. Trace the flow from entry point to exit. Check
  3. Dead code, obsolete artifacts, and comments. Scan every changed file for code that is no longer useful or reachable, and for comments that…
  4. Correctness. The logic is sound — now verify it survives real-world input. Walk each changed file and check
  5. Structural coherence. Step back from individual lines. Read the .context.md files for affected directories (follows…
  6. Duplication detection. Scan the changed code for logic, patterns, or methods that duplicate existing functionality in the codebase. For…
  7. Classify findings. For each finding in the progress file, verify the severity

What it can do on your machine

Read from SKILL.md and the folder at commit 851e942. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • rg

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Coherence Review loads about 2.8k tokens when it runs. Until then it costs about 26 tokens; SKILL.md has 1,440 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~26
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

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.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated 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.

SKILL.md

The full file from ntorga/agent-starter-kit at commit 851e942, republished under its MIT licence (© ntorga). 1,440 words, ~2,753 tokens.

Download SKILL.mdSave it as .claude/skills/code-coherence-review/SKILL.md (or your agent's skills folder).
name
code-coherence-review
description
Reviews code and plans for logic coherence, correctness, and structural integrity.
usedBy
reviewer
version
0.2.0
lastUpdated
2026-09-12

Purpose

A correct function that violates a naming rule ships with a warning. A rule-compliant function with broken logic cannot ship. This skill checks what matters most: does the code make sense, survive real-world input, and respect the project's boundaries? Run it first — nothing else matters until the code is coherent.

Procedure

  1. Initialize the progress file. Create .memory/reviews/review-coherence-<timestamp>.md:

    markdown
    # Coherence Review Progress
    
    ## Status
    - Last updated: <timestamp>
    - Overall: In Progress
    
    ## Phases
    - [ ] 1. Logic coherence
    - [ ] 2. Dead code, obsolete artifacts, and comments
    - [ ] 3. Correctness
    - [ ] 4. Structural coherence
    - [ ] 5. Duplication detection
    
    ## Findings
  2. Logic coherence. Read the work as a narrative. Trace the flow from entry point to exit. Check:

    • Does the algorithm solve what the task brief says it should?
    • Are there circular logic paths or infinite loops?
    • Do the data structures fit the problem, or is the code fighting its own model?
    • For plans: check for ambiguity (instructions that can be read two ways), logical gaps (steps that assume preconditions without establishing them), redundancy (duplicate steps), and contradictions.
    • For code and other non-plan artifacts: review against the task brief's acceptance criteria. Stress-test for blindspots, ambiguity, and false assumptions.

    Write any findings to the progress file under ## Findings with the heading ### Logic coherence. Mark phase 1 as [x].

  3. Dead code, obsolete artifacts, and comments. Scan every changed file for code that is no longer useful or reachable, and for comments that did not earn their place. For each file, check:

    • Unused functions and methods — functions or methods defined but never called anywhere in the codebase. Run rg -n 'func <name>' or rg -n 'def <name>' to find definitions, then verify with rg '<name>\(' that they are actually invoked elsewhere. If a function has zero callers, it is dead.
    • Unused variables and constants — variables or constants assigned but never read. Trace each assignment to its usage sites. Variables declared and initialized but never referenced in any subsequent statement are dead.
    • Unused imports — import statements for modules, packages, or symbols that are never referenced in the file. Compare every import against actual usage in the file body.
    • Unreachable code — code after return, break, continue, raise, exit, or panic statements within the same block. Code in conditional branches that can never be true (e.g., if false, if 1 == 0, or branches contradicted by earlier guards).
    • Commented-out code — commented code of any length. Version control holds old code, not inline comments; no justification preserves a commented-out block. Flag for removal.
    • Explanatory comments — comments that restate, narrate, or explain what code does. The fix is a rename, an extraction, or a type — not the comment. Do not flag a comment that explains why under an external constraint no code can express (see the Comments section in rules/code/general.md), and do not flag a comment a domain rule or tool contract mandates (shell headers, suppression justifications) — those are structure, not confession.
    • Deprecated or superseded logic — code paths replaced by newer implementations but not removed. Check for conditional branches that always take one path because a feature flag is permanent, or old implementations kept "just in case" with no callers.

    For each finding, verify it is truly dead by searching the entire codebase for references. Do not flag something as dead if it is exported/public API, used via reflection, invoked dynamically, or called from test files.

    Write any findings to the progress file under ### Dead code and comments. Mark phase 2 as [x].

  4. Correctness. The logic is sound — now verify it survives real-world input. Walk each changed file and check:

    • Error paths — every error is handled or explicitly logged. No silent swallows.
    • Boundary conditions — off-by-one, nil/null, empty collections, zero values.
    • Concurrency — shared state is protected. No data races, no unguarded async mutations.
    • N+1 queries — loops that trigger a database query per iteration instead of batching.
    • Resource leaks — unclosed connections, file handles, channels, or transactions in error paths.
    • Retry logic — missing backoff, missing idempotency keys, thundering-herd potential on failure recovery.
    • Time handling — timezone assumptions, clock skew sensitivity, missing UTC normalization.
    • Stale reads — reading state, deciding, then acting without verifying the state still holds.
    • Missing indexes — new query patterns that will table-scan at production data volumes.
    • Missing timeouts — external calls (HTTP clients, database queries, third-party APIs) without a timeout. One slow dependency without a deadline cascades into a full system hang.
    • Backward compatibility — does this change break existing consumers? Removed or renamed fields, changed response shapes, stricter validation, or altered behavior on existing endpoints break clients that depend on the previous contract.
    • Incomplete work markers — TODO, FIXME, HACK, XXX, empty function bodies, stub implementations returning hardcoded values. These are unfinished work, not code that can ship.
    • Test skip markers — t.Skip(), pytest.mark.skip, .skip(, xit(, xdescribe(, xtest(, or equivalent. Skipped tests hide regressions. If a test must be skipped, a comment must name the blocker and the condition that re-enables the test — a skipped test is a deliberate rule violation, earned under rules/code/general.md § Comments.

    Write any findings to the progress file under ### Correctness. Mark phase 3 as [x].

  5. Structural coherence. Step back from individual lines. Read the .context.md files for affected directories (follows: skills/context-maintenance/SKILL.md) to understand layer boundaries and directory purpose. Check:

    • Does the change respect those boundaries?
    • Are there new dependencies that break the dependency direction? If the project documents its architecture in an architecture skill or a dedicated architecture file, read it and verify dependencies flow in the correct direction.
    • For plans: does any proposed change introduce a dependency that flows against the architecture's grain?

    Write any findings to the progress file under ### Structural coherence. Mark phase 4 as [x].

  6. Duplication detection. Scan the changed code for logic, patterns, or methods that duplicate existing functionality in the codebase. For each changed file, check:

    • Duplicated functions or methods — functions that perform the same or nearly identical operations as existing functions. Compare the new function's logic, parameters, and return values against existing ones. Use rg to search for similar names or patterns. If two functions differ only in minor details, consolidate them.
    • Duplicated logic blocks — sequences of 5+ lines that appear in multiple places with identical or near-identical structure. Look for repeated patterns like:
      • Data transformation pipelines (filter → map → reduce)
      • Error handling and retry logic
      • Validation sequences
      • Database query patterns
      • HTTP request/response handling
      • Configuration parsing
    • Copy-pasted constants or configuration — magic numbers, strings, or configuration values that appear in multiple places instead of being defined once as a constant or configuration.
    • Reinvented utilities — new implementations of functionality that already exists in standard libraries, third-party packages, or project utilities. Before flagging, verify the existing utility covers the use case.

    For each suspected duplication:

    1. Use rg -n '<pattern>' to find all occurrences of similar logic across the codebase
    2. Compare the implementations line by line
    3. If the duplication is substantial (5+ lines) and the variations are minor, flag it as a Warning
    4. Suggest consolidation: extract to a shared function, use a parameterized approach, or point to the existing utility

    Do not flag duplication if:

    • The duplicated code is in test files and is under 20 lines (test duplication is often acceptable for clarity). If test duplication exceeds 20 lines and the tests are clearly parameterizable, flag it as a Warning.
    • The code is intentionally duplicated for performance reasons (verify with a comment earned under rules/code/general.md § Comments — a measured bottleneck is an external constraint)
    • The duplication spans different architectural layers and extracting it would create inappropriate dependencies

    Write any findings to the progress file under ### Duplication. Mark phase 5 as [x] and set Overall to Complete.

  7. Classify findings. For each finding in the progress file, verify the severity:

    • Blocker — logic incoherence, correctness bug, architectural violation, plan contradiction, dead code that is exported/public API (misleading), massive duplication (20+ lines) with no abstraction. Must be fixed.
    • Warning — minor structural concern, edge case worth considering, dead code (unused private functions/variables), unearned explanatory comments (fix is a restructure, not the comment), moderate duplication (5-19 lines). Should be addressed.
    • Note — observation or question. No action required.

    For plans, replace <file>:<line> with <phase or section name>. Each finding should already be under its phase heading. Update the format to include the check type:

    - <file>:<line> — <what is wrong and why it breaks>. (check: <logic | dead-code | comment | correctness | structural | duplication>)

    If review is interrupted, the progress file shows which phases were completed and what findings were recorded.

Show full SKILL.md (106 more words)Show less

Guardrails

  • Never skip the logic coherence step to jump to correctness. A correct implementation of broken logic is still broken.
  • Never flag style, naming, or convention issues. Those belong to the quality review skill.
  • Test issues split at the proof seam. Proof belongs to this pass: skip markers, assertions on internals instead of behavior. Style belongs to quality review: naming, table-driven shape, setup placement.
  • Never flag dead code without verifying it is truly unused across the entire codebase. Search for all references before reporting.
  • Never flag duplication without comparing the implementations line by line. Superficial similarity is not duplication — verify the logic, not just the structure.

© ntorga, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/code-coherence-review of ntorga/agent-starter-kit.

Open the folder on GitHubat commit 851e942

Compare with similar skills

Code Coherence Review 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.

Code Coherence Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Coherence Review this skillntorga/agent-starter-kit146—~2.8kAutomated safety check: PassMIT
Planning Oracle To Postgres Migration Integration Testinggithub/awesome-copilot40k1 repos~669Automated safety check: PassMIT
Review Hog Perspective Logic CorrectnessPostHog/posthog40k—~988Automated safety check: PassCustom licence
Plancodewhale-hq/Codewhale41k—~213Automated safety check: PassMIT
Structured Autonomy Plangithub/awesome-copilot40k1 repos~759Automated safety check: PassMIT
Planningn8n-io/n8n207k—~2.5kAutomated safety check: PassCustom licence

Similar skills

  • The Logic & Correctness review perspective for PostHog Review.

    40k GitHub stars~988 tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Plan

    codewhale-hq/Codewhale

    Turn a sufficiently understood task into an ordered implementation plan with dependencies and verification.

    41k GitHub stars~213 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Structured Autonomy Plan

    github/awesome-copilot

    Official

    Structured Autonomy Planning Prompt

    40k GitHub starsUsed in 1 repo~759 tokens
    Auto-check passed
  • Planning

    n8n-io/n8n

    Official

    ONLY for coordinated multi-artifact work: multiple workflows with dependencies, shared data-table schema/migration across tasks, or the user explicitly asked to review a plan first.

    207k GitHub stars~2.5k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Plan

    asgeirtj/system_prompts_leaks

    On an explicit planning request, always call readskill for this skill before answering.

    69k GitHub stars~5.1k tokensUpdated today
    DevelopmentAuto-check passed

More from ntorga/agent-starter-kit

All 21 skills in this repo
  • Agent Decision

    ntorga/agent-starter-kit

    Deterministic self-evaluation rubric for decision escalations — scored every run using the FRAME framework.

    146 GitHub stars~1.7k tokensUpdated 25 days ago
    Auto-check passed
  • Agent Memory

    ntorga/agent-starter-kit

    Long-term and session memory across sessions. An agent skill from ntorga/agent-starter-kit.

    146 GitHub stars~2.7k tokensUpdated 25 days ago
    Auto-check passed
  • Architect Design Tree

    ntorga/agent-starter-kit

    Builds the design tree for the grill — decisions mapped as nodes with dependencies, recommendations, and impact, pruned by path.

    146 GitHub stars~1.2k tokensUpdated 25 days ago
    Auto-check passed
  • Architect Impl Grounding

    ntorga/agent-starter-kit

    Grounds the grill's settled decisions in the codebase — annotates impl.md with file paths, signatures, reference files, test specs, and LOC; re-grounds the next epic after each landing.

    146 GitHub stars~944 tokensUpdated 25 days ago
    Auto-check passed
  • Boot

    ntorga/agent-starter-kit

    Session startup — gitignore, auto-update, memory, rules, context, CLI config, and greet.

    146 GitHub stars~937 tokensUpdated 25 days ago
    Auto-check passed
  • Browser Inspect

    ntorga/agent-starter-kit

    Browser inspection and interaction for verifying rendered web UI during development.

    146 GitHub stars~2k tokensUpdated 25 days ago
    Auto-check passed

Questions about Code Coherence Review

What does Code Coherence Review do?

Reviews code and plans for logic coherence, correctness, and structural integrity. Code Coherence Review is an agent skill from ntorga/agent-starter-kit. Reviews code and plans for logic coherence, correctness, and structural integrity.

How do I install Code Coherence Review in Claude Code?

Run `npx skills add ntorga/agent-starter-kit --skill code-coherence-review -a claude-code`. Or copy the skill folder (skills/code-coherence-review in ntorga/agent-starter-kit) into .claude/skills/code-coherence-review in your project. Claude Code loads it when a task matches its description.

How do I install Code Coherence Review in Codex?

Run `npx skills add ntorga/agent-starter-kit --skill code-coherence-review -a codex`. Or copy the skill folder (skills/code-coherence-review in ntorga/agent-starter-kit) into .agents/skills/code-coherence-review in your project. Codex loads it when a task matches its description.

Can I use Code Coherence Review in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ntorga/agent-starter-kit --skill code-coherence-review -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-coherence-review, .gemini/skills/code-coherence-review, .github/skills/code-coherence-review and .opencode/skills/code-coherence-review in your project.

What does Code Coherence Review need to run?

Going by SKILL.md and its folder, Code Coherence Review needs the command-line tools its instructions call (rg).

Does Code Coherence Review access the network?

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.

Is Code Coherence Review safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Coherence Review use?

Code Coherence Review is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Coherence Review use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Coherence Review?

Skills that share tags, products or a category with Code Coherence Review: Planning Oracle To Postgres Migration Integration Testing (github/awesome-copilot, 40k stars), Review Hog Perspective Logic Correctness (PostHog/posthog, 40k stars), Plan (codewhale-hq/Codewhale, 41k stars) and Structured Autonomy Plan (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Coherence Review?

ntorga (a GitHub user) maintains it in ntorga/agent-starter-kit, which has 146 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on September 12, 2026.

Source: ntorga/agent-starter-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.