Notes_RuleNaming - rpapub/WatchfulAnvil GitHub Wiki

🛠️ Naming Static Analyzer Rules with Craft: The Master–Apprentice Pattern

When designing custom static analyzer rules in UiPath, clear naming isn't just a cosmetic choice — it's part of the developer experience. Inspired by the metaphor of a master craftsman guiding an apprentice, I’ve adopted a structured and expressive naming convention that blends engineering clarity with poetic discipline.


🎓 The Pattern: MasterVerbTraitRule

Each rule name answers three questions:

  1. What is the master doing? — e.g., Judge, Inspect, Refine
  2. What is being examined? — e.g., Flow, Structure, Path
  3. What aspect is under scrutiny? — e.g., Form, Discipline, Stability

The result is a class name like:

public class RefineFlowDisciplineRule : IRegisterAnalyzerConfiguration

This rule might check that control flow in a unit-of-work is clean, shallow, and focused — not cluttered or directionless.


🆔 RuleID Format: CPRIMA-ABC-###

Each rule class is mapped to a structured ID:

  • CPRIMA = namespace prefix
  • ABC = abbreviation of the three name parts (RefineFlowDisciplineRFD)
  • ### = sequence number

So our example becomes:

private const string RuleId = "CPRIMA-RFD-001";

This keeps RuleIDs short and sortable, while the class name remains human-readable and expressive.


⚙️ Why It Works

  • Encourages thoughtful naming rooted in metaphor and purpose
  • Scales easily as the rule set grows
  • Reflects a mindset of mentorship and discipline — the master guiding the apprentice
  • Leaves space for both strict enforcement and stylistic guidance

This approach turns your static analyzer into a tool of craft — less a judge, more a mentor, helping your automations grow into clean, reliable systems.


🧠 LLM Instructions: ClassName & RuleID Generator


Goal: Help the user design a new static analyzer rule in UiPath Studio using the Master–Apprentice metaphor.


Steps:

  1. Start with Context Collection Ask the user:

    • What is the rule checking or validating? (e.g. input arguments, selector stability)
    • Why is it important? (e.g. for modularity, clarity, robustness)
    • What is the tone they want? (strict, advisory, reflective, playful)
    • Is it more about structure, behavior, naming, or logic?
  2. Map Metaphor From the answers, choose:

    • A Master Verb: Judge, Test, Review, Inspect, Refine, Challenge, Observe
    • A Target Trait: Flow, Path, Structure, Naming, Craft, Discipline, Motion
    • A Subject Noun: Form, Stability, Isolation, Intent, Weight, Boundaries, Drift
  3. Generate Rule Class Name

    • Format: <Verb><Trait><Subject>Rule Example: RefineFlowDisciplineRule
  4. Generate RuleID

    • Prefix: CPRIMA-
    • Abbreviation: Take the first letters of each of the three parts Example: RFDCPRIMA-RFD-001
  5. Confirm with User

    • Present the generated class name and RuleID
    • Offer a one-line description of what it does
    • Ask if they’d like to revise any part

Output Format:

// Class name
public class RefineFlowDisciplineRule : IRegisterAnalyzerConfiguration
{
    private const string RuleId = "CPRIMA-RFD-001";
    ...
}

Example Prompt for LLM Usage:

"Let’s design a new static analyzer rule. What does your rule check for, and why? Is it strict or more advisory? Would you describe it as focused on structure, behavior, naming, or something else?"

⚠️ **GitHub.com Fallback** ⚠️