Skip to content

feat: add bundled lean preset with minimal workflow commands#2161

Merged
mnriem merged 7 commits intogithub:mainfrom
mnriem:feat/bundled-lean-preset
Apr 10, 2026
Merged

feat: add bundled lean preset with minimal workflow commands#2161
mnriem merged 7 commits intogithub:mainfrom
mnriem:feat/bundled-lean-preset

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 10, 2026

Summary

Add a lean preset — a bundled, minimal-workflow preset that overrides the 5 core commands (specify, plan, tasks, implement, constitution) with stripped-down prompts that produce exactly one artifact each.

Also introduces bundled preset infrastructure mirroring the existing bundled extension pattern, so presets can ship inside the wheel and install offline.

Problem

The core commands include significant boilerplate: extension hooks, script dependencies, git branching, template resolution, validation loops, and multi-artifact generation. Users wanting a simpler "just create the artifact" workflow had no built-in option.

Additionally, presets could only be installed from catalog URLs or local paths — there was no bundled preset mechanism, unlike bundled extensions (e.g., git).

Changes

Lean Preset (presets/lean/)

  • 5 commands: speckit.specify, speckit.plan, speckit.tasks, speckit.implement, speckit.constitution
  • Each produces exactly one artifact — no hooks, no scripts, no git branching, no templates
  • Uses .specify/feature.json for feature directory discovery (written by specify, read by plan/tasks/implement)

Bundled Preset Infrastructure

  • pyproject.toml: Added force-include entry to bundle presets/lean into the wheel
  • _locate_bundled_preset(): New discovery function mirroring _locate_bundled_extension()
  • specify init --preset: Updated to try local → bundled → catalog fallback
  • specify preset add: Updated to try bundled → catalog fallback
  • download_pack(): Added bundled guard for presets without download URLs
  • presets/catalog.json: Added lean entry with "bundled": true marker (matching git extension pattern)
  • Error messages: Aligned with bundled extension errors — same structure, same REINSTALL_COMMAND

Tests

  • TestLeanPreset (8 tests): manifest validation, command file existence, no scripts/hooks, install, resolver
  • TestBundledPresetLocator (7 tests): discovery, invalid IDs, CLI install, catalog entry, download rejection, missing-locally error

Testing

All 1255 tests pass. Manually verified:

  • specify init --preset lean installs bundled preset during init
  • specify preset add lean installs bundled preset after init
  • specify preset info lean shows correct metadata
  • Full E2E: specify → plan → tasks → implement producing a working Spring Boot MVC app

Add a lean preset that overrides the 5 core workflow commands (specify,
plan, tasks, implement, constitution) with minimal prompts that produce
exactly one artifact each — no extension hooks, no scripts, no git
branching, no templates.

Bundled preset infrastructure:
- Add _locate_bundled_preset() mirroring _locate_bundled_extension()
- Update 'specify init --preset' to try bundled -> catalog fallback
- Update 'specify preset add' to try bundled -> catalog fallback
- Add bundled guard in download_pack() for presets without download URLs
- Add lean to presets/catalog.json with 'bundled: true' marker
- Add lean to pyproject.toml force-include for wheel packaging
- Align error messages with bundled extension error pattern

Tests: 15 new tests (TestLeanPreset + TestBundledPresetLocator)
Copilot AI review requested due to automatic review settings April 10, 2026 19:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a bundled “lean” preset that overrides the 5 core workflow commands with minimal, single-artifact prompts, and introduces bundled-preset discovery/install support so presets can ship inside the wheel and install offline.

Changes:

  • Added presets/lean/ with a manifest and 5 minimal command overrides (speckit.specify/plan/tasks/implement/constitution).
  • Implemented bundled preset discovery (_locate_bundled_preset) and updated specify init --preset / specify preset add to prefer bundled installs.
  • Updated preset catalog handling to guard against downloads for bundled presets without download_url, plus added tests for the new behavior.
Show a summary per file
File Description
tests/test_presets.py Adds coverage for lean preset manifest/commands and bundled preset discovery/install flows.
src/specify_cli/presets.py Prevents download_pack() from attempting to download bundled presets without a URL.
src/specify_cli/init.py Adds _locate_bundled_preset() and wires bundled fallback into init and preset add.
pyproject.toml Bundles presets/lean into the wheel via force-include.
presets/lean/preset.yml Declares the lean preset and its 5 command overrides.
presets/lean/commands/speckit.specify.md Lean specify prompt producing <feature_directory>/spec.md and .specify/feature.json.
presets/lean/commands/speckit.plan.md Lean plan prompt producing <feature_directory>/plan.md.
presets/lean/commands/speckit.tasks.md Lean tasks prompt producing <feature_directory>/tasks.md.
presets/lean/commands/speckit.implement.md Lean implement prompt executing tasks and updating tasks.md.
presets/lean/commands/speckit.constitution.md Lean constitution prompt producing .specify/memory/constitution.md.
presets/catalog.json Adds lean entry marked as "bundled": true (no download_url).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 11/11 changed files
  • Comments generated: 2

…ssertions

- Remove unused MagicMock import and cache_dir setup in download test
- Assert 'bundled' and 'reinstall' in CLI error output (not just exit code)
- Mock catalog in missing-locally test for deterministic bundled error path
- Fix test versions to satisfy updated speckit_version >=0.6.0 requirement
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a bundled “lean” preset (minimal workflow overrides for the 5 core commands) and introduces bundled-preset discovery/installation so presets can ship inside the wheel and install offline.

Changes:

  • Introduces presets/lean/ with command overrides for speckit.specify/plan/tasks/implement/constitution.
  • Adds bundled preset discovery (_locate_bundled_preset) and updates specify init --preset / specify preset add to prefer bundled installs.
  • Updates preset catalog + download logic and adds tests validating the lean preset and bundled preset installation paths.
Show a summary per file
File Description
tests/test_presets.py Adds test coverage for the lean preset manifest/commands and bundled preset locator + CLI behavior.
src/specify_cli/presets.py Blocks downloading “bundled” presets that don’t have a download_url.
src/specify_cli/__init__.py Adds _locate_bundled_preset and wires bundled preset fallback into init/preset-add flows.
pyproject.toml Bundles presets/lean into the wheel via force-include.
presets/lean/preset.yml Defines the lean preset manifest and the 5 command templates it provides.
presets/lean/commands/speckit.specify.md Lean specify prompt that writes .specify/feature.json and generates <feature_dir>/spec.md.
presets/lean/commands/speckit.plan.md Lean plan prompt producing <feature_dir>/plan.md.
presets/lean/commands/speckit.tasks.md Lean tasks prompt producing <feature_dir>/tasks.md.
presets/lean/commands/speckit.implement.md Lean implement prompt executing tasks and updating tasks.md.
presets/lean/commands/speckit.constitution.md Lean constitution prompt producing .specify/memory/constitution.md.
presets/catalog.json Adds lean entry marked as "bundled": true.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 11/11 changed files
  • Comments generated: 4

…AND to presets.py

- Fix constitution path to .specify/memory/constitution.md in plan, tasks,
  implement commands (matching core command convention)
- Include REINSTALL_COMMAND in download_pack() bundled guard for consistent
  recovery instructions across bundled extensions and presets
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new bundled “lean” preset that overrides the 5 core workflow commands with minimal, single-artifact prompts, and introduces bundled preset discovery/install support so presets can ship inside the wheel for offline installs.

Changes:

  • Adds presets/lean/ (manifest + 5 command overrides) and publishes it as a bundled preset in presets/catalog.json.
  • Introduces _locate_bundled_preset() and updates specify init --preset + specify preset add to prefer bundled presets when available.
  • Adds a bundled-preset guard in PresetCatalog.download_pack() plus new test coverage for the lean preset and bundled locator behavior.
Show a summary per file
File Description
tests/test_presets.py Adds lean preset tests and bundled preset locator/CLI tests
src/specify_cli/presets.py Prevents downloading bundled presets that have no download_url
src/specify_cli/init.py Adds bundled preset locator and updates init/preset-add flows
pyproject.toml Forces presets/lean into the wheel under core_pack/
presets/lean/preset.yml Defines the lean preset manifest and command replacements
presets/lean/commands/speckit.specify.md Lean “specify” prompt (writes .specify/feature.json + spec.md)
presets/lean/commands/speckit.plan.md Lean “plan” prompt (writes plan.md)
presets/lean/commands/speckit.tasks.md Lean “tasks” prompt (writes tasks.md)
presets/lean/commands/speckit.implement.md Lean “implement” prompt (executes tasks and marks completion)
presets/lean/commands/speckit.constitution.md Lean “constitution” prompt (writes .specify/memory/constitution.md)
presets/catalog.json Adds lean entry with bundled: true and updates timestamp

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 11/11 changed files
  • Comments generated: 2

…nup in finally

- Prefix spec.md/plan.md/tasks.md with <feature_directory>/ in plan, tasks,
  and implement commands so the agent doesn't operate on repo root by mistake
- Move ZIP unlink into finally block in init --preset path so cleanup runs
  even when install_from_zip raises (matching preset_add pattern)
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a bundled “lean” preset that replaces the 5 core workflow commands with minimal, single-artifact prompts, and introduces bundled preset discovery/installation so presets can ship inside the wheel for offline installs.

Changes:

  • Added presets/lean/ preset manifest + 5 lean command templates.
  • Implemented bundled preset discovery (_locate_bundled_preset) and updated specify init --preset / specify preset add to prefer local → bundled → catalog.
  • Extended preset catalog/download behavior and added test coverage for lean preset + bundled preset locator flows.
Show a summary per file
File Description
tests/test_presets.py Adds tests for lean preset manifest/commands and bundled preset discovery + CLI install paths.
src/specify_cli/presets.py Prevents downloading “bundled” presets that have no download_url, with a clearer error.
src/specify_cli/init.py Adds _locate_bundled_preset and updates init/preset-add flows to install bundled presets offline.
pyproject.toml Bundles presets/lean into the wheel via hatchling force-include.
presets/lean/preset.yml Defines the new bundled lean preset metadata and provided command overrides.
presets/lean/commands/speckit.*.md Adds stripped-down prompts for specify/plan/tasks/implement/constitution.
presets/catalog.json Adds lean preset entry marked as "bundled": true.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

presets/lean/preset.yml:8

  • The author value here is "github", but bundled core assets elsewhere use a consistent author identifier (e.g., author: spec-kit-core in extensions/git/extension.yml:8 and extensions/catalog.json:11). Aligning this field across bundled packs will make catalog/search filtering and metadata more consistent.
  author: "github"

presets/catalog.json:11

  • The catalog author is set to "github" here, but bundled core assets use a consistent author identifier (e.g., spec-kit-core in extensions/catalog.json:11). Consider aligning the preset catalog entry (and preset.yml) to the same author to keep metadata consistent.
      "author": "github",
  • Files reviewed: 11/11 changed files
  • Comments generated: 3

…grammar

- Replace all Unicode em dashes with ASCII hyphens in preset.yml and
  catalog.json to avoid decode errors on non-UTF-8 environments
- Fix grammar: 'store it in tasks.md' -> 'store them in tasks.md'
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a bundled “lean” preset (minimal workflow overrides for the 5 core commands) and introduces bundled-preset installation/discovery support so presets can ship inside the wheel and install offline.

Changes:

  • Add presets/lean/ preset manifest plus 5 lean command prompt overrides.
  • Add bundled preset discovery (_locate_bundled_preset) and update specify init --preset / specify preset add to prefer bundled installs.
  • Add catalog + download safeguards for bundled presets and extend test coverage for lean + bundled discovery flows.
Show a summary per file
File Description
tests/test_presets.py Adds tests for lean preset validity and bundled preset discovery/install flows.
src/specify_cli/presets.py Prevents downloading bundled presets that have no download_url (must install locally).
src/specify_cli/__init__.py Adds _locate_bundled_preset() and updates init/preset-add logic to try bundled presets.
pyproject.toml Bundles presets/lean into the wheel via force-include.
presets/lean/preset.yml Defines the lean preset and its 5 command overrides.
presets/lean/commands/speckit.specify.md Lean specify prompt (writes spec and feature locator).
presets/lean/commands/speckit.plan.md Lean plan prompt.
presets/lean/commands/speckit.tasks.md Lean tasks prompt (generates tasks checklist).
presets/lean/commands/speckit.implement.md Lean implement prompt (executes tasks).
presets/lean/commands/speckit.constitution.md Lean constitution prompt.
presets/catalog.json Adds lean preset entry marked as bundled: true.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 11/11 changed files
  • Comments generated: 3

- Remove undefined [P] marker from implement (lean uses sequential execution)
- Clarify checkbox update: 'change - [ ] to - [x]' instead of ambiguous '[X]'
- Simplify implement to execute tasks in order without parallel complexity
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a bundled “lean” preset that overrides the 5 core workflow commands with minimal, single-artifact prompts, and introduces bundled preset discovery/installation so presets can ship inside the wheel for offline installs.

Changes:

  • Added presets/lean/ preset (manifest + 5 lean command prompts) overriding core workflow commands.
  • Implemented bundled preset infrastructure: wheel bundling via pyproject.toml, _locate_bundled_preset(), and CLI install flow updates (init --preset, preset add, catalog/download guardrails).
  • Added test coverage for the lean preset and bundled preset locator/CLI behavior.
Show a summary per file
File Description
tests/test_presets.py Adds tests validating the lean preset structure and bundled preset install/discovery behavior.
src/specify_cli/presets.py Prevents attempting to download bundled presets that have no download_url.
src/specify_cli/__init__.py Adds bundled preset locator and updates init --preset and preset add to prefer bundled installs.
pyproject.toml Bundles presets/lean into the wheel under specify_cli/core_pack/presets/lean.
presets/lean/preset.yml Defines the lean preset manifest and the 5 command overrides.
presets/lean/commands/speckit.specify.md Lean “specify” command prompt.
presets/lean/commands/speckit.plan.md Lean “plan” command prompt.
presets/lean/commands/speckit.tasks.md Lean “tasks” command prompt.
presets/lean/commands/speckit.implement.md Lean “implement” command prompt.
presets/lean/commands/speckit.constitution.md Lean “constitution” command prompt.
presets/catalog.json Adds lean preset catalog entry marked as "bundled": true.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

tests/test_presets.py:2927

  • The hook checks use raw substring assertions like "hooks." not in content, which can be a false positive if the text ever mentions hooks in an example or explanation. If the intent is to ensure the lean preset doesn’t include the core command boilerplate, consider checking for a more specific sentinel (e.g. the "Check for extension hooks" section header) or parsing frontmatter/body and validating expected keys/sections explicitly.
    def test_lean_commands_have_no_hooks(self):
        """Verify lean commands do not contain extension hook boilerplate."""
        for name in LEAN_COMMAND_NAMES:
            cmd_path = LEAN_PRESET_DIR / "commands" / f"speckit.{name.split('.')[-1]}.md"
            content = cmd_path.read_text()
            assert "hooks." not in content, f"{name} should not reference extension hooks"
            assert "extensions.yml" not in content, f"{name} should not reference extensions.yml"
  • Files reviewed: 11/11 changed files
  • Comments generated: 1

… search

- Use CommandRegistrar.parse_frontmatter() to check for scripts/agent_scripts
  keys in YAML frontmatter instead of brittle 'scripts:' substring search
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new bundled “lean” preset that provides a minimal, single-artifact workflow for the five core commands, and introduces bundled preset infrastructure so presets can ship inside the wheel (offline install), similar to bundled extensions.

Changes:

  • Add presets/lean/ preset with stripped-down versions of speckit.specify, speckit.plan, speckit.tasks, speckit.implement, and speckit.constitution.
  • Add bundled preset discovery + CLI install fallbacks (local → bundled → catalog for init, bundled → catalog for preset add) and guard downloads for bundled presets with no download_url.
  • Add catalog entry + tests covering the lean preset and bundled preset locator behavior.
Show a summary per file
File Description
tests/test_presets.py Adds test coverage for lean preset contents and bundled preset discovery/install behaviors.
src/specify_cli/presets.py Prevents attempting catalog downloads for bundled presets without a download URL; improves error messaging for that case.
src/specify_cli/__init__.py Adds _locate_bundled_preset() and updates init / preset add flows to support bundled preset installation and clearer “missing bundled files” messaging.
pyproject.toml Bundles presets/lean into the wheel under specify_cli/core_pack/presets/lean.
presets/lean/preset.yml Defines the lean preset manifest (5 command overrides).
presets/lean/commands/*.md Adds the lean command prompt files implementing the minimal workflow.
presets/catalog.json Adds lean preset entry marked as "bundled": true (no download_url).

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new

@mnriem mnriem merged commit 43cb0fa into github:main Apr 10, 2026
12 checks passed
@mnriem mnriem deleted the feat/bundled-lean-preset branch April 10, 2026 21:18
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.

2 participants