Skip to content

feat(skills): add /kiro-getspecs brownfield bootstrap#176

Open
Brujo2020 wants to merge 6 commits into
gotalab:mainfrom
Brujo2020:feat/kiro-getspecs-brownfield
Open

feat(skills): add /kiro-getspecs brownfield bootstrap#176
Brujo2020 wants to merge 6 commits into
gotalab:mainfrom
Brujo2020:feat/kiro-getspecs-brownfield

Conversation

@Brujo2020

@Brujo2020 Brujo2020 commented Jun 19, 2026

Copy link
Copy Markdown

Summary

Adds /kiro-getspecs — the brownfield entry point for cc-sdd when a repository already has code but no (or incomplete) .kiro/ specs.

This PR adds one new skill (#18) plus minimal handoff updates so seeds plug into the existing pipeline without bypassing phase gates.


What it does

Phase Action
0 Gate Confirm brownfield intent + user approval before any writes
1 Lite scan Metadata only: .kiro/ inventory, root listing
2 Reverse Sub-agent analysis (≤200 lines): stack, architecture, modules, spec candidates
3 Git Read-only forensics: branches, commit themes
4 Steering Bootstrap or additive merge of product.md, tech.md, structure.md
5 Seeds roadmap.md + per-slug seed bundle (see below)
6 Handoff /kiro-spec-requirements or /kiro-spec-batch

Spec seed bundle (per slug)

Each seed is a handoff package, not a finished spec:

.kiro/specs/<slug>/
├── brief.md           # brownfield context — Current State cites real code paths
├── spec.json          # phase: initialized, all approvals false
└── requirements.md    # STUB ONLY — Project Description (same as /kiro-spec-init)
                       # ## Requirements section stays empty → EARS in next skill

Not written: EARS acceptance criteria, design.md, tasks.md, spec-kit .specify/.


Why it exists

Situation Wrong tool Right tool
Existing codebase, empty .kiro/specs/ /kiro-discovery (needs an idea) /kiro-getspecs (reads code)
Parallel spec-kit tree .specify/ (not Kiro-portable) Native .kiro/ only
One giant spec Manual /kiro-spec-init × N Roadmap + bounded seeds (3–8)

Logic distilled from spec-kit brownfield extensions, mapped to cc-sdd artifacts.


Pipeline position

/kiro-getspecs  ──→  steering + seeds
                           │
                           ▼
              /kiro-spec-requirements  (EARS)
                           │
              /kiro-validate-gap  (optional)
                           │
              /kiro-spec-design → /kiro-spec-tasks → /kiro-impl

Discovery (/kiro-discovery) remains the idea-first router. getSpecs is code-first bootstrap. They complement; they do not replace each other.


Files added / touched

New skill (×8 agents):

  • skills/kiro-getspecs/SKILL.md
  • references/analysis-guide.md, references/spec-seed-template.md
  • templates/shared/settings/rules/getspecs-principles.md

Handoff (minimal, required for pipeline integrity):

  • kiro-spec-init — brownfield seed path when brief + spec.json exist
  • kiro-spec-requirements — derive project description from brief if stub missing
  • kiro-spec-batch — init step respects existing seeds
  • kiro-discovery — redirect substantial brownfield repos to getSpecs

Docs: docs/guides/brownfield-getspecs.md (includes mermaid diagrams)


Validation

  • npm test in tools/cc-sdd193/193 passing (all 8 agent manifests)
  • Seed contract dogfood: brief + spec.json + requirements stub verified on disk
  • Codex: agents/openai.yaml for new skill

Usage

npx cc-sdd@latest --cursor-skills

# Brownfield (existing code, no specs)
/kiro-getspecs
/kiro-spec-requirements auth-service   # or /kiro-spec-batch

# Greenfield (new idea) — unchanged
/kiro-discovery "add photo albums"

Scope note

This PR intentionally does not change EARS gates, design review, or impl loops. getSpecs only accelerates day-zero adoption on brownfield repos.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2d6e8911a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +163 to +165
- Single seed: `/kiro-spec-requirements <slug>`
- Multiple seeds: `/kiro-spec-batch` (after reviewing briefs)
- Steering only: `/kiro-steering` sync if they want refinement before specs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Emit Codex-prefixed handoff commands

In Codex skills installs, the generated AGENTS.md and existing Codex skill templates instruct users to invoke skills with the $kiro-... prefix, but this new handoff emits /kiro-... commands. When a Codex user finishes $kiro-getspecs, following these next-step commands will not invoke the installed Codex skills, so the brownfield bootstrap stalls before requirements or batch generation; the same prefix regression should be corrected in the Codex handoff text added/changed in this commit.

Useful? React with 👍 / 👎.

Comment on lines +106 to +107
- Run `/kiro-spec-design $1` to create technical design document
- Or `/kiro-spec-design $1 -y` to auto-approve requirements and proceed directly

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore Windsurf-prefixed design commands

Windsurf skill templates use @kiro-... invocations, and this file already keeps that prefix for the missing-requirements and prior-bootstrap guidance. After this change, a Windsurf user completing @kiro-validate-gap is told to run /kiro-spec-design, which does not match the installed Windsurf skill invocation and breaks the normal continuation to design generation.

Useful? React with 👍 / 👎.

@Brujo2020 Brujo2020 force-pushed the feat/kiro-getspecs-brownfield branch from 7d8fae6 to 8b2a8ec Compare June 19, 2026 23:01
Introduce /kiro-getspecs as the code-first entry point for adopting cc-sdd
on existing repositories that have implementation but no (or incomplete)
.kiro/ specs.

What it does:
- Reverse-engineers stack, architecture, and module boundaries from code
- Writes steering (product, tech, structure), roadmap.md, and spec seeds
- Each seed: brief.md + spec.json + requirements.md stub (project description
  only — same contract as /kiro-spec-init; EARS stays in /kiro-spec-requirements)
- Does not write design.md, tasks.md, or spec-kit .specify/ artifacts

Pipeline handoffs (minimal, required):
- kiro-spec-init: brownfield seed path when brief + spec.json exist
- kiro-spec-requirements: derive project description from brief if needed
- kiro-spec-batch / kiro-discovery: point brownfield repos to getSpecs

Docs:
- docs/guides/brownfield-getspecs.md (architecture + seed contract diagrams)
- CHANGELOG [Unreleased], RELEASE_NOTES, skill-reference, agent AGENTS.md

Tests: npm test in tools/cc-sdd — 193/193 passing (all 8 agent manifests)

Credits: logic distilled from spec-kit brownfield extensions, mapped to native
.kiro/ outputs for Kiro/cc-sdd portability.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Brujo2020 Brujo2020 force-pushed the feat/kiro-getspecs-brownfield branch from 8b2a8ec to d4d2c3c Compare June 19, 2026 23:01
Claude Code handoff parity, native getSpecs skill format, JA/ZH doc mirrors,
and EN seed-contract wording. 193/193 tests passing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Brujo2020

Copy link
Copy Markdown
Author

Thanks for taking a look when you have time.

Follow-up aligned with cc-sdd conventions (commit 819d4e5):

  • SDD philosophy: /kiro-getspecs is code-first brownfield bootstrap only — writes steering, roadmap, and spec seeds (brief.md, spec.json, requirements.md stub). Phase gates unchanged; EARS → /kiro-spec-requirements, design/tasks → existing skills.
  • 8-platform parity: Claude Code now matches the other 7 agents for handoffs (kiro-discovery, kiro-spec-init, kiro-spec-batch, kiro-spec-requirements, kiro-validate-gap). Claude kiro-getspecs uses platform-native frontmatter (disable-model-invocation, allowed-tools, step-based structure).
  • Tests: cd tools/cc-sdd && npm test193/193 passed.
  • Doc mirrors: EN skill-reference seed contract fixed; JA skill-reference + package README (ja/zh) updated (17→18 skills, getSpecs entry).
  • Diff hygiene: reverted accidental Claude kiro-validate-gap reformat; handoff edits remain minimal and pipeline-focused.

Brownfield gap today: /kiro-discovery is idea-first; repos with substantial code but empty .kiro/specs/ had no native bootstrap. This complements /kiro-validate-gap (post-requirements) earlier in the pipeline.

Happy to split handoff-only edits into a follow-up PR if you prefer a smaller review surface.

Address Codex review on PR gotalab#176:
- Codex validate-gap: use $kiro-* invocations (not /kiro-*)
- Windsurf validate-gap: restore @kiro-spec-design handoff
- spec-batch: restore per-agent skill install paths (.agents, .windsurf,
  .opencode, .github, .gemini, .agent) broken in brownfield handoff edits

Tests: cd tools/cc-sdd && npm test → 193/193 passed
Co-authored-by: Cursor <cursoragent@cursor.com>
@Brujo2020

Copy link
Copy Markdown
Author

Follow-up: Codex review addressed (1323dc8)

Thanks for the automated review — both P2 items are fixed:

  1. Codex $kiro-* handoffskiro-validate-gap (Codex) now emits $kiro-spec-requirements, $kiro-spec-design, and $kiro-getspecs (was incorrectly /kiro-*). kiro-getspecs Codex handoffs were already $-prefixed from 819d4e5.

  2. Windsurf @kiro-* handoffskiro-validate-gap (Windsurf) design step restored to @kiro-spec-design (was regressed to /kiro-spec-design).

Extra fix (same class of bug): brownfield handoff edits had also broken kiro-spec-batch skill install paths on 6 platforms (e.g. Codex .cursor/skills$….agents/skills/…, Windsurf .cursor/skills@….windsurf/skills@…, plus OpenCode/GitHub Copilot/Gemini/Antigravity native paths).

Validation: cd tools/cc-sdd && npm test193/193 passed.

Scope unchanged: /kiro-getspecs brownfield bootstrap + minimal pipeline handoffs only — no SteelHarness-specific orient (graphify/mh-learn).

@Brujo2020

Copy link
Copy Markdown
Author

@codex review

@Brujo2020

Copy link
Copy Markdown
Author

@gotalab — ready for human review when you have a moment.

Latest: 1323dc8 addresses the two Codex P2 items (platform-native handoff prefixes) plus spec-batch skill path regressions on 6 agents. npm test → 193/193.

Scope: skill #18 /kiro-getspecs + minimal brownfield handoffs only — no harness-specific logic. Happy to split handoff edits into a follow-up if you prefer a smaller first merge.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1323dc8be4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

3. **Check Uniqueness / Brownfield seed**:
- If the directory exists with `brief.md` and `spec.json` but **no** `requirements.md` (typical `$kiro-getspecs` seed): use that directory. Write `requirements.md` stub from `requirements-init.md` using the brief; **do not** recreate or overwrite `spec.json`. Stop after stub write.
- If the directory exists with only `brief.md` (no `spec.json`, from `$kiro-discovery`): use that directory.
- If the directory exists with all three files: report conflict and ask whether to refresh the stub only.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept getSpecs stubs instead of reporting conflicts

When a brownfield repo is bootstrapped with /kiro-getspecs and the user follows the advertised handoff to /kiro-spec-batch, each seed already has brief.md, spec.json, and a requirements.md stub because the new getSpecs skill writes all three files. This branch therefore makes kiro-spec-init report a conflict/ask for input before requirements generation, which breaks the autonomous batch path for getSpecs seeds; it should recognize an ungenerated stub as reusable rather than treating all three files as a conflict.

Useful? React with 👍 / 👎.

…seed detection

When /kiro-getspecs writes all three files (brief.md, spec.json, requirements.md
stub), kiro-spec-init flagged the dir as a conflict. Now detects stub by
empty `## Requirements` section — treat as reusable seed for batch flow.

Fixes last open Codex P2: batch path from getSpecs → kiro-spec-batch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Brujo2020

Copy link
Copy Markdown
Author

@codex review — third P2 resolved: kiro-spec-init now detects getSpecs requirements.md stubs (empty ## Requirements section) as reusable seeds instead of reporting conflict. 8-platform update, npm test → 193/193.

@gotalab — ready for human review when you have a moment.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

After all waves complete, spawn a **single sub-agent** for cross-spec consistency review. This is the highest-value quality gate -- it catches issues that per-spec review gates cannot.

P2 Badge Add inline fallback for no-subagent platforms

For Windsurf installs, the generated AGENTS.md explicitly says Windsurf does not support programmatic sub-agent dispatch and should execute such skill work sequentially in the main context. This new Step 4 unconditionally tells the user to spawn a review sub-agent, unlike Step 3's inline fallback, so /kiro-spec-batch can get stuck or skip the cross-spec review/remediation path on Windsurf. Add the same “if unavailable, run inline” fallback here and for the follow-up fix dispatch.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

## Step 4: Cross-Spec Review

After all waves complete, perform a cross-spec consistency review. This is the highest-value quality gate -- it catches issues that per-spec review gates cannot.
After all waves complete, spawn a **single sub-agent** for cross-spec consistency review. This is the highest-value quality gate -- it catches issues that per-spec review gates cannot.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add inline fallback for no-subagent platforms

For Antigravity installs, the generated AGENTS.md explicitly says Antigravity does not support programmatic sub-agent dispatch and should execute such skill work sequentially in the main context. This new Step 4 unconditionally tells the user to spawn a review sub-agent, unlike Step 3's inline fallback, so /kiro-spec-batch can get stuck or skip the cross-spec review/remediation path on Antigravity. Add the same “if unavailable, run inline” fallback here and for the follow-up fix dispatch.

Useful? React with 👍 / 👎.

Windsurf does not support programmatic sub-agent dispatch. Step 4
(cross-spec review) now includes "if unavailable, run inline" fallback
for both the review task and the fix-dispatch loop.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Brujo2020

Copy link
Copy Markdown
Author

@codex review — Windsurf cross-spec review and fix-dispatch now include inline fallback. npm test → 193/193.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6081c3c82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Creates/updates: `{{KIRO_DIR}}/steering/{product,tech,structure,roadmap}.md`
- Creates spec seeds: `{{KIRO_DIR}}/specs/<slug>/{spec.json,brief.md,requirements.md}` — `requirements.md` is **project-description stub only** (same as `@kiro-spec-init`), not EARS requirements
- Does NOT create: EARS requirements body, `design.md`, `tasks.md`, `.specify/`
4. **Safety check**: If any spec has `spec.json` with `approvals.requirements.approved: true` or `approvals.design.approved: true`, list them and ask before overwriting or duplicating boundaries.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard draft specs before writing seeds

When a brownfield repo already has partial .kiro/specs/ with draft or in-progress specs, this gate only asks before touching specs whose requirements or design are approved; Phase 5 then creates and writes seed files for every chosen slug, so a matching unapproved spec can be overwritten without warning. Since the skill explicitly supports partial .kiro/ additive merge mode, protect any existing spec directory (skip, suffix, or ask) before writing seeds, not only approved specs.

Useful? React with 👍 / 👎.

…allback

- getSpecs Phase 0 safety check now scans ALL existing spec dirs (not
  just approved ones) before writing seeds. Falls back to ask/keep.
- Antigravity kiro-spec-batch Step 4 now has inline fallback for
  cross-spec review and fix-dispatch (same pattern as Windsurf).

Co-authored-by: Cursor <cursoragent@cursor.com>
@Brujo2020

Copy link
Copy Markdown
Author

@codex review — two new P2s resolved:

  1. Antigravity inline fallback — same Windsurf pattern applied to Antigravity kiro-spec-batch Step 4 (review + fix-dispatch)
  2. Guard draft specs — getSpecs Phase 0 now scans ALL existing spec dirs before writing seeds, not just approved ones. Safety table updated.

npm test → 193/193.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33633e4e41

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- [ ] slug-b -- one line. Dependencies: slug-a
```

Mark `[x]` only when a spec has approved requirements (rare on first bootstrap).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep roadmap checkboxes aligned with batch skipping

When getSpecs runs in additive mode against a repo that already has a spec with approved requirements but no design.md/tasks.md, this instruction tells it to mark that roadmap entry [x]. I checked kiro-spec-batch: it parses [x] as “done” and its constraints skip features with [x], so /kiro-spec-batch will never finish those partially complete specs. The checkbox should mean fully batch-complete, or approved-requirements specs need a separate status.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant