Skip to content

feat(dev): add integration scaffolder#2685

Open
PascalThuet wants to merge 5 commits into
github:mainfrom
PascalThuet:codex/integration-scaffold
Open

feat(dev): add integration scaffolder#2685
PascalThuet wants to merge 5 commits into
github:mainfrom
PascalThuet:codex/integration-scaffold

Conversation

@PascalThuet
Copy link
Copy Markdown
Contributor

Closes #2683.

Summary

  • add specify dev integration scaffold <key> for built-in integration boilerplate
  • generate a minimal integration package plus matching test skeleton for markdown, toml, yaml, and skills layouts
  • document the local contributor workflow

Testing

  • uv run --extra test pytest tests/integrations/test_integration_scaffold.py -v
  • uv run --extra test pytest tests/integrations/test_integration_scaffold.py tests/integrations/test_registry.py -v
  • uvx ruff check src/specify_cli/integration_scaffold.py src/specify_cli/__init__.py tests/integrations/test_integration_scaffold.py
  • git diff --check

Copilot AI review requested due to automatic review settings May 23, 2026 09: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

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 scaffold Typer 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 thread src/specify_cli/integration_scaffold.py
Comment thread src/specify_cli/integration_scaffold.py
Comment thread src/specify_cli/integration_scaffold.py
Comment thread src/specify_cli/__init__.py Outdated
@PascalThuet PascalThuet marked this pull request as ready for review May 26, 2026 03:56
@PascalThuet PascalThuet requested a review from mnriem as a code owner May 26, 2026 03:56
Copilot AI review requested due to automatic review settings May 26, 2026 03:56
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 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/specify_cli/integration_scaffold.py
Comment thread src/specify_cli/integration_scaffold.py Outdated
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.

Copilot's findings

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

Comment thread src/specify_cli/integration_scaffold.py Outdated
Comment on lines +120 to +121
context_file = "AGENTS.md"
multi_install_safe = True
Comment thread src/specify_cli/integration_scaffold.py Outdated
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
Comment thread tests/integrations/test_integration_scaffold.py Outdated
Copy link
Copy Markdown
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

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

Please address Copilot feedback

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.

Copilot's findings

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

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
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented Jun 4, 2026

Please address Copilot feedback

PascalThuet and others added 5 commits June 4, 2026 17:22
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>
@PascalThuet PascalThuet force-pushed the codex/integration-scaffold branch from cdf7c79 to d6eed85 Compare June 4, 2026 15:54
@mnriem mnriem requested a review from Copilot June 4, 2026 16:46
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.

Copilot's findings

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

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)}",
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.

[Feature]: Add integration scaffolder for contributors

3 participants