---
name: writing-plans
description: "Use when you have an approved spec or written requirements for a multi-step task that needs a durable plan document before touching code. Small, single-owner, or fast-path tasks do not need this skill."
title: writing-plans
canonical_url: https://skilld.dev/gh/ganyuanran/aegis/writing-plans
last_updated: 2026-11-13T17:09:46.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [expanded-planning-guidance.md](https://skilld.dev/api/skills-raw/ganyuanran/aegis/writing-plans/expanded-planning-guidance.md), [plan-document-reviewer-prompt.md](https://skilld.dev/api/skills-raw/ganyuanran/aegis/writing-plans/plan-document-reviewer-prompt.md).
>
> If the user asked to install this Skill, run `npx skilld install ganyuanran/aegis/writing-plans`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/writing-plans`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/ganyuanran/aegis/writing-plans) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/writing-plans`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/writing-plans --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/writing-plans --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

<EXPLICIT-MODE-GATE>
If activation mode is explicit (`~/.config/aegis/config.toml` has
`activation_mode = "explicit"`, or `AEGIS_ACTIVATION_MODE=explicit` is visible
in the environment) and the current user request did not explicitly invoke
Aegis or this skill by name, exit back to the fast path: answer concisely
without this workflow's checklist, ceremony, or document requirements. If the
user explicitly named Aegis or this skill, proceed normally.
</EXPLICIT-MODE-GATE>

# Execute

→ Existing parent plan/spec and a tiny execution slice? → **Use Planless Slice Lane.**
→ Mechanical or bounded change with no durable boundary (no new owner,
  contract, schema, public API, migration, or compat surface)? → **Use
  Planless Slice Lane without a parent document.**
→ Approved spec/requirements for a new workstream or an escalation trigger? →
  **Write an implementation plan for an engineer with no prior task context.**

For a durable plan: confirm scope and acceptance, map current owners/files,
record the TDD route, decompose into executable tasks, define verification and
retirement, self-review, save, then select the execution route. Proceed unless
a real authorization or safety boundary requires the user.

Bind tasks to the requested user outcomes: object, actions, conditions, and
deliverables. Include the final delivery step and evidence at the user-visible
seam, not only implementation/tests. Keep unmet needs and dependencies explicit;
project-wide goals do not authorize work outside this request. Reuse the
existing scope/acceptance slots; no extra goal artifact is required.

This plan is method-pack guidance, not authoritative completion.

## TDD Route Guard

Before task decomposition, record `TDD Route` with mode (`off | auto`), decision
(`strict | light | skipped`), authority, test posture, reason, and verification.

Strict RED / GREEN steps belong only to an explicit user/project TDD request or
`TDD Route: strict`. In `off`, use `skipped` unless explicit strict authority
overrides it. An approved plan or a risk label alone is not strict authority.

In `auto`, select `strict` for behavior, bugfix, shared/core, contract,
persistence, permission, migration, producer/consumer, or meaningful
regression signals. Select `light` only when the work is tiny, low-risk,
single-owner, has no behavior change or strict signal, and has an obvious
focused check. Absence of an explicit user TDD request is never evidence for
`light`; the auto decision itself must be recorded.

If risk remains unknown, return to requirements, debugging, or plan review
before task decomposition; do not infer a TDD route from uncertainty.

Only a `strict` decision with stated authority may prescribe failing-test,
RED, GREEN, and REFACTOR steps. Otherwise plan the minimum change plus
diagnostic reproduction or post-change regression. A missing auto decision
returns to route selection before implementation tasks.

## Entry And Artifact Choice

**Announce at start:** on the plan-writing route, say that this skill is
creating the implementation plan. On `Planless Slice Lane`, announce the lane instead and do not claim a plan is being created.

**Execution context:** Reuse the current branch/workspace by default. A branch
needs independent history; a worktree needs concurrent checkout, blocking
unrelated dirty state, or explicit user/repository authority.

**Input:** approved requirements, a Spec Brief, or a Design Spec.

**Default plan path:** `docs/aegis/plans/YYYY-MM-DD-<feature-name>.md`. Plans do
not go in `work/`; user and repository authority override the default.

## Planless Slice Lane

Use `Planless Slice Lane` before writing or saving a plan when one of these
entry conditions holds:

- a parent spec or parent plan already defines the workstream, and the current
  request is executing or refining one bounded task from that parent
- the change is mechanical or bounded and needs no parent document (the
  no-parent branch under `# Execute`)

and both of these are true:

- no new owner, contract, schema, public API, architecture boundary, migration,
  persistence, security/permission, distribution/release surface, or unclear
  verification boundary appears
- the slice can be described by a `Slice Card`

The lane preserves long-task continuity without turning execution bookkeeping
into durable planning artifacts. A parent scope or acceptance mismatch returns
to the parent plan/spec instead of spawning a micro-plan.

Do not save a new plan. Emit a compact `Slice Card`:

```text
Slice Card:
- Goal:
- Parent plan/spec:
- Files:
- Boundary:
- Verification:
- Stop:
```

On the no-parent branch, `Parent plan/spec:` is `none — direct bounded request`.

## Aegis Project Workspace

Workspace creation is lazy and follows project authority. The Aegis Method
Pack repository must not create or ship a live `docs/aegis/` workspace. When a
durable plan must initialize or update another project's workspace, read the
`## Workspace Save Detail` section of `expanded-planning-guidance.md`. It owns the
`<aegis-workspace-helper>` and `INDEX.md` command detail, not the decision to
create a plan.

## Default Plan Surface

Compact output contract: express these as natural plan content, not a stack of
cards: `Aegis Visibility`, approved scope and plan basis, required baseline
refs, files/owners, compatibility boundary, `Change Necessity`, TDD route,
tasks, verification, risks, and retirement. Keep conditional structures silent unless their trigger below fires.

`Aegis Visibility` is normally one sentence explaining which owner, contract,
retirement, compatibility, or verification pressure makes a durable plan
useful. Structured trace belongs only to audit, debug, release, long-task
review, or explicit request.

Before tasks, perform a `Requirement Ready Check`: identify the approved source,
scope, scenarios, and acceptance evidence. If any decision-changing item is
missing, do not create implementation tasks; return the smallest gap to the
requirement/spec owner.

Perform `Change Necessity` before any non-trivial source edit or any new source-code path. This is behavior-triggered, not prompt-triggered. State
naturally why no-change/docs/config is insufficient and name the minimum code
boundary. A tiny helper, guard, branch, fallback, adapter, or owner is not
exempt. A `no-change`, `docs/config-only`, or `needs-clarification` result
narrows or stops the code plan.

Run `Ripple Signal Triage` before tasks when the change touches shared/core or
cross-module behavior; a public API, schema, contract, compatibility,
persistence, cache, export/readback, fallback, adapter, duplicate/legacy owner,
retirement path, or both producer and consumer. If no signal fires, add no
output. If one fires, identify the canonical owner and affected downstream consumers,
state source-of-truth/contract/fallback/retirement risk, and carry expanded verification
into the relevant task. A required owner/public-contract/source-of-truth change,
retaining two owners, or adding a fallback, adapter, or compatibility branch
returns to design or requires explicit prior alignment before implementation.

Run a compact `Plan Pressure Test` before task decomposition: test owner / contract / retirement fit, higher-level architecture path, verification scope,
and task executability. It may proceed, revise the plan, or return to design;
it is not an approval authority.

## Conditional Detailed Guidance

For interface/interaction work, compose `ui-ux-governance` and carry the accepted
experience criteria and corresponding checks into affected tasks. Include API
changes that alter visible states or recovery; keep backend-only work scoped.

For maintained source, screen file shape, owner fit, add-in-place risk, and a
better boundary. With no pressure signal, a compact edit-in-place decision is
enough. For an ordinary medium/high handoff, state Intent Lock, Scope Fence, Baseline Lock, tests, and drift stop naturally. Load the expanded `Execution Readiness View` only for the auditable handoff triggers below. Neither form is a
`GateDecision`, `PolicySnapshot`, approval gate, or completion authority.

Read only the trigger-matched section of `expanded-planning-guidance.md`, never
the whole file. This map owns conditional activation, not another planning pass.
Do not load references merely to announce a route or describe a Planless slice.

| Evidence trigger | Exact section and required action |
| --- | --- |
| Specific baseline acknowledgement needs structure, or requirement readiness is incomplete/disputed | `## Baseline And Requirement Detail`; retain the task-blocking Requirement Ready Check above |
| A new surface or new owner is proposed | `## New-Surface And Architecture Detail`; run `Existence Check` and `docs/current/AEGIS_MINIMALITY_REFERENCE.md` before tasks, reusing an existing owner when sufficient |
| Owner/contract, responsibility overlap, higher-level simplification, fallback or retirement remains risky | `## New-Surface And Architecture Detail`; use `Architecture Integrity Lens` and `first-principles-review` before decomposition |
| Material file-size, mixed-owner, add-in-place, adapter, fallback or shared-core complexity pressure appears | `## Complexity Detail`; use `Plan-Time Complexity Check` and `Complexity Budget`. An over-budget result must change the boundary, add governance work, or stop for follow-up |
| Long-running, handoff-prone, subagent-driven, high-risk architecture/contract/compatibility/retirement handoff | `## Execution Readiness Detail`; expand the existing plan inputs into the auditable readiness view |
| Saving requires workspace initialization or `INDEX.md` updates | `## Workspace Save Detail` |
| Execution-route evidence needs a structured handoff | `## Execution Route Detail` |
| An independent high-risk or handoff-heavy review is needed | `## Expanded Plan Review` |

The reference supplies detail only. This main file owns routing, plan versus
Planless selection, task blocking, and execution handoff.

If the plan must choose among deleting an old internal path, retaining a proven
external compatibility boundary, or stopping for persistent-state
confirmation, compose `anti-entropy-governance`. It does not authorize
destructive execution.

Preserve approved ADR signal preservation, source refs, alternatives,
compatibility, and baseline-sync questions for completion; do not create
accepted architecture memory from an unexecuted plan.

## Plan And Task Quality

Map files before tasks. Follow existing ownership and naming. For non-trivial
plans, passively use relevant current terms from `CONTEXT-MAP.md` or `CONTEXT.md`;
route a real semantic conflict to `establishing-project-context`.

Every durable plan starts with Goal, Architecture, Tech Stack,
Baseline/Authority Refs, Compatibility Boundary, TDD Route, and Verification.
Then define small, ordered tasks with exact files, purpose, minimum necessary
change, compatibility impact, and commands/outcomes that prove the task.
Include code excerpts only when a signature, contract, or transformation would
otherwise remain ambiguous; do not duplicate the implementation inside the
plan.

For bug fixes, refactors, contract changes, or governance cleanup, keep Repair
Track and Retirement Track explicit in the affected task. A retained old owner
or fallback needs a reason and retirement trigger.

Self-review once for approved-scope coverage, placeholders, owner/type
consistency, minimum change boundary, compatibility, exact verification,
conditional trigger handling, and retirement. Fix defects inline. Tasks are
execution units, not Git history units: the coordinator captures
`TaskStartSnapshot` and creates one scoped commit only after the whole Task is
reviewed and freshly verified.

## Execution Handoff

The agent owns the execution-route decision. Select `subagent-driven` only for
genuinely independent tasks with bounded ownership when coordination pays for
it; otherwise select `inline`. Unavailable subagents falls back to inline execution. A dirty workspace alone does not select either route.

Ask the user only for unresolved authorization, privacy, paid-resource,
external-action, irreversible-action, scope, acceptance, or workspace-ownership
boundaries. Otherwise proceed immediately. State the decision, evidence,
fallback, and `User confirmation required: no | yes — <boundary>` compactly;
load the reference only when the full `Execution Route` schema is useful.

For `subagent-driven`, use `aegis:subagent-driven-development`. For `inline`,
use `aegis:executing-plans`.
