Skip to content

Tool/kimi#1004

Closed
fkmatsuda wants to merge 9 commits into
Fission-AI:mainfrom
dynamicworks-com-br:tool/kimi
Closed

Tool/kimi#1004
fkmatsuda wants to merge 9 commits into
Fission-AI:mainfrom
dynamicworks-com-br:tool/kimi

Conversation

@fkmatsuda

@fkmatsuda fkmatsuda commented Apr 24, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features

    • Added tools management command to configure IDE and Code Agent integrations without re-initializing projects.
    • Added support for Kimi Code CLI as a supported AI tool integration.
  • Documentation

    • Portuguese (pt-BR) translation of full project documentation including concepts, workflows, commands, CLI reference, and migration guide.
    • Updated tool documentation to include Kimi Code CLI integration details.
  • Tests

    • Added comprehensive test coverage for tools management functionality and Kimi tool support.
  • Chores

    • Added Vitest coverage reporter dependency.
    • Updated code review language configuration to Portuguese.

Copilot AI and others added 9 commits April 23, 2026 11:56
Translate README.md, docs/installation.md, docs/multi-language.md,
and docs/supported-tools.md to Brazilian Portuguese.

- Created docs/pt-BR/ directory
- README.pt-BR.md: full translation with internal links updated to pt-BR paths
- docs/pt-BR/installation.md: translated installation guide
- docs/pt-BR/multi-language.md: translated multi-language guide
- docs/pt-BR/supported-tools.md: translated supported tools reference

Technical terms (API, CLI, JSON, YAML, npm, pnpm, yarn, bun, nix),
code blocks, commands, file paths, and URLs kept unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: fkmatsuda <9040193+fkmatsuda@users.noreply.github.com>
Links to untranslated files (getting-started, customization, workflows,
commands, cli) now use '../' to reference the English source files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: fkmatsuda <9040193+fkmatsuda@users.noreply.github.com>
…n Portuguese

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: fkmatsuda <9040193+fkmatsuda@users.noreply.github.com>
…ra-portugues

docs: tradução completa da documentação para português Brasil (pt-BR)
…Agent configurations

Agent-Logs-Url: https://github.com/fkmatsuda/BR-OpenSpec/sessions/dd2004d2-6bb8-4524-b78c-f74ec5ef1d4f

Co-authored-by: fkmatsuda <9040193+fkmatsuda@users.noreply.github.com>
…li-commands

feat: add `openspec tools` subcommand to manage IDE/Code Agent configurations
@fkmatsuda fkmatsuda requested a review from TabishB as a code owner April 24, 2026 01:28
Copilot AI review requested due to automatic review settings April 24, 2026 01:28
@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

Warning

Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories.

📝 Walkthrough

Walkthrough

This PR adds comprehensive Portuguese documentation for OpenSpec, introduces a new tools CLI command for managing IDE and Code Agent integrations post-initialization, adds support for Kimi Code CLI as a tool, refactors init cleanup logic into a dedicated tools-manager module, and adds Vitest coverage reporting to devDependencies. The changes span configuration, documentation, core tool management functionality, CLI integration, and test coverage.

Changes

Cohort / File(s) Summary
Configuration & Dependencies
.coderabbit.yaml, package.json
Updates review language configuration to Portuguese; adds Vitest coverage reporter package.
Documentation (English)
README.md, docs/cli.md, docs/commands.md, docs/supported-tools.md
Adds guidance for managing tool integrations via openspec tools command; documents Kimi Code CLI tool with skill-based command syntax; updates CLI tool ID enumeration.
Documentation (Portuguese)
docs/pt-BR/*
Introduces comprehensive Portuguese documentation including README, installation, getting-started, CLI reference, commands, concepts, customization, workflows, migration guide, OPSX workflow, supported tools, and multi-language artifact guidance.
Core Tool Management
src/core/config.ts, src/core/tools-manager.ts, src/core/is-project-initialized.ts
Adds Kimi Code CLI to supported tools; introduces tools-manager module exporting add/remove/query functions for managing tool artifacts; creates project initialization detection utility.
CLI Integration
src/cli/index.ts, src/commands/tools.ts
Registers new top-level tools command; implements interactive and non-interactive (--add/--remove flags) tool configuration with spinner-based progress and result reporting.
Init Refactoring
src/core/init.ts
Delegates workflow-specific skill directory and command file cleanup to tools-manager functions; removes inline workflow iteration and ALL_WORKFLOWS dependency.
Test Suite
test/commands/tools.test.ts, test/core/tools-manager.test.ts, test/core/available-tools.test.ts
Adds comprehensive test coverage for tools command (initialization guarding, add/remove semantics, error handling), tools-manager functions (artifact creation/removal, idempotency, current/eligible tool queries, argument parsing), and Kimi tool detection.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • TabishB

Poem

🐰 With Portuguese words and tools we weave,
A manager sleek for add/remove reprieve,
Kimi joins the fold with skill and might,
Tests bloom bright—integration takes flight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Tool/kimi' is vague and uses non-descriptive naming conventions without conveying the actual changeset purpose. Revise the title to clearly describe the main change, such as 'Add Kimi Code CLI integration' or 'Support Kimi tool with IDE command artifacts'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds first-class support for the Kimi tool integration and introduces a new openspec tools command for adding/removing generated tool configuration artifacts after initialization, alongside broader documentation updates (including new pt-BR docs).

Changes:

  • Add kimi to the supported tool registry and tool auto-detection.
  • Introduce src/core/tools-manager.ts plus a new openspec tools command (interactive + non-interactive add/remove).
  • Add/refresh documentation (supported tools + extensive pt-BR docs) and enable Vitest V8 coverage dependency.

Reviewed changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/core/tools-manager.test.ts New unit tests for add/remove/query behavior in tools-manager
test/core/available-tools.test.ts Adds coverage for detecting .kimi as an available tool
test/commands/tools.test.ts New tests for the openspec tools command behavior
src/core/tools-manager.ts New core API for adding/removing skill + command artifacts and resolving tool args
src/core/is-project-initialized.ts New helper used to guard openspec tools execution
src/core/init.ts Refactors removal helpers to call tools-manager shared removal functions
src/core/config.ts Registers the new kimi tool entry
src/commands/tools.ts Implements the openspec tools CLI command (interactive + flags)
src/cli/index.ts Registers the new tools command in the CLI
pnpm-lock.yaml Locks new dependency graph (incl. coverage-v8)
package.json Adds @vitest/coverage-v8 dev dependency
docs/supported-tools.md Documents kimi support and tool ID list update
docs/pt-BR/workflows.md New pt-BR workflows documentation
docs/pt-BR/supported-tools.md New pt-BR supported tools documentation (incl. kimi)
docs/pt-BR/opsx.md New pt-BR OPSX overview
docs/pt-BR/multi-language.md New pt-BR multi-language guide
docs/pt-BR/migration-guide.md New pt-BR migration guide
docs/pt-BR/installation.md New pt-BR installation guide
docs/pt-BR/getting-started.md New pt-BR getting started guide
docs/pt-BR/customization.md New pt-BR customization guide
docs/pt-BR/concepts.md New pt-BR concepts guide
docs/pt-BR/commands.md New pt-BR commands reference
docs/pt-BR/cli.md New pt-BR CLI reference
docs/commands.md Adds Kimi invocation syntax note
docs/cli.md Adds kimi to supported tool IDs list
README.pt-BR.md New pt-BR README including openspec tools usage
README.md Documents openspec tools usage
.coderabbit.yaml Switches CodeRabbit review language to pt-BR
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to +17
* OpenSpec (i.e., `openspec/config.yaml` or `openspec/config.yml` exists).
*/
export function isProjectInitialized(projectPath: string): boolean {
const base = path.join(projectPath, 'openspec');
return (

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

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

isProjectInitialized() currently treats a project as initialized only if openspec/config.yaml or openspec/config.yml exists. However, InitCommand.createConfig() can intentionally skip creating config files in non-interactive mode (and openspec update considers the project initialized as long as the openspec/ directory exists). This makes openspec tools unusable for valid initialized projects that don't have a config file. Consider checking for openspec/ (and/or expected subdirs like openspec/specs / openspec/changes) instead of requiring a config file, or align the logic with the update command's initialization check.

Suggested change
* OpenSpec (i.e., `openspec/config.yaml` or `openspec/config.yml` exists).
*/
export function isProjectInitialized(projectPath: string): boolean {
const base = path.join(projectPath, 'openspec');
return (
* OpenSpec. A project is considered initialized if the `openspec/`
* directory exists, including cases where config files were intentionally
* not created.
*/
export function isProjectInitialized(projectPath: string): boolean {
const base = path.join(projectPath, 'openspec');
return (
existsSync(base) ||

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +129
// testDir has no openspec/config.yaml
const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(1);
});

it('proceeds when project is initialized (openspec/config.yaml exists)', async () => {
await fs.mkdir(path.join(testDir, 'openspec'), { recursive: true });
await fs.writeFile(path.join(testDir, 'openspec', 'config.yaml'), 'schema: spec-driven\n');

const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(0);
});

it('also accepts openspec/config.yml', async () => {
await fs.mkdir(path.join(testDir, 'openspec'), { recursive: true });
await fs.writeFile(path.join(testDir, 'openspec', 'config.yml'), 'schema: spec-driven\n');

const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(0);
});

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

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

These tests encode that a project is “initialized” only when openspec/config.yaml exists. The init flow can skip config creation in non-interactive mode, and other commands (e.g. update) use the presence of the openspec/ directory instead. If the initialization guard is adjusted to match actual initialization semantics, these assertions will need to be updated (e.g. create openspec/ + minimal expected structure rather than only config files).

Suggested change
// testDir has no openspec/config.yaml
const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(1);
});
it('proceeds when project is initialized (openspec/config.yaml exists)', async () => {
await fs.mkdir(path.join(testDir, 'openspec'), { recursive: true });
await fs.writeFile(path.join(testDir, 'openspec', 'config.yaml'), 'schema: spec-driven\n');
const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(0);
});
it('also accepts openspec/config.yml', async () => {
await fs.mkdir(path.join(testDir, 'openspec'), { recursive: true });
await fs.writeFile(path.join(testDir, 'openspec', 'config.yml'), 'schema: spec-driven\n');
const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(0);
});
// testDir has no openspec directory
const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(1);
});
it('proceeds when project is initialized (openspec directory exists)', async () => {
await fs.mkdir(path.join(testDir, 'openspec'), { recursive: true });
const result = await runToolsCommand(['--add', 'claude', testDir], testDir);
expect(result.exitCode).toBe(0);
});

Copilot uses AI. Check for mistakes.
Comment thread src/core/tools-manager.ts
Comment on lines +200 to +208
/**
* Returns the IDs of all tools that are currently configured in the project.
*/
export function getCurrentToolIds(projectPath: string): Set<string> {
const toolStates: Map<string, ToolSkillStatus> = getToolStates(projectPath);
const configured = new Set<string>();
for (const [toolId, status] of toolStates) {
if (status.configured) configured.add(toolId);
}

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

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

getCurrentToolIds() relies on getToolStates() which only checks for configured skills. In delivery: commands mode (or if a project has only command files present), tools can be configured without any skills, but they’ll be treated as unconfigured here. That makes the interactive openspec tools checklist inaccurate and can prevent removals via interactive mode. Consider basing “configured” on either skills or commands (e.g., reuse getConfiguredToolsForProfileSync() / getCommandConfiguredTools() from profile-sync-drift.ts).

Suggested change
/**
* Returns the IDs of all tools that are currently configured in the project.
*/
export function getCurrentToolIds(projectPath: string): Set<string> {
const toolStates: Map<string, ToolSkillStatus> = getToolStates(projectPath);
const configured = new Set<string>();
for (const [toolId, status] of toolStates) {
if (status.configured) configured.add(toolId);
}
function getExpectedCommandNames(): Set<string> {
return new Set(
Object.keys(WORKFLOW_TO_SKILL_DIR).map((workflowId) =>
transformToHyphenCommands(workflowId)
)
);
}
function hasConfiguredCommands(projectPath: string, tool: AIToolOption): boolean {
if (!tool.skillsDir) {
return false;
}
const toolRoot = path.join(projectPath, tool.skillsDir);
if (!fs.existsSync(toolRoot) || !fs.statSync(toolRoot).isDirectory()) {
return false;
}
const expectedCommandNames = getExpectedCommandNames();
const stack: string[] = [toolRoot];
while (stack.length > 0) {
const currentDir = stack.pop();
if (!currentDir) {
continue;
}
for (const entry of fs.readdirSync(currentDir, { withFileTypes: true })) {
if (entry.name === 'skills') {
continue;
}
const entryPath = path.join(currentDir, entry.name);
if (entry.isDirectory()) {
stack.push(entryPath);
continue;
}
const basename = path.parse(entry.name).name;
if (expectedCommandNames.has(basename)) {
return true;
}
}
}
return false;
}
/**
* Returns the IDs of all tools that are currently configured in the project.
*/
export function getCurrentToolIds(projectPath: string): Set<string> {
const toolStates: Map<string, ToolSkillStatus> = getToolStates(projectPath);
const configured = new Set<string>();
for (const tool of AI_TOOLS) {
const status = toolStates.get(tool.value);
if (status?.configured || hasConfiguredCommands(projectPath, tool)) {
configured.add(tool.value);
}
}

Copilot uses AI. Check for mistakes.
Comment thread src/core/tools-manager.ts
Comment on lines +30 to +48

const require = createRequire(import.meta.url);
const { version: OPENSPEC_VERSION } = require('../../package.json');

// Map from workflow ID to the skill directory name it uses
const WORKFLOW_TO_SKILL_DIR: Record<string, string> = {
explore: 'openspec-explore',
new: 'openspec-new-change',
continue: 'openspec-continue-change',
apply: 'openspec-apply-change',
ff: 'openspec-ff-change',
sync: 'openspec-sync-specs',
archive: 'openspec-archive-change',
'bulk-archive': 'openspec-bulk-archive-change',
verify: 'openspec-verify-change',
onboard: 'openspec-onboard',
propose: 'openspec-propose',
};

Copilot AI Apr 24, 2026

Copy link

Choose a reason for hiding this comment

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

WORKFLOW_TO_SKILL_DIR is duplicated here, but a typed canonical mapping already exists in src/core/profile-sync-drift.ts and is used elsewhere (migration/update). To avoid future drift when workflows are added/renamed, consider importing/reusing the shared WORKFLOW_TO_SKILL_DIR (or deriving from the existing shared skill constants) instead of maintaining another copy.

Suggested change
const require = createRequire(import.meta.url);
const { version: OPENSPEC_VERSION } = require('../../package.json');
// Map from workflow ID to the skill directory name it uses
const WORKFLOW_TO_SKILL_DIR: Record<string, string> = {
explore: 'openspec-explore',
new: 'openspec-new-change',
continue: 'openspec-continue-change',
apply: 'openspec-apply-change',
ff: 'openspec-ff-change',
sync: 'openspec-sync-specs',
archive: 'openspec-archive-change',
'bulk-archive': 'openspec-bulk-archive-change',
verify: 'openspec-verify-change',
onboard: 'openspec-onboard',
propose: 'openspec-propose',
};
import { WORKFLOW_TO_SKILL_DIR } from './profile-sync-drift.js';
const require = createRequire(import.meta.url);
const { version: OPENSPEC_VERSION } = require('../../package.json');

Copilot uses AI. Check for mistakes.
@fkmatsuda fkmatsuda closed this Apr 24, 2026
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.

3 participants