Skip to content

Commit a8939e4

Browse files
authored
Merge pull request #231 from graysurf/feat/update-create-plan-tooling-flow
Align create-plan with current plan-tooling workflow
2 parents a1a266a + 208ac9e commit a8939e4

2 files changed

Lines changed: 72 additions & 3 deletions

File tree

skills/workflows/plan/create-plan/SKILL.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Prereqs:
1616

1717
- User is asking for an implementation plan (not asking you to build it yet).
1818
- You can read enough repo context to plan safely (or the user provides constraints).
19-
- `plan-tooling` available on `PATH` for linting (install via `brew install nils-cli`).
19+
- `plan-tooling` available on `PATH` for linting/parsing/splitting (`validate`, `to-json`, `batches`, `split-prs`; install via
20+
`brew install nils-cli`).
2021

2122
Inputs:
2223

@@ -57,9 +58,12 @@ Failure modes:
5758
1. Write the plan (do not implement)
5859

5960
- Use sprints/phases that each produce a demoable/testable increment.
60-
- Break work into atomic, independently testable tasks.
61+
- Treat sprints as sequential integration gates; do not imply cross-sprint execution parallelism.
62+
- Break work into atomic, independently testable tasks with explicit dependencies when execution order matters.
63+
- Prefer within-sprint parallel lanes only when file overlap and validation scope stay manageable.
6164
- Include file paths whenever you can be specific.
6265
- Include a validation step per sprint (commands, checks, expected outcomes).
66+
- Fill `Complexity` when it materially affects batching/splitting or when a task looks oversized.
6367

6468
1. Save the plan file
6569

@@ -71,16 +75,59 @@ Failure modes:
7175
- Run: `plan-tooling validate --file docs/plans/<slug>-plan.md`
7276
- If it fails: tighten tasks (missing fields, placeholders, unclear validations) until it passes.
7377

78+
1. Run an executability + grouping pass (mandatory)
79+
80+
- Default grouping policy for this skill:
81+
- If the user did not explicitly request grouping behavior, validate with metadata-first auto
82+
(`--strategy auto --default-pr-grouping group`).
83+
- For each sprint, run:
84+
85+
```bash
86+
plan-tooling to-json --file docs/plans/<slug>-plan.md --sprint <n>
87+
plan-tooling batches --file docs/plans/<slug>-plan.md --sprint <n>
88+
plan-tooling split-prs --file docs/plans/<slug>-plan.md --scope sprint \
89+
--sprint <n> --strategy auto --default-pr-grouping group --format json
90+
```
91+
92+
- If the user explicitly requests deterministic/manual grouping:
93+
- Provide explicit mapping for every task: `--pr-group <task-id>=<group>` (repeatable).
94+
- Validate with:
95+
96+
```bash
97+
plan-tooling split-prs --file docs/plans/<slug>-plan.md --scope sprint --sprint <n> --pr-grouping group --strategy deterministic --pr-group ... --format json
98+
```
99+
100+
- If the user explicitly requests one shared lane per sprint:
101+
- Validate with:
102+
103+
```bash
104+
plan-tooling split-prs --file docs/plans/<slug>-plan.md --scope sprint --sprint <n> --pr-grouping per-sprint --strategy deterministic --format json
105+
```
106+
107+
- When you add sprint metadata for grouping/parallelism, use exact case-sensitive labels:
108+
- `**PR grouping intent**: per-sprint|group`
109+
- `**Execution Profile**: serial|parallel-xN`
110+
- Keep metadata coherent:
111+
- If `PR grouping intent` is `per-sprint`, do not declare parallel width `>1`.
112+
- If planning multi-lane parallel execution, set `PR grouping intent` to `group`.
113+
- After each adjustment, rerun `plan-tooling validate` and the relevant `split-prs` command until the plan is stable and executable.
114+
74115
1. Review “gotchas”
75116

76-
- After saving, add/adjust a “Risks & gotchas” section: ambiguity, dependencies, migrations, rollout, backwards compatibility, and rollback.
117+
- After saving, add/adjust a “Risks & gotchas” section: ambiguity, dependency bottlenecks, same-batch overlap hotspots, migrations, rollout,
118+
backwards compatibility, and rollback.
77119

78120
## Plan Template
79121

80122
Shared template (single source of truth):
81123

82124
- `skills/workflows/plan/_shared/assets/plan-template.md`
83125

126+
When a plan needs explicit grouping/parallelism metadata, extend each sprint with these exact labels:
127+
128+
- `**PR grouping intent**: per-sprint|group`
129+
- `**Execution Profile**: serial|parallel-xN`
130+
84131
Optional scaffold helper (creates a placeholder plan; fill it before linting):
85132

86133
- `plan-tooling scaffold --slug <kebab-case> --title "<task name>"`

skills/workflows/plan/create-plan/tests/test_workflows_plan_create_plan.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,25 @@
88
def test_workflows_plan_create_plan_contract() -> None:
99
skill_root = Path(__file__).resolve().parents[1]
1010
assert_skill_contract(skill_root)
11+
12+
13+
def _skill_md_text() -> str:
14+
return (Path(__file__).resolve().parents[1] / "SKILL.md").read_text(encoding="utf-8")
15+
16+
17+
def test_create_plan_requires_plan_tooling_executability_pass() -> None:
18+
text = _skill_md_text()
19+
assert "plan-tooling to-json --file docs/plans/<slug>-plan.md --sprint <n>" in text
20+
assert "plan-tooling batches --file docs/plans/<slug>-plan.md --sprint <n>" in text
21+
assert "--strategy auto --default-pr-grouping group --format json" in text
22+
assert "--pr-grouping group --strategy deterministic --pr-group ... --format json" in text
23+
assert "--pr-grouping per-sprint --strategy deterministic --format json" in text
24+
25+
26+
def test_create_plan_documents_grouping_metadata_and_cross_sprint_policy() -> None:
27+
text = _skill_md_text()
28+
assert "Treat sprints as sequential integration gates" in text
29+
assert "do not imply cross-sprint execution parallelism." in text.lower()
30+
assert "`**PR grouping intent**: per-sprint|group`" in text
31+
assert "`**Execution Profile**: serial|parallel-xN`" in text
32+
assert "If `PR grouping intent` is `per-sprint`, do not declare parallel width `>1`." in text

0 commit comments

Comments
 (0)