Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .claude/templates/coding_prompt.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,33 @@ Get the next feature to implement:
Use the feature_get_next tool
```

**IMPORTANT - PROJECT COMPLETION:** If `feature_get_next` returns:
```json
{"error": "All features are passing! No more work to do."}
```

This means **the project is complete!** Take these final steps:

1. **Write final summary** to `claude-progress.txt`:
- Note that all features are implemented
- List any remaining recommendations
- Include final completion statistics

2. **Perform one final verification** (optional):
- Test 2-3 core features to ensure app is stable
- Check for console errors
- Verify app is production-ready

3. **Commit final state**:
```bash
git add -A
git commit -m "chore: All features complete - project production-ready"
```

4. **End session gracefully** - Do NOT continue with more regression tests. The agent loop will automatically stop when it detects completion.

---

Once you've retrieved the feature, **immediately mark it as in-progress**:

```
Expand Down
12 changes: 11 additions & 1 deletion agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8", errors="replace")

from client import create_client
from progress import has_features, print_progress_summary, print_session_header
from progress import has_features, is_project_complete, print_progress_summary, print_session_header
from prompts import (
copy_spec_to_project,
get_coding_prompt,
Expand Down Expand Up @@ -198,6 +198,16 @@ async def run_autonomous_agent(

# Handle status
if status == "continue":
# Check if project is complete (all features passing)
if is_project_complete(project_dir):
print("\n" + "=" * 70)
print(" ALL FEATURES COMPLETE!")
print("=" * 70)
print("\nAll features have been implemented and verified.")
print("Project is production-ready!")
print("\nThe agent will now stop to avoid unnecessary token usage.")
break # Exit the loop - project is complete

delay_seconds = AUTO_CONTINUE_DELAY_SECONDS
target_time_str = None

Expand Down
19 changes: 19 additions & 0 deletions progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,25 @@ def count_passing_tests(project_dir: Path) -> tuple[int, int, int]:
return 0, 0, 0


def is_project_complete(project_dir: Path) -> bool:
"""
Check if all features are passing (project is complete).

Args:
project_dir: Directory containing the project

Returns:
True if all features are passing, False otherwise
"""
passing, in_progress, total = count_passing_tests(project_dir)

# Project is complete if:
# 1. There are features (total > 0)
# 2. All features are passing (passing == total)
# 3. No features are in progress
return total > 0 and passing == total and in_progress == 0


def get_all_passing_features(project_dir: Path) -> list[dict]:
"""
Get all passing features for webhook notifications.
Expand Down