Skip to content

Instantly share code, notes, and snippets.

@zfael
Created January 8, 2026 17:45
Show Gist options
  • Select an option

  • Save zfael/6cabeacc1ea788c71433a0dff0f5fbed to your computer and use it in GitHub Desktop.

Select an option

Save zfael/6cabeacc1ea788c71433a0dff0f5fbed to your computer and use it in GitHub Desktop.

WRAP - Issue Writing for AI Coding Agents

Transform a task/idea into a well-structured issue optimized for AI coding agents.

WRAP: Write effective issues | Refine instructions | Atomic tasks | Pair with agent

Input

$ARGUMENTS - Task description, Jira ticket ID, or rough idea to transform

Process

1. Gather Context

If Jira ticket provided:

  • Fetch ticket via mcp__atlassian__getJiraIssue
  • Extract requirements, acceptance criteria, linked issues

If raw idea:

  • Clarify scope with user if ambiguous

2. Analyze Codebase (for context)

  • Identify relevant files/modules for the task
  • Find existing patterns to reference
  • Note testing conventions used

3. Apply WRAP Principles

W - Write Effective Issue

Structure the task as if explaining to a new developer:

  • Title: Clear, specific location + action (e.g., "Add retry logic to ChargebeeClient.createSubscription")
  • Context: Why this change? What problem does it solve?
  • Requirements: Concrete, testable acceptance criteria
  • Examples: Include code samples of desired patterns

R - Refine Instructions

Add project-specific guidance:

  • Reference existing similar implementations
  • Specify error handling patterns to follow
  • Note any gotchas or edge cases
  • Include relevant file paths

A - Atomic Tasks

If task is large, break into independent sub-tasks:

  • Each task should be completable in isolation
  • Each should have clear definition of done
  • Suggest dependency order if needed

P - Pair Considerations

Flag what needs human review:

  • Security implications
  • Architecture decisions
  • External API changes
  • Database migrations

4. Output Format

## Issue: [Clear, Specific Title]

### Context
[Why this change is needed - 1-2 sentences]

### Requirements
- [ ] [Specific, testable requirement 1]
- [ ] [Specific, testable requirement 2]
- [ ] [Tests added/updated]

### Implementation Guidance
**Files likely involved:**
- `path/to/file.ts` - [what changes]

**Pattern to follow:**
```typescript
// Reference existing pattern from codebase

Edge cases to handle:

  • [case 1]
  • [case 2]

Definition of Done

  • Implementation complete
  • Tests passing
  • Lint/type checks pass
  • [Any manual verification needed]

Human Review Needed

  • [List items requiring human judgment]

---

## If Task is Too Large

Decompose into atomic issues:

```markdown
## Parent: [Overall Goal]

### Issue 1: [First atomic task]
[WRAP-formatted content]

### Issue 2: [Second atomic task]
Depends on: Issue 1
[WRAP-formatted content]

### Issue 3: [Third atomic task]
Can run parallel to Issue 2
[WRAP-formatted content]

Quick Reference

Bad Issue Good Issue
"Fix auth" "Add token refresh to AuthService when 401 received"
"Update tests" "Add unit tests for UserService.validateEmail edge cases"
"Refactor payments" "Extract PaymentProcessor interface from StripeClient"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment