agentleFS
ROCmROCm/rocprofiler-systems-skills/skills/planning-architecture/SKILL.md

planning-architecture

Skill5 starsChanged 17 days agoMITView on GitHub

Plan new or redesigned system architecture - define components, boundaries, interactions, and technical decisions before implementation

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 11 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when designing NEW architecture or planning REDESIGN of existing architecture.

    line 8
  2. Distinctive:

    Follow all base planning rules, plus the architecture-specific rules below.

    line 13
  3. Very specific:

    Use AskUserQuestion to ask:

    line 32
  4. Distinctive:

    Wait for answer before proceeding.

    line 38
  5. Distinctive:

    Before designing the new architecture, understand what exists:

    line 42
  6. Distinctive:

    Document the constraints: what cannot change (APIs, data formats, external dependencies)

    line 46
  7. Distinctive:

    If the system is on a hot path or performance-critical, this changes the polymorphism strategy:

    line 62
  8. Distinctive:

    Always ask whether the code is on a hot path.

    line 72
  9. Distinctive:

    ALWAYS present at least 2 architectural alternatives.

    line 82
  10. Distinctive:

    Ask: "Which direction do you prefer?

    line 118
  11. Distinctive:

    After the user picks a direction, flesh out the design.

    line 124
  12. Distinctive:

    If redesigning existing architecture:

    line 156

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Architecture Planning

Use this skill when designing NEW architecture or planning REDESIGN of existing architecture.

<IMPORTANT> **Prerequisites:** Invoke `planning-base` skill first if not already loaded. It provides the core planning phases (0-5).

Follow all base planning rules, plus the architecture-specific rules below.

Mandatory: Invoke programming-cpp-design-patterns during Phase 4 (detailing the architecture). Consider which patterns apply to the component interactions and extension points being designed.

Key distinction:

  • planning-architecture = design what WILL BE built (this skill)
  • review-architecture = document what already EXISTS</IMPORTANT>

When to Use

  • Designing a new system, module, or component from scratch
  • Redesigning or migrating existing architecture
  • Making decisions that affect multiple components or modules
  • Choosing between architectural patterns or technologies
  • Defining system boundaries, APIs, or integration points

Phase 1: Determine Scope

Use AskUserQuestion to ask:

"What kind of architecture work is this?"

  • Greenfield - Design a new system or component from scratch
  • Redesign - Change the architecture of something that already exists

Wait for answer before proceeding.

If Redesign: Understand Current State

Before designing the new architecture, understand what exists:

  1. Invoke review-architecture or exploration-explore-code to analyze the current system
  2. Identify what works well (keep), what is broken (fix), and what is missing (add)
  3. Document the constraints: what cannot change (APIs, data formats, external dependencies)

Phase 2: Gather Requirements

Identify and confirm with the user:

CategoryQuestions
FunctionalWhat must the system do? What are the core capabilities?
Non-functionalPerformance targets, scalability needs, reliability requirements
PerformanceIs this on a hot path? How frequently is it called? Is latency critical?
ConstraintsTechnology stack, team expertise, timeline, budget, legacy compatibility
IntegrationWhat external systems must it connect to? What protocols/formats?

Performance-Sensitive Design

If the system is on a hot path or performance-critical, this changes the polymorphism strategy:

TechniqueOverheadWhen to Use
Virtual interfacesvtable indirection, heap allocation, cache-unfriendlyRare calls, set of types unknown at compile time
std::variant + std::visitZero indirection, stack-allocated, cache-friendlyFixed set of known types (preferred for hot paths)
Templates / Policy-based designZero overhead, resolved at compile timeTypes known at compile time, maximum performance
CRTPZero overhead, compile-time polymorphismStatic dispatch with base class behavior
<IMPORTANT> Always ask whether the code is on a hot path. If yes, prefer compile-time polymorphism (templates, std::variant, CRTP) over virtual interfaces. Virtual dispatch has vtable indirection and prevents inlining — avoid it in performance-critical code. </IMPORTANT>

Present findings and ask: "Are these requirements complete, or should I add/change anything?"

Wait for answer before proceeding.

Phase 3: Propose Alternatives

<IMPORTANT> ALWAYS present at least 2 architectural alternatives. Never propose a single solution without showing what was considered and rejected. </IMPORTANT>

For each alternative, describe:

AspectWhat to Cover
OverviewHigh-level description of the approach
ComponentsWhat modules/services/layers exist
InteractionsHow components communicate
Trade-offsPros and cons relative to requirements
RiskWhat could go wrong, what is hard to change later
EffortRelative complexity of implementation

Present alternatives in a comparison table:

## Architectural Alternatives

### Alternative A: [Name]
[Description]

### Alternative B: [Name]
[Description]

### Comparison

| Criterion | Alternative A | Alternative B |
|-----------|---------------|---------------|
| Meets functional requirements | Yes/Partial/No | Yes/Partial/No |
| Performance | [assessment] | [assessment] |
| Complexity | [Low/Medium/High] | [Low/Medium/High] |
| Extensibility | [assessment] | [assessment] |
| Risk | [assessment] | [assessment] |

Ask: "Which direction do you prefer? Or should I explore a different approach?"

Wait for answer before proceeding.

Phase 4: Detail the Chosen Architecture

After the user picks a direction, flesh out the design. Cover these sections one at a time, getting user approval between each:

4.1 Class Diagram

Generate a Mermaid class diagram showing all components, their interfaces, relationships, and ownership. Present it for user approval before continuing.

4.2 Component Breakdown

Define each component:

  • Responsibility (what it does and does NOT do)
  • Public interface (what it exposes to other components)
  • Internal structure (sub-components if any)
  • Ownership boundaries (what data/state it owns)

4.3 Interactions and Data Flow

For each pair of interacting components:

  • Direction of communication (who calls whom)
  • Protocol or mechanism (function call, message queue, API, event)
  • Data exchanged (types, formats)
  • Error handling (what happens when communication fails)

4.4 Extension Points

Where and how the system can be extended:

  • Plugin interfaces or abstract base classes
  • Configuration-driven behavior
  • Feature flags or conditional compilation
  • Module boundaries designed for future expansion

4.5 Migration Plan (Redesign Only)

If redesigning existing architecture:

  • Incremental migration steps (never big-bang)
  • What can be changed independently
  • Backward compatibility during transition
  • Rollback strategy for each step
  • Data migration approach if applicable
<IMPORTANT> Present each section (4.1-4.5) individually. Wait for user approval before moving to the next section. Revise if the user requests changes. </IMPORTANT>

Phase 5: Risk Analysis

Identify architectural risks:

RiskImpactLikelihoodMitigation
[risk description][High/Medium/Low][High/Medium/Low][how to address]

Focus on:

  • Decisions that are hard to reverse later
  • Single points of failure
  • Scalability bottlenecks
  • Coupling that will make future changes expensive
  • Technology bets that may not pay off

Phase 6: Create Implementation Roadmap

Break the architecture into implementable work items:

  1. Foundation first - Core abstractions, interfaces, base components
  2. Critical path next - The most important or risky pieces
  3. Incremental delivery - Each step produces something usable or testable
  4. Tests alongside - Each component should be testable in isolation

Map work items to PRs following planning-base PR size guidelines.

Plan File Format

Save to planning/architecture-<name>.md:

# Architecture: <System/Component Name>

## Goal
<What is being designed and why>

## Type
<Greenfield / Redesign>

## Requirements
### Functional
- <Requirement 1>
- <Requirement 2>

### Non-Functional
- <Requirement 1>

### Constraints
- <Constraint 1>

## Alternatives Considered

### Alternative A: <Name>
<Summary and why chosen/rejected>

### Alternative B: <Name>
<Summary and why chosen/rejected>

**Chosen:** Alternative <X> because <reason>

## Architecture Design

### Components
| Component | Responsibility | Interface |
|-----------|---------------|-----------|
| <name> | <what it does> | <what it exposes> |

### Interactions
| From | To | Mechanism | Data |
|------|----|-----------|------|
| <component> | <component> | <how> | <what> |

### Extension Points
- <Where and how the system can be extended>

## Migration Plan (if redesign)
- [ ] Step 1: <description>
- [ ] Step 2: <description>

## Risks
| Risk | Impact | Mitigation |
|------|--------|------------|
| <risk> | <level> | <how> |

## Implementation Roadmap
### PR 1: <Title>
**Scope:** <What's included>
- [ ] Task 1
- [ ] Task 2

### PR 2: <Title>
**Scope:** <What's included>
- [ ] Task 1
- [ ] Task 2

## Notes
<Decisions, trade-offs, open questions>

Common Mistakes

MistakeFix
Jumping to a single solution without alternativesAlways present at least 2 alternatives with trade-offs
Designing without understanding requirementsGather and confirm requirements first
Big-bang migration planBreak redesign into incremental steps with rollback
Over-engineering for hypothetical future needsDesign for known requirements, add extension points only where likely
Detailing all sections at oncePresent one section at a time, get approval between each
Skipping risk analysisHard-to-reverse decisions need explicit risk assessment
Ignoring current state in redesignAlways analyze what exists before proposing changes

Rationalizations to Reject

ExcuseReality
"The answer is obvious, no need for alternatives"Even obvious choices benefit from documenting what was rejected and why
"We'll figure out migration later"Migration is the hardest part of redesign. Plan it upfront.
"Requirements are clear from context"Confirm anyway. Assumptions are the root of architectural drift.
"It's a small system, no need for formal planning"Small systems grow. Early decisions are the hardest to change later.

Integration with Other Skills

Before This SkillUse
Understanding existing codeexploration-explore-code
Documenting current architecturereview-architecture
After This SkillUse
Implementing planned featuresplanning-feature
Refactoring toward new architectureplanning-refactor
Creating test planstesting-testplan

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.