This recipe bootstraps a JS monorepo where:
- root
package.jsondefines workspace tooling - commands are run at the root and cover the whole workspace
- package managers supported: pnpm (recommended), yarn, npm
It gives you:
AGENTS.md/RUNBOOK.mdwith safe marker-only sections.agentsgen.jsonwith explicit root commands- PR Guard workflow snippet
package.json(workspaces configured)pnpm-workspace.yaml(pnpm) ORyarn.lock(yarn) ORpackage-lock.json(npm)packages/*(orapps/*,libs/*)
If built-in presets are enough, start with agentsgen presets and agentsgen init . --preset monorepo-js before copying this recipe.
- Copy
.agentsgen.jsonfrom this folder to your monorepo root. - Run:
agentsgen init . --defaults
agentsgen update . --dry-run --print-diff
agentsgen pack . --check --format jsonCreate .github/workflows/agentsgen-guard.yml:
name: agentsgen guard + pack check
on:
pull_request:
push:
branches: [ main ]
permissions:
contents: read
pull-requests: write
jobs:
agentsgen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: markoblogo/AGENTS.md_generator/.github/actions/agentsgen-guard@main
with:
comment: "true"
files: "AGENTS.md,RUNBOOK.md"
pack_check: "true"
pack_format: "json"Notes:
- This recipe assumes you have root scripts like lint, test, build.
- If your monorepo uses turbo/nx, point the scripts to those tools.
- Set the monorepo root commands in
.agentsgen.json -> commands(oftenpnpm -w lint/test/build) to match your actual workspace tooling. - If you want per-package docs, run
agentsgen initin each package folder (or set up a separate config per workspace).