Cfn dry review

From masharratt/claude-flow-novice · View interactive version

Cfn dry review is an AI agent skill from the GitHub repository masharratt/claude-flow-novice. MUST BE USED before merging any PR that adds 3+ new functions or 50+ lines. Run after implementation. Reviews code for DRY violations, modularity, resumable pipeline opportunities. Outputs JSON manifest for cfn-vote-implement.

How to use this skill

Skill file

CFN DRY Review

Purpose: Systematically review code for DRY violations, modularity improvements, and resumable pipeline opportunities. Produces a structured manifest that feeds into cfn-vote-implement for 3-agent voting.

Inputs

Outputs

Manifest Schema

{
  "review_id": "dry-review-<timestamp>",
  "scope": "git diff main | src/services/",
  "generated_at": "ISO-8601",
  "suggestions": [
    {
      "id": "S001",
      "category": "dry | modularity | resumable",
      "tag": "delete | stdlib | native | yagni | shrink",
      "one_liner": "L12-38: stdlib: 27-line validator class. \"@\" check is 1 line; real validation is the confirmation mail.",
      "title": "Short description",
      "description": "What the problem is and why it matters",
      "files": ["path/to/file.ts:42", "path/to/other.ts:17"],
      "impact": "high | medium | low",
      "effort": "high | medium | low",
      "suggested_approach": "Brief description of the fix",
      "related_suggestions": ["S003"]
    }
  ]
}

Categories

| Category | What to look for |

|----------|-----------------|

| dry | Duplicated logic, copy-pasted blocks, repeated patterns across files, string literals that should be constants |

| modularity | God functions/files, mixed concerns, missing abstractions at natural boundaries, tight coupling between modules |

| resumable | Pipelines that lose progress on failure, missing checkpoints, non-idempotent operations, batch processes without resume capability |

Suggestion Tags & Grammar

Every suggestion carries one tag (orthogonal to category — it sharpens the fix) and a one-line one_liner in imperative form:

L<line>: <tag> <what>. <replacement>. (use <file>:L<line>: ... for multi-file diffs)

| Tag | Means |

|-----|-------|

| delete | Dead code, unused flexibility, speculative feature. Replacement: nothing. |

| stdlib | Hand-rolled thing the standard library ships. Name the function. |

| native | Dependency or code doing what the platform/DB/framework already does. Name the feature. |

| yagni | Abstraction with one implementation, config nobody sets, a layer with one caller. |

| shrink | Same logic, fewer lines. Show the shorter form. |

Imperative, not Socratic:

End the stdout summary with one metric: net: -<N> lines possible. (or Lean already. Ship. if nothing to cut).

Scope Lock

This review covers minimalism ONLY: DRY, modularity, resumable, over-engineering. Correctness bugs, security holes, and performance are explicitly OUT of scope — route those to /code-review. Do not mix axes; the scope lock is what keeps findings terse and the manifest focused.

Usage

# Review changed files (default)
/cfn-dry-review

# Review a specific directory
/cfn-dry-review src/services/

# Review only DRY violations
/cfn-dry-review --category=dry

# Review changes since a specific branch
/cfn-dry-review --diff=feature-branch

Integration

Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.