plan-flow-skill 1.0.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/.claude/commands/create-contract.md +468 -0
- package/.claude/commands/create-plan.md +512 -0
- package/.claude/commands/discovery-plan.md +561 -0
- package/.claude/commands/execute-plan.md +682 -0
- package/.claude/commands/review-code.md +459 -0
- package/.claude/commands/review-pr.md +651 -0
- package/.claude/commands/setup.md +1609 -0
- package/.claude/commands/write-tests.md +543 -0
- package/.claude/rules/core/allowed-patterns.md +175 -0
- package/.claude/rules/core/complexity-scoring.md +225 -0
- package/.claude/rules/core/forbidden-patterns.md +253 -0
- package/.claude/rules/languages/python-patterns.md +6 -0
- package/.claude/rules/languages/typescript-patterns.md +7 -0
- package/.claude/rules/patterns/contract-patterns.md +332 -0
- package/.claude/rules/patterns/discovery-patterns.md +342 -0
- package/.claude/rules/patterns/discovery-templates.md +319 -0
- package/.claude/rules/patterns/jest-patterns.md +482 -0
- package/.claude/rules/patterns/plans-patterns.md +225 -0
- package/.claude/rules/patterns/plans-templates.md +227 -0
- package/.claude/rules/patterns/pytest-patterns.md +457 -0
- package/.claude/rules/patterns/review-code-templates.md +305 -0
- package/.claude/rules/patterns/review-pr-patterns.md +360 -0
- package/.claude/rules/tools/auth-pr-tool.md +30 -0
- package/.claude/rules/tools/interactive-questions-tool.md +235 -0
- package/.claude/rules/tools/jest-testing-tool.md +73 -0
- package/.claude/rules/tools/plan-mode-tool.md +164 -0
- package/.claude/rules/tools/pytest-testing-tool.md +121 -0
- package/.claude/rules/tools/reference-expansion-tool.md +326 -0
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +139 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/handlers/claude.d.ts +9 -0
- package/dist/cli/handlers/claude.d.ts.map +1 -0
- package/dist/cli/handlers/claude.js +119 -0
- package/dist/cli/handlers/claude.js.map +1 -0
- package/dist/cli/handlers/codex.d.ts +9 -0
- package/dist/cli/handlers/codex.d.ts.map +1 -0
- package/dist/cli/handlers/codex.js +100 -0
- package/dist/cli/handlers/codex.js.map +1 -0
- package/dist/cli/handlers/cursor.d.ts +8 -0
- package/dist/cli/handlers/cursor.d.ts.map +1 -0
- package/dist/cli/handlers/cursor.js +34 -0
- package/dist/cli/handlers/cursor.js.map +1 -0
- package/dist/cli/handlers/openclaw.d.ts +8 -0
- package/dist/cli/handlers/openclaw.d.ts.map +1 -0
- package/dist/cli/handlers/openclaw.js +34 -0
- package/dist/cli/handlers/openclaw.js.map +1 -0
- package/dist/cli/handlers/shared.d.ts +9 -0
- package/dist/cli/handlers/shared.d.ts.map +1 -0
- package/dist/cli/handlers/shared.js +44 -0
- package/dist/cli/handlers/shared.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +43 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/types.d.ts +26 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +5 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/utils/files.d.ts +37 -0
- package/dist/cli/utils/files.d.ts.map +1 -0
- package/dist/cli/utils/files.js +122 -0
- package/dist/cli/utils/files.js.map +1 -0
- package/dist/cli/utils/logger.d.ts +11 -0
- package/dist/cli/utils/logger.d.ts.map +1 -0
- package/dist/cli/utils/logger.js +34 -0
- package/dist/cli/utils/logger.js.map +1 -0
- package/dist/cli/utils/prompts.d.ts +10 -0
- package/dist/cli/utils/prompts.d.ts.map +1 -0
- package/dist/cli/utils/prompts.js +65 -0
- package/dist/cli/utils/prompts.js.map +1 -0
- package/dist/test/setup.d.ts +5 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +7 -0
- package/dist/test/setup.js.map +1 -0
- package/package.json +63 -0
- package/rules/core/_index.mdc +89 -0
- package/rules/core/allowed-patterns.mdc +185 -0
- package/rules/core/complexity-scoring.mdc +235 -0
- package/rules/core/forbidden-patterns.mdc +263 -0
- package/rules/languages/_index.mdc +80 -0
- package/rules/languages/python-patterns.mdc +188 -0
- package/rules/languages/typescript-patterns.mdc +128 -0
- package/rules/patterns/_index.mdc +185 -0
- package/rules/patterns/contract-patterns.mdc +344 -0
- package/rules/patterns/discovery-patterns.mdc +354 -0
- package/rules/patterns/discovery-templates.mdc +329 -0
- package/rules/patterns/jest-patterns.mdc +492 -0
- package/rules/patterns/plans-patterns.mdc +237 -0
- package/rules/patterns/plans-templates.mdc +237 -0
- package/rules/patterns/pytest-patterns.mdc +467 -0
- package/rules/patterns/review-code-templates.mdc +315 -0
- package/rules/patterns/review-pr-patterns.mdc +370 -0
- package/rules/skills/_index.mdc +174 -0
- package/rules/skills/create-contract-skill.mdc +239 -0
- package/rules/skills/create-plan-skill.mdc +271 -0
- package/rules/skills/discovery-skill.mdc +295 -0
- package/rules/skills/execute-plan-skill.mdc +388 -0
- package/rules/skills/review-code-skill.mdc +308 -0
- package/rules/skills/review-pr-skill.mdc +496 -0
- package/rules/skills/setup-skill.mdc +923 -0
- package/rules/skills/write-tests-skill.mdc +294 -0
- package/rules/templates/index-template.mdc +126 -0
- package/rules/tools/_index.mdc +114 -0
- package/rules/tools/auth-pr-tool.mdc +362 -0
- package/rules/tools/interactive-questions-tool.mdc +337 -0
- package/rules/tools/jest-testing-tool.mdc +96 -0
- package/rules/tools/plan-mode-tool.mdc +229 -0
- package/rules/tools/pytest-testing-tool.mdc +144 -0
- package/rules/tools/reference-expansion-tool.mdc +338 -0
- package/skills/plan-flow/SKILL.md +109 -0
- package/skills/plan-flow/create-contract/SKILL.md +139 -0
- package/skills/plan-flow/create-plan/SKILL.md +93 -0
- package/skills/plan-flow/discovery/SKILL.md +85 -0
- package/skills/plan-flow/execute-plan/SKILL.md +89 -0
- package/skills/plan-flow/review-code/SKILL.md +100 -0
- package/skills/plan-flow/review-pr/SKILL.md +122 -0
- package/skills/plan-flow/setup/SKILL.md +73 -0
- package/skills/plan-flow/write-tests/SKILL.md +115 -0
- package/templates/shared/AGENTS.md.template +60 -0
- package/templates/shared/CLAUDE.md.template +62 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Python best practices including type hints and PEP 8 conventions"
|
|
3
|
+
globs: ["**/*.py"]
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Python Best Practices & Patterns
|
|
8
|
+
|
|
9
|
+
## 1. Follow PEP 8 Style Guide
|
|
10
|
+
|
|
11
|
+
Follow PEP 8 conventions. Key naming reminders:
|
|
12
|
+
|
|
13
|
+
- Variables and functions: `lower_case_with_underscores`
|
|
14
|
+
- Classes: `CapWords`
|
|
15
|
+
- Constants: `UPPER_CASE_WITH_UNDERSCORES`
|
|
16
|
+
- Private members: `_leading_underscore`
|
|
17
|
+
|
|
18
|
+
## 2. Use Type Hints
|
|
19
|
+
|
|
20
|
+
Add type annotations for clarity and IDE support:
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from typing import Optional, List, Dict
|
|
24
|
+
|
|
25
|
+
def get_user(user_id: int) -> Optional[Dict[str, str]]:
|
|
26
|
+
"""Fetch user by ID, returns None if not found."""
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
def process_items(items: List[str]) -> Dict[str, int]:
|
|
30
|
+
return {item: len(item) for item in items}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 3. Utilize Dataclasses for Structured Data
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from dataclasses import dataclass, field
|
|
37
|
+
from typing import List
|
|
38
|
+
|
|
39
|
+
@dataclass
|
|
40
|
+
class User:
|
|
41
|
+
id: int
|
|
42
|
+
name: str
|
|
43
|
+
email: str
|
|
44
|
+
active: bool = True
|
|
45
|
+
roles: List[str] = field(default_factory=list)
|
|
46
|
+
|
|
47
|
+
@dataclass(frozen=True) # Immutable
|
|
48
|
+
class Config:
|
|
49
|
+
api_url: str
|
|
50
|
+
timeout: int = 30
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 4. Write Modular Functions
|
|
54
|
+
|
|
55
|
+
Break down code into focused functions with single responsibility:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
def calculate_total_price(items: List[Item]) -> float:
|
|
59
|
+
return sum(item.price for item in items)
|
|
60
|
+
|
|
61
|
+
def validate_order(customer: Customer, items: List[Item]) -> bool:
|
|
62
|
+
return customer.is_active and len(items) > 0
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 5. Avoid Magic Numbers and Strings
|
|
66
|
+
|
|
67
|
+
Use enums and named constants:
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from enum import Enum, auto
|
|
71
|
+
from http import HTTPStatus
|
|
72
|
+
|
|
73
|
+
class OrderStatus(Enum):
|
|
74
|
+
PENDING = auto()
|
|
75
|
+
APPROVED = auto()
|
|
76
|
+
|
|
77
|
+
if status == OrderStatus.APPROVED:
|
|
78
|
+
send_email()
|
|
79
|
+
|
|
80
|
+
if response.status_code == HTTPStatus.OK:
|
|
81
|
+
process_data()
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 6. Use Context Managers for Resource Management
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from contextlib import contextmanager
|
|
88
|
+
|
|
89
|
+
@contextmanager
|
|
90
|
+
def database_connection(url: str):
|
|
91
|
+
conn = create_connection(url)
|
|
92
|
+
try:
|
|
93
|
+
yield conn
|
|
94
|
+
finally:
|
|
95
|
+
conn.close()
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 7. Implement Custom Exceptions
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
class ValidationError(Exception):
|
|
102
|
+
def __init__(self, message: str, field: str = None):
|
|
103
|
+
self.message = message
|
|
104
|
+
self.field = field
|
|
105
|
+
super().__init__(self.message)
|
|
106
|
+
|
|
107
|
+
class NotFoundError(Exception):
|
|
108
|
+
pass
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 8. Async/Await for I/O Operations
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import asyncio
|
|
115
|
+
|
|
116
|
+
async def fetch_data(url: str) -> dict:
|
|
117
|
+
async with aiohttp.ClientSession() as session:
|
|
118
|
+
async with session.get(url) as response:
|
|
119
|
+
return await response.json()
|
|
120
|
+
|
|
121
|
+
async def fetch_all(urls: List[str]) -> List[dict]:
|
|
122
|
+
tasks = [fetch_data(url) for url in urls]
|
|
123
|
+
return await asyncio.gather(*tasks)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 9. Use Dependency Injection
|
|
127
|
+
|
|
128
|
+
Favor dependency injection for testable code:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from abc import ABC, abstractmethod
|
|
132
|
+
|
|
133
|
+
class EmailService(ABC):
|
|
134
|
+
@abstractmethod
|
|
135
|
+
def send(self, to: str, subject: str, body: str) -> bool:
|
|
136
|
+
pass
|
|
137
|
+
|
|
138
|
+
class UserService:
|
|
139
|
+
def __init__(self, email_service: EmailService):
|
|
140
|
+
self._email_service = email_service
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## 10. Use Logging Instead of Print
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
import logging
|
|
147
|
+
|
|
148
|
+
logger = logging.getLogger(__name__)
|
|
149
|
+
|
|
150
|
+
def process_data(data: dict) -> None:
|
|
151
|
+
logger.debug(f"Processing data: {data}")
|
|
152
|
+
try:
|
|
153
|
+
result = transform(data)
|
|
154
|
+
logger.info(f"Successfully processed {len(result)} items")
|
|
155
|
+
except Exception as e:
|
|
156
|
+
logger.exception(f"Error processing data: {e}")
|
|
157
|
+
raise
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## 11. Use Pydantic for Data Validation
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
from pydantic import BaseModel, EmailStr, validator
|
|
164
|
+
|
|
165
|
+
class UserCreate(BaseModel):
|
|
166
|
+
name: str
|
|
167
|
+
email: EmailStr
|
|
168
|
+
|
|
169
|
+
@validator("name")
|
|
170
|
+
def name_must_not_be_empty(cls, v):
|
|
171
|
+
if not v.strip():
|
|
172
|
+
raise ValueError("Name cannot be empty")
|
|
173
|
+
return v.strip()
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## 12. Use Pathlib for File Operations
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
from pathlib import Path
|
|
180
|
+
|
|
181
|
+
file_path = Path(__file__).parent / "data" / "file.txt"
|
|
182
|
+
|
|
183
|
+
if file_path.exists():
|
|
184
|
+
content = file_path.read_text()
|
|
185
|
+
|
|
186
|
+
for py_file in Path(".").glob("**/*.py"):
|
|
187
|
+
print(py_file.name)
|
|
188
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "TypeScript best practices and strict typing patterns"
|
|
3
|
+
globs: ["**/*.ts", "**/*.tsx"]
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TypeScript Best Practices & Patterns
|
|
8
|
+
|
|
9
|
+
## 1. Enable Strict Type-Checking
|
|
10
|
+
|
|
11
|
+
Ensure `strict: true` is enabled in `tsconfig.json` for rigorous type-checking.
|
|
12
|
+
|
|
13
|
+
## 2. Prefer Interfaces for Object Shapes
|
|
14
|
+
|
|
15
|
+
Use interfaces to define object structures:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
interface User {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
email: string;
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Reserve type aliases for unions, intersections, and complex type compositions.
|
|
26
|
+
|
|
27
|
+
## 3. Utilize Discriminated Unions for State Management
|
|
28
|
+
|
|
29
|
+
Model exclusive states with discriminated unions:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
type RequestState =
|
|
33
|
+
| { status: "idle" }
|
|
34
|
+
| { status: "loading" }
|
|
35
|
+
| { status: "success"; data: User }
|
|
36
|
+
| { status: "error"; error: Error };
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 4. Leverage Generics for Reusable Components
|
|
40
|
+
|
|
41
|
+
Use generics for flexible, type-safe components:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
class Cache<T> {
|
|
45
|
+
private data: Map<string, T> = new Map();
|
|
46
|
+
set(key: string, value: T): void { this.data.set(key, value); }
|
|
47
|
+
get(key: string): T | undefined { return this.data.get(key); }
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 5. Implement Custom Error Types
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
class ValidationError extends Error {
|
|
55
|
+
constructor(message: string) {
|
|
56
|
+
super(message);
|
|
57
|
+
this.name = "ValidationError";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 6. Utilize Utility Types
|
|
63
|
+
|
|
64
|
+
Use TypeScript's built-in utility types: `Partial<T>`, `Required<T>`, `Readonly<T>`, `Pick<T, K>`, `Omit<T, K>`, `Record<K, T>`.
|
|
65
|
+
|
|
66
|
+
## 7. Avoid the `any` Type
|
|
67
|
+
|
|
68
|
+
Use `unknown` with type guards instead of `any`:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
let value: unknown;
|
|
72
|
+
|
|
73
|
+
if (typeof value === "string") {
|
|
74
|
+
console.log(value.toUpperCase());
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 8. Enable Null Safety
|
|
79
|
+
|
|
80
|
+
Use optional chaining and nullish coalescing:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
const name = user?.profile?.name;
|
|
84
|
+
const displayName = name ?? "Anonymous";
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 9. Prefer `const` Assertions for Literal Types
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
const roles = ["admin", "user", "guest"] as const;
|
|
91
|
+
const response = { status: "active", code: 200 } as const;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 10. Use Type Guards for Runtime Type Checking
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
function isDog(animal: Dog | Cat): animal is Dog {
|
|
98
|
+
return (animal as Dog).bark !== undefined;
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 11. Prefer Immutability
|
|
103
|
+
|
|
104
|
+
Use `readonly` and `ReadonlyArray` for immutable data:
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
interface Config {
|
|
108
|
+
readonly apiUrl: string;
|
|
109
|
+
readonly timeout: number;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function processItems(items: ReadonlyArray<string>) {
|
|
113
|
+
// items.push('new'); // Error
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 12. Use `satisfies` Operator
|
|
118
|
+
|
|
119
|
+
Validate types while preserving narrower types:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
type Colors = "red" | "green" | "blue";
|
|
123
|
+
|
|
124
|
+
const palette = {
|
|
125
|
+
primary: "red",
|
|
126
|
+
secondary: "blue",
|
|
127
|
+
} satisfies Record<string, Colors>;
|
|
128
|
+
```
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Summary index for patterns - load this to see available references"
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Patterns Index
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Pattern files provide templates, examples, and guidelines for specific workflows. This is the largest category covering discovery, planning, testing, code review, and contracts.
|
|
11
|
+
|
|
12
|
+
**Total Files**: 9 files, ~3,145 lines
|
|
13
|
+
**Reference Codes**: PTN-CON-1 through PTN-PR-6
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Reference Codes
|
|
18
|
+
|
|
19
|
+
### Contract Patterns (`contract-patterns.mdc`)
|
|
20
|
+
|
|
21
|
+
| Code | Description | Source | Lines |
|
|
22
|
+
|------|-------------|--------|-------|
|
|
23
|
+
| PTN-CON-1 | Contract document structure and required sections | contract-patterns.mdc | 24-44 |
|
|
24
|
+
| PTN-CON-2 | Allowed patterns (TypeScript interfaces, status codes, auth examples) | contract-patterns.mdc | 47-171 |
|
|
25
|
+
| PTN-CON-3 | Forbidden patterns (no hardcoded secrets, generic types) | contract-patterns.mdc | 173-250 |
|
|
26
|
+
| PTN-CON-4 | FE integration guidelines (state management, caching) | contract-patterns.mdc | 252-283 |
|
|
27
|
+
|
|
28
|
+
### Discovery Patterns (`discovery-patterns.mdc`)
|
|
29
|
+
|
|
30
|
+
| Code | Description | Source | Lines |
|
|
31
|
+
|------|-------------|--------|-------|
|
|
32
|
+
| PTN-DIS-1 | What is discovery + folder structure | discovery-patterns.mdc | 14-47 |
|
|
33
|
+
| PTN-DIS-2 | Naming conventions + question status tracking | discovery-patterns.mdc | 49-88 |
|
|
34
|
+
| PTN-DIS-3 | Requirements categories (FR, NFR, Constraints) | discovery-patterns.mdc | 90-109 |
|
|
35
|
+
| PTN-DIS-4 | Allowed discovery patterns | discovery-patterns.mdc | 112-213 |
|
|
36
|
+
| PTN-DIS-5 | Forbidden discovery patterns | discovery-patterns.mdc | 215-298 |
|
|
37
|
+
|
|
38
|
+
### Discovery Templates (`discovery-templates.mdc`)
|
|
39
|
+
|
|
40
|
+
| Code | Description | Source | Lines |
|
|
41
|
+
|------|-------------|--------|-------|
|
|
42
|
+
| PTN-DIST-1 | Discovery document template | discovery-templates.mdc | 12-94 |
|
|
43
|
+
| PTN-DIST-2 | Spike template | discovery-templates.mdc | 96-162 |
|
|
44
|
+
| PTN-DIST-3 | Question format examples (functional, technical, UI/UX) | discovery-templates.mdc | 164-215 |
|
|
45
|
+
| PTN-DIST-4 | Referenced documents analysis example | discovery-templates.mdc | 217-242 |
|
|
46
|
+
| PTN-DIST-5 | Requirements gathering example | discovery-templates.mdc | 244-279 |
|
|
47
|
+
| PTN-DIST-6 | Risks and proposed approach examples | discovery-templates.mdc | 281-330 |
|
|
48
|
+
|
|
49
|
+
### Jest Patterns (`jest-patterns.mdc`)
|
|
50
|
+
|
|
51
|
+
| Code | Description | Source | Lines |
|
|
52
|
+
|------|-------------|--------|-------|
|
|
53
|
+
| PTN-JEST-1 | File naming conventions and test location | jest-patterns.mdc | 12-56 |
|
|
54
|
+
| PTN-JEST-2 | Test structure (AAA pattern, describe/it blocks) | jest-patterns.mdc | 58-91 |
|
|
55
|
+
| PTN-JEST-3 | Server and client test setup | jest-patterns.mdc | 93-160 |
|
|
56
|
+
| PTN-JEST-4 | Mock factories and mocking dependencies | jest-patterns.mdc | 162-301 |
|
|
57
|
+
| PTN-JEST-5 | Testing async code, errors, hooks, browser APIs | jest-patterns.mdc | 303-412 |
|
|
58
|
+
| PTN-JEST-6 | Forbidden testing patterns | jest-patterns.mdc | 414-481 |
|
|
59
|
+
|
|
60
|
+
### Plans Patterns (`plans-patterns.mdc`)
|
|
61
|
+
|
|
62
|
+
| Code | Description | Source | Lines |
|
|
63
|
+
|------|-------------|--------|-------|
|
|
64
|
+
| PTN-PLN-1 | Workflow folder structure | plans-patterns.mdc | 14-31 |
|
|
65
|
+
| PTN-PLN-2 | Allowed planning patterns (12 patterns) | plans-patterns.mdc | 39-142 |
|
|
66
|
+
| PTN-PLN-3 | Forbidden planning patterns (13 patterns) | plans-patterns.mdc | 144-223 |
|
|
67
|
+
|
|
68
|
+
### Plans Templates (`plans-templates.mdc`)
|
|
69
|
+
|
|
70
|
+
| Code | Description | Source | Lines |
|
|
71
|
+
|------|-------------|--------|-------|
|
|
72
|
+
| PTN-PLNT-1 | Plan document template | plans-templates.mdc | 12-95 |
|
|
73
|
+
| PTN-PLNT-2 | Phase templates (types, backend, store, UI, integration, tests) | plans-templates.mdc | 98-188 |
|
|
74
|
+
| PTN-PLNT-3 | Key changes and complexity summary examples | plans-templates.mdc | 190-238 |
|
|
75
|
+
|
|
76
|
+
### Pytest Patterns (`pytest-patterns.mdc`)
|
|
77
|
+
|
|
78
|
+
| Code | Description | Source | Lines |
|
|
79
|
+
|------|-------------|--------|-------|
|
|
80
|
+
| PTN-PYTEST-1 | File naming and test structure | pytest-patterns.mdc | 12-77 |
|
|
81
|
+
| PTN-PYTEST-2 | Fixtures and factory fixtures | pytest-patterns.mdc | 79-173 |
|
|
82
|
+
| PTN-PYTEST-3 | Mocking (basic, class instances, async) | pytest-patterns.mdc | 175-241 |
|
|
83
|
+
| PTN-PYTEST-4 | Parametrized tests | pytest-patterns.mdc | 243-276 |
|
|
84
|
+
| PTN-PYTEST-5 | Testing exceptions and context managers | pytest-patterns.mdc | 278-347 |
|
|
85
|
+
| PTN-PYTEST-6 | Async testing and forbidden patterns | pytest-patterns.mdc | 349-457 |
|
|
86
|
+
|
|
87
|
+
### Review Code Templates (`review-code-templates.mdc`)
|
|
88
|
+
|
|
89
|
+
| Code | Description | Source | Lines |
|
|
90
|
+
|------|-------------|--------|-------|
|
|
91
|
+
| PTN-REV-1 | Code review output format template | review-code-templates.mdc | 12-192 |
|
|
92
|
+
| PTN-REV-2 | Pattern conflict example | review-code-templates.mdc | 196-232 |
|
|
93
|
+
| PTN-REV-3 | Rule update recommendation example | review-code-templates.mdc | 234-284 |
|
|
94
|
+
| PTN-REV-4 | Finding example | review-code-templates.mdc | 286-316 |
|
|
95
|
+
|
|
96
|
+
### PR Review Patterns (`review-pr-patterns.mdc`)
|
|
97
|
+
|
|
98
|
+
| Code | Description | Source | Lines |
|
|
99
|
+
|------|-------------|--------|-------|
|
|
100
|
+
| PTN-PR-1 | General PR review checklist | review-pr-patterns.mdc | 32-74 |
|
|
101
|
+
| PTN-PR-2 | TypeScript PR review patterns | review-pr-patterns.mdc | 76-116 |
|
|
102
|
+
| PTN-PR-3 | Python PR review patterns | review-pr-patterns.mdc | 118-163 |
|
|
103
|
+
| PTN-PR-4 | Forbidden patterns to catch in reviews | review-pr-patterns.mdc | 165-253 |
|
|
104
|
+
| PTN-PR-5 | Allowed patterns to encourage | review-pr-patterns.mdc | 255-310 |
|
|
105
|
+
| PTN-PR-6 | Review comment templates and approval criteria | review-pr-patterns.mdc | 312-371 |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## When to Expand
|
|
110
|
+
|
|
111
|
+
### Discovery Workflow
|
|
112
|
+
|
|
113
|
+
| Code | Expand When |
|
|
114
|
+
|------|-------------|
|
|
115
|
+
| PTN-DIS-1 | Starting discovery, need folder structure |
|
|
116
|
+
| PTN-DIS-3 | Categorizing requirements (FR, NFR, C) |
|
|
117
|
+
| PTN-DIST-1 | Creating a discovery document |
|
|
118
|
+
| PTN-DIST-5 | Need requirements gathering example |
|
|
119
|
+
|
|
120
|
+
### Planning Workflow
|
|
121
|
+
|
|
122
|
+
| Code | Expand When |
|
|
123
|
+
|------|-------------|
|
|
124
|
+
| PTN-PLN-1 | Need folder structure reference |
|
|
125
|
+
| PTN-PLN-2 | Need allowed planning patterns |
|
|
126
|
+
| PTN-PLNT-1 | Creating a new plan document |
|
|
127
|
+
| PTN-PLNT-2 | Need phase templates |
|
|
128
|
+
|
|
129
|
+
### Testing (Jest)
|
|
130
|
+
|
|
131
|
+
| Code | Expand When |
|
|
132
|
+
|------|-------------|
|
|
133
|
+
| PTN-JEST-1 | Setting up test file naming |
|
|
134
|
+
| PTN-JEST-2 | Need test structure example |
|
|
135
|
+
| PTN-JEST-3 | Setting up server/client tests |
|
|
136
|
+
| PTN-JEST-4 | Need mock factory examples |
|
|
137
|
+
|
|
138
|
+
### Testing (Pytest)
|
|
139
|
+
|
|
140
|
+
| Code | Expand When |
|
|
141
|
+
|------|-------------|
|
|
142
|
+
| PTN-PYTEST-1 | Setting up pytest file structure |
|
|
143
|
+
| PTN-PYTEST-2 | Need fixture examples |
|
|
144
|
+
| PTN-PYTEST-3 | Need mocking examples |
|
|
145
|
+
| PTN-PYTEST-4 | Need parametrized test examples |
|
|
146
|
+
|
|
147
|
+
### Code Review
|
|
148
|
+
|
|
149
|
+
| Code | Expand When |
|
|
150
|
+
|------|-------------|
|
|
151
|
+
| PTN-REV-1 | Creating code review output |
|
|
152
|
+
| PTN-PR-1 | Need general PR checklist |
|
|
153
|
+
| PTN-PR-2 | Reviewing TypeScript code |
|
|
154
|
+
| PTN-PR-3 | Reviewing Python code |
|
|
155
|
+
|
|
156
|
+
### Contracts
|
|
157
|
+
|
|
158
|
+
| Code | Expand When |
|
|
159
|
+
|------|-------------|
|
|
160
|
+
| PTN-CON-1 | Creating a new contract document |
|
|
161
|
+
| PTN-CON-2 | Need contract pattern examples |
|
|
162
|
+
| PTN-CON-4 | Need FE integration guidance |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Quick Reference by Category
|
|
167
|
+
|
|
168
|
+
### Discovery
|
|
169
|
+
- **PTN-DIS-***: Discovery patterns and rules
|
|
170
|
+
- **PTN-DIST-***: Discovery templates and examples
|
|
171
|
+
|
|
172
|
+
### Planning
|
|
173
|
+
- **PTN-PLN-***: Planning patterns and rules
|
|
174
|
+
- **PTN-PLNT-***: Plan templates
|
|
175
|
+
|
|
176
|
+
### Testing
|
|
177
|
+
- **PTN-JEST-***: Jest testing patterns (JS/TS)
|
|
178
|
+
- **PTN-PYTEST-***: Pytest testing patterns (Python)
|
|
179
|
+
|
|
180
|
+
### Reviews
|
|
181
|
+
- **PTN-REV-***: Code review templates
|
|
182
|
+
- **PTN-PR-***: PR review patterns
|
|
183
|
+
|
|
184
|
+
### Contracts
|
|
185
|
+
- **PTN-CON-***: Integration contract patterns
|