feat: add support for code studio AI-powered coding agent#883
feat: add support for code studio AI-powered coding agent#883Code-Studio-Team wants to merge 4 commits intoFission-AI:mainfrom
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 WalkthroughWalkthroughA 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
🧹 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
descriptionis 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 useescapeYamlValue()for all YAML fields, includingpi,cursor,claude, andwindsurf. If the description contains YAML special characters (colons, quotes, newlines), the generated.prompt.mdfile 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
📒 Files selected for processing (6)
docs/supported-tools.mdsrc/core/command-generation/adapters/codestudio.tssrc/core/command-generation/adapters/index.tssrc/core/command-generation/registry.tssrc/core/config.tstest/core/command-generation/adapters.test.ts
This PR adds support for Code Studio, an AI-powered coding assistant.
Changes
src/core/command-generation/adapters/codestudio.ts): Generates.prompt.mdfiles for Code Studio with description frontmattercodeStudioAdapterAI_TOOLSwith.codestudioskills directory andcodestudiotool IDcodeStudioAdapterfollowing existing patternssupported-tools.mdwith Code Studio entryCode Studio Integration Details
Code Studio uses two mechanisms that OpenSpec supports:
.codestudio/skills/): Follows the Agent Skills standard - OpenSpec skills are installed here and invoked via/skill:openspec-*.codestudio/prompts/): Generated asopsx-{command}.prompt.mdfiles with description frontmatterThe implementation follows the same pattern as GitHub Copilot and Amazon Q adapters, using description-only YAML frontmatter.
Testing
All tests pass:
codeStudioAdapter.toolIdreturns'codestudio'getFilePath()returns.codestudio/prompts/opsx-{command}.prompt.mdformatFile()generates correct frontmatter formatUsage
After this PR, users can:
openspec init --tools codestudio # or interactively select Code StudioThen in Code Studio:
/skill:openspec-propose "my feature"to start a change proposal/opsx-propose "my feature"via prompt templatesSummary by CodeRabbit
New Features
Documentation
codestudioTests
Chores
Summary by CodeRabbit
New Features
Documentation
Tests