mcpField
W
writing-rules

writing-rules

github.com/timschochDevelopment1718 installsUpdated 1d ago
Repository

About writing-rules

writing-rules organizes writing guidance into sidecar files by content type and injects matching rules through a PreToolUse hook when Markdown is written. It is for teams applying consistent conventions to documentation, agent files, and Git text.

Key features

  1. 01Separate rules by audience and content type
  2. 02Inject matching rules during writes
  3. 03Skip designated directories and files
  4. 04Check Mermaid diagrams in changed files

Use cases

  1. 01Writing READMEs and documentation
  2. 02Creating agent instruction files
  3. 03Checking Mermaid diagrams changed on a branch

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/timschoch/skilly --skill writing-rules

After installing, type/writing-rulesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
all.md
dense.md
git.md
plain.md
scripts/
check-mermaid.mjs
default-branch.mjs
inject-writing-rules.mjs

Details

From the project README

Writing rules

One list, one copy, synced from the hub — rules update here, never in a consumer. Enforcement varies per repo; the rules do not.

The rules live in sidecar files, one per style, so only what applies gets injected:

  • rules/all.md — every file: audience, words and links, the never list, where a statement lives
  • rules/plain.md — a person reads it: README, docs, code comments
  • rules/dense.md — only an agent reads it: CLAUDE.md, AGENTS.md, skill files, agent docs; where both could apply, dense wins
  • rules/git.md — commits, PRs, issues; the format is enforced by setup-repo's commit gate

Reviewing or writing prose by hand? Read the sidecars above — this file holds no rule.

Injection on write actions

scripts/inject-writing-rules.mjs is a PreToolUse hook: on every file-writing tool call it prints the matching rules (all + plain|dense by path) as additional context, so the writer sees them without loading this skill. /setup-repo wires it into .claude/settings.json. Markdown files only; node_modules, .temp/ and the synced .claude/skills/.claude/rules trees are skipped.

Mermaid check

scripts/check-mermaid.mjs parses every mermaid diagram in the .md, .mdx and .mmd files a branch changes. The verify skill's push stage runs it. It needs the repo's mermaid and jsdom devDependencies; /setup-repo installs them.

Comments

Markdown supported