dsh-plugin-cursor-plan: Reading Cursor's Plan Mode Files in DSH

Introduction

The plugin system of DeepSeek Harness (DSH) allows users to extend tool capabilities. Cursor’s Plan mode generates .plan.md files, but DSH does not natively provide an interface to read these files. To leverage these plan files within DSH, an additional tool must be implemented. The dsh-plugin-cursor-plan plugin registers a read-only cursor_plan tool, enabling the model to list and read plan files produced by Cursor’s Plan mode.

Plugin Scope and Maintainer

This is a DeepSeek Harness plugin published by maintainer eppen. It registers a read-only tool to solve the problem of “accessing Cursor Plan files within DSH.” The plugin has no external library dependencies, is implemented in pure ESM, and uses only Node.js built-in modules.

Core Features

The plugin provides a cursor_plan tool that supports two operations:

  1. list: List currently accessible plan files
  2. read: Read the content of a specified plan file

List Operation Parameters

Parameter Type Required Description
action "list" | "read" Yes Operation type
match string No Substring filter; matches filename, overview, or file path (case-insensitive)
limit integer No Maximum number of results to return; default 20, cap 100 (truncated if exceeded; values <= 0 fall back to 20)

Read Operation Parameters

Parameter Type Required Description
action "list" | "read" Yes Operation type
file string No Absolute plan path; must be within an allowed directory
basename string No File name (e.g., Plan-642d0fd6.plan.md), or the name field returned by list

read requires either file or basename; if both are provided, file takes precedence. The tool returns name, overview, todos, and the file body (Markdown).

Read-Only Constraint

The plugin is strictly read-only: it does not write, edit, or delete files. The only write operation in DSH comes from the harness session log, which is unrelated to the plugin.

Allowed Accessible Directories

The plugin only scans the following two directories (deduplicated for display):

  1. ~/.cursor/plans (home scope)
  2. .cursor/plans under the current session’s working directory (workspace scope)

The session working directory is sourced from DSH’s workingDirectory service; if the service is unavailable, it falls back to the process startup directory process.cwd().

Path Validation and Resolution Rules

  • On read, path.resolve(file) is called first, then path.relative checks whether the path is within an allowed directory; if not, it returns error: "path-not-allowed"
  • .. path traversal or access outside allowed directories is not permitted
  • Preamble rules: file headers may contain HTML comments (<!-- uuid -->) and blank lines; if the frontmatter --- is not closed, the remaining content is treated as body text
  • todos supports [] or indented - id/content/status lists
  • overview supports | or > block scalars
  • Single file read limit is 200KB; exceeding it returns error: "too-big"; during list, only the first 32KB of each file is read

Error Codes

The tool returns the following error codes (all canonical values; no exceptions are thrown):

  • bad-action: unsupported action
  • path-not-allowed: path is not within an allowed directory
  • not-found: file does not exist
  • ambiguous: multiple files matched (list only)
  • not-file: path points to a directory
  • too-big: file exceeds 200KB
  • read-failed: read failed

Installation and Activation

The plugin is installed to a specified profile via the dsh plugin command (using the web profile in this case).

  1. Bundle Installation (Recommended)
dsh plugin --profile web add "github:eppen/dsh-plugin-cursor-plan#main"

dsh plugin runs pnpm add within the profile and then mounts the package at the bundle layer. After installation, dsh web must be restarted (the dsh-web-app patch disables HMR, so plugin changes are not hot-reloaded).

  1. Local Development (Direct Mount)

If you prefer not to install into the profile’s node_modules, you can mount the source code directly at the user layer:

Add the following to ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: cursor-plan
      name: 'file:///D:/Tools/dsh-plugin-cursor-plan/index.mjs'

Note the file:/// prefix: cordis’s loader calls import(name) for names that do not start with ., and a bare path would be treated as a package name and fail. After mounting, dsh web must also be restarted.

Verifying Installation

dsh --profile web --dump-config | grep -A3 cursor-plan

You should see id: cursor-plan and a name of dsh-plugin-cursor-plan (bundle install) or file:///... (direct mount), while retaining nodes such as id: tools and id: plan-mode.

Uninstalling

  • Bundle install: dsh plugin --profile web remove dsh-plugin-cursor-plan, then restart dsh web
  • Direct mount: remove the insert entry from cordis.patch.yml (an empty array [] is also acceptable), then restart dsh web

Typical Usage

For example, using list to list up to 10 plan files in the current workspace (sorted by name):

action: list
match: ""
limit: 10

Sample output:

Cursor plans: 10/1082 (limit 10)
roots: C:\Users\<you>\.cursor\plans | D:\work\proj\.cursor\plans
1. [home] Plan name — overview summary (file.plan.md, 2026-11-18 11:33)
   file: C:\Users\<you>\.cursor\plans\file.plan.md
… 1072 more not shown; narrow with match or raise limit (max 100)

For example, using read to read a file:

action: read
file: D:\work\proj\.cursor\plans\Plan-642d0fd6.plan.md

The response includes name, overview, todos, and the body Markdown.

Use Cases and Notes

  • Suitable for using Cursor Plan files as context or reference material within DSH, allowing the model to continue development or perform reviews based on existing plans
  • The plugin runs with the permissions of the current dsh process; check the source code and license (MIT) before installation
  • The plugin is not listed in a marketplace; it can only be discovered via GitHub topics or a custom index

Conclusion

dsh-plugin-cursor-plan provides a read-only interface that enables DSH to access plan files generated by Cursor’s Plan mode. It scans plan files within two fixed directories and exposes them to the model via the list and read tools. For more plugins, visit the directory page or the GitHub repository.

  • Directory page: https://www.skillhub.cn/plugins/eppen/dsh-plugin-cursor-plan
  • GitHub: https://github.com/eppen/dsh-plugin-cursor-plan
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye