Skip to content

skill · phase: implementation

Lifecycle Continuation

Purpose

Resume an in-progress lifecycle instance efficiently. Determine where work left off and continue from that exact point without re-reading full artifacts or re-explaining context.

{{glossary:instance}}

Instructions

{{glossary:claim}}

  1. Load state. Read .aidlc/state/<instance>/instance.yaml to get:

    • Current phase
    • Template name
    • Scope

    Also check <git-common-dir>/aidlc/retro-pending/ for markers. A marker for this instance → run the aidlc-retrospective skill first. A marker whose instance has no state dir and no registry entry is stale — remove it and report the cleanup in one line.

  2. Check claim. Claims live in <git-common-dir>/aidlc/claims/<instance>.yaml (resolve via git rev-parse --git-common-dir); fall back to the claim: field in instance.yaml outside a git repo or for unmigrated instances. If another session holds the claim:

    • Check renewed_at against the staleness timeout (default: 60 minutes)
    • If stale: warn and request override confirmation before taking over
    • If active: warn and do NOT proceed without explicit override
  3. Claim the instance. Prefer aidlc claim <instance> — it writes the claim and appends the claim event to sessions.ndjson (the durable session↔instance record cost attribution depends on). Without the CLI, do both: write the claim file (or claim: field in the fallback case), then append the claim event to .aidlc/state/<instance>/sessions.ndjson (append-only; see the state protocol in aidlc-overview). Renew (aidlc claim --renew) at every phase transition. Release the same way when you stop (aidlc release <instance>).

  4. Determine next step. Apply this priority:

    • If current phase has incomplete required artifacts → produce the next artifact
    • If the current phase is implementation and a task-bearing tasks.md exists → resume at the lowest-numbered open ([ ]) task; do NOT re-derive the plan from design.md
    • If current phase is complete but not transitioned → evaluate transition (check gates)
    • If transition is allowed → move to next pending phase
    • If the transition is the instance's completion moment (last applicable phase for the template × scope reaches complete; for maintenance-terminal instances, maintenance entry) → run the aidlc-retrospective skill before any cleanup, then fire on-instance-complete
    • If all phases complete → report instance complete; if no retrospective.md exists, offer the retro
  5. Load minimal context. Read only:

    • The skill for the determined phase, and specifically its Entering in a fresh session list
    • Artifact summaries (.summary.md) instead of full artifacts where available
    • Compact state files, not full transition history
  6. Say where context stands when a phase boundary was just crossed. If step 4 moved the instance to a new phase, run aidlc cost context and report the line it prints. Crossing a boundary is the one moment a fresh session is free, and the reading is what makes that visible instead of leaving it to be noticed on the bill. Over budget is information, never a blocker — see The context rule in aidlc-overview.

  7. Execute. Follow the phase skill for the determined step.

Multiple Instances

When multiple instances are active and the user did not specify which one:

  • List all active instances: name, current phase, completion percentage
  • Ask the user to select one
  • Resume the selected instance

Exit Criteria

  • The next step is identified and executed (or the instance is reported as complete)
  • State is updated to reflect progress
  • Claim is held for the duration of work

Security Confirmation

If continuation leads to a phase that involves sensitive operations (Deployment, infrastructure changes), apply the security confirmation rules of that phase's skill before executing.

Token Efficiency

  • Do NOT re-read unchanged files from prior sessions
  • Use state fields to determine progress, not artifact content
  • Load artifact summaries in place of full documents when summaries exist