⚒️ Generated with [Fabro](https://fabro.sh)
This commit is contained in:
Fabro 2026-06-04 14:07:12 -04:00
commit a87582d3ff
2 changed files with 1084 additions and 0 deletions

296
graph.fabro Normal file
View file

@ -0,0 +1,296 @@
digraph Solitaire {
graph [
goal="Build a terminal-based Klondike solitaire game in Python with a curses TUI",
rankdir=LR,
default_max_retries=3,
retry_target="impl_setup",
fallback_retry_target="impl_logic"
]
start [shape=Mdiamond, label="Start"]
exit [shape=Msquare, label="Exit"]
expand_spec [
label="Expand Spec",
shape=box,
prompt="Goal: $goal
Create a detailed implementation spec for a Python Klondike solitaire TUI.
Hard requirements:
- Create the application under solitaire-app/.
- Use Python 3.11+ and the standard-library curses module for the playable UI.
- Implement draw-one Klondike with 7 tableau piles, 4 foundations, stock, and waste.
- Support keyboard-only play.
- Keep game rules testable without curses.
- Include a smoke mode so `python3 main.py --smoke` starts enough of the app to prove imports and setup without requiring an interactive terminal.
Write the spec to .ai/solitaire-spec.md.
Write status.json at workspace root: outcome=succeeded if the spec is complete, outcome=failed with failure_reason otherwise."
]
impl_setup [
label="Setup Project",
shape=box,
prompt="Read .ai/solitaire-spec.md.
Create the Python project skeleton under solitaire-app/:
- pyproject.toml with pytest configured
- main.py entrypoint
- src/solitaire_tui/ package
- tests/ directory
- README.md stub
Add minimal importable modules so the project compiles.
Run:
cd solitaire-app && python3 -m py_compile main.py src/solitaire_tui/*.py
Write status.json at workspace root: outcome=succeeded if the project skeleton exists and compiles, outcome=failed with failure_reason otherwise."
]
verify_setup [
label="Verify Setup",
shape=box,
class="verify",
prompt="Verify setup for the solitaire app.
Check:
1. solitaire-app/pyproject.toml exists
2. solitaire-app/main.py exists
3. solitaire-app/src/solitaire_tui exists
4. Python files compile
Run:
cd solitaire-app && python3 -m py_compile main.py src/solitaire_tui/*.py
Write findings to .ai/verify_setup.md.
Write status.json at workspace root: outcome=succeeded if all checks pass, outcome=failed with failure_reason otherwise."
]
check_setup [shape=diamond, label="Setup OK?"]
impl_data [
label="Data Structures",
shape=box,
prompt="Read .ai/solitaire-spec.md.
Implement core data structures under solitaire-app/src/solitaire_tui/:
- Card with rank, suit, face_up, color, display helpers
- Deck with standard 52-card creation and shuffle
- Pile types or clear pile abstractions for tableau, foundation, stock, and waste
- GameState container with initial deal
Add focused unit tests under solitaire-app/tests/.
Run:
cd solitaire-app && python3 -m pytest tests/ -v
Write status.json at workspace root: outcome=succeeded if tests pass and the data model is implemented, outcome=failed with failure_reason otherwise."
]
verify_data [
label="Verify Data",
shape=box,
class="verify",
prompt="Verify the solitaire data structures.
Run:
cd solitaire-app && python3 -m pytest tests/ -v && python3 -m py_compile main.py src/solitaire_tui/*.py
Check that Card, Deck, pile handling, and initial GameState/deal behavior are covered by tests.
Write findings to .ai/verify_data.md.
Write status.json at workspace root: outcome=succeeded if all checks pass, outcome=failed with failure_reason otherwise."
]
check_data [shape=diamond, label="Data OK?"]
impl_logic [
label="Game Logic",
shape=box,
class="hard",
max_retries=2,
prompt="Read .ai/solitaire-spec.md and the current solitaire-app implementation.
Implement complete draw-one Klondike game logic:
- Legal moves from waste/tableau to tableau
- Legal moves to foundation
- Moving face-up tableau runs
- Flipping newly exposed tableau cards
- Drawing from stock to waste
- Recycling waste into stock when stock is empty
- Undo for player actions
- Win detection when all foundations are complete
Add tests for legal moves, illegal moves, deal invariants, stock/waste behavior, undo, and win detection.
Run:
cd solitaire-app && python3 -m pytest tests/ -v
Write status.json at workspace root: outcome=succeeded if all tests pass and rules are implemented, outcome=failed with failure_reason otherwise."
]
verify_logic [
label="Verify Logic",
shape=box,
class="verify",
prompt="Verify Klondike game logic.
Run:
cd solitaire-app && python3 -m pytest tests/ -v
Check for coverage of:
- Deal invariants
- Tableau move legality
- Foundation move legality
- Stock/waste draw and recycle
- Undo
- Win detection
Write findings to .ai/verify_logic.md.
Write status.json at workspace root: outcome=succeeded if all checks pass, outcome=failed with failure_reason otherwise."
]
check_logic [shape=diamond, label="Logic OK?"]
impl_ui [
label="Terminal UI",
shape=box,
class="hard",
max_retries=2,
prompt="Read .ai/solitaire-spec.md and the game logic.
Implement the curses TUI:
- Board rendering for foundations, stock, waste, and 7 tableau piles
- Compact card labels with face-down cards hidden
- Keyboard navigation and selection
- Commands for draw, recycle, move to foundation, undo, help, new game, and quit
- Clear status/help messages
- Graceful handling for terminals that are too small
- `python3 main.py --smoke` non-interactive smoke path
Keep rendering helpers testable where practical and avoid coupling game rules to curses.
Run:
cd solitaire-app && python3 -m pytest tests/ -v && python3 -m py_compile main.py src/solitaire_tui/*.py && python3 main.py --smoke
Write status.json at workspace root: outcome=succeeded if tests pass, files compile, and smoke mode works, outcome=failed with failure_reason otherwise."
]
verify_ui [
label="Verify UI",
shape=box,
class="verify",
prompt="Verify the terminal UI.
Run:
cd solitaire-app && python3 -m pytest tests/ -v && python3 -m py_compile main.py src/solitaire_tui/*.py && python3 main.py --smoke
Check that:
- main.py can start smoke mode
- UI module imports without requiring an interactive terminal
- Board rendering helpers have tests or smoke coverage
- Controls are documented in README.md
Write findings to .ai/verify_ui.md.
Write status.json at workspace root: outcome=succeeded if all checks pass, outcome=failed with failure_reason otherwise."
]
check_ui [shape=diamond, label="UI OK?"]
impl_integration [
label="Integrate",
shape=box,
prompt="Finish the solitaire app.
Do the integration work:
- Wire main.py to start the curses game loop normally
- Keep --smoke non-interactive
- Add README.md run instructions and controls
- Add any missing tests needed for confidence
- Ensure no generated files are outside solitaire-app/ except .ai/ reports and root status.json
Run:
cd solitaire-app && python3 -m pytest tests/ -v && python3 main.py --smoke
Write status.json at workspace root: outcome=succeeded if the app is playable and tests pass, outcome=failed with failure_reason otherwise."
]
verify_integration [
label="Verify Integration",
shape=box,
class="verify",
prompt="Verify final integration.
Run:
cd solitaire-app && python3 -m pytest tests/ -v && python3 -m py_compile main.py src/solitaire_tui/*.py && python3 main.py --smoke
Check README.md includes setup, run, test, and controls instructions.
Write findings to .ai/verify_integration.md.
Write status.json at workspace root: outcome=succeeded if all checks pass, outcome=failed with failure_reason otherwise."
]
check_integration [shape=diamond, label="Integration OK?"]
review [
label="Final Review",
shape=box,
class="hard",
goal_gate=true,
prompt="Review the complete solitaire app against .ai/solitaire-spec.md.
Confirm:
- The app is in solitaire-app/
- It is Python 3.11+ and uses curses for the TUI
- Draw-one Klondike rules are implemented correctly
- Keyboard controls are usable and documented
- Tests pass
- Smoke mode works without an interactive terminal
Run:
cd solitaire-app && python3 -m pytest tests/ -v && python3 main.py --smoke
Write review to .ai/solitaire-review.md.
Write status.json at workspace root: outcome=succeeded if the app is complete and demo-ready, outcome=failed with specific missing or broken items."
]
check_review [shape=diamond, label="Review OK?"]
start -> expand_spec -> impl_setup -> verify_setup -> check_setup
check_setup -> impl_data [condition="outcome=succeeded"]
check_setup -> impl_setup [condition="outcome=failed", label="Retry"]
check_setup -> impl_setup [label="Fallback"]
impl_data -> verify_data -> check_data
check_data -> impl_logic [condition="outcome=succeeded"]
check_data -> impl_data [condition="outcome=failed", label="Retry"]
check_data -> impl_data [label="Fallback"]
impl_logic -> verify_logic -> check_logic
check_logic -> impl_ui [condition="outcome=succeeded"]
check_logic -> impl_logic [condition="outcome=failed", label="Retry"]
check_logic -> impl_logic [label="Fallback"]
impl_ui -> verify_ui -> check_ui
check_ui -> impl_integration [condition="outcome=succeeded"]
check_ui -> impl_ui [condition="outcome=failed", label="Retry"]
check_ui -> impl_ui [label="Fallback"]
impl_integration -> verify_integration -> check_integration
check_integration -> review [condition="outcome=succeeded"]
check_integration -> impl_integration [condition="outcome=failed", label="Retry"]
check_integration -> impl_integration [label="Fallback"]
review -> check_review
check_review -> exit [condition="outcome=succeeded"]
check_review -> impl_ui [condition="outcome=failed", label="Fix"]
check_review -> impl_ui [label="Fallback"]
}

788
run.json Normal file

File diff suppressed because one or more lines are too long