Skip to content
Skill Authoring
Skill

/simplify-and-harden

Post-completion self-review for coding agents that runs simplify, harden, re-verification, and micro-documentation passes on non-trivial code or high-impact configuration changes. Use when a task is complete in a general agent session and you want a bounded quality and security

From plugin
pskoett-ai-skills
33622 skills

Claude Code

$ npx -y skills add pskoett/pskoett-ai-skills --skill simplify-and-harden --agent claude-code

SKILL.md

simplify-and-harden.SKILL.md
name: simplify-and-harden
description: "Post-completion self-review for coding agents that runs simplify, harden, re-verification, and micro-documentation passes on non-trivial code or high-impact configuration changes. Use when a task is complete in a general agent session and you want a bounded quality and security sweep before signaling done. For CI pipeline execution, use simplify-and-harden-ci."

Agent Skill: Simplify & Harden

Install

gh skill install pskoett/pskoett-skills simplify-and-harden

For CI-only execution, use:

gh skill install pskoett/pskoett-skills simplify-and-harden-ci

Fallback using the Agent Skills CLI:

npx skills add pskoett/pskoett-skills/skills/simplify-and-harden
npx skills add pskoett/pskoett-skills/skills/simplify-and-harden-ci

Metadata

| Field | Value | |---------------|--------------------------------| | Skill ID | `simplify-and-harden` | | Version | 0.1.0 | | Trigger | Post-completion hook | | Author | Peter Skøtt Pedersen | | Category | Code Quality / Security | | Priority | Recommended |

Rationale and Philosophy

When a coding agent completes a task, it holds peak contextual understanding of the problem, the solution, and the tradeoffs it made along the way. This context degrades immediately -- the next task wipes the slate. Simplify & Harden exploits that peak context window to perform two focused review passes before the agent moves on.

Most agents solve the ticket and stop. This skill turns "done" into "done well."

The operating philosophy is a deliberate "fresh eyes" self-review before moving on: carefully re-read all newly written code and all existing code modified in the task, and look hard for obvious bugs, errors, confusing logic, brittle assumptions, naming issues, and missed hardening opportunities. The goal is not to expand scope or rewrite the solution -- it is to use peak context to perform a disciplined first review pass while the agent still remembers the intent behind every change.

Best Use with Independent Review

This skill is a post-completion self-pass and does not replace an independent review pass.

Recommended flow: 1. Implement the task. 2. Run Simplify & Harden to clean, harden, and document non-obvious decisions. 3. Run an independent review pass for severity-ordered findings. 4. Merge only after both passes are addressed.

If the two disagree, treat the independent review findings as the external gate and either fix or explicitly waive findings.

On-demand independent review

For larger or risky changes, use a general-purpose subagent with fresh context. No named agent preset is required. Give it the changed-file list, diff, approved plan or acceptance criteria, and relevant verification evidence. Ask it to read the scoped code directly and report findings without editing files. Restrict tools to read-only where the host supports it; otherwise state that constraint in the brief. In Copilot, request the same scoped independent review in chat.

Use the Simplify and Harden checklists below for complexity and security. Also compare every supplied requirement against the implementation: missing features, incorrect behavior, incomplete edge/error paths, API and response contracts, test coverage, and unverified acceptance criteria. Classify spec gaps as missing, incorrect, incomplete, or untested.

Require severity-ordered findings with file and line (or "not implemented"), category, concrete evidence, relevant spec reference or attack vector, and a specific fix. Keep out-of-scope observations separate and explicitly report when there are no in-scope findings. The reviewer reports; the implementing agent handles fixes under the existing approval and re-verification rules.

One reviewer can cover all relevant dimensions. Split reviews only when scope or risk justifies it, not automatically into three agents. If independent review is unavailable, report that limitation; a self-pass is not a substitute for an independent merge gate.

Trigger Conditions

The skill activates automatically when ALL of the following are true:

  • The agent has completed its primary coding task
  • The agent signals task completion (exit code 0, PR ready, or equivalent)
  • The diff contains a non-trivial code change (see definition below)
  • The skill has not already run on this task (no re-entry loops)

**Non-trivial code change definition**

Treat a diff as non-trivial when either condition is true:

1. It touches at least one executable source file (for example: `*.ts`, `*.tsx`, `*.js`, `*.jsx`, `*.py`, `*.go`, `*.rs`, `*.java`, `*.cs`, `*.rb`, `*.php`, `*.swift`, `*.kt`, `*.scala`, `*.sh`) and includes either:

  • At least 10 changed non-comment, non-whitespace lines in executable source files, OR
  • At least one high-impact logic change (auth/authz checks, input validation, data access/query logic, external command execution, file path handling, network request handling, or concurrency control).

2. It changes configuration, workflow, permissions, deployment, or security policy in a way that can alter who may act, what executes, what is deployed, or which protections apply.

Treat the diff as non-trivial = false when it is docs-only, low-impact config-only, comments-only, formatting-only, generated artifacts only, or tests-only.

The skill does NOT activate when:

  • The agent failed or was interrupted
  • The change is documentation-only
  • The change is tests-only
  • The change is a generated file (lockfiles, build artifacts)
  • The user explicitly skips it via `--no-review` or equivalent flag

Scope Constraints

**Hard rule: Only touch files modified in this task.**

The agent MUST NOT:

  • Refactor adjacent code it did not modify
  • Pursue "while I'm here" improvements outside the diff
  • Introduce new dependencies or archite
Read more
@pskoett
Ships withpskoett-ai-skills

I use this repository to build and test skills for AI agents. The skills follow the Agent Skills specification, and the repo includes an Agent Plugins 1.0 portable package.

Stars on GitHub

Momentum

stars in total
336
Star history of pskoett/pskoett-ai-skills on GitHub, a chart by star-history.com

Other skills on pskoett-ai-skills.

context-decay

context-decay

Revalidate persistent agent knowledge by classifying why it can become stale and how quickly it changes, then retain, revise,…

eval-creator

eval-creator

[Beta] Creates permanent eval cases from promoted learnings and runs regression checks against them. Turns failures into test…

More skills from other plugins.

gstack-openclaw-ceo-review

gstack-openclaw-ceo-re…

Use when asked to review a plan, challenge a proposal, run a CEO review, poke holes in an approach, think bigger about scope, or…

gstack3w138k
@garrytan@garrytanInstall Skill
book-to-skill

book-to-skill

Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Calibre) into structured agent…

@virgiliojr94@virgiliojr94Install Skill
distilly

distilly

Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…

@titanwings@titanwingsInstall Skill

Questions about simplify-and-harden.

Which coding agents can use simplify-and-harden?
simplify-and-harden installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.