|
| 1 | +# Start Working with Hamster Brief |
| 2 | + |
| 3 | +End-to-end workflow for working on tasks from a connected Hamster brief. All tasks from the brief are worked on in a single branch, with one PR created at the end. |
| 4 | + |
| 5 | +## Step 1: Verify Connection & Authentication |
| 6 | + |
| 7 | +```bash |
| 8 | +# Check current context and authentication status |
| 9 | +tm context |
| 10 | +``` |
| 11 | + |
| 12 | +If not connected or authentication fails: |
| 13 | +- Get brief URL from user if not available |
| 14 | +- Connect: `tm context <brief url>` |
| 15 | +- Refresh token if needed: `tm auth refresh` |
| 16 | + |
| 17 | +## Step 2: List Available Tasks |
| 18 | + |
| 19 | +```bash |
| 20 | +# View all tasks from the brief |
| 21 | +tm list |
| 22 | +``` |
| 23 | + |
| 24 | +Review the task list to understand what needs to be done. Note the total number of tasks. |
| 25 | + |
| 26 | +## Step 3: Initialize Git Branch for Brief |
| 27 | + |
| 28 | +```bash |
| 29 | +# Ensure you're on dev branch and pull latest |
| 30 | +git checkout dev |
| 31 | +git pull origin dev |
| 32 | + |
| 33 | +# Create a single branch for the entire brief (e.g., hamster-brief-YYYY-MM-DD or brief-specific name) |
| 34 | +git checkout -b hamster-brief |
| 35 | + |
| 36 | +# Verify branch creation |
| 37 | +git branch |
| 38 | +``` |
| 39 | + |
| 40 | +**Note**: This branch will be used for ALL tasks in the brief. Do not create separate branches per task. |
| 41 | + |
| 42 | +## Step 4: Task Loop (Repeat for Each Task) |
| 43 | + |
| 44 | +Work through all tasks sequentially in the same branch: |
| 45 | + |
| 46 | +### 4.1: Read Task Details |
| 47 | + |
| 48 | +```bash |
| 49 | +# Get detailed information about the task |
| 50 | +tm show 1 |
| 51 | + |
| 52 | +# If task has subtasks, examine them all |
| 53 | +tm show 1,1.1,1.2,1.3 # Adjust IDs as needed |
| 54 | +``` |
| 55 | + |
| 56 | +### 4.2: Log Initial Context |
| 57 | + |
| 58 | +```bash |
| 59 | +# Document task understanding and initial findings |
| 60 | +tm update-task -i 1 --append --prompt="Starting task implementation. |
| 61 | +
|
| 62 | +Initial context: |
| 63 | +- Task requirements: [summarize key requirements] |
| 64 | +- Dependencies identified: [list any dependencies] |
| 65 | +- Files that may need modification: [list relevant files] |
| 66 | +- Approach planned: [brief implementation approach]" |
| 67 | +``` |
| 68 | + |
| 69 | +### 4.3: Mark Task as In-Progress |
| 70 | + |
| 71 | +```bash |
| 72 | +# Mark task and first subtask (if exists) as in-progress |
| 73 | +tm set-status -i 1,1.1 -s in-progress |
| 74 | +``` |
| 75 | + |
| 76 | +### 4.4: Subtask Implementation Loop |
| 77 | + |
| 78 | +For each subtask (1.1, 1.2, 1.3, etc.): |
| 79 | + |
| 80 | +#### 4.4.1: Read Subtask Details |
| 81 | +```bash |
| 82 | +tm show 1.1 # Replace with current subtask ID |
| 83 | +``` |
| 84 | + |
| 85 | +#### 4.4.2: Log Research & Context Gathering |
| 86 | +```bash |
| 87 | +# Document findings during implementation |
| 88 | +tm update-task -i 1 --append --prompt="Subtask 1.1 - Context gathered: |
| 89 | +
|
| 90 | +- Code exploration findings: [what you discovered] |
| 91 | +- Implementation approach: [how you plan to implement] |
| 92 | +- Key decisions made: [important choices] |
| 93 | +- Challenges encountered: [any blockers or issues]" |
| 94 | +``` |
| 95 | + |
| 96 | +#### 4.4.3: Implement Subtask |
| 97 | +- Write code following the subtask requirements |
| 98 | +- Make necessary changes to files |
| 99 | + |
| 100 | +#### 4.4.4: Quality Verification |
| 101 | +```bash |
| 102 | +# Run linting |
| 103 | +pnpm lint |
| 104 | + |
| 105 | +# Run type checking |
| 106 | +pnpm typecheck |
| 107 | + |
| 108 | +# If either fails, fix issues and re-run until both pass |
| 109 | +``` |
| 110 | + |
| 111 | +#### 4.4.5: CodeRabbit Review |
| 112 | +```bash |
| 113 | +# Generate code review (wait for plain text results) |
| 114 | +coderabbit --prompt-only |
| 115 | + |
| 116 | +# Review the output and address any critical issues if needed |
| 117 | +``` |
| 118 | + |
| 119 | +#### 4.4.6: Log Implementation Completion |
| 120 | +```bash |
| 121 | +# Document what was completed |
| 122 | +tm update-task -i 1 --append --prompt="Subtask 1.1 - Implementation complete: |
| 123 | +
|
| 124 | +- Files modified: [list files changed] |
| 125 | +- Key changes: [summary of implementation] |
| 126 | +- CodeRabbit feedback addressed: [if any issues were fixed] |
| 127 | +- Ready for commit" |
| 128 | +``` |
| 129 | + |
| 130 | +#### 4.4.7: Commit Subtask Work |
| 131 | +```bash |
| 132 | +# Stage changes |
| 133 | +git add . |
| 134 | + |
| 135 | +# Commit with detailed message following git_workflow.mdc format |
| 136 | +git commit -m "feat(task-1): Complete subtask 1.1 - [Subtask Title] |
| 137 | +
|
| 138 | +- Implementation details |
| 139 | +- Key changes made |
| 140 | +- Files modified: [list files] |
| 141 | +- CodeRabbit review completed |
| 142 | +
|
| 143 | +Subtask 1.1: [Brief description of what was accomplished] |
| 144 | +Relates to Task 1: [Main task title]" |
| 145 | +``` |
| 146 | + |
| 147 | +#### 4.4.8: Mark Subtask as Done |
| 148 | +```bash |
| 149 | +tm set-status -i 1.1 -s done |
| 150 | +``` |
| 151 | + |
| 152 | +#### 4.4.9: Move to Next Subtask |
| 153 | +Repeat steps 4.4.1 through 4.4.8 for the next subtask (1.2, 1.3, etc.) |
| 154 | + |
| 155 | +### 4.5: Complete Parent Task |
| 156 | + |
| 157 | +After all subtasks are complete: |
| 158 | + |
| 159 | +#### 4.5.1: Final Quality Checks |
| 160 | +```bash |
| 161 | +# Final linting |
| 162 | +pnpm lint |
| 163 | + |
| 164 | +# Final type checking |
| 165 | +pnpm typecheck |
| 166 | + |
| 167 | +# Final CodeRabbit review |
| 168 | +coderabbit --prompt-only |
| 169 | + |
| 170 | +# Address any remaining issues if critical |
| 171 | +``` |
| 172 | + |
| 173 | +#### 4.5.2: Log Task Completion |
| 174 | +```bash |
| 175 | +# Document final task completion |
| 176 | +tm update-task -i 1 --append --prompt="Task 1 - Complete: |
| 177 | +
|
| 178 | +- All subtasks completed: [list all subtasks] |
| 179 | +- Final verification passed: lint, typecheck, CodeRabbit review |
| 180 | +- Files changed: [comprehensive list] |
| 181 | +- Committed to brief branch" |
| 182 | +``` |
| 183 | + |
| 184 | +#### 4.5.3: Mark Parent Task as Done |
| 185 | +```bash |
| 186 | +tm set-status -i 1 -s done |
| 187 | +``` |
| 188 | + |
| 189 | +**Note**: Do NOT push or create PR yet. Continue to next task in the same branch. |
| 190 | + |
| 191 | +### 4.6: Move to Next Task |
| 192 | + |
| 193 | +```bash |
| 194 | +# Verify remaining tasks |
| 195 | +tm list |
| 196 | + |
| 197 | +# Continue with next task (e.g., Task 2) |
| 198 | +# Repeat steps 4.1 through 4.5 for Task 2, then Task 3, etc. |
| 199 | +``` |
| 200 | + |
| 201 | +## Step 5: Complete All Tasks |
| 202 | + |
| 203 | +Continue working through all tasks (Steps 4.1-4.6) until all tasks in the brief are complete. All work is committed to the same `hamster-brief` branch. |
| 204 | + |
| 205 | +## Step 6: Final Verification & PR Creation |
| 206 | + |
| 207 | +After ALL tasks are complete: |
| 208 | + |
| 209 | +### 6.1: Verify All Tasks Complete |
| 210 | +```bash |
| 211 | +# Verify all tasks are done |
| 212 | +tm list |
| 213 | + |
| 214 | +# Should show all tasks with status 'done' |
| 215 | +``` |
| 216 | + |
| 217 | +### 6.2: Final Quality Checks |
| 218 | +```bash |
| 219 | +# Final comprehensive checks |
| 220 | +pnpm lint |
| 221 | +pnpm typecheck |
| 222 | +coderabbit --prompt-only |
| 223 | + |
| 224 | +# Address any remaining issues if critical |
| 225 | +``` |
| 226 | + |
| 227 | +### 6.3: Push Branch |
| 228 | +```bash |
| 229 | +# Push the brief branch to remote |
| 230 | +git push origin hamster-brief |
| 231 | +``` |
| 232 | + |
| 233 | +### 6.4: Create Pull Request to Dev |
| 234 | +```bash |
| 235 | +# Get all task titles (adjust task IDs as needed) |
| 236 | +# Create comprehensive PR description |
| 237 | + |
| 238 | +gh pr create \ |
| 239 | + --base dev \ |
| 240 | + --title "Hamster Brief: Complete Implementation" \ |
| 241 | + --body "## Brief Overview |
| 242 | +Completed all tasks from Hamster brief. |
| 243 | +
|
| 244 | +## Tasks Completed |
| 245 | +- [x] Task 1: [Task 1 title] |
| 246 | + - Subtasks: 1.1, 1.2, 1.3 |
| 247 | +- [x] Task 2: [Task 2 title] |
| 248 | + - Subtasks: 2.1, 2.2 |
| 249 | +- [x] Task 3: [Task 3 title] |
| 250 | + - [Continue listing all tasks] |
| 251 | +
|
| 252 | +## Implementation Summary |
| 253 | +- Total tasks: [number] |
| 254 | +- Total subtasks: [number] |
| 255 | +- Files modified: [comprehensive list] |
| 256 | +- All quality checks passed |
| 257 | +
|
| 258 | +## Quality Checks |
| 259 | +- ✅ Linting passed (pnpm lint) |
| 260 | +- ✅ Type checking passed (pnpm typecheck) |
| 261 | +- ✅ CodeRabbit review completed for all changes |
| 262 | +
|
| 263 | +## Testing |
| 264 | +- [ ] Manual testing completed |
| 265 | +- [ ] All checks passing |
| 266 | +
|
| 267 | +Complete implementation of Hamster brief tasks" |
| 268 | +``` |
| 269 | + |
| 270 | +## Step 7: Cleanup |
| 271 | + |
| 272 | +```bash |
| 273 | +# After PR is merged, switch back to dev |
| 274 | +git checkout dev |
| 275 | +git pull origin dev |
| 276 | + |
| 277 | +# Delete local branch (optional) |
| 278 | +git branch -d hamster-brief |
| 279 | +``` |
| 280 | + |
| 281 | +## Important Notes |
| 282 | + |
| 283 | +- **Use ONLY**: `tm list`, `tm show <id>`, `tm set-status`, `tm update-task`, `tm auth refresh`, `tm context <brief url>` |
| 284 | +- **DON'T use MCP tools** - not compatible with Hamster integration |
| 285 | +- **Single branch per brief**: All tasks work in the same branch (`hamster-brief`) |
| 286 | +- **Single PR per brief**: One PR created after all tasks are complete |
| 287 | +- **Always target dev branch** - never main branch |
| 288 | +- **Regular logging**: Use `tm update-task -i <id> --append` frequently to document: |
| 289 | + - Context gathered during exploration |
| 290 | + - Implementation decisions made |
| 291 | + - Challenges encountered |
| 292 | + - Completion status |
| 293 | +- **Quality gates**: Never skip lint, typecheck, or CodeRabbit review |
| 294 | +- **Commit format**: Follow git_workflow.mdc commit message standards |
| 295 | +- **PR format**: Always use `--base dev` when creating PRs |
| 296 | + |
| 297 | +## Workflow Summary |
| 298 | + |
| 299 | +``` |
| 300 | +1. Verify connection → tm context |
| 301 | +2. List tasks → tm list |
| 302 | +3. Create single branch → git checkout -b hamster-brief |
| 303 | +4. For each task (in same branch): |
| 304 | + a. Read task → tm show X |
| 305 | + b. Log context → tm update-task -i X --append |
| 306 | + c. Mark in-progress → tm set-status -i X,X.Y -s in-progress |
| 307 | + d. For each subtask: |
| 308 | + - Read → tm show X.Y |
| 309 | + - Log context → tm update-task -i X --append |
| 310 | + - Implement code |
| 311 | + - Verify → pnpm lint && pnpm typecheck |
| 312 | + - Review → coderabbit --prompt-only |
| 313 | + - Log completion → tm update-task -i X --append |
| 314 | + - Commit → git commit (following git_workflow.mdc format) |
| 315 | + - Mark done → tm set-status -i X.Y -s done |
| 316 | + e. Final checks → pnpm lint && pnpm typecheck && coderabbit --prompt-only |
| 317 | + f. Log completion → tm update-task -i X --append |
| 318 | + g. Mark task done → tm set-status -i X -s done |
| 319 | + h. Continue to next task (same branch) |
| 320 | +5. After ALL tasks complete: |
| 321 | + a. Final verification → pnpm lint && pnpm typecheck && coderabbit --prompt-only |
| 322 | + b. Push branch → git push origin hamster-brief |
| 323 | + c. Create PR → gh pr create --base dev |
| 324 | +``` |
| 325 | + |
| 326 | +## References |
| 327 | + |
| 328 | +- Full guidelines: [hamster.mdc](mdc:.cursor/rules/hamster.mdc) |
| 329 | +- Git workflow: [git_workflow.mdc](mdc:.cursor/rules/git_workflow.mdc) |
0 commit comments