{"id":50232600,"url":"https://github.com/owainlewis/pi-extensions","last_synced_at":"2026-05-30T00:30:46.421Z","repository":{"id":351516604,"uuid":"1211334989","full_name":"owainlewis/pi-extensions","owner":"owainlewis","description":"Context-isolated workflow automation for Pi coding agent","archived":false,"fork":false,"pushed_at":"2026-05-19T11:35:02.000Z","size":67,"stargazers_count":68,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-19T14:41:21.773Z","etag":null,"topics":["ai-coding","code-review","developer-tools","pi-coding-agent","productivity","tdd","typescript","workflow-automation"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owainlewis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-15T09:38:30.000Z","updated_at":"2026-05-19T09:09:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/owainlewis/pi-extensions","commit_stats":null,"previous_names":["owainlewis/pi-extensions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/owainlewis/pi-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fpi-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fpi-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fpi-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fpi-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owainlewis","download_url":"https://codeload.github.com/owainlewis/pi-extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owainlewis%2Fpi-extensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33676190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding","code-review","developer-tools","pi-coding-agent","productivity","tdd","typescript","workflow-automation"],"created_at":"2026-05-26T19:00:32.248Z","updated_at":"2026-05-30T00:30:46.411Z","avatar_url":"https://github.com/owainlewis.png","language":"TypeScript","funding_links":[],"categories":["Extensions"],"sub_categories":[],"readme":"# Pi Extensions\n\nExperimental extensions for the [Pi coding agent](https://github.com/badlogic/pi-mono) that explore development workflow ideas.\n\n\u003e **Experimental / not production-ready:** These extensions are prototypes for personal workflow exploration. They may be incomplete, unstable, or unsafe for unattended use, and are not designed or supported for production environments.\n\n## Demo\n\nSee it in action:\n\n```bash\ncd demo\npi\n/workflow ../examples/specs/user-api.md\n```\n\nWatches Pi build a complete FastAPI user management API with tests, automatically iterating through write → test → review → fix cycles with clean, unbiased code reviews.\n\n[View demo details →](demo/README.md)\n\n---\n\n## Extensions\n\n### Context-Isolated Workflow\n\n**The workflow that solves the real problem.**\n\nStop manually prompting \"now review\", \"now test\", \"now fix\" at every step. Stop getting biased reviews because the LLM sees all the implementation details. Let Pi handle the entire development cycle automatically with clean, unbiased code reviews.\n\n```bash\n/workflow spec.md\n```\n\n**What makes it special:**\n- Context compaction before review - LLM reviews with fresh eyes, no implementation bias\n- Deterministic test validation - Parses actual exit codes, no guessing\n- Automated iteration cycle - write → test → review → fix → verify (all automatic)\n- State persistence - Handles long tasks, survives restarts\n- Flexible input - Spec file, prompt, or editor\n\n**The problem it solves:**\n\n```\nBEFORE:\nYou: Write this feature\nLLM: [writes code]\nYou: Now review it                    (Manual)\nLLM: [reviews but context polluted]   (Biased - \"I just wrote this!\")\nYou: Fix these issues                 (Manual)\nLLM: [fixes]\nYou: Run tests                        (Manual)\n...endless manual orchestration\n\nAFTER:\nYou: /workflow spec.md\nLLM: [writes → tests → COMPACTS CONTEXT → reviews with clean eyes → \n      finds real issues → fixes → verifies → done!]\nYou: [just watched]\n```\n\n[Read full documentation →](extensions/context-workflow/README.md)\n\n---\n\n### Funny Status Messages\n\n**Make waiting for Pi more entertaining.**\n\nReplaces boring \"Working...\" with random hilarious messages like:\n- \"Consulting the void...\"\n- \"Bribing the compiler...\"\n- \"Teaching old code new tricks...\"\n- \"Debugging the matrix...\"\n- ...and 27 more!\n\n```bash\n# Just install - works automatically\n```\n\nZero configuration. Pure entertainment. 30 different messages.\n\n[Read full documentation →](extensions/funny-status/README.md)\n\n---\n\n## Quick Install\n\n### Install Everything\n\n```bash\ngit clone https://github.com/owainlewis/pi-extensions.git\ncd pi-extensions\n./install.sh\n```\n\n### Install Specific Extension\n\n```bash\n./install.sh context-workflow\n./install.sh funny-status\n```\n\n### Manual Installation\n\n```bash\ncp extensions/context-workflow/context-workflow.ts ~/.pi/agent/extensions/\ncp extensions/funny-status/funny-status.ts ~/.pi/agent/extensions/\n```\n\nThen in Pi:\n```\n/reload\n```\n\n---\n\n## Why Context-Workflow?\n\nMost \"workflow\" extensions are just fancy prompts. **Context-workflow** actually solves real problems:\n\n### 1. Clean Code Reviews\n\nThe key innovation:\n\n```typescript\n// After tests pass, BEFORE review:\nctx.compact({\n  customInstructions: \"Remove all implementation details. \n                      Keep only: spec, file list, summary.\"\n});\n\n// Now LLM reviews with FRESH context\n// No bias from \"I just wrote this\"\n// Catches real issues\n```\n\n### 2. Deterministic Validation\n\n```typescript\n// Not: \"I think tests passed\" (unreliable)\n// Yes: Parse actual exit code (reliable)\nworkflow_test_result({ exitCode: 0 })  // Pass\nworkflow_test_result({ exitCode: 1 })  // Fail\n```\n\n### 3. Automated Iteration\n\nNo more manual prompting:\n\n```\nwrite → test → review → fix → test → verify\n  ↓      ↓       ↓       ↓      ↓       ↓\nauto   auto   auto    auto   auto    auto\n```\n\n### 4. State Management\n\nTracks everything across long tasks:\n- Current stage\n- Iteration count\n- Test status\n- Review issues list\n- Context state (compacted or full)\n\n---\n\n## Real Example\n\n```bash\n$ pi\n\n\u003e /workflow \"Create a calculator with add/subtract/multiply/divide. Include tests.\"\n\nContext-Isolated Workflow Started\n\n[Pi automatically:]\n\nStage 1: Writing implementation (1/10)\n  - Creates calculator.py\n  - Creates test_calculator.py\n  → Calls workflow_next\n\nStage 2: Running tests (2/10)\n  - Runs: pytest tests/\n  - Exit code: 1 (tests failed)\n  → Calls workflow_test_result({ exitCode: 1 })\n\nStage 4: Fixing issues (3/10)\n  - Fixes the bug\n  → Calls workflow_next\n\nStage 2: Re-testing (4/10)\n  - Runs: pytest tests/\n  - Exit code: 0 (tests passed)\n  → Calls workflow_test_result({ exitCode: 0 })\n\n[CONTEXT COMPACTION - Removes all implementation details]\n\nStage 3: Code review (clean context) (5/10)\n  - Reviews with fresh eyes\n  - Finds: missing docstrings, no div-by-zero check\n  → Calls workflow_review_result({ issues: [...] })\n\nStage 4: Fixing issues (6/10)\n  - Adds docstrings\n  - Adds div-by-zero error handling\n  → Calls workflow_next\n\nStage 2: Re-testing (7/10)\n  - Tests still pass\n  → workflow_test_result({ exitCode: 0 })\n\n[CONTEXT COMPACTION AGAIN]\n\nStage 3: Code review (clean context) (8/10)\n  - Reviews again\n  - No issues found\n  → workflow_review_result({ issues: [] })\n\nStage 5: Final verification (9/10)\n  - Final test run\n  - Everything works\n  → workflow_complete\n\nWorkflow Complete!\n\nIterations: 9\nTests: All passing\nReview: No issues\n\nYou: [just watched it happen]\n```\n\n---\n\n## Documentation\n\n- **[Context-Workflow README](extensions/context-workflow/README.md)** - Complete documentation\n- **[Funny Status README](extensions/funny-status/README.md)** - Usage and customization\n- **[TUTORIAL.md](TUTORIAL.md)** - Step-by-step walkthrough\n- **[CONTRIBUTING.md](CONTRIBUTING.md)** - How to contribute\n\n---\n\n## Tutorial\n\nSee [TUTORIAL.md](TUTORIAL.md) for a complete walkthrough:\n1. Installation (2 min)\n2. First workflow run (5 min)\n3. Understanding stages (5 min)\n4. Tips for best results\n\n---\n\n## Usage Examples\n\n### Example 1: REST API\n\n```bash\n/workflow \"Create a REST API for user management with:\n- CRUD operations (create, read, update, delete)\n- Input validation\n- Error handling\n- Comprehensive tests\"\n```\n\n### Example 2: With Spec File\n\nCreate `spec-auth.md`:\n```markdown\n# Authentication System\n\n## Requirements\n- Password hashing with bcrypt\n- JWT token generation\n- Login/logout endpoints\n- Session management\n- Rate limiting\n\n## Tests\n- Valid/invalid credentials\n- Token validation\n- Session expiry\n- Rate limit enforcement\n```\n\nThen:\n```bash\n/workflow spec-auth.md\n```\n\n### Example 3: Using Editor\n\n```bash\n/workflow\n# Editor opens - write your spec\n# Save and exit\n# Watch it execute\n```\n\n### Example 4: Demo Project\n\n```bash\ncd demo\n/workflow ../examples/specs/user-api.md\n```\n\nBuilds a complete FastAPI user management API with CRUD operations, validation, tests, and documentation.\n\n---\n\n## Commands Reference\n\n### Context-Workflow\n\n- `/workflow [spec]` - Start workflow\n- `/workflow:status` - Check progress\n- `/workflow:cancel` - Cancel workflow\n\n### Status While Running\n\nWatch the footer:\n```\nWriting implementation (1/10)\nRunning tests (2/10)\nCode review (clean context) (5/10)\nImproving based on review (6/10)\nFinal verification (9/10)\nComplete\n```\n\n---\n\n## FAQ\n\n### Q: Is this just a fancy prompt?\n\n**No!** It has:\n- State management (tracks stage, iteration, issues)\n- Context compaction (removes bias before review)\n- Deterministic validation (parses exit codes)\n- Automated progression (no manual steps)\n\n### Q: How is review \"unbiased\"?\n\nBefore review, it **compacts the context** - removing all implementation details. The LLM only sees:\n- Original spec\n- List of files\n- Brief summary\n- The actual code to review\n\nNot:\n- Implementation conversation\n- Debugging thoughts  \n- Decision-making process\n- \"I just wrote this\" bias\n\n### Q: What if tests never pass?\n\nMax 10 iterations. It will complete automatically and show you where it got stuck.\n\n### Q: Can I customize the stages?\n\nYes! Edit `context-workflow.ts` to add stages, change logic, or customize behavior.\n\n### Q: What test frameworks does it support?\n\nAuto-detects:\n- pytest (Python)\n- npm test (JavaScript)\n- cargo test (Rust)\n- go test (Go)\n- mvn test (Java)\n- Any command that returns exit codes\n\n---\n\n## Why This Matters\n\n### The Old Way (Manual)\n\n```\nYou write prompt\n→ LLM writes code\n→ You: \"now review\"\n→ LLM reviews (biased - sees everything)\n→ You: \"fix these issues\"\n→ LLM fixes\n→ You: \"run tests\"\n→ LLM tests\n→ You: \"fix failures\"\n→ ...endless back and forth\n```\n\n**Problems:**\n- Manual orchestration\n- Polluted context (biased reviews)\n- Easy to skip steps\n- Time-consuming\n- LLM gets lost in long tasks\n\n### The New Way (Context-Workflow)\n\n```\nYou: /workflow spec.md\n→ Pi does everything automatically\n→ With clean reviews\n→ Deterministic validation\n→ State tracking\n```\n\n**Benefits:**\n- Fully automated\n- Clean, unbiased reviews\n- Reliable progression\n- Fast\n- Handles long tasks\n\n---\n\n## Requirements\n\n- Pi coding agent ([Installation guide](https://github.com/badlogic/pi-mono))\n- Node.js (for Pi)\n\n---\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\nIdeas for extensions:\n- Git workflow automation\n- Deployment pipelines\n- Documentation generation\n- Performance profiling\n\n---\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details\n\n---\n\n## Acknowledgments\n\n- [Pi coding agent](https://github.com/badlogic/pi-mono) by @badlogic\n- Built to solve real development workflow problems\n- Community feedback welcome\n\n---\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/owainlewis/pi-extensions/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/owainlewis/pi-extensions/discussions)\n- **Pi Discord**: [Join](https://discord.com/invite/3cU7Bz4UPx)\n\n---\n\n**Made for developers tired of manual workflow orchestration**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainlewis%2Fpi-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowainlewis%2Fpi-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowainlewis%2Fpi-extensions/lists"}