editing-agents-md
하는 일
이 스킬은 AI 코딩 도구가 세션을 시작할 때 읽는 지침 파일에 무엇을 넣을지 고르도록 돕습니다. 이 파일을 관리하면서 짧고 유용하게 유지하려는 사람을 위한 것입니다.
사용하는 경우
- ✓AGENTS.md나 CLAUDE.md 파일에 새 규칙을 추가하고 싶을 때.
- ✓규칙이 계속 어겨져서 누군가 문서로 적자고 제안할 때.
- ✓지침 파일이 길어져서 줄여야 할 때.
스킬 링크
https://github.com/PostHog/posthog/blob/master/.agents/skills/editing-agents-md/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 규칙이 제 CLAUDE.md 파일에 들어가야 하는지 판단해 주고, AI가 따를 수 있게 다시 써 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
먼저 린터나 테스트 같은 다른 방법으로 규칙을 강제할 수 있는지 묻습니다. 다른 방법이 맞지 않을 때만 규칙을 파일에 남기고, 분명하게 다시 씁니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Editing AGENTS.md
The root AGENTS.md loads in full at the start of every session, in every tool that reads it.
A line you add is paid for by every task in the repo, forever, whether or not that task touches the subject.
So the question is never "is this true?" — it is "is this worth loading into every session?"
Two findings set the frame:
- Adding a context file raises inference cost by over 20% on average, and does not reliably raise task success (2602.11988). A second study measured the opposite sign on runtime and tokens (2601.20404). The evidence is mixed, which argues for a small sharp file rather than no file.
- File size, instruction position, file architecture, and contradictions between adjacent files each produced no detectable effect on whether an agent follows a rule, across 1,650 sessions (2605.10039).
Read the second one carefully, because it kills a whole class of proposals. Moving a section higher "so the agent sees it" is churn against a null result. Do not reorder for attention. Reorder only when a heading makes a rule easier for a human to find or cite.
1. Does this belong in the file at all?
Work down this ladder and stop at the first rung that fits. It is the same ladder AGENTS.md states for itself.
| Rung | Mechanism | Use when |
|---|---|---|
| 1 | Linter — ruff, oxlint, semgrep (.semgrep/rules/devex/) |
The violation is a code pattern a matcher can see |
| 2 | lint-staged / pre-commit | It needs the file list or the working tree, not the AST |
| 3 | Skill (.agents/skills/) |
It applies to one kind of task, not every task |
| 4 | A rule in AGENTS.md | None of the above can carry it |
Rung 4 is the last resort, not the default.
A convention that a semgrep rule could catch belongs in .semgrep/rules/devex/ — read its README for the severity choice and the WARNING-to-ERROR ratchet.
Put the migration playbook in the rule's message: field, because that is what an author actually reads when it fires.
Rung 3 is the one people skip most. If a rule only matters while merging a PR, writing a migration, or building a workflow, it belongs in that skill, where it loads on demand and can be ten times longer.
2. Check the six smells
Measured across 100 popular repositories (2606.15828). Prevalence in brackets.
- Lint leakage [62%] — the rule restates what a linter already blocks. This is the most common failure by a wide margin. Do not delete the reasoning, but cut it to the reason plus the rule id, and tag it. CI is the check; the prose is only the why.
- Context bloat [42%] — content that does not apply to most sessions. Environment-specific setup, product documentation, anything a
docs/page should hold. Target is under 200 lines. - Skill leakage [35%] — task-specific instructions sitting in the always-loaded file instead of a skill.
- Conflicting instructions [28%] — two rules that disagree, often because one aged. Grep for the other statement before you add yours.
- Init fossilization [24%] — text nobody has reviewed since it was generated. If you are editing near a stale rule, verify it still holds and fix it in the same diff.
- Blind references [16%] — a link with no statement of what it holds and when to read it. Every link needs a "read this when …" clause, or an agent has no basis to spend a tool call on it.
3. Write the rule as an invariant, not an instruction
The file is read by authors and reviewers alike. An invariant serves both; an instruction has to be translated.
- Say what must be true: "Every tenant-data model must have
team_id." - Not what to do: "Remember to add
team_idwhen you make a model."
Be specific and imperative. A vague preference changes nothing.
"Use uv pip, never pip" works. "We prefer uv" does not.
Name the trigger the rule fires on, so a reader scanning a diff knows when it applies.
Keep to the repo's prose conventions: ASD-STE100 Simplified Technical English, active voice, one
자주 묻는 질문
왜 모든 규칙을 파일에 넣으면 안 되나요?
파일의 모든 줄은 매 세션마다 불러와지므로, 긴 파일은 비용을 늘리고 AI가 규칙을 따르는 데 항상 도움이 되지는 않습니다. 짧고 핵심적인 파일이 더 잘 작동합니다.
이 내용은 CLAUDE.md 파일에도 적용되나요?
네. AGENTS.md와 CLAUDE.md는 둘 다 세션 시작 시 불러와지므로 같은 조언이 적용됩니다.
AI가 보도록 규칙을 파일 위쪽으로 옮겨야 하나요?
보통은 아닙니다. 이 스킬의 근거가 된 연구에서는 위치가 에이전트의 규칙 준수 여부를 안정적으로 바꾸지 못했으므로, 사람이 섹션을 찾기 쉽게 할 때만 순서를 바꾸세요.
상세 정보
작성자의 원본 설명
Decide whether a rule belongs in an AGENTS.md / CLAUDE.md file, and write it so it holds. Use before adding, editing, or removing any instruction in a root or nested AGENTS.md, when a convention keeps getting broken and someone proposes documenting it, when reviewing a diff that touches one, or when a file has grown and needs a trim. Carries the enforcement-tag convention (`[lint: <id>]` / `[review]`), the six configuration smells to check against, and the size budget. Trigger terms: AGENTS.md, CLAUDE.md, agent instructions, context file, add a rule, document this convention, the file is too l
repo: PostHog/posthog
인기도
- GitHub 스타
- 41k
- 순위
- #6813
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
depot-ci
41k에이전트가 GitHub Actions 대안인 Depot CI 워크플로를 설정하고 실행하도록 돕습니다. 기존 워크플로 이전과 실행 로그 읽기를 포함합니다.
depot-container-builds
41k에이전트가 Depot 원격 빌더에서 Docker 이미지를 빌드하도록 돕습니다. 다중 플랫폼 이미지, 레지스트리 푸시, 빌드 실패 수정을 포함합니다.
depot-github-runners
41k에이전트가 GitHub Actions 작업을 Depot 관리형 러너로 옮기고, 러너 크기와 라벨을 고르도록 돕습니다.
formatting-slack-messages
41k에이전트가 Slack 메시지, 모달, 홈 화면을 Slack의 최신 규칙에 맞춰 명확하게 구성하도록 돕습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.