## Thinking Path > - Paperclip orchestrates AI agents for zero-human companies > - Agents create pull requests as part of their development workflow > - The PR template already has a "Model Used" section (added in PR #2552) > - But agents were not filling it in because neither AGENTS.md nor CONTRIBUTING.md referenced it > - This PR updates both docs to explicitly require reading and filling in the full PR template, including Model Used > - The benefit is that every PR will now document which AI model produced the change, improving traceability and auditability ## What Changed - **CONTRIBUTING.md**: Added "Model Used (Required)" subsection under "PR Requirements (all PRs)" and listed it in the required sections enumeration - **AGENTS.md**: Added new "Section 10: Pull Request Requirements" instructing agents to read and fill in every section of the PR template when creating PRs (including Model Used). Renumbered "Definition of Done" to Section 11 and added PR template compliance as item 5. ## Verification - Review `CONTRIBUTING.md` — confirm "Model Used (Required)" subsection appears under PR Requirements - Review `AGENTS.md` — confirm Section 10 (Pull Request Requirements) lists all required PR template sections including Model Used - Review `AGENTS.md` — confirm Definition of Done item 5 references PR template compliance - No code changes, no tests to run ## Risks - Low risk — documentation-only changes. No code, schema, or behavioral changes. ## Model Used - **Provider**: Anthropic Claude - **Model ID**: claude-opus-4-6 (1M context) - **Capabilities**: Tool use, code execution, extended context ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] If this change affects the UI, I have included before/after screenshots - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] I will address all Greptile and reviewer comments before requesting merge Co-authored-by: Paperclip <noreply@paperclip.ing>
7.1 KiB
AGENTS.md
Guidance for human and AI contributors working in this repository.
1. Purpose
Paperclip is a control plane for AI-agent companies.
The current implementation target is V1 and is defined in doc/SPEC-implementation.md.
2. Read This First
Before making changes, read in this order:
doc/GOAL.mddoc/PRODUCT.mddoc/SPEC-implementation.mddoc/DEVELOPING.mddoc/DATABASE.md
doc/SPEC.md is long-horizon product context.
doc/SPEC-implementation.md is the concrete V1 build contract.
3. Repo Map
server/: Express REST API and orchestration servicesui/: React + Vite board UIpackages/db/: Drizzle schema, migrations, DB clientspackages/shared/: shared types, constants, validators, API path constantspackages/adapters/: agent adapter implementations (Claude, Codex, Cursor, etc.)packages/adapter-utils/: shared adapter utilitiespackages/plugins/: plugin system packagesdoc/: operational and product docs
4. Dev Setup (Auto DB)
Use embedded PGlite in dev by leaving DATABASE_URL unset.
pnpm install
pnpm dev
This starts:
- API:
http://localhost:3100 - UI:
http://localhost:3100(served by API server in dev middleware mode)
Quick checks:
curl http://localhost:3100/api/health
curl http://localhost:3100/api/companies
Reset local dev DB:
rm -rf data/pglite
pnpm dev
5. Core Engineering Rules
-
Keep changes company-scoped. Every domain entity should be scoped to a company and company boundaries must be enforced in routes/services.
-
Keep contracts synchronized. If you change schema/API behavior, update all impacted layers:
packages/dbschema and exportspackages/sharedtypes/constants/validatorsserverroutes/servicesuiAPI clients and pages
- Preserve control-plane invariants.
- Single-assignee task model
- Atomic issue checkout semantics
- Approval gates for governed actions
- Budget hard-stop auto-pause behavior
- Activity logging for mutating actions
-
Do not replace strategic docs wholesale unless asked. Prefer additive updates. Keep
doc/SPEC.mdanddoc/SPEC-implementation.mdaligned. -
Keep plan docs dated and centralized. New plan documents belong in
doc/plans/and should useYYYY-MM-DD-slug.mdfilenames.
6. Database Change Workflow
When changing data model:
- Edit
packages/db/src/schema/*.ts - Ensure new tables are exported from
packages/db/src/schema/index.ts - Generate migration:
pnpm db:generate
- Validate compile:
pnpm -r typecheck
Notes:
packages/db/drizzle.config.tsreads compiled schema fromdist/schema/*.jspnpm db:generatecompilespackages/dbfirst
7. Verification Before Hand-off
Run this full check before claiming done:
pnpm -r typecheck
pnpm test:run
pnpm build
If anything cannot be run, explicitly report what was not run and why.
8. API and Auth Expectations
- Base path:
/api - Board access is treated as full-control operator context
- Agent access uses bearer API keys (
agent_api_keys), hashed at rest - Agent keys must not access other companies
When adding endpoints:
- apply company access checks
- enforce actor permissions (board vs agent)
- write activity log entries for mutations
- return consistent HTTP errors (
400/401/403/404/409/422/500)
9. UI Expectations
- Keep routes and nav aligned with available API surface
- Use company selection context for company-scoped pages
- Surface failures clearly; do not silently ignore API errors
10. Pull Request Requirements
When 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. Do not craft ad-hoc PR bodies — use the template as the structure for your PR description. Required sections:
- Thinking Path — trace reasoning from project context to this change (see
CONTRIBUTING.mdfor examples) - What Changed — bullet list of concrete changes
- Verification — how a reviewer can confirm it works
- Risks — what could go wrong
- 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.
- Checklist — all items checked
11. Definition of Done
A change is done when all are true:
- Behavior matches
doc/SPEC-implementation.md - Typecheck, tests, and build pass
- Contracts are synced across db/shared/server/ui
- Docs updated when behavior or commands change
- PR description follows the PR template with all sections filled in (including Model Used)
11. Fork-Specific: HenkDz/paperclip
This is a fork of paperclipai/paperclip with QoL patches and an external-only Hermes adapter story on branch feat/externalize-hermes-adapter (tree).
Branch Strategy
feat/externalize-hermes-adapter→ core has nohermes-paperclip-adapterdependency and no built-inhermes_localregistration. Install Hermes via the Adapter Plugin manager (@henkey/hermes-paperclip-adapteror afile:path).- Older fork branches may still document built-in Hermes; treat this file as authoritative for the externalize branch.
Hermes (plugin only)
- Register through Board → Adapter manager (same as Droid). Type remains
hermes_localonce the package is loaded. - UI uses generic config-schema + ui-parser.js from the package — no Hermes imports in
server/orui/source. - Optional:
file:entry in~/.paperclip/adapter-plugins.jsonfor local dev of the adapter repo.
Local Dev
- Fork runs on port 3101+ (auto-detects if 3100 is taken by upstream instance)
npx vite buildhangs on NTFS — usenode node_modules/vite/bin/vite.js buildinstead- Server startup from NTFS takes 30-60s — don't assume failure immediately
- Kill ALL paperclip processes before starting:
pkill -f "paperclip"; pkill -f "tsx.*index.ts" - Vite cache survives
rm -rf dist— delete both:rm -rf ui/dist ui/node_modules/.vite
Fork QoL Patches (not in upstream)
These are local modifications in the fork's UI. If re-copying source, these must be re-applied:
- stderr_group — amber accordion for MCP init noise in
RunTranscriptView.tsx - tool_group — accordion for consecutive non-terminal tools (write, read, search, browser)
- Dashboard excerpt —
LatestRunCardstrips markdown, shows first 3 lines/280 chars
Plugin System
PR #2218 (feat/external-adapter-phase1) adds external adapter support. See root AGENTS.md for full details.
- Adapters can be loaded as external plugins via
~/.paperclip/adapter-plugins.json - The plugin-loader should have ZERO hardcoded adapter imports — pure dynamic loading
createServerAdapter()must include ALL optional fields (especiallydetectModel)- Built-in UI adapters can shadow external plugin parsers — remove built-in when fully externalizing
- Reference external adapters: Hermes (
@henkey/hermes-paperclip-adapterorfile:) and Droid (npm)