AILANG Sprint Executor
Execute an approved sprint plan with continuous progress tracking, testing, and documentation updates. Supports parallel execution of independent milestones using Task sub-agents for faster sprints.
Current State
- Branch: !'git branch --show-current'
- Working directory: !'git status --short | head -5'
- Active sprints: !'ls .ailang/state/sprints/ 2>/dev/null | head -5 || echo "none"'
- Sprint progress: !'for f in .ailang/state/sprints/sprint_*.json; do [ -f "$f" ] && echo "$(basename $f): status=$(jq -r .status $f 2>/dev/null), features=$(jq "[.features[] | select(.passes==true)] | length" $f 2>/dev/null)/$(jq ".features | length" $f 2>/dev/null)"; done 2>/dev/null || echo "no sprint files"'
- Test gate:
make test-changed(packages this branch touches +make test-core). Never run the fullmake testhere: it belongs to CI. - Uncommitted changes: !'git diff --stat HEAD 2>/dev/null | tail -1 || echo "clean"'
Use the data above first. Only re-run these commands manually if the injected context is empty or you need to refresh after making changes.
Quick Start
Sequential execution (default):
# User says: "Execute the sprint plan in design_docs/20251019/M-S1.md"
# This skill will:
# 1. Validate prerequisites (tests pass, linting clean)
# 2. Create TodoWrite tasks for all milestones
# 3. Execute each milestone with test-driven development
# 4. Run checkpoint after each milestone (tests + lint)
# 5. Update CHANGELOG and sprint plan progressively
# 6. Pause after each milestone for user review
Parallel execution (for independent milestones):
# User says: "Execute sprint plan at docs/sprint-plans/M-FOO.md in parallel"
# This skill will:
# 1. Read sprint plan and identify all milestones
# 2. Analyze dependencies — group independent milestones for parallel execution
# 3. Spawn Task sub-agents per milestone (branch, TDD, implement, commit)
# 4. Act as integration agent — merge branches, run full test suite
# 5. Write sprint retrospective with timing and friction analysis
When to Use This Skill
Invoke this skill when:
- User says "execute sprint", "start sprint", "begin implementation"
- User has an approved sprint plan ready to implement
- User wants guided execution with built-in quality checks
- User needs progress tracking and pause points
Choose parallel mode when:
- Sprint has 3+ milestones with independent work
- Milestones touch different files/packages (low merge conflict risk)
- User says "execute in parallel", "parallel sprint", or "use sub-agents"
Choose sequential mode when:
- Milestones have strict dependencies (M2 depends on M1's output)
- All milestones touch the same files
- Sprint is small (1-2 milestones)
Coordinator Integration
When invoked by the AILANG Coordinator (detected by GitHub issue reference in the prompt), you MUST output these markers at the end of your response:
IMPLEMENTATION_COMPLETE: true
BRANCH_NAME: coordinator/task-XXXX
FILES_CREATED: file1.go, file2.go
FILES_MODIFIED: file3.go, file4.go
Why? The coordinator uses these markers to:
- Track implementation completion
- Post updates to GitHub issues
- Trigger the merge approval workflow
Example completion:
## Implementation Complete
All milestones have been completed and tests pass.
**IMPLEMENTATION_COMPLETE**: true
**BRANCH_NAME**: `coordinator/task-abc123`
**FILES_CREATED**: `internal/new_file.go`, `internal/new_test.go`
**FILES_MODIFIED**: `internal/existing.go`
Core Principles
- Test-Driven: All code must pass tests before moving to next milestone
- Lint-Clean: All code must pass linting before moving to next milestone
- Document as You Go: Update CHANGELOG.md and sprint plan progressively
- Pause for Breath: Stop at natural breakpoints for review and approval — interactive sessions only; unattended runs commit and continue, see resources/unattended_runs.md
- Track Everything: Use TodoWrite to maintain visible progress
- DX-First: Improve AILANG development experience as we go - make it easier next time
- Parallelize When Possible: Independent milestones run as concurrent Task sub-agents for speed
- Failing Tests First: Sub-agents MUST write failing tests before implementation — no exceptions
- Determinism Verified: Pure builtins (
IsPure: true) MUST be tested with-count=20— single-pass tests hide Go map iteration nondeterminism. Use realistic inputs, not toy examples. See milestone_checklist.md for details. - Windows-Proof Every New Test (added 2026-07-14 after THREE same-class round-2/red-dev cycles: iter-29
exampleRunPathbackslash paths failed both Windows CI jobs → round-1 FAIL 81/100; iter-30TestDocsSearch_StillDesignDocSimHashasserteddesign_docs/against native-separator output → both Windows jobs red; M-SMT-CALLEE-SORT-GATE e2e tests invoked z3 which the Windows runner lacks → dev itself red). The local rig is macOS; CI runstest-windows+Build windows-latestyou never exercise. Before declaring ANY milestone done, scan its new/changed tests for: (a) path assertions — output containing paths must be normalized (filepath.ToSlash/ replace\with/) beforestrings.Contains-style checks; (b) external binaries — anything invoking z3 or other non-Go tools must guard with the repo's availability convention (smt.Z3Available()→t.Skip; ubuntu CI installs z3 atci.yml, Windows does NOT); (c) golden files vs native rendering — goldens comparing rendered paths/line endings need normalization. Two seconds of scan beats a 20-minute CI round-trip. - Load AILANG syntax before writing
.ail— no exceptions. Runailang promptbefore the first.ailedit each session, recordAILANG prompt version loaded: <version>, and discharge the contracts/effects/inline-tests checklist for every showcase module (a skip without a reason fails the milestone). Details: AILANG syntax gate. Adding a runnable example: manifest checklist.
Multi-Session Continuity (NEW)
Sprint execution can span multiple Claude Code sessions. Based on Anthropic's long-running agent patterns, sprint-executor implements the "Coding Agent" pattern:
- Session Startup Routine: Every session starts with
session_start.sh - Checks working directory
- Reads JSON progress file (
.ailang/state/sprints/sprint_<id>.json) - Reviews recent git commits
- Validates tests pass
- Prints "Here's where we left off" summary
- Structured Progress Tracking: JSON file tracks state
- Features with
passes: true/false/null(follows "constrained modification" pattern) - Velocity metrics updated automatically
- Clear checkpoint messages
- Session timestamps
- Pause and Resume: Work can be interrupted at any time
- Status saved to JSON:
not_started,in_progress,paused,completed - Next session picks up exactly where you left off
- No loss of context or progress