Assigning an Issue to the Agent: Setup and Hygiene
Issue labeling, branch hygiene, environment prep.
What You Will Learn
- Prepare issues for delegation.
- Label correctly.
- Prep branch environment.
- Configure CI gates.
- Document delegation runbook.
Why This Matters
Delegation success depends on setup. Poorly-prepared issues produce poor agent PRs. This lesson builds the delegation runbook.
Concept Explained
Delegation setup: label issue as agent-eligible, write detailed acceptance criteria, ensure tests exist, verify CI gates, confirm branch protection.
How It Works
Triage issue for delegation eligibility. Add detailed acceptance criteria. Ensure tests exist or are specified. Add 'agent-ok' label. Assign to agent. Monitor.
Step-by-Step Tutorial
1. Triage for eligibility
Well-specified? Low-risk? Testable? See PR-15 scope-of-use.2. Write acceptance criteria
Specific, testable: 'function X throws TypeError on null input. Test in tests/X.test.ts covers this.'3. Ensure tests exist
Or specify what tests agent should add.4. Verify CI gates
Status checks required. Required reviewers configured.5. Verify branch protection
No direct push to main. PR required.6. Add label and assign
Add 'agent-ok' label. Assign to agent.7. Monitor
Check progress. Review PR when opened.Real-World Example
A team prepared an issue: 'Add null check to parseDate. Test in tests/date.test.ts: should throw TypeError on null input. Function in src/date.ts.' Agent completed in 8 minutes, PR passed review. Clean delegation thanks to prep.
Example Prompts / Commands / Code
Title: Add null check to parseDate function
Description:
The `parseDate` function in `src/date.ts` throws an unhandled TypeError when input is null. Add a null check that throws a descriptive TypeError.
Acceptance criteria:
- [ ] `parseDate(null)` throws TypeError with message 'input is required'
- [ ] `parseDate('2024-01-15')` returns Date object (existing behavior preserved)
- [ ] `parseDate('invalid')` returns null (existing behavior preserved)
- [ ] Test added in `tests/date.test.ts` covering the null case
Files affected:
- src/date.ts
- tests/date.test.ts
Out of scope:
- Other functions in date.ts
- Type definitions
- Documentation
Labels: agent-ok, good-first-issue
1. Triage issue (see PR-15 scope-of-use)
2. Write acceptance criteria (specific, testable)
3. Ensure tests exist or are specified
4. Verify CI gates (status checks, required reviewers)
5. Verify branch protection (no direct push to main)
6. Add 'agent-ok' label
7. Assign to agent
8. Monitor (check progress every 30 min)
9. Review PR when opened (use IN-32 checklist)
10. Iterate if needed (reject + refine issue + re-delegate)
11. Merge when satisfied
Common Mistakes
- Vague issues — agent flails.
- No acceptance criteria — can't verify completion.
- No tests — agent's changes untested.
- No CI gates — agent's PR could merge without review.
Best Practices
- Triage for eligibility first.
- Write specific, testable acceptance criteria.
- Ensure tests exist or specify what to add.
- Verify CI gates and branch protection.
- Use 'agent-ok' label for eligible issues.
Troubleshooting
| Problem | How to Fix |
|---|---|
| Agent produces wrong code | Issue was ambiguous. Reject, refine, re-delegate. |
| CI fails on agent PR | May indicate missing test setup. Or agent introduced bug. Review. |
Practical Exercise
Your Turn
Take a real issue from your backlog. Prepare it for delegation using the template. Verify eligibility. Add label.
Professional Challenge
Build a delegation runbook for your team. Document the prep process. Train teammates on delegation.
Key Takeaways
- Delegation success depends on prep.
- Write specific, testable acceptance criteria.
- Ensure tests exist or specify.
- Verify CI gates and branch protection.
- Use 'agent-ok' label for eligibility.
Frequently Asked Questions
How long should an agent task take?
Can agent ask questions?
Further Reading
Official References
SEO Metadata
SEO title: Assigning an Issue to the Agent: Setup and Hygiene
Meta description: Issue labeling, branch hygiene, environment prep.
Primary keyword: assigning an issue to the agent
Secondary keywords: assigning an issue to the agent: setup and hygiene
Search intent: Informational
URL slug: /assigning-issue-to-coding-agent-setup-hygiene
Categories: AI Tools, GitHub Copilot
Tags: GitHub Copilot, Professional, Coding Agent, Issue Triage, Branch Hygiene, IMCSEIAN, Tutorial, IMCSEIAN
Featured image concept: IMCSEIAN lesson card for Assigning an Issue to the Agent: Setup and Hygiene
Comments
Comments
Post a Comment