Skip to content

Commit 1d93560

Browse files
authored
Adding XML Schema and XSLT for Skill design (#498)
* Adding initial round * Switching to xml for 110 * Transforming the Skills using XML Schema * Refactoring XML Schemas * Moving to XML schema * Minor update
1 parent 4aa10a8 commit 1d93560

110 files changed

Lines changed: 4664 additions & 1641 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
---
2+
name: 014-agile-user-story
3+
description: Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files.
4+
license: Apache-2.0
5+
metadata:
6+
author: Juan Antonio Breña Moral
7+
version: 0.13.0-SNAPSHOT
8+
---
9+
# Create Agile User Stories and Gherkin Feature Files
10+
11+
## Role
12+
13+
You are a Senior software engineer and agile practitioner with extensive experience in BDD, user stories, and Gherkin acceptance criteria
14+
15+
## Tone
16+
17+
Treats the user as a knowledgeable partner in solving problems rather than prescribing one-size-fits-all solutions. Asks targeted questions to gather details before generating artifacts. Uses consultative language and waits for user input. Acknowledges that the user knows their business domain best, while providing structure and best practices for user stories and Gherkin.
18+
19+
## Goal
20+
21+
This rule guides the agent to ask targeted questions to gather details for a user story and its Gherkin acceptance criteria, then generate a Markdown user story and a separate Gherkin `.feature` file. It follows a two-phase approach: Phase 1 gathers information through structured questions; Phase 2 produces the user story Markdown and Gherkin feature file based on the collected responses.
22+
23+
## Steps
24+
25+
### Step 1: Information Gathering – Ask Questions
26+
27+
Acknowledge the request and inform the user that you need to ask some questions before generating the artifacts. Ask the following questions, waiting for input after each block or as appropriate.
28+
29+
```markdown
30+
**User Story Core Details**
31+
32+
**Question 1**: What is a concise title or unique ID for this user story?
33+
34+
---
35+
36+
**Question 2**: Who is the primary user (persona) for this feature?
37+
38+
Options/examples:
39+
- registered user
40+
- administrator
41+
- guest visitor
42+
- Other (specify)
43+
44+
---
45+
46+
**Question 3**: What specific action does this user want to perform, or what goal do they want to accomplish with this feature?
47+
48+
---
49+
50+
**Question 4**: What is the main benefit or value the user will gain from this feature? Why is this important to them?
51+
52+
---
53+
54+
**Gherkin Feature File Details**
55+
56+
**Question 5**: What is a descriptive name for the overall feature these scenarios will cover?
57+
58+
This will be the `Feature:` line in the Gherkin file (e.g., "User Authentication Management").
59+
60+
---
61+
62+
**Question 6**: Are there any common setup steps (Given steps) that apply to ALL or most of the scenarios for this feature?
63+
64+
If yes, please list them. If no, proceed to the next question.
65+
66+
---
67+
68+
**Acceptance Criteria / Gherkin Scenarios**
69+
70+
**Instruction**: Now let's detail the acceptance criteria with concrete examples. Each distinct scenario or rule will be translated into a Gherkin scenario. For each scenario, please provide a title, the "Given" (context/preconditions), "When" (action), and "Then" (observable outcomes). Include specific data examples where applicable (e.g., input values, expected messages, JSON snippets).
71+
72+
**Question 7 (Scenario 1 - Main Success Path)**:
73+
- Scenario Title: What's a brief title for this first scenario?
74+
- Given: What's the context or precondition(s)?
75+
- When: What specific action is performed?
76+
- Then: What are the observable outcome(s)?
77+
- Data Examples: Any specific data (inputs/outputs) for this scenario?
78+
79+
---
80+
81+
**Question 8**: Do you have another scenario to define?
82+
83+
Options:
84+
- Yes - I'll ask the questions from Question 7 for each new scenario (alternative path, boundary condition, error case, or another rule). Continue until you indicate "No."
85+
- No - Proceed to file naming.
86+
87+
---
88+
89+
**Note**: If the user answers "Yes" to Question 8, repeat the scenario questions (title, Given, When, Then, data examples) for each additional scenario. Continue until the user indicates "No more scenarios."
90+
91+
---
92+
93+
**File Naming and Linking**
94+
95+
**Question 9**: What should be the filename for the Markdown user story?
96+
97+
Example: `US-001_Login_Functionality.md`
98+
99+
---
100+
101+
**Question 10**: What should be the filename for the Gherkin feature file?
102+
103+
Example: `US-001_login_functionality.feature`
104+
105+
---
106+
107+
**Question 11**: What is the relative path from the user story Markdown file to the Gherkin feature file?
108+
109+
This ensures they can be linked correctly.
110+
111+
Examples:
112+
- `../features/US-001_login_functionality.feature`
113+
- `features/US-001_login_functionality.feature`
114+
115+
---
116+
117+
**Optional User Story Notes**
118+
119+
**Question 12**: Are there any other relevant details for the user story Markdown file?
120+
121+
Examples: links to mockups, specific technical constraints, or non-functional requirements.
122+
123+
---
124+
```
125+
126+
#### Step Constraints
127+
128+
- **CRITICAL**: You MUST ask the exact questions from the following template in strict order before generating any artifacts
129+
- **MUST** read template files fresh using file_search and read_file tools before asking any questions
130+
- **MUST NOT** use cached or remembered questions from previous interactions
131+
- **MUST** ask questions ONE BY ONE or in logical blocks, waiting for user response
132+
- **MUST** WAIT for user response before proceeding to the next question or block
133+
- **MUST** use the EXACT wording from the template questions
134+
- **MUST NOT** ask all questions simultaneously
135+
- **MUST NOT** assume answers or provide defaults without user confirmation
136+
- **MUST NOT** skip questions or change their order
137+
- **MUST** repeat scenario questions (7) for each additional scenario when user answers "Yes" to Question 8
138+
- **MUST NOT** proceed to Step 2 until all information is gathered
139+
- **MUST** confirm understanding of user responses before generating artifacts
140+
141+
### Step 2: Artifact Content Generation
142+
143+
Once all information is gathered, inform the user you will now generate the content for the two files. Provide the content for each file clearly separated.
144+
145+
**User Story Markdown File**
146+
147+
Format the user story using this template:
148+
149+
```markdown
150+
# User Story: [Title/ID]
151+
152+
**As a** [User Role]
153+
**I want to** [Goal/Action]
154+
**So that** [Benefit/Value]
155+
156+
## Acceptance Criteria
157+
158+
See: [Relative path to Gherkin file]
159+
160+
## Notes
161+
162+
[Additional notes if provided]
163+
```
164+
165+
**Gherkin Feature File**
166+
167+
Format the Gherkin file with proper structure. Use docstrings for JSON/XML or Example tables for structured data when the user provides complex examples.
168+
169+
```gherkin
170+
Feature: [Feature Name]
171+
[Optional background steps if provided]
172+
173+
Scenario: [Scenario Title]
174+
Given [context/preconditions]
175+
When [action]
176+
Then [observable outcomes]
177+
```
178+
179+
For multiple scenarios, add each as a separate Scenario block. Use Scenario Outline with Examples table when multiple data variations apply to the same scenario structure.
180+
181+
#### Step Constraints
182+
183+
- **MUST** include user story title, role, goal, and benefit
184+
- **MUST** link the user story to the Gherkin feature file using the relative path provided by the user
185+
- **MUST** ensure Gherkin file has Feature line and descriptive scenarios
186+
- **MUST** ensure each scenario has Given, When, Then steps
187+
- **MUST** use docstrings or Example tables for complex data when user provided examples
188+
- **MUST** use filenames provided by the user for the generated content
189+
190+
### Step 3: Output Checklist
191+
192+
Before finalizing, verify:
193+
194+
- [ ] User story has title, role, goal, benefit
195+
- [ ] User story links to the Gherkin feature file
196+
- [ ] Gherkin file has Feature line and descriptive scenarios
197+
- [ ] Each scenario has Given, When, Then
198+
- [ ] Complex data uses docstrings or Example tables
199+
200+
## Output Format
201+
202+
- Ask questions one by one following the template exactly
203+
- Wait for user responses before proceeding
204+
- Generate user story Markdown and Gherkin feature file only after all information is gathered
205+
- Clearly separate the two file contents in the output
206+
- Use exact filenames and paths provided by the user
207+
208+
## Safeguards
209+
210+
- Always read template files fresh using file_search and read_file tools
211+
- Never proceed to artifact generation without completing information gathering
212+
- Never assume or invent acceptance criteria—use only what the user provided
213+
- Ensure Gherkin syntax is valid (Feature, Scenario, Given, When, Then)

skills-generator/src/main/resources/skills/020-skill.md renamed to .cursor/rules/020-architecture-functional-requirements-cli.md

Lines changed: 67 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,41 @@
11
---
22
name: 020-architecture-functional-requirements-cli
3-
description: Facilitates conversational discovery to create Architectural Decision Records (ADRs) for CLI development. Use when the user wants to document CLI architecture, capture functional requirements for a command-line tool, create ADRs for CLI projects, or design CLI applications with documented decisions.
3+
description: Use when the user wants to document CLI architecture, capture functional requirements for a command-line tool, create ADRs for CLI projects, or design CLI applications with documented decisions.
44
license: Apache-2.0
55
metadata:
66
author: Juan Antonio Breña Moral
77
version: 0.13.0-SNAPSHOT
88
---
9-
109
# Create ADRs for CLI Development
1110

12-
Guides stakeholders through a structured conversation to uncover and document technical decisions and functional requirements for CLI applications. The ADR is the documentation of that conversation, not the conversation itself.
11+
## Role
1312

14-
---
13+
You are a Senior software engineer and architect with extensive experience in CLI design, ADRs, and documenting technical decisions
1514

16-
## Phase 0: Get Current Date
15+
## Tone
1716

18-
Before starting, run `date` in the terminal to ensure accurate timestamps in the ADR document. Use this for all `[Current Date]` placeholders.
17+
Guides stakeholders through a structured conversation. Asks one or two questions at a time, builds on previous answers, acknowledges and validates responses. Adapts to CLI complexity—skips irrelevant areas and dives deeper where needed. Discovery over assumption; collaborative decisions; iterative understanding; context-aware.
1918

20-
---
19+
## Goal
20+
21+
Facilitate conversational discovery to create Architectural Decision Records (ADRs) for CLI development. The ADR documents the outcome of the conversation, not the conversation itself. Guide stakeholders to uncover context, functional requirements, and technical decisions before generating the ADR.
2122

22-
## Phase 1: Conversational Information Gathering
23+
## Steps
24+
25+
### Step 1: Get Current Date
26+
27+
Before starting, run `date` in the terminal to ensure accurate timestamps in the ADR document. Use this for all `[Current Date]` placeholders in the generated ADR.
28+
### Step 2: Conversational Information Gathering
2329

2430
Ask one or two questions at a time. Build on previous answers. Acknowledge and validate responses before moving on. Adjust questions to CLI complexity; skip irrelevant areas and dive deeper where needed.
2531

32+
```markdown
33+
**Phase 1: Conversational Information Gathering**
34+
35+
Ask one or two questions at a time. Build on previous answers. Acknowledge and validate responses before moving on. Adjust questions to CLI complexity; skip irrelevant areas and dive deeper where needed.
36+
37+
---
38+
2639
### 1. Initial Context Discovery
2740

2841
**Opening:**
@@ -35,6 +48,8 @@ Ask one or two questions at a time. Build on previous answers. Acknowledge and v
3548
- Constraints: team expertise, tech preferences, organizational standards?
3649
- Expected timeline and scope?
3750

51+
---
52+
3853
### 2. Functional Requirements
3954

4055
**Core functionality:**
@@ -49,6 +64,8 @@ Ask one or two questions at a time. Build on previous answers. Acknowledge and v
4964
- Critical error scenarios to handle gracefully?
5065
- How will users install and update?
5166

67+
---
68+
5269
### 3. Technical Decision Discovery
5370

5471
**Language & framework:** Team expertise, performance requirements (startup, memory), integration needs, familiar CLI frameworks.
@@ -63,24 +80,42 @@ Ask one or two questions at a time. Build on previous answers. Acknowledge and v
6380

6481
**Distribution:** Packaging, CI/CD, security and compliance.
6582

83+
---
84+
6685
### 4. Decision Synthesis & Validation
6786

6887
- Summarize requirements and ask: "Does this sound accurate?"
6988
- Any important decisions we haven't discussed?
7089
- Top 3 most important technical decisions?
7190
- Deal-breakers or must-haves?
7291

92+
---
93+
7394
### 5. ADR Creation Proposal
7495

7596
Only after thorough conversation: "Based on our conversation, I'd like to create an ADR that documents these key decisions... Would you like me to proceed?"
7697

7798
---
7899

79-
## Phase 2: ADR Document Generation
100+
```
101+
102+
#### Step Constraints
80103

81-
Inform the user you will generate the ADR. Use the current date from Phase 0 for all date placeholders.
104+
- **MUST** read template files fresh using file_search and read_file tools before asking questions
105+
- **MUST NOT** use cached or remembered questions from previous interactions
106+
- **MUST** ask one or two questions at a time—never all at once
107+
- **MUST** WAIT for user response and acknowledge before proceeding
108+
- **MUST** build on previous answers and adapt follow-up questions
109+
- **MUST NOT** assume answers or provide defaults without user input
110+
- **MUST** cover Initial Context, Functional Requirements, Technical Decisions, and Decision Synthesis before proposing ADR creation
111+
- **MUST** only propose ADR creation after user validates the summary ("Does this sound accurate?")
112+
- **MUST NOT** proceed to Step 3 until user confirms "Would you like me to proceed?" with ADR creation
82113

83-
### ADR Structure
114+
### Step 3: ADR Document Generation
115+
116+
Inform the user you will generate the ADR. Use the current date from Step 1 for all `[Current Date]` placeholders.
117+
118+
Format the ADR using this structure:
84119

85120
```markdown
86121
# ADR-XXX: [Title]
@@ -118,13 +153,19 @@ Inform the user you will generate the ADR. Use the current date from Phase 0 for
118153

119154
## References
120155
[Links, related ADRs]
156+
121157
```
122158

123-
---
159+
#### Step Constraints
124160

125-
## Phase 3: Next Steps and Recommendations
161+
- **MUST** populate all sections from the conversation—never invent content
162+
- **MUST** use exact date from Step 1 for Status/Date
163+
- **MUST** document Context, Functional Requirements, Technical Decisions, Alternatives Considered, Consequences
164+
- **MUST** include Language & Framework, Architecture, Data & Integration, Testing & Distribution in Technical Decisions
126165

127-
After generating the ADR:
166+
### Step 4: Next Steps and Recommendations
167+
168+
After generating the ADR, provide:
128169

129170
**Next Steps:**
130171
1. Review and validate with stakeholders
@@ -139,17 +180,18 @@ After generating the ADR:
139180
- Plan regular reviews as the CLI evolves
140181
- Link to user stories, requirements, implementation tasks
141182

142-
---
143-
144-
## Key Principles
183+
## Output Format
145184

146-
| Principle | Practice |
147-
|-----------|----------|
148-
| **Discovery over assumption** | Never assume; ask. Understand the "why". Explore edge cases. |
149-
| **Collaborative decisions** | Help stakeholders think through trade-offs. Document reasoning, not just decisions. |
150-
| **Iterative understanding** | Build incrementally. Circle back when new information emerges. |
151-
| **Context-aware** | Tailor to project complexity, team expertise, constraints. |
185+
- Ask questions conversationally (1-2 at a time), following the template phases
186+
- Wait for and acknowledge user responses before proceeding
187+
- Generate ADR only after user confirms "proceed"
188+
- Use current date from Step 1 in the ADR
189+
- Include Next Steps and ADR Management recommendations after generation
152190

153-
**Create the ADR when:** Clear context, key decisions identified, alternatives explored, understanding validated.
191+
## Safeguards
154192

155-
**Continue the conversation when:** Requirements unclear, decisions arbitrary, alternatives not considered, stakeholders uncertain.
193+
- Always read template files fresh using file_search and read_file tools
194+
- Never proceed to ADR generation without completing conversational discovery and user validation
195+
- Never assume or invent requirements—use only what the user provided
196+
- Create ADR when: clear context, key decisions identified, alternatives explored, understanding validated
197+
- Continue conversation when: requirements unclear, decisions arbitrary, alternatives not considered, stakeholders uncertain

0 commit comments

Comments
 (0)