Skip to content

feat: add native Cline integration#2508

Open
pedropalb wants to merge 3 commits into
github:mainfrom
pedropalb:cline-integration
Open

feat: add native Cline integration#2508
pedropalb wants to merge 3 commits into
github:mainfrom
pedropalb:cline-integration

Conversation

@pedropalb
Copy link
Copy Markdown

@pedropalb pedropalb commented May 9, 2026

Description

This PR introduces a new integration for Cline (IDE-based agent).

  • New Cline Integration: Added a dedicated integration for Cline in src/specify_cli/integrations/cline/. It uses the .clinerules/ directory and defaults to hyphenated command invocations (e.g., /speckit-plan) which Cline handles optimally.
  • Unified Naming Convention: Refactored CommandRegistrar to respect a format_name callback in integration configurations. This unifies naming for hyphenated agents so that even extension commands (e.g., those from the git extension) use hyphenated filenames (e.g., speckit-git-feature.md) instead of dot-notation.
  • Hook Rendering Update: Updated HookExecutor to correctly render hyphenated invocations for Cline projects.
  • Documentation: Added Cline to the supported integrations documentation.
  • Forge Compatibility: Updated Forge test expectations to reflect the new unified naming convention for extension commands.

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Code generated with Gemini CLI with little manual tunings.

@pedropalb pedropalb marked this pull request as ready for review May 9, 2026 19:18
@pedropalb pedropalb requested a review from mnriem as a code owner May 9, 2026 19:18
@mnriem mnriem requested a review from Copilot May 11, 2026 19:34
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

Adds first-class support for the Cline IDE agent integration, while generalizing command name formatting so integrations can control on-disk command naming (notably for hyphenated slash-command agents). Also updates hook invocation rendering and adjusts tests/docs accordingly.

Changes:

  • Introduce ClineIntegration targeting .clinerules/ with hyphenated command filenames and invocations.
  • Update CommandRegistrar to respect an integration-provided format_name callback for non-skill command file output names.
  • Render hyphenated invocations for Cline in hook execution and update tests/docs/catalog to include the new integration.
Show a summary per file
File Description
tests/test_extensions.py Adds coverage for Cline-specific hook invocation rendering (/speckit-*).
tests/integrations/test_integration_subcommand.py Normalizes CLI output assertions by stripping ANSI codes.
tests/integrations/test_integration_forge.py Updates Forge expectations for hyphenated extension command filenames.
tests/integrations/test_integration_cline.py Adds new test suite for Cline integration behavior and naming.
tests/integrations/test_cli.py Strips ANSI codes before asserting on Rich CLI output.
src/specify_cli/integrations/cline/init.py Implements the new Cline integration + command name formatter.
src/specify_cli/integrations/init.py Registers Cline as a builtin integration.
src/specify_cli/extensions.py Updates hook invocation rendering to emit /speckit-* for Cline projects.
src/specify_cli/agents.py Applies format_name when computing non-skill on-disk command filenames.
integrations/catalog.json Adds Cline metadata to the integrations catalog.
docs/reference/integrations.md Documents Cline as a supported integration.

Copilot's findings

Tip

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

  • Files reviewed: 11/11 changed files
  • Comments generated: 3

Comment thread src/specify_cli/integrations/cline/__init__.py
Comment thread src/specify_cli/integrations/cline/__init__.py
Comment thread tests/integrations/test_integration_cline.py
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: 11/11 changed files
  • Comments generated: 3

Comment thread src/specify_cli/agents.py
Comment thread tests/integrations/test_integration_cline.py Outdated
Comment thread integrations/catalog.json
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 12, 2026

Please address Copilot feedback

Standardize on using strip_ansi to clean CLI output before string
assertions in test_cli.py and test_integration_subcommand.py.
This prevents test failures caused by rich console formatting
codes interfering with substring matching and parsing.
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: 11/11 changed files
  • Comments generated: 1

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

@mnriem mnriem requested a review from Copilot May 13, 2026 21:26
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 encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@pedropalb pedropalb force-pushed the cline-integration branch from 1b9a0f1 to 83b6c3e Compare May 13, 2026 21:27
- Implement dot-to-hyphen rewriting for agent handoffs in Cline integration.
- Inject instructional note for hook command mapping in generated markdown.
- Update HookExecutor to use Cline-specific command formatting.
- Add unit tests for Cline-specific handoff and hook transformations.
- Fix workflow tests by mocking shutil.which to prevent side effects.
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: 12/12 changed files
  • Comments generated: 2

Comment on lines 2457 to +2471
@@ -2464,6 +2465,10 @@ def _render_hook_invocation(self, command: Any) -> str:
return f"/skill:{skill_name}"
if cursor_skill_mode and skill_name:
return f"/{skill_name}"
if cline_mode:
from .integrations.cline import format_cline_command_name

return f"/{format_cline_command_name(command_id)}"
Comment thread src/specify_cli/agents.py
parent.rmdir() # no-op if dir still has other files
except OSError:
pass

@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 13, 2026

Please address Copilot feedback. If not applicable please explain why. Also please resolve conflicts by pulling in latest from upstream/main

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.

3 participants