본문으로 건너뛰기
Skillpedia
에이전트41k · #6813

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/.agents/skills/editing-agents-md/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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_id when 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬