matdev83/hermes-cursor-dispatcher/cursor-delegate

Claude Code and agent skill by matdev83/hermes-cursor-dispatcher

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when delegating repository-level coding, debugging, refactoring, or implementation work to the installed Cursor CLI (`agent`). Safely transfers exact UTF-8 prompts through a Python wrapper, prefers isolated Git worktrees, captures a structured result, and requires Hermes to inspect diffs and run validation independently before acceptance. Integrates natively with the newest Grok models.

Install

npx vskill@latest install matdev83/hermes-cursor-dispatcher/cursor-delegate

SKILL.md

The same SKILL.md was published earlier as matdev83/hermes-cursor-dispatcher/cursor-delegate.

Cursor CLI Delegation

Overview

Use Cursor CLI as an external implementation executor, never as a source of truth. Hermes owns task construction, workspace selection, safe invocation, diff review, independent tests, corrective iterations, and the final acceptance decision.

The bundled wrapper is scripts/cursor_delegate.py; invoke it as ${HERMES_SKILL_DIR}/scripts/cursor_delegate.py. It reads an exact UTF-8 prompt from a file and sends it to Cursor through stdin without shell interpretation. Stdin transport was verified against Cursor CLI agent; this avoids Linux's per-argument size limit while preserving multiline prompts and shell metacharacters. The wrapper invokes agent with shell=False, explicit cwd, a narrowly allowlisted environment, a timeout, and an isolated process group. Dedicated drain threads retain bounded tails and bounded mode-0600 log prefixes; exceeding either output limit terminates the Cursor process group.

Never invoke Cursor by interpolating arbitrary prompt text into a shell command. Never use eval, shell=True, an environment variable as prompt transport, echo, or an unquoted heredoc.

When to Use

Use for:

  • non-trivial implementation, debugging, migration, or refactoring tasks;
  • repository changes where a second coding executor is useful;
  • tasks with large Markdown prompts, code blocks, structured data, or shell syntax;
  • independent implementation attempts in isolated Git worktrees.

Do not use for:

  • a one-line local edit Hermes can safely make and verify directly;
  • operations outside a clearly selected workspace;
  • prompts containing secret values;
  • arbitrary MCP access or implicit privilege escalation;
  • accepting Cursor's report without inspecting its actual changes.

Installed CLI Contract

Before relying on the wrapper in a changed environment, run:

bash
agent --help
agent --version

The version verified when this skill was authored supports:

  • executable: agent;
  • headless mode: --print;
  • output formats: text, json, stream-json;
  • read-only modes: --mode plan and --mode ask;
  • edit mode: the default (there is no --mode edit Cursor flag);
  • workspace selection: --workspace <path>;
  • headless trust: --trust;
  • sandbox selection: --sandbox enabled|disabled;
  • model selection: --model <id>;
  • prompt input through stdin.

The wrapper defaults to grok-4.5-xhigh. Although this alias was not printed by agent --list-models, it was verified directly against the installed CLI with a successful non-interactive execution. Override deliberately with --model only after confirming another identifier locally.

The wrapper accepts --mode edit, but deliberately omits --mode from Cursor's argv for edit mode. It does not pass --force, --yolo, --approve-mcps, --add-dir, or arbitrary headers.

If agent --help changes, update the wrapper and tests before delegating real work. Do not infer unsupported flags from online examples.

Mandatory Workflow

1. Inspect before delegating

Hermes must first inspect:

  • repository structure and applicable instruction files;
  • relevant modules, interfaces, and implementation constraints;
  • current tests and repository-specific validation commands;
  • current branch, git status --short, repository root, and HEAD;
  • whether the current worktree contains unrelated changes.

Do not delegate a vague issue title. Completion criterion: Hermes can name the relevant files, current behavior, required behavior, exclusions, and validation commands.

2. Select an isolated workspace

Prefer the wrapper's worktree mode for non-trivial edits:

bash
python3 ${HERMES_SKILL_DIR}/scripts/cursor_delegate.py \
--prompt-file /tmp/hermes-cursor-task.md \
--workspace /path/to/repository \
--isolate-worktree \
--worktree-root /tmp \
--task-id cursor-example-8f31c2 \
--timeout 3600 \
--mode edit \
--output-format json

Use a collision-resistant task ID made from a timestamp and random suffix. Never derive paths or branch names from prompt text. The resulting branch is hermes/<task-id> and the worktree path is returned in the JSON envelope.

Skip isolation only when the task is read-only, the source is not Git, worktrees are unavailable, or the user explicitly requires the current tree. This wrapper requires an accessible Git repository; use a separately reviewed execution path for non-Git workspaces.

A dirty source workspace is rejected by default. Use --allow-dirty-worktree only after accounting for every existing change. Prefer isolation instead. When --allowed-root is supplied, the resolved Git repository root and any isolated worktree destination must also be inside it; choose a root broad enough to contain both reviewed locations.

Completion criterion: the JSON result identifies an explicit workspace and starting commit, and unrelated user work cannot be overwritten.

3. Build a self-contained structured prompt

Start from bundled templates/implementation-prompt.md at ${HERMES_SKILL_DIR}/templates/implementation-prompt.md. Include:

  • precise task and current behavior;
  • relevant files, modules, interfaces, and conventions;
  • concrete functional requirements and non-requirements;
  • compatibility, security, architecture, and scope constraints;
  • a TDD procedure and exact validation commands;
  • expected deliverables and completion-report format.

Tell Cursor that Hermes will independently inspect and validate all changes. Do not include credentials, tokens, private keys, passwords, or connection strings. Before saving, scan the prompt for obvious secrets and replace values with secret names or configuration references.

Completion criterion: Cursor can implement the task without guessing any essential requirement or reading an external issue title.

4. Save the prompt as UTF-8

Use the file tool or Python's Path.write_text:

python
from pathlib import Path
Path("/tmp/hermes-cursor-task.md").write_text(prompt, encoding="utf-8")

If a shell heredoc is unavoidable, single-quote its delimiter. Never use an unquoted delimiter for arbitrary prompt text.

The wrapper rejects missing, non-regular, invalid UTF-8, empty, whitespace-only, and oversized prompt files. Default maximum size is 1 MiB; override deliberately with --max-prompt-bytes, never by truncating.

Completion criterion: the prompt file's byte length and SHA-256 in the result match the intended file.

5. Invoke the wrapper with explicit arguments

Normal edit:

bash
python3 ${HERMES_SKILL_DIR}/scripts/cursor_delegate.py \
--prompt-file /tmp/hermes-cursor-task.md \
--workspace /tmp/hermes-cursor-example-8f31c2 \
--timeout 3600 \
--mode edit \
--output-format json

Read-only analysis defaults:

bash
python3 ${HERMES_SKILL_DIR}/scripts/cursor_delegate.py \
--prompt-file /tmp/hermes-cursor-analysis.md \
--workspace /path/to/repository \
--timeout 900 \
--mode plan \
--output-format json

Use up to 7200 seconds only for intentionally large repository tasks. Keep sandbox enabled unless a known repository or host limitation makes it impossible and the user accepts the increased risk. If sandboxing is unavailable, pass --sandbox disabled deliberately and compensate with worktree isolation plus Cursor's allowlist mode.

The wrapper always emits exactly one JSON object on stdout and returns a non-zero wrapper exit status when ok is false. It redacts prompt contents from command, but records prompt SHA-256 and byte length.

Completion criterion: parse stdout as JSON; do not infer success from process output text.

6. Classify the result

Recognized failures:

  • configuration_error — fix caller arguments; do not retry blindly;
  • prompt_validation_error — fix the prompt file;
  • workspace_validation_error — fix workspace selection or dirty state;
  • executable_not_found — install or locate agent;
  • cursor_exit_error — inspect stdout, stderr, and changes;
  • timeout — inspect retained changes before retrying;
  • invalid_cursor_json — retain raw stdout and inspect workspace;
  • output_limit_exceeded — inspect full log paths and workspace;
  • git_inspection_error — restore Git accessibility;
  • unexpected_internal_error — diagnose the wrapper before retrying.

Do not automatically retry configuration or validation failures. Treat changes_may_exist as a requirement to inspect before any cleanup or rerun.

7. Independently inspect every change

Run inside the returned workspace, not the source repository:

bash
git status --short
git diff --stat
git diff --check
git diff

Also inspect staged changes when present:

bash
git diff --cached --stat
git diff --cached --check
git diff --cached

Account for every modified, added, deleted, renamed, generated, and untracked file. Check for:

  • unrelated refactors or generated artifacts;
  • deleted or weakened tests and validation;
  • commented-out code or hardcoded bypasses;
  • secrets, credentials, or connection strings;
  • debug output and temporary files;
  • suspicious config, CI, permission, or dependency changes;
  • writes outside the selected worktree.

Cursor's summary and test claims are evidence only, never acceptance proof.

Completion criterion: every changed path is expected and every diff hunk supports a stated requirement.

8. Run validation independently

Hermes must execute repository-specific commands itself. Use the commands discovered before delegation, not a generic list. Capture command, exit code, stdout, stderr, and duration.

Examples only:

bash
pytest -q
go test ./...
go vet ./...
npm test
npm run lint

At minimum run:

  • focused tests for changed behavior;
  • the relevant package or project test suite;
  • git diff --check;
  • repository-required lint, type, build, or static-analysis commands.

Completion criterion: required checks pass in Hermes's own tool output, independent of Cursor's report.

9. Correct in a bounded loop

On validation failure, write a new follow-up prompt containing:

  • concise original task summary;
  • exact failed command and exit status;
  • relevant error output;
  • current diff context;
  • constraints against regressions and unrelated edits;
  • requirement to inspect existing changes before editing.

Invoke Cursor again in the same retained worktree. Use at most three Cursor invocations per delegated task. Do not hide retries inside the wrapper. After the limit, stop and report the failure with retained workspace path.

Completion criterion: either independent validation passes or Hermes returns a grounded failure report after no more than three invocations.

10. Accept, transfer, or retain

Accept only when:

  • wrapper execution succeeded or Hermes explicitly accepted a reviewed partial result;
  • prompt integrity metadata is consistent;
  • all changed files and hunks are expected;
  • no quoting or shell-injection path exists;
  • independent tests and required static checks passed;
  • no secrets, debug artifacts, or unrelated changes remain;
  • dependency changes are justified;
  • risks and assumptions are documented.

Do not automatically destroy a worktree containing unreviewed changes. After accepted changes have been committed/transferred, or after Hermes explicitly decides to discard them, use the cleanup commands returned in worktree.cleanup_commands:

bash
git worktree remove /tmp/hermes-<task-id>
git branch -D hermes/<task-id>

Completion criterion: accepted work is transferred safely, or rejected work remains at a clearly reported path until explicitly discarded.

Result Envelope

Important fields include:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
2
7-day trend score
5

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/matdev83/hermes-cursor-dispatcher/cursor-delegate/badge)](https://verified-skill.com/skills/matdev83/hermes-cursor-dispatcher/cursor-delegate)

Something wrong with this skill or its page? Tell us.