npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@firefly0621/dsh-always-apply

v0.1.0-rc.28

Published

Inject Cursor-aligned project rules from .dsh/rules into DeepSeek Harness sessions

Readme


description: "Opt-in project-rules consumer that loads Cursor-aligned .dsh/rules files into the rules:project system-prompt section." kind: "package-bundle"

@firefly0621/dsh-always-apply

English | 中文

Summary

Opt-in project-rules consumer: loads Cursor-aligned .dsh/rules/**/*.mdc files into the rules:project system-prompt section.

Table of Contents

Opt-in Cordis consumer that loads Cursor-aligned project rules from .dsh/rules/**/*.mdc and injects them into the system prompt. Cordis plugin name: rules. Prompt section: rules:project.

This package does not read skills or depend on ctx.skills. Mount it when you want project rules; install with:

dsh plugin --profile web add @firefly0621/dsh-always-apply

Or insert the shipped cordis.patch.yml into a custom base. That patch also inserts the browser Settings「规则」panel (@firefly0621/dsh-client-ui-settings-rules); that client package is a dependency of this host plugin so one install resolves both Loader rows.

Rule files

Place .mdc files under <session cwd>/.dsh/rules/ (override with Config rulesDir). Each file needs YAML frontmatter:

| alwaysApply | globs | Type | |---|---|---| | true | * | Always Apply — full body every assemble | | false | non-empty | Specific Files — body when an in-context path matches | | false | empty | Inactive — stored on disk but not auto-attached |

Only alwaysApply: true classifies as Always Apply. alwaysApply: false without globs is never treated as always.

---
alwaysApply: true
description: Repo-wide constraints
---

Keep rules short and actionable.

Bodies must not contain complete {{...}} prompt-variable groups (skipped with a warning).

Behavior

On every system-prompt/assemble:

  1. Skip agentless assemblies and subagent sessions by default (skipSubagent).
  2. Load .mdc rules from the resolved rules root (cached; invalidated on Settings write/delete and on external edits when watchRules is enabled).
  3. Auto-attach Always bodies and Specific bodies whose globs match v1 in-context paths (tool read/write/edit file_path values ∪ path tokens in user message text).
  4. Honor maxTotalBytes for the complete auto-attached section text (drop Specific before Always when over budget).
  5. Contribute at most one rules:project section per assembly; when another mount already contributed one, the nearer mount's section is kept.

Also registers:

  • projectRules Typert remote — list / read / write / delete for Settings and host callers.

Config

| Field | Default | Meaning | |---|---|---| | rulesDir | .dsh/rules | Relative directory under the session workspace root; absolute paths and .. are rejected. | | skipSubagent | true | Skip subagent-origin sessions. | | maxTotalBytes | 100000 | UTF-8 length of the complete auto-attached section text (reminder + bodies + framing as rendered). | | watchRules | true | Watch each accessed rules root and invalidate the cache on external .mdc edits (debounced). | | watchDebounceMs | 100 | Watcher debounce window in milliseconds before cache invalidation. | | defaultWorkspaceRoot | (empty) | Absolute workspace root used when no session workspace is available. Enables the Settings UI to manage rules without an active session. Must be an absolute path. |

Version compatibility

This bundle declares peerDependencies on @deepseek-ai/dsh-* packages. DSH checks those ranges against the running runtime at install and profile startup; an incompatible pair is refused unless the profile grants an exact package@version × dsh-version exemption. Source-workspace workspace:* peers mean the matching DSH release; packed manifests substitute that exact version. See the plugin manager's compatibility reference for version-exemptions, allow-version, and the crash/data-loss risk.

Model Experience

Project rules section

What the model sees

When non-empty: a rules:project system-prompt section with a short reminder and <auto_attached_rules> / <rule_content> blocks for all auto-attached rules (Always and matching Specific).

Token effect

One section re-sent each request while rules and in-context matches stay within budget.

KV Cache effect

Prefix reuse holds while the rendered section text is unchanged; a rules-file write, delete, or Specific match set change recomposes the section.

Known Limitations and Deferred Work

  • No runtime invariant companion is published; this package listens on system-prompt/assemble and derives injection from on-disk .mdc rules, with no independently observable durable relation beyond that consumer behavior.
  • Opt-in only — product defaults do not mount this plugin.
  • No .cursor/rules import — storage is .dsh/rules only.
  • In-context paths are incomplete vs Cursor IDE — no open-editor inventory on the web host; Specific matching uses tool-touched paths and user-text path tokens only.
  • A complete persona replaces every section — presets with a complete persona suppress this section for that agent.
  • Typert client artifacts — the gateway registers at runtime; web Settings must compose a client that can call projectRules once the remote is on the host API surface.

Dev Note

The package owns rule discovery, matching, and prompt rendering. The Settings page is a separate client package that edits the same files through the host remote API.