Stage 6: Complete migration — remove legacy scaffold path (#1924)#2063
Stage 6: Complete migration — remove legacy scaffold path (#1924)#2063mnriem merged 6 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
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_CONFIGandCommandRegistrar.AGENT_CONFIGSfromINTEGRATION_REGISTRYto 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.
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.
485632d to
ce8fb34
Compare
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.
There was a problem hiding this comment.
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.mdcommand 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.
There was a problem hiding this comment.
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.
- _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].
There was a problem hiding this comment.
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--offlineto switch to bundled assets, but this PR makes all scaffolding integration-only and marks--offlineas a deprecated no-op. Please update the docstring (steps + examples) to reflect the new behavior sospecify inithelp/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.
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.
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)download_template_from_github()download_and_extract_template()integration.setup()scaffold_from_core_pack(),_locate_release_script()integration.setup()install_ai_skills(),_has_bundled_skills()SkillsIntegration.setup()_migrate_legacy_kimi_dotted_skills()KimiIntegration.setup()AGENT_SKILLS_MIGRATIONS,_handle_agent_skills_migration()_parse_rate_limit_headers(),_format_rate_limit_error()init()Config derivation (single source of truth)
AGENT_CONFIG→ derived fromINTEGRATION_REGISTRY(replaced 180-line hand-maintained dict with 6-line_build_agent_config())CommandRegistrar.AGENT_CONFIGS→ derived fromINTEGRATION_REGISTRY(replaced 160-line dict with 10-line_build_agent_configs())SKILL_DESCRIPTIONS,NATIVE_SKILLS_AGENTS,DEFAULT_SKILLS_DIR,_get_skills_dir()Release pipeline cleanup
create-release-packages.shcreate-release-packages.ps1create-github-release.shgenerate-release-notes.shsimulate-release.shget-next-version.shupdate-version.shcheck-release-exists.sh.github/workflows/scripts/directoryrelease.ymlis now self-contained — check, notes, and release creation all inlined. Install instructions useuv tool installwith version tag.Test cleanup
test_ai_skills.py(82 tests — tested removedinstall_ai_skills())test_core_pack_scaffold.py(~350 tests — tested removedscaffold_from_core_pack())test_agent_config_consistency.py(removed 19 release-script tests, kept 29 runtime tests)test_branch_numbering.py(removed deaddownload_and_extract_templatemonkeypatches)Validation
uvx ruff check src/— all checks passed__init__.py: 4623 → 3550 lines