All skills
simota avatar
by shingo imotasimota/agent-skills85 stars
15

Refactoring code: variable naming, function extraction, magic number constants, dead code removal. Does not change behavior. Not for bugs/security (Judge), tests (Radar), or features (Builder).

Use this Skill: https://skilld.dev/gh/simota/agent-skills/zen

This session only. Nothing lands on disk.

referenceguard-clauses.md

≈315 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Guard Clause Delta

Purpose: Zen semantic-preservation contract for flattening nested control flow. Guard-clause syntax is model-known.

Transformation Rules

  • Invert only conditions whose early exit is behaviorally equivalent.
  • Preserve condition evaluation order, short-circuiting, exceptions, logging, mutations, and resource cleanup.
  • Keep validation guards separate from side-effecting work.
  • Use language-native propagation (?, defer, try/finally, typed narrowing) without changing error shape.
  • Prefer a linear happy path, but extract a predicate or responsibility when guard lists become another form of complexity.

Guard clauses generally reduce nesting/cognitive complexity, not cyclomatic branch count. Report the metric that actually changed.

Verification

  • Existing focused tests pass unchanged.
  • Every input returns or throws the same externally observable result.
  • Error precedence remains the same when multiple preconditions fail.
  • Cleanup and transaction boundaries still execute.
  • Type narrowing and nullability behavior remain sound.

If repeated guard preambles reveal cross-cutting policy, propose a named validation boundary; route architecture changes to Atlas rather than introducing middleware implicitly.

Source: SKILL.md on GitHub

1 warning13d5 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    No security issues detected. The skill provides comprehensive and well-structured instructions for code refactoring and quality review. It utilizes standard developer tools, references reputable technical documentation from trusted organizations, and includes explicit safety boundaries to ensure behavior-preserving changes.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

  • Runlayer6mo

    1/15 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at e307415. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 weeks ago

README badge

README badge for simota/agent-skills/zen