Skip to content

feat: add native Cline integration#2508

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

feat: add native Cline integration#2508
pedropalb wants to merge 2 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 on lines 402 to +406
"""Compute the on-disk command or skill name for an agent."""
if agent_config["extension"] != "/SKILL.md":
format_name = agent_config.get("format_name")
if format_name:
return format_name(cmd_name)

import os
import pytest
from pathlib import Path
Comment thread integrations/catalog.json
Comment on lines +15 to +23
"cline": {
"id": "cline",
"name": "Cline",
"version": "1.0.0",
"description": "Cline IDE integration",
"author": "spec-kit-core",
"repository": "https://github.com/github/spec-kit",
"tags": ["ide"]
},
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 12, 2026

Please address Copilot feedback

pedropalb added 2 commits May 12, 2026 14:22
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
Comment on lines 401 to 407
) -> str:
"""Compute the on-disk command or skill name for an agent."""
if agent_config["extension"] != "/SKILL.md":
format_name = agent_config.get("format_name")
if format_name:
return format_name(cmd_name)
return cmd_name
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