Monorepo entrypoint for coding agents working in gardens-v2.
- Repo root:
/home/corantin/Documents/GitHub/gardens-v2 - Package manager:
pnpm - Task runner:
turbo - Workspace globs from
pnpm-workspace.yaml:apps/*pkg/*
- Use this root file for monorepo-wide rules and package routing.
- When work is scoped to a package, switch to that package's local
AGENTS.mdand follow it. - If a task spans multiple packages, use the root file first, then the local guide for each touched package.
apps/web: seeapps/web/AGENTS.mdapps/docs: seeapps/docs/AGENTS.mdpkg/contracts: seepkg/contracts/AGENTS.mdpkg/e2e: seepkg/e2e/AGENTS.mdpkg/eslint-config-custom: seepkg/eslint-config-custom/AGENTS.mdpkg/services: seepkg/services/AGENTS.mdpkg/subgraph: seepkg/subgraph/AGENTS.mdpkg/tsconfig: seepkg/tsconfig/AGENTS.mdpkg/ui: seepkg/ui/AGENTS.md
- Prefer
rgandrg --filesfor discovery. - Expect a dirty worktree. Do not revert unrelated user changes.
- Treat generated outputs as derived unless the task explicitly targets them.
- Check package-local scripts before inventing ad hoc workflows.
- When changing contract interfaces, verify whether
pkg/subgraphandapps/webalso need updates. - When changing network support, keep contracts, subgraph config, and frontend chain config aligned.
- This repo includes a local skill library under
skills/. - Also use relevant installed skills from
npx skills add vercel-labs/agent-skillswhen they match the task domain, especially for frontend, Next.js, Vercel, browser verification, documents, spreadsheets, presentations, PDFs, or other specialized workflows not covered by the repo-local skills. - For Gardens E2E test creation, repair, or flakiness work, consult
skills/e2e-test-maker/SKILL.md. - For Gardens proposal drafting or creation flows, consult
skills/proposal-creator/SKILL.md. - For Gardens indexed data or entity lookup tasks, consult
skills/query-subgraph/SKILL.md. - For Gardens on-chain read tasks, address/ABI resolution, or
cast callusage, consultskills/read-contracts/SKILL.md. - For Gardens state-changing transactions, calldata encoding, multisig payloads, or write preparation, consult
skills/write-contract/SKILL.md. - When multiple skills apply, prefer this order:
query-subgraph,read-contracts,write-contract. - Users may invoke these skills explicitly with
$e2e-test-maker,$query-subgraph,$read-contracts, or$write-contract.
Run from the repo root when the task spans packages:
pnpm install
pnpm build
pnpm dev
pnpm lint
pnpm test
pnpm formatUseful targeted commands:
pnpm --filter web build
pnpm --filter web lint
pnpm --filter web typecheck
pnpm --filter docs build
pnpm --filter foundry build
pnpm --filter foundry test
pnpm --filter subgraph buildapps/web/src/generated.tsbroadcast/**pkg/subgraph/generated/**pkg/subgraph/build/**pkg/subgraph/.graphclient/**
Avoid editing vendored or cache directories unless the task explicitly targets them.
Use this workflow when triaging a GitHub Security Advisory, bounty eligibility question, duplicate report, severity reconsideration, or "is this exploitable" security report.
- Start from existing public guidance before evaluating the new claim:
SECURITY.mdsecurity/advisory-history.mdsecurity/known-non-eligible-findings.md- relevant security reports under
security/
- Compare by root cause, not only by title or PoC:
- Treat reports as duplicates when they rely on the same underlying bug, even if the symptom, route, or reproduction is different.
- If a report claims a bypass of an already-known issue, identify exactly what precondition or production path makes it different.
- Ground eligibility and severity in the current production surface:
- Confirm whether the affected code is deployed and used by current Gardens flows.
- Separate intended design, trusted-admin actions, local/test/deprecated code, unexecuted upgrade payloads, and non-production registry paths from production-reachable vulnerabilities.
- For severity reductions, record the concrete reason, such as no direct theft, upgrade/recovery path, trusted-role requirement, limited affected pool type, or required governance-state preconditions.
- Update the advisory ledger whenever a decision changes or a new advisory is acknowledged:
- Add or edit the matching row in
security/advisory-history.md. - Include advisory id, decision, severity, status, affected component, root cause, and duplicate guidance.
- Include bounty proposal links or fixed commit references when they are known and public.
- Do not publish private exploit details that should remain confined to a private advisory.
- Add or edit the matching row in
- Keep public researcher guidance aligned:
- If the decision creates a reusable non-eligible, intended-design, out-of-scope, or duplicate category, update
security/known-non-eligible-findings.md. - If the bounty process or discovery path changes, update
SECURITY.md.
- If the decision creates a reusable non-eligible, intended-design, out-of-scope, or duplicate category, update
- Before finishing, verify documentation consistency:
rg -n "<advisory-id>|<root-cause-keyword>" SECURITY.md security/advisory-history.md security/known-non-eligible-findings.md securitygit diff --check- Report any advisory decision that was intentionally not added to public docs because it is still private or unresolved.
Use this workflow when .github/workflows/web-audit.yml or pnpm --dir apps/web audit:check reports high or critical advisories.
-
Reproduce the exact failing revision.
- Read the Actions run and job metadata to confirm the failing step, branch, and head SHA.
- Work from the current
origin/maincommit when the failure is onmain; do not diagnose from an unrelated feature branch whose lockfile happens to pass. - If
mainis already checked out in another worktree, use that clean worktree or create a temporary worktree fromorigin/main. Do not disturb another task's checkout.
-
Run the repository audit commands with advisory-registry network access:
pnpm --dir apps/web audit:check pnpm --dir apps/web audit:resolve
audit:checkis the CI-equivalent gate.audit:resolveis for triage, but its interactive writer may reject the repository's version-1apps/web/audit-resolve.jsonschema. If it fails withInvalid audit-resolve file, preserve the existing schema and add decisions directly rather than replacing or downgrading the file.
-
Inspect every high or critical finding before changing dependencies:
- Use
pnpm --filter web why <package>to enumerate runtime, build-time, and dev-only paths. - Search
apps/webfor direct imports, interceptors, parsers, image processing, user-controlled inputs, and relevant Next.js configuration. - Treat a path as reachable when untrusted input can reach the vulnerable behavior. For example, review
next.config.jsimage host rules before declaring asharpfinding unreachable.
- Use
-
Choose the smallest justified resolution:
- Upgrade or override reachable runtime packages to the first fixed compatible release.
- Snooze only a path that is not exploitable in the deployed app. Record a concrete reachability reason and a time-bounded expiry, normally about one month.
- Add one decision per advisory ID and exact dependency path emitted by the checker; a package can require several entries.
- Never use a snooze to hide a runtime package that remains vulnerable in the installed pnpm tree.
-
Keep npm audit modeling and the real pnpm install aligned:
apps/web/scripts/audit-resolver.mjsbuilds a sanitized npm manifest and carriesapps/web/package.json'soverridesinto it.- Runtime enforcement comes from root
package.jsonunderpnpm.overrides. - When fixing an overridden transitive dependency, update both the existing
apps/web/package.jsonoverridesobject and the corresponding rootpnpm.overridesentry. Do not add a secondoverrideskey to either JSON object. - Regenerate
pnpm-lock.yamlwith pnpm 9 and verifypnpm --filter web why <package>resolves the intended fixed versions.
-
Validate before publishing:
pnpm install --frozen-lockfile pnpm --dir apps/web audit:check pnpm --dir apps/web generate pnpm --dir apps/web typecheck git diff --check
- Run
generatebeforetypecheckin a fresh worktree becauseapps/web/src/generated.tsis derived and may be absent. - Do not commit
apps/web/src/generated.tsunless the task intentionally changes generated contract bindings. - Review the lockfile diff and stage only the audit decision, manifest, and lockfile changes required by the remediation.
- Run
-
Before a direct push to
main, fetchorigin/mainagain and confirm the branch has not advanced. After pushing, verify the newWeb AuditActions run is attached to the pushed commit and report whether it passed or is still running.
- Prefer package-local verification from the package guide.
- For cross-package work, validate each touched package separately instead of relying on a single root command.
- Be explicit in handoff about skipped checks caused by missing env, RPC access, or third-party credentials.