Agent skill

Code Solving

by HoangTheQuyen in HoangTheQuyen/think-better

Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates.

MITAuto-check passedTesting & QA

Install Code Solving

skills CLI
$ npx skills add HoangTheQuyen/think-better --skill code-solving -a claude-code

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

GitHub CLI
$ gh skill install HoangTheQuyen/think-better code-solving --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/HoangTheQuyen/think-better.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/code-solving .claude/skills/code-solving && 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-solving
GitHub stars
122
Token cost
~3.7k tokens
SKILL.md length
1,874 words
Files
17 (incl. scripts)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates.

  • Works in 6 steps: Classify the Task → Generate the Plan (REQUIRED) → Work the Steps, Gate by Gate → …
  • User says fix this bug
  • SKILL.md covers Prerequisites, Running the Scripts, How to Use This Workflow and When to Use the Other Skills, plus 3 more sections
  • Runs Python scripts from its folder; calls python3 and python

What it does

Code Solving is an agent skill from HoangTheQuyen/think-better. Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates. Use when user says "fix this bug", "debug this", "exception", "stack trace", "crash", "the code is not working", "add a feature", "refactor", "clean up this code", "the code is slow", "memory leak", "flaky test", "CI is failing", "production is down", "upgrade the dependency", "migrate", "review my code", "write tests", "fix the error", "add a…

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 18 other files, including scripts (for example `PROMPT.md`, `scripts/advisor.py` and `scripts/context.py`).

It sits in Testing & QA, covering Debugging, Failing and flaky tests and Code review. It works with Python. The repository describes itself as: The Operating System for Clear Thinking & Better Decisions. The licence is MIT.

When your agent uses it

  • User says fix this bug
  • The code is not working
  • Clean up this code
  • The code is slow

Example prompts

  • “fix this bug”
  • “debug this”
  • “exception”
  • “/code-solving”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Classify the Task
  2. Generate the Plan (REQUIRED)
  3. Work the Steps, Gate by Gate
  4. Deep-Dive Searches
  5. Save a Workspace (optional)
  6. Resume Later

What it can do on your machine

Read from SKILL.md and the folder at commit dd112f4. 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

    Ships 5 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • python

    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 Solving loads about 3.7k tokens when it runs. Until then it costs about 222 tokens; SKILL.md has 1,874 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from HoangTheQuyen/think-better at commit dd112f4, republished under its MIT licence (© HoangTheQuyen). 1,874 words, ~3,710 tokens.

Download SKILL.mdSave it as .claude/skills/code-solving/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
code-solving
description
Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates. Use when user says "fix this bug", "debug this", "exception", "stack trace", "crash", "the code is not working", "add a feature", "refactor", "clean up this code", "the code is slow", "memory leak", "flaky test", "CI is failing", "production is down", "upgrade the dependency", "migrate", "review my code", "write tests", "fix the error", "add a new feature", "make it faster", "upgrade the library". Trivial edits (a typo, a rename, a one-line change with an obvious result) do not need this process; just make the change. Do NOT use for problems outside the code (business, product, process; use problem-solving-pro) or for weighing alternatives such as two designs or libraries (use make-decision).

Goal

Make code changes the way a careful senior engineer does: define done before coding, map the change, work in small verified steps, and prove the result with evidence instead of claiming it.

code-solving

A 7-step method (Define → Decompose → Prioritize → Plan → Execute → Verify → Communicate) applied to 12 task types: debug, feature, refactor, performance, flaky-test, incident, migration, review, test, explain, security and quick-fix. Every step has a gate: a concrete piece of evidence that must exist before moving on. The knowledge base has 149 records: debugging techniques, change techniques (feature flags, expand-contract, strangler fig…), testing strategies, design principles, engineering biases, a review checklist, hand-off templates and 44 common error messages across languages with their likely causes. The script also detects the project's own test, lint and build commands.

Prerequisites

Detect the Python command first: python3 --version 2>/dev/null || python --version. Use whichever works (python on most Windows machines) in every command below. The scripts use only the standard library. If neither works, tell the user that Python 3.9+ is needed and ask before installing anything; do not install it yourself.


Running the Scripts

Run every command from the project root with the path shown, e.g. python3 .agents/skills/code-solving/scripts/search.py ... (the installer adjusts this path for your AI tool). Saved plans are written to the project, never inside the skill folder. Saving again never overwrites files that already exist (they hold your notes); add --force to replace them.

Passing the user's text

When the query is the user's own words (a request, an error message, a pasted log), pass it on stdin with --stdin instead of quoting it, so quotes, backticks and $ never reach the shell. Every example below does this.

Use exactly this delimiter, THINK_BETTER_EOF_7f3a, quoted as shown:

bash
python3 .agents/skills/code-solving/scripts/search.py --stdin --plan <<'THINK_BETTER_EOF_7f3a'
<the user's text, unchanged>
THINK_BETTER_EOF_7f3a

Check the text first. The heredoc ends at the first line that is exactly THINK_BETTER_EOF_7f3a; anything after it would run as shell commands. If a line of the user's text is exactly that delimiter, do not use the heredoc: write the text unchanged to a temporary file with your file-editing tool (not the shell), run python3 .agents/skills/code-solving/scripts/search.py --stdin --plan < <file>, then delete the file.

In PowerShell (keep '@ at the start of its line):

powershell
$OutputEncoding = [Text.UTF8Encoding]::new()
@'
<the user's text, unchanged>
'@ | python .agents/skills/code-solving/scripts/search.py --stdin --plan

The here-string ends at a line that starts with '@. If a line of the user's text starts with '@, write the text to a file instead and run Get-Content -Raw -Encoding UTF8 <file> | python .agents/skills/code-solving/scripts/search.py --stdin --plan.


How to Use This Workflow

Language: Respond in English. The scripts' output is in English: show it as it is, and keep commands, flags, file names and option names exactly as written.

If the user has not said what they want done, ask before running anything. Trivial edits (a typo, a rename, a one-line change with an obvious result) do not need the plan: make the change and show the check that proves it.

Step 1: Classify the Task

Pick the type yourself; you understand the request better than keyword matching.

TypeUse when
debugWrong result, error, exception or crash with an unknown cause
featureAdding behavior that does not exist yet
refactorChanging structure without changing behavior
performanceToo slow, too much memory, does not scale
flaky-testA test or CI job fails sometimes or only in CI
incidentProduction is broken and users are affected now
migrationUpgrading a dependency or moving code/data to another system or version
reviewAssessing a change for defects and risks
testWriting tests for existing code or raising coverage
explainUnderstanding how existing code works, without changing it
securityFixing a vulnerability, an injection, a leaked secret or a vulnerable dependency
quick-fixA few-line change with an obvious result (typo, text, config value); the plan keeps only Define, Execute, Verify and Communicate
Step 2: Generate the Plan (REQUIRED)
bash
python3 .agents/skills/code-solving/scripts/search.py --stdin --plan --type <type> -f markdown <<'THINK_BETTER_EOF_7f3a'
<the user's request, unchanged>
THINK_BETTER_EOF_7f3a

If the user asked to save the work ("save", "step-by-step", "workspace"), run the Step 5 command instead of this one: it prints the same plan.

Omit --type to auto-detect (the plan says when it is unsure). The plan contains the 7 steps with task-specific guidance and gates, the project's own check commands, techniques, testing strategy, design principles, bias warnings, a review checklist and the hand-off template.

The plan opens with Context from the project: facts the script found in the code and git, so Step 2 starts from them instead of a blank search. Pass the user's full error output and stack trace in the request; the script reads it.

ContextFound from
Where the error pointsStack-trace and compiler-error frames (Python, JS/TS, Go, Java/Kotlin, C#, Rust, …) resolved to project files, with the source line; library frames are dropped
Files and symbolsFile names and identifiers in the request: where each symbol is defined and how many files mention it
Recent commitsThe last commits touching those files (regressions usually start there)
Working treeBranch and uncommitted changes
Diff (reviews)Changed files with line counts, and the review areas they touch (security, data safety, API compatibility, concurrency, error handling, performance, observability, missing tests); those areas go first in the review checklist

Reviews include the diff automatically: uncommitted changes if there are any, else the branch against the default branch, else the last commit. Name a base with --diff <base> (a branch, tag or commit). Skip all lookups with --no-context. To see only the context, run --stdin --context with the user's text in the same heredoc.

Treat the context as leads to verify, not conclusions: read the code at each location before relying on it.

When the request contains a known error message (for example Cannot read properties of undefined, nil pointer dereference, ModuleNotFoundError), the plan adds a Known error section with its meaning, likely causes, what to check first and the root-cause fix. The likely causes pre-fill the hypothesis log of a saved workspace.

Depth: --depth quick (Define, Execute, Verify only), standard (default), deep (pitfalls per step, extra techniques, full review checklist), executive (deep plus a stakeholder summary).

To see only the project's commands: python3 .agents/skills/code-solving/scripts/search.py --detect

Step 3: Work the Steps, Gate by Gate

Go through the steps in order and keep the user informed in short updates. For each step:

  1. Do the step using the task-specific guidance in the plan.
  2. Produce the gate's evidence for real: run the repro, run the tests, read the code.
  3. Show the evidence briefly (the command and the relevant output lines), then move on.
StepGate (evidence required)
1. DefineA check that fails today: failing test, repro command, benchmark baseline or acceptance criteria
2. DecomposeChange map: files and functions involved and their callers
3. PrioritizeOrdered work list; the first slice can be finished and verified alone
4. PlanEach task has a proving test or check and a rollback
5. ExecuteSmall steps, each ending green; a log of hypotheses or progress
6. VerifyThe Step 1 check passes; the project's checks are green; review checklist done
7. CommunicateHand-off artifact (PR description, postmortem, design doc or review report)

Never claim a gate is met without having produced its evidence in this session. If a command cannot run (missing tool, no network, no test suite), say so plainly and say what you did instead.

For small tasks, keep the steps light, but do not drop Define and Verify.

Show full SKILL.md (673 more words)Show less
Step 4: Deep-Dive Searches
bash
python3 .agents/skills/code-solving/scripts/search.py --stdin --domain <domain> <<'THINK_BETTER_EOF_7f3a'
<keywords>
THINK_BETTER_EOF_7f3a
DomainContents
debuggingRead the error, minimal repro, recent changes, git bisect, divide and conquer, hypothesis log, tracing, differential diagnosis, stress and repeat, profiling, read the tests…
changesThin vertical slice, spike, feature flag, preparatory refactoring, Mikado, seams, expand-contract, strangler fig, branch by abstraction, codemods, dependency upgrade for a vulnerability
testingRegression test first, TDD, acceptance tests, characterization, property-based, contract, snapshot, benchmark, hermetic tests, test pyramid, mutation testing, coverage gap analysis
principlesKISS, YAGNI, DRY (rule of three), SRP, separation of concerns, dependency direction, fail fast, validate at the boundary, least privilege…
biasesAnchoring, confirmation bias, streetlight effect, works on my machine, premature optimization, rewrite fallacy, coverage theater, illusion of understanding…
reviewCorrectness, edge cases, error handling, security, concurrency, performance, data safety, API compatibility, tests, readability, observability
artifactsPR description, commit message, ADR, postmortem, design doc, bug report, review report, status update, code explanation, security fix note
errors44 common error messages (JS/TS, Python, Go, Java, C#, Rust, SQL, infrastructure): meaning, likely causes, first checks, fix
steps, task-typesThe method itself
Step 5: Save a Workspace (optional)

When the user asks to save or work step by step ("save", "step-by-step", "workspace"), run this instead of the Step 2 command, not after it:

bash
python3 .agents/skills/code-solving/scripts/search.py --stdin --plan --type <type> --persist --step-docs -p "<short-name>" -f markdown <<'THINK_BETTER_EOF_7f3a'
<the user's request, unchanged>
THINK_BETTER_EOF_7f3a

This creates coding-plans/<short-name>/ with 00-OVERVIEW.md, 01-DEFINE.md, 02-CHANGE-MAP.md, 03-PLAN.md, 04-LOG.md, 05-VERIFY.md and the hand-off file. Fill them in as you work, and tick each gate once its evidence is in the file:

bash
python3 .agents/skills/code-solving/scripts/search.py --done <step> -p "<short-name>"   # 1-7 or define, decompose, ...
Step 6: Resume Later

A saved workspace is how work continues in a new session (/code.resume):

bash
python3 .agents/skills/code-solving/scripts/search.py --stdin --status [-p "<short-name>"] <<'THINK_BETTER_EOF_7f3a'
<the user's text, or nothing>
THINK_BETTER_EOF_7f3a

It shows each step's file, whether it was filled in and whether its gate is ticked, then the next step with its guidance and gate. Without -p, it picks the workspace whose name or request matches the text given on stdin, else the most recently changed one. Read the files of finished steps before continuing, re-run the Step 1 check, and never tick a gate whose evidence you did not produce. --undone <step> reopens a gate.


When to Use the Other Skills

  • Two or more designs with real trade-offs (library, database, architecture): use make-decision (/decide) and record the choice as an ADR.
  • The root problem is not in the code (process, product, business metrics): use problem-solving-pro (/solve).

Key Principles

  1. Define done before writing code: a check that fails today and must pass when done.
  2. Read before you change: trace the real call path; do not guess structure from names.
  3. Small steps, always green: one change, run the checks, commit.
  4. Root cause, not symptom: a fix without a failing test first is a guess.
  5. Measure, don't assume: for performance, profiles and numbers decide.
  6. Evidence over claims: every "done" and "passes" is backed by output you ran.
  7. Reversible first: flags, expand-contract and rollbacks before irreversible steps.
  8. Hand it over cleanly: outcome first, evidence, risks, rollback.

Constraints

  • Always run Step 2 (--plan) before starting work on a non-trivial task; trivial edits (typo, rename, one-line change) skip it.
  • Do not skip, disable or weaken tests to get green; do not swallow errors to make symptoms disappear.
  • Do not mix refactoring with behavior changes in one step.
  • Ask the user when expected behavior or acceptance criteria are unclear, instead of guessing.

Error Handling

If a command fails (an Error: or usage: message, or a non-zero exit), show the error to the user. If it names an input you chose (a flag value, scores, a workspace name), fix that and re-run; otherwise stop. Never present a plan the script did not produce.

If Python is missing and the user does not want to install it, you may apply the method manually, saying clearly that the script did not run: classify the task with the table above, walk the 7 steps with the gates from the Step 3 table, find the project's test command (README, CI config, package.json, Makefile), and finish with a PR description that leads with the outcome and lists the checks you ran. The knowledge base is in English; translate the user's key terms before searching.

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

Files

SKILL.md and 16 other files (scripts) in .agents/skills/code-solving of HoangTheQuyen/think-better.

  • SKILL.md
  • PROMPT.md
  • data/artifacts.csv
  • data/biases.csv
  • data/changes.csv
  • data/debugging.csv
  • data/errors.csv
  • data/principles.csv
  • data/review-checklist.csv
  • data/steps.csv
  • data/task-types.csv
  • data/testing.csv
  • scripts/advisor.py
  • scripts/context.py
  • scripts/core.py
  • scripts/search.py
  • scripts/workspace.py

Open the folder on GitHubat commit dd112f4

Compare with similar skills

Code Solving 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 Solving compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Solving this skillHoangTheQuyen/think-better122—~3.7kAutomated safety check: PassMIT
Devnpc-live/clawfirm156—~642Automated safety check: PassNone
RustPython Test Failure InvestigationRustPython/RustPython22k—~467Automated safety check: PassMIT
Test BlindspotsNeeeophytee/finding-unknowns-skills343—~676Automated safety check: PassMIT
Crap Analyzerswingerman/engineer154—~1.2kAutomated safety check: PassMIT
Offloadimbue-ai/offload125—~3.1kAutomated safety check: PassMIT

Similar skills

  • Dev

    npc-live/clawfirm

    Software development workflow dispatcher. An agent skill from npc-live/clawfirm.

    156 GitHub stars~642 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Investigates a failing RustPython test by comparing it with CPython, then either fixes it or gathers the details for an incompatibility report.

    22k GitHub stars~467 tokensUpdated today
    Testing & QAAuto-check passed
  • Test Blindspots

    Neeeophytee/finding-unknowns-skills

    Find consequential behavior that a passing test suite does not establish, using focused exploratory checks.

    343 GitHub stars~676 tokensUpdated 11 days ago
    Testing & QAAuto-check passed
  • Crap Analyzer

    swingerman/engineer

    A skill your agent uses to produce a risk-based refactor + test plan for recently-changed code on a diff/branch/PR by computing CRAP (complexity × untested) on changed methods.

    154 GitHub stars~1.2k tokensUpdated 16 days ago
    Testing & QAAuto-check passed
  • Offload

    imbue-ai/offload

    Activate when you see offload.toml in a repo, offload referenced in build targets (justfile, Makefile, scripts), or when you need to run a large test suite in parallel.

    125 GitHub stars~3.1k tokensUpdated 13 days ago
    Testing & QAAuto-check passed
  • Fix The Class

    joetawil7/first-pass

    Bug-fix routine that fixes the whole class of bug, not just the reported instance.

    92 GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed

More from HoangTheQuyen/think-better

  • Make Decision

    HoangTheQuyen/think-better

    AI-powered decision-making framework: 10+ methodologies, cognitive bias detection, weighted scoring with sensitivity analysis, career, personal & business decisions.

    122 GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Problem Solving Pro

    HoangTheQuyen/think-better

    Systematic problem-solving toolkit for business, product, process and personal problems: root cause analysis, hypothesis testing, critical thinking frameworks.

    122 GitHub stars~4.5k tokensUpdated today
    Auto-check passed

Works with

Questions about Code Solving

What does Code Solving do?

Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates. Code Solving is an agent skill from HoangTheQuyen/think-better. Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates.

When should I use Code Solving?

Code Solving fits situations like: user says fix this bug; the code is not working; clean up this code; the code is slow.

How do I install Code Solving in Claude Code?

Run `npx skills add HoangTheQuyen/think-better --skill code-solving -a claude-code`. Or copy the skill folder (.agents/skills/code-solving in HoangTheQuyen/think-better) into .claude/skills/code-solving in your project. Claude Code loads it when a task matches its description.

How do I install Code Solving in Codex?

Run `npx skills add HoangTheQuyen/think-better --skill code-solving -a codex`. Or copy the skill folder (.agents/skills/code-solving in HoangTheQuyen/think-better) into .agents/skills/code-solving in your project. Codex loads it when a task matches its description.

Can I use Code Solving 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 HoangTheQuyen/think-better --skill code-solving -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-solving, .gemini/skills/code-solving, .github/skills/code-solving and .opencode/skills/code-solving in your project.

What does Code Solving need to run?

Going by SKILL.md and its folder, Code Solving needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and python). Our summary lists: Python 3.

Does Code Solving 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 Solving 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Code Solving use?

Code Solving 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 Solving use?

About 3.7k tokens (SKILL.md is roughly 15k 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 Solving?

Skills that share tags, products or a category with Code Solving: Dev (npc-live/clawfirm, 156 stars), RustPython Test Failure Investigation (RustPython/RustPython, 22k stars), Test Blindspots (Neeeophytee/finding-unknowns-skills, 343 stars) and Crap Analyzer (swingerman/engineer, 154 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Solving?

HoangTheQuyen (a GitHub user) maintains it in HoangTheQuyen/think-better, which has 122 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 9, 2026.

Source: HoangTheQuyen/think-better on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.