Skip to content

Commit 06aaa3a

Browse files
committed
feat: optimiz spec kit command
1 parent d3af522 commit 06aaa3a

2 files changed

Lines changed: 41 additions & 45 deletions

File tree

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
---
2-
description: "Automatically execute the subsequent code delivery pipeline: changelog → commit → prgenerate, in strict sequential order."
2+
description: 'Automatically execute the subsequent code delivery pipeline: changelog → commit → prgenerate, in strict sequential order.'
33
handoffs:
4-
- agent: speckit.changelog
5-
label: "Phase 1: Generate Changelog"
4+
- label: 'Create Pull Request'
5+
agent: 'speckit.prcreate'
6+
prompt: 'Create the GitHub Pull Request using the generated body'
67
send: true
7-
prompt: "Generate Rush changes since the `develop` branch. Infer bump type automatically (`auto`). If `$ARGUMENTS` are provided, they will be used to override defaults (e.g., `bumpType=patch`). Output the list of created files in `common/changes/`."
8-
- agent: speckit.commit
9-
label: "Phase 2: Create Commit"
10-
send: true
11-
prompt: "Create a Conventional Commits-compliant commit and push to the origin. If `$ARGUMENTS` are provided, they will be used to override defaults (e.g., `message='docs: update readme'` or `pushAfterCommit=false`)."
128
---
139

1410
## User Input
@@ -25,43 +21,43 @@ This command orchestrates the code delivery pipeline, executing the `changelog`,
2521

2622
### Phase 1: Generate Changelog (`/speckit.changelog`)
2723

28-
- **Action**: Initiates the delivery pipeline by invoking `/speckit.changelog`.
29-
- **Process**:
30-
- Collects commits since a base branch (defaulting to `develop`).
31-
- Infers the version bump type (`patch`, `minor`, `major`) automatically from commit messages unless an explicit `bumpType` is passed in `$ARGUMENTS`.
32-
- Generates the necessary change files within the `common/changes/` directory.
33-
- Any parameters provided in `$ARGUMENTS` will be passed through to override default behavior.
34-
- **Handoff**: Upon successful completion, automatically triggers the `commit` phase.
35-
- **Output Report**:
36-
- "Phase 1 (Changelog) completed."
37-
- `CREATED_FILES`: [List of paths to generated files in `common/changes/`]
38-
- `VALIDATION`: "Changelog message conforms to Conventional Commits standards."
24+
- **Action**: Initiates the delivery pipeline by invoking `/speckit.changelog`.
25+
- **Process**:
26+
- Collects commits since a base branch (defaulting to `develop`).
27+
- Infers the version bump type (`patch`, `minor`, `major`) automatically from commit messages unless an explicit `bumpType` is passed in `$ARGUMENTS`.
28+
- Generates the necessary change files within the `common/changes/` directory.
29+
- Any parameters provided in `$ARGUMENTS` will be passed through to override default behavior.
30+
- **Handoff**: Upon successful completion, automatically triggers the `commit` phase.
31+
- **Output Report**:
32+
- "Phase 1 (Changelog) completed."
33+
- `CREATED_FILES`: [List of paths to generated files in `common/changes/`]
34+
- `VALIDATION`: "Changelog message conforms to Conventional Commits standards."
3935

4036
### Phase 2: Create Commit (`/speckit.commit`)
4137

42-
- **Action**: Triggered automatically after `changelog` completes.
43-
- **Process**:
44-
- Stages all current workspace changes (`git add --all`).
45-
- Generates a Conventional Commits-compliant commit message, prioritizing `$ARGUMENTS`, then `common/changes/` content, and finally a generic message.
46-
- Executes `git commit`.
47-
- Pushes the commit to the remote origin by default.
48-
- The `message` and `pushAfterCommit` behaviors can be overridden via `$ARGUMENTS`.
49-
- **Handoff**: Upon successful completion, automatically triggers the `prgenerate` phase.
50-
- **Output Report**:
51-
- "Phase 2 (Commit) completed."
52-
- `COMMIT_MESSAGE`: [The full commit message used]
53-
- `PUSH_STATUS`: "Branch [branch-name] pushed to origin."
38+
- **Action**: Triggered automatically after `changelog` completes.
39+
- **Process**:
40+
- Stages all current workspace changes (`git add --all`).
41+
- Generates a Conventional Commits-compliant commit message, prioritizing `$ARGUMENTS`, then `common/changes/` content, and finally a generic message.
42+
- Executes `git commit`.
43+
- Pushes the commit to the remote origin by default.
44+
- The `message` and `pushAfterCommit` behaviors can be overridden via `$ARGUMENTS`.
45+
- **Handoff**: Upon successful completion, automatically triggers the `prgenerate` phase.
46+
- **Output Report**:
47+
- "Phase 2 (Commit) completed."
48+
- `COMMIT_MESSAGE`: [The full commit message used]
49+
- `PUSH_STATUS`: "Branch [branch-name] pushed to origin."
5450

5551
### Phase 3: Generate PR Body (`/speckit.prgenerate`)
5652

57-
- **Action**: The final phase, realized via the native `handoff` from `/speckit.commit` to `/speckit.prgenerate` after `commit` completes. This `/speckit.aftercode` command does not declare its own `handoff` entry for `/speckit.prgenerate` to avoid duplicate execution.
58-
- **Process**:
59-
- Selects the appropriate PR template (`.github/PULL_REQUEST_TEMPLATE/pr_cn.md` or `.github/PULL_REQUEST_TEMPLATE.md`), defaulting to Chinese unless specified in `$ARGUMENTS`.
60-
- Populates the template with content from `common/changes/`, commit history, and any other available artifacts.
61-
- Saves the final, populated PR body to `.trae/output/pr.body.local.md`.
62-
- **Handoff**: This step retains its original `handoff` to `speckit.prcreate`. The `/speckit.aftercode` command depends strictly on the original single-step handoff chain and does **not** introduce any additional handoffs, preventing `prgenerate` (or downstream steps) from running more than once.
63-
- **Output Report**:
64-
- "Phase 3 (PR Generate) completed."
65-
- `OUTPUT_FILE`: ".trae/output/pr.body.local.md"
66-
- `VALIDATION_SUMMARY`: "PR body generated. Please review the file before creating the pull request."
67-
- `NEXT_STEPS`: "The `speckit.prcreate` command may have been triggered automatically. If not, you can run it manually to create the GitHub Pull Request."
53+
- **Action**: The final phase, realized via the native `handoff` from `/speckit.commit` to `/speckit.prgenerate` after `commit` completes. This `/speckit.aftercode` command does not declare its own `handoff` entry for `/speckit.prgenerate` to avoid duplicate execution.
54+
- **Process**:
55+
- Selects the appropriate PR template (`.github/PULL_REQUEST_TEMPLATE/pr_cn.md` or `.github/PULL_REQUEST_TEMPLATE.md`), defaulting to Chinese unless specified in `$ARGUMENTS`.
56+
- Populates the template with content from `common/changes/`, commit history, and any other available artifacts.
57+
- Saves the final, populated PR body to `.trae/output/pr.body.local.md`.
58+
- **Handoff**: This step retains its original `handoff` to `speckit.prcreate`. The `/speckit.aftercode` command depends strictly on the original single-step handoff chain and does **not** introduce any additional handoffs, preventing `prgenerate` (or downstream steps) from running more than once.
59+
- **Output Report**:
60+
- "Phase 3 (PR Generate) completed."
61+
- `OUTPUT_FILE`: ".trae/output/pr.body.local.md"
62+
- `VALIDATION_SUMMARY`: "PR body generated. Please review the file before creating the pull request."
63+
- `NEXT_STEPS`: "The `speckit.prcreate` command may have been triggered automatically. If not, you can run it manually to create the GitHub Pull Request."

.cursor/commands/speckit.auto.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
description: Automatically execute the four core phases of the Spec-Driven Development (SDD) pipeline: specify → plan → tasks → implement, in strict sequential order.
33
handoffs:
4-
- label: Generate Changelog
5-
agent: speckit.changelog
6-
prompt: Generate Rush changes entries from current work
4+
- label: Execute After-Code Pipeline
5+
agent: speckit.aftercode
6+
prompt: Execute the after-code pipeline.
77
send: true
88
---
99

0 commit comments

Comments
 (0)