スキル一覧に戻る
mcart13

code-simplifier

by mcart13

0🍴 0📅 2026年1月16日
GitHubで見るManusで実行

SKILL.md


name: code-simplifier description: Simplify and refactor code while preserving behavior. Use when the user asks to simplify, refactor, reduce complexity, remove duplication, flatten control flow, or make logic easier to read/maintain without changing behavior.

Code Simplifier

Overview

Simplify existing code by reducing duplication, flattening control flow, and clarifying intent while preserving behavior, audit posture, and tenant isolation.

Workflow

  1. Confirm scope and invariants.

    • State explicitly that behavior must remain unchanged.
    • List any hard constraints (audit logs, RLS, immutability, error semantics, timeouts/retries).
    • If behavior might change, pause and ask for confirmation.
  2. Map the current flow.

    • Identify the smallest unit to simplify (function, module, handler).
    • Note duplicated blocks, deep nesting, repeated validations, or inconsistent error handling.
  3. Choose minimal, safe transformations.

    • Prefer guard clauses over nested branches.
    • Extract shared logic into helpers with clear names.
    • Consolidate repeated error mapping or validation.
    • Replace ad-hoc flags with enum-style state where it improves clarity.
    • Reduce parameter surface by grouping related inputs into typed objects.
  4. Implement incrementally.

    • Keep edits tight; avoid touching unrelated code.
    • Preserve logs/metrics/audit trails and their fields.
    • Preserve request/trace/account propagation.
  5. Verify and summarize.

    • Run the smallest relevant checks (typecheck/tests) if feasible.
    • Summarize behavior invariants and what changed structurally.

Safety Guardrails

  • Do NOT change public API shapes, database schema, or message contracts.
  • Do NOT alter compliance-relevant behaviors (evidence signing, retention, policy gates) without explicit approval.
  • Preserve error types, error codes, and retry semantics.
  • Preserve ordering where it affects side effects (DB writes, message publishes, S3 writes).
  • If the simplification crosses regulated workflows, flag it and ask for direction before proceeding.

Common Simplification Patterns

  • Guard clauses: invert conditionals to reduce nesting depth.
  • Shared core: extract common body from near-identical branches.
  • Normalize inputs: convert to a single internal shape early, then branch by type.
  • Error handling: centralize mapping to avoid drift.
  • Resource handling: wrap open/close logic in a helper to avoid leaks.

When to Ask a Clarifying Question

  • Ambiguous intent or unclear behavior guarantees.
  • Missing tests in a risk-sensitive area.
  • Potential concurrency or ordering impact.
  • Any regulated workflow or audit-critical path.

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です