soloscrum-implement-task
Implement code and generate a draft PR for a develop work unit (Subtask or no-Subtask Issue per soloscrum-define-branch-commit).
Overview
Implements code for a develop work unit and generates a draft PR. The target is either a Subtask (read its Checklist / "what" slice scope and the parent Issue's AC — Subtasks themselves do not carry AC per soloscrum-define-issue-format's Subtask Body section) or a no-Subtask Issue (per soloscrum-define-branch-commit's branch-per-Issue case — read the Issue's AC directly). The draft phase is the local-quality-gate window defined in soloscrum-define-pr-lifecycle; promotion to ready is owned by soloscrum-review after the review pipeline has decided every finding. Follows soloscrum-define-branch-commit conventions. Subtask state transitions delegate to the active profile's tracker operation skill.
Steps
Read target's reference material — for a Subtask target: its "what" + Checklist (slice scope per
soloscrum-define-issue-format's Subtask Body section) and the parent Issue's AC (what the slice must move closer to satisfying without regression); for a no-Subtask Issue target (persoloscrum-define-branch-commit's branch-per-Issue case): the Issue's full AC directly. Arguments: $ARGUMENTSCheck tech stack in
.claude/rules/stack.mdCreate the work unit's worktree and branch per
soloscrum-define-worktree:- Branch name
{type}/{issue-id}-{slug}persoloscrum-define-branch-commit - Resolve the main checkout root (
git rev-parse --path-format=absolute --git-common-dir),git fetch origin, resolveworktree_root, thengit worktree add -b <branch> <main-root>/<worktree_root>/<branch> "$default_ref"(wheredefault_refisgit rev-parse --abbrev-ref origin/HEAD, alreadyorigin/-prefixed — do not prefix it again). Build the path from the main root, never from the current directory — starting from a previous worktree would nest the new one inside it. If a worktree for the branch already exists, reuse it — and inspect it first, since it may hold work from an interrupted run. - Every step below runs with that worktree as the working directory. The main checkout is never switched onto the branch.
- Write the resolved root as a repo-root-anchored pattern (
/<worktree_root>/) to.git/info/excluderight away (untracked, effective immediately — this is what stopsgit add -Afrom staging a worktree as a gitlink), and if.gitignoredoes not already cover it, add the entry here too so the durable form lands in this unit's PR. Never commit it directly to the default branch.
- Branch name
Implement code to deliver the slice (and to move the parent Issue's AC closer to satisfied without regression):
- First, if
.claude/rules/stack.mdrecords an install command, run it in the worktree.git worktree addchecks out tracked files only, so gitignored dependency trees (node_modules/,.venv/, build caches) do not exist in a fresh worktree and the lint and test steps below will fail for an unrelated-looking reason. Skip when reusing an already-provisioned worktree. Seesoloscrum-define-worktree, "Known limitation" (tracked for automation in #99). - Write tests (when applicable)
- Confirm zero lint errors
- First, if
Commit using Conventional Commits format
Generate PR body:
## Summary [Change summary] ## Changes - [Change 1] ## Test [How to test] Closes #[Subtask number for a Subtask target, OR Issue number for a no-Subtask Issue target — never `Closes #<parent>` on a Subtask PR per `soloscrum-define-branch-commit`'s parent-close contract]Create the PR as draft:
gh pr create --draft .... This is a reversible transition persoloscrum-define-pr-lifecycleand runs without pre-confirm. If.claude/rules/pr.mddocuments a repository-level override that makes the draft window unnecessary, follow that file; otherwise default to--draft.Confirm CI started cleanly via
soloscrum-tracker-github-wait-for-pr-checks(shorttimeout_sec, e.g.300):skills/soloscrum-tracker-github-wait-for-pr-checks/scripts/wait-for-pr-checks.sh <pr-number> 15 300That path is repo-root-relative, so run it with the main checkout as the working directory rather than the worktree — see
soloscrum-define-worktree, "Paths that stay anchored to the main checkout". This is a startup-confirmation step, not a green-gate — surface non-SUCCESSconclusions if any but proceed to handoff regardless. The intent is to catch CI startup failures (workflow syntax errors, missing secrets) early. Do not write inlineuntilloops overgh pr view; that pattern is the named anti-pattern inCLAUDE.mdand the reason this skill exists (seesoloscrum-tracker-github-wait-for-pr-checks).Verify DoD self-check with
soloscrum-define-dod(every item except "Review has passed", which is owned bysoloscrum-review).Resolve the active tracker profile via
soloscrum-define-tracker-profile, then invoke the matchingtransition-stateoperation skill to move the target (Subtask or no-Subtask Issue) toin-review:github-only→soloscrum-tracker-github-transition-statelinear+github→soloscrum-tracker-linear-transition-stateReversible persoloscrum-define-pr-lifecycle's autonomy table; runs without pre-confirm. This is the creator-side→ in-reviewtransition assigned todevinsoloscrum-define-agent-responsibilities(applies to both Subtask and no-Subtask Issue targets).
Hand off to
/soloscrum:review(which launchessoloscrum-review-implementation). Do not promote the PR to ready from this skill —gh pr readyis owned by the review phase.
Depends On
soloscrum-define-worktree(where the work happens; worktree creation and reuse)soloscrum-define-branch-commitsoloscrum-define-dodsoloscrum-define-pr-lifecycle(draft creation, autonomy of reversible transitions, handoff boundary)soloscrum-define-tracker-profile(for resolving subtask ID conventions and routing the transition)soloscrum-define-agent-responsibilities(creator-side Subtask State ownership)soloscrum-tracker-{github|linear}-transition-state(delegated→ in-reviewtransition in step 10)soloscrum-tracker-github-wait-for-pr-checks(CI-startup confirmation step 8)