Skip to content

Instantly share code, notes, and snippets.

@planetbk9
Created February 12, 2026 12:22
Show Gist options
  • Select an option

  • Save planetbk9/9e1669d28d290bf49e650df842a7e6cd to your computer and use it in GitHub Desktop.

Select an option

Save planetbk9/9e1669d28d290bf49e650df842a7e6cd to your computer and use it in GitHub Desktop.
claude code 이슈 처리 에이전트

Fetch open issues from Linear and fix them all.

Known IDs

  • Linear team ID: xxxx
  • Supabase project ID: xxxx

Linear API

Use the Linear GraphQL API via curl with this key:

Authorization: lin_api_xxxx

Fetch issues (Todo + In Progress)

curl -s -X POST https://api.linear.app/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: lin_api_xxxx" \
  -d '{"query":"{ team(id: \"xxxx\") { issues(filter: { state: { type: { in: [\"started\", \"unstarted\"] } } }, first: 50) { nodes { id identifier title description labels { nodes { name } } state { name type } } } } }"}'

Note: Linear state types — unstarted = "Todo", started = "In Progress"

Update issue status to Done

curl -s -X POST https://api.linear.app/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: lin_api_xxxx" \
  -d '{"query":"mutation { issueUpdate(id: \"ISSUE_ID\", input: { stateId: \"DONE_STATE_ID\" }) { success } }"}'

To get the "Done" state ID, query workflow states first:

curl -s -X POST https://api.linear.app/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: lin_api_xxxx" \
  -d '{"query":"{ team(id: \"xxxx\") { states { nodes { id name type } } } }"}'

Issue Format

Issues follow this description format:

* issue: <what's wrong>
* fix: <what to do>
* verification: <how to verify>
  • Labels indicate which pages/areas are affected (e.g., product detail, partner-product, home(product list))
  • Skip any issue where the issue and fix fields are both empty (test/junk issues)

Workflow

  1. Fetch open issues using the Linear GraphQL API (curl) — get both "Todo" and "In Progress" issues
  2. Filter out junk: Skip issues where the issue: and fix: fields in the description are empty
  3. Display a summary table of valid issues: | # | ID | Title | Label (page) | Issue | Fix | Each row should show the parsed issue/fix from the description
  4. If there are 0 valid issues, report that there are no issues to fix and stop
  5. If there are 2+ issues, use TeamCreate to spawn a team with one agent per issue working in parallel:
    • Create the team with TeamCreate
    • Create a task per issue with TaskCreate
    • Spawn a general-purpose agent per issue via the Task tool with team_name, assigning each agent one issue
    • Each agent should: read the issue requirements, explore relevant code, implement changes, and report back
    • The lead (you) coordinates: runs bun run typecheck after all agents finish, resolves conflicts if any, and updates Linear status to "Done"
  6. If there is only 1 issue, fix it directly without spawning a team
  7. Update Linear status to "Done" for each completed issue using the Linear GraphQL API (curl mutation)

Important Notes

  • Apply database migrations using the Supabase MCP tools (apply_migration, execute_sql) with project ID xxxx
  • After migration, regenerate types using mcp__plugin_supabase_supabase__generate_typescript_types and write to packages/db/src/database.types.ts
  • Always run bun run typecheck before marking issues as done
  • Follow the project conventions in CLAUDE.md (naming, imports, code style)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment