rulepack.json

Pack the AI memory

rulepack.json describes the Markdown memories an AI coding agent should read — at your project root, the same way package.json describes an npm package.

Create it with the CLI

If you are comfortable in a terminal, interactive rulepack init is the fastest path. You can keep rulepack.json in a repo like package.json without signing in; sign in only when you are ready to publish. See the CLI docs for options.

1. Generate rulepack.json

$pnpm dlx rulepack init

2. Sign in before publishing

$pnpm dlx rulepack login

3. Publish it

$pnpm dlx rulepack publish

Don't write JSON? Let your agent do it

No JSON experience needed. rulepack.json reads just like package.json — paste this into Claude Code, Cursor, or any agent and it'll scaffold one for your repo.

Paste into your agent
Set up rulepack.json for this project.

rulepack.json is like package.json, but instead of shipping code it bundles this repo's AI memory files (AGENTS.md, CLAUDE.md, .cursor/rules, .clinerules, .windsurfrules, GEMINI.md, Copilot instructions, and custom Markdown docs) into one reusable, versioned pack.

Please:
1. Scan the repo and list every existing AI memory file.
2. Create rulepack.json at the project root with:
   - "name": "@your-scope/short-pack-name" (ask me for my scope)
   - "version": "0.1.0"
   - "license": "MIT" unless I choose another license
   - "visibility": "public" unless I choose private or pay
   - "description": one line on what these memories help an agent do
   - "memories": map existing files to standard keys: agents, claude, cursor, cline, windsurf, gemini, copilot. Put other Markdown files under "custom" with path and optional description/readWhen/tags.
   - "files": include rulepack.json, LICENSE, README.md, and every memory path.
3. Show me the file and explain each field in plain language.

Reference: https://rulepack.lyrra.net/rulepack.json

Prefer a link? Point your agent at /llms.txt — a machine-readable guide it can read directly to learn the format.

A minimal rulepack.json

Required fields: who the pack is (name), what version (version), the license and access policy (license, visibility), and which memory files it ships (memories).

{
  "name": "@ichi/nextjs",
  "version": "1.0.0",
  "license": "MIT",
  "visibility": "public",
  "memories": {
    "claude": "CLAUDE.md"
  }
}

The full shape

Everything optional layered on: discovery metadata, custom memories, files to bundle, and consumer dependencies on other packs.

{
  "name": "@ichi/nextjs",
  "version": "1.4.0",
  "description": "Strict Next.js rules for Claude Code + Cursor",
  "license": "MIT",
  "visibility": "public",
  "keywords": ["nextjs", "typescript", "strict"],
  "memories": {
    "agents": "AGENTS.md",
    "claude": "CLAUDE.md",
    "cursor": ".cursor/rules/main.mdc",
    "custom": {
      "launch-plan": {
        "path": "docs/launch-plan.md",
        "description": "Launch and social media plan",
        "readWhen": "when planning launch posts or growth strategy",
        "priority": "normal",
        "tags": ["marketing", "launch"]
      }
    }
  },
  "files": ["rulepack.json", "CLAUDE.md", ".cursor/rules/**", "AGENTS.md", "docs/launch-plan.md", "LICENSE"],
  "dependencies": {
    "@rulepack/typescript": "^0.1.0"
  }
}

Where it lives

Always at the repository root — /rulepack.json. Tooling resolves it from the current working directory the same way npm finds package.json, so a root manifest is what rulepack publish and rulepack add expect.

Every field

A published pack is an author manifest: it needs name, version, license, visibility, and at least one memories entry. A consumer project can also use dependencies to record installed packs.

FieldTypeMeaning
name *stringPack identity in @scope/name form. Scope and name use lowercase letters, digits, and internal hyphens.
version *stringSemver. Published versions are immutable, so every content change needs a new version.
license *stringSPDX identifier such as MIT or Apache-2.0, or UNLICENSED. A matching LICENSE file should be shipped when possible.
visibility *"public" | "private" | "pay"Registry access policy. It controls who can read memory files and install the pack.
memories *objectThe core map of memory files. Standard keys point to agent-specific files; custom holds project-level Markdown memories.
descriptionstringOne-line summary, up to 280 characters. Used in search results and pack pages.
authorstringOptional human-readable author or organization name.
homepagestringOptional http(s) URL for source, docs, or the project page.
keywordsstring[]Discovery tags. Up to 20 strings, each up to 40 characters.
filesstring[]Optional tarball globs. The CLI always includes rulepack.json and every path declared in memories.
dependenciesobjectConsumer-side map from @scope/name to a semver range. rulepack add writes this when a project has rulepack.json.

* Required for published packs.

Memory keys

Each standard key in memories points to one file. Use memories.custom for project plans, handoffs, research notes, or any Markdown memory that is not tied to a single agent.

KeyMemoryDefault path
agentsAGENTS.mdAGENTS.md
claudeClaude CodeCLAUDE.md
cursorCursor.cursor/rules/main.mdc
clineCline.clinerules
windsurfWindsurf.windsurfrules
geminiGemini CLIGEMINI.md
copilotGitHub Copilot.github/copilot-instructions.md
custom.*Project memorydocs/plan.md

Custom memories

memories.custom is for reusable Markdown that is not owned by one agent: project plans, architecture notes, launch docs, runbooks, prompts, research summaries, or handoff notes. A custom value can be a bare path string, or an object with metadata.

{
  "memories": {
    "agents": "AGENTS.md",
    "custom": {
      "plan": "docs/plan.md",
      "launch": {
        "path": "docs/launch-plan.md",
        "description": "Launch and social media plan",
        "readWhen": "when planning launch posts or growth strategy",
        "priority": "normal",
        "tags": ["marketing", "launch"]
      }
    }
  }
}
FieldTypeMeaning
path *stringRequired path to the Markdown memory file. It must be relative to the pack root.
descriptionstringShort label shown in UI and useful to agents when choosing what to read.
readWhenstringA hint for when this memory matters, such as when planning launch posts or debugging auth.
priority"low" | "normal" | "high"Optional loading hint. Use high for memories the agent should consider early.
tagsstring[]Optional discovery and routing tags. Up to 20 short strings.

Visibility

visibility changes registry access, not the file format. Public, private, and pay packs all publish the same kind of rulepack.json and memory files.

ValueAccess
publicAnyone can view metadata, read memory files, download the tarball, and install the pack.
privateOnly authorized users or teams can view memory files, download the tarball, and install the pack.
payMetadata and purchase surfaces can be public; memory files and tarball access require purchase.

files and tarballs

files is optional and behaves like npm pack allow-listing. rulepack publish always forces rulepack.json and every path declared in memories into the tarball, even if you forget to list them. Add README, LICENSE, and extra supporting files explicitly.

Consumer dependencies

The same filename is used in projects that install packs. In that role, dependencies records installed packs and semver ranges. A consumer-only rulepack.json does not need name, version, or memories.

{
  "dependencies": {
    "@rulepack/nextjs": "^0.1.0",
    "@rulepack/typescript": "^0.1.0"
  }
}

Validation rules

  • name must be @scope/name. Scope is 1-39 chars; pack name is 1-64 chars; both use lowercase alphanumerics with internal hyphens.
  • version must be valid semver, for example 1.0.0 or 1.2.0-beta.1.
  • license is required and must be a non-empty string up to 64 characters.
  • visibility must be exactly public, private, or pay.
  • memories must declare at least one standard memory file or one custom memory.
  • All paths must be relative, non-empty, under 512 characters, and cannot contain absolute paths, empty segments, dot segments, .., or NUL.
  • custom memory keys must be 1-64 characters and start with an alphanumeric; ., _, and - are allowed after that.
  • homepage must be an http(s) URL. javascript: and data: URLs are rejected.
  • dependency keys must be @scope/name and values must be valid semver ranges such as ^1.2.3, ~1.0.0, or >=1.0.0 <2.0.0.

Need a walkthrough?

This page is the complete manifest reference. The docs are for tutorials, publishing flow, and CLI examples.

Open tutorials