|
| 1 | +# Project Workflow |
| 2 | + |
| 3 | +> Defines the development workflow conventions for the project. |
| 4 | +> Referenced by `/please:implement`. |
| 5 | +
|
| 6 | +## Guiding Principles |
| 7 | + |
| 8 | +1. **The Plan is the Source of Truth**: All work is tracked in the track's `plan.md` |
| 9 | +2. **The Tech Stack is Deliberate**: Changes to the tech stack must be documented in `tech-stack.md` before implementation |
| 10 | +3. **Test-Driven Development**: Write tests before implementing functionality |
| 11 | +4. **High Code Coverage**: Aim for >80% code coverage for new code |
| 12 | +5. **Non-Interactive & CI-Aware**: Prefer non-interactive commands. Use `CI=true` for watch-mode tools |
| 13 | + |
| 14 | +## Task Workflow |
| 15 | + |
| 16 | +All tasks follow a strict lifecycle within `/please:implement`: |
| 17 | + |
| 18 | +### Standard Task Lifecycle |
| 19 | + |
| 20 | +1. **Select Task**: Choose the next available task from `plan.md` |
| 21 | +2. **Mark In Progress**: Update task status from `[ ]` to `[~]` |
| 22 | +3. **Write Failing Tests (Red Phase)**: |
| 23 | + - Create test file for the feature or bug fix |
| 24 | + - Write unit tests defining expected behavior |
| 25 | + - Run tests and confirm they fail as expected |
| 26 | +4. **Implement to Pass Tests (Green Phase)**: |
| 27 | + - Write minimum code to make failing tests pass |
| 28 | + - Run test suite and confirm all tests pass |
| 29 | +5. **Refactor (Optional)**: |
| 30 | + - Improve clarity, remove duplication, enhance performance |
| 31 | + - Rerun tests to ensure they still pass |
| 32 | +6. **Verify Coverage**: Run coverage reports. Target: >80% for new code |
| 33 | +7. **Document Deviations**: If implementation differs from tech stack, update `tech-stack.md` first |
| 34 | +8. **Commit**: Stage and commit with conventional commit message |
| 35 | +9. **Update Progress**: Mark the task as completed in `## Progress` with a timestamp |
| 36 | + |
| 37 | +### Phase Completion Protocol |
| 38 | + |
| 39 | +Executed when all tasks in a phase are complete: |
| 40 | + |
| 41 | +1. **Verify Test Coverage**: Identify all files changed in the phase, ensure test coverage |
| 42 | +2. **Run Full Test Suite**: Execute all tests, debug failures (max 2 fix attempts) |
| 43 | +3. **Manual Verification Plan**: Generate step-by-step verification instructions for the user |
| 44 | +4. **User Confirmation**: Wait for explicit user approval before proceeding |
| 45 | +5. **Create Checkpoint**: Commit with message `chore(checkpoint): complete phase {name}` |
| 46 | +6. **Update Plan**: Mark phase as complete in `plan.md` |
| 47 | + |
| 48 | +## Quality Gates |
| 49 | + |
| 50 | +Before marking any task complete: |
| 51 | + |
| 52 | +- [ ] All tests pass |
| 53 | +- [ ] Code coverage meets requirements (>80%) |
| 54 | +- [ ] Code follows project style guidelines |
| 55 | +- [ ] No linting or static analysis errors |
| 56 | +- [ ] No security vulnerabilities introduced |
| 57 | +- [ ] Documentation updated if needed |
| 58 | + |
| 59 | +## Development Commands |
| 60 | + |
| 61 | +### Setup |
| 62 | + |
| 63 | +```bash |
| 64 | +bun install |
| 65 | +``` |
| 66 | + |
| 67 | +### Daily Development |
| 68 | + |
| 69 | +```bash |
| 70 | +# Web application |
| 71 | +cd apps/web && bun run dev |
| 72 | + |
| 73 | +# Plugin sync |
| 74 | +bun run skills:sync |
| 75 | +``` |
| 76 | + |
| 77 | +### Testing |
| 78 | + |
| 79 | +```bash |
| 80 | +# Run all tests via Turborepo |
| 81 | +bun run test |
| 82 | + |
| 83 | +# Run project-level tests |
| 84 | +bun run test:projects |
| 85 | + |
| 86 | +# Watch mode |
| 87 | +bun run test:projects:watch |
| 88 | + |
| 89 | +# Integration tests |
| 90 | +bun run test:integration |
| 91 | +``` |
| 92 | + |
| 93 | +### Before Committing |
| 94 | + |
| 95 | +```bash |
| 96 | +# Lint |
| 97 | +bun run lint |
| 98 | + |
| 99 | +# Build (includes typecheck) |
| 100 | +bun run build |
| 101 | + |
| 102 | +# Validate plugin manifests |
| 103 | +claude plugin validate <path-to-plugin-dir> |
| 104 | +``` |
| 105 | + |
| 106 | +## Testing Requirements |
| 107 | + |
| 108 | +### Unit Testing |
| 109 | + |
| 110 | +- Every module must have corresponding tests |
| 111 | +- Mock external dependencies |
| 112 | +- Test both success and failure cases |
| 113 | + |
| 114 | +### Integration Testing |
| 115 | + |
| 116 | +- Test complete user flows |
| 117 | +- Verify data transactions |
| 118 | +- Test authentication and authorization |
| 119 | + |
| 120 | +## Commit Guidelines |
| 121 | + |
| 122 | +Follow the project's commit convention. See `Skill("standards:commit-convention")` for details. |
| 123 | + |
| 124 | +### Types |
| 125 | + |
| 126 | +- `feat`: New feature |
| 127 | +- `fix`: Bug fix |
| 128 | +- `docs`: Documentation only |
| 129 | +- `style`: Formatting changes |
| 130 | +- `refactor`: Code change without behavior change |
| 131 | +- `test`: Adding or updating tests |
| 132 | +- `chore`: Maintenance tasks |
| 133 | + |
| 134 | +## Definition of Done |
| 135 | + |
| 136 | +A task is complete when: |
| 137 | + |
| 138 | +1. All code implemented to specification |
| 139 | +2. Unit tests written and passing |
| 140 | +3. Code coverage meets project requirements |
| 141 | +4. Code passes all configured checks |
| 142 | +5. Progress updated in `plan.md` |
| 143 | +6. Changes committed with proper message |
0 commit comments