360 Secure SkillHub
360 安全技能中心

writing-rules

面向仓库内所有散文产物的写作规范:规则按受众拆分为 all/plain/dense/git 四个 sidecar 文件,写作或评审前读取对应规则;附带 node 脚本,可在写文件时注入匹配规则,并解析分支改动中 .md/.mdx/.mmd 文件里的 Mermaid 图。主文件本身不含规则条文。

分类:效率
timschoch
热度 0.66
最近更新 2026-10-31 11:11:33

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add timschoch/skilly/writing-rules
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
writing-rules
description
The writing rules for every repo artifact: docs, code comments, commit messages, PR bodies, issue bodies. Use before writing or reviewing prose anywhere in a repo — README, docs, CLAUDE.md, skill files, commits, PRs, issues.

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 the workflow Bundle's commit-msg hook

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.