asana-sweep
Scheduled AI sweep of your Asana tasks - triage, dedupe, and open GitLab issues that trigger an AI coding harness.
A Claude Code plugin that periodically sweeps the Asana tasks assigned to you, triages them with AI judgment, and turns the actionable ones into GitLab issues that trigger an AI coding harness — so routine "read the ticket → write a plan → kick off the agent" work runs unattended. The official Asana MCP server is remote and OAuth-only. OAuth needs an interactive login and token refresh — fragile for unattended scheduled runs.
Summary extracted from the README.
asana-sweep
繁體中文安裝指南 → SETUP.zh-TW.md
A Claude Code plugin that periodically sweeps the Asana tasks assigned to you, triages them with AI judgment, and turns the actionable ones into GitLab issues that trigger an AI coding harness — so routine "read the ticket → write a plan → kick off the agent" work runs unattended.
scheduler (cron / Task Scheduler)
└─ claude -p "run the asana-sweep skill" --allowedTools "<allowlist>"
├─ fetch my incomplete Asana tasks (local MCP, PAT auth — works headless)
├─ triage: 🟢 auto / 🟡 ask a human / ⚪ skip
├─ dedupe against open issues, plans, branches
├─ 🟢 → asana-to-harness skill → GitLab issue + @claude trigger comment
└─ write a summary file (your wrapper can forward it to Discord/Slack)
Three skills are included:
- asana-sweep-setup — derive and confirm a repository's config, then validate it with a dry run.
- asana-sweep — the scheduled sweep: fetch → triage → dedupe → trigger → report.
- asana-to-harness — turn one Asana task into a plan, open a GitLab issue with the plan as its description, and post the trigger comment. Also usable standalone in an interactive session.
Why a local PAT-based Asana MCP (and not the official one)?
The official Asana MCP server is remote and OAuth-only. OAuth needs an interactive login and token refresh — fragile for unattended scheduled runs. This plugin bundles config for @roychri/mcp-server-asana (community, MIT), which runs locally over stdio with a long-lived Personal Access Token: set it once, runs headless forever. Tested in real scheduled use.
Requirements
- Claude Code (the plugin host) with an active subscription or API key.
- Node.js (the Asana MCP server runs via npm/npx).
- A GitLab MCP server configured in your environment, exposing at least
list_issues,create_issue,create_issue_note(e.g. the official GitLab MCP server or a community one). This plugin does not bundle one because GitLab auth setups vary. - An AI coding harness listening on your GitLab project — anything that reacts to a mention comment on an issue (a webhook-triggered CI job running Claude Code, GitLab Duo, etc.). The sweep only opens issues and comments; the harness does the implementation.
- An Asana Personal Access Token — create one in the Asana developer console.
Install
/plugin marketplace add <this-repo-url>
/plugin install asana-sweep@asana-sweep
You will be prompted for your Asana PAT (stored in your OS credential store — never in any repo).
Then, in the repository where the sweep should run:
Fast setup: tell Claude Code “set up asana-sweep”. The setup skill derives the repository, default branch, workspace, plan paths, and a draft scope from your actual incomplete tasks; after you confirm the draft, it writes the config and runs a dry run.
Or configure it manually:
cp <plugin-repo>/asana-sweep.config.example.json ./asana-sweep.config.json
# fill in workspace_gid, gitlab.project, repo_scope, ...
echo "asana-sweep.config.json" # keep it or gitignore it — it holds no secrets
Add the state/summary paths to your .gitignore (defaults: docs/plans/.asana-sweep-*).
Finding your workspace gid
Ask Claude Code: "using the asana MCP, list my workspaces" — or call asana_list_workspaces yourself.
Limiting the sweep to certain boards (asana_projects)
Optional, and the easiest win if your Asana boards line up with your repos:
"asana_projects": ["ACME Store dev"]
List the boards (Asana projects) this repo's work lives on, by name or by gid. Anything assigned to you outside those boards is dropped before triage even starts. Leave it empty (or omit it) to sweep everything assigned to you.
If one board maps 1:1 to this repo, set asana_projects and you can keep repo_scope minimal — the board membership already answers "is this ours?", far more reliably than keywords. Reach for a detailed repo_scope when a single board mixes several systems, or when this repo's work is spread across boards.
⚠️ Asana subtasks normally belong to no project — board membership lives further up the tree, and often more than one level up (a sub-subtask and its parent can both have an empty
projectsarray while the grandparent carries the board). The skill walks the whole ancestor chain, so workflows where you are assigned bare "implement" subtasks still work. Worth knowing if you ever debug why a task was or was not picked up.
Configuring repo_scope
This is the setting people get stuck on, and the one that stops the sweep opening issues it shouldn't. (If you set asana_projects above and your boards map cleanly to repos, a couple of entries here are enough — this section matters most when one board covers several systems.)
Your Asana list covers everything you're assigned — this product, other products, other clients, ops chores. The harness can only produce code in one repo (gitlab.project). repo_scope is how the sweep tells those apart.
"repo_scope": {
"this_repo_hints": ["acme-shop", "ACME Store", "admin panel", "checkout", "inventory"],
"other_systems": ["Storefront-Next", "storefront.acme.com", "BigCorp site", "bigcorp.example", "iOS app"]
}
other_systems— the safety gate; fill this one carefully. List every other thing you get assigned work for: other products, other clients' sites, external platforms, mobile apps, infrastructure. Use the names and domains that actually appear in your task titles, parent tasks, and notes. A hit here is a hard skip.this_repo_hints— supporting evidence that a task is about this repo: the product name, internal nicknames, and the modules or areas you work on. Matching nothing here does not auto-skip a task; hints only raise confidence.
Three things worth knowing:
- These are hints for a language model, not regex filters. The test the skill actually applies is "would finishing this task mean committing code to this repo?" A task naming a system you never listed still gets judged on its content.
- Uncertain never means "open it". Anything the sweep can't place confidently is reported as 🟡 for you to decide — it never opens an issue on a guess.
- Tune it from real runs. Do a few
--dry-runpasses and read the ⚪ reasons. If something was wrongly skipped, or an off-limits system slipped through, add the name and run again. This list gets good after two or three rounds, not on the first write.
First run: always dry-run
claude -p "run the asana-sweep skill --dry-run"
Dry-run stops after triage + dedupe and only prints what would happen. Check that the 🟢/🟡/⚪ classification matches your intuition — tune repo_scope and skip_rules until it does — before scheduling the real thing.
Scheduling
Before you schedule: launch the Asana server from a global install
Do this before setting up any unattended run. The bundled MCP config starts the Asana server with npx, which re-resolves the package on every launch (~12s on a cold cache). Claude Code waits roughly 10 seconds for an MCP server to register, so a scheduled run can start with no Asana tools at all — and the failure is intermittent and quiet: it works for days, then one run sweeps zero tasks and reports "nothing to do". Pre-warming the npx cache first is not a reliable fix — that was tried and still failed in production.
Install the server once, globally:
npm install -g @roychri/mcp-server-asana
npm root -g # prints the directory used in the path below
Then declare your own MCP server pointing at that install — put it in your user config or the project's .mcp.json, not inside the plugin's directory (plugin updates overwrite files there):
{
"mcpServers": {
"asana-local": {
"command": "node",
"args": ["<npm root -g>/@roychri/mcp-server-asana/dist/index.js"],
"env": { "ASANA_ACCESS_TOKEN": "<your Asana PAT>" }
}
}
}
Startup drops from ~12s to ~2s. Keep both server prefixes in the allowlist below, so the run succeeds as long as either server registered.
Scheduling itself is deliberately left to your OS — pick any times you like. The command to schedule (working directory = the target repo):
claude -p "run the asana-sweep skill" --allowedTools "<allowlist below>"
Add --model <model> to pin which Claude model the sweep uses (e.g. a cheaper model for routine sweeps); omit it to use your default.
Recommended allowlist (headless runs must use an explicit allowlist; never --dangerously-skip-permissions):
mcp__asana-local__asana_get_my_tasks,mcp__asana-local__asana_get_task,mcp__asana-local__asana_get_task_stories,mcp__asana-local__asana_get_subtasks,
mcp__plugin_asana-sweep_asana__asana_get_my_tasks,mcp__plugin_asana-sweep_asana__asana_get_task,mcp__plugin_asana-sweep_asana__asana_get_task_stories,mcp__plugin_asana-sweep_asana__asana_get_subtasks,
mcp__gitlab__list_issues,mcp__gitlab__create_issue,mcp__gitlab__create_issue_note,
Read,Grep,Glob,Write,Bash(asana-fetch-attachments:*),Bash(git branch:*),Bash(git log:*),Task,Skill
The two Asana blocks are the same four tools served by two different servers: asana-local is the global install you set up above, plugin_asana-sweep_asana is the plugin's bundled one. Listing both means either can carry the run. Tool names are not guesses — run /mcp in an interactive session to see exactly what your setup registers, since a prefix that matches nothing silently denies the tool and the sweep stops at step 1.
- Windows — Task Scheduler: create a task with your chosen triggers (e.g. daily 09:00 and 15:00), action = the command above. Redirect stdout to a log file if you want history (
>> sweep.log). - Linux/macOS — cron:
0 9,15 * * 1-5 cd /path/to/repo && claude -p "..." >> sweep.log 2>&1
Notifications (optional)
Every run rewrites summary_file — even when nothing happened (heartbeat: a stale file means the run broke). Wrap the scheduled command in a small script that posts that file to Discord/Slack after each run; the skill itself never calls webhooks.
Running on a server
The plugin runs anywhere Claude Code runs. For unattended servers, authenticate once with a long-lived subscription token:
claude setup-token # on any machine with a browser, prints a 1-year OAuth token
# on the server:
export CLAUDE_CODE_OAUTH_TOKEN=<token>
Quota note: a subscription token shares its rate limits with your interactive use.
Reading image attachments (optional, recommended)
PM specs often live in screenshots or annotated printouts attached to Asana tasks, and the bundled MCP server has no attachment tools. To let the skills read image attachments (Claude reads images, including handwritten annotations):
- Expose your Asana PAT as the environment variable
ASANA_PATwherever the sweep runs — in your scheduler wrapper (set "ASANA_PAT=..."on Windows,export ASANA_PAT=...in cron) or your shell profile for interactive use. Yes, this duplicates the token you gave the plugin config; the plugin's secure store isn't readable by shell commands, so the shell needs its own copy. Keep the wrapper file out of any repo. - Add
Bash(asana-fetch-attachments:*)to your headless--allowedToolslist.
The plugin ships a bin/asana-fetch-attachments helper (added to PATH on install) that reads ASANA_PAT internally and downloads a task's image attachments — so the command line never contains the token or a $VAR expansion (headless permission matching rejects commands with variable expansions, which is why a raw curl -H "... $ASANA_PAT" cannot be allowlisted). Videos and other non-image files are still unreadable and fall back to "ask the human" (🟡).
Troubleshooting
- Asana tools never appear, or a scheduled run sweeps zero tasks — the
npxlaunch lost the race with Claude Code's MCP registration window. See Before you schedule; a global install plus your own server entry fixes it permanently. Don't patch the plugin's own.mcp.json— updates overwrite it. - A run reports 0 tasks scanned but no error — almost always an allowlist prefix that matches no registered server. Check the exact names with
/mcp. payment_requiredfrom Asana — your workspace is on the free tier; search endpoints are paid-only. Setpaid_workspace: falsein the config (the skills then use only the free User Task List endpoint).- Issues opened for the wrong project's tasks — tighten
repo_scope.other_systems; the triage hard-gate judges by "is the deliverable code in this repo?", and anything ambiguous is demoted to 🟡 (report-only) rather than opened.
Security notes
- Your Asana PAT lives in your OS credential store (via the plugin's
userConfig); nothing sensitive is ever written to a repo. - Issue creation is the only write action, and it is gated three times: triage (🟢 only), dedupe, and the state file (each task opens at most one issue, ever).
Acknowledgements
Developed at boyu Inc. (博聿股份有限公司) — https://boyu.one/ — and released as open source. Built and maintained by Cyrus.
License
MIT — see LICENSE.