一键导入
coding-tools
Use external coding tools (Claude Code, Codex, Cursor) via invoke_coding_tool and coding_tool_apply to implement, debug, and refactor code
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use external coding tools (Claude Code, Codex, Cursor) via invoke_coding_tool and coding_tool_apply to implement, debug, and refactor code
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Feishu/Lark platform interaction via MCP - documents, tasks, calendar, Bitable, messaging
Use the Claude Code CLI for complex refactors, multi-file changes, and sustained codebase exploration
Use the OpenAI Codex CLI for quick fixes, targeted edits, and non-interactive automation
Use the Cursor CLI agent mode for IDE-integrated coding with project rules and repo-aware edits
Learn from experience — capture insights, organize knowledge, share reusable practices as skills, and refine your role over time
Design and create AI agent packages — manifest format, directory structure, file writing workflow
| name | coding-tools |
| description | Use external coding tools (Claude Code, Codex, Cursor) via invoke_coding_tool and coding_tool_apply to implement, debug, and refactor code |
Markus can delegate hands-on coding work to external CLI tools. You have two built-in tools for this workflow:
| Tool | Purpose |
|---|---|
invoke_coding_tool | Run Claude Code, Codex, or Cursor Agent against a repository with a prompt |
coding_tool_apply | Commit the changes produced by a coding tool session |
Use these when the task requires substantial code changes across multiple files, when you want a specialized coding agent to explore a codebase, or when direct editing would be slower or less reliable than delegating to a dedicated tool.
| Tool name | CLI binary | Best for |
|---|---|---|
claude-code | claude | Complex refactors, multi-file changes, deep exploration, architecture-level edits |
codex | codex | Quick fixes, targeted patches, scripted automation, fast iteration |
cursor-agent | cursor | IDE-heavy work, projects with .cursor/rules, repo-specific conventions |
Check availability with markus doctor before relying on a tool. If a tool is not installed, the handler returns an installHint.
Use external coding tools when:
Write code directly (file_edit, shell_execute) when:
Rule of thumb: If you would open an IDE and spend 15+ minutes navigating and editing, prefer invoke_coding_tool. If you can describe the exact diff in one paragraph, edit directly.
invoke_coding_tool({
tool: "claude-code", // or "codex" | "cursor-agent"
prompt: "<clear instruction>",
workdir: "/absolute/path/to/repo",
task_id: "<optional-task-id>" // injects task context when provided
})
Write prompts as if briefing a senior engineer who has never seen the ticket:
Keep prompts focused. One coding tool invocation = one coherent unit of work. Split large tasks into sequential invocations rather than one mega-prompt.
When you pass task_id, Markus fetches full task context (requirement, project, upstream/downstream dependencies) and injects it into the tool's working directory:
CLAUDE.md.cursor/rules/markus-task.mdc.agent_context/task_context.mdThe injected context also includes progress-reporting instructions for the Markus CLI. Always pass task_id when working on an assigned task.
The tool returns JSON:
{
"status": "success",
"sessionId": "...",
"tool": "claude-code",
"result": {
"success": true,
"summary": "...",
"diffStats": { "filesChanged": 3, "additions": 42, "deletions": 7 },
"modifiedFiles": ["src/foo.ts"],
"testResult": { "passed": 10, "failed": 0, "success": true }
},
"cost": { "estimatedCostUsd": 0.12, "inputTokens": 5000, "outputTokens": 1200 }
}
Always review before applying:
result.summary and modifiedFilesresult.testResult if presentgit diff via shell_execute in workdirinvoke_coding_tool call referencing what still needs fixingAfter reviewing and approving the tool's work:
coding_tool_apply({
session_id: "<sessionId from invoke_coding_tool>",
workdir: "/absolute/path/to/repo",
commit_message: "feat: implement user auth middleware"
})
This stages all changes and creates a git commit. If there are no changes, it returns success with filesChanged: 0.
Do not apply blindly. Verify tests pass and the diff matches expectations first.
| Scenario | Recommended tool | Why |
|---|---|---|
| Large refactor across packages | claude-code | Strong multi-turn reasoning, --max-turns 50, stream-json progress |
| One-file bug fix or typo | codex | Fast, exec --full-auto, minimal overhead |
Repo with .cursor/rules | cursor-agent | Reads project rules natively |
| Need cost/token visibility | claude-code | Reports tokens and USD in stream-json result events |
| Long-running exploratory task | claude-code | Best at sustained codebase navigation |
| CI/automation-friendly run | codex | Designed for non-interactive full-auto mode |
When unsure, start with claude-code for complexity and codex for speed. Switch tools if the first attempt stalls or produces poor results.
Keep the task board updated while coding tools run. Use shell_execute:
markus task progress <task-id> -t "Claude Code implementing auth middleware" --percent 40
markus task note <task-id> -t "Coding tool modified 3 files, running tests"
markus task context <task-id> # refresh full context if needed
Report progress at these milestones:
Coding tools also receive these CLI instructions in their injected context file when task_id is provided.
{ "error": "Claude Code is not installed. npm install -g @anthropic-ai/claude-code", "installHint": "..." }
Action: Try a different installed tool, or report the blocker via task note and escalate.
result.error and result.rawOutput (truncated)workdir (git status, git diff)Long tasks may hit configured timeoutMs. Split the work into smaller invocations with explicit checkpoints.
If coding_tool_apply fails (merge conflict, git error):
git status in workdirfile_editshell_execute if neededWhen result.testResult shows failures, do not apply. Re-invoke with:
The following tests failed: <output>. Fix the failures without changing unrelated code.
Before calling coding_tool_apply, verify ALL of the following:
result.testResult.success is true, or you have explicitly accepted known failures with justificationresult.modifiedFiles — no unexpected files were changedshell_execute before applyingIf any check fails, re-invoke with a targeted prompt referencing the specific issue rather than applying and fixing later.
1. Scope the work → write a clear prompt
2. invoke_coding_tool({ tool, prompt, workdir, task_id })
3. Review result (summary, diff, tests)
4. Iterate if needed (step 2 with refined prompt)
5. coding_tool_apply({ session_id, workdir, commit_message })
6. Report progress via markus task progress/note
7. Submit task for review
The invoke_coding_tool handler accepts per-invocation overrides:
invoke_coding_tool({
tool: "claude-code",
prompt: "...",
model: "opus", // optional: override the user's default model
mode: "plan", // optional: tool-specific execution mode
effort: "high", // optional: reasoning effort level
approved: true // required when approvalRequired is enabled for this tool
})
defaultModel in settings, respect it unless you have a specific reason to overrideMany tasks benefit from a multi-step approach:
invoke_coding_tool({ tool: "claude-code", mode: "plan", prompt: "Analyze the codebase and create an implementation plan for..." }) or invoke_coding_tool({ tool: "cursor-agent", mode: "plan", ... })mode override) using the plan output as contextmode: "ask" (Cursor) for targeted questionsIf a tool has approvalRequired: true, the handler returns an approval_required error. You must:
request_user_approval explaining what you want to do and whyapproved: trueVoluntarily request approval (even without approvalRequired) when:
Cost awareness is your responsibility as the agent. The UI provides enforceable controls (default model, budget cap for Claude Code, approval toggle), but strategic cost optimization is up to you.
cost.estimatedCostUsd (if available) and note it in progress updates| Tool | Cost data available? |
|---|---|
claude-code | Yes — tokens and USD in every result |
codex | Limited — no structured cost data from CLI |
cursor-agent | Limited — may include tokens in result events |
When cost data is unavailable, estimate by task duration and complexity. Report what you know.
For tool-specific details, activate the matching skill:
.cursor/rules, working directory setup, Auto vs Max ModeUse discover_tools({ name: ["claude-code"] }) to load a tool-specific skill before invoking that tool.
task_id for assigned tasksdefaultModel setting unless you have a clear reason to overridecursor, claude, codex) directly via shell_execute. Always use invoke_coding_tool — it handles binary resolution, argument building, context injection, streaming, cost tracking, and session management. Direct shell calls bypass all of this and will likely use wrong arguments.