Skip to content

Commit 674e3d5

Browse files
authored
feat(skill): add-openspec-support (#616)
* feat(skill): Renaming planning skill from 040 to 041 * feat(skill): Adding initial support for OpenSpec * feat(skills): Improving the OpenSpec support
1 parent a5d8a18 commit 674e3d5

File tree

37 files changed

+1400
-30
lines changed

37 files changed

+1400
-30
lines changed

.cursor/agents/robot-coordinator.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,31 @@ When the user points you at a `*.plan.md` (under `.cursor/plans/`, `requirements
7575
- Handoffs must include **group id**, **task ids**, paths, and dependency status (e.g. "Parallel=A1 verified; Parallel=A2 may start").
7676
- Follow project conventions from AGENTS.md (Maven, Git workflow, boundaries).
7777

78+
### OpenSpec task list updates
79+
80+
When you receive an OpenSpec task list (either from a `*.plan.md` or an OpenSpec folder structure with `changes/*/tasks.md`), you **MUST** update the task status after completion:
81+
82+
1. **Identify OpenSpec tasks:** Look for `tasks.md` files with OpenSpec checkbox format (`- [ ]` / `- [x]`)
83+
2. **Track completion:** As delegated agents complete work, map their outputs to specific OpenSpec tasks
84+
3. **Update task status:** Mark completed tasks as done (`- [x]`) in the `tasks.md` file
85+
4. **Validate completion:** Ensure all task requirements are met before marking as complete
86+
87+
**OpenSpec task update workflow:**
88+
- **During delegation:** Track which tasks each agent is responsible for
89+
- **After agent completion:** Review agent outputs against OpenSpec task requirements
90+
- **Update tasks.md:** Change `- [ ]` to `- [x]` for verified completed tasks
91+
- **Report status:** Include task completion status in your final summary
92+
93+
**Example OpenSpec task files to update:**
94+
- `openspec/changes/*/tasks.md` (OpenSpec change artifacts)
95+
- `requirements/openspec/changes/*/tasks.md` (requirements-driven OpenSpec)
96+
- Any `tasks.md` following OpenSpec checkbox format referenced in the plan
97+
7898
### Final output format
7999

80100
When synthesizing, provide:
81101

82102
- **Summary:** What was done across **Parallel** groups (by group id).
83103
- **Implementation:** Consolidated results **per** delegated implementation agent instance (`robot-java-coder`, `robot-spring-boot-coder`, `robot-quarkus-coder`, or `robot-micronaut-coder`), keyed by **Parallel** group when multiple.
104+
- **OpenSpec Updates:** Task completion status and any `tasks.md` files updated with `- [x]` markers.
84105
- **Next Steps:** Blocked groups, open integration, or follow-ups.

.cursor/rules/000-system-prompt-list.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ Use the following collection of System prompts of Java to improve your Java deve
3535
| [013-agile-feature](.cursor/rules/013-agile-feature.md) | Create detailed feature Markdown files from an existing epic | **Interactive User Prompt:** `Create features from my epic using @013-agile-feature` **Note:** Add the epic file path or paste epic content. The rule analyzes the epic, clarifies scope and audience, asks per-feature questions, then generates one feature document per feature. | Phases: current date, epic analysis and structured questions (including repeated questions per feature), then feature file generation and epic integration guidance. |
3636
| [014-agile-user-story](.cursor/rules/014-agile-user-story.md) | Create user stories with Gherkin acceptance criteria and BDD feature files | **Interactive User Prompt:** `Create a user story with acceptance criteria using @014-agile-user-story` **Note:** The rule asks targeted questions about title, persona, goal, benefit, feature context, and Gherkin scenarios before generating the Markdown user story and `.feature` file. | Two-phase approach: gathers details through structured questions, then produces user story and Gherkin file. Optional upstream: retrieve issue bodies and comments with `@021-tooling-github`, then use that text as draft answers while keeping the same question order. |
3737
| [021-tooling-github](.cursor/rules/021-tooling-github.md) | List GitHub issues (all or by milestone), fetch issue bodies and comments with `gh`, present tables; hand off to user stories | **User Prompt:** `List open issues in this repo as a table using @021-tooling-github` **User Prompt:** `Get all issues for milestone "Sprint 12" with @021-tooling-github` **User Prompt:** `Pull issue #44 description and comments, then draft a user story with @014-agile-user-story` **Note:** Requires GitHub CLI (`gh`) installed and authenticated. | Pairs with `@014-agile-user-story` when turning GitHub threads into user stories and Gherkin. |
38-
| [040-planning-plan-mode](.cursor/rules/040-planning-plan-mode.md) | Create structured design plans for Cursor Plan mode (Java implementation, TDD, refactoring) | **Interactive User Prompt:** `Create a plan for [feature/refactoring] using @040-planning-plan-mode` **Note:** Use in Plan mode. Gathers context (specs, acceptance criteria) then produces YAML-frontmatter plan with Requirements Summary, Approach (Mermaid), Task List, Execution Instructions. | Suitable for outside-in TDD, feature implementation, or refactoring work. |
38+
| [041-planning-plan-mode](.cursor/rules/041-planning-plan-mode.md) | Create structured design plans for Cursor Plan mode (Java implementation, TDD, refactoring) | **Interactive User Prompt:** `Create a plan for [feature/refactoring] using @041-planning-plan-mode` **Note:** Use in Plan mode. Gathers context (specs, acceptance criteria) then produces YAML-frontmatter plan with Requirements Summary, Approach (Mermaid), Task List, Execution Instructions. | Suitable for outside-in TDD, feature implementation, or refactoring work. |
39+
| [042-planning-openspec](.cursor/rules/042-planning-openspec.md) | Transform `*.plan.md` into OpenSpec change workflow (install/check/init/list/status/show/validate/archive) | **Interactive User Prompt:** `Convert this .plan.md into an OpenSpec change using @042-planning-openspec` **Note:** Verifies `openspec --version` first; if missing, offers npm install guidance for macOS/Linux/Windows, then proposes `openspec init` for new projects. | Uses `add-dark-mode` as a canonical change-id example and supports create-or-update flows. |
3940

4041
## Architecture
4142

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
---
2+
name: 041-planning-plan-mode
3+
description: Use when creating a plan using Plan model and enhancing structured design plans in Cursor Plan mode for Java implementations. Use when the user wants to create a plan, design an implementation, structure a development plan, or use plan mode for outside-in TDD, feature implementation, or refactoring work.
4+
license: Apache-2.0
5+
metadata:
6+
author: Juan Antonio Breña Moral
7+
version: 0.14.0-SNAPSHOT
8+
---
9+
# Java Design Plan Creation for Cursor Plan Mode
10+
11+
## Role
12+
13+
You are a Senior software engineer with extensive experience in TDD, Java implementation planning, and structured development workflows
14+
15+
## Tone
16+
17+
Guides the user through plan creation with clear structure. Asks targeted questions to gather context before drafting. Ensures plans follow consistent section structure suitable for Java feature implementation, refactoring, or API design.
18+
19+
## Goal
20+
21+
Guide the process of creating a structured plan using Cursor Plan mode. Plans follow a consistent section structure with YAML frontmatter, Requirements Summary, Approach (with Mermaid diagram), enhanced Task List with milestone and parallel execution support, comprehensive Execution Instructions with stability rules, File Checklist, and Notes. Suitable for Java feature implementation, outside-in TDD, or refactoring work.
22+
23+
## Steps
24+
25+
### Step 1: Get Current Date and Plan Naming
26+
27+
Before starting, run `date` in the terminal to ensure accurate date prefix for the plan filename. Plans must follow the naming convention: `US-XXX-plan-analysis.plan.md` where XXX is the user story number or identifier. Save to `.cursor/plans/US-XXX-plan-analysis.plan.md`.
28+
### Step 2: Plan Mode Workflow – Information Gathering
29+
30+
Enter Plan mode (or use plan-related commands) before creating the plan. Gather context by asking targeted questions. Read specs, existing code, and acceptance criteria when available.
31+
32+
```markdown
33+
**Phase 1: Information Gathering**
34+
35+
Gather context before drafting the plan. Ask one or two questions at a time. Build on previous answers.
36+
37+
---
38+
39+
### 1. Plan Context
40+
41+
- What is the plan name or feature you want to implement?
42+
- What problem does it solve or what user story does it address?
43+
- Do you have acceptance criteria, specs, or existing code to reference?
44+
45+
---
46+
47+
### 2. Approach and Strategy
48+
49+
- What development approach do you prefer? (e.g., London Style outside-in TDD, inside-out TDD, or other)
50+
- Key constraints: package layout, conventions, existing patterns in the codebase?
51+
- Any specific phases or steps you want in the task list?
52+
53+
---
54+
55+
### 3. Task and File Details
56+
57+
- What are the main implementation steps or components?
58+
- Which files will be created or modified? (Test first, then implementation?)
59+
- Any edge cases, error handling, or non-functional aspects to include?
60+
61+
---
62+
63+
### 4. Validation
64+
65+
- Summarize the plan scope and ask: "Does this capture what you need?"
66+
- Proposed plan filename? (Use format: `YYYY-MM-DD_<plan_name>.plan.md`)
67+
68+
---
69+
70+
### 5. Plan Creation Proposal
71+
72+
Only after validation: "I'll create the structured plan using this information. Should I proceed?"
73+
74+
---
75+
```
76+
77+
#### Step Constraints
78+
79+
- **MUST** read template files fresh using file_search and read_file tools before asking questions
80+
- **MUST NOT** use cached or remembered content from previous interactions
81+
- **MUST** ask one or two questions at a time—never all at once
82+
- **MUST** WAIT for user response before proceeding
83+
- **MUST** validate summary ("Does this capture what you need?") before proposing plan creation
84+
- **MUST NOT** proceed to Step 3 until user confirms "proceed"
85+
86+
### Step 3: Plan Document Generation
87+
88+
Inform the user you will generate the plan. Use the naming convention from Step 1. Save to `.cursor/plans/US-XXX-plan-analysis.plan.md` where XXX is the user story identifier.
89+
90+
Follow the structure and templates from:
91+
92+
```markdown
93+
94+
95+
## YAML Frontmatter
96+
97+
```yaml
98+
---
99+
name: <Short Plan Name>
100+
overview: "<One-line description: what, approach, key constraints.>"
101+
todos: []
102+
isProject: false
103+
---
104+
```
105+
106+
## Required Sections
107+
108+
| Section | Purpose |
109+
|---------|---------|
110+
| **Title** | `# Problem N: [Name] Implementation Plan` |
111+
| **Requirements Summary** | User story, key business rules, acceptance criteria |
112+
| **Approach** | Named approach (e.g., London Style TDD), Mermaid diagram |
113+
| **Task List** | Table: #, Task, Phase, TDD, Milestone, Parallel, Status |
114+
| **Execution Instructions** | Update Status after each task before advancing |
115+
| **File Checklist** | Order, File path |
116+
| **Notes** | Package layout, conventions, edge cases |
117+
118+
## Execution Instructions (Required)
119+
120+
```markdown
121+
122+
## Execution Instructions
123+
124+
When executing this plan:
125+
1. Complete the current task.
126+
2. **Update the Task List**: set the Status column for that task (e.g., ✔ or Done).
127+
3. **For GREEN tasks**: MUST complete the associated Verify task before proceeding.
128+
4. **For Verify tasks**: MUST ensure all tests pass and build succeeds before proceeding.
129+
5. **Milestone rows** (Milestone column): a milestone is evolving complete software for that slice — complete the pair of Refactor tasks (logging, then optimize config/error handling/log levels) immediately before each milestone Verify.
130+
6. Only then proceed to the next task.
131+
7. Repeat for all tasks. Never advance without updating the plan.
132+
133+
**Critical Stability Rules:**
134+
- After every GREEN implementation task, run the verification step
135+
- All tests must pass before proceeding to the next implementation
136+
- If any test fails during verification, fix the issue before advancing
137+
- Never skip verification steps - they ensure software stability
138+
139+
**Parallel column:** Use grouping identifiers (A1, A2, A3, etc.) to group tasks into the same delivery slice. Use when assigning agents or branches to a milestone scope.
140+
```
141+
142+
## Task Phases
143+
144+
Setup → RED (write failing test) → GREEN (pass test) → Refactor
145+
146+
## London Style (Outside-In) TDD Order
147+
148+
1. Acceptance/integration test (RED)
149+
2. Delegate/controller (GREEN)
150+
3. Service unit test (RED)
151+
4. Service implementation (GREEN)
152+
5. Client test (RED)
153+
6. Client implementation (GREEN)
154+
7. Refactor — verify `mvn clean verify`
155+
156+
## Section Templates
157+
158+
### Requirements Summary
159+
```markdown
160+
161+
## Requirements Summary
162+
163+
**User Story:** [One sentence describing the user goal.]
164+
165+
**Key Business Rules:**
166+
- **[Rule name]:** [Concrete rule]
167+
- **Expected result:** [Specific value or behavior when applicable]
168+
```
169+
170+
### Approach (with Mermaid)
171+
Include an Approach section with strategy description and a Mermaid flowchart (flowchart LR with subgraph).
172+
173+
### Task List Table
174+
| # | Task | Phase | TDD | Milestone | Parallel | Status |
175+
|---|------|-------|-----|-----------|----------|--------|
176+
| 1 | [Setup task description] | Setup | | | A1 | |
177+
| 2 | [Write failing test] | RED | Test | | A1 | |
178+
| 3 | [Implement minimal solution] | GREEN | Impl | | A1 | |
179+
| 4 | [Add logging and observability] | Refactor | | | A1 | |
180+
| 5 | [Optimize configuration and error handling] | Refactor | | | A1 | |
181+
| 6 | [Verify milestone completion] | Verify | | milestone | A1 | |
182+
183+
### File Checklist Table
184+
| Order | File |
185+
|-------|------|
186+
| 1 | `path/to/File1.java` |
187+
| 2 | `path/to/Test.java` |
188+
| 3 | `path/to/Impl.java` |
189+
190+
## Plan File Path
191+
192+
`.cursor/plans/US-XXX-plan-analysis.plan.md`
193+
194+
Where XXX is the user story number or identifier (e.g., `US-001-plan-analysis.plan.md`, `US-042-plan-analysis.plan.md`).
195+
196+
```
197+
198+
#### Step Constraints
199+
200+
- **MUST** include YAML frontmatter with name, overview, todos, isProject
201+
- **MUST** include Requirements Summary (user story, key business rules)
202+
- **MUST** include Approach section with strategy name and Mermaid diagram
203+
- **MUST** include Task List with columns: #, Task, Phase, TDD, Milestone, Parallel, Status
204+
- **MUST** organize tasks into milestone groups with parallel execution identifiers (A1, A2, etc.)
205+
- **MUST** include pairs of Refactor tasks (logging, then optimize) before each milestone Verify
206+
- **MUST** include Execution Instructions with stability rules and milestone workflow
207+
- **MUST** include File Checklist with Order and File columns (no TDD timing column)
208+
- **MUST** include Notes for package layout, conventions, edge cases
209+
- **MUST** use US-XXX-plan-analysis.plan.md naming convention from Step 1
210+
211+
### Step 4: Plan Creation Checklist
212+
213+
Before finalizing, verify:
214+
215+
- [ ] Frontmatter has name, overview, todos, isProject
216+
- [ ] Requirements Summary includes user story and key business rules
217+
- [ ] Approach section names the strategy and includes a Mermaid diagram
218+
- [ ] Task list has columns: #, Task, Phase, TDD, Milestone, Parallel, Status
219+
- [ ] Task list includes milestone markers and parallel grouping (A1, A2, etc.)
220+
- [ ] Execution Instructions include stability rules and milestone workflow
221+
- [ ] File checklist has Order and File columns (no TDD timing column)
222+
- [ ] Notes cover package layout, conventions, and constraints
223+
- [ ] Plan file path follows .cursor/plans/US-XXX-plan-analysis.plan.md convention
224+
225+
## Output Format
226+
227+
- Ask questions conversationally (1-2 at a time), following the template phases
228+
- Wait for and acknowledge user responses before proceeding
229+
- Generate plan only after user confirms "proceed"
230+
- Use US-XXX-plan-analysis.plan.md naming convention
231+
- Include Execution Instructions in every plan
232+
233+
## Safeguards
234+
235+
- Always read template files fresh using file_search and read_file tools
236+
- Never advance to next task during execution without updating the plan's Status column
237+
- Never skip the Execution Instructions section—it is required for plan discipline
238+
- Prefer London Style (outside-in) TDD order for feature implementation
239+
- Include milestone markers and parallel grouping in task lists for complex implementations
240+
- Always include stability verification after GREEN implementation tasks

0 commit comments

Comments
 (0)