홈 / Skills / 개발 생산성 / 컨텍스트 엔지니어링 Context Engineering
개발 생산성

컨텍스트 엔지니어링 Context Engineering

Addy OsmaniMITSkill 언어: 영어
라이선스 확인됨스크립트 없음낮은 위험
실행 예시실제 실행 · claude-sonnet-5-5 · 2026년 10월
My AI coding agent keeps ignoring our conventions on a Next.js 15 + TypeScript + Prisma + Tailwind project (fictional example): it uses default exports, invents helper functions that already exist in src/lib, and edits the Prisma schema without asking. I am about to start the "checkout" feature (src/checkout/ and src/lib/payments.ts). Please set up the agent's context properly: write the rules file in the current folder and a short task context block I can paste at the start of the session.
Skill: context-engineering

I wrote CLAUDE.md in the current folder. Since the project is fictional, I couldn't check it against real files, so a few parts are guesses (listed below).

The rules file covers your three problems directly:

  • Default exports: named exports only, with a short exception list for the files Next.js requires to be default.
  • Invented helpers: the agent must search src/lib/ before writing any helper. If it thinks one is missing, it has to say what it searched and ask first.
  • Prisma schema: it may not edit schema.prisma or run migrate or db push without approval. It must stop and describe the change instead.

It also tells the agent to ask rather than guess when requirements conflict or are missing.

Task context block to paste at the session start

TASK: Implement the "checkout" feature.

SCOPE (only touch these):
- src/checkout/        (new feature code: UI, server actions, types)
- src/lib/payments.ts  (payment logic)

READ FIRST, before writing anything:
- src/lib/payments.ts and `ls src/lib` (reuse existing helpers; list what you found)
- One existing feature folder in src/ as the pattern to follow: <PATH, e.g. src/cart/>
- The relevant Prisma models (read-only): <MODEL NAMES, e.g. Order, OrderItem, Payment>

CONSTRAINTS:
- Follow CLAUDE.md: named exports, reuse src/lib, no new deps.
- Do NOT modify prisma/schema.prisma. If checkout needs a schema change, stop and propose it.
- Never log or store raw card data; <PAYMENT PROVIDER, e.g. Stripe> handles it.

OPEN QUESTIONS (ask me, don't guess): <e.g. guest checkout? tax/shipping rules? failure and retry behavior?>

FIRST STEP: reply with a short plan (files to create or change, existing helpers you'll reuse), then wait for my go-ahead.

What you need to fill in

  • Commands: I assumed standard npm scripts. Check them against your package.json.
  • Pattern example: The example at the bottom is a placeholder. Swap in a real file from your repo, because one concrete example does more than any rule.
  • Block placeholders: Fill the <...> spots in the pasted block (pattern folder, Prisma models, payment provider, open questions).
  • Session length: Start a fresh session when checkout is done. If the session runs long, compact the history around 75% of the window and keep the task block and constraints intact.

Test run on a fictional Next.js project: the model wrote a CLAUDE.md in a temporary folder and a task context block, and said which parts were guesses (commands, the pattern example, placeholders). It could not check the rules against real project files.

하는 일

컨텍스트를 에이전트 출력 품질을 좌우하는 가장 큰 지렛대로 봅니다. 가장 지속적인 것부터 가장 일시적인 것까지 5단계(규칙 파일, 명세와 아키텍처, 관련 소스 파일, 오류 출력, 대화 기록)의 계층을 제시하고, 규칙 파일(CLAUDE.md, .cursorrules, AGENTS.md 등) 작성법을 기술 스택, 명령, 규약, 경계, 패턴 예시 하나와 함께 보여 줍니다. 관련 명세 부분만 불러오기, 편집 전에 그 파일과 비슷한 예시 읽기, 외부 파일 속 지시처럼 보이는 글은 데이터로 취급하기, 실제로 실패한 오류만 되돌려 주기, 다시 시작할 수 있는 세션 경계, 세 가지 묶기 전략(브레인 덤프, 선택적 포함, 계층적 요약), 예산 규칙(약 75%에서 줄이기 시작, 버리기 전에 압축, 작업에 가장 중요한 내용을 맨 뒤에 두기)도 다룹니다. 충돌이나 빠진 요구 사항은 추측하지 말고 드러내라고 요구합니다.

결과물

프로젝트의 규칙 파일, 세션 시작 때 붙여 넣을 짧은 작업 컨텍스트 블록, 아직 채워야 할 항목 목록.

이런 때 좋습니다

AI 지원 개발을 위해 프로젝트를 설정할 때, 규약을 무시하거나 헬퍼를 지어내거나 긴 세션에서 초점을 잃는 에이전트를 고치고 싶을 때.

참고 사항 및 위험

낮은 위험:지침만 있는 파일로 스크립트가 없습니다. 프로젝트에 CLAUDE.md 같은 규칙 파일을 쓰고 추가할 수 있는 MCP 서버를 언급하지만 설치하지는 않습니다. 규칙 파일은 에이전트의 행동을 바꾸므로 쓰인 내용을 읽어 보세요. 가상의 Next.js 프로젝트로 한 번 시험했고 CLAUDE.md와 작업 블록을 쓰면서 실제 파일로 확인할 수 없어 추측한 부분(명령, 패턴 예시)을 표시했습니다. 작성자 Addy Osmani, MIT.

SKILL.md 원본패키지에 파일 2개