Create spec

From gittower/git-flow-next · View interactive version

Create spec is an AI agent skill from the GitHub repository gittower/git-flow-next. Create a Codex-gated spec issue from a triaged report, concept, or idea

How to use this skill

Skill file

Create Spec

Turn an accepted bug report, feature request, concept, or idea into an

implementation-ready spec issue per the Spec Issues section of

ISSUE_GUIDELINES.md. The spec is drafted locally, reviewed by Codex, and

only posted to GitHub after user acceptance. The spec issue is the source of

truth for implementation; test scenarios are its centerpiece.

Arguments

/create-spec <source>

if present) or an existing thin issue to be specced

folder matching the current branch

Instructions

1. Gather Input

.ai/issue-<n>-*/triage.md and any existing analysis.md/concept.md

related or duplicate issues (open and closed) before speccing

.ai/feature-<slug>/

2. Research the Codebase

Understand what the spec touches: current behavior, affected components,

existing configuration options, prior art. Enough to write concrete expected

behavior and test scenarios — not an implementation plan. Consult

ARCHITECTURE.md and CONFIGURATION.md as needed.

3. Draft the Spec

Write .ai/<folder>/spec.md following the Spec Issues structure in

ISSUE_GUIDELINES.md exactly (it will be posted as the issue body):

before/after

conditions, edge cases; each with setup, action, expected outcome,

concrete enough to become a test without guessing

The spec stays at concept level: what to achieve and what changes. How to

implement it belongs to the implementation phase.

Breakdown: if the work can't land as one reviewable PR, split into

sub-specs — each a complete spec of its own (goal, behavior, test

scenarios), independently implementable. Draft them as

spec-<part-slug>.md files; the main spec keeps the overall goal and a

Breakdown task list.

4. Codex Gate

Run a Codex gate per

../_shared/CODEX_GATE.md:

behavior, contradictions with the originating report, and scope creep.

Is this a readable concept a maintainer can verify and accept?

Evaluate per the convention — apply high-confidence findings, reject

over-engineering, when in doubt leave it out. Log all verdicts to

.ai/<folder>/codex-spec.md.

5. Acceptance Gate

Present to the user:

or the Codex gate

Wait for acceptance. The user may edit, answer open questions, or reject.

Iterate until accepted.

6. Post to GitHub

After acceptance, verify spec.md and any comment body against the

posting checklist, then:

  1. Create the spec issue via mcp__github__create_issue: title per

ISSUE_GUIDELINES.md (imperative, specific), body from spec.md, labels:

spec plus bug or enhancement

  1. For breakdowns: create the sub-specs first, then the parent spec with the

Breakdown task list referencing their numbers, and attach each sub-spec as

a native sub-issue of the parent spec (same mechanics as step 3)

  1. Link the spec to the originating user report, if any — **keep the report

open**:

parent, spec is the child):

```bash

SPEC_ID=$(gh api repos/gittower/git-flow-next/issues/<spec#> --jq '.id')

gh api repos/gittower/git-flow-next/issues/<report#>/sub_issues \

-F sub_issue_id="$SPEC_ID"

```

sub_issue_id is the report child's REST database id, not the

issue number — fetch it as shown.

addressing the reporter: the request is accepted and now specced in the

spec issue (link it, note it's attached as a sub-issue); the report stays

open and is the place to follow progress.

Resolves #<spec> (closing the spec), after which you close the report

with a short "shipped in <version>" note. Both end up closed once the

work lands.

7. Report

manual chain starting with /analyze-issue)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.