A TaskSpawner that polls GitHub for issues matching a label filter and automatically creates a Task for each one. This is the core pattern for autonomous issue resolution.
Automatically assign an AI agent to every new bug-labeled issue. The agent
clones the repo, investigates the issue, and opens a PR with a fix.
| File | Kind | Purpose |
|---|---|---|
credentials-secret.yaml |
Secret | Claude OAuth token for the agent |
github-token-secret.yaml |
Secret | GitHub token for cloning, PR creation, and issue polling |
workspace.yaml |
Workspace | Git repository to clone into each Task |
taskspawner.yaml |
TaskSpawner | Watches GitHub issues and spawns Tasks |
TaskSpawner polls GitHub Issues (label: bug, state: open)
│
├── new issue found → creates Task → agent fixes bug → opens PR
├── new issue found → creates Task → agent fixes bug → opens PR
└── ...
-
Edit the secrets — replace placeholders in both secret files.
-
Edit
workspace.yaml— set your repository URL and branch. -
Apply the resources:
kubectl apply -f examples/03-taskspawner-github-issues/- Verify the spawner is running:
kubectl get taskspawners -w-
Create a test issue with the
buglabel in your repository. The TaskSpawner picks it up on the next poll and creates a Task. -
Watch spawned Tasks:
kubectl get tasks -w- Cleanup:
kubectl delete -f examples/03-taskspawner-github-issues/- Change
labelsintaskspawner.yamlto match your labeling scheme. - Add
excludeLabelsto skip issues that need human input (e.g.,["needs-triage", "wontfix"]). - Adjust
pollIntervalinside the source block to control how often GitHub is polled. - Set
maxConcurrencyto limit how many Tasks run in parallel. - Edit
promptTemplateto give the agent more specific instructions.