Implement feature with interleaved testing
Implement the current feature by following the spec, with interleaved testing after each user story.
User arguments: $ARGUMENTS
You MUST follow these steps:
Get current feature number from branch:
BRANCH=$(git rev-parse --abbrev-ref HEAD)
NUM=$(echo "$BRANCH" | grep -oE 'alg-([0-9]+)' | grep -oE '[0-9]+')
Read context files:
specs/alg-${NUM}-*/spec.md - User stories, requirements, acceptance criteria (REQUIRED)specs/alg-${NUM}-*/research.md exists - Implementation patterns, files to modify (OPTIONAL)Create a todo list with all user stories from the spec (P1 first, then P2, P3)
For each user story, follow this interleaved pattern:
git commit -m "feat(scope): description ALG-${NUM}"npm test --workspaces --if-presentgit commit -m "test(scope): description ALG-${NUM}"Final verification:
npm run type-check --workspaces --if-presentnpm test --workspaces --if-presentCRITICAL: Do NOT batch all implementation then all tests. Interleave them - implement one story, test it, commit, then move to the next.
Follow Conventional Commits:
Types: feat, fix, test, refactor, perf, docs, chore, ci, build
Examples:
git commit -m "feat(search): add semantic search service ALG-27"
git commit -m "test(search): add semantic search tests ALG-27"
git commit -m "fix(api): handle null response from Tidal ALG-27"
Write integration tests when the user story involves: