## NAME
`ase-task-implement` - Implement a Task Plan
## SYNOPSIS
`ase-task-implement`
[`--help`|`-h`]
[`--next`|`-n` *option*[,...]]
[`--worktree`|`-w` *name*]
[`--source`|`-s` *source*]
[`--changeset`|`-c` *changeset*]
[`--draft`|`-d`]
[`--no-cleanup`|`-K`]
[`--stateless`|`-S`]
[`--ground`|`-G`]
[*id*]
## DESCRIPTION
The `ase-task-implement` skill performs the *final implementation* of
a task plan by creating a complete *change set* from the plan's
*source* (the code basis) into the plan's *changeset* (the location of
the change set). Delivering the change set from there into the plan's
*target* is the separate concern of `ase-task-integrate`. Afterwards
the checkboxes of the realized `DOM`/`IFC`/`ARC`/`IMP` bullet-points
and of the performed and succeeded `REG`/`CON` bullet-points are ticked
to `[x]` (or `[/]` if only partially realized or succeeded), refreshing
the plan's `Modified:` key. Bullet-points in state `[-]` (cancelled) or
`[>]` (deferred) are *skipped*: they are neither realized nor checked,
do not count against completeness, and keep their checkbox untouched.
The *source* is selected by the plan's `Source:` frontmatter key
(if absent, the configured default `project.task.default.source`),
overridable via `--source`:
- `worktree` (default): the *origin* working copy (the one the skill
was started in) with its checked-out branch.
- `branch:`*name*: the existing branch *name*. For a `worktree`
changeset without `--worktree`, the origin working copy is
*switched* to it in place first, but only if it has *no*
uncommitted changes, otherwise the skill stops and touches nothing.
A context worktree created by `--worktree` carries its *own* branch
*name*, which starts at the source (so the source branch itself is never
checked out there and stays available as the integration target), while
a reused one keeps its own base, so earlier work in it is continued.
The *changeset* is selected by the plan's `Changeset:` frontmatter
key (if absent, the configured default `project.task.default.changeset`),
overridable via `--changeset`:
- `worktree` (default): the change set stays *uncommitted* in the
context worktree.
- `branch:`*name*: the change set is *committed* onto the branch
*name* -- created from the source if missing -- inside the worktree
in which this branch is checked out, or inside a newly created
worktree `.ase/worktree/<name>`, which is removed again after the
commit (unless `--no-cleanup` is given), while an already existing
worktree is always kept.
- `attachment:`*name*: the change set is made and verified in a
*temporary* worktree, detached at the source commit, and stored as
the attachment block of type `text/x-diff; charset=utf-8;
kind="<name>"` (with its base commit in the `Desc:` key) of the
plan only, leaving all artifacts untouched. An already existing
attachment of this kind is re-applied first, so re-runs build the
change set *cumulatively*. A *stale* one -- older than the plan --
stops the skill with an error, and an already *delivered* one --
marked `merged` in its `Desc:` key by `ase-task-integrate
--no-cleanup` -- is not re-applied, but replaced by a fresh change
set. The `--draft` shorthand selects
`attachment:draft`, the *implementation draft* of the plan, which
can be reviewed via `ase-task-view --full` and delivered via
`ase-task-integrate --draft`. An undelivered draft is *ignored* by
any other changeset (with a warning), as only `attachment:draft`
builds upon it.
For derived changesets (`branch:` and `attachment:`), *uncommitted*
changes of a `worktree` source are *not* carried over, as they start
at its `HEAD`.
The skill does *not* maintain the *change set snapshot* of the plan
(the attachment block of type `text/x-diff; charset=utf-8;
kind="changeset"`), which only the `implementer` agent of `ase agent`
attaches after its implementation, but passes an existing one through
unchanged.
Unless `--stateless` is given, the plan's `Status:` key follows the
task lifecycle model: for `solo` it stays untouched (as the task is
closed by `ase-task-integrate`), and for `team` and `enterprise` it
becomes `IMPLEMENTING` before and `IMPLEMENTED` (if the change set was
applied completely and successfully) or `STALLED` (otherwise) after
the implementation.
The *kind of change* stated by the plan's `Kind:` frontmatter key
(`SPECIFYING`, `CRAFTING`, `REFACTORING`, or `RESOLVING`) selects which
*operation-specific tenet set* of the **ASE Tenets** is internalized
before any artifact is touched, in addition to the always applying
**GENERIC TENETS**. If a plan carries no such key, the kind is
*inferred* from the plan content, defaulting to `CRAFTING`.
If the task plan deliberately *omits* the `## VERIFICATION (WHEN)` section
(as produced by `ase-task-edit` when invoked with `--unverified`),
the entire verification phase is strictly skipped: no build, tests,
linter, type-checker, or program execution is performed once the
source files have been modified.
The implementation runs to *completion*: the skill never concludes
while any point of the plan is still unimplemented, neither because the
change set grew large nor because an open question stands in the way.
Undecided details and defensible alternatives are therefore *decided by
the skill itself*, guided by the surrounding artifacts and the
internalized tenets, instead of interrupting the run with a question.
Once the change set is applied, the run closes with up to two summaries:
the `OPEN POINTS` box lists everything now waiting for the user --
points left unimplemented on a *genuine blocker* no assumption can
bridge, follow-ups deliberately left out of scope with their reason,
and results needing review -- and a `WHAT`/`WHY` table lists the
*own decisions* of the skill, i.e. those neither made in the plan nor
during grilling, so they can be revisited or overruled.
The table covers only decisions of the focus areas `DOM` (domain), `IFC`
(interface), and `ARC` (architecture), ranked in this order and numbered
`D01`, `D02`, etc., each with a brief, keyword-prefixed decision and
rationale. Either summary is omitted entirely when it has no content.
After implementation, the user is asked whether to stop, hand off to
`ase-task-edit`, hand off to `ase-task-integrate`, or delete the task
plan, unless `--next` pre-selects this choice.
## OPTIONS
- `--next`|`-n` *option*[,...]:
Automatically answer the user dialog for the next step. *option*
is a single token or a *comma-separated chronological list* of
tokens; the *first* token is consumed by this skill, and any
remaining tokens are *forwarded* (via `--next`) to the downstream
skill. Recognized tokens at this skill: `none` (default,
interactive answer required), `DONE` (preserve task plan and stop),
`EDIT` (hand off to `ase-task-edit`), `INTEGRATE` (hand off to
`ase-task-integrate`, forwarding `--worktree`, `--changeset`,
`--stateless`, and `--source` as `--target` for a `source` target),
or `DELETE` (hand off to `ase-task-delete`).
- `--worktree`|`-w` *name*:
Operate in the *context worktree* `.ase/worktree/<name>` instead
of the current working copy: it is *reused* if it already exists,
otherwise it is *created* with its own branch *name* (checked out if
it exists, created at the source commit otherwise, so the source
branch itself is never checked out there). The `worktree` value of the
changeset refers to it, while the `worktree` value of the source
(and of the target of a subsequent integration) keeps referring to
the origin working copy, so an integration delivers the change set
from the context worktree back into the origin branch. The option
is permitted for a `worktree` changeset only, as a `branch:` or
`attachment:` changeset would leave the context worktree unused.
- `--source`|`-s` *source*:
Override the plan's `Source:` key (`worktree` or `branch:`*name*)
for this run, without changing the plan.
- `--changeset`|`-c` *changeset*:
Override the plan's `Changeset:` key (`worktree`, `branch:`*name*,
or `attachment:`*name*) for this run, without changing the plan.
- `--draft`|`-d`:
Shorthand for `--changeset attachment:draft`: create the
*implementation draft* of the plan only, leaving all artifacts
untouched (a dry-run). Mutually exclusive with `--changeset`.
- `--no-cleanup`|`-K`:
For a `branch:` changeset, keep the worktree `.ase/worktree/<name>`
newly created by this run, instead of removing it after the commit,
so the change set can be reviewed, built, and tested there. Without
this option, the worktree is removed only if it has no uncommitted
changes, as the change set lives on the branch alone.
- `--stateless`|`-S`:
Leave the plan's `Status:` key untouched.
- `--ground`|`-G`:
Ground the implementation in facts instead of the world knowledge
of the model alone: before any artifact is modified, each dimension
-- `WHAT` (the requirements), `HOW` (the realization), and `WHEN`
(the verification) -- is grounded in parallel. Its artifacts
(`SPEC` and `DOCS` for `WHAT`, `CODE` and `INFR` for `HOW`, and the
test and CI files for `WHEN`) are scanned for the project facts
relevant to the plan, and the Internet/Web is searched iteratively,
with at most 5 searches per dimension, for the established
practices, standards, patterns, and pitfalls about it. Both focus
especially on the special and less known terms and concepts and on
the aspects which potentially could be outdated in the model
knowledge, judging every Web fact by its date or version. If no
usable facts are found, a warning is shown and the implementation
falls back to model knowledge.
## ARGUMENTS
- *id*:
The unique identifier of the task whose plan should be
implemented. If omitted, the *current* task id is used.
## SCENARIOS
- You want a task plan turned into actual changes
- You want the planned change set applied and verified
- You want the change set committed onto a dedicated branch
- You want the change set attached to the plan for review only
- You want a dry-run of the implementation as a reviewable draft
- You want the implementation isolated in a Git worktree
## EXAMPLES
Implement the current task plan in the current working copy:
```text
❯ /ase-task-implement
```
Implement a specific task and delete the plan when done:
```text
❯ /ase-task-implement --next DELETE hello
```
Draft the implementation of the task `hello` and apply the draft when
done:
```text
❯ /ase-task-implement --draft --next INTEGRATE hello
```
Implement the task `hello` inside the isolated Git worktree
`.ase/worktree/hello` and integrate it afterwards:
```text
❯ /ase-task-implement --worktree hello --next INTEGRATE,DONE hello
```
Implement the task `hello` by committing its change set onto the
branch `feature-hello`:
```text
❯ /ase-task-implement --changeset branch:feature-hello hello
```
## SEE ALSO
[`ase-task-edit`](../ase-task-edit/help.md), [`ase-task-integrate`](../ase-task-integrate/help.md),
[`ase-task-view`](../ase-task-view/help.md), [`ase-task-delete`](../ase-task-delete/help.md).