Skip to Content
Health ReportsUse CasesCleanup with Cursor

Cleanup with Cursor

Turn unused code and dependency findings from health reports into actionable cleanup work — open a pre-built prompt in Cursor (or another AI editor) directly from the Dev Herald dashboard.

What you’ll get

Health reports surface unused artifacts detected by tools like Knip:

  • Unused files — Source files with no imports
  • Unused dependencies — Packages in package.json that are never imported
  • Unused type exports — Exported types with no consumers

Each finding appears in the Dev Herald dashboard with an Open in Cursor action that launches a deeplink with a structured prompt containing the relevant findings.

Collect unused code signals

Add Knip to your health workflow to populate the unusedCode signal:

- name: Run Knip run: >- pnpm exec knip --reporter json --reporter compact --no-exit-code | { IFS= read -r l; printf '%s\n' "$l" > results.json; cat; } - name: Upload health data uses: dev-herald/health@v1 with: api-key: ${{ secrets.DEV_HERALD_API_KEY }} knip-report-path: results.json lockfile-path: ${{ github.workspace }}/pnpm-lock.yaml workflow-run-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

The dev-herald/health action parses the Knip JSON report and maps it to the unusedCode signal — unused files, dependencies, and type exports. See Signals for what each field means, or the API Reference for the payload schema.

Open findings in Cursor

From the Dev Herald dashboard health report view:

  1. Navigate to the Unused files, Unused dependencies, or Bundle size card
  2. Click Open in Cursor (or choose another editor from the dropdown)
  3. Cursor opens with a pre-built prompt containing the findings, repository context, and remediation guidance

The prompt includes instructions tailored to the signal type — for example, unused dependency cleanup suggests verifying the package is truly unused before removing it, and bundle regressions suggest lazy loading or import optimization.

Supported editors

EditorAction
CursorOpens Cursor chat with the report prompt
Claude CodeOpens Claude Code in VS Code
CodexOpens Codex app
GitHub CopilotOpens Copilot Chat in VS Code
ZedOpens Zed Agent with the prompt

You can also copy the prompt to clipboard or open a GitHub issue with the findings pre-filled.

Workflow example

Run health collection weekly, review findings in the dashboard, and use Cursor to batch-fix unused code:

name: Health on: schedule: - cron: '0 9 * * 1' workflow_dispatch: jobs: health: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: node-version: "20" cache: "pnpm" - run: pnpm install --frozen-lockfile - run: >- pnpm exec knip --reporter json --reporter compact --no-exit-code | { IFS= read -r l; printf '%s\n' "$l" > results.json; cat; } - uses: dev-herald/health@v1 with: api-key: ${{ secrets.DEV_HERALD_API_KEY }} knip-report-path: results.json lockfile-path: ${{ github.workspace }}/pnpm-lock.yaml workflow-run-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

Next steps

Last updated on