Communitygithub.com

yli769227-jpg/agent-discipline

AI 코딩 에이전트가 자신감 있게 망가진 코드를 배포하는 것을 막아주는 8가지 전투 검증된 규율 기술 — 각각 검증 가능한 완료 기준 포함. 영어/중국어 이중 언어 지원.

agent-discipline란 무엇인가요?

이 스킬은 AI 코딩 에이전트(예: Claude Code, Cursor)가 버그 투성이 코드를 자신 있게 배포하는 것을 방지하기 위해 설계된 8가지 전투 검증된 규율을 제공합니다. 각 규율에는 '완료 기준(완료判据)'이라는 검증 가능한 통과/실패 체크리스트가 포함되어 있어, 에이전트가 작업을 제대로 수행했는지 개발자가 확인할 수 있습니다. 이는 동기 부여나 약속에 의존하지 않고, grep이나 lint 검사와 같은 확인 가능한 기준을 통해 품질을 보장합니다. 영어와 중국어를 모두 지원하며, 실전 예제(EXAMPLES.md)를 통해 각 규율의 적용 방법과 안티 패턴을 명확히 보여줍니다. 개발자가 에이전트에게 코드 작성을 하위 작업으로 위임할 때 이 규율을 적용하면, 자동 생성된 코드의 안정성과 유지보수성을 크게 향상시킬 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add yli769227-jpg/agent-discipline

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Log First / 日志优先

Writing buggy code is normal. Locating the bug is the hard part — logs are how you win that part. 写代码犯错是正常的,定位问题才是真正困难的——日志就是你赢下这一关的方式。

The discipline / 纪律

  1. All new code carries key-path logs: connection established, state change, error raised, request/response. 所有新代码带关键路径日志:连接建立、状态变化、错误发生、请求/响应。
  2. Keep log format consistent and prefix each line with a module tag so it greps cleanly. 日志格式统一,每行带模块前缀,便于 grep。
  3. Error logs must carry context: which operation, which arguments, which error. 错误日志必须带上下文:什么操作、什么参数、什么错误。
  4. This applies to agent-written code too — a sub-task to write code must require key-path logging. agent 写的代码同样适用——派写代码的子任务时要写明"加关键路径日志"。(派子任务的完整必含项见 agent-team 的「派子任务必含清单」)

When this triggers / 触发时机

  • About to write a new module / interface / external call / async task.
  • Debugging a stretch of code that has no logs (add them first).
  • Before handing an agent a code-writing sub-task (require "add key-path logs").

Done criterion (verifiable) / 完成判据(可验证)

✅ A grep over the new code (e.g. grep -nE 'log\.(info|warn|error)' <file>) shows a line at each key path — connect, state change, error, request/response — each module-prefixed and carrying context. ⚠️ Some paths logged, some missing — name the gaps. ❌ The new code is silent. If it fails in prod, you'll be blind. Add logs before shipping.

Worked examples / 实战反例

Real before/after cases for this discipline live in EXAMPLES.md — read them before you act. 本纪律的真实 before/after 反例见 EXAMPLES.md —— 动手前先对照。

관련 스킬