Skip to content

feat: init:agent command to set up MCP and skills for coding agents - #5735

Open
DavertMik wants to merge 3 commits into
4.xfrom
feat/init-agent
Open

DavertMik wants to merge 3 commits into
4.xfrom
feat/init-agent

Conversation

@DavertMik

@DavertMik DavertMik commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds npx codeceptjs init:agent [agent] (alias init-agent). It registers the CodeceptJS MCP server and installs the CodeceptJS skills for a coding agent, using the agent's own commands where it has them.

Base branch is 4.x: the MCP server and agent docs exist only there.

npx codeceptjs init:agent              # pick from a list
npx codeceptjs init:agent claude       # claude | codex | cursor | opencode
npx codeceptjs init --agent claude     # full init, then agent setup

What each agent gets

Agent MCP Skills
claude claude mcp add codeceptjs -- npx codeceptjs-mcp npx skills add codeceptjs/skills -a claude-code -y
codex codex mcp add codeceptjs -- npx codeceptjs-mcp npx skills add codeceptjs/skills -a codex -y
cursor adds mcpServers.codeceptjs to .cursor/mcp.json npx skills add codeceptjs/skills -a cursor -y
opencode adds mcp.codeceptjs to opencode.json npx skills add codeceptjs/skills -a opencode -y
  • Commands run with execSync. If one fails, the error and the command to run by hand are printed, and setup continues.
  • Cursor/OpenCode files keep their other keys. A file that isn't valid JSON is left untouched and the entry to add is printed.
  • init gets --agent <name> and ends with "Set up an AI coding agent?" (default none). With -y and no --agent it's skipped.
  • Docs: docs/agents.md leads with init:agent, manual steps moved under "Manual setup"; docs/mcp.md and docs/commands.md mention it.

Test plan

  • test/unit/command/initAgent_test.js: fake claude/codex/npx binaries on PATH record their arguments. Covers claude and codex commands, skills still installed when MCP fails, cursor/opencode merge, same file on second run, invalid JSON untouched, unknown agent and -y without agent.
  • npx mocha test/unit/command: 34 passing
  • eslint and prettier clean on the new files

🤖 Generated with Claude Code

DavertMik and others added 2 commits October 6, 2026 01:42
`npx codeceptjs init:agent [claude|codex|cursor|opencode]` registers the
CodeceptJS MCP server and installs CodeceptJS skills for the chosen agent.
Claude and Codex use their own `mcp add` commands; Cursor and OpenCode get
their project MCP file merged. `init` gains `--agent` and a final prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One agents table and execSync with the agents' own commands. Drop the
runner injection, CLI detection, mcp get check and CODECEPTJS_CONFIG
handling. Tests use fake binaries on PATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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