@@ -55,126 +55,51 @@ concurrency:
5555 cancel-in-progress : false # Don't cancel ongoing work
5656
5757jobs :
58- # Check if issue is ready for implementation
59- check-readiness :
58+ implement :
6059 if : inputs.action == 'labeled' && inputs.label_name == 'agent: claude'
6160 runs-on : arc-happyvertical
62- timeout-minutes : 5
63- outputs :
64- ready : ${{ steps.check.outputs.ready }}
65- missing : ${{ steps.check.outputs.missing }}
61+ timeout-minutes : 60
6662 steps :
67- - name : Check Definition of Ready
63+ - name : Check Issue State
6864 id : check
6965 env :
7066 GH_TOKEN : ${{ secrets.GH_TOKEN }}
7167 run : |
72- echo "Checking Definition of Ready for issue #${{ inputs.issue_number }}..."
73-
74- ISSUE=$(gh issue view ${{ inputs.issue_number }} --json labels,body,title,state)
75-
76- STATE=$(echo "$ISSUE" | jq -r '.state')
68+ STATE=$(gh issue view ${{ inputs.issue_number }} --json state --jq '.state')
7769 if [ "$STATE" != "OPEN" ]; then
78- echo "ready=false" >> $GITHUB_OUTPUT
79- echo "missing=Issue is closed" >> $GITHUB_OUTPUT
80- exit 0
81- fi
82-
83- LABELS=$(echo "$ISSUE" | jq -r '.labels[].name' 2>/dev/null || echo "")
84-
85- HAS_TYPE=$(echo "$LABELS" | grep -c "^type:" || true)
86- HAS_PRIORITY=$(echo "$LABELS" | grep -c "^priority:" || true)
87- HAS_SIZE=$(echo "$LABELS" | grep -c "^size:" || true)
88-
89- BODY_LENGTH=$(echo "$ISSUE" | jq '.body | length // 0')
90-
91- MISSING=""
92- if [ "$HAS_TYPE" -eq 0 ]; then
93- MISSING="${MISSING}type label, "
94- fi
95- if [ "$HAS_PRIORITY" -eq 0 ]; then
96- MISSING="${MISSING}priority label, "
97- fi
98- if [ "$HAS_SIZE" -eq 0 ]; then
99- MISSING="${MISSING}size label, "
100- fi
101- if [ "$BODY_LENGTH" -lt 50 ]; then
102- MISSING="${MISSING}detailed description, "
103- fi
104-
105- if [ -n "$MISSING" ]; then
106- echo "ready=false" >> $GITHUB_OUTPUT
107- echo "missing=${MISSING%, }" >> $GITHUB_OUTPUT
70+ echo "Issue is closed, skipping"
71+ echo "skip=true" >> $GITHUB_OUTPUT
10872 else
109- echo "ready=true" >> $GITHUB_OUTPUT
110- echo "missing=" >> $GITHUB_OUTPUT
73+ echo "skip=false" >> $GITHUB_OUTPUT
11174 fi
11275
113- # NOT READY: Reject and remove label
114- not-ready :
115- needs : check-readiness
116- if : needs.check-readiness.outputs.ready == 'false'
117- runs-on : arc-happyvertical
118- timeout-minutes : 5
119- steps :
120- - name : Post Not Ready Comment
121- env :
122- GH_TOKEN : ${{ secrets.GH_TOKEN }}
123- run : |
124- gh issue comment ${{ inputs.issue_number }} --body "## Issue Not Ready for Autopilot
125-
126- The \`agent: claude\` label is for **fully autonomous implementation only**.
127-
128- This issue is missing: **${{ needs.check-readiness.outputs.missing }}**
129-
130- ### To use autopilot:
131- 1. Ensure the issue has \`type:\`, \`priority:\`, and \`size:\` labels
132- 2. Provide a detailed description (50+ characters)
133- 3. Re-apply the \`agent: claude\` label
134-
135- ### Alternatives:
136- - **Run Issue Checkup** workflow to have Claude triage/prepare issues
137- - **Use \`@claude\`** in a comment for interactive assistance
138- - **Manually prepare** the issue, then re-apply the label
139-
140- ---
141- *Removing \`agent: claude\` label*"
142-
143- - name : Remove Label
144- env :
145- GH_TOKEN : ${{ secrets.GH_TOKEN }}
146- run : |
147- gh issue edit ${{ inputs.issue_number }} --remove-label "agent: claude"
148-
149- # IMPLEMENT: If ready, Claude implements the issue
150- implement :
151- needs : check-readiness
152- if : needs.check-readiness.outputs.ready == 'true'
153- runs-on : arc-happyvertical
154- timeout-minutes : 60
155- steps :
15676 - name : Checkout repository
77+ if : steps.check.outputs.skip != 'true'
15778 uses : actions/checkout@v4
15879 with :
15980 fetch-depth : 0
16081 token : ${{ secrets.GH_TOKEN }}
16182
16283 - name : Configure Git
84+ if : steps.check.outputs.skip != 'true'
16385 run : |
16486 git config user.name "claude[bot]"
16587 git config user.email "claude[bot]@users.noreply.github.com"
16688
16789 - name : Setup Node.js
90+ if : steps.check.outputs.skip != 'true'
16891 uses : actions/setup-node@v4
16992 with :
17093 node-version : ' 24'
17194
17295 - name : Setup pnpm
96+ if : steps.check.outputs.skip != 'true'
17397 uses : pnpm/action-setup@v4
17498 with :
17599 version : 9
176100
177101 - name : Install dependencies
102+ if : steps.check.outputs.skip != 'true'
178103 run : |
179104 if [ -f "pnpm-lock.yaml" ]; then
180105 pnpm install --frozen-lockfile
@@ -185,24 +110,8 @@ jobs:
185110 fi
186111 continue-on-error : true
187112
188- - name : Post Start Comment
189- env :
190- GH_TOKEN : ${{ secrets.GH_TOKEN }}
191- run : |
192- gh issue comment ${{ inputs.issue_number }} --body "## Implementation Started
193-
194- This issue is ready and I'm beginning implementation.
195-
196- **Status**: In Progress
197- **Started**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
198-
199- I'll post updates as I progress.
200-
201- ---
202- *Automated implementation by Claude*"
203-
204113 - name : Update Project Board to In Progress
205- if : inputs.project_id != '' && inputs.status_in_progress_id != ''
114+ if : steps.check.outputs.skip != 'true' && inputs.project_id != '' && inputs.status_in_progress_id != ''
206115 env :
207116 GH_TOKEN : ${{ secrets.GH_TOKEN }}
208117 run : |
@@ -240,6 +149,7 @@ jobs:
240149 fi
241150
242151 - name : Run Claude Implementation
152+ if : steps.check.outputs.skip != 'true'
243153 id : implement
244154 uses : anthropics/claude-code-action@v1
245155 with :
@@ -263,15 +173,24 @@ jobs:
263173 7. **Commit**: `git commit -m "feat(scope): description\n\nCloses #${{ inputs.issue_number }}"`
264174 8. **Push**: `git push -u origin [branch]`
265175 9. **Create PR**: `gh pr create --title "..." --body "..."`
266- 10. **Post completion** comment on the issue
267176
268- If blocked, post a comment explaining why.
177+ ## If Blocked
178+
179+ If you cannot complete the implementation (unclear requirements, need decisions, etc.):
180+ 1. Post a comment on the issue explaining what you need
181+ 2. Remove the `agent: claude` label so the workflow doesn't re-trigger
182+ 3. The human can clarify and re-apply the label when ready
183+
184+ ```bash
185+ gh issue comment ${{ inputs.issue_number }} --body "## Need Clarification\n\n[your questions here]\n\n---\n*Removing \`agent: claude\` label until clarified*"
186+ gh issue edit ${{ inputs.issue_number }} --remove-label "agent: claude"
187+ ```
269188
270189 allowed_tools : |
271190 Bash(git:*),Bash(gh pr:*),Bash(gh issue:*),Bash(pnpm:*),Bash(npm:*),Bash(npx:*),Bash(node:*),Bash(bun:*),Read,Write,Edit,Glob,Grep,Bash(ls:*),Bash(cat:*),Bash(mkdir:*),Bash(cp:*),Bash(mv:*),Bash(rm:*)
272191
273192 - name : Post Failure Comment
274- if : failure()
193+ if : failure() && steps.check.outputs.skip != 'true'
275194 env :
276195 GH_TOKEN : ${{ secrets.GH_TOKEN }}
277196 run : |
0 commit comments