Create a user story for TDD implementation
Guides the user through creating a well-structured German user story for TDD implementation.
/plugin marketplace add lenneTech/claude-code/plugin install lt-dev@lenne-tech[optional: initial story idea]Guide the user through creating a well-structured user story that can be used as a prompt for Claude Code to implement with Test-Driven Development (TDD).
| Command | Purpose |
|---|---|
/lt-dev:fix-issue | Work on an existing Linear issue |
Workflow: Create story → Save to Linear → /lt-dev:fix-issue to implement
IMPORTANT: The generated story and all user-facing communication must ALWAYS be in German, regardless of the user's input language. Exceptions: Properties (camelCase), code snippets, and technical terms remain in English.
ABORT HANDLING: If the user wants to cancel at any point (e.g., "abbrechen", "stop", "cancel", "nicht mehr"), acknowledge it (in German): "Okay, Story-Erstellung abgebrochen." and stop the process.
Keep these guidelines in mind when generating the story:
Every story should be checked against these criteria:
The story should convey the user's emotional experience, not just technical functionality. Ask "Why does this matter to the user?" - use the 5 Whys technique if the reason is unclear.
Gegeben [Ausgangssituation]
Wenn [Aktion]
Dann [Erwartetes Ergebnis]
Check for argument: If the user provided an initial idea as argument (e.g., /lt-dev:create-story "FAQ Feature"), use that as starting point and skip directly to Step 2.
If no argument provided: Output the following prompt in German and wait for user response:
Bitte beschreibe deine User Story Idee. Teile so viele Details wie möglich mit:
- Wer braucht dieses Feature (Rolle/Nutzertyp)?
- Was soll erreicht werden?
- Warum wird es benötigt?
- Spezifische Anforderungen oder Properties?
- Technische Hinweise?
Schreib einfach deine Gedanken auf - ich helfe dir, sie in eine strukturierte User Story zu bringen.
Wait for the user's response before proceeding to Step 2.
After receiving the user's input, analyze it against this checklist:
Basic Story Elements:
Description Details:
Quality Criteria:
For each missing or unclear element, formulate a specific question in German using the AskUserQuestion tool:
Fehlende Rolle:
Fehlendes Feature/Ziel:
Fehlende Begründung:
Fehlende Properties (only ask if the feature involves data entities):
Fehlende Akzeptanzkriterien:
Unklare Sicherheit:
Fehlende Edge Cases:
Example question (in German): "Deine Story-Idee ist klar bezüglich des Grundfeatures. Ich brauche noch ein paar Details:
If user refuses or skips questions:
When the user doesn't provide information for certain areas, don't just leave gaps - actively suggest sensible completions:
For missing Role:
For missing Reason/Benefit:
For missing Properties:
For missing Acceptance Criteria:
For missing Security/Permissions:
For missing Edge Cases:
Suggestion Format (in German): "Für [Bereich] schlage ich vor: [konkreter Vorschlag]. Passt das so, oder möchtest du etwas ändern?"
Important:
Once all information is gathered, perform a final validation:
If issues found: Ask clarifying questions (in German) before proceeding.
If complete: Proceed to Step 4.
Generate the complete user story in the standard format and present it to the user first.
Display the story in a clearly marked code block so the user can:
After presenting the story, ask (in German): "Ist die Story so in Ordnung, oder möchtest du noch etwas anpassen?"
If changes requested: Make the adjustments and present the updated story again.
If approved: Proceed to Step 5 (Ask for Output Format).
# [Titel - Rolle möchte Feature, damit Begründung]
**Story:** Als [Rolle] möchte ich [Feature], damit [Begründung].
## Beschreibung
[Ausführliche Beschreibung]
### Kontext
[Hintergrund und Systemkontext]
### Anforderungen
[Liste der spezifischen Anforderungen]
### Properties (optional - nur wenn vom Nutzer explizit angegeben)
| Property | Type | Required | Description (EN) | Beschreibung (DE) |
|------------|--------|----------|--------------------|----------------------|
| example | string | yes | Example property | Beispiel-Eigenschaft |
[Diesen Abschnitt komplett weglassen, wenn der Nutzer keine Properties angegeben hat]
### Hinweise (optional)
[Technische Hinweise, Einschränkungen, spezielle Logik - nur wenn relevant]
## Akzeptanzkriterien
- [ ] [Testbares Kriterium 1]
- [ ] [Testbares Kriterium 2]
- [ ] [Sicherheitskriterium]
- [ ] [Edge-Case-Kriterium]
Once the user approves the story, use AskUserQuestion with these 4 options:
Question: "Wie möchtest du mit dieser Story fortfahren?"
| Option | Label | Description |
|---|---|---|
| 1 | Neues Linear Ticket | Neues Ticket in Linear erstellen |
| 2 | Bestehendes Ticket erweitern | Bereits angelegtes Linear Ticket aktualisieren |
| 3 | Markdown-Datei | Story in eine .md-Datei im Projekt speichern |
| 4 | Direkt umsetzen | Sofort mit TDD-Implementierung starten |
Note: The "Other" option allows shortcuts - see below.
After user selects an option:
DEV-123 oder nur 123):"DEV-123, ABC-456): Proceed directly to Step 6, Option 2 with this ID123, 456): Assume DEV- prefix → Proceed to Step 6, Option 2 with DEV-[number]Shortcut hint (optional): After presenting options, you may add: "Tipp: Du kannst bei 'Other' auch direkt eine Ticket-ID eingeben (z.B. 123 für DEV-123)."
Prerequisite: Linear MCP must be installed (lt claude install-mcps linear)
First, check if Linear MCP is available. If not, inform the user (in German):
lt claude install-mcps linear installieren."If Linear MCP is available, ask for Linear project/team (in German):
Create ticket via Linear MCP:
Report the created ticket URL to the user (in German)
Then ask (in German): "Möchtest du diese Story jetzt auch mit TDD umsetzen?"
Prerequisite: Linear MCP must be installed (lt claude install-mcps linear)
Note: The ticket ID was already collected in Step 5 (either via Option 2 selection or "Other" shortcut).
First, check if Linear MCP is available. If not, inform the user (in German):
lt claude install-mcps linear installieren."Fetch the existing ticket via Linear MCP:
get_issue to retrieve the current ticket detailsShow the user the current ticket state (in German):
Update the ticket via Linear MCP:
\n\n---\n\n[story content without title heading]Report the updated ticket URL to the user (in German): "Ticket [ID] wurde erfolgreich aktualisiert: [URL]"
Then ask (in German): "Möchtest du diese Story jetzt auch mit TDD umsetzen?"
Ask for the file location (in German):
docs/stories/faq-verwaltung.md oder stories/STORY-001.md)"stories/admin-faq-verwaltung.md)Validate the path:
Write the story to the specified file
Confirm (in German): "Story gespeichert unter [Pfad]"
Then ask (in German): "Möchtest du diese Story jetzt auch mit TDD umsetzen?"
When the user chooses direct implementation or answers "yes" to TDD after Option 1, 2, or 3:
Confirm (in German): "Starte TDD-Implementierung mit dem building-stories-with-tdd Skill..."
Invoke the building-stories-with-tdd skill with the generated story as context
The skill will handle: test creation, implementation, validation
Here is an example of a well-structured user story:
User's initial input:
"Ich brauche FAQs die der Admin verwalten kann und die auf der Website angezeigt werden. Die sollen eine Reihenfolge haben."
Gap analysis question (in German):
"Du hast erwähnt, dass FAQs eine Reihenfolge haben sollen. Möchtest du die Properties (z.B.
question,answer,position) genauer spezifizieren, oder soll das der Implementierung überlassen werden?"
User response:
"Nein, das kann die Implementierung machen."
Resulting story (suggestions integrated as definitive requirements):
# Admin möchte FAQs verwalten, damit sie auf der Website verfügbar sind
**Story:** Als Admin möchte ich FAQs verwalten können, damit sie allen Besuchern auf der Website zur Verfügung stehen.
## Beschreibung
Es soll ein Modul für FAQs erstellt werden, in dem der Admin FAQs sehen, anlegen, bearbeiten und löschen kann. Nicht eingeloggte Nutzer sollen die FAQs sehen können, damit sie auf der Website dargestellt werden können.
### Kontext
- FAQs sind öffentlich sichtbare Inhalte, die von Administratoren verwaltet werden
- Die Reihenfolge der FAQs ist für die Anzeige wichtig
### Anforderungen
- Admins können vollständige CRUD-Operationen auf FAQs durchführen
- Alle Nutzer (auch Gäste) können FAQs lesen
- FAQs müssen eine bestimmte Reihenfolge haben
- Die Reihenfolgeverwaltung muss automatisch und effizient erfolgen
## Akzeptanzkriterien
- [ ] Administratoren können FAQs vollständig verwalten (GET, POST, DELETE, PUT)
- [ ] Alle Nutzer (auch nicht eingeloggte) können die komplette Liste der FAQs sortiert nach Reihenfolge abrufen
- [ ] Beim Anlegen einer neuen FAQ wird automatisch die nächste Position in der Reihenfolge vergeben
- [ ] Die Reihenfolge der FAQs kann angepasst werden
- [ ] Nicht-Admin-Nutzer können keine FAQs erstellen, bearbeiten oder löschen
Beispiel eines Akzeptanzkriteriums im Gherkin-Format:
Gegeben es existieren bereits 3 FAQs in der Reihenfolge A, B, C
Wenn ein Admin eine neue FAQ D an Position 2 einfügt
Dann ist die neue Reihenfolge A, D, B, C
Und alle anderen FAQs werden entsprechend neu positioniert
123 → DEV-123) skips extra questionKey behaviors:
Remember: A well-written user story leads to better tests and cleaner implementation!