feat(dev): add integration scaffolder#2685
Open
PascalThuet wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a developer-facing integration scaffolding feature to generate built-in integration packages plus a matching test skeleton, exposed via a new specify dev integration scaffold CLI command and documented for contributors.
Changes:
- Introduces
scaffold_integration()and templates for multiple integration types (markdown/toml/yaml/skills). - Adds
specify dev integration scaffoldTyper command to generate scaffold files and print next steps. - Adds integration tests validating generated file contents and error cases; updates local development docs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/integrations/test_integration_scaffold.py | New integration tests covering CLI scaffold behavior, templates, and validation errors. |
| src/specify_cli/integration_scaffold.py | New scaffold implementation: templates, content generation, filesystem writes, and result metadata. |
| src/specify_cli/init.py | Adds new dev integration scaffold CLI command wiring around scaffold_integration(). |
| docs/local-development.md | Documents how to run the new scaffold command and renumbers subsequent sections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+120
to
+121
| context_file = "AGENTS.md" | ||
| multi_install_safe = True |
Comment on lines
+154
to
+155
| assert integration.context_file == "AGENTS.md" | ||
| assert integration.multi_install_safe is True |
Comment on lines
+49
to
+53
| assert "class MyAgentIntegration(MarkdownIntegration):" in content | ||
| assert 'key = "my-agent"' in content | ||
| assert '"folder": ".my-agent/"' in content | ||
| assert '"extension": ".md"' in content | ||
| assert "multi_install_safe = True" in content |
Comment on lines
+55
to
+58
| test_content = test_file.read_text(encoding="utf-8") | ||
| assert "from specify_cli.integrations.my_agent import MyAgentIntegration" in test_content | ||
| assert 'assert integration.registrar_config["dir"] == ".my-agent/commands"' in test_content | ||
| assert "assert integration.multi_install_safe is True" in test_content |
mnriem
requested changes
Jun 3, 2026
Collaborator
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
| assert f'"commands_subdir": "{commands_subdir}"' in content | ||
| assert f'"args": "{args}"' in content | ||
| assert f'"extension": "{extension}"' in content | ||
| assert "multi_install_safe = False" in content |
Collaborator
|
Please address Copilot feedback |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The scaffold template emitted `multi_install_safe = True` alongside a placeholder `context_file = "AGENTS.md"`. Registered as-is, that violates the registry contract (test_safe_integrations_have_distinct_context_files): codex already pairs AGENTS.md with multi_install_safe = True, so the generated boilerplate would collide on first registration. Default the scaffold to False (matching IntegrationBase) so generated code is registry-test-friendly out of the box; contributors opt in once they pick a unique context_file. Aligns the generated test skeleton and both scaffold tests, which previously contradicted each other (one expected True, one False). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cdf7c79 to
d6eed85
Compare
Comment on lines
+208
to
+225
| integration_dir.mkdir(parents=True, exist_ok=True) | ||
| test_file.parent.mkdir(parents=True, exist_ok=True) | ||
| integration_file.write_text( | ||
| _integration_content( | ||
| key=clean_key, | ||
| class_name=class_name, | ||
| integration_type=normalized_type, | ||
| ), | ||
| encoding="utf-8", | ||
| ) | ||
| test_file.write_text( | ||
| _test_content( | ||
| key=clean_key, | ||
| class_name=class_name, | ||
| integration_type=normalized_type, | ||
| ), | ||
| encoding="utf-8", | ||
| ) |
Comment on lines
+648
to
+652
| integration_type: str = typer.Option( | ||
| "markdown", | ||
| "--type", | ||
| click_type=click.Choice(INTEGRATION_SCAFFOLD_TYPES), | ||
| help=f"Scaffold type: {', '.join(INTEGRATION_SCAFFOLD_TYPES)}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2683.
Summary
specify dev integration scaffold <key>for built-in integration boilerplateTesting
uv run --extra test pytest tests/integrations/test_integration_scaffold.py -vuv run --extra test pytest tests/integrations/test_integration_scaffold.py tests/integrations/test_registry.py -vuvx ruff check src/specify_cli/integration_scaffold.py src/specify_cli/__init__.py tests/integrations/test_integration_scaffold.pygit diff --check