Files
TheRock/rocm-systems/projects/amdsmi/.claude/skills/writing-plans/SKILL.md
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

141 lines
5.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: writing-plans
description: "Use when an approved spec exists and you need a bite-sized, file-level implementation plan before any code is written. Produces a plan ready for executing-plans or subagent dispatch."
---
# Writing Plans — amd-smi
Translate an approved spec into a concrete plan an engineer (or fresh subagent) with zero project context can execute task-by-task. **DRY. YAGNI. TDD. Frequent commits.**
**Announce at start:** "I'm using the `writing-plans` skill to create the implementation plan."
**Save plans to:** `${TMPDIR:-/tmp}/amdsmi-agent-plans/YYYY-MM-DD-<feature-name>.md` (ephemeral, never committed to the workspace)
## Required Inputs
- An approved spec at `${TMPDIR:-/tmp}/amdsmi-agent-specs/YYYY-MM-DD-<topic>-design.md`
- Familiarity with the amd-smi project layout (see `project-layout` rule)
If no spec exists, STOP and invoke the `amdsmi-interrogate` skill first.
## Scope Check
If the spec covers multiple independent subsystems, it should have been split during interrogate. If it wasn't, push back: each plan must produce working, testable software on its own. Suggest splitting before writing the plan.
## File Structure (Map First)
Before writing tasks, map every file that will be created or modified and what each is responsible for. This locks in decomposition decisions.
For amd-smi work, this map almost always includes:
| Layer | Typical Files |
|-------|---------------|
| Public header | `include/amd_smi/amdsmi.h` |
| C++ impl | `src/amd_smi/amd_smi.cc`, `rocm_smi/src/*.cc` |
| Wrapper | `py-interface/amdsmi_wrapper.py` (auto-generated — task = run `tools/update_wrapper.sh`) |
| Python API | `py-interface/amdsmi_interface.py` |
| CLI | `amdsmi_cli/amdsmi_commands.py`, `amdsmi_parser.py`, `amdsmi_helpers.py` |
| Tests | `tests/amd_smi_test/`, `tests/python_unittest/` |
| Docs | `docs/`, `CHANGELOG.md` |
| Build | `CMakeLists.txt`, `RPM/`, `DEBIAN/` |
Tasks should follow the cascade order so each commit builds independently.
## Plan Document Header
Every plan starts with:
```markdown
# <Feature Name> Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL — use `executing-plans` (or the `amdsmi-development` agent's subagent dispatch) to implement task-by-task. Steps use checkbox (`- [ ]`) syntax.
**Goal:** <one sentence>
**Spec:** <link to spec file>
**Architecture:** <2-3 sentences>
**Cascade layers touched:** <list>
---
```
## Task Structure
Each task is a self-contained unit producing a single commit. Steps within a task are 2–5 minute actions.
````markdown
### Task N: <Component Name>
**Files:**
- Create: `exact/path/to/file.cc`
- Modify: `exact/path/to/existing.h:42-58`
- Test: `tests/amd_smi_test/test_file.cc`
- [ ] **Step 1: Write the failing test**
```cpp
TEST_F(AmdSmiTest, AmdsmiGetNewFeature) {
amdsmi_status_t status = amdsmi_get_gpu_new_feature(handle, &out);
EXPECT_EQ(status, AMDSMI_STATUS_SUCCESS);
}
```
- [ ] **Step 2: Run test — verify it fails**
```bash
cd build && make -j$(nproc) amdsmitst
./tests/amd_smi_test/amdsmitst --gtest_filter=AmdSmiTest.AmdsmiGetNewFeature
```
Expected: FAIL — symbol not defined.
- [ ] **Step 3: Implement** (show full code, no `// ...existing...`)
- [ ] **Step 4: Run test — verify it passes**
- [ ] **Step 5: Commit**
```bash
git add include/amd_smi/amdsmi.h src/amd_smi/amd_smi.cc tests/amd_smi_test/test_file.cc
git commit -s -m "feat(amdsmi): add amdsmi_get_gpu_new_feature"
```
````
## No Placeholders
The following are **plan failures**. Never write them:
- `TBD`, `TODO`, `implement later`, `fill in details`
- "Add appropriate error handling" / "handle edge cases" without showing the code
- "Write tests for the above" without the actual test code
- "Similar to Task N" — repeat the code; engineers may read tasks out of order
- References to types, functions, or methods not defined in any earlier task
Every step that changes code must show the code.
## Self-Review
After writing the complete plan, re-read it against the spec:
1. **Spec coverage** — every requirement maps to a task. List gaps; add tasks.
2. **Placeholder scan** — none of the patterns above present
3. **Type consistency** — function/type/field names match across tasks (a method called `clear_layers()` in Task 3 and `clearAllLayers()` in Task 7 is a bug)
4. **Cascade completeness** — header → impl → wrapper regen → interface → CLI → tests → docs → changelog all addressed
5. **Commit boundaries** — each commit compiles independently when possible
Fix inline. Move on.
## Execution Handoff
After saving the plan, offer the user a choice:
> Plan saved to `${TMPDIR:-/tmp}/amdsmi-agent-plans/<filename>.md`. Two execution options:
>
> 1. **Subagent-driven** (recommended for multi-task plans) — invoke the `amdsmi-development` agent or planning agent, fresh subagent per task with review between tasks
> 2. **Inline execution** — execute tasks in this session using the `executing-plans` skill, batched with checkpoints
>
> Which approach?
If the planning agent dispatched this skill, return the plan path and the recommended execution mode rather than offering interactively.