{"_id":"@47nation/agent-policy","name":"@47nation/agent-policy","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@47nation/agent-policy","version":"0.1.0","description":"Vendor-neutral CLI to keep AI coding-agent instruction files in sync and enforce commit attribution.","keywords":["agents","ai","claude","copilot","agents-md","claude-md","cli"],"license":"MIT","author":{"name":"Vivek","email":"vivek.selvarajan@getbaraka.com"},"homepage":"https://github.com/V-ivek/agent-policy","repository":{"type":"git","url":"git+https://github.com/V-ivek/agent-policy.git"},"bugs":{"url":"https://github.com/V-ivek/agent-policy/issues"},"type":"module","engines":{"node":">=20"},"bin":{"agent-policy":"dist/cli.js"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","lint":"eslint .","format":"prettier --write .","prepublishOnly":"npm run build"},"dependencies":{"ajv":"^8.12.0","ajv-formats":"^3.0.1","commander":"^12.0.0","yaml":"^2.4.0"},"devDependencies":{"@types/node":"^20.11.0","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","eslint":"^8.57.0","prettier":"^3.2.0","tsup":"^8.0.0","typescript":"^5.4.0","vitest":"^4.1.4"},"gitHead":"2e412fffba34a0f241c00df6752cab069513cd00","_id":"@47nation/agent-policy@0.1.0","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-uWINxrU4xEhcLqud6xSOstBMbrI21zaZhAv9NATRbWoZOx8TmEXTar/XUhmTG5IwbkvnQCzikNfospz/+maLCA==","shasum":"6cf4f436be2c6e1805ca4b0040f9f98f0f931b43","tarball":"https://registry.npmjs.org/@47nation/agent-policy/-/agent-policy-0.1.0.tgz","fileCount":6,"unpackedSize":87986,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC6Lvbx8LEkWTeAN/X6TYVODPk/VNgu+BOVzTyEH3nkHAIhALB3eC9pa2lgPG0aSsvLFSntRS1Rw/5Qx7Ldq08vkEEP"}]},"_npmUser":{"name":"v-ivek","email":"agent47vivek@gmail.com"},"directories":{},"maintainers":[{"name":"v-ivek","email":"agent47vivek@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-policy_0.1.0_1776520944030_0.9135646090977458"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T14:02:23.918Z","0.1.0":"2026-04-18T14:02:24.215Z","modified":"2026-04-18T14:02:24.396Z"},"maintainers":[{"name":"v-ivek","email":"agent47vivek@gmail.com"}],"description":"Vendor-neutral CLI to keep AI coding-agent instruction files in sync and enforce commit attribution.","homepage":"https://github.com/V-ivek/agent-policy","keywords":["agents","ai","claude","copilot","agents-md","claude-md","cli"],"repository":{"type":"git","url":"git+https://github.com/V-ivek/agent-policy.git"},"author":{"name":"Vivek","email":"vivek.selvarajan@getbaraka.com"},"bugs":{"url":"https://github.com/V-ivek/agent-policy/issues"},"license":"MIT","readme":"# agent-policy\n\n[![CI](https://github.com/V-ivek/agent-policy/actions/workflows/ci.yml/badge.svg)](https://github.com/V-ivek/agent-policy/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/@47nation/agent-policy.svg)](https://www.npmjs.com/package/@47nation/agent-policy)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n**Vendor-neutral CLI to keep AI coding-agent instruction files in sync and enforce commit attribution.**\n\n## Why this exists\n\nAI coding tools read different repository instruction files: `AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`, and more over time. Maintainers end up hand-editing three near-duplicate documents, or worse, one goes stale and the agents that rely on it quietly drift.\n\nSeparately, when AI assists with a commit, attribution is inconsistent or absent. Which model? Which prompt? Was this human-only or hybrid? You cannot audit what you do not record.\n\n`agent-policy` solves both with one small tool:\n\n- **One canonical `agent-policy.yaml`** is the source of truth.\n- **Generators** produce `AGENTS.md`, `CLAUDE.md`, and `.github/copilot-instructions.md` deterministically.\n- **A git `commit-msg` hook** enforces an `Assisted-by:` footer with a simple, machine-readable format.\n\n## Install\n\n```sh\nnpm install -g @47nation/agent-policy\n```\n\nOr run ad hoc:\n\n```sh\nnpx @47nation/agent-policy init\n```\n\n## Quick start\n\n```sh\n# 1. Scaffold the canonical config\nagent-policy init\n\n# 2. Edit agent-policy.yaml (sections, attribution, renderer paths)\n\n# 3. Generate the instruction files\nagent-policy sync\n\n# 4. Install the commit-msg hook (one time per clone)\nagent-policy install-hooks\n\n# 5. Commit with attribution\ngit commit -m \"feat: add widget\n\nAssisted-by: claude:opus-4-7\"\n```\n\n## Example config\n\n```yaml\nversion: 1\n\nproject:\n  name: my-repo\n\npolicy:\n  sections:\n    - id: overview\n      title: Overview\n      body: |\n        Describe what this repo does.\n\nattribution:\n  assisted_by:\n    required: true\n\nrenderers:\n  agents_md:\n    enabled: true\n  claude_md:\n    enabled: true\n    concise: true\n  copilot_instructions:\n    enabled: true\n    concise: true\n```\n\nSee [`examples/full/agent-policy.yaml`](examples/full/agent-policy.yaml) for a realistic example with section targeting and every option.\n\n## Example generated output\n\nFrom `examples/full/AGENTS.md`:\n\n```markdown\n<!-- Generated by agent-policy. Do not edit directly. Edit agent-policy.yaml instead. -->\n<!-- agent-policy:hash=1c57397774466302 -->\n\n# full-example\n\nA realistic agent-policy config that exercises every renderer and every attribution option.\n\n## Project overview\n\nThis repo is a worked example of an agent-policy setup...\n```\n\nEvery generated file carries the banner and a content hash, so tooling can tell \"user edited the generated file\" apart from \"policy changed.\"\n\n## Example commit attribution\n\nValid:\n\n```\nfeat: add widget\n\nAssisted-by: claude:opus-4-7\n```\n\n```\nfeat: hybrid\n\nAssisted-by: claude:opus-4-7\nAssisted-by: copilot:v1\n```\n\n```\nchore: rename variable\n\nAssisted-by: n/a\n```\n\nInvalid (hook blocks the commit):\n\n```\nfix: something\n\nAssisted-by: just-an-agent-no-model-version\n```\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `agent-policy init` | Scaffold `agent-policy.yaml` |\n| `agent-policy validate` | Parse and schema-validate the config |\n| `agent-policy render` | Render to stdout (useful for diff review) |\n| `agent-policy sync` | Render all enabled renderers to disk |\n| `agent-policy sync --check` | Drift-check for CI (exit 1 on drift) |\n| `agent-policy check-commit <file>` | Validate a commit message file |\n| `agent-policy install-hooks` | Install the `commit-msg` hook |\n\nSee [`docs/commands.md`](docs/commands.md) for flags and exit codes.\n\n## Claude Code integration (`47nation`)\n\nA companion Claude Code plugin lives under [`integrations/claude-code/47nation/`](integrations/claude-code/47nation/). It provides slash commands (`/agent-policy:init`, `/agent-policy:sync`, `/agent-policy:check`, `/agent-policy:render`) and a skill that teaches Claude the commit-attribution convention for your repo.\n\nSee [`docs/claude-code-integration.md`](docs/claude-code-integration.md) for install instructions.\n\n## Development\n\n```sh\ngit clone https://github.com/V-ivek/agent-policy\ncd agent-policy\nnpm install\nnpm test          # vitest (68+ tests)\nnpm run typecheck # tsc --noEmit\nnpm run lint      # eslint\nnpm run build     # bundle to dist/cli.js\n```\n\n## Contributing\n\nIssues and pull requests welcome. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for dev setup and how to add a new renderer.\n\n## License\n\nMIT — see [`LICENSE`](LICENSE).\n","readmeFilename":"README.md","_rev":"1-fea932fd6756750f20fa37ea003bb6be"}