Skip to content

feat(plugins): add official OpenSpec plugin for spec-driven development#1498

Open
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:auto-pr-temp-20260708-1800
Open

feat(plugins): add official OpenSpec plugin for spec-driven development#1498
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:auto-pr-temp-20260708-1800

Conversation

@bj456736

@bj456736 bj456736 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Add kimi-openspec official plugin that integrates Fission-AI OpenSpec CLI into Kimi Code via MCP stdio transport.

Resolves discussion #927: Native OpenSpec & Spec-Kit Integration

Features

  • 11 OpenSpec tools: init, new_change, list, show, status, validate, archive, update, instructions, read_file, refresh_cache
  • Built-in prompt: openspec_kickoff for spec-driven workflow initialization
  • In-memory cache: of openspec/ directory for fast listing operations
  • Direct file reading: via read_file to bypass CLI subprocess overhead
  • Auto-install: @fission-ai/openspec via npx --yes

Architecture

The plugin is a self-contained MCP server (bin/kimi-openspec.mjs) that:

  1. Wraps the @fission-ai/openspec CLI commands
  2. Maintains an in-memory cache of openspec/changes/ and openspec/specs/ directories
  3. Provides direct file reading via openspec_read_file
  4. Exposes a built-in openspec_kickoff prompt

Files Added

  • plugins/official/kimi-openspec/kimi.plugin.json
  • plugins/official/kimi-openspec/SKILL.md
  • plugins/official/kimi-openspec/bin/kimi-openspec.mjs
  • plugins/marketplace.json (registered as official plugin)

Testing

Verified locally with test MCP client:

  • openspec_init initializes project correctly
  • openspec_new_change creates change scaffolding
  • openspec_list returns cached entries after mutation
  • openspec_status returns detailed artifact completion
  • openspec_read_file reads artifacts directly
  • prompts/get openspec_kickoff returns workflow prompt

Checklist

  • Plugin follows official plugin structure
  • Self-contained (no workspace dependencies)
  • Uses JSON-RPC 2.0 over stdio per MCP spec
  • Registered in plugins/marketplace.json
  • Local testing passed
  • Documentation complete

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8d2eb73

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@8d2eb73
npx https://pkg.pr.new/@moonshot-ai/kimi-code@8d2eb73

commit: 8d2eb73

Add kimi-openspec official plugin that integrates Fission-AI OpenSpec CLI
into Kimi Code via MCP stdio transport.

Features:
- 11 OpenSpec tools: init, new_change, list, show, status, validate,
  archive, update, instructions, read_file, refresh_cache
- Built-in openspec_kickoff prompt for spec-driven workflow initialization
- In-memory cache of openspec/ directory for fast listing operations
- Direct file reading via read_file to bypass CLI subprocess overhead
- Auto-installs @fission-ai/openspec via npx --yes

The plugin is registered in plugins/marketplace.json as an official plugin.

Closes discussion MoonshotAI#927
@bj456736 bj456736 force-pushed the auto-pr-temp-20260708-1800 branch from d400a4d to 8d2eb73 Compare July 8, 2026 10:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d400a4dd2c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@@ -0,0 +1,17 @@
{
"id": "kimi-openspec",
"name": "OpenSpec",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use a valid Kimi plugin manifest

The plugin parser treats name as the plugin id and requires it to match the lowercase plugin-name regex; this OpenSpec value makes parseManifest() reject the manifest, so installing the marketplace entry fails before any MCP server or skill can load. The display label belongs in interface.displayName, and the executable should be declared through mcpServers rather than the unsupported entry shape below.

Useful? React with 👍 / 👎.

const args = params?.arguments ?? {};

const runOpenSpec = async (callArgs) => {
const cmd = `${OPENSPEC_CMD} ${callArgs.join(' ')}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid building OpenSpec commands through the shell

For any tool call where name, description, changeName, or similar arguments come from the model/user, a value containing shell syntax can break out of the ad-hoc quotes and execute arbitrary commands inside this exec invocation. Build the command as an argv array with execFile/spawn (for example npx, --yes, @fission-ai/openspec, ...args) instead of concatenating shell text.

Useful? React with 👍 / 👎.


async function start() {
const args = process.argv.slice(2);
const projectPath = args[0] || process.cwd();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass the user workspace into the MCP server

When Kimi launches plugin MCP servers, the plugin manager sets the process cwd to the installed plugin root, and this server falls back to process.cwd() unless an explicit path argument is provided. Since the plugin manifest does not pass the session workspace, openspec_init, openspec_new_change, and the cache/list/read operations will act on the managed plugin directory instead of the user's repository.

Useful? React with 👍 / 👎.

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