spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

feat: add /speckit.converge command

Open BenBtg opened this issue 5 months ago • 0 comments

Description

Adds a built-in /speckit.converge command — an implementation-convergence step that runs after /speckit.implement. It reads a feature's spec.md, plan.md, and tasks.md as the sole source of intent (with the constitution as governing constraints), assesses the current codebase, and appends remaining unbuilt work as new, traceable tasks to tasks.md so /speckit.implement can complete it.

It is needed to close the gap between what a feature specifies and what the implementation pass actually built, expressed as actionable tasks the existing workflow can consume — without a manual review step.

The command is delivered as a Markdown command template (templates/commands/converge.md) plus registration of the new core command across the integration registries, integration tests, post-init guidance, and the README Core Commands table.

Key behaviours

  • Append-only: never modifies spec.md, plan.md, existing tasks, or application code. The only write is a new ## Phase N — Convergence section in tasks.md.
  • Traceable findings: each appended task names its source-ref (e.g. FR-003, SC-002, US1/AC2, Constitution II) and a gap-type label (missing / partial / contradicts / unrequested).
  • Clean converged state: when nothing remains, reports a converged result with summary counts and leaves tasks.md byte-for-byte unchanged.
  • Prerequisite guard: stops with an actionable message when plan.md or tasks.md is missing.
  • Cross-integration: installs and is invocable across all supported agents; appears in post-init guidance as the step after implement. Hooks: before_converge / after_converge (the latter receives the converged vs tasks_appended outcome).

Built through the spec-driven workflow — see specs/001-converge-command/ (spec.md, plan.md, tasks.md, research.md, data-model.md, contracts/, quickstart.md).

Note: A new core command is a material change that, for the upstream project, warrants maintainer agreement before merge. This PR targets the fork's main for review; retarget the base to github/spec-kit:main when ready to propose upstream.

Testing

  • [x] Tested locally with uv run specify --help
  • [x] Ran existing tests with uv sync && uv run pytest
  • [x] Tested with a sample project (if applicable)

Details:

  • Automated: uv run python -m pytest tests/test_agent_config_consistency.py tests/integrations -q → 2343 passed (the suites that enumerate the core command set, now including converge).
  • Sample projects: scaffolded with uv run specify init … --integration copilot and --integration gemini; verified converge is installed and discoverable in post-init guidance.
  • Template tokens: process_template for copilot + gemini × sh + ps resolves with no leftover {SCRIPT} / __SPECKIT_COMMAND_*__.
  • Manual quickstart (Constitution IV) — re-verified 2026-06-16, GitHub Copilot + Gemini, macOS/zsh (prior pass 2026-06-10, Copilot):
    • S1 gap → appended traceable (missing) task ✅
    • S2 implement closes gap, re-converge finds 0 ✅
    • S3 converged → tasks.md unchanged ✅
    • S4 read-only boundaries (spec/plan/code untouched) ✅
    • S5 missing-prerequisite guard ✅
    • S6 cross-integration install + post-init guidance ✅

Full per-scenario results are recorded in T025 of specs/001-converge-command/tasks.md.

AI Disclosure

  • [ ] I did not use AI assistance for this contribution
  • [x] I did use AI assistance (describe below)

The command template, core-command registration edits, and SDD artifacts were authored with GitHub Copilot (model: Claude Opus 4.8) on behalf of @BenBtg, who reviewed the changes. The feature was itself built using the Spec Kit spec-driven workflow (specify → plan → tasks → implement); the agent also ran the automated test suite and the manual quickstart validation.

BenBtg avatar Jun 16 '26 14:06 BenBtg