@@ -12,7 +12,10 @@ permissions:
1212 issues : read
1313 pull-requests : read
1414
15- network : defaults
15+ network :
16+ allowed :
17+ - defaults
18+ - app.asana.com
1619
1720tools :
1821 github :
@@ -26,9 +29,46 @@ safe-outputs:
2629 allowed-github-references : []
2730 create-pull-request :
2831 title-prefix : " [Android Maintenance] "
32+ labels : [agentic-maintenance]
2933 base-branch : develop
3034 draft : true
3135 github-token : ${{ secrets.GT_DAXMOBILE }}
36+ mcp-scripts :
37+ asana_get_section_tasks :
38+ description : " List tasks in a given section of an Asana project. Returns task GIDs, names, and URLs."
39+ inputs :
40+ section_gid :
41+ type : string
42+ required : true
43+ description : " The GID of the Asana section to list tasks from"
44+ script : |
45+ const token = process.env.ASANA_ACCESS_TOKEN;
46+ const res = await fetch(
47+ `https://app.asana.com/api/1.0/sections/${section_gid}/tasks?opt_fields=name,permalink_url`,
48+ { headers: { Authorization: `Bearer ${token}` } }
49+ );
50+ if (!res.ok) throw new Error(`Asana API error: ${res.status}`);
51+ return await res.json();
52+ env :
53+ ASANA_ACCESS_TOKEN : " ${{ secrets.ASANA_ACCESS_TOKEN }}"
54+
55+ asana_get_task :
56+ description : " Get full details of an Asana task by GID. Returns name, notes (description), and URL."
57+ inputs :
58+ task_gid :
59+ type : string
60+ required : true
61+ description : " The GID of the Asana task to fetch"
62+ script : |
63+ const token = process.env.ASANA_ACCESS_TOKEN;
64+ const res = await fetch(
65+ `https://app.asana.com/api/1.0/tasks/${task_gid}?opt_fields=name,notes,permalink_url,memberships.section.name`,
66+ { headers: { Authorization: `Bearer ${token}` } }
67+ );
68+ if (!res.ok) throw new Error(`Asana API error: ${res.status}`);
69+ return await res.json();
70+ env :
71+ ASANA_ACCESS_TOKEN : " ${{ secrets.ASANA_ACCESS_TOKEN }}"
3272engine : claude
3373---
3474
@@ -62,22 +102,30 @@ PR against live data before acting on memory.
62102
63103### Step 1: Check for in-progress work
64104
65- 1 . Read memory for any task marked in_progress
66- 2 . If found, fetch the current state of that task and its PR from live data
67- 3 . If the PR has CI failures caused by your changes → fix them, push an update, and stop
68- 4 . If the PR has merge conflicts → resolve them, push an update, and stop
69- 5 . If the PR is in "In Review" with no issues → nothing to do, stop
70- 6 . If no in-progress task exists → proceed to Step 2
105+ ** Before doing anything else, check live state — do not rely on memory alone.**
106+
107+ 1 . Use the ` asana_get_section_tasks ` tool to list tasks in the "In Progress" section
108+ (section GID: ` 1213746476312672 ` ).
109+ 2 . List open GitHub PRs whose title starts with ` [Android Maintenance] `
110+ (use the GitHub MCP tool ` list_pull_requests ` with state ` open ` ).
111+ 3 . If EITHER check returns results → in-progress work exists. Go to step 5.
112+ 4 . If BOTH checks are empty → no in-progress work. Proceed to Step 2.
113+ 5 . Inspect the in-progress work:
114+ - If the PR has CI failures caused by your changes → fix them, push an update, and ** stop** .
115+ - If the PR has merge conflicts → resolve them, push an update, and ** stop** .
116+ - Otherwise (PR is open and healthy, or no PR exists yet) → ** stop** . Do not start a new task.
117+
118+ ** Never proceed to Step 2 when step 3 applies.**
119+ Use memory (` in_progress_task ` , ` in_progress_pr ` ) only as a hint to locate the task and PR
120+ faster — it is not the source of truth.
71121
72122### Step 2: Select a task
73123
74- 1 . Use the Asana API to fetch tasks in the "Ready" section of the Android Agentic Maintenance Backlog
75- - Project GID: ` 1213746476312668 `
124+ 1 . Use the ` asana_get_section_tasks ` tool to fetch tasks in the "Ready" section
76125 - "Ready" section GID: ` 1213746476312669 `
771262 . Pick the first task listed
78- 3 . Move the task to "In Progress" (section GID: ` 1213746476312672 ` ) via the Asana API
79- 4 . Leave a comment: "🤖 Android Maintenance Worker: starting work on this task."
80- 5 . Save the task GID and URL to memory as in_progress_task
127+ 3 . Use the ` asana_get_task ` tool to fetch the full task details (name, notes, URL)
128+ 4 . Save the task GID and URL to memory as in_progress_task
81129
82130### Step 3: Read project conventions
83131
@@ -140,19 +188,15 @@ Body (follow the template exactly — replace the placeholder sections):
140188 | No UI changes | No UI changes |
141189
142190After opening the PR:
143- - Move the Asana task to "In Review" (section GID: ` 1213746476312674 ` ) via the Asana API
144- - Leave a comment on the Asana task with the PR link
145191- Update memory: in_progress_pr → PR number and branch
146192
147193### Step 7: If stuck
148194
149195If at any point you cannot proceed (the task is ambiguous, the approach does not work,
150196verification fails in a way you cannot resolve):
151- 1 . Comment on the Asana task tagging the original task owner
152- 2 . Describe specifically what is blocking you
153- 3 . Move the task back to "Ready"
154- 4 . Do NOT open a partial PR
155- 5 . Update memory: clear in_progress_task and in_progress_pr
197+ 1 . Do NOT open a partial PR
198+ 2 . Update memory: clear in_progress_task and in_progress_pr
199+ 3 . Stop and explain what blocked you in the workflow output
156200
157201## Guidelines
158202
@@ -164,5 +208,5 @@ verification fails in a way you cannot resolve):
164208- No breaking changes: if a change could break existing behavior, stop and comment instead
165209- Format before committing: always run spotlessApply before committing
166210- One task per run: never pick up a second task even if the first completes quickly
167- - Asana API: use bash with curl and the ASANA_ACCESS_TOKEN secret for all Asana operations
168- - AI transparency: every PR description and Asana comment must include the 🤖 Android Maintenance Worker disclosure
211+ - Asana API: use the ` asana_get_section_tasks ` and ` asana_get_task ` tools for all Asana reads; do not attempt Asana writes
212+ - AI transparency: every PR description must include the 🤖 Android Maintenance Worker disclosure
0 commit comments