completion
This skill should be used when a reviewed task is ready to close, for example "close this task", "finish the task", "mark the task done", "write the pull request body", or "complete the task". It read
SKILL.mdaida/skills/completion/SKILL.md
GitHubCompletion
Completion runs once per task, after review closed, or after a person decides to close without
one. It reads the records and offers a task per follow up finding. It writes a pull request body
as a file and its own record, then calls the task skill's complete last.
Completion is not review. It runs no check, dispatches no model, and re-derives no verdict. It
repairs no finding. Its one code change takes out the files task environment up committed for
the worktree's own site, because trunk must not receive them. It calls no remote: no GitHub, no
push, no merge.
The person opens the pull request from the file. Review is a separate skill so a person can run
their own reviews between the two.
Find the task
Resolve the active project's own folder first, from the project-folder: line of the ## AIDA
block. Then resolve the task, <taskId> when given, or whichever task is already active in this
conversation. Neither known: say so in one line, name the task skill, and stop. There is nowhere to
act.
The task's own folder is <projectPath>/tasks/<task-id>. Every call below takes that folder.
completion-actions.sh takes a text value from a file. Write the text with the Write tool in the
session's scratchpad folder. With no scratchpad, write it in the task folder, and delete it after
the call. Then pass @/<absolute path> as the value. Use this for a text that names a command, such
as git. Claude Code refuses a command whose quoted text names git when the session works in a
worktree.
Read what is already there
Run:
"${CLAUDE_PLUGIN_ROOT}"/skills/completion/scripts/completion-actions.sh read "<task_folder>"
It reports the task's state and run mode. It says whether the contract, the build record and the
review record exist. It gives the review verdict in one of four words: passed, failed,
unfinished or none. It lists each follow up finding with the task that exists for it, or
none. It counts the children still open. Its closes line says whether the task closes on the
verdict or on a person's reason. It writes nothing.
nextStep: done means the task is already complete. Say so in one line, name the record path
under <task_folder>/completion/, and stop. nextStep: close sends you to the one step file.
read is the one call here that runs from anywhere. Every other call refuses at exit 79 when
the task builds in its worktree and this window is elsewhere. The refusal names the tree and the
route that works from here, either the EnterWorktree tool or the call started with
cd <worktree> &&. Take the route it names, the way /aida:next does, and run the call again.
The step, and where its instructions are
Open the step file through the script, never through the Read tool:
"${CLAUDE_PLUGIN_ROOT}"/skills/completion/scripts/completion-actions.sh step close
This prints references/close.md. A Read rule naming that folder does not reliably expand
${CLAUDE_PLUGIN_ROOT}, which is why this skill grants the one Bash rule above. Run step every
time, even when the file was read earlier this turn. A step run from memory is a step run against
rules that may have changed.
Three rules the step repeats
The records hold the bodies. Every action prints key: value lines and a path. Never read the
review record, the contract or the pull request body into this conversation, and never paste one
back. Name the path the script printed, and say the person can open it in an editor. A body pasted
here costs context this skill does not need.
Every task write goes through the task skill. follow-ups creates a task through task create, and close moves the state through task complete. Completion writes no task field
itself. When the task script refuses, its own line is printed above the refusal; relay it as
printed.
A reason is a sentence, not a bypass. A review that did not pass, or that passed with warnings, closes only on a person's word. The record keeps that sentence. Never invent one, and never suggest one. Ask the person why the task closes over them, and pass what they said.
The run mode decides who answers
The run mode is the task's own for the completion stage: runMode in task.json, absent
meaning interactive. light reads as autonomous. It is interactive too when runModeStages
names stages without this one.
A person's answer is accepted only when a person is present.
| Question | Interactive | Autonomous |
|---|---|---|
| A follow up finding with no task | the person accepts or declines each one | every one is created and listed |
| A review that did not pass, or passed with warnings | the person gives the reason | the close halts, naming the verdict and the warnings |
| A high severity follow up with no task | the person creates it, sends it to a shared task, or says why not | the close warns, since the tasks were created first |
The summary for task complete |
the person gives one or two lines | one line naming the grounds |
| A saved note offered as a play | the person says yes or no per note, and names the play | offers nothing; the record says autonomous |
close refuses --reason, --leave and --captures-offered on an autonomous run at exit 70, and
in a session that does not report itself attended. A run with nobody present closes a task on a passed review with no
warning and on nothing else. That is the one place an unattended task stops on the review. Or the person's answer is recorded with the task skill's person-answer.sh, step
completion close. Claude Code asks the person first. The refusal prints the command whole. The
implement skill's references/finish.md says how.
The exit codes
One number never means two things, and none is new to this plugin.
| Code | What it says |
|---|---|
| 1 | refused, with the reason on the first line. The path holds no task.json, or the task is already complete. Or the review did not pass, or passed with warnings, and no reason was given. Everything else close finds is a warning in the task record. Examples are an open child and a high severity follow up with no task. |
| 3 | the script could not do its job. A missing argument, a record it could not read or that fails its schema, a file it could not write, or a task name the task script refused. Or a --leave value task:<task id> names a task that cannot take the finding. |
| 70 | --reason or --leave was passed on a run with nobody present |
| 79 | the call ran outside the task's worktree. Enter the tree, the way /aida:next does, and run it again. read alone runs from anywhere |
Read a refusal and act on it. Do not repeat the same call unchanged.