chore: Add local template package testing utility#941
chore: Add local template package testing utility#941harikrishnan83 wants to merge 1 commit intogithub:mainfrom
Conversation
Add test-local-init.py script to test spec-kit initialization with locally built template packages instead of downloading from GitHub. Uses monkey patching to bypass GitHub downloads and load ZIPs from .genreleases/. Add documentation to CONTRIBUTING.md explaining the local testing workflow, including prerequisites (bash 4+, zip) and step-by-step instructions. Fixes github#729 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a local testing utility to enable contributors to test template and script changes without relying on GitHub releases. The solution includes a Python script that uses monkey patching to bypass GitHub downloads and comprehensive documentation for the testing workflow.
Key changes:
- Added
test-local-init.pyscript for local testing with monkey patching - Enhanced CONTRIBUTING.md with detailed instructions for building and testing local packages
- Streamlined the development workflow to reduce manual file copying and configuration
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test-local-init.py | New utility script that monkey patches GitHub downloads to use local packages |
| CONTRIBUTING.md | Added comprehensive documentation for local testing workflow and prerequisites |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Thank you for the contribution, @harikrishnan83, but at this time we will just keep this simple: ./.github/workflows/scripts/create-release-packages.sh v1.0.0
cp -r .genreleases/sdd-copilot-package-sh/. /mnt/c/Downloads/test-project-new5/You can then just open the agent within that folder and test the implementation. I would rather not include too much testing logic in the CLI at this time. |
Thanks, @localden. I agree on not including testing logic in CLI. |
Summary
Adds a local testing utility (
test-local-init.py) and documentation to enable contributors to test template and script changes locally before submitting PRs, without having to manually copy files and configure directory structures.Problem
When running
uv run specify, the CLI downloads the latest release packages from GitHub, which means local changes to templates, scripts, or memory files are not included. Previously, contributors had to manually:.specify/,.claude/, etc.)This manual process is tedious, error-prone, and discourages thorough local testing.
Solution
This PR introduces a streamlined local testing workflow:
.genreleases/create-release-packages.shtest-local-init.pyHow It Works
The
test-local-init.pyscript:uv run specify(project path, AI agent, script type)--versionparameter matching the locally-built package versionspecify_cli.download_template_from_githubto return local ZIPs instead of downloading from GitHubspecify_cli.main()command with local packagesWhat's Included
New Files
Modified Files
Test Plan
Contributors can now:
bash .github/workflows/scripts/create-release-packages.sh v0.0.70uv run test-local-init.py /path/to/project --ai claude --script sh --version v0.0.70AI Assistance Disclosure
This PR was created with assistance from Claude Code (Anthropic). The solution was discussed, implemented, and tested with AI assistance for code generation and documentation. All changes have been reviewed and validated.
Fixes #729
🤖 Generated with Claude Code