// Guides AI agents through TDD workflow, build system safety, git operations, and TODO management for gem development. Use this when starting development sessions, managing tasks, or needing workflow clarification.
| name | Project Workflow & Build System |
| description | Guides AI agents through TDD workflow, build system safety, git operations, and TODO management for gem development. Use this when starting development sessions, managing tasks, or needing workflow clarification. |
Development workflow, build system permissions, and git safety protocols for PicoRuby development.
You are the developer of the pra gem — a CLI tool for PicoRuby application development on ESP32.
pra gem itselflib/picotorokko/, test/, gem configuration → You develop thesedocs/github-actions/, templates → These are for pra users (not executed during gem development)pra commands are incomplete, add to TODO.md — don't rush implementation unless explicitly required.
├── lib/picotorokko/ # Gem implementation
├── test/ # Test suite
├── docs/github-actions/ # User-facing templates
├── storage/home/ # Example application code
├── patch/ # Repository patches
├── .cache/ # Cached repositories (git-ignored)
├── build/ # Build environments (git-ignored)
└── TODO.md # Task tracking
rake monitor # Watch UART output in real-time
rake check_env # Verify ESP32 and build environment
rake build # Compile firmware (2-5 min)
rake cleanbuild # Clean + rebuild
rake flash # Upload to hardware (requires device)
rake init # Contains git reset --hard
rake update # Destructive git operations
rake buildall # Combines destructive ops
Rationale: Protect work-in-progress from accidental git reset --hard.
commit subagent for all commitsgit push, git push --force, raw git commitgit reset --hard, git rebase -igit status, git log, git diffImportant: TODO.md is NOT just a checklist — it's a workflow guide supporting t-wada style TDD.
Key concepts:
When starting a phase:
Example from picotorokko refactoring:
[TODO-INFRASTRUCTURE-DEVICE-COMMAND] (Thor env name parsing)Goal: Complete one Red-Green-RuboCop-Refactor-Commit cycle per TODO task
1. RED: Write one failing test
bundle exec rake test → Verify failure ❌
2. GREEN: Write minimal code to pass test
bundle exec rake test → Verify pass ✅
bundle exec rubocop -A → Auto-fix violations
3. REFACTOR: Improve code quality
- Apply Tidy First principles (guard clauses, symmetry, clarity)
- Fix remaining RuboCop violations manually
- Understand WHY each violation exists
- bundle exec rubocop → Verify 0 violations
4. VERIFY & COMMIT: All quality gates must pass
bundle exec rake ci → Tests + RuboCop + Coverage ✅
Use `commit` subagent with clear, imperative message
5. UPDATE TODO.md
- Immediately mark task complete
- Record any [TODO-INFRASTRUCTURE-*] discoveries
- Move to next task
# Gate 1: Tests pass
bundle exec rake test
✅ Expected: All tests pass
# Gate 2: RuboCop: 0 violations
bundle exec rubocop
✅ Expected: "26 files inspected, 0 offenses"
# Gate 3: Coverage (CI mode)
bundle exec rake ci
✅ Expected: Line: ≥ 80%, Branch: ≥ 50%
1. Read TODO.md phase description
- Check for [TODO-INFRASTRUCTURE-*] warnings
- Understand task granularity (each = 1-5 min)
2. Check for unresolved [TODO-INFRASTRUCTURE-*] markers
- If found: Resolve in TDD cycles BEFORE proceeding
- If none: Proceed to first task
3. Repeat Micro-Cycle for each task in phase
- Each task is exactly one TDD cycle
- Commit after each cycle
- Update TODO.md immediately (remove completed tasks)
- Record any infrastructure issues with [TODO-INFRASTRUCTURE-*]
4. After phase completion
- Verify all [TODO-INFRASTRUCTURE-*] markers from this phase resolved
- Verify no hanging infrastructure markers
- If new [TODO-INFRASTRUCTURE-*] created: Mark which phase will handle it
5. User verifies
- Full test suite passes: `rake ci`
- Manual testing if needed
- Code review if applicable
Test-First Architecture (Phase 0 Priority)
[TODO-INFRASTRUCTURE-*] Marker Discipline
Tidy First (Kent Beck)
t-wada style TDD
RuboCop as Quality Gate
rubocop -A)# rubocop:disable comments# rubocop:disable commentsMUST ask in these scenarios:
See .claude/docs/testing-guidelines.md for detailed examples.