Skip to content

Commit af0c84f

Browse files
committed
fix: make agent:claude autopilot implementation-only
- Remove prepare phase from autopilot workflow - Unready issues now get rejected with helpful comment - Label is automatically removed when issue not ready - Directs users to Issue Checkup or @claude for preparation Autopilot is now strictly for fully autonomous implementation.
1 parent 65d35a1 commit af0c84f

2 files changed

Lines changed: 26 additions & 142 deletions

File tree

.github/workflows/org-agent-autopilot.yml

Lines changed: 20 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ on:
2525
required: false
2626
type: string
2727
default: ''
28-
status_planning_id:
29-
description: 'Status option ID for "Planning"'
30-
required: false
31-
type: string
32-
default: ''
3328
status_in_progress_id:
3429
description: 'Status option ID for "In Progress"'
3530
required: false
@@ -115,151 +110,41 @@ jobs:
115110
echo "missing=" >> $GITHUB_OUTPUT
116111
fi
117112
118-
# PREPARE: If not ready, Claude will prepare the issue
119-
prepare:
113+
# NOT READY: Reject and remove label
114+
not-ready:
120115
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'
122117
runs-on: arc-happyvertical
123-
timeout-minutes: 15
118+
timeout-minutes: 5
124119
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
131121
env:
132122
GH_TOKEN: ${{ secrets.GH_TOKEN }}
133123
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
210125
211-
**Labels Applied**: [list labels]
212-
**Implementation Plan**: [brief plan]
126+
The \`agent: claude\` label is for **fully autonomous implementation only**.
213127
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 }}**
216129
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
220134
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
222139
223-
allowed_tools: |
224-
Bash(gh issue:*),Bash(gh search:*),Read,Grep,Glob
140+
---
141+
*Removing \`agent: claude\` label*"
225142
226-
- name: Update Project Board to Planning
227-
if: inputs.project_id != '' && inputs.status_planning_id != ''
143+
- name: Remove Label
228144
env:
229145
GH_TOKEN: ${{ secrets.GH_TOKEN }}
230146
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"
263148
264149
# IMPLEMENT: If ready, Claude implements the issue
265150
implement:

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,12 @@ Analyzes test failures:
104104

105105
### Agent Autopilot (`org-agent-autopilot.yml`)
106106

107-
Full implementation automation triggered by `agent: claude` label:
108-
1. Validates Definition of Ready
109-
2. Creates feature branch
110-
3. Implements the solution
111-
4. Runs quality checks
112-
5. Creates pull request
113-
6. Updates issue status
107+
Full **autonomous implementation** triggered by `agent: claude` label:
108+
1. Validates Definition of Ready (type, priority, size labels + description)
109+
2. If not ready: **rejects and removes label** with helpful comment
110+
3. If ready: Creates feature branch, implements, runs quality checks, creates PR
111+
112+
**Important**: This is for fully autonomous implementation only. Use Issue Checkup or `@claude` mentions for issue preparation/triage.
114113

115114
### Issue Checkup (`org-issue-checkup.yml`)
116115

0 commit comments

Comments
 (0)