ワンクリックで
cursor-agent
Use the Cursor CLI agent mode for IDE-integrated coding with project rules and repo-aware edits
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use the Cursor CLI agent mode for IDE-integrated coding with project rules and repo-aware edits
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 external coding tools (Claude Code, Codex, Cursor) via invoke_coding_tool and coding_tool_apply to implement, debug, and refactor code
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 | cursor-agent |
| description | Use the Cursor CLI agent mode for IDE-integrated coding with project rules and repo-aware edits |
Cursor Agent (cursor binary) runs the Cursor IDE's agent mode from the command line. Markus invokes it via invoke_coding_tool({ tool: "cursor-agent", ... }). Use it when the project has Cursor-specific configuration (.cursor/rules) or when IDE-integrated, project-aware editing is the best fit.
Install Cursor from https://cursor.sh, then enable the shell command:
cursor --versionCheck availability with markus doctor. Requires authentication via cursor agent login (browser-based) or CURSOR_API_KEY env var.
Markus runs Cursor in CLI agent mode:
cursor agent --print --output-format stream-json --workspace <workdir> --trust --force "<prompt>"
| Flag | Purpose |
|---|---|
--print | Non-interactive mode |
--output-format stream-json | Emits structured JSON events for progress parsing |
--workspace <workdir> | Specifies the repo root for project context |
--trust --force | Auto-trusts the workspace without interactive prompts |
Additional args can be configured via CodingToolConfig.defaultArgs.
Cursor projects use .cursor/rules/ for persistent agent instructions. Rule files (.mdc or .md) define:
Cursor Agent reads these rules automatically when operating in a project directory. Well-maintained rules significantly improve output quality.
When you pass task_id to invoke_coding_tool, Markus writes task-specific context to:
.cursor/rules/markus-task.mdc
This file contains the full Markus task context (title, description, subtasks, dependencies, progress-reporting CLI commands). It sits alongside your project's permanent rules and takes effect for the coding session.
Important:
.cursor/rules/ directory if it doesn't existmarkus-task.mdc file is regenerated each invocation — do not store permanent rules therecoding-standards.mdc, architecture.mdc).cursor/rules/
├── coding-standards.mdc # permanent — naming, formatting, test requirements
├── architecture.mdc # permanent — module boundaries, patterns
└── markus-task.mdc # ephemeral — injected by Markus per task
The workdir parameter is critical for Cursor Agent:
Always pass the absolute path to the git repository root as workdir:
workdir: "/Users/agent/projects/my-app"
Cursor Agent resolves .cursor/rules/ relative to this directory. Pointing at a subdirectory may cause rules to be missed.
If the task spans multiple repositories, invoke Cursor Agent once per repository with repo-specific prompts:
invoke_coding_tool({
tool: "cursor-agent",
prompt: "Implement the API client changes described in the task context.",
workdir: "/path/to/backend-repo",
task_id: "task-789"
})
Ensure the working directory is a clean git checkout (or at least understand existing uncommitted changes). Cursor Agent edits files in-place. Review with git status and git diff before applying.
Markus injects these env vars during context injection:
| Variable | Purpose |
|---|---|
MARKUS_API_URL | API server for task operations |
MARKUS_TASK_ID | Current task ID |
MARKUS_CLI | Path to the markus CLI binary |
Cursor Agent subprocesses can use these if the injected context references CLI commands for progress reporting.
invoke_coding_tool({
tool: "cursor-agent",
prompt: "Implement the user settings page following the patterns in .cursor/rules/frontend.mdc. Use existing component library imports. Add unit tests.",
workdir: "/path/to/frontend-repo",
task_id: "task-789"
})
invoke_coding_tool({
tool: "cursor-agent",
prompt: "Migrate all API routes in src/routes/ to the new error-handling pattern defined in .cursor/rules/api-conventions.mdc. Update tests accordingly.",
workdir: "/path/to/repo",
task_id: "task-789"
})
invoke_coding_tool({
tool: "cursor-agent",
prompt: "Add the coding-tools skill templates under templates/skills/. Follow the existing skill.json + SKILL.md pattern from templates/skills/self-evolution/.",
workdir: "/path/to/markus-monorepo",
task_id: "task-789"
})
Cursor Agent supports per-invocation model and mode overrides:
invoke_coding_tool({
tool: "cursor-agent",
prompt: "...",
model: "auto", // optional: CLI-specific model (auto, composer-2.5, etc.)
mode: "plan", // optional: plan | ask
})
The Cursor agent CLI only accepts a limited set of CLI-specific model identifiers: auto, composer-2.5, etc. Cursor Cloud API models (Claude, GPT families) are not available via the CLI — they only work via the REST API.
The Settings UI only shows CLI-compatible models to prevent selection errors.
Not specifying --model uses Auto mode — this is unlimited on paid Cursor plans and very cheap (or free). The moment you specify a model name, Cursor enters Max Mode, which bills per-token from the monthly credit pool.
| Mode | Cost | When to use |
|---|---|---|
Auto (no --model) | Free / unlimited on paid plans | Default for most tasks |
Max Mode (explicit --model) | Per-token billing, varies by model | Only when task needs specific model capabilities |
Warning: Opus in Max Mode consumes credits approximately 20x faster than Auto mode. Only specify --model when the task genuinely needs a specific model's capabilities. For most tasks, Auto mode is the correct and cost-effective choice.
plan — Analyze architecture first, don't make changes yet. Good as a first step for complex tasks.ask — Answer questions about the codebase without making changes.For complex tasks:
mode: "plan" — "Analyze the codebase and propose an implementation plan for..."mode: "ask" — "Review the changes and identify any issues"request_user_approval before specifying expensive models (Opus) since it enables Max Mode billing| Choose Cursor Agent | Choose something else |
|---|---|
Project has rich .cursor/rules/ | No Cursor config, generic repo → claude-code |
| Team standardized on Cursor conventions | Need stream-json cost tracking → claude-code |
| IDE-style project-aware edits | Quick one-file fix → codex |
| Frontend/UI work with component rules | Deep backend exploration → claude-code |
Cursor Agent may include some token data in result events. Evaluate results by:
result.success and result.summaryresult.modifiedFiles — do they match expected scope?result.testResult from quality verificationgit diff review in workdirIf Cursor Agent ignores project rules, verify:
workdir points to the repo root (where .cursor/rules/ lives).mdc format and are not emptyIf output quality is poor after 2 attempts, switch to claude-code with equivalent prompt and CLAUDE.md context.
.cursor/rules/ with clear, actionable project conventionsworkdirtask_id so markus-task.mdc carries task contextUse Cursor Agent modes strategically:
invoke_coding_tool({ tool: "cursor-agent", mode: "plan", prompt: "..." }) — analyze before implementinginvoke_coding_tool({ tool: "cursor-agent", mode: "ask", prompt: "..." }) — targeted questions about the codebaseFor complex tasks, always plan first. Review the plan before proceeding to implementation.
Cursor Agent reads .cursor/rules/ automatically. When task_id is provided, Markus injects task context into .cursor/rules/markus-task.mdc. This means Cursor Agent automatically understands:
workdirmarkus-task.mdc--model) for cost savingsmarkus-task.mdc--model by default — it triggers Max Mode billing