Fetch open issues from Linear and fix them all.
- Linear team ID:
xxxx - Supabase project ID:
xxxx
Use the Linear GraphQL API via curl with this key:
Authorization: lin_api_xxxx
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"
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 } } } }"}'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
issueandfixfields are both empty (test/junk issues)
- Fetch open issues using the Linear GraphQL API (curl) — get both "Todo" and "In Progress" issues
- Filter out junk: Skip issues where the
issue:andfix:fields in the description are empty - Display a summary table of valid issues: | # | ID | Title | Label (page) | Issue | Fix | Each row should show the parsed issue/fix from the description
- If there are 0 valid issues, report that there are no issues to fix and stop
- 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-purposeagent per issue via theTasktool withteam_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 typecheckafter all agents finish, resolves conflicts if any, and updates Linear status to "Done"
- Create the team with
- If there is only 1 issue, fix it directly without spawning a team
- Update Linear status to "Done" for each completed issue using the Linear GraphQL API (curl mutation)
- Apply database migrations using the Supabase MCP tools (
apply_migration,execute_sql) with project IDxxxx - After migration, regenerate types using
mcp__plugin_supabase_supabase__generate_typescript_typesand write topackages/db/src/database.types.ts - Always run
bun run typecheckbefore marking issues as done - Follow the project conventions in CLAUDE.md (naming, imports, code style)