ai-to-spec-workplan
ai-to-spec-workplan
Turn the settled conversation into one spec and publish it to Workplan. The invocation authorizes publication. Synthesize what is known without an interview or approval round. If required intent is missing, report the missing input instead of inventing it or creating a partial workplan.
Before using wp, load the ai-workplan skill. If ai-workplan is unavailable, stop and tell the user to install it before continuing. Follow its pointers to the machine-output contract and workplan command reference. They are the source of truth for envelopes, pagination, validation, typed errors, and command flags.
Process
-
Explore the repository. Read the applicable domain glossary and ADRs. Inspect the implementation area, its closest precedent, and its tests. Use glossary terms in the spec and follow ADR decisions. Choose the highest existing test seam that proves the requested behavior. Introduce a lower seam only when the higher seam cannot make the behavior observable.
This step is complete when every named domain concept matches the glossary, every applicable ADR is accounted for, and the testing decision names the highest useful seam and its precedent.
-
Resolve source lineage. Set a source only when the invocation or conversation explicitly identifies a source workplan. Resolve that reference to one exact slug from
wp --jsonoutput. Ask when the explicit reference does not resolve uniquely. The current topic, similar titles, and recent workplans are not evidence of lineage. When no source was explicit, keep the source absent.This step is complete when the source is either one exact explicitly requested slug or absent.
-
Derive the identity. Write a concise title from the settled feature. The trimmed title must be nonempty and contain no ASCII control characters. Derive an ASCII base slug from the title and repository terms: lowercase it, replace each run outside
a-zand0-9with one hyphen, trim edge hyphens, and keep at most 63 bytes without leaving an edge hyphen. Use a more specific settled term if normalization produces an empty slug.List workplans through
wp --json workplan list, following every cursor, because slugs are globally unique across types. Treat every returned slug as occupied. Use the base when it is free. Otherwise, test numeric suffixes from-2upward and select the first free candidate. For each suffix, reserve its bytes, truncate the base to the remaining part of the 63-byte limit, and remove any trailing hyphen before joining the two. Stop before writing if the suffix leaves no nonempty accurate base.