@jahanxu/trellis 0.5.0 → 0.5.5
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/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +98 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +8 -58
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +0 -17
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +0 -19
- package/dist/constants/paths.js.map +1 -1
- package/dist/templates/claude/commands/trellis/handoff.md +56 -122
- package/dist/templates/claude/hooks/enforce-output-dir.py +115 -0
- package/dist/templates/claude/hooks/session-start.py +87 -166
- package/dist/templates/claude/settings.json +10 -0
- package/dist/templates/iflow/hooks/session-start.py +0 -171
- package/dist/templates/markdown/index.d.ts +0 -9
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +0 -10
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/trellis/index.d.ts +9 -1
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +17 -2
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/__init__.py +11 -0
- package/dist/templates/trellis/scripts/common/paths.py +1 -49
- package/dist/templates/trellis/scripts/common/roles.py +252 -0
- package/dist/templates/trellis/spec/roles/designer/index.md +49 -0
- package/dist/templates/trellis/spec/roles/frontend-impl/index.md +52 -0
- package/dist/templates/trellis/spec/roles/pm/index.md +44 -0
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +2 -0
- package/dist/utils/template-hash.js.map +1 -1
- package/package.json +2 -2
- package/dist/templates/claude/commands/trellis/pick-task.md +0 -145
- package/dist/templates/iflow/commands/trellis/handoff.md +0 -148
- package/dist/templates/iflow/commands/trellis/pick-task.md +0 -145
- package/dist/templates/markdown/spec/roles/designer/index.md.txt +0 -57
- package/dist/templates/markdown/spec/roles/designer/mock-data-standards.md.txt +0 -63
- package/dist/templates/markdown/spec/roles/designer/prototype-guidelines.md.txt +0 -49
- package/dist/templates/markdown/spec/roles/frontend-impl/api-integration.md.txt +0 -63
- package/dist/templates/markdown/spec/roles/frontend-impl/index.md.txt +0 -57
- package/dist/templates/markdown/spec/roles/frontend-impl/prototype-to-production.md.txt +0 -57
- package/dist/templates/markdown/spec/roles/pm/index.md.txt +0 -45
- package/dist/templates/markdown/spec/roles/pm/prd-template.md.txt +0 -64
- package/dist/templates/markdown/spec/roles/pm/requirement-checklist.md.txt +0 -43
- package/dist/templates/trellis/scripts/pool.py +0 -322
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
# Handoff - Complete Task and Add to Pool
|
|
2
|
-
|
|
3
|
-
Complete the current task, generate a HANDOFF.md document, and add the deliverable to the appropriate pool.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
- Must have a current task set (`.trellis/.current-task`)
|
|
10
|
-
- Task must have deliverable files in the output directory
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Process `[AI]`
|
|
15
|
-
|
|
16
|
-
### Step 1: Read Current Task
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
python3 ./.trellis/scripts/get_context.py
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Read the task's `task.json` to get:
|
|
23
|
-
- `output_dir`: where deliverables are stored
|
|
24
|
-
- `role`: which role completed this task
|
|
25
|
-
- `title`: task title
|
|
26
|
-
- `slug`: task slug / deliverable ID
|
|
27
|
-
|
|
28
|
-
If no current task is set, inform the user and stop.
|
|
29
|
-
|
|
30
|
-
### Step 2: Check Deliverables
|
|
31
|
-
|
|
32
|
-
Verify that the output directory exists and contains files:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
ls -la <output_dir>/
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
If empty or missing, warn the user:
|
|
39
|
-
> "The output directory `<output_dir>` appears empty. Would you like to continue anyway?"
|
|
40
|
-
|
|
41
|
-
### Step 3: Generate HANDOFF.md
|
|
42
|
-
|
|
43
|
-
Analyze all files in the output directory and generate a `HANDOFF.md` document.
|
|
44
|
-
|
|
45
|
-
**For PM role (requirements pool):**
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
48
|
-
# {Title} - Requirements Handoff
|
|
49
|
-
|
|
50
|
-
## Task Info
|
|
51
|
-
- **Feature ID**: {slug}
|
|
52
|
-
- **Title**: {title}
|
|
53
|
-
- **Completed by**: {developer}
|
|
54
|
-
- **Completed at**: {timestamp}
|
|
55
|
-
|
|
56
|
-
## Core Requirements
|
|
57
|
-
(AI-generated summary of PRD key points, 2-3 paragraphs)
|
|
58
|
-
|
|
59
|
-
## Deliverable Files
|
|
60
|
-
- `prd.md` - Product requirements document
|
|
61
|
-
- (list all files)
|
|
62
|
-
|
|
63
|
-
## Key Design Points
|
|
64
|
-
1. (extracted from PRD)
|
|
65
|
-
2. ...
|
|
66
|
-
|
|
67
|
-
## Special Notes for Downstream
|
|
68
|
-
- (important details the Designer should know)
|
|
69
|
-
- (constraints, edge cases, specific UI requirements)
|
|
70
|
-
|
|
71
|
-
## Related Resources
|
|
72
|
-
- (links if any)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**For Designer role (prototypes pool):**
|
|
76
|
-
|
|
77
|
-
```markdown
|
|
78
|
-
# {Title} - Prototype Handoff
|
|
79
|
-
|
|
80
|
-
## Task Info
|
|
81
|
-
- **Feature ID**: {slug}
|
|
82
|
-
- **Based on**: {source requirement}
|
|
83
|
-
- **Completed by**: {developer}
|
|
84
|
-
- **Completed at**: {timestamp}
|
|
85
|
-
|
|
86
|
-
## Design Notes
|
|
87
|
-
(AI-generated summary of design approach, 2-3 paragraphs)
|
|
88
|
-
|
|
89
|
-
## Deliverable Files
|
|
90
|
-
- (list all component files)
|
|
91
|
-
|
|
92
|
-
## Component Structure
|
|
93
|
-
(component tree overview)
|
|
94
|
-
|
|
95
|
-
## Mock Data Notes
|
|
96
|
-
Current mock data used:
|
|
97
|
-
```typescript
|
|
98
|
-
// Document all mock data and their locations
|
|
99
|
-
// Include file name and line numbers
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Logic for Frontend to Implement
|
|
103
|
-
1. Replace mock login handler with real API call (file:line)
|
|
104
|
-
2. Add error handling for network failures
|
|
105
|
-
3. Implement loading state management
|
|
106
|
-
4. ...
|
|
107
|
-
|
|
108
|
-
## Special Notes for Downstream
|
|
109
|
-
- (interactions to preserve)
|
|
110
|
-
- (SDK dependencies)
|
|
111
|
-
- (form validation already implemented)
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Write the generated HANDOFF.md to `<output_dir>/HANDOFF.md`.
|
|
115
|
-
|
|
116
|
-
### Step 4: Ask for Handoff Message (Optional)
|
|
117
|
-
|
|
118
|
-
Ask the user:
|
|
119
|
-
> "Any additional notes for the downstream role? (Press Enter to skip)"
|
|
120
|
-
|
|
121
|
-
If provided, append to the Special Notes section.
|
|
122
|
-
|
|
123
|
-
### Step 5: Add to Pool
|
|
124
|
-
|
|
125
|
-
Determine the target pool based on role:
|
|
126
|
-
- `pm` -> `requirements`
|
|
127
|
-
- `designer` -> `prototypes`
|
|
128
|
-
- `frontend-impl` or `frontend` -> `implementations`
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
python3 ./.trellis/scripts/pool.py add <pool> <slug> "<title>" <output_dir>
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Step 6: Report
|
|
135
|
-
|
|
136
|
-
Output a summary:
|
|
137
|
-
```
|
|
138
|
-
Handoff complete!
|
|
139
|
-
- Deliverable: <slug>
|
|
140
|
-
- Pool: <pool>
|
|
141
|
-
- HANDOFF.md: <output_dir>/HANDOFF.md
|
|
142
|
-
- Status: available
|
|
143
|
-
|
|
144
|
-
Next: The downstream role can pick this up with:
|
|
145
|
-
/trellis:pick-task <pool> <slug>
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Remind the user to commit and push so the downstream role can access the deliverables.
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# Pick Task - Select Upstream Deliverable and Start Working
|
|
2
|
-
|
|
3
|
-
Pick a deliverable from an upstream pool, create a task directory, and inject upstream context.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
/trellis:pick-task <pool> <id>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
- `<pool>`: `requirements` (for Designers) or `prototypes` (for Frontend)
|
|
14
|
-
- `<id>`: deliverable ID to pick (e.g., `user-login`)
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Process `[AI]`
|
|
19
|
-
|
|
20
|
-
### Step 1: Validate Role
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
python3 ./.trellis/scripts/get_context.py
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Read the developer name from `.developer` file. Parse role from `{role}-{name}` convention.
|
|
27
|
-
|
|
28
|
-
Validate role-pool match:
|
|
29
|
-
- `designer` can pick from `requirements`
|
|
30
|
-
- `frontend` / `frontend-impl` can pick from `prototypes`
|
|
31
|
-
- `pm` should NOT pick from pools (PMs create tasks directly)
|
|
32
|
-
|
|
33
|
-
If role cannot be parsed, warn but continue (soft detection).
|
|
34
|
-
|
|
35
|
-
### Step 2: Check Pool Availability
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
python3 ./.trellis/scripts/pool.py status <pool> <id>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Verify the item:
|
|
42
|
-
- Exists in the pool
|
|
43
|
-
- Status is `available` (not `consumed`)
|
|
44
|
-
|
|
45
|
-
If not available, list what IS available:
|
|
46
|
-
```bash
|
|
47
|
-
python3 ./.trellis/scripts/pool.py list <pool>
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Step 3: Check Current Task
|
|
51
|
-
|
|
52
|
-
If there is already a current task set, ask:
|
|
53
|
-
> "You have an active task: `<current-task>`. Would you like to finish it first, or switch to the new task?"
|
|
54
|
-
|
|
55
|
-
If user wants to continue, proceed.
|
|
56
|
-
|
|
57
|
-
### Step 4: Create Task Directory
|
|
58
|
-
|
|
59
|
-
Determine task suffix based on pool:
|
|
60
|
-
- `requirements` pool -> `{id}-prototype`
|
|
61
|
-
- `prototypes` pool -> `{id}-impl`
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
TASK_DIR=$(python3 ./.trellis/scripts/task.py create "<title>" --slug <id>-<suffix>)
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Step 5: Write source.json
|
|
68
|
-
|
|
69
|
-
Create `source.json` in the task directory to reference upstream:
|
|
70
|
-
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"based_on": {
|
|
74
|
-
"type": "<requirement|prototype>",
|
|
75
|
-
"id": "<id>",
|
|
76
|
-
"path": "<deliverable path>",
|
|
77
|
-
"handoff_doc": "<path>/HANDOFF.md"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Write this file:
|
|
83
|
-
```bash
|
|
84
|
-
cat > "$TASK_DIR/source.json" << 'EOF'
|
|
85
|
-
{content}
|
|
86
|
-
EOF
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Step 6: Configure Context (JSONL)
|
|
90
|
-
|
|
91
|
-
Initialize context files for the task:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
python3 ./.trellis/scripts/task.py init-context "$TASK_DIR" frontend
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Add upstream deliverable files and role specs to context:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Add role spec
|
|
101
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement ".trellis/spec/roles/<role>/index.md" "Role guidelines"
|
|
102
|
-
|
|
103
|
-
# Add upstream HANDOFF doc
|
|
104
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<handoff_doc>" "Upstream handoff document"
|
|
105
|
-
|
|
106
|
-
# Add upstream deliverable directory files
|
|
107
|
-
# (add each significant file from the upstream output)
|
|
108
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<upstream_file>" "Upstream deliverable"
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Step 7: Consume from Pool
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
python3 ./.trellis/scripts/pool.py consume <pool> <id> <developer>
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Step 8: Activate Task
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
python3 ./.trellis/scripts/task.py start "$TASK_DIR"
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Step 9: Read Upstream Context
|
|
124
|
-
|
|
125
|
-
Read and summarize the upstream deliverables for the user:
|
|
126
|
-
|
|
127
|
-
1. Read the HANDOFF.md document
|
|
128
|
-
2. List all upstream files
|
|
129
|
-
3. Summarize key points the user should know
|
|
130
|
-
|
|
131
|
-
### Step 10: Report
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
Task picked and ready!
|
|
135
|
-
- Task: <task-dir>
|
|
136
|
-
- Based on: <pool>/<id>
|
|
137
|
-
- Upstream: <deliverable-path>
|
|
138
|
-
- Role specs loaded: .trellis/spec/roles/<role>/
|
|
139
|
-
|
|
140
|
-
Key points from upstream HANDOFF:
|
|
141
|
-
- (summary point 1)
|
|
142
|
-
- (summary point 2)
|
|
143
|
-
|
|
144
|
-
What would you like to work on first?
|
|
145
|
-
```
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Designer Role Guidelines
|
|
2
|
-
|
|
3
|
-
> Standards for interactive prototyping and mock data design.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
This directory contains guidelines for the Designer role in the three-role collaboration pipeline. Fill in each file with your project's specific conventions.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Guidelines Index
|
|
14
|
-
|
|
15
|
-
| Guide | Description | Status |
|
|
16
|
-
|-------|-------------|--------|
|
|
17
|
-
| [Prototype Guidelines](./prototype-guidelines.md) | Component structure and interaction patterns | To fill |
|
|
18
|
-
| [Mock Data Standards](./mock-data-standards.md) | How to create and document mock data | To fill |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Workflow
|
|
23
|
-
|
|
24
|
-
1. Pick a requirement from the pool: `/trellis:pick-task requirements <id>`
|
|
25
|
-
2. Read the upstream HANDOFF.md and PRD carefully
|
|
26
|
-
3. Create runnable prototype code in `deliverables/prototypes/<feature-id>/`
|
|
27
|
-
4. Run `/trellis:handoff` to generate HANDOFF.md and add to pool
|
|
28
|
-
5. Downstream Frontend developer picks from the `prototypes` pool
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Output Directory
|
|
33
|
-
|
|
34
|
-
All Designer deliverables go to: `deliverables/prototypes/<feature-id>/`
|
|
35
|
-
|
|
36
|
-
Required files:
|
|
37
|
-
- Component files (`.tsx`, `.vue`, etc.) - runnable prototype code
|
|
38
|
-
- Mock data inline or in separate files
|
|
39
|
-
|
|
40
|
-
The prototype should:
|
|
41
|
-
- Be runnable (renders correctly with mock data)
|
|
42
|
-
- Follow the project's component conventions (see `spec/frontend/`)
|
|
43
|
-
- Use clear `// TODO:` comments where real logic needs to be added
|
|
44
|
-
- Document all mock data locations
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Key Principle
|
|
49
|
-
|
|
50
|
-
> **The prototype IS the spec for Frontend.**
|
|
51
|
-
>
|
|
52
|
-
> Frontend developers should be able to run your prototype and understand
|
|
53
|
-
> exactly what the final product should look like and behave like.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
**Language**: All documentation should be written in **English**.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Mock Data Standards
|
|
2
|
-
|
|
3
|
-
> How to create, document, and organize mock data in prototypes.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Principles
|
|
8
|
-
|
|
9
|
-
1. **Realistic**: Mock data should look like real data (realistic names, dates, amounts)
|
|
10
|
-
2. **Documented**: Every mock data location must be clearly marked
|
|
11
|
-
3. **Replaceable**: Mock data should be easy to find and replace with real API calls
|
|
12
|
-
4. **Complete**: Cover all data states (populated, empty, error, boundary values)
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Mock Data Location
|
|
17
|
-
|
|
18
|
-
Place mock data at the top of the component file or in a separate `__mocks__/` directory:
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
// === MOCK DATA (start) ===
|
|
22
|
-
const mockUser = {
|
|
23
|
-
id: "1",
|
|
24
|
-
name: "Alice Johnson",
|
|
25
|
-
email: "alice@example.com",
|
|
26
|
-
avatar: "https://i.pravatar.cc/150?u=alice",
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const mockProducts = [
|
|
30
|
-
{ id: "p1", name: "Widget A", price: 29.99, stock: 150 },
|
|
31
|
-
{ id: "p2", name: "Widget B", price: 49.99, stock: 0 },
|
|
32
|
-
];
|
|
33
|
-
// === MOCK DATA (end) ===
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Mock Handler Pattern
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// TODO: Replace with real API call - see api-integration.md
|
|
42
|
-
const handleSubmit = async (formData: FormData) => {
|
|
43
|
-
// Mock: simulate network delay
|
|
44
|
-
await new Promise(resolve => setTimeout(resolve, 800));
|
|
45
|
-
// Mock: simulate success response
|
|
46
|
-
return { success: true, data: mockResponse };
|
|
47
|
-
};
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Edge Case Data
|
|
53
|
-
|
|
54
|
-
Always include mock data for edge cases:
|
|
55
|
-
- Empty list / no results
|
|
56
|
-
- Single item
|
|
57
|
-
- Maximum items (test scrolling/pagination)
|
|
58
|
-
- Long text (test text overflow)
|
|
59
|
-
- Missing optional fields
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
**Language**: All documentation should be written in **English**.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Prototype Guidelines
|
|
2
|
-
|
|
3
|
-
> Standards for creating interactive prototypes.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Component Structure
|
|
8
|
-
|
|
9
|
-
1. **One feature per directory**: Each feature prototype lives in its own directory
|
|
10
|
-
2. **Entry point**: Always have a clear entry component (e.g., `FeaturePage.tsx`)
|
|
11
|
-
3. **Component hierarchy**: Break down into logical sub-components
|
|
12
|
-
4. **Shared components**: Use project's existing shared components when possible
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Interaction Patterns
|
|
17
|
-
|
|
18
|
-
1. **All states**: Implement all UI states (loading, empty, error, success)
|
|
19
|
-
2. **Animations**: Include transition animations if specified in PRD
|
|
20
|
-
3. **Responsive**: Build mobile-first if the PRD requires responsive design
|
|
21
|
-
4. **Accessibility**: Use semantic HTML, ARIA labels, keyboard navigation
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Code Conventions
|
|
26
|
-
|
|
27
|
-
1. Follow the project's existing component patterns (see `spec/frontend/component-guidelines.md`)
|
|
28
|
-
2. Use the project's styling approach (Tailwind, CSS modules, etc.)
|
|
29
|
-
3. Keep components focused and single-purpose
|
|
30
|
-
4. Add clear comments for complex interactions
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## TODO Markers
|
|
35
|
-
|
|
36
|
-
Mark all places where real implementation is needed:
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
// TODO: Replace with real API call
|
|
40
|
-
const data = mockData;
|
|
41
|
-
|
|
42
|
-
// TODO: Add error handling
|
|
43
|
-
// TODO: Implement loading state with skeleton
|
|
44
|
-
// TODO: Connect to auth context
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
**Language**: All documentation should be written in **English**.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# API Integration Guide
|
|
2
|
-
|
|
3
|
-
> How to replace mock data and handlers with real API calls.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Process
|
|
8
|
-
|
|
9
|
-
### 1. Identify All Mock Points
|
|
10
|
-
|
|
11
|
-
Search the prototype for:
|
|
12
|
-
- `// TODO:` comments
|
|
13
|
-
- `// Mock:` comments
|
|
14
|
-
- `mock` variables and functions
|
|
15
|
-
- `setTimeout` simulating API latency
|
|
16
|
-
- Hardcoded data arrays/objects
|
|
17
|
-
|
|
18
|
-
### 2. Map Mock to API
|
|
19
|
-
|
|
20
|
-
For each mock point, determine:
|
|
21
|
-
- Which API endpoint to call
|
|
22
|
-
- Request format (method, headers, body)
|
|
23
|
-
- Response format and how it maps to the component's expected data shape
|
|
24
|
-
- Error responses and how to handle them
|
|
25
|
-
|
|
26
|
-
### 3. Replace Pattern
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
// BEFORE (mock):
|
|
30
|
-
const handleLogin = async (email: string, password: string) => {
|
|
31
|
-
await new Promise(r => setTimeout(r, 800));
|
|
32
|
-
return { success: true, user: mockUser };
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// AFTER (real):
|
|
36
|
-
const handleLogin = async (email: string, password: string) => {
|
|
37
|
-
const response = await api.post('/auth/login', { email, password });
|
|
38
|
-
return response.data;
|
|
39
|
-
};
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Error Handling
|
|
45
|
-
|
|
46
|
-
Every API call must handle:
|
|
47
|
-
1. **Network errors**: Connection timeout, server unreachable
|
|
48
|
-
2. **HTTP errors**: 4xx (client error), 5xx (server error)
|
|
49
|
-
3. **Business errors**: Invalid credentials, insufficient permissions
|
|
50
|
-
4. **Loading states**: Show loading indicator during request
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Testing
|
|
55
|
-
|
|
56
|
-
- Test with real API responses
|
|
57
|
-
- Test with simulated error responses
|
|
58
|
-
- Test loading state transitions
|
|
59
|
-
- Test retry behavior (if implemented)
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
**Language**: All documentation should be written in **English**.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Frontend Implementation Role Guidelines
|
|
2
|
-
|
|
3
|
-
> Standards for converting prototypes to production code.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
This directory contains guidelines for the Frontend Implementation role in the three-role collaboration pipeline. Fill in each file with your project's specific conventions.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Guidelines Index
|
|
14
|
-
|
|
15
|
-
| Guide | Description | Status |
|
|
16
|
-
|-------|-------------|--------|
|
|
17
|
-
| [API Integration](./api-integration.md) | How to replace mock data with real APIs | To fill |
|
|
18
|
-
| [Prototype to Production](./prototype-to-production.md) | Checklist for converting prototypes | To fill |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Workflow
|
|
23
|
-
|
|
24
|
-
1. Pick a prototype from the pool: `/trellis:pick-task prototypes <id>`
|
|
25
|
-
2. Read the upstream HANDOFF.md carefully - it lists all TODOs
|
|
26
|
-
3. Replace mock data with real API calls
|
|
27
|
-
4. Add error handling, loading states, and edge case handling
|
|
28
|
-
5. Write tests for critical paths
|
|
29
|
-
6. Run `/trellis:handoff` to complete
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Output Directory
|
|
34
|
-
|
|
35
|
-
Production code goes directly into the project source tree (e.g., `src/features/<feature>/`).
|
|
36
|
-
|
|
37
|
-
A copy or reference is also placed in: `deliverables/production/<feature-id>/`
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Key Principle
|
|
42
|
-
|
|
43
|
-
> **Preserve the prototype's UX, replace the data layer.**
|
|
44
|
-
>
|
|
45
|
-
> The Designer's prototype defines the look and interaction.
|
|
46
|
-
> Your job is to make it work with real data and handle all edge cases.
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Also Read
|
|
51
|
-
|
|
52
|
-
- `spec/frontend/` - Project frontend conventions (components, hooks, state management)
|
|
53
|
-
- `spec/backend/` - API conventions (if applicable)
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
**Language**: All documentation should be written in **English**.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Prototype to Production Checklist
|
|
2
|
-
|
|
3
|
-
> Step-by-step checklist for converting a Designer's prototype to production code.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Pre-Implementation
|
|
8
|
-
|
|
9
|
-
- [ ] Read HANDOFF.md thoroughly - note all "Logic for Frontend to Implement" items
|
|
10
|
-
- [ ] Identify all mock data locations (search for `// TODO:`, `// Mock:`, `mock` prefix)
|
|
11
|
-
- [ ] Review prototype component structure - decide what to keep vs refactor
|
|
12
|
-
- [ ] Check if prototype components follow project conventions (if not, note adjustments)
|
|
13
|
-
|
|
14
|
-
## Data Layer
|
|
15
|
-
|
|
16
|
-
- [ ] Replace all mock data with API calls or store connections
|
|
17
|
-
- [ ] Add proper TypeScript types for API responses
|
|
18
|
-
- [ ] Implement data fetching hooks (or use existing patterns)
|
|
19
|
-
- [ ] Add caching strategy if needed (React Query, SWR, etc.)
|
|
20
|
-
|
|
21
|
-
## Error Handling
|
|
22
|
-
|
|
23
|
-
- [ ] Add error boundaries for component-level errors
|
|
24
|
-
- [ ] Handle API errors with user-friendly messages
|
|
25
|
-
- [ ] Implement retry logic for transient failures
|
|
26
|
-
- [ ] Add fallback UI for error states
|
|
27
|
-
|
|
28
|
-
## State Management
|
|
29
|
-
|
|
30
|
-
- [ ] Connect to global state (auth, theme, etc.) as needed
|
|
31
|
-
- [ ] Implement form state management
|
|
32
|
-
- [ ] Handle optimistic updates if applicable
|
|
33
|
-
- [ ] Clean up state on unmount
|
|
34
|
-
|
|
35
|
-
## UX Polish
|
|
36
|
-
|
|
37
|
-
- [ ] Loading skeletons for async content
|
|
38
|
-
- [ ] Smooth transitions between states
|
|
39
|
-
- [ ] Keyboard navigation works correctly
|
|
40
|
-
- [ ] Focus management for modals/dialogs
|
|
41
|
-
|
|
42
|
-
## Testing
|
|
43
|
-
|
|
44
|
-
- [ ] Unit tests for business logic
|
|
45
|
-
- [ ] Integration tests for API interactions
|
|
46
|
-
- [ ] Accessibility testing (screen reader, keyboard-only)
|
|
47
|
-
|
|
48
|
-
## Final Check
|
|
49
|
-
|
|
50
|
-
- [ ] All TODO comments from prototype are resolved
|
|
51
|
-
- [ ] No mock data remains in production code
|
|
52
|
-
- [ ] Lint and type check pass
|
|
53
|
-
- [ ] Visual diff with prototype (should look identical)
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
**Language**: All documentation should be written in **English**.
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# PM (Product Manager) Role Guidelines
|
|
2
|
-
|
|
3
|
-
> Standards for product requirements and feature specification.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
This directory contains guidelines for the PM role in the three-role collaboration pipeline. Fill in each file with your project's specific conventions.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Guidelines Index
|
|
14
|
-
|
|
15
|
-
| Guide | Description | Status |
|
|
16
|
-
|-------|-------------|--------|
|
|
17
|
-
| [PRD Template](./prd-template.md) | Standard PRD structure and content requirements | To fill |
|
|
18
|
-
| [Requirement Checklist](./requirement-checklist.md) | Quality checklist before handoff | To fill |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Workflow
|
|
23
|
-
|
|
24
|
-
1. Create a task with `/trellis:start`
|
|
25
|
-
2. Write PRD and supporting documents in `deliverables/requirements/<feature-id>/`
|
|
26
|
-
3. Run `/trellis:handoff` to generate HANDOFF.md and add to pool
|
|
27
|
-
4. Downstream Designer picks from the `requirements` pool
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Output Directory
|
|
32
|
-
|
|
33
|
-
All PM deliverables go to: `deliverables/requirements/<feature-id>/`
|
|
34
|
-
|
|
35
|
-
Required files:
|
|
36
|
-
- `prd.md` - Product requirements document
|
|
37
|
-
|
|
38
|
-
Optional files:
|
|
39
|
-
- `user-stories.md` - Detailed user stories
|
|
40
|
-
- `wireframes/` - Low-fidelity wireframes
|
|
41
|
-
- `acceptance-criteria.md` - Detailed acceptance criteria
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Language**: All documentation should be written in **English**.
|