skills
CLAUDE.md0 starsChanged 2 months agoMITView on GitHub
Machine-wide rules for every project (the Claude Code analog of ~/.cursor/rules/). Each rule lives in ~/.claude/rules/*.md and is imported below; base-rule is the always-on entry, the rest are language-specific. Note: unlike Cursor's per-glob .mdc, these imports are always loaded into context (no glob-scoped auto-attach). If a language rule grows large and you'd rather load it on demand, move it to a Skill (~/.claude/skills/<name>/SKILL.md). 请现在起遵守以下三条规则: CRITICAL RULE: Style for comments in any language (#, //, /* */, --, …). When running…
- Installs packages
In this repository32 other files it gives its agents.
- .cursor/rules/base-rule.mdcCursor rule
- .cursor/rules/bash-style.mdcCursor rule
- .cursor/rules/groovy-implicit-return.mdcCursor rule
- .cursor/rules/groovy-style.mdcCursor rule
- .cursor/rules/markdown-style.mdcCursor rule
- .cursor/rules/python-style.mdcCursor rule
- automateSkill
- autopilotSkill
- canvasSkill
- create-hookSkill
- create-ruleSkill
- create-skillSkill
- create-subagentSkill
- cursor-blameSkill
- git-messageSkill
- goalSkill
- loopSkill
- migrate-to-skillsSkill
- new-repoSkill
- onboardSkill
- originSkill
- rename-chatSkill
- review-bugbotSkill
- review-securitySkill
- reviewSkill
- sdkSkill
- shareSkill
- shellSkill
- split-to-prsSkill
- statuslineSkill
- update-cli-configSkill
- update-cursor-settingsSkill
The file
We split this CLAUDE.md into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
If you are unsure about an answer, explicitly state "I am not sure" and explain the reason.
- Distinctive: line 14
All numerical statistics and quotes from individuals must be accompanied by verified sources.
- Distinctive: line 26
If not explicitly asked to commit, !!NEVER!!
- Distinctive: line 31
Before editing any script, read the original file first with the Read tool.
- Very specific: line 32
When running in a sandbox environment, prepend /opt/homebrew/bin to your PATH: export …
- Distinctive: line 33
Only run git commit when I explicitly say "commit".
- Distinctive: line 34
After substantive changes, run lint checks on the files you edited.
- Very specific: line 46
no 80-column limit: put it on one line if one line says it.
- Distinctive: line 60
When running shell commands, prefer the faster modern replacements:
- Very specific: line 72
When running Linux commands via Shell, any command I (marslo) have aliased that injects ANSI color or changes behavior MUST be invoked with …
- Very specific: line 93
Add --no-color as well when the result will be parsed further.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
marslo — global Claude Code rules
Machine-wide rules for every project (the Claude Code analog of ~/.cursor/rules/). Each rule lives in ~/.claude/rules/*.md and is imported below;
base-rule is the always-on entry, the rest are language-specific.
Note: unlike Cursor's per-glob
.mdc, these imports are always loaded into context (no glob-scoped auto-attach). If a language rule grows large and you'd rather load it on demand, move it to a Skill (~/.claude/skills/<name>/SKILL.md).
0. Core Directives (Highest Priority)
- If you are unsure about an answer, explicitly state "I am not sure" and explain the reason. Strictly NO guessing or hallucinating information!
- At the end of every response, provide a confidence score from 1 to 10. Any content with a confidence score below 7 must be explicitly highlighted/called out.
- All numerical statistics and quotes from individuals must be accompanied by verified sources.
- Before modifying any existing file, read it first with the Read tool. If the file is non-empty, it is FORBIDDEN to overwrite it wholesale — use Edit for targeted changes or to append. Write is only for creating a new file, or replacing one you have just read in full this session.
请现在起遵守以下三条规则:
- 如果你对答案没有把握, 请直接说我不确定并解释原因, 严禁瞎猜假想!
- 每次回答完后, 请为你的信心指数打分, 1 到 10 分, 任何低于 7 分的内容都要专门标注出来
- 针对所有的数字统计数据和人物言论必须提供经过验证的来源
- 修改任何已存在的文件前, 必须先用 Read 读取原文件; 若文件非空, 严禁直接整体覆盖 —— 用 Edit 做局部修改或追加, 不得用 Write 覆盖 (Write 仅用于新建文件, 或覆盖你本次会话已完整读过的文件)
CRITICAL RULE:
- If not explicitly asked to commit, !!NEVER!! run git commit for any message. Provide the message if necessary, but unless explicitly instructed, you must absolutely not run git commit!
- 如果没有明确的让你提交, !!切勿!! git commit 任何 message. 如果有必要提供就行, 除非我显式的让你提交, 否则一律不得 git commit!
1. base-rule (always applied)
- Before editing any script, read the original file first with the Read tool.
- When running in a sandbox environment, prepend
/opt/homebrew/binto your PATH:export PATH="/opt/homebrew/bin:/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH". - Only run
git commitwhen I explicitly say "commit"; never push on your own. - After substantive changes, run lint checks on the files you edited.
- Reply/Chat language — chat answers only: if I ask in Chinese, reply in Simplified Chinese; otherwise reply in English. (code comments are always English — see § 2.)
- Any
pip/pipxinstall/uninstall action —python3 -m pip install/uninstall,python -m pip install/uninstall, barepip install/uninstall, orpipx install/uninstall— MUST ask for confirmation first, regardless of the current permission mode. - Bash — when invoking bash in a command (e.g.
bash -lc '...',bash script.sh), use/opt/homebrew/bin/bash(Homebrew bash 5.x), never barebashor/bin/bash(macOS system bash 3.2). Script shebangs are covered inrules/bash-style.md.
2. Code comments
Style for comments in any language (#, //, /* */, --, …).
- language: always English, regardless of the conversation language (even when we're chatting in Chinese).
- lowercase by default — no leading capital; keep uppercase only for terms that demand it:
ID,PR,URL,API,TTL,SHA, acronyms, and proper names. - describe what it is or what it does — not why, not the underlying mechanism. prefer precise technical terms over prose.
- no 80-column limit: put it on one line if one line says it; wrap only when a single line can't be clear, or when listing an
example/ multiple behaviors.
# append (#ID) to the commit subject; skip if already present # ✅
# fetch base ref then rebase HEAD onto it # ✅
# Appends the pull-request identifier to the commit subject line # ❌ capitalized, wordy
# we do this because otherwise the log loses the PR link # ❌ explains why3. Shell/Command
3.1. prefer modern search tools
When running shell commands, prefer the faster modern replacements:
find→ usecommand fdgrep→ usecommand rg(ripgrep)
Both are color-aliased, so ALWAYS invoke them with the command prefix (i.e. command fd / command rg) to bypass the alias and get clean, parseable output.
Fallback: if the modern tool isn't installed (command -v fd / command -v rg fails), fall back to the default find / grep. Prefer a guarded one-liner,
e.g. command -v fd >/dev/null && command fd PATTERN || command find . -name PATTERN and command -v rg >/dev/null && command rg PATTERN || command grep -rn PATTERN.
3.2. bypass color-injecting aliases
When running Linux commands via Shell, any command I (marslo) have aliased that injects ANSI color or changes behavior MUST be invoked with the command prefix (the raw binary) to get clean, parseable output.
Rule of thumb: if a command's output will be parsed again (pipes, command substitution, downstream grep/awk/sed), use command to bypass the alias. Purely human-facing interactive output may keep the colored alias.
Known aliases to bypass:
grep/egrep/lgrep(aliased with--color=alwaysplus-i/-n, which change both color and matching) → usecommand grep/command egrepcat→ usecommand catls/l/ll/l./ld(--color=always) → usecommand lsrg(--color=always) → usecommand rg, or pass--color=neverfd(--color=always) → usecommand fd, or pass--color=neverdiff(--color=auto) → in pipes usecommand diffezafamily (la/els/etree,--iconsforces color) → when parsing usecommand lsip(ip -c) → usecommand ip
3.3. Git - always bypass the external diff tool
My git is configured with an external/pager diff tool (e.g. difftastic / delta via diff.external or [pager] diff). Any command that emits a diff MUST be run with --no-pager and --no-ext-diff so the output is a clean, parseable unified diff:
git diff→git --no-pager diff --no-ext-diffgit show→git --no-pager show --no-ext-diff --no-colorgit log -p→git --no-pager log -p --no-ext-diff -1 --no-color
Add --no-color as well when the result will be parsed further.
@rules/bash-style.md @rules/python-style.md @rules/groovy-style.md @rules/groovy-implicit-return.md @rules/markdown-style.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

