Shared Snippet Conventions for Dev Teams: A Practical Ruleset

Shared Snippet Conventions for Dev Teams: A Practical Ruleset Last updated: November 3, 2026 · Reading time: ~8 min Quick Answer A dev team’s shared snippets work when they live in a git repository (not a clipboard history), use a consistent trigger prefix per category, use one placeholder syntax, contain no secrets, and have a named owner and review process. Keep the shared library in a text expander or config format your team can diff. Use a clipboard manager like Maccy for personal, ephemeral work. Most teams discover they need snippet conventions the day two people paste two slightly different versions of the same incident-response template into the same channel. Everyone has a snippet. Nobody knows whose is current. This article is a ruleset, not a tool review. Each rule comes with its rationale, so you can bend it when your team differs from the assumptions. It ends with a template you can copy into a repo today. Should a team share snippets through a clipboard manager? No. A clipboard manager records what you copied; a snippet library stores what you decided to reuse. They solve different problems, and mixing them is how teams end up with stale, unreviewed text. Maccy App is a good example of the boundary. It is a local-first clipboard history for macOS: it stores your recent copies on your machine, lets you search them, and lets you pin items you want to keep. It does not sync to other machines and has no team-sharing layer . That is a feature for privacy, and it is exactly why it should not be your team’s source of truth. The workable split looks like this: Need Right tool Why Reviewed, versioned team templates (PR descriptions, incident updates, SQL boilerplate) A git repo consumed by a text expander Diffs, blame, code review, rollback Personal shortcuts Text expander or macOS Text Replacements Fast, no review needed “What was that command I copied ten minutes ago?” Clipboard manager (e.g., Maccy) Recall of ephemeral content Pinned one-offs you reuse this week Maccy pins Quick access without committing to a convention The ten conventions 1. One source of truth, in version control Rule: The canonical snippet library is a git repository with a README and a CODEOWNERS file. Why: Snippets are code-adjacent text with the same failure modes as code: drift, silent edits, and “works on my machine.” Git gives you review, history, and a way to answer “who changed this and why?” Shared documents and chat pins give you none of that. Practical note: Espanso, an open-source cross-platform text expander, stores matches in YAML files and supports installing packages from git repositories, which makes it a natural consumer of a team repo . Whatever tool you choose, prefer one whose config is plain text. 2. Prefix every trigger with a category Rule: Triggers follow <sigil><category>-<name>, for example ;pr-bugfix, ;inc-update, ;sql-explain. Why: Flat trigger namespaces collide as libraries grow. A category prefix gives you autocomplete-by-memory and makes collisions visible in review. Pick a sigil that will not appear in normal prose or code. A leading semicolon or double-colon is common; avoid sigils that are valid at the start of a shell command or a Markdown line. 3. Make triggers lowercase, hyphenated, and short Rule: Lowercase ASCII, hyphens as separators, no more than about 12 characters after the category. Why: Case-sensitive triggers cause misfires across keyboard layouts and are painful to say aloud in pairing sessions. Short triggers are typed; long ones get abandoned. 4. Pick one placeholder syntax and document it Rule: Use one cursor marker and one variable style across the whole library, and document both in the README. Why: Different expanders use different syntax for cursor position, dates, and form fields. If your team uses more than one tool, the lowest-common-denominator approach is to use obvious human-readable placeholders such as {{ticket_id}} or TODO: markers that work even when pasted raw. A snippet that expands to broken template syntax is worse than no snippet. 5. Never put secrets in a snippet Rule: No API keys, tokens, passwords, internal hostnames you would not put in a public README, or customer data. Enforce it with a secret scanner in CI. Why: Snippet repos get cloned widely and rarely get the scrutiny of production code. Treat the repo as semi-public inside the company. This is also where clipboard hygiene matters on the personal side. If you copy credentials, configure your clipboard manager to skip them. In Maccy Mac, the Ignore settings (Maccy Clipboard → Settings → Ignore) let you exclude specific apps, such as your password manager, and specific pasteboard types . Many password managers also mark their copies as concealed using a community pasteboard convention (see nspasteboard.org), which well-behaved clipboard managers respect . 6. Every snippet gets a description and an owner Rule: Each entry has a one-line description of when to use it and an owning team or person (via CODEOWNERS path, or a metadata field if your tool allows it). Why: Ownerless snippets rot. When an incident template references a retired Slack channel, someone needs to be paged to fix it. 7. Organize files by domain, not by author Rule: One file per domain (git.yml, incident.yml, sql.yml), never alex-snippets.yml. Why: Author-based files make ownership personal, make deduplication impossible, and become orphaned when people change teams. 8. Review snippets like code, but lightly Rule: Changes go through pull requests with one approver from the owning domain. Use a short checklist: trigger follows the prefix rule, no secrets, description present, no collision. Why: Heavy process kills contribution. A one-approver rule keeps the library healthy without making a typo fix feel like a release. 9. Deprecate, don’t delete Rule: When retiring a snippet, keep the trigger for a release or two, make it expand to a short notice pointing to its replacement, then remove it. Why: Muscle memory outlives documentation. A trigger that silently stops working looks like a bug in the tool. 10. Test the destructive ones Rule: Any snippet that expands to