Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ A missing foundation document does not trigger this workflow during ideas, disco

Override the brainstorming skill's own hand-off. It saves its design under `docs/superpowers/specs/` and then invokes `writing-plans`. Here, save the approved design as the change's shaping document in `docs/product/shaping/{feature}--{change}/`, then return control to this skill. The shaping document includes the change's provenance record (`references/changes-and-deltas.md`, Provenance). A change to an existing feature names it in the shaping document's front matter: `x-amends: {feature}`. The override ends there: this skill never invokes `writing-plans` or plans implementation, which belongs to the implementation workflow.

When the requirements are already clear and the Foundation Gate has passed, skip brainstorming: write them as the change's shaping document, provenance record included, and get the maintainer's approval of it as the design.

An early idea that nobody is shaping yet goes to `docs/product/ideas/` instead, with no gate.

**Output:** Approved design, saved as the change's shaping document in `docs/product/shaping/{feature}--{change}/`.
Expand Down Expand Up @@ -177,7 +179,7 @@ An early idea that nobody is shaping yet goes to `docs/product/ideas/` instead,

**Trigger:** Scenarios are reviewed and cover the acceptance criteria.

**Process:** Follow `references/ratification.md` for the ratification checks and the promotion PR body, and review the PR against the checklist in `references/promotion-review.md`, which the `spec-reviewer` agent uses. Run the overlap check (`references/changes-and-deltas.md`) and put its report in the promotion PR. With the maintainer's approval, open a promotion PR that moves the change's approved documents from `docs/product/shaping/{feature}--{change}/` into `docs/product/features/{feature}/changes/{change}/`, sets their OKF `status` to `stable`, and adds a Ratified entry to the feature log. For a new feature, the PR also creates the feature bundle: a metadata-only feature overview that claims no behavior, `log.md` and `changes/`. The first canonization writes the complete overview and the facet specs (`references/feature-bundles.md`). The maintainer reviews it and orders or combines any overlapping changes. Run the overlap check again just before the PR merges. At both points, also run the design-level open-questions check (`references/open-questions.md`): no open `design` or `none yet` question may name the change unless the maintainer approved its deferral. Merging the promotion PR ratifies the change; the merge is the approval record. Code alone never admits a spec, so a change whose code has already shipped still goes through promotion.
**Process:** Follow `references/ratification.md` for the ratification checks and the promotion PR body, and review the PR against the checklist in `references/promotion-review.md`, which the `spec-reviewer` agent uses. Run the overlap check (`references/changes-and-deltas.md`) and put its report in the promotion PR. Before the promotion PR opens, the approved change must be on the default branch in `docs/product/shaping/{feature}--{change}/`: if its approved documents are not there yet, land them first, in a PR of its own, opened with the maintainer's approval. The promotion PR then shows the move from `shaping/` to `features/` that board mapping detects, and closing it without merging leaves the change in `shaping/` (`references/board-mapping.md`). With the maintainer's approval, open a promotion PR that moves the change's approved documents from `docs/product/shaping/{feature}--{change}/` into `docs/product/features/{feature}/changes/{change}/`, sets their OKF `status` to `stable`, and adds a Ratified entry to the feature log. For a new feature, the PR also creates the feature bundle: a metadata-only feature overview that claims no behavior, `log.md` and `changes/`. The first canonization writes the complete overview and the facet specs (`references/feature-bundles.md`). The maintainer reviews it and orders or combines any overlapping changes. Run the overlap check again just before the PR merges. At both points, also run the design-level open-questions check (`references/open-questions.md`): no open `design` or `none yet` question may name the change unless the maintainer approved its deferral. Merging the promotion PR ratifies the change; the merge is the approval record. Code alone never admits a spec, so a change whose code has already shipped still goes through promotion.

The promotion PR also lists each app-local scenario file under `apps/{surface}/docs/features/{feature}/scenarios/` that it adds or changes, so the maintainer ratifies surface-specific scenarios with the rest of the change.

Expand Down Expand Up @@ -385,7 +387,7 @@ Not every feature starts at the beginning. Match the entry point to the current
| Missing, unapproved, or unversioned constitution or vision before first PRD | Foundation workflow |
| Early idea nobody is shaping yet | Record it in `ideas/` |
| Vague idea, no clarity on approach | Discovery and Design |
| Clear requirements, needs documentation | Requirements after Foundation Gate |
| Clear requirements, needs documentation | Discovery and Design: record them as the change's shaping document and get it approved, skipping brainstorming once the Foundation Gate passes; then Requirements |
| PRD or TRD drafted, not yet approved | Requirements: finish its review and approval |
| PRD and TRD approved, no stories yet | User Stories |
| Stories drafted, not yet approved, or without acceptance criteria | User Stories: finish them |
Expand All @@ -406,7 +408,7 @@ Not every feature starts at the beginning. Match the entry point to the current
| A codebase whose features have no product docs, or specs only in other formats (Spec Kit, OpenSpec, design and plan files) | Retrofit (`references/retrofit.md`) |
| Specs written with version 0.1.0 of this skill (a PRD and TRD per feature folder, changelog tables, committed plans) | Modernization (`references/modernization.md`) |

Clear requirements may skip brainstorming only after Foundation Gate passes. If this is the first PRD and `docs/product/constitution.md` or `docs/product/vision.md` is missing, unapproved, or unversioned, run the Foundation workflow before Requirements.
Clear requirements may skip brainstorming only after the Foundation Gate passes, never the approved shaping document: Requirements starts from an approved design (`references/requirements.md`), so record them as the change's shaping document and get it approved first. If this is the first PRD and `docs/product/constitution.md` or `docs/product/vision.md` is missing, unapproved, or unversioned, run the Foundation workflow before Requirements.

## Skill Delegation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Every `gh project` command below that writes to the board runs only after the ma
gh auth refresh -s project
```

Name the project, its owner and the repository once per session. `OWNER` is the organization or user that owns the project; use `@me` for a project you own. `REPO` is the repository whose `docs/product/` holds the changes.
Name the project, its owner and the repository once per session. `OWNER` is the organization or user that owns the project; use `@me` for a project you own. `REPO` is the repository whose `docs/product/` holds the changes. Every `gh pr` command and REST call below names it, with `--repo "$REPO"` or `repos/$REPO/`, so it reads that repository whichever directory the shell is in.

```sh
OWNER=<org-or-user>
Expand Down Expand Up @@ -131,9 +131,9 @@ set_spec_state() {
# it reads fewer files than the pull request changed.
promotion_change() {
local total moves got
total=$(gh api "repos/{owner}/{repo}/pulls/$1" --jq .changed_files) || return 1
total=$(gh api "repos/$REPO/pulls/$1" --jq .changed_files) || return 1
# One "file" line per file read, then one line per move out of shaping or into changes.
moves=$(gh api --paginate "repos/{owner}/{repo}/pulls/$1/files" --jq '.[]
moves=$(gh api --paginate "repos/$REPO/pulls/$1/files" --jq '.[]
| "file",
(select(.status == "renamed" or .status == "removed")
| (.previous_filename // .filename)
Expand All @@ -160,16 +160,16 @@ promotion_change() {
closing_refs() {
local closers total commits got
closers='def closers: [scan("(?i)\\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?):?\\s+(?:https://github\\.com/[\\w.-]+/[\\w.-]+/issues/|(?:[\\w.-]+/[\\w.-]+)?#)[0-9]+")] | .[];'
total=$(gh api "repos/{owner}/{repo}/pulls/$1" --jq .commits) || return 1
total=$(gh api "repos/$REPO/pulls/$1" --jq .commits) || return 1
# One bare SHA line per commit read, then one line per closing keyword in it.
commits=$(gh api --paginate "repos/{owner}/{repo}/pulls/$1/commits" --jq "$closers"'
commits=$(gh api --paginate "repos/$REPO/pulls/$1/commits" --jq "$closers"'
.[] | .sha[0:7] as $sha | $sha, (.commit.message | closers | "commit \($sha): \(.)")') || return 1
got=$(grep -cv '^commit ' <<< "$commits")
if [ "$got" -ne "$total" ]; then
echo "closing_refs $1: read $got of $total commits; check the rest by hand" >&2
return 1
fi
gh pr view "$1" --json title,body,closingIssuesReferences --jq "$closers"'
gh pr view "$1" --repo "$REPO" --json title,body,closingIssuesReferences --jq "$closers"'
((.title, .body) | closers | "title or body: \(.)"),
(.closingIssuesReferences[] | "closes on merge: \(.url)")' || return 1
grep '^commit ' <<< "$commits" || true
Expand All @@ -178,7 +178,7 @@ closing_refs() {
# promotion_prs: each open promotion PR and the change it promotes, tab-separated
promotion_prs() {
local prs pr changes
prs=$(gh api --paginate "repos/{owner}/{repo}/pulls?state=open&per_page=100" \
prs=$(gh api --paginate "repos/$REPO/pulls?state=open&per_page=100" \
--jq '.[].number') || return 1
while read -r pr; do
[ -n "$pr" ] || continue
Expand Down Expand Up @@ -236,9 +236,9 @@ Each move follows [Board moves](board-mapping.md#board-moves). The evidence is w
|-------|----------|-----------|
| The maintainer asks to track an idea | The idea in `docs/product/ideas/` on the default branch | Idea |
| The idea moves to shaping | `docs/product/shaping/{feature}--{change}/` on the default branch | Shaping |
| The promotion PR opens or reopens | `gh pr view <n> --json state` says `OPEN`, and `closing_refs <n>` prints nothing | In review |
| The promotion PR closes without merging | `gh pr view <n> --json state` says `CLOSED`; the change is still in `shaping/` | Shaping |
| The promotion PR merges | `gh pr view <n> --json state` says `MERGED`; the change is in `features/{feature}/changes/{change}/` | Ratified |
| The promotion PR opens or reopens | `gh pr view <n> --repo "$REPO" --json state` says `OPEN`, and `closing_refs <n>` prints nothing | In review |
| The promotion PR closes without merging | `gh pr view <n> --repo "$REPO" --json state` says `CLOSED`; the change is still in `shaping/` | Shaping |
| The promotion PR merges | `gh pr view <n> --repo "$REPO" --json state` says `MERGED`; the change is in `features/{feature}/changes/{change}/` | Ratified |
| The Shipped entry lands | A `Shipped: {change}` entry in `features/{feature}/log.md` on the default branch | Shipped |
| The canonization PR merges | The change is in `features/{feature}/changes/archive/YYYY-MM-DD-{change}/` | Canonized |
| The drop lands | The change's directory is gone, and `features/log.md` has its `Dropped change` entry | Dropped |
Expand Down Expand Up @@ -270,7 +270,7 @@ Run a drift check when the maintainer asks, before a planning or review session,
promotion_prs
```

`gh pr list --json files` gives one path per renamed file, so it can't show a move from `shaping/` to `changes/`. `promotion_change` reads the pull request's files from the REST API instead (`gh api` fills `{owner}/{repo}` from the current repository), where a renamed file carries both `previous_filename` and `filename`, and counts a pull request as a promotion only when files leave `shaping/{feature}--{change}/` and arrive in `features/{feature}/changes/{change}/` for the same change. It stops if it read fewer files than the pull request's `changed_files`, since the files endpoint lists at most 3,000.
`gh pr list --json files` gives one path per renamed file, so it can't show a move from `shaping/` to `changes/`. `promotion_change` reads the pull request's files from the REST API instead (at `repos/$REPO/`, the repository named in [Setup](#setup), not whichever one the current directory belongs to), where a renamed file carries both `previous_filename` and `filename`, and counts a pull request as a promotion only when files leave `shaping/{feature}--{change}/` and arrive in `features/{feature}/changes/{change}/` for the same change. Those files leave `shaping/` because a promotion PR opens only once the change is in `shaping/` on the default branch ([ratification.md](ratification.md#1-prepare-the-promotion-pr)); a pull request that adds a change straight to `features/` shows no such move and is not detected. It stops if it read fewer files than the pull request's `changed_files`, since the files endpoint lists at most 3,000.

Check that no promotion PR would close an issue:

Expand Down Expand Up @@ -336,7 +336,7 @@ set_spec_state shared-calendars/invite-expiry "Shaping"
The promotion PR #214 (promote invite-expiry) opens. Its body and its commit say `Refs #210`, with no closing keyword. The agent checks the evidence:

```sh
gh pr view 214 --json state --jq .state
gh pr view 214 --repo "$REPO" --json state --jq .state
closing_refs 214
```

Expand Down Expand Up @@ -370,13 +370,13 @@ The next commit to the default branch that touches `docs/product/` adds to `feat
The maintainer reworks the change on the promotion PR's branch, adding a per-calendar expiry window, and reopens the original promotion PR:

```sh
gh pr reopen 214
gh pr reopen 214 --repo "$REPO"
```

The agent checks that #214 is open again and still closes nothing:

```sh
gh pr view 214 --json state --jq .state
gh pr view 214 --repo "$REPO" --json state --jq .state
```

```text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ A Shipped change cannot be dropped, so no item moves from Shipped to Dropped.

## Closed promotion PRs

A promotion PR closed without merging returns the change to Shaping: its documents are still in `shaping/{feature}--{change}/`. The lineage log, `features/log.md`, gets a "Promotion PR closed without merging" entry saying why. A closed PR can't carry its own entry, so the next commit to the default branch that touches `docs/product/` adds it ([feature-bundles.md](feature-bundles.md#lineage-log)).
A promotion PR closed without merging returns the change to Shaping: its documents are still in `shaping/{feature}--{change}/`, because a promotion PR opens only once the change is in `shaping/` on the default branch ([ratification.md](ratification.md#1-prepare-the-promotion-pr)). The lineage log, `features/log.md`, gets a "Promotion PR closed without merging" entry saying why. A closed PR can't carry its own entry, so the next commit to the default branch that touches `docs/product/` adds it ([feature-bundles.md](feature-bundles.md#lineage-log)).

If the maintainer drops the change instead, the lineage log gets both entries: the "Promotion PR closed without merging" entry, with the outcome Dropped, and a "Dropped change" entry with the drop's reason and the state when dropped ([feature-bundles.md](feature-bundles.md#lineage-log)). The PR that adds the Dropped change entry also deletes the shaping directory. The item moves to Dropped only once the PR that deletes the shaping directory and adds the Dropped change entry merges; until then it stays at Shaping.

Expand Down
Loading