From workflow
This skill should be used whenever the user states a durable project-level preference, constraint, convention, or rule — phrases like "don't use X", "we don't use X in this project", "always use Y", "prefer Z over W", "we use <library/pattern/style>", "stick to <convention>", or any time the user agrees to "remember this" / "add this to memory" for the current codebase. The skill ensures the preference is written to the project's CLAUDE.md (which is committed to the repo and travels across machines) instead of only being saved to machine-local memory, so the constraint is preserved when the user works from a different machine, a new clone, or a teammate joins. Trigger this even when Claude Code's default reaction would be "okay, I'll remember that" — that default is insufficient because local memory does not sync. Do NOT trigger for one-off requests scoped to the current task ("rename this variable", "skip tests this time"), for personal/global preferences unrelated to the project (those belong in ~/.claude/CLAUDE.md), or for ephemeral chat-only context.
How this skill is triggered — by the user, by Claude, or both
Slash command
/workflow:persist-project-preferencesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude Code's default response to "I don't want to use JPA in this project" or similar is often "Got it, I'll remember that" — saved to local memory only. That memory does not travel: a different machine, a fresh clone, or a teammate gets none of it. The fix is to write durable project preferences into the repo's `CLAUDE.md`, which **is** committed and **does** travel.
Claude Code's default response to "I don't want to use JPA in this project" or similar is often "Got it, I'll remember that" — saved to local memory only. That memory does not travel: a different machine, a fresh clone, or a teammate gets none of it. The fix is to write durable project preferences into the repo's CLAUDE.md, which is committed and does travel.
This skill makes that the default behavior for project-level preferences.
Trigger when the user expresses a durable, project-scoped rule. Signals include:
Do not trigger for:
~/.claude/CLAUDE.md, not the repo's CLAUDE.md)Look for CLAUDE.md at the repository root (the directory containing .git, or the working directory if git is not present). If it exists, read it. If it does not exist, create it with a minimal header:
# Project Instructions for Claude
This file is read by Claude Code at session start. It captures durable project conventions, constraints, and preferences. Edit freely; commit changes so they travel across machines and teammates.
Match the existing structure first. If the file already has a section the new entry fits — ## Database, ## API style, ## Testing, whatever the user has organized — use it. Don't impose new headings on a file the user has already shaped.
Only when the file is new, or no existing section is a clean match, use this default set (creating any that don't yet exist):
## Tech Stack — languages, frameworks, package managers, databases that are in use## Conventions — positive rules ("always do X", "prefer Y")## Constraints — negative rules ("don't use X", "no Z")## Architecture — structural decisions (layering, module boundaries)## Workflow — how to build, test, run, deployIf the new preference doesn't fit any existing section cleanly and none of the defaults fit either, prefer ## Constraints for "don't" rules and ## Conventions for "do" rules — but a one-off custom heading is also fine when the topic is genuinely its own thing.
Style: one line, imperative phrasing or a clear factual statement. No multi-line entries; if the rule is too big for one line, split it into multiple atomic entries.
Reason in parens: include a short rationale in parentheses when the user gave one. Reasons aren't required, but they help future-you (and future Claude sessions) judge whether the rule still applies — when the original incident or constraint is forgotten, a bare rule is harder to maintain than one that says why.
Position in the section: append to the bottom of the section. Don't re-sort or re-cluster existing entries — diff churn for no value, and it makes git blame lie about when each rule was added. Newest at the bottom is fine.
Good:
- Do not use Spring Data JPA. Use JDBC + jOOQ instead. (Avoiding hidden N+1 queries and lazy-loading surprises.)- Package manager: pnpm. Do not use npm or yarn.- Tests live next to source files as \*.test.ts`, not in a separate `tests/` tree.`Avoid:
tsconfig.json is right there) — unless the user explicitly stated it as a ruleAfter editing, briefly tell the user what was added and where, so they can review and commit. Example:
Added to
CLAUDE.mdunder Constraints:
- Do not use Spring Data JPA. Use JDBC + jOOQ instead.
Commit this so it persists across machines.
Do not commit the change yourself unless the user asks — they may want to review or batch it with other work.
If you also wrote the preference to local memory (via the standard memory mechanism), that's fine — local memory provides faster recall within the session. But CLAUDE.md is the source of truth, and if the two ever disagree, CLAUDE.md wins.
CLAUDE.md files. Place the rule in the most specific CLAUDE.md that applies (e.g. services/api/CLAUDE.md for an API-only rule, root CLAUDE.md for a repo-wide rule). Ask if it's ambiguous.CLAUDE.md in the working directory and mention to the user that the file lives with whatever they sync (Dropbox, etc.) — the persistence guarantee comes from version control, not from the file itself.~/.claude/CLAUDE.md, not the project CLAUDE.md.| User says | Where it goes |
|---|---|
| "Don't use JPA in this project" | Project CLAUDE.md → Constraints |
| "We use pnpm here" | Project CLAUDE.md → Tech Stack |
| "I always prefer tabs over spaces" (general) | ~/.claude/CLAUDE.md |
| "For this PR, skip the integration tests" | Neither — task-scoped |
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub pgatzka/pgatzka-skills