--- name: feature description: Turn the next, named, or numbered build-plan feature into a buildable current-feature.md spec with small steps and done-when criteria. Use for /feature, planning a feature, or starting planned work. --- # feature - create the active implementation spec **Context reuse:** Reuse any required file already loaded in project instructions or the current session. Read it again only if absent, changed, or exact current bytes or line references are needed. This skill plans one feature and stops before implementation. Its output is `blueprint/context/current-feature.md`. ## Start **First action:** Before project inspection, preflight, or any other tool call, publish the `feature` activity as `running` when `blueprint/.state/` exists. Combine that write with the first context-gathering tool batch when the adapter supports it. Read `blueprint/config.json` only for settings that affect the spec. Invalid configuration stops mutating work and points to `/doctor`. Confirm that `blueprint/context/current-feature.md` is the empty stub. If it contains active work, stop and direct the user to resume or complete it. Never replace another worker's active spec. Parallel work uses one clone or Git worktree per work item, with a separate branch in each checkout. Resolve the target from `blueprint/build-plan.md`: - Use the requested number or name when it matches a checklist item. - With no argument, use the first unchecked leaf item. - Read only the matching checklist line, its parent, and nearby text needed to understand the hierarchy. - If a plain list has no checkboxes, treat its first item as unchecked and offer to convert the plan after the spec review. State the selected feature in one sentence. ## Build one authoritative feature packet Gather the smallest packet that can answer what must be built: 1. Search `blueprint/context/project-overview.md` for the feature number, title, and distinctive nouns from the target line. Read the matching feature passage plus only the usage-model, data-model, stack, UI, security, or deployment passages it directly depends on. Do not read the whole overview by default. 2. Inspect the repository once, starting from paths named by those passages. Follow only relevant imports, callers, tests, schemas, and configuration. Batch related searches and reads when supported. 3. Use the Commands section already loaded from `AGENTS.md`. Read it from disk only when it is absent or changed. Read only applicable sections of `blueprint/context/coding-standards.md`. 4. Run the declared Verify command once when it exists. Record only observed results. Do not start a dev server. Finish context gathering in at most four tool rounds after this skill starts: target and overview matches, one batched repository inspection, applicable standards only if needed, and Verify. Combine or skip rounds when possible. Do not inspect other skill directories, `ai-interaction.md`, findings, review records, or templates during normal planned-feature work. The only history exception is this skill's `reference/build-history.md` and the selected feature's archive metadata, exact rollback records, and Git evidence needed to freeze its build attempt below; batch this with the target lookup, without loading unrelated history. Do not create scratch code or run implementation probes while writing a spec. Put a check in the relevant build step when a repository detail cannot be confirmed from existing evidence. The plans and overview define product intent. The repository defines current reality. Do not invent presets, defaults, limits, permissions, money rules, destructive behavior, stored fields, or API contracts. A familiar label is not a complete contract when it has multiple reasonable meanings. Put unresolved material choices under an `Open questions` heading and in the review handoff. Stop without writing the spec when implementation cannot begin safely until one is answered. Do not block on a reversible internal implementation detail with no user-visible, security, persisted-data, or interoperability consequence. Choose the simplest repository-native option, record it in the spec, and require a test seam when the value is nondeterministic. Planned future persistence alone does not make a current in-memory representation a product decision when no stored data or external compatibility exists yet. Apply proportional engineering before drafting: add an abstraction, dependency, service, configuration surface, compatibility layer, or security mechanism only when an established requirement needs it now. Prefer existing code, the standard library, native platform features, and installed dependencies. Unknown scale or future extensibility defaults to the smaller reversible design. Treat a trust or data-integrity boundary as established when the repository exposes network or untrusted input, auth/session/ownership, shared persisted data, destructive operations, secrets, or sensitive data, even when the plans do not name it. If `project-overview.md` is 20,000 bytes or larger, stop and ask for `/overview` instead of loading it. If the target is too large for one reviewable branch, propose sub-features and wait for approval before editing the user-owned build plan. After approval, add lettered checklist items under the parent and spec only the first one. ## New feature not in the plan Do not silently add scope. Search for a duplicate, then propose one checkbox line and its placement. Include a `project-plan.md` edit only when the request changes the product direction, users, data, stack, monetization, UI, or deployment. Wait for approval, update the plans, run the installed `overview` skill, and then resume this skill. Bugs and small unplanned changes belong in `/fix`. ## Write the final spec once Before review, allocate the selected stable feature ID's build attempt using `reference/build-history.md`: first build 1, otherwise one greater than the maximum proven prior attempt after all prior builds were reversed. Preserve the ID across renamed titles and lettered sub-items. Stop on ambiguous history; never infer attempts from a title suffix, file count, or timestamps. Draft and critique in context, then write `blueprint/context/current-feature.md` once. A later write is only for a mechanical correction or user-requested revision. Record `**Branch:**` with the full configured feature branch. The first heading and build-plan identity must use this canonical form: ```markdown # Feature: