Feat/markdown agent format#1267
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds Markdown (.md) support for custom mode files by extracting YAML frontmatter and using the Markdown body as the system prompt; introduces kebabCase and a frontmatter parser, includes .md in file discovery, derives missing slugs/icons, and adds an optional ChangesMarkdown Mode Support
Sequence DiagramsequenceDiagram
participant FileSystem
participant loadCustomModes
participant parseMarkdownFrontmatter
participant CCBMode
FileSystem->>loadCustomModes: discover .md/.yml/.yaml files
alt Markdown file
loadCustomModes->>parseMarkdownFrontmatter: extract YAML frontmatter and Markdown body
parseMarkdownFrontmatter->>loadCustomModes: return frontmatter + body
loadCustomModes->>CCBMode: merge frontmatter, set system_prompt from body, derive slug, default icon
else YAML file
loadCustomModes->>CCBMode: parse YAML directly
end
CCBMode->>loadCustomModes: custom mode object
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
493e69f to
bcc2907
Compare
…de loader Extends the mode loader to accept .md files alongside .yaml/.yml in ~/.claude/modes/. Markdown files use YAML frontmatter for metadata and the body as systemPrompt — the same format supported by OpenCode, Claude Code agents, and Cursor rules. .md data is normalized to the same shape as .yaml data, reusing the existing CCBMode mapping with zero code duplication. - Add kebabCase() helper for slug derivation from name - Add parseMarkdownFrontmatter() helper (uses existing yaml package) - .md: body → system_prompt, auto-slug if missing, icon default 🤖 - Add optional model field to CCBMode for cross-tool alignment - Existing .yaml/.yml path: unchanged
bcc2907 to
1f44e2b
Compare
Summary
支持在 ~/.claude/modes/ 目录下使用 Markdown + YAML frontmatter 格式
定义自定义 Mode,与 OpenCode / Cursor / Codex 等工具的 Agent 定义格式
完全统一。
Motivation
社区反馈:当前 Mode 使用 CCP 专有 YAML 格式,而 OpenCode 和 Claude Code
的 Agent/SKILL.md 都使用 --- YAML frontmatter + Markdown body 的通用格式。
统一后同一份 claude.md 可在多个工具间零修改迁移。
Changes
src/modes/store.ts — 仅一个文件,+34 / -3:
Usage
name: Claude
description: Anthropic's Claude persona
Character
You have a genuine, stable character...
激活: /mode claude 或 settings.json 中 "ccbMode": "claude"
Summary by CodeRabbit