AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
81/100
Scores the file, not the repository.Length
1,340 words
19 headings · 8 code blocksRepository
76k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# AGENTS.md23Guidance for human and AI contributors working in this repository.45## 1. Purpose67Paperclip is a control plane for AI-agent companies.8The current implementation target is V1 and is defined in `doc/SPEC-implementation.md`.910## 2. Read This First1112Before making changes, read in this order:13141. `doc/GOAL.md`152. `doc/PRODUCT.md`163. `doc/SPEC-implementation.md`174. `doc/DEVELOPING.md`185. `doc/DATABASE.md`1920`doc/SPEC.md` is long-horizon product context.21`doc/SPEC-implementation.md` is the concrete V1 build contract.2223## 3. Repo Map2425- `server/`: Express REST API and orchestration services26- `ui/`: React + Vite board UI27- `packages/db/`: Drizzle schema, migrations, DB clients28- `packages/shared/`: shared types, constants, validators, API path constants29- `packages/adapters/`: agent adapter implementations (Claude, Codex, Cursor, etc.)30- `packages/adapter-utils/`: shared adapter utilities31- `packages/plugins/`: plugin system packages32- `doc/`: operational and product docs3334## 4. Dev Setup (Auto DB)3536Use embedded PGlite in dev by leaving `DATABASE_URL` unset.3738```sh39pnpm install40pnpm dev41```4243This starts:4445- API: `http://localhost:3100`46- UI: `http://localhost:3100` (served by API server in dev middleware mode)4748Quick checks:4950```sh51curl http://localhost:3100/api/health52curl http://localhost:3100/api/companies53```5455Reset local dev DB:5657```sh58rm -rf data/pglite59pnpm dev60```6162## 5. Core Engineering Rules63641. Keep changes company-scoped.65Every domain entity should be scoped to a company and company boundaries must be enforced in routes/services.66672. Keep contracts synchronized.68If you change schema/API behavior, update all impacted layers:69- `packages/db` schema and exports70- `packages/shared` types/constants/validators71- `server` routes/services72- `ui` API clients and pages73743. Preserve control-plane invariants.75- Single-assignee task model76- Atomic issue checkout semantics77- Approval gates for governed actions78- Budget hard-stop auto-pause behavior79- Activity logging for mutating actions80814. Do not replace strategic docs wholesale unless asked.82Prefer additive updates. Keep `doc/SPEC.md` and `doc/SPEC-implementation.md` aligned.83845. Keep repo plan docs dated and centralized.85When you are creating a plan file in the repository itself, new plan documents belong in `doc/plans/` and should use `YYYY-MM-DD-slug.md` filenames. This does not replace Paperclip issue planning: if a Paperclip issue asks for a plan, update the issue `plan` document per the `paperclip` skill instead of creating a repo markdown file.86876. Attach inspectable generated artifacts.88When your task produces a user-inspectable deliverable file, follow the Paperclip skill's "Generated Artifacts and Work Products" workflow before final disposition. In this repo, prefer the self-contained skill helper at `skills/paperclip/scripts/paperclip-upload-artifact.sh` so the file is available through the Paperclip API, create/update an artifact work product when the file is the deliverable, link the uploaded artifact in the final issue comment, and then set status. Do not rely on local filesystem paths as the only access path. If an important file intentionally remains workspace-only, create/update a work product with `metadata.resourceRef.kind: "workspace_file"` and a workspace-relative path, then name that work product and path in the final comment. Treat browse/search as a fallback for recovering workspace files, not the preferred deliverable path. See `doc/AGENT-ARTIFACTS.md` for details and `.mp4`/`.webm` examples.8990## 6. Database Change Workflow9192When changing data model:93941. Edit `packages/db/src/schema/*.ts`952. Ensure new tables are exported from `packages/db/src/schema/index.ts`963. Generate migration:9798```sh99pnpm db:generate100```1011024. Validate compile:103104```sh105pnpm -r typecheck106```107108Notes:109- `packages/db/drizzle.config.ts` reads compiled schema from `dist/schema/*.js`110- `pnpm db:generate` compiles `packages/db` first111112## 7. Verification Before Hand-off113114Default local/agent test path:115116```sh117pnpm test118```119120This is the cheap default and only runs the Vitest suite. Browser suites stay opt-in:121122```sh123pnpm test:e2e124pnpm test:release-smoke125```126127Run the browser suites only when your change touches them or when you are explicitly verifying CI/release flows.128129For normal issue work, run the smallest relevant verification first. Do not default to repo-wide typecheck/build/test on every heartbeat when a narrower check is enough to prove the change.130131Run this full check before claiming repo work done in a PR-ready hand-off, or when the change scope is broad enough that targeted checks are not sufficient:132133```sh134pnpm -r typecheck135pnpm test:run136pnpm build137```138139If anything cannot be run, explicitly report what was not run and why.140141## 8. API and Auth Expectations142143- Base path: `/api`144- Board access is treated as full-control operator context145- Agent access uses bearer API keys (`agent_api_keys`), hashed at rest146- Agent keys must not access other companies147148When adding endpoints:149150- apply company access checks151- enforce actor permissions (board vs agent)152- write activity log entries for mutations153- return consistent HTTP errors (`400/401/403/404/409/422/500`)154155## 9. UI Expectations156157- Keep routes and nav aligned with available API surface158- Use company selection context for company-scoped pages159- Surface failures clearly; do not silently ignore API errors160161## 10. Pull Request Requirements162163When creating a pull request (via `gh pr create` or any other method), you **must** read and fill in every section of [`.github/PULL_REQUEST_TEMPLATE.md`](.github/PULL_REQUEST_TEMPLATE.md). Do not craft ad-hoc PR bodies — use the template as the structure for your PR description. Required sections:164165- **Thinking Path** — trace reasoning from project context to this change (see `CONTRIBUTING.md` for examples)166- **What Changed** — bullet list of concrete changes167- **Verification** — how a reviewer can confirm it works168- **Risks** — what could go wrong169- **Model Used** — the AI model that produced or assisted with the change (provider, exact model ID, context window, capabilities). Write "None — human-authored" if no AI was used.170- **Checklist** — all items checked171172## 11. Definition of Done173174A change is done when all are true:1751761. Behavior matches `doc/SPEC-implementation.md`1772. Typecheck, tests, and build pass1783. Contracts are synced across db/shared/server/ui1794. Docs updated when behavior or commands change1805. PR description follows the [PR template](.github/PULL_REQUEST_TEMPLATE.md) with all sections filled in (including Model Used)181182## 11. Fork-Specific: HenkDz/paperclip183184This is a fork of `paperclipai/paperclip` with QoL patches and a **built-in** Hermes adapter story on branch `feat/externalize-hermes-adapter` ([tree](https://github.com/HenkDz/paperclip/tree/feat/externalize-hermes-adapter)).185186### Branch Strategy187188- `feat/externalize-hermes-adapter` now ships `hermes_local` and `hermes_gateway` as built-in core adapters.189- Older fork branches may still document plugin-only Hermes; treat this file as authoritative for the current branch.190191### Hermes (built-in)192193- `hermes_local` is available without Adapter manager installation and runs the local Hermes CLI.194- `hermes_gateway` is available without Adapter manager installation and calls an already-running Hermes API server.195- Operators may still install external Hermes packages through Adapter manager to override/shadow the built-ins.196- Optional: `file:` entry in `~/.paperclip/adapter-plugins.json` remains useful for local development of override packages.197198### Local Dev199200- Fork runs on port 3101+ (auto-detects if 3100 is taken by upstream instance)201- `npx vite build` hangs on NTFS — use `node node_modules/vite/bin/vite.js build` instead202- Server startup from NTFS takes 30-60s — don't assume failure immediately203- Kill ALL paperclip processes before starting: `pkill -f "paperclip"; pkill -f "tsx.*index.ts"`204- Vite cache survives `rm -rf dist` — delete both: `rm -rf ui/dist ui/node_modules/.vite`205206### Fork QoL Patches (not in upstream)207208These are local modifications in the fork's UI. If re-copying source, these must be re-applied:2092101. **stderr_group** — amber accordion for MCP init noise in `RunTranscriptView.tsx`2112. **tool_group** — accordion for consecutive non-terminal tools (write, read, search, browser)2123. **Dashboard excerpt** — `LatestRunCard` strips markdown, shows first 3 lines/280 chars213214### Plugin System215216PR #2218 (`feat/external-adapter-phase1`) adds external adapter support. See root `AGENTS.md` for full details.217218- Adapters can be loaded as external plugins via `~/.paperclip/adapter-plugins.json`219- The plugin-loader should have ZERO hardcoded adapter imports — pure dynamic loading220- `createServerAdapter()` must include ALL optional fields (especially `detectModel`)221- Built-in UI adapters can shadow external plugin parsers; external override pause/resume should restore the built-in parser.222- Reference external adapters: Droid (npm); Hermes can also be tested as an override package.223224## Design system225226`DESIGN.md` at the repo root is the source of truth for UI design decisions. The token-only rule applies to all `ui/` changes: every color, spacing, radius, type, shadow, and motion value in `ui/src/components/**` and `ui/src/pages/**` comes from the token layer in `ui/src/index.css` — no hex, raw px, arbitrary Tailwind bracket values, or raw `font-size`/`fontSize` declarations in components, outside the documented allowlist in `ui/src/index.css`. Run `pnpm check:token-gates` (`scripts/check-token-gates.mjs`) before committing UI changes — it fails on any violation not covered by that allowlist.227
Also in paperclipai/paperclip
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| paperclipai/paperclippackages/plugins/plugin-llm-wiki/agents/wiki-maintainer/AGENTS.md · 76k | AGENTS.md | no sections | 48/100 | 3 days ago | |
| paperclipai/paperclippackages/teams-catalog/catalog/bundled/company-defaults/core-exec-team/agents/ceo/AGENTS.md · 76k | AGENTS.md | no sections | 47/100 | 3 days ago | |
| paperclipai/paperclippackages/teams-catalog/catalog/bundled/company-defaults/core-exec-team/agents/cto/AGENTS.md · 76k | AGENTS.md | securitydo-not | 46/100 | 3 days ago | |
| paperclipai/paperclippackages/teams-catalog/catalog/bundled/company-defaults/core-exec-team/agents/qa/AGENTS.md · 76k | AGENTS.md | no sections | 39/100 | 3 days ago | |
| paperclipai/paperclippackages/teams-catalog/catalog/bundled/product/product-design/agents/ux-designer/AGENTS.md · 76k | AGENTS.md | do-not | 46/100 | 3 days ago | |
| paperclipai/paperclippackages/teams-catalog/catalog/bundled/software-development/product-engineering/agents/cto/AGENTS.md · 76k | AGENTS.md | securitydo-not | 46/100 | 3 days ago | |
| paperclipai/paperclippackages/teams-catalog/catalog/bundled/software-development/product-engineering/agents/qa/AGENTS.md · 76k | AGENTS.md | no sections | 39/100 | 3 days ago | |
| paperclipai/paperclippackages/teams-catalog/catalog/bundled/software-development/product-engineering/agents/senior-coder/AGENTS.md · 76k | AGENTS.md | securitydo-not | 46/100 | 3 days ago | |
| paperclipai/paperclipserver/src/built-ins/agents/reflection-coach/AGENTS.md · 76k | AGENTS.md | apiagent-behaviour | 43/100 | 3 days ago | |
| paperclipai/paperclipserver/src/built-ins/agents/summarizer/AGENTS.md · 76k | AGENTS.md | api | 43/100 | 3 days ago | |
| paperclipai/paperclipserver/src/onboarding-assets/ceo/AGENTS.md · 76k | AGENTS.md | performance | 48/100 | 3 days ago | |
| paperclipai/paperclipserver/src/onboarding-assets/default/AGENTS.md · 76k | AGENTS.md | api | 34/100 | 3 days ago |
Diff against packages/plugins/plugin-llm-wiki/agents/wiki-maintainer/AGENTS.md Diff against packages/teams-catalog/catalog/bundled/company-defaults/core-exec-team/agents/ceo/AGENTS.md Diff against packages/teams-catalog/catalog/bundled/company-defaults/core-exec-team/agents/cto/AGENTS.md Diff against packages/teams-catalog/catalog/bundled/company-defaults/core-exec-team/agents/qa/AGENTS.md Diff against packages/teams-catalog/catalog/bundled/product/product-design/agents/ux-designer/AGENTS.md Diff against packages/teams-catalog/catalog/bundled/software-development/product-engineering/agents/cto/AGENTS.md Diff against packages/teams-catalog/catalog/bundled/software-development/product-engineering/agents/qa/AGENTS.md Diff against packages/teams-catalog/catalog/bundled/software-development/product-engineering/agents/senior-coder/AGENTS.md Diff against server/src/built-ins/agents/reflection-coach/AGENTS.md Diff against server/src/built-ins/agents/summarizer/AGENTS.md Diff against server/src/onboarding-assets/ceo/AGENTS.md Diff against server/src/onboarding-assets/default/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago |
