HN 표시: 모든 AI 에이전트 지침 파일에 대한 Agentfile 하나의 contract.yaml 표시

hackernews | | 📦 오픈소스
#agentfile #ai 딜 #ai 에이전트 #claude #cli #개발 도구 #프롬프트 관리
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

AI 개발 도구 Agentfile은 여러 AI 에이전트에 분산된 규칙 파일을 'contract.yaml' 하나로 통합하여 관리하는 복잡함을 해결합니다. 사용자는 CLI 명령어를 통해 GitHub Copilot, Claude, Cursor 등이 각자 요구하는 고유한 형식과 위치에 맞게 지침 파일을 자동 생성할 수 있습니다. 생성된 파일은 개발자별로 커스터마이징되며 Git 추적에서 제외되어 프로젝트 저장소를 깔끔하게 유지합니다.

본문

One contract. Every AI agent. Zero clutter. Your team uses GitHub Copilot, Claude, Cursor — each expecting its own instruction file, in its own format, in its own location. agentfile lets you define your rules once and generate the right file for each agent automatically. Generated files are never committed. Each developer only generates what they personally use. Without agentfile, you maintain the same rules in multiple places — and they drift: CLAUDE.md ← manually written .github/copilot-instructions.md ← manually written, probably out of date .cursor/rules/main.mdc ← manually written, different format .windsurfrules ← someone forgot to update this one Every rule change means touching four files. Every new team member copies the wrong one. Every new agent means another file to maintain forever. You write your rules once in ai/contract.yaml : version: 1 project: name: My Project stack: [typescript, react, nextjs] rules: coding: - Prefer small composable functions - Avoid unnecessary abstractions architecture: - Follow feature-based folder structure skills: - name: create-component description: Creates a new React component with tests steps: - Create /src/components/{feature}/{Name}.tsx - Create matching test file - Export from index.ts Then run one command: npx @agentfile/cli sync And every agent gets the right file in the right format: ✔ claude → CLAUDE.md ✔ copilot → .github/copilot-instructions.md ✔ cursor → .cursor/rules/main.mdc ✔ cursor:skill:create-component → .cursor/rules/skills/create-component.mdc ✔ agents-md → AGENTS.md Each agent receives its rules in its own native format — Claude gets readable markdown, Cursor gets structured .mdc with frontmatter, Copilot gets compact inline context. The contract is the same. The output adapts. ai/contract.yaml ← your team's rules, committed once ai/agents/ ← agent templates, committed once CLAUDE.md ← gitignored, generated per-developer .cursor/rules/main.mdc ← gitignored, generated per-developer .github/copilot-instructions.md ← gitignored, generated per-developer AGENTS.md ← gitignored, generated per-developer npx @agentfile/cli init The init command walks you through your project name, stack, and which agents your team uses — then scaffolds everything. After init, generate your personal agent files: npx @agentfile/cli sync For teams that want agentfile as a project dependency: npm install --save-dev @agentfile/agentfile Or use the scoped CLI package directly: npm install --save-dev @agentfile/cli Add to package.json : { "scripts": { "ai:sync": "agentfile sync", "ai:validate": "agentfile validate" } } Interactive setup. Scaffolds ai/contract.yaml , agent templates, .ai-agents.example , and a CI workflow. Safe to run in existing projects — never overwrites existing files. Imports existing instruction files and creates a draft ai/contract.yaml . npx @agentfile/cli migrate --from .github/copilot-instructions.md --from CLAUDE.md npx @agentfile/cli migrate --from CLAUDE.md --replace-policy archive npx @agentfile/cli migrate --from CLAUDE.md --targets claude,copilot Key options: --replace-policy keep|archive|delete --targets --exclude --dry-run --output Watches ai/ for changes and automatically re-runs sync. Runs an initial sync on start. npx @agentfile/cli watch Solves the problem of manually running sync after every contract change. Reads your personal .ai-agents file and generates the corresponding instruction files. npx @agentfile/cli sync # generate files npx @agentfile/cli sync --dry-run # render without writing — used in CI Validates ai/contract.yaml against the schema. Fast, exits 0 or 1. Designed for CI. Checks generated files against .agentfile-manifest.json and exits non-zero when drift is detected. npx @agentfile/cli diff npx @agentfile/cli diff --files CLAUDE.md,.github/copilot-instructions.md Removes generated files that can be regenerated and updates manifest ownership records. npx @agentfile/cli clean --dry-run npx @agentfile/cli clean Restores files from .agentfile-backup/ . npx @agentfile/cli rollback --list npx @agentfile/cli rollback --tag migrate-1700000000000 ai/contract.yaml is your single source of truth: version: 1 project: name: My Project stack: - typescript - react - nextjs rules: coding: - Prefer small composable functions - Avoid unnecessary abstractions architecture: - Follow feature-based folder structure - Avoid cross-feature imports testing: - Critical business logic must have unit tests naming: - Use descriptive variable names - Boolean variables must be prefixed with is, has, or should Each developer creates a .ai-agents file (gitignored) listing the agents they personally use: # .ai-agents — yours, not the team's claude cursor A committed .ai-agents.example documents the available options for new joiners. Skills define shared workflows that every agent understands. Define them once — each agent receives them in its own format. version: 1 project: name: My Project stack: [typescript, react] rules: coding: - Prefer small comp

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →