add PTY support #1704
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claude Code | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| issues: | |
| types: [opened, assigned] | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| claude: | |
| if: | | |
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || | |
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || | |
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || | |
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) | |
| timeout-minutes: 30 | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| id-token: write | |
| actions: read # Required for Claude to read CI results on PRs | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Run Claude Code | |
| id: claude | |
| uses: anthropics/claude-code-action@v1 | |
| with: | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| track_progress: true | |
| # This is an optional setting that allows Claude to read CI results on PRs | |
| additional_permissions: | | |
| actions: read | |
| plugin_marketplaces: | | |
| https://github.com/obra/superpowers-marketplace.git | |
| https://github.com/anthropics/claude-plugins-official.git | |
| plugins: | | |
| superpowers@superpowers-marketplace | |
| ralph-wiggum@claude-plugins-official | |
| prompt: | | |
| REPO: ${{ github.repository }} | |
| ISSUE/PR: #${{ github.event.issue.number || github.event.pull_request.number }} | |
| ## Task Context | |
| ${{ github.event.comment.body || github.event.issue.body || github.event.review.body }} | |
| ## Workflow Instructions | |
| **STEP 1: Read project conventions** | |
| Read CLAUDE.md at the root of this repository. It contains critical project conventions, architecture patterns, and development guidelines. | |
| **STEP 2: Assess task complexity** | |
| Determine if this task requires planning: | |
| - **Needs planning**: New features, architectural changes, significant refactoring, adding major functionality | |
| - **Direct execution**: Bug fixes, test fixes, investigations, documentation updates, simple one-line changes | |
| **STEP 3: Execute appropriate workflow** | |
| **For tasks needing planning:** | |
| 1. Use the brainstorming skill (`superpowers:brainstorming`) to: | |
| - **IMPORTANT**: You are working autonomously (no user to answer questions) | |
| - Use Socratic method on yourself: ask questions, explore answers, consider trade-offs | |
| - The task context above contains all available information | |
| - Explore 2-3 different approaches with pros/cons | |
| - Design the solution covering: architecture, components, data flow, error handling, testing | |
| - Save design to `${{ runner.temp }}/design.md` (temporary, not committed) | |
| 2. Use the writing-plans skill (`superpowers:writing-plans`) to: | |
| - Create detailed, bite-sized implementation plan | |
| - Include exact file paths, complete code examples, verification steps | |
| - Save plan to `${{ runner.temp }}/implementation.md` (temporary, not committed) | |
| 3. **Define completion criteria** before implementing: | |
| - What specific, verifiable conditions indicate success? | |
| - Examples: "All tests pass", "Feature X works as specified", "Bug no longer reproducible" | |
| - Write criteria to `${{ runner.temp }}/completion-criteria.md` | |
| 4. **Use ralph-loop for implementation** (iterative until done): | |
| ``` | |
| /ralph-loop "Execute the implementation plan at ${{ runner.temp }}/implementation.md following TDD. | |
| After each task: run tests, fix failures, continue to next task. | |
| When ALL tasks complete AND all tests pass AND npm run check succeeds: | |
| - Use requesting-code-review skill to self-review | |
| - Fix any issues found | |
| - Commit changes following CLAUDE.md git guidelines | |
| - Output <promise>IMPLEMENTATION_COMPLETE</promise>" --completion-promise "IMPLEMENTATION_COMPLETE" --max-iterations 20 | |
| ``` | |
| **For direct execution tasks:** | |
| - Use test-driven-development for code changes | |
| - Use systematic-debugging for investigations | |
| - Use verification-before-completion before claiming done | |
| - Follow CLAUDE.md conventions | |
| - For bug fixes with clear criteria, consider using ralph-loop to ensure fix is complete | |
| **REMEMBER:** | |
| - If a superpowers skill applies to your task, you MUST use it (not optional) | |
| - Write tests before code (TDD iron law) | |
| - Verify with evidence before claiming completion | |
| - Create commits following CLAUDE.md git guidelines | |
| - Ralph-loop ensures you iterate until truly done (don't give up early) | |
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | |
| # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options | |
| claude_args: '--allowedTools "Task,Skill,SlashCommand,Read,Write,Edit,Glob,Grep,TodoWrite,mcp__cloudflare-docs__search_cloudflare_documentation,mcp__exa__get_code_context_exa,mcp__exa__web_search_exa,Bash(npm test:*),Bash(npm run *),Bash(npm install:*),Bash(npm ls:*),Bash(npm view:*),Bash(docker:*),Bash(git status),Bash(git log:*),Bash(git diff:*),Bash(git rev-parse:*),Bash(git fetch:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git branch:*),Bash(git checkout:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr checks:*),Bash(gh pr create:*),Bash(gh issue view:*),Bash(gh issue create:*),Bash(gh issue comment:*),Bash(gh repo view:*),Bash(gh api:*),Bash(find:*),Bash(tree:*),Bash(ls:*),Bash(jq:*)"' |