Skip to content

Stage 6: Complete migration — remove legacy scaffold path (#1924)#2063

Merged
mnriem merged 6 commits intogithub:mainfrom
mnriem:issue-1924-stage-6
Apr 2, 2026
Merged

Stage 6: Complete migration — remove legacy scaffold path (#1924)#2063
mnriem merged 6 commits intogithub:mainfrom
mnriem:issue-1924-stage-6

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 2, 2026

Summary

Removes the legacy GitHub download and offline scaffold code paths. All 26 agents now use the integration system exclusively. This is Stage 6 of the integration migration plan (#1924).

Net change: 185 insertions, 4652 deletions.

What changed

Code removal (~1073 lines from __init__.py)

Removed Reason
download_template_from_github() No more GitHub ZIP downloads
download_and_extract_template() Replaced by integration.setup()
scaffold_from_core_pack(), _locate_release_script() Replaced by integration.setup()
install_ai_skills(), _has_bundled_skills() Handled by SkillsIntegration.setup()
_migrate_legacy_kimi_dotted_skills() Handled by KimiIntegration.setup()
AGENT_SKILLS_MIGRATIONS, _handle_agent_skills_migration() No longer needed — skills are the default
_parse_rate_limit_headers(), _format_rate_limit_error() Only used by removed download functions
Three-way branch in init() Collapsed to integration-only path

Config derivation (single source of truth)

  • AGENT_CONFIG → derived from INTEGRATION_REGISTRY (replaced 180-line hand-maintained dict with 6-line _build_agent_config())
  • CommandRegistrar.AGENT_CONFIGS → derived from INTEGRATION_REGISTRY (replaced 160-line dict with 10-line _build_agent_configs())
  • Backward-compat constants kept for presets/extensions: SKILL_DESCRIPTIONS, NATIVE_SKILLS_AGENTS, DEFAULT_SKILLS_DIR, _get_skills_dir()

Release pipeline cleanup

Removed Lines
create-release-packages.sh 388
create-release-packages.ps1 560
create-github-release.sh 72 (inlined in release.yml)
generate-release-notes.sh 47 (inlined in release.yml)
simulate-release.sh 134
get-next-version.sh unused
update-version.sh unused
check-release-exists.sh 22 (inlined in release.yml)
.github/workflows/scripts/ directory entirely removed

release.yml is now self-contained — check, notes, and release creation all inlined. Install instructions use uv tool install with version tag.

Test cleanup

  • Deleted test_ai_skills.py (82 tests — tested removed install_ai_skills())
  • Deleted test_core_pack_scaffold.py (~350 tests — tested removed scaffold_from_core_pack())
  • Cleaned test_agent_config_consistency.py (removed 19 release-script tests, kept 29 runtime tests)
  • Fixed test_branch_numbering.py (removed dead download_and_extract_template monkeypatches)
  • Updated auto-promote tests to verify files created instead of tip messages

Validation

  • 1089 tests pass, 0 failures
  • uvx ruff check src/ — all checks passed
  • __init__.py: 4623 → 3550 lines

Copilot AI review requested due to automatic review settings April 2, 2026 16:03
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 completes Stage 6 of the “Agents → Integrations” migration by removing the legacy GitHub-download/offline-scaffold code paths and consolidating agent configuration into the integration registry as the single source of truth.

Changes:

  • Removed legacy init scaffolding paths (GitHub ZIP download, offline core_pack scaffold, legacy skills installer) in favor of integration.setup() exclusively.
  • Derived AGENT_CONFIG and CommandRegistrar.AGENT_CONFIGS from INTEGRATION_REGISTRY to eliminate duplicated, hand-maintained dictionaries.
  • Simplified/updated tests to validate created files/dirs instead of legacy output tips; removed release workflow helper scripts.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_extension_skills.py Updates skills-dir helper logic to match new skills dir resolution behavior.
tests/test_core_pack_scaffold.py Removes offline/core-pack scaffolding parity test suite (legacy path removed).
tests/test_branch_numbering.py Removes monkeypatches for deleted download code; updates CLI invocations for non-interactive runs.
tests/test_ai_skills.py Removes tests for deleted install_ai_skills() / legacy download path behavior.
tests/test_agent_config_consistency.py Drops assertions tied to removed release scripts; keeps runtime-surface consistency checks.
tests/integrations/test_integration_kiro_cli.py Adjusts assertions away from “tip text” output and toward file existence.
tests/integrations/test_integration_codex.py Validates --ai codex behavior via created skills artifacts rather than output text.
tests/integrations/test_integration_base_toml.py Updates auto-promote tests to assert directories created instead of output messaging.
tests/integrations/test_integration_base_skills.py Updates auto-promote tests to assert skills directories created instead of output messaging.
tests/integrations/test_integration_base_markdown.py Updates auto-promote tests to assert commands directories created instead of output messaging.
tests/integrations/test_integration_agy.py Validates --ai agy behavior via created skills artifacts rather than output text.
tests/integrations/test_cli.py Removes assertion on “--integration …” output tip; keeps file-based validation.
src/specify_cli/agents.py Replaces static agent config dict with integration-registry-derived configs (single source of truth).
src/specify_cli/__init__.py Removes legacy scaffold/download/skills code and routes init through integrations only; derives AGENT_CONFIG from registry.
.github/workflows/scripts/update-version.sh Removes unused workflow helper script.
.github/workflows/scripts/simulate-release.sh Removes unused workflow helper script.
.github/workflows/scripts/get-next-version.sh Removes unused workflow helper script.
.github/workflows/scripts/generate-release-notes.sh Removes unused workflow helper script (notes generation inlined).
.github/workflows/scripts/create-release-packages.sh Removes legacy release packaging script (templates ZIPs no longer built here).
.github/workflows/scripts/create-release-packages.ps1 Removes legacy release packaging script (PowerShell variant).
.github/workflows/scripts/create-github-release.sh Removes legacy release helper (release creation inlined).
.github/workflows/scripts/check-release-exists.sh Removes legacy release helper (existence check inlined).
.github/workflows/release.yml Inlines release existence check + release notes generation + GitHub release creation.

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

mnriem added 2 commits April 2, 2026 11:17
Remove the legacy GitHub download and offline scaffold code paths.
All 26 agents now use the integration system exclusively.

Code removal (~1073 lines from __init__.py):
- download_template_from_github(), download_and_extract_template()
- scaffold_from_core_pack(), _locate_release_script()
- install_ai_skills(), _get_skills_dir (restored slim version for presets)
- _has_bundled_skills(), _migrate_legacy_kimi_dotted_skills()
- AGENT_SKILLS_MIGRATIONS, _handle_agent_skills_migration()
- _parse_rate_limit_headers(), _format_rate_limit_error()
- Three-way branch in init() collapsed to integration-only

Config derivation (single source of truth):
- AGENT_CONFIG derived from INTEGRATION_REGISTRY (replaced 180-line dict)
- CommandRegistrar.AGENT_CONFIGS derived from INTEGRATION_REGISTRY (replaced 160-line dict)
- Backward-compat constants kept for presets/extensions: SKILL_DESCRIPTIONS,
  NATIVE_SKILLS_AGENTS, DEFAULT_SKILLS_DIR

Release pipeline cleanup:
- Deleted create-release-packages.sh/.ps1 (948 lines of ZIP packaging)
- Deleted create-github-release.sh, generate-release-notes.sh
- Deleted simulate-release.sh, get-next-version.sh, update-version.sh
- Removed .github/workflows/scripts/ directory entirely
- release.yml is now self-contained: check, notes, release all inlined
- Install instructions use uv tool install with version tag

Test cleanup:
- Deleted test_ai_skills.py (tested removed functions)
- Deleted test_core_pack_scaffold.py (tested removed scaffold)
- Cleaned test_agent_config_consistency.py (removed 19 release-script tests)
- Fixed test_branch_numbering.py (removed dead monkeypatches)
- Updated auto-promote tests (verify files created, not tip messages)

1089 tests pass, 0 failures, ruff clean.
- Fix circular import: move CommandRegistrar import in claude
  integration to inside method bodies (was at module level)
- Lazy-populate AGENT_CONFIGS via _ensure_configs() to avoid
  circular import at class definition time
- Set claude registrar_config to .claude/commands (extension/preset
  target) since the integration handles .claude/skills in setup()
- Update tests from github#2051 to match: registrar_config assertions,
  remove --integration tip assertions, remove install_ai_skills mocks

1086 tests pass.
@mnriem mnriem force-pushed the issue-1924-stage-6 branch from 485632d to ce8fb34 Compare April 2, 2026 16:29
Restore ClaudeIntegration.registrar_config to .claude/skills (not
.claude/commands) so extension/preset registrations write to the
correct skills directory.

Update tests that simulate claude setup to use .claude/skills and
check for SKILL.md layout. Some tests still need updating for the
full skills path — 10 remaining failures from the github#2051 test
expectations around the extension/preset skill registration flow.

WIP: 1076/1086 pass.
Copilot AI review requested due to automatic review settings April 2, 2026 16:36
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

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (2)

tests/test_extensions.py:1092

  • register_commands_for_claude() now writes Claude overrides as skills (".../speckit-/SKILL.md"), but this test still asserts legacy .md command files in .claude/skills/. Update expected paths/names to the skills layout (including alias mapping) so the test actually validates current behavior.
        claude_dir = project_dir / ".claude" / "skills"
        claude_dir.mkdir(parents=True)

        manifest = ExtensionManifest(ext_dir / "extension.yml")
        registrar = CommandRegistrar()
        registered = registrar.register_commands_for_claude(manifest, ext_dir, project_dir)

        assert len(registered) == 2
        assert "speckit.ext-alias.cmd" in registered
        assert "speckit.ext-alias.shortcut" in registered
        assert (claude_dir / "speckit.ext-alias.cmd.md").exists()
        assert (claude_dir / "speckit.ext-alias.shortcut.md").exists()

tests/test_extensions.py:1614

  • The expected Claude skill directory name here uses a dot (speckit-test-ext.hello), but the skills naming logic replaces dots with hyphens (e.g. speckit-test-ext-hello). Update the expected path to match the actual skill directory naming so the test is meaningful.
        # Verify command registered
        cmd_file = project_dir / ".claude" / "skills" / "speckit-test-ext.hello" / "SKILL.md"
        assert cmd_file.exists()

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

…tests

Fix extension update rollback using _compute_output_name() for SKILL.md
agents (converts dots to hyphens in skill directory names). Previously
the backup and cleanup code constructed paths with raw command names
(e.g. speckit.test-ext.hello/SKILL.md) instead of the correct computed
names (speckit-test-ext-hello/SKILL.md).

Test fixes for claude skills migration:
- Update claude tests to use .claude/skills paths and SKILL.md layout
- Use qwen (not claude) for skills-guard tests since claude's agent dir
  IS the skills dir — creating it triggers command registration
- Fix test_extension_command_registered_when_extension_present to check
  skills path format

1086 tests pass, 0 failures, ruff clean.
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

Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.


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

mnriem added 2 commits April 2, 2026 12:11
- _ensure_configs(): catch ImportError (not Exception), don't set
  _configs_loaded on failure so retries work
- Move _ensure_configs() before unregister loop (not inside it)
- Module-level try/except catches ImportError specifically
- Remove tautology assertion (or True) in test_extensions.py
- Strengthen preset provenance assertion to check source: field
- Mark --offline, --skip-tls, --debug, --github-token as hidden
  deprecated no-ops in init()

1086 tests pass.
Removes force-include entries for create-release-packages.sh/.ps1
which were deleted but still referenced in [tool.hatch.build].
Copilot AI review requested due to automatic review settings April 2, 2026 17:18
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

Copilot reviewed 28 out of 28 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/specify_cli/init.py:862

  • The init() docstring/examples still describe downloading templates from GitHub and using --offline to switch to bundled assets, but this PR makes all scaffolding integration-only and marks --offline as a deprecated no-op. Please update the docstring (steps + examples) to reflect the new behavior so specify init help/docs aren’t misleading.
    offline: bool = typer.Option(False, "--offline", help="Deprecated (no-op). All scaffolding now uses bundled assets.", hidden=True),
    preset: str = typer.Option(None, "--preset", help="Install a preset during initialization (by preset ID)"),
    branch_numbering: str = typer.Option(None, "--branch-numbering", help="Branch numbering strategy: 'sequential' (001, 002, ...) or 'timestamp' (YYYYMMDD-HHMMSS)"),
    integration: str = typer.Option(None, "--integration", help="Use the new integration system (e.g. --integration copilot). Mutually exclusive with --ai."),
    integration_options: str = typer.Option(None, "--integration-options", help='Options for the integration (e.g. --integration-options="--commands-dir .myagent/cmds")'),

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

@mnriem mnriem merged commit b1832c9 into github:main Apr 2, 2026
12 checks passed
@mnriem mnriem deleted the issue-1924-stage-6 branch April 2, 2026 17:34
Quratulain-bilal added a commit to Quratulain-bilal/spec-kit that referenced this pull request Apr 2, 2026
Resolve conflicts with Stage 6 migration (github#2063) and release 0.4.5 (github#2064).
Keep inject_argument_hint alongside new _render_skill and _build_skill_fm methods.
Accept deletion of legacy release packaging scripts.
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