Skip to content

feat: add support for code studio AI-powered coding agent#883

Open
Code-Studio-Team wants to merge 4 commits intoFission-AI:mainfrom
Code-Studio-Team:feat/add-code-studio-tool
Open

feat: add support for code studio AI-powered coding agent#883
Code-Studio-Team wants to merge 4 commits intoFission-AI:mainfrom
Code-Studio-Team:feat/add-code-studio-tool

Conversation

@Code-Studio-Team
Copy link

@Code-Studio-Team Code-Studio-Team commented Mar 27, 2026

This PR adds support for Code Studio, an AI-powered coding assistant.

Changes

  • New adapter (src/core/command-generation/adapters/codestudio.ts): Generates .prompt.md files for Code Studio with description frontmatter
  • Registry updates: Register and export the codeStudioAdapter
  • Config: Add Code Studio to AI_TOOLS with .codestudio skills directory and codestudio tool ID
  • Tests: Add comprehensive tests for codeStudioAdapter following existing patterns
  • Documentation: Update supported-tools.md with Code Studio entry

Code Studio Integration Details

Code Studio uses two mechanisms that OpenSpec supports:

  • Skills (.codestudio/skills/): Follows the Agent Skills standard - OpenSpec skills are installed here and invoked via /skill:openspec-*
  • Prompt Templates (.codestudio/prompts/): Generated as opsx-{command}.prompt.md files with description frontmatter

The implementation follows the same pattern as GitHub Copilot and Amazon Q adapters, using description-only YAML frontmatter.

Testing

All tests pass:

  • codeStudioAdapter.toolId returns 'codestudio'
  • getFilePath() returns .codestudio/prompts/opsx-{command}.prompt.md
  • formatFile() generates correct frontmatter format

Usage

After this PR, users can:

openspec init --tools codestudio
# or interactively select Code Studio

Then in Code Studio:

  • Use /skill:openspec-propose "my feature" to start a change proposal
  • Or use /opsx-propose "my feature" via prompt templates

Summary by CodeRabbit

New Features

  • Code Studio is now available as a supported tool option

Documentation

  • Tool reference updated to list Code Studio with proper tool ID codestudio

Tests

  • Added tests covering Code Studio adapter behavior and file path generation

Chores

  • Registry, configuration, and adapter index updated to recognize Code Studio

Summary by CodeRabbit

  • New Features

    • Code Studio is now a selectable tool option when initializing projects.
  • Documentation

    • Updated supported tools reference to include Code Studio with filesystem patterns for skills and command/prompt files.
  • Tests

    • Added test coverage for Code Studio adapter functionality.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

A new AI tool "Code Studio" is integrated into the system by creating a command adapter, registering it in the adapter registry, adding it to the configuration, updating documentation with supported filesystem patterns, and adding comprehensive test coverage.

Changes

Cohort / File(s) Summary
Tool Documentation
docs/supported-tools.md
Added codestudio to the available tool IDs list and tool directory reference table with skill path pattern (.codestudio/skills/openspec-*/SKILL.md) and command/prompt path pattern (.codestudio/prompts/opsx-<id>.prompt.md).
Code Studio Adapter Implementation
src/core/command-generation/adapters/codestudio.ts
New adapter module exporting codeStudioAdapter with getFilePath() to generate .codestudio/prompts/opsx-<id>.prompt.md paths and formatFile() to serialize command content into YAML frontmatter with description and body.
Adapter Registration & Configuration
src/core/command-generation/adapters/index.ts, src/core/command-generation/registry.ts, src/core/config.ts
Re-exported codeStudioAdapter from adapters index, registered it in CommandAdapterRegistry, and added Code Studio entry to AI_TOOLS configuration with skillsDir: '.codestudio'.
Test Coverage
test/core/command-generation/adapters.test.ts
Added test suite for codeStudioAdapter verifying toolId, getFilePath() path generation, and formatFile() YAML frontmatter formatting; updated shared adapter path test to include new adapter.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • TabishB
  • Israel-Laguan

Poem

🐰 A studio for code, so grand and so bright,
With prompts in .codestudio, all shiny and right,
Skills tucked in their place, paths registered well,
New adapter adapts—a development spell! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—adding Code Studio support as a new AI-powered coding agent to the system, which is the core objective reflected across all file changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Code-Studio-Team Code-Studio-Team marked this pull request as draft March 27, 2026 05:11
@Code-Studio-Team Code-Studio-Team marked this pull request as ready for review March 27, 2026 05:15
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/core/command-generation/adapters/codestudio.ts (1)

22-29: Add YAML escaping for the description field to prevent malformed files when descriptions contain special characters.

The description is inserted directly into YAML frontmatter without escaping. While some adapters (e.g., github-copilot, amazon-q) also don't escape this field, most other adapters in the codebase use escapeYamlValue() for all YAML fields, including pi, cursor, claude, and windsurf. If the description contains YAML special characters (colons, quotes, newlines), the generated .prompt.md file may be malformed.

♻️ Proposed fix
 import path from 'path';
-import type { CommandContent, ToolCommandAdapter } from '../types.js';
+import type { CommandContent, ToolCommandAdapter } from '../types.js';
+import { escapeYamlValue } from '../utils.js';
 
 export const codeStudioAdapter: ToolCommandAdapter = {
   toolId: 'codestudio',
 
   getFilePath(commandId: string): string {
     return path.join('.codestudio', 'prompts', `opsx-${commandId}.prompt.md`);
   },
 
   formatFile(content: CommandContent): string {
     return `---
-description: ${content.description}
+description: ${escapeYamlValue(content.description)}
 ---
 
 ${content.body}
 `;
   },
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/core/command-generation/adapters/codestudio.ts` around lines 22 - 29, The
YAML frontmatter uses raw content.description in formatFile (method formatFile,
type CommandContent) which can break YAML when it contains special characters;
update formatFile to pass the description through the existing escapeYamlValue
utility (e.g., use escapeYamlValue(content.description)) and use that escaped
string in the frontmatter, making sure to handle undefined/null descriptions
(fallback to an empty string) and import/require escapeYamlValue if not already
available.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/core/command-generation/adapters/codestudio.ts`:
- Around line 22-29: The YAML frontmatter uses raw content.description in
formatFile (method formatFile, type CommandContent) which can break YAML when it
contains special characters; update formatFile to pass the description through
the existing escapeYamlValue utility (e.g., use
escapeYamlValue(content.description)) and use that escaped string in the
frontmatter, making sure to handle undefined/null descriptions (fallback to an
empty string) and import/require escapeYamlValue if not already available.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9c003b6e-8988-4cc9-a022-9165cc1e41bf

📥 Commits

Reviewing files that changed from the base of the PR and between afdca0d and 6a00712.

📒 Files selected for processing (6)
  • docs/supported-tools.md
  • src/core/command-generation/adapters/codestudio.ts
  • src/core/command-generation/adapters/index.ts
  • src/core/command-generation/registry.ts
  • src/core/config.ts
  • test/core/command-generation/adapters.test.ts

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.

2 participants