agentsclimarketplace

Hardening code paths

Skill narumiruna/skills/skills/workflow-repository/hardening-code-paths

Install
npx -y skills add narumiruna/skills --skill hardening-code-paths

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when asked to proactively harden a specific code path by finding and fixing plausible edge-case, boundary, failure-mode, or lifecycle bugs, or when a concrete bug fix suggests nearby same-pattern regression risks.

SKILL.md

3.4 KB, as published. Nobody here has run it

Hardening Code Paths

Actively inspect the relevant code path, confirm plausible edge-case and failure-mode bugs, and fix or harden them. Do not wait for the user to enumerate cases.

Default Scope

When the user does not provide files, a commit, or a diff, inspect git status --short and start with relevant staged, unstaged, and untracked paths. For a branch or pull request, determine its target from repository or PR context and include paths from the merge-base diff, such as git diff --name-only <target>...HEAD; do not assume the target is main or master. If no changed path applies, inspect the files implied by the request; if no scope can be inferred, ask for one target.

Loop

  1. Infer intended behavior from the user request, code, tests, docs, and sibling flows; state assumptions, but only ask when the rule is ambiguous.
  2. Trace the real flow end to end, including callers, sibling routes, cleanup paths, stored state, and representation changes.
  3. Load the edge-case checklist and select only domains reachable in this flow.
  4. Build a bounded risk matrix across the few dimensions most likely to interact: representative inputs, operations, before/during/after states, lifecycle events, and representations. Prioritize security, data loss, corruption, hangs, and broken core behavior; avoid exhaustive Cartesian products and unsupported platform speculation.
  5. Establish that each candidate violates intended behavior, then add the smallest regression test or executable check that fails before the fix when practical. If the failure cannot be verified, report the risk as unverified instead of changing behavior.
  6. Fix or harden each confirmed bug at the shared root path, not only the reported symptom.
  7. Run the narrow check, then scan sibling callers/routes for the same pattern.
  8. Perform one fresh pass over the resulting diff for opposite bounds, equivalent encodings, stale or cancelled state at asynchronous boundaries, cleanup, and whether the regression test would fail if the bug returned.
  9. Repeat only while the fix exposes a concrete adjacent case in the same failure class; stop before materially different behavior or scope.
  10. Run the repo's normal verification gate before final response.

Fix Rules

  • Prefer one guard or normalization in the shared boundary over repeated caller patches.
  • Preserve existing contracts unless the task explicitly changes them.
  • If retained state is introduced, add the minimal eviction or cleanup path.
  • If a timeout or cancellation can fire, close or clear the resource too.
  • If input crosses a trust boundary, validate type and shape before use.
  • If a package/config points to code, prove the referenced file exists in the packaged/runtime form.
  • Keep the sibling scan bounded to the same root cause and directly affected flow. Stop and report when the next candidate requires a new behavior decision or material scope expansion.
  • Stop when checks pass and the sibling scan finds no same-pattern bug; report fixed cases, checks run, and any unverified risk plainly.
  • Do not return only a checklist or plan unless the user explicitly asks for one.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.