Skip to content

feat(core): add Lingma IDE support#669

Open
caohuanglin wants to merge 4 commits intoFission-AI:mainfrom
caohuanglin:feature/lingma-ide-support
Open

feat(core): add Lingma IDE support#669
caohuanglin wants to merge 4 commits intoFission-AI:mainfrom
caohuanglin:feature/lingma-ide-support

Conversation

@caohuanglin
Copy link

@caohuanglin caohuanglin commented Feb 5, 2026

PR Description

Summary

Added Lingma IDE support to OpenSpec. Lingma IDE is an Alibaba product with millions of users in China. It recently added skills and slash command support, making OpenSpec integration essential to serve this large user base with structured AI-assisted development workflows. Official website:https://lingma.aliyun.com/

Changes

  • Added lingma.ts command adapter with proper file path structure (.lingma/commands/opsx-<id>.md)
  • Updated registry to include Lingma adapter
  • Added Lingma to legacy cleanup patterns
  • Created comprehensive tests covering all adapter functionality
  • Updated documentation in supported-tools.md

Key Features

  • Generates 10 command files with YAML frontmatter format
  • Creates proper skill directory structure
  • Supports all standard OPSX workflow commands
  • Cross-platform path handling

Generated with Qwen using Lingma IDE

Summary by CodeRabbit

  • New Features

    • Lingma is now available as a supported tool in OpenSpec for command generation and skill management.
  • Documentation

    • CLI docs and tool reference updated to list Lingma and include it in non-interactive setup examples.
  • Tests

    • Added test coverage to validate Lingma adapter behavior and cross-platform path handling.

@caohuanglin caohuanglin requested a review from TabishB as a code owner February 5, 2026 19:18
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Adds first-class support for the Lingma tool: new command adapter, adapter export and registry registration, AI_TOOLS config entry, docs updates, and tests covering file path and Markdown/YAML formatting.

Changes

Cohort / File(s) Summary
New Lingma Adapter
src/core/command-generation/adapters/lingma.ts
Implements lingmaAdapter: ToolCommandAdapter with toolId: 'lingma', getFilePath producing .lingma/commands/opsx/<id>.md, and formatFile emitting Markdown with YAML frontmatter (name, description, category, tags) plus body.
Adapter Export & Registry
src/core/command-generation/adapters/index.ts, src/core/command-generation/registry.ts
Exports lingmaAdapter from adapters index and registers it in CommandAdapterRegistry static initializer.
Configuration
src/core/config.ts
Adds { name: 'Lingma', value: 'lingma', available: true, successLabel: 'Lingma', skillsDir: '.lingma' } to AI_TOOLS.
Documentation
docs/supported-tools.md, docs/cli.md
Adds Lingma to supported-tools reference and CLI docs; documents skills and commands paths and includes lingma in available tool IDs.
Tests
test/core/command-generation/adapters.test.ts
Adds tests for lingmaAdapter: validates toolId, file path generation for multiple commands, YAML frontmatter fields and tags, and includes Lingma in cross-platform path checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • TabishB

Poem

🐰 I hopped in bytes and chewed the log,
Lingma seeds sown under opsx bog.
YAML tidings, tags in line,
Registry hums — a tool divine.
Hop, push, commit — the garden's fine! 🥕✨

🚥 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 'feat(core): add Lingma IDE support' directly and clearly summarizes the main change: adding support for the Lingma IDE tool to the OpenSpec core functionality.
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
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


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.

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.

@caohuanglin
Copy link
Author

image As shown in the screenshot, the commands can be successfully triggered.

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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/core/legacy-cleanup.ts`:
- Line 36: Remove the mistaken legacy-cleanup entry for 'lingma' that points to
'.lingma/commands/opsx' so live Lingma output isn't deleted; specifically delete
the mapping with key 'lingma' in the legacy-cleanup registry (the entry
"'lingma': { type: 'directory', path: '.lingma/commands/opsx' }") so
detectLegacySlashCommands and cleanupLegacyArtifacts no longer treat the current
Lingma adapter output (see adapters/lingma.ts) as a legacy path.
🧹 Nitpick comments (1)
src/core/command-generation/adapters/lingma.ts (1)

22-32: Align YAML value escaping with windsurf and claude adapters.

The lingma adapter leaves YAML values unquoted, which fails if name, description, category, or tags contain special characters (:, #, [, {, etc.). Other adapters in this codebase—specifically windsurf and claude—already implement escapeYamlValue() for defensive YAML formatting. Adopt the same pattern here for consistency and robustness.

Example using escapeYamlValue pattern
+/**
+ * Escapes YAML special characters in scalar values.
+ */
+function escapeYamlValue(value: string): string {
+  if (/[:#\[\]{},&*!'"|>@`]|^[-?]/.test(value)) {
+    return `"${value.replace(/"/g, '\\"')}"`;
+  }
+  return value;
+}
+
+/**
+ * Formats a tags array as a YAML array with proper escaping.
+ */
+function formatTagsArray(tags: string[]): string {
+  const escapedTags = tags.map((tag) => escapeYamlValue(tag));
+  return `[${escapedTags.join(', ')}]`;
+}
+
 export const lingmaAdapter: ToolCommandAdapter = {
   toolId: 'lingma',
 
   getFilePath(commandId: string): string {
     return path.join('.lingma', 'commands', 'opsx', `${commandId}.md`);
   },
 
   formatFile(content: CommandContent): string {
-    const tagsStr = content.tags.join(', ');
     return `---
-name: ${content.name}
-description: ${content.description}
-category: ${content.category}
-tags: [${tagsStr}]
+name: ${escapeYamlValue(content.name)}
+description: ${escapeYamlValue(content.description)}
+category: ${escapeYamlValue(content.category)}
+tags: ${formatTagsArray(content.tags)}
 ---
 
 ${content.body}`;
   },
 };

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.

1 participant