Skip to content
Development
Skill

/agentsop-conventions-pinning

SOP for writing, loading, and evolving a project-level convention file (CONVENTIONS.md / CLAUDE.md / .cursor/rules / .clinerules / AGENTS.md) so that a coder-agent reliably respects your codebase's style choices every session. Tool-agnostic; covers the four load mechanics

From plugin
skillalchemy
46149 skills

Claude Code

$ npx -y skills add agentsope/SkillAlchemy --skill agentsop-conventions-pinning --agent claude-code

SKILL.md

agentsop-conventions-pinning.SKILL.md
name: agentsop-conventions-pinning
version: 0.1.0
description: SOP for writing, loading, and evolving a project-level convention file (CONVENTIONS.md / CLAUDE.md / .cursor/rules / .clinerules / AGENTS.md) so that a coder-agent reliably respects your codebase's style choices every session. Tool-agnostic; covers the four load mechanics (read-only attachment, ancestor-walk auto-load, glob-scoped rules, agent backstory) and the conflict resolution between pinned conventions and the existing code.
domain: coder-agent infrastructure / context engineering
audience: coder-agents and engineers configuring them, on any project lived in for > 1 day
trigger_keywords:
  - "conventions file"
  - "CONVENTIONS.md"
  - "CLAUDE.md"
  - ".cursorrules"
  - ".clinerules"
  - "AGENTS.md"
  - "coding standards for AI"
  - "style guide for agent"
  - "agent ignored my rule"
  - "pin my coding style"
when_to_use:
  - "any project you (or your agent) will return to more than once"
  - "the same correction has been typed into chat more than twice"
  - "code review (human or LLM) keeps catching style violations the agent should know"
  - "onboarding a new agent / new teammate; they need the project's tacit rules in writing"
  - "you switch coder-tools and want one canonical style source across Aider, Claude Code, Cursor, Cline"
when_not_to_use:
  - "one-off / throwaway scripts where the cost of writing rules > the cost of the work"
  - "true greenfield where conventions ARE being invented as code; pin AFTER the first 2-3 modules stabilise"
  - "you need hard enforcement (lint/format/CI) — conventions are guidance, hooks/precommit are enforcement"
  - "the project already has a lint config that fully encodes the rule — point at the lint config instead"

Conventions Pinning — Writing a Style Guide Your Coder-Agent Will Actually Read

> One line: a conventions file is **the system prompt of your codebase**. Treat it like a system prompt, not like a README. Anti-patterns: writing prose, narrating history, marketing the project. Patterns: command-first, verifiable, "prefer X over Y", < 200 lines.

---

1. 何时激活 (When to Activate)

1.1 Direct triggers

  • The user (human or upstream agent) asks "how do I make Claude/Cursor/Cline/Aider respect our style?".
  • The same correction has been typed in chat ≥ 2 times this week ("use httpx not requests", "add type hints", "no comments on every line"). Claude Code's docs codify this rule: *"Add to it when Claude makes the same mistake a second time."* [code.claude.com/docs/en/memory]
  • A new project is past the "first 2 modules" phase — there are now style choices implicit in the code that an outsider (or fresh-context agent) can't see.
  • The team is switching coder-tools (Aider → Claude Code, or adding Cursor) and conventions are scattered in chat history.
  • An AI code review caught the same anti-pattern twice.

1.2 Reverse triggers (skip)

  • **One-off / throwaway scripts**. The write-cost of a conventions file is fixed; the savings are proportional to session count. < 3 sessions → don't bother.
  • **True greenfield**. The first 2-3 files of a project ARE the convention. Pinning style before the style exists locks in arbitrary choices.
  • **Hard enforcement needed**. A conventions file is *context*, not a *hook*. Claude Code's docs are explicit: *"CLAUDE.md instructions shape Claude's behavior but are not a hard enforcement layer."* [code.claude.com/docs/en/memory] If the rule must run every time (e.g. "must `make lint` before commit"), write a hook / precommit / CI check.
  • **The rule is already in a config that the agent can read** — `.eslintrc`, `pyproject.toml`, `.editorconfig`, `tsconfig.json`. Point the agent at the config; don't duplicate.

1.3 Mental check

> A conventions file earns its tokens only if it contains **information that is not already in the repository**. The research is unambiguous on this: *"Developer-written context files performed better for exactly the reason you'd guess: they contained information that wasn't already in the repository — tooling preferences, workflow requirements, conventions that existed in developers' heads but not in any documentation."* [developer.upsun.com/posts/ai/agents-md-less-is-more]

If everything you would write into CONVENTIONS.md is already discoverable from `package.json`, `pyproject.toml`, `.eslintrc`, the test directory, and obvious code patterns — don't write the file. The agent will pre-cache it itself.

---

2. 核心心智模型 (Mental Model)

2.1 Convention as compile-time, code-review as runtime

+-------------------------------------+   +-------------------------------------+
|  COMPILE-TIME (conventions file)    |   |  RUNTIME (code review / lint / CI)  |
|                                     |   |                                     |
|  - Loaded once per session          |   |  - Runs on every change             |
|  - Shapes generation                |   |  - Catches violations after-the-fact|
|  - Cheap to update, free to ignore  |   |  - Costly to set up, hard to ignore |
|  - "Prefer X over Y" lives here     |   |  - "X must always hold" lives here  |
|  - Style + intent + preferences     |   |  - Invariants + safety + correctness|
+-------------------------------------+   +-------------------------------------+
        ^                                            ^
        |        Conventions guide;                  |
        |        review enforces.                    |
        |        Both are needed; they fail          |
        |        in different ways.                  |

Conventions fail by **silent drift**: agent ignores the rule once, no one notices, code is merged. Review fails by **late catch**: violation is found post-PR, expensive to fix. The two complement, not substitute.

2.2 The four load mechanics across the ecosystem

Every coder-tool has settled on one of four mechanics for getting persistent context into the agent. Knowing which mechanic your tool uses is

Read more
@agentsope
Ships withskillalchemy

Turn people, methods, and experience into installable, reusable agent skills. SkillAlchemy is an open-world agent skill creation system that turns underspecified skill briefs and open-world sources into installable, reusable agent skills.

Stars on GitHub

Momentum

stars in total
461
Star history of agentsope/SkillAlchemy on GitHub, a chart by star-history.com

Other skills on skillalchemy.

LEAP

LEAP

LEAP builds skills through two pipelines: Branch A distills a skill from raw data, while Branch B combines multiple skills into…

Lens

Lens

Lens — Add a cognitive lens to any problem. It accepts a task description and produces an enhanced description that surfaces…

agentsop-aider

agentsop-aider

SOP for terminal-based, git-native AI pair programming with Aider (git work-tree + tree-sitter repo-map + edit-format +…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about agentsop-conventions-pinning.

Which coding agents can use agentsop-conventions-pinning?
agentsop-conventions-pinning installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.