一键导入
planning-architecture
Plan new or redesigned system architecture - define components, boundaries, interactions, and technical decisions before implementation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Plan new or redesigned system architecture - define components, boundaries, interactions, and technical decisions before implementation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Given a TheRock nightly build (URL or run-id), return the rocm-systems pin_sha used in that build
Check whether a given rocm-systems commit is included in a specific TheRock nightly build
Find the first TheRock nightly build that includes a given rocm-systems commit
Reviews Pull Requests or local diffs with an 8-agent fan-out covering static analysis, dead code, code smells + quality (naming, complexity, single-responsibility, magic numbers), language rules (C++/Python/CMake), architecture, simplification, performance (hot-path classification, allocations, locks, I/O), and undefined behaviour (signed overflow, lifetime, strict aliasing, data races, sanitizer coverage; C/C++/unsafe-Rust only). Use when the user asks to "review this PR", "review the diff", "audit this branch", "/pr-review", or when staging changes before push.
Walk through a PR review interactively, one finding at a time. Generate review via pr-review, then for each issue present analysis + proposed inline comment, let user accept/edit/skip, accumulate into a PENDING GitHub review, submit at end.
Use when user wants to list, analyze, review, or summarize GitHub PR comments on a pull request number or URL
| name | planning-architecture |
| description | Plan new or redesigned system architecture - define components, boundaries, interactions, and technical decisions before implementation |
Use this skill when designing NEW architecture or planning REDESIGN of existing architecture.
**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
Use AskUserQuestion to ask:
"What kind of architecture work is this?"
Wait for answer before proceeding.
Before designing the new architecture, understand what exists:
review-architecture or exploration-explore-code to analyze the current systemIdentify and confirm with the user:
| Category | Questions |
|---|---|
| Functional | What must the system do? What are the core capabilities? |
| Non-functional | Performance targets, scalability needs, reliability requirements |
| Performance | Is this on a hot path? How frequently is it called? Is latency critical? |
| Constraints | Technology stack, team expertise, timeline, budget, legacy compatibility |
| Integration | What external systems must it connect to? What protocols/formats? |
If the system is on a hot path or performance-critical, this changes the polymorphism strategy:
| Technique | Overhead | When to Use |
|---|---|---|
| Virtual interfaces | vtable indirection, heap allocation, cache-unfriendly | Rare calls, set of types unknown at compile time |
| std::variant + std::visit | Zero indirection, stack-allocated, cache-friendly | Fixed set of known types (preferred for hot paths) |
| Templates / Policy-based design | Zero overhead, resolved at compile time | Types known at compile time, maximum performance |
| CRTP | Zero overhead, compile-time polymorphism | Static dispatch with base class behavior |
Present findings and ask: "Are these requirements complete, or should I add/change anything?"
Wait for answer before proceeding.
For each alternative, describe:
| Aspect | What to Cover |
|---|---|
| Overview | High-level description of the approach |
| Components | What modules/services/layers exist |
| Interactions | How components communicate |
| Trade-offs | Pros and cons relative to requirements |
| Risk | What could go wrong, what is hard to change later |
| Effort | Relative 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.
After the user picks a direction, flesh out the design. Cover these sections one at a time, getting user approval between each:
Generate a Mermaid class diagram showing all components, their interfaces, relationships, and ownership. Present it for user approval before continuing.
Define each component:
For each pair of interacting components:
Where and how the system can be extended:
If redesigning existing architecture:
Identify architectural risks:
| Risk | Impact | Likelihood | Mitigation |
|---|---|---|---|
| [risk description] | [High/Medium/Low] | [High/Medium/Low] | [how to address] |
Focus on:
Break the architecture into implementable work items:
Map work items to PRs following planning-base PR size guidelines.
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>
| Mistake | Fix |
|---|---|
| Jumping to a single solution without alternatives | Always present at least 2 alternatives with trade-offs |
| Designing without understanding requirements | Gather and confirm requirements first |
| Big-bang migration plan | Break redesign into incremental steps with rollback |
| Over-engineering for hypothetical future needs | Design for known requirements, add extension points only where likely |
| Detailing all sections at once | Present one section at a time, get approval between each |
| Skipping risk analysis | Hard-to-reverse decisions need explicit risk assessment |
| Ignoring current state in redesign | Always analyze what exists before proposing changes |
| Excuse | Reality |
|---|---|
| "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. |
| Before This Skill | Use |
|---|---|
| Understanding existing code | exploration-explore-code |
| Documenting current architecture | review-architecture |
| After This Skill | Use |
|---|---|
| Implementing planned features | planning-feature |
| Refactoring toward new architecture | planning-refactor |
| Creating test plans | testing-testplan |