spaghetti-code-detection

Trigger: spaghetti code, temporal coupling, hidden side effects. Detect hard-to-follow flow and hidden ordering constraints.

SKILL.md

GitHub

Activation Contract

Load this skill when reviewing refactor plans for: spaghetti code, temporal coupling, hidden side effects.

Hard Rules

  • Flag tangled branches, implicit execution order, hidden side effects, and temporal coupling.
  • Recommend guard clauses, Split Phase, Extract Method, or explicit state transitions.
  • Never recommend a Big Bang rewrite.
  • Preserve observable behavior; label functional changes as follow-up.
  • Require evidence for every recommendation, or mark it as a hypothesis.

Decision Gates

Signal Action
Concrete evidence exists Create a finding with file, lines, symbol, benefit, validation, and rollback.
Evidence is incomplete Mark as hypothesis and lower confidence.
Recommendation is cosmetic or speculative Omit it unless maintainability benefit is clear.

Execution Steps

  1. Inspect the target and nearby tests only as needed for this lens.
  2. Identify findings that match this skill's responsibility.
  3. Recommend the smallest safe behavior-preserving refactor.
  4. Add validation and rollback steps for each recommendation.

Output Contract

Return structured findings for the calling reviewer. Return no_findings when this lens has no material issue.

References

None.