|
25 | 25 | required: false |
26 | 26 | type: string |
27 | 27 | default: '' |
28 | | - status_planning_id: |
29 | | - description: 'Status option ID for "Planning"' |
30 | | - required: false |
31 | | - type: string |
32 | | - default: '' |
33 | 28 | status_in_progress_id: |
34 | 29 | description: 'Status option ID for "In Progress"' |
35 | 30 | required: false |
@@ -115,151 +110,41 @@ jobs: |
115 | 110 | echo "missing=" >> $GITHUB_OUTPUT |
116 | 111 | fi |
117 | 112 |
|
118 | | - # PREPARE: If not ready, Claude will prepare the issue |
119 | | - prepare: |
| 113 | + # NOT READY: Reject and remove label |
| 114 | + not-ready: |
120 | 115 | needs: check-readiness |
121 | | - if: needs.check-readiness.outputs.ready == 'false' && needs.check-readiness.outputs.missing != 'Issue is closed' |
| 116 | + if: needs.check-readiness.outputs.ready == 'false' |
122 | 117 | runs-on: arc-happyvertical |
123 | | - timeout-minutes: 15 |
| 118 | + timeout-minutes: 5 |
124 | 119 | steps: |
125 | | - - name: Checkout repository |
126 | | - uses: actions/checkout@v4 |
127 | | - with: |
128 | | - fetch-depth: 1 |
129 | | - |
130 | | - - name: Post Preparation Comment |
| 120 | + - name: Post Not Ready Comment |
131 | 121 | env: |
132 | 122 | GH_TOKEN: ${{ secrets.GH_TOKEN }} |
133 | 123 | run: | |
134 | | - gh issue comment ${{ inputs.issue_number }} --body "## Preparing Issue for Implementation |
135 | | -
|
136 | | - This issue needs some preparation before I can implement it. |
137 | | -
|
138 | | - **Missing**: ${{ needs.check-readiness.outputs.missing }} |
139 | | -
|
140 | | - I'll analyze the issue and: |
141 | | - - Add appropriate labels (type, priority, size) |
142 | | - - Clarify requirements if needed |
143 | | - - Create an implementation plan |
144 | | -
|
145 | | - --- |
146 | | - *Automated preparation by Claude*" |
147 | | -
|
148 | | - - name: Run Claude Preparation |
149 | | - uses: anthropics/claude-code-action@v1 |
150 | | - with: |
151 | | - claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} |
152 | | - timeout_minutes: 12 |
153 | | - prompt: | |
154 | | - REPO: ${{ github.repository }} |
155 | | - ISSUE_NUMBER: ${{ inputs.issue_number }} |
156 | | - MISSING: ${{ needs.check-readiness.outputs.missing }} |
157 | | -
|
158 | | - This issue has the `agent: claude` label but is not ready for implementation. |
159 | | - Your job is to PREPARE it so it can be implemented. |
160 | | -
|
161 | | - ## Step 1: Read and Understand |
162 | | -
|
163 | | - ```bash |
164 | | - gh issue view ${{ inputs.issue_number }} |
165 | | - ``` |
166 | | -
|
167 | | - Read the issue thoroughly. Also read CLAUDE.md for repository context. |
168 | | -
|
169 | | - ## Step 2: Add Missing Labels |
170 | | -
|
171 | | - Based on the issue content, apply appropriate labels: |
172 | | -
|
173 | | - **Type** (choose one): |
174 | | - - `type: bug` - Something broken |
175 | | - - `type: feature` - New functionality |
176 | | - - `type: docs` - Documentation |
177 | | - - `type: maintenance` - Refactoring, cleanup |
178 | | - - `type: research` - Investigation needed |
179 | | -
|
180 | | - **Priority** (choose one): |
181 | | - - `priority: critical` - Urgent, blocking |
182 | | - - `priority: high` - Important |
183 | | - - `priority: medium` - Normal (default) |
184 | | - - `priority: low` - Nice to have |
185 | | -
|
186 | | - **Size** (choose one based on complexity): |
187 | | - - `size: xs` - < 2 hours, trivial |
188 | | - - `size: s` - 2-4 hours, small |
189 | | - - `size: m` - ~1 day, moderate |
190 | | - - `size: l` - 2-3 days, significant |
191 | | - - `size: xl` - > 3 days, large |
192 | | -
|
193 | | - Apply labels: |
194 | | - ```bash |
195 | | - gh issue edit ${{ inputs.issue_number }} --add-label "type: X,priority: Y,size: Z" |
196 | | - ``` |
197 | | -
|
198 | | - ## Step 3: Clarify and Plan |
199 | | -
|
200 | | - If the issue description is vague or missing details, post a comment with: |
201 | | - 1. Your understanding of what needs to be done |
202 | | - 2. Any clarifying questions |
203 | | - 3. A brief implementation plan |
204 | | -
|
205 | | - ## Step 4: Completion |
206 | | -
|
207 | | - Post a summary comment: |
208 | | - ``` |
209 | | - ## Issue Prepared |
| 124 | + gh issue comment ${{ inputs.issue_number }} --body "## Issue Not Ready for Autopilot |
210 | 125 |
|
211 | | - **Labels Applied**: [list labels] |
212 | | - **Implementation Plan**: [brief plan] |
| 126 | + The \`agent: claude\` label is for **fully autonomous implementation only**. |
213 | 127 |
|
214 | | - This issue is now ready for implementation. The `agent: claude` label will trigger |
215 | | - the implementation phase automatically. |
| 128 | + This issue is missing: **${{ needs.check-readiness.outputs.missing }}** |
216 | 129 |
|
217 | | - If you'd like me to proceed with implementation now, just comment "@claude implement this". |
218 | | - Otherwise, I'll wait for manual review. |
219 | | - ``` |
| 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 |
220 | 134 |
|
221 | | - DO NOT start implementation yet - just prepare the issue. |
| 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 |
222 | 139 |
|
223 | | - allowed_tools: | |
224 | | - Bash(gh issue:*),Bash(gh search:*),Read,Grep,Glob |
| 140 | + --- |
| 141 | + *Removing \`agent: claude\` label*" |
225 | 142 |
|
226 | | - - name: Update Project Board to Planning |
227 | | - if: inputs.project_id != '' && inputs.status_planning_id != '' |
| 143 | + - name: Remove Label |
228 | 144 | env: |
229 | 145 | GH_TOKEN: ${{ secrets.GH_TOKEN }} |
230 | 146 | run: | |
231 | | - ISSUE_NODE_ID=$(gh api graphql -f query=' |
232 | | - query($owner: String!, $repo: String!, $number: Int!) { |
233 | | - repository(owner: $owner, name: $repo) { |
234 | | - issue(number: $number) { |
235 | | - id |
236 | | - projectItems(first: 10) { |
237 | | - nodes { |
238 | | - id |
239 | | - project { id } |
240 | | - } |
241 | | - } |
242 | | - } |
243 | | - } |
244 | | - } |
245 | | - ' -f owner="${{ github.repository_owner }}" -f repo="${{ github.event.repository.name }}" -F number=${{ inputs.issue_number }} --jq '.data.repository.issue') |
246 | | -
|
247 | | - ITEM_ID=$(echo "$ISSUE_NODE_ID" | jq -r ".projectItems.nodes[] | select(.project.id == \"${{ inputs.project_id }}\") | .id" 2>/dev/null || echo "") |
248 | | -
|
249 | | - if [ -n "$ITEM_ID" ]; then |
250 | | - gh api graphql -f query=' |
251 | | - mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) { |
252 | | - updateProjectV2ItemFieldValue(input: { |
253 | | - projectId: $projectId |
254 | | - itemId: $itemId |
255 | | - fieldId: $fieldId |
256 | | - value: { singleSelectOptionId: $optionId } |
257 | | - }) { |
258 | | - projectV2Item { id } |
259 | | - } |
260 | | - } |
261 | | - ' -f projectId="${{ inputs.project_id }}" -f itemId="$ITEM_ID" -f fieldId="${{ inputs.status_field_id }}" -f optionId="${{ inputs.status_planning_id }}" || true |
262 | | - fi |
| 147 | + gh issue edit ${{ inputs.issue_number }} --remove-label "agent: claude" |
263 | 148 |
|
264 | 149 | # IMPLEMENT: If ready, Claude implements the issue |
265 | 150 | implement: |
|
0 commit comments