automatasaurus 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +543 -0
- package/bin/cli.js +62 -0
- package/package.json +39 -0
- package/src/commands/init.js +149 -0
- package/src/commands/status.js +68 -0
- package/src/commands/update.js +140 -0
- package/src/lib/block-merge.js +86 -0
- package/src/lib/json-merge.js +121 -0
- package/src/lib/manifest.js +60 -0
- package/src/lib/paths.js +55 -0
- package/src/lib/symlinks.js +127 -0
- package/template/CLAUDE.block.md +357 -0
- package/template/README.md +36 -0
- package/template/agents/architect/AGENT.md +167 -0
- package/template/agents/designer/AGENT.md +289 -0
- package/template/agents/developer/AGENT.md +182 -0
- package/template/agents/tester/AGENT.md +308 -0
- package/template/artifacts/discovery.md.template +193 -0
- package/template/artifacts/implementation-plan.md.template +119 -0
- package/template/commands/discovery.md +325 -0
- package/template/commands/work-all.md +274 -0
- package/template/commands/work-plan.md +169 -0
- package/template/commands/work.md +73 -0
- package/template/commands.block.md +45 -0
- package/template/commands.template.md +156 -0
- package/template/hooks/notify.sh +83 -0
- package/template/hooks/on-stop.sh +54 -0
- package/template/hooks/request-attention.sh +16 -0
- package/template/settings.json +85 -0
- package/template/skills/agent-coordination/SKILL.md +166 -0
- package/template/skills/code-review/SKILL.md +386 -0
- package/template/skills/css-standards/SKILL.md +488 -0
- package/template/skills/github-issues/SKILL.md +144 -0
- package/template/skills/github-workflow/SKILL.md +161 -0
- package/template/skills/infrastructure-standards/SKILL.md +189 -0
- package/template/skills/javascript-standards/SKILL.md +355 -0
- package/template/skills/notifications/SKILL.md +95 -0
- package/template/skills/pr-writing/SKILL.md +259 -0
- package/template/skills/project-commands/SKILL.md +100 -0
- package/template/skills/python-standards/SKILL.md +284 -0
- package/template/skills/requirements-gathering/SKILL.md +212 -0
- package/template/skills/user-stories/SKILL.md +192 -0
- package/template/skills/work-issue/SKILL.md +245 -0
- package/template/skills/workflow-orchestration/SKILL.md +271 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: python-standards
|
|
3
|
+
description: Python coding standards, conventions, and best practices. Use when writing, reviewing, or testing Python code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python Coding Standards
|
|
7
|
+
|
|
8
|
+
## New Project Preferences
|
|
9
|
+
|
|
10
|
+
When starting new Python projects, prefer:
|
|
11
|
+
|
|
12
|
+
- **uv** for package/environment management (fast, modern alternative to pip/venv)
|
|
13
|
+
- **FastAPI** for web APIs
|
|
14
|
+
- **Pydantic** for data validation and serialization
|
|
15
|
+
|
|
16
|
+
## Style Guide
|
|
17
|
+
|
|
18
|
+
Follow PEP 8 with these project-specific additions:
|
|
19
|
+
|
|
20
|
+
### Formatting
|
|
21
|
+
- Line length: 88 characters (Black default)
|
|
22
|
+
- Use Black for formatting, isort for imports
|
|
23
|
+
- Use double quotes for strings (Black default)
|
|
24
|
+
|
|
25
|
+
### Naming Conventions
|
|
26
|
+
```python
|
|
27
|
+
# Modules and packages: lowercase_with_underscores
|
|
28
|
+
user_service.py
|
|
29
|
+
|
|
30
|
+
# Classes: PascalCase
|
|
31
|
+
class UserService:
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
# Functions and variables: snake_case
|
|
35
|
+
def get_user_by_id(user_id: int) -> User:
|
|
36
|
+
active_users = []
|
|
37
|
+
|
|
38
|
+
# Constants: SCREAMING_SNAKE_CASE
|
|
39
|
+
MAX_RETRY_ATTEMPTS = 3
|
|
40
|
+
DEFAULT_TIMEOUT_SECONDS = 30
|
|
41
|
+
|
|
42
|
+
# Private: single leading underscore
|
|
43
|
+
def _internal_helper():
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
# "Private" (name mangling): double leading underscore (rare)
|
|
47
|
+
class Base:
|
|
48
|
+
def __private_method(self):
|
|
49
|
+
pass
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Imports
|
|
53
|
+
```python
|
|
54
|
+
# Order: stdlib, third-party, local (isort handles this)
|
|
55
|
+
import os
|
|
56
|
+
import sys
|
|
57
|
+
from pathlib import Path
|
|
58
|
+
|
|
59
|
+
import requests
|
|
60
|
+
from pydantic import BaseModel
|
|
61
|
+
|
|
62
|
+
from app.models import User
|
|
63
|
+
from app.services import UserService
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Type Hints
|
|
67
|
+
|
|
68
|
+
Always use type hints for function signatures:
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from typing import Optional, List, Dict, Any, Union
|
|
72
|
+
from collections.abc import Sequence, Mapping
|
|
73
|
+
|
|
74
|
+
def process_users(
|
|
75
|
+
users: List[User],
|
|
76
|
+
filter_active: bool = True,
|
|
77
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
78
|
+
) -> List[ProcessedUser]:
|
|
79
|
+
"""Process a list of users with optional filtering."""
|
|
80
|
+
...
|
|
81
|
+
|
|
82
|
+
# Use | for unions (Python 3.10+)
|
|
83
|
+
def get_value(key: str) -> str | None:
|
|
84
|
+
...
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Docstrings
|
|
88
|
+
|
|
89
|
+
Use Google-style docstrings:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
def fetch_user(user_id: int, include_deleted: bool = False) -> User:
|
|
93
|
+
"""Fetch a user by their ID.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
user_id: The unique identifier of the user.
|
|
97
|
+
include_deleted: Whether to include soft-deleted users.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
The User object if found.
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
UserNotFoundError: If no user exists with the given ID.
|
|
104
|
+
DatabaseConnectionError: If the database is unavailable.
|
|
105
|
+
"""
|
|
106
|
+
...
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Error Handling
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
# Be specific with exceptions
|
|
113
|
+
try:
|
|
114
|
+
user = await fetch_user(user_id)
|
|
115
|
+
except UserNotFoundError:
|
|
116
|
+
logger.warning(f"User {user_id} not found")
|
|
117
|
+
raise HTTPException(status_code=404, detail="User not found")
|
|
118
|
+
except DatabaseConnectionError as e:
|
|
119
|
+
logger.error(f"Database error: {e}")
|
|
120
|
+
raise HTTPException(status_code=503, detail="Service unavailable")
|
|
121
|
+
|
|
122
|
+
# Create custom exceptions for domain errors
|
|
123
|
+
class UserNotFoundError(Exception):
|
|
124
|
+
"""Raised when a user cannot be found."""
|
|
125
|
+
def __init__(self, user_id: int):
|
|
126
|
+
self.user_id = user_id
|
|
127
|
+
super().__init__(f"User with ID {user_id} not found")
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Classes and Data
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
# Prefer dataclasses for simple data containers
|
|
134
|
+
from dataclasses import dataclass, field
|
|
135
|
+
from datetime import datetime
|
|
136
|
+
|
|
137
|
+
@dataclass
|
|
138
|
+
class User:
|
|
139
|
+
id: int
|
|
140
|
+
email: str
|
|
141
|
+
name: str
|
|
142
|
+
created_at: datetime = field(default_factory=datetime.utcnow)
|
|
143
|
+
is_active: bool = True
|
|
144
|
+
|
|
145
|
+
# Use Pydantic for validation and serialization
|
|
146
|
+
from pydantic import BaseModel, EmailStr, validator
|
|
147
|
+
|
|
148
|
+
class UserCreate(BaseModel):
|
|
149
|
+
email: EmailStr
|
|
150
|
+
name: str
|
|
151
|
+
|
|
152
|
+
@validator('name')
|
|
153
|
+
def name_must_not_be_empty(cls, v):
|
|
154
|
+
if not v.strip():
|
|
155
|
+
raise ValueError('Name cannot be empty')
|
|
156
|
+
return v.strip()
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Async Code
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
# Use async/await consistently
|
|
163
|
+
async def get_user_with_posts(user_id: int) -> UserWithPosts:
|
|
164
|
+
async with get_db_session() as session:
|
|
165
|
+
user = await session.get(User, user_id)
|
|
166
|
+
posts = await session.execute(
|
|
167
|
+
select(Post).where(Post.user_id == user_id)
|
|
168
|
+
)
|
|
169
|
+
return UserWithPosts(user=user, posts=posts.scalars().all())
|
|
170
|
+
|
|
171
|
+
# Use asyncio.gather for concurrent operations
|
|
172
|
+
async def fetch_all_data(user_id: int) -> tuple[User, list[Post], Settings]:
|
|
173
|
+
user, posts, settings = await asyncio.gather(
|
|
174
|
+
fetch_user(user_id),
|
|
175
|
+
fetch_posts(user_id),
|
|
176
|
+
fetch_settings(user_id),
|
|
177
|
+
)
|
|
178
|
+
return user, posts, settings
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Testing
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
# Use pytest with fixtures
|
|
185
|
+
import pytest
|
|
186
|
+
from unittest.mock import Mock, patch, AsyncMock
|
|
187
|
+
|
|
188
|
+
@pytest.fixture
|
|
189
|
+
def mock_user():
|
|
190
|
+
return User(id=1, email="test@example.com", name="Test User")
|
|
191
|
+
|
|
192
|
+
@pytest.fixture
|
|
193
|
+
def mock_db_session():
|
|
194
|
+
with patch('app.database.get_session') as mock:
|
|
195
|
+
yield mock
|
|
196
|
+
|
|
197
|
+
# Async tests
|
|
198
|
+
@pytest.mark.asyncio
|
|
199
|
+
async def test_fetch_user(mock_db_session, mock_user):
|
|
200
|
+
mock_db_session.return_value.get = AsyncMock(return_value=mock_user)
|
|
201
|
+
|
|
202
|
+
result = await fetch_user(1)
|
|
203
|
+
|
|
204
|
+
assert result.id == 1
|
|
205
|
+
assert result.email == "test@example.com"
|
|
206
|
+
|
|
207
|
+
# Parameterized tests
|
|
208
|
+
@pytest.mark.parametrize("input,expected", [
|
|
209
|
+
("hello", "HELLO"),
|
|
210
|
+
("World", "WORLD"),
|
|
211
|
+
("", ""),
|
|
212
|
+
])
|
|
213
|
+
def test_uppercase(input, expected):
|
|
214
|
+
assert uppercase(input) == expected
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Project Commands
|
|
218
|
+
|
|
219
|
+
Check `.claude/commands.md` for project-specific commands. Common Python commands:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Virtual environment
|
|
223
|
+
python -m venv venv
|
|
224
|
+
source venv/bin/activate # or `venv\Scripts\activate` on Windows
|
|
225
|
+
|
|
226
|
+
# Dependencies
|
|
227
|
+
pip install -r requirements.txt
|
|
228
|
+
pip install -r requirements-dev.txt
|
|
229
|
+
|
|
230
|
+
# Formatting
|
|
231
|
+
black .
|
|
232
|
+
isort .
|
|
233
|
+
|
|
234
|
+
# Linting
|
|
235
|
+
ruff check .
|
|
236
|
+
mypy .
|
|
237
|
+
|
|
238
|
+
# Testing
|
|
239
|
+
pytest
|
|
240
|
+
pytest --cov=app --cov-report=html
|
|
241
|
+
pytest -x -v # stop on first failure, verbose
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Common Patterns
|
|
245
|
+
|
|
246
|
+
### Context Managers
|
|
247
|
+
```python
|
|
248
|
+
from contextlib import contextmanager, asynccontextmanager
|
|
249
|
+
|
|
250
|
+
@contextmanager
|
|
251
|
+
def temporary_file(suffix: str = ".tmp"):
|
|
252
|
+
path = Path(tempfile.mktemp(suffix=suffix))
|
|
253
|
+
try:
|
|
254
|
+
yield path
|
|
255
|
+
finally:
|
|
256
|
+
path.unlink(missing_ok=True)
|
|
257
|
+
|
|
258
|
+
@asynccontextmanager
|
|
259
|
+
async def get_db_connection():
|
|
260
|
+
conn = await create_connection()
|
|
261
|
+
try:
|
|
262
|
+
yield conn
|
|
263
|
+
finally:
|
|
264
|
+
await conn.close()
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Logging
|
|
268
|
+
```python
|
|
269
|
+
import logging
|
|
270
|
+
|
|
271
|
+
logger = logging.getLogger(__name__)
|
|
272
|
+
|
|
273
|
+
def process_order(order_id: int) -> None:
|
|
274
|
+
logger.info(f"Processing order {order_id}")
|
|
275
|
+
try:
|
|
276
|
+
# ... processing
|
|
277
|
+
logger.debug(f"Order {order_id} validated")
|
|
278
|
+
except ValidationError as e:
|
|
279
|
+
logger.warning(f"Order {order_id} validation failed: {e}")
|
|
280
|
+
raise
|
|
281
|
+
except Exception as e:
|
|
282
|
+
logger.exception(f"Unexpected error processing order {order_id}")
|
|
283
|
+
raise
|
|
284
|
+
```
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: requirements-gathering
|
|
3
|
+
description: Discovery questions, checklists, and techniques for gathering requirements. Use during discovery to ensure thorough understanding before creating issues.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Requirements Gathering Skill
|
|
7
|
+
|
|
8
|
+
This skill provides guidance for thorough requirements gathering during discovery.
|
|
9
|
+
|
|
10
|
+
## Core Principle
|
|
11
|
+
|
|
12
|
+
**The more we nail down upfront, the better the results.** Don't assume - ASK.
|
|
13
|
+
|
|
14
|
+
## Your Job During Discovery
|
|
15
|
+
|
|
16
|
+
- Be thorough and inquisitive
|
|
17
|
+
- Ask clarifying questions before creating any issues
|
|
18
|
+
- Uncover hidden assumptions
|
|
19
|
+
- Define the desired end state clearly
|
|
20
|
+
- Identify edge cases early
|
|
21
|
+
- Document what's in scope AND out of scope
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Questions to Ask for Every Feature
|
|
26
|
+
|
|
27
|
+
### Goals & Success
|
|
28
|
+
|
|
29
|
+
- What problem are we solving?
|
|
30
|
+
- What does success look like? How will we measure it?
|
|
31
|
+
- What's the priority relative to other work?
|
|
32
|
+
|
|
33
|
+
### Users & Personas
|
|
34
|
+
|
|
35
|
+
- Who are the users of this feature?
|
|
36
|
+
- Are there different user types with different needs?
|
|
37
|
+
- What permissions/roles are involved?
|
|
38
|
+
|
|
39
|
+
### Core Functionality
|
|
40
|
+
|
|
41
|
+
- What is the primary goal?
|
|
42
|
+
- Walk me through the ideal user flow step by step
|
|
43
|
+
- What happens at each step?
|
|
44
|
+
|
|
45
|
+
### Data & State
|
|
46
|
+
|
|
47
|
+
- What data needs to be captured/stored?
|
|
48
|
+
- What are the required fields vs optional?
|
|
49
|
+
- Are there validation rules? (formats, lengths, ranges)
|
|
50
|
+
- What's the initial/default state?
|
|
51
|
+
|
|
52
|
+
### Edge Cases & Errors
|
|
53
|
+
|
|
54
|
+
- What happens if [X] fails?
|
|
55
|
+
- What if the user enters invalid data?
|
|
56
|
+
- What about empty states? (no data yet)
|
|
57
|
+
- What about concurrent access?
|
|
58
|
+
- Rate limiting needed?
|
|
59
|
+
|
|
60
|
+
### UI/UX (if applicable)
|
|
61
|
+
|
|
62
|
+
- Is there a specific design or layout in mind?
|
|
63
|
+
- Mobile responsive?
|
|
64
|
+
- Accessibility requirements?
|
|
65
|
+
- Loading states? Progress indicators?
|
|
66
|
+
- Success/error feedback to user?
|
|
67
|
+
|
|
68
|
+
### Integration
|
|
69
|
+
|
|
70
|
+
- Does this connect to external services?
|
|
71
|
+
- Are there existing patterns to follow?
|
|
72
|
+
- API format preferences?
|
|
73
|
+
|
|
74
|
+
### Security & Privacy
|
|
75
|
+
|
|
76
|
+
- Is this data sensitive?
|
|
77
|
+
- Authentication required?
|
|
78
|
+
- Who can see/edit this data?
|
|
79
|
+
|
|
80
|
+
### Architecture & Technical
|
|
81
|
+
|
|
82
|
+
- What's the existing tech stack?
|
|
83
|
+
- Are there performance requirements? (latency, throughput, scale)
|
|
84
|
+
- What's the deployment environment?
|
|
85
|
+
- Are there budget constraints?
|
|
86
|
+
- What external services or APIs are involved?
|
|
87
|
+
|
|
88
|
+
### Scope Boundaries
|
|
89
|
+
|
|
90
|
+
- What is explicitly NOT included?
|
|
91
|
+
- Are there future phases we should plan for but not build now?
|
|
92
|
+
- What's the MVP vs nice-to-have?
|
|
93
|
+
- What can we cut if we run short?
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Red Flags to Probe
|
|
98
|
+
|
|
99
|
+
When the user says something vague, dig deeper:
|
|
100
|
+
|
|
101
|
+
| User Says | Ask About |
|
|
102
|
+
|-----------|-----------|
|
|
103
|
+
| "Simple login" | What's simple? OAuth? Email/password? Magic links? |
|
|
104
|
+
| "Just like [X site]" | Which specific features? They have many |
|
|
105
|
+
| "Standard CRUD" | What fields? Validation? Permissions? |
|
|
106
|
+
| "Users can edit" | Edit what exactly? All fields? Their own only? |
|
|
107
|
+
| "Normal validation" | What's normal? Email format? Required fields? |
|
|
108
|
+
| "Handle errors" | Which errors? How? Messages? Retry? |
|
|
109
|
+
| "Make it secure" | What threats? Auth? Encryption? Rate limiting? |
|
|
110
|
+
| "Real-time updates" | WebSockets? SSE? Polling? How fresh? |
|
|
111
|
+
| "Good performance" | What's good? <100ms? <1s? Specific benchmarks? |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Discovery Readiness Checklist
|
|
116
|
+
|
|
117
|
+
**Don't move to issue creation until:**
|
|
118
|
+
|
|
119
|
+
- [ ] You understand the complete user flow
|
|
120
|
+
- [ ] You've identified all user types involved
|
|
121
|
+
- [ ] You know what data is captured and validated
|
|
122
|
+
- [ ] Edge cases and error handling are defined
|
|
123
|
+
- [ ] Security/permission requirements are clear
|
|
124
|
+
- [ ] You know what's explicitly OUT of scope
|
|
125
|
+
- [ ] The user has confirmed your understanding
|
|
126
|
+
- [ ] Architecture approach is validated
|
|
127
|
+
- [ ] UI/UX requirements are captured (if applicable)
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Example: Requirements Interview
|
|
132
|
+
|
|
133
|
+
**User says:** "Add user authentication"
|
|
134
|
+
|
|
135
|
+
**Good discovery response:**
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Before we design this, let me make sure I understand the full scope:
|
|
139
|
+
|
|
140
|
+
**Users:**
|
|
141
|
+
1. Is this for end-users, admins, or both?
|
|
142
|
+
2. Will there be different roles/permissions?
|
|
143
|
+
|
|
144
|
+
**Registration:**
|
|
145
|
+
3. What fields are required? (email, password, name, etc.)
|
|
146
|
+
4. Email verification required?
|
|
147
|
+
5. Password requirements? (length, complexity)
|
|
148
|
+
6. Terms of service acceptance?
|
|
149
|
+
|
|
150
|
+
**Login:**
|
|
151
|
+
7. Remember me / stay logged in option?
|
|
152
|
+
8. Session timeout duration?
|
|
153
|
+
9. Multiple device login allowed?
|
|
154
|
+
|
|
155
|
+
**Password:**
|
|
156
|
+
10. Password reset flow - email link or security questions?
|
|
157
|
+
11. Password change when logged in?
|
|
158
|
+
12. Account lockout after failed attempts?
|
|
159
|
+
|
|
160
|
+
**Security:**
|
|
161
|
+
13. Two-factor authentication needed?
|
|
162
|
+
14. OAuth/social login? (Google, GitHub, etc.)
|
|
163
|
+
15. Rate limiting on login attempts?
|
|
164
|
+
|
|
165
|
+
**Edge cases:**
|
|
166
|
+
16. What happens to existing data/users (if any)?
|
|
167
|
+
17. Account deletion/deactivation?
|
|
168
|
+
|
|
169
|
+
**Out of scope (confirm):**
|
|
170
|
+
18. User profile editing - separate feature?
|
|
171
|
+
19. Admin user management - separate feature?
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Capturing Discovery Output
|
|
177
|
+
|
|
178
|
+
As you gather requirements, document findings in structured format:
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
## Goals
|
|
182
|
+
- [Primary goal]
|
|
183
|
+
- [Success metrics]
|
|
184
|
+
|
|
185
|
+
## Users
|
|
186
|
+
- [User type 1]: [needs]
|
|
187
|
+
- [User type 2]: [needs]
|
|
188
|
+
|
|
189
|
+
## Requirements
|
|
190
|
+
### Must Have (MVP)
|
|
191
|
+
- [Requirement 1]
|
|
192
|
+
- [Requirement 2]
|
|
193
|
+
|
|
194
|
+
### Nice to Have
|
|
195
|
+
- [Requirement 3]
|
|
196
|
+
|
|
197
|
+
## Architecture Considerations
|
|
198
|
+
- [Technical approach]
|
|
199
|
+
- [Constraints]
|
|
200
|
+
|
|
201
|
+
## UI/UX Requirements
|
|
202
|
+
- [Design notes]
|
|
203
|
+
|
|
204
|
+
## Out of Scope
|
|
205
|
+
- [Explicitly excluded item 1]
|
|
206
|
+
- [Explicitly excluded item 2]
|
|
207
|
+
|
|
208
|
+
## Open Questions
|
|
209
|
+
- [Any remaining unknowns]
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
This structured output becomes the `discovery.md` document.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: user-stories
|
|
3
|
+
description: Guidelines for writing effective user stories with clear acceptance criteria. Use when creating issues from discovery findings.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# User Stories Skill
|
|
7
|
+
|
|
8
|
+
This skill provides guidance for writing well-formed user stories with clear acceptance criteria.
|
|
9
|
+
|
|
10
|
+
## User Story Format
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
As a [type of user],
|
|
14
|
+
I want [goal/desire],
|
|
15
|
+
So that [benefit/value].
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Examples
|
|
19
|
+
|
|
20
|
+
**Good:**
|
|
21
|
+
```
|
|
22
|
+
As a registered user,
|
|
23
|
+
I want to reset my password via email,
|
|
24
|
+
So that I can regain access to my account if I forget my password.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Bad:**
|
|
28
|
+
```
|
|
29
|
+
Add password reset feature.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The good example captures WHO needs it, WHAT they need, and WHY.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## INVEST Criteria
|
|
37
|
+
|
|
38
|
+
Good user stories are:
|
|
39
|
+
|
|
40
|
+
| Criteria | Description |
|
|
41
|
+
|----------|-------------|
|
|
42
|
+
| **I**ndependent | Can be developed separately from other stories |
|
|
43
|
+
| **N**egotiable | Details can be discussed and refined |
|
|
44
|
+
| **V**aluable | Delivers clear value to the user |
|
|
45
|
+
| **E**stimable | Can be sized (fits in a single PR) |
|
|
46
|
+
| **S**mall | Implementable in one PR, not weeks of work |
|
|
47
|
+
| **T**estable | Has clear acceptance criteria to verify |
|
|
48
|
+
|
|
49
|
+
### Checking Your Stories
|
|
50
|
+
|
|
51
|
+
- **Independent**: Does this require other stories to be done first? If so, document the dependency.
|
|
52
|
+
- **Negotiable**: Is there flexibility in HOW this is implemented?
|
|
53
|
+
- **Valuable**: Can you explain the user benefit?
|
|
54
|
+
- **Estimable**: Is it clear enough to implement?
|
|
55
|
+
- **Small**: Could this be done in 1-3 days? If not, break it down.
|
|
56
|
+
- **Testable**: Can you write acceptance criteria?
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Acceptance Criteria
|
|
61
|
+
|
|
62
|
+
Acceptance criteria define WHEN a story is complete. They should be:
|
|
63
|
+
|
|
64
|
+
- **Specific**: Clear, unambiguous conditions
|
|
65
|
+
- **Measurable**: Can be verified as pass/fail
|
|
66
|
+
- **Complete**: Cover the happy path AND edge cases
|
|
67
|
+
|
|
68
|
+
### Format
|
|
69
|
+
|
|
70
|
+
Use checkbox format for easy verification:
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
## Acceptance Criteria
|
|
74
|
+
- [ ] User can request password reset with their email
|
|
75
|
+
- [ ] Reset link is sent to registered email only
|
|
76
|
+
- [ ] Reset link expires after 1 hour
|
|
77
|
+
- [ ] User sees error message for unregistered email
|
|
78
|
+
- [ ] User can set new password via reset link
|
|
79
|
+
- [ ] Old password no longer works after reset
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Writing Good Criteria
|
|
83
|
+
|
|
84
|
+
**Good criteria:**
|
|
85
|
+
- [ ] Login form shows error for incorrect password
|
|
86
|
+
- [ ] Error message says "Invalid email or password" (not which is wrong)
|
|
87
|
+
- [ ] Account locks after 5 failed attempts
|
|
88
|
+
|
|
89
|
+
**Bad criteria:**
|
|
90
|
+
- [ ] Login works correctly (too vague)
|
|
91
|
+
- [ ] Errors are handled (not specific)
|
|
92
|
+
- [ ] Good UX (not measurable)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Breaking Down Large Features
|
|
97
|
+
|
|
98
|
+
Large features should be broken into stories sized for a single PR.
|
|
99
|
+
|
|
100
|
+
### Splitting Strategies
|
|
101
|
+
|
|
102
|
+
1. **By User Flow Step**
|
|
103
|
+
- Registration → Login → Password Reset → Session Management
|
|
104
|
+
|
|
105
|
+
2. **By Data Entity**
|
|
106
|
+
- User Model → User API → User UI
|
|
107
|
+
|
|
108
|
+
3. **By User Type**
|
|
109
|
+
- End-user features → Admin features
|
|
110
|
+
|
|
111
|
+
4. **By Complexity Layer**
|
|
112
|
+
- Backend API → Frontend UI → Integration
|
|
113
|
+
|
|
114
|
+
### Example: "User Authentication" Feature
|
|
115
|
+
|
|
116
|
+
Break into:
|
|
117
|
+
|
|
118
|
+
| Issue | Story | Dependencies |
|
|
119
|
+
|-------|-------|--------------|
|
|
120
|
+
| #1 | Database schema for users | None |
|
|
121
|
+
| #2 | User registration endpoint | #1 |
|
|
122
|
+
| #3 | User login endpoint | #1 |
|
|
123
|
+
| #4 | Session management | #3 |
|
|
124
|
+
| #5 | Password reset flow | #2, #3 |
|
|
125
|
+
|
|
126
|
+
Each issue is one PR's worth of work.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Issue Template
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
## User Story
|
|
134
|
+
As a [type of user],
|
|
135
|
+
I want [goal/desire],
|
|
136
|
+
So that [benefit/value].
|
|
137
|
+
|
|
138
|
+
## Acceptance Criteria
|
|
139
|
+
- [ ] Criterion 1
|
|
140
|
+
- [ ] Criterion 2
|
|
141
|
+
- [ ] Criterion 3
|
|
142
|
+
|
|
143
|
+
## Technical Notes
|
|
144
|
+
[Architecture decisions, approach, or constraints]
|
|
145
|
+
|
|
146
|
+
## UI/UX Requirements
|
|
147
|
+
[Design specs, wireframes, or "None - backend only"]
|
|
148
|
+
|
|
149
|
+
## Dependencies
|
|
150
|
+
[List as "Depends on #X" or "None - can be worked independently"]
|
|
151
|
+
|
|
152
|
+
## Out of Scope
|
|
153
|
+
[Explicitly list what is NOT included to avoid scope creep]
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Common Mistakes
|
|
159
|
+
|
|
160
|
+
### Too Big
|
|
161
|
+
**Bad:** "As a user, I want a complete authentication system"
|
|
162
|
+
**Better:** Split into registration, login, password reset, etc.
|
|
163
|
+
|
|
164
|
+
### No User Value
|
|
165
|
+
**Bad:** "Refactor the database layer"
|
|
166
|
+
**Better:** "As a developer, I want a normalized user schema so that queries are faster"
|
|
167
|
+
|
|
168
|
+
### Vague Criteria
|
|
169
|
+
**Bad:** "Login should work well"
|
|
170
|
+
**Better:** "User is redirected to dashboard after successful login"
|
|
171
|
+
|
|
172
|
+
### Missing Edge Cases
|
|
173
|
+
**Bad:** Only happy path criteria
|
|
174
|
+
**Better:** Include error states, empty states, boundary conditions
|
|
175
|
+
|
|
176
|
+
### Hidden Dependencies
|
|
177
|
+
**Bad:** No mention of required prior work
|
|
178
|
+
**Better:** "Depends on #1 (User model must exist first)"
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Verification
|
|
183
|
+
|
|
184
|
+
Before finalizing a story, verify:
|
|
185
|
+
|
|
186
|
+
1. **Is the user clear?** Who specifically benefits?
|
|
187
|
+
2. **Is the goal actionable?** What exactly will they do?
|
|
188
|
+
3. **Is the value stated?** Why does this matter?
|
|
189
|
+
4. **Are criteria testable?** Can each be verified pass/fail?
|
|
190
|
+
5. **Is it sized right?** One PR, not a week of work?
|
|
191
|
+
6. **Are dependencies explicit?** What must exist first?
|
|
192
|
+
7. **Is scope bounded?** What's explicitly excluded?
|