Read-only design scanner. Finds abstraction, MI, and generics improvement opportunities in Eiffel libraries. Produces structured report. Use with /eiffel.design-scan command.
Read-only design scanner. Finds abstraction, MI, and generics improvement opportunities in Eiffel libraries. Produces structured report. Use with /eiffel.design-scan command.
allowed-tools
Read, Grep, Glob, Bash, Task
/eiffel.design-scan - Design Improvement Scanner
Purpose: Scan an Eiffel library to discover design improvement opportunities in three categories: missing abstractions, multiple inheritance candidates, and generics candidates. This is READ-ONLY — no source files are modified.
Usage
/eiffel.design-scan <library-path>
Example:
/eiffel.design-scan d:\prod\simple_sorter
If no path provided, ask user: "Which library? Provide the full path (e.g., d:\prod\simple_sorter)"
Features that exist in multiple classes without postconditions
Opportunity: extract to deferred ancestor WITH contracts
For each finding, record:
Category: A1/A2/A3/A4
Classes: [list]
Features: [list with line numbers]
Description: [what the abstraction would capture]
Effort: [number of features to extract]
Step 3: Detect MI Opportunities
Scan for these patterns:
M1: Missing ITERABLE
Classes with internal collections (ARRAYED_LIST, HASH_TABLE, etc.) that don't inherit ITERABLE
Should provide new_cursor for across loop compatibility
M2: Duplicated Cross-Cutting Concerns
Same utility features (logging, validation, conversion) duplicated across unrelated classes
Could be separate role-based parent
M3: Missing Standard Parents
Classes that implement < but don't inherit COMPARABLE
Classes that implement hash_code but don't inherit HASHABLE
Classes with out but could benefit from CUSTOM_OUTPUT
M4: Monolithic Classes
Large classes (>20 features) mixing distinct responsibilities
Could be decomposed into role-based parents (storage vs traversal vs comparison vs serialization)
For each finding, record:
Category: M1/M2/M3/M4
Class: [target class]
Proposed Parent: [parent class name and role]
Features Affected: [list with line numbers]
Conflicts: [potential name clashes to resolve]
Step 4: Detect Generics Opportunities
Scan for these patterns:
G1: Concrete Types Where Generic Would Be Safer
Classes using ANY for element types
Collections with hardcoded element types that could be parameterized
Factory-like classes creating specific types
G2: Missing Constraints on Existing Generics
[G] where [G -> COMPARABLE] needed because < is used on G
[G] where [G -> HASHABLE] needed because hash_code is called on G
Missing detachable separate for SCOOP compatibility
G3: like Current Candidates
Binary operations where both operands and result should share the same type
Builder-pattern features returning like Current
G4: Type Parameter Extraction
A type mentioned in 5+ features that could become a class parameter
Tight coupling to a specific type that limits reuse
For each finding, record:
Category: G1/G2/G3/G4
Class: [target class]
Current Type: [concrete type being used]
Proposed Parameter: [G/K/V with constraint]
Features Affected: [list with line numbers]
Client Impact: [files that would need updating]
Do NOT blindly list next steps. The report speaks for itself — the user can read it and decide what to act on. Only mention a specific skill if the user asks "what now?"
Context Management (RLM Pattern)
This skill focuses ONLY on: <library-path>
DO NOT:
Read files outside this library directory
Modify any source files (READ-ONLY skill)
Load entire ecosystem into context
DO:
Use Grep for structural element discovery before deep reading
Use Task tool with Explore agent for EiffelBase pattern reference questions
Focus on one category at a time to avoid context bloat
Anti-Drift
READ-ONLY: Do not modify any source files under any circumstances
Evidence Required: Every finding must cite specific classes, features, and line numbers
No Imagination: Do not invent findings — every opportunity must be grounded in actual code patterns
Prioritize by Impact: HIGH = real duplication/safety issues, not subjective aesthetics
Skill Version Lock: If you discover skill improvements during workflow, queue them in <library-path>/.eiffel-workflow/skill-improvements.md — do NOT modify skills mid-workflow