mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-13 07:12:00 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - Contributors and agents read the docs under `doc/` before they change code > - `doc/SPEC.md` and `doc/SPEC-implementation.md` were out of date. `doc/SPEC-implementation.md` became an append-only log: in 60 days it got about 1,645 new lines and lost 181, across 140 commits > - #20557 changed `AGENTS.md` so the code and its tests are the source of truth, and the specs are only background > - This pull request removes the two spec docs. It moves only the sections that live code comments cite into focused docs, and it repoints all other references > - The benefit is one less stale document that agents read and append to ## Linked Issues or Issue Description Refs #20557 (merged). This PR is the follow-up that removes the docs. It is based on `master`, which already contains #20557. **Issue type** Outdated content. The docs are out of date and conflict with the code. **Where is the issue?** `doc/SPEC.md`, `doc/SPEC-implementation.md`, and the code comments and docs that cite them. **What's wrong?** `doc/SPEC.md` and `doc/SPEC-implementation.md` are out of date, but agents still read them and append a paragraph with each fix. **Suggested fix** Delete both files. Move the sections that code cites into focused docs. Repoint the references. ## What Changed - Deleted `doc/SPEC.md` and `doc/SPEC-implementation.md`. - Moved these spec sections, because live code comments cite them: - §9.3.1 "Shared default-open issue writes" → new section in `doc/agent-permission-defaults.md`. - §9.8.1 "Issue-thread interaction resolver contract" → `doc/execution-semantics.md`, "Issue-thread interaction resolution". That section already had most of the contract. I added only the missing parts: the `supersedeOnUserComment` default, the canonical policy list, the addressee and cap rules, the rule that surfaces show the server's effective audience, and the cross-issue budget charge. The short policy summary at the top of the section now points to the list, so the definitions occur one time only. - §9.9 "Task Watchdog Authority Contract" → new "Authority contract" section in `doc/TASK-WATCHDOG.md`. It holds the allowed and disallowed mutation lists and the deferred capabilities. The atomic recovery batch, restoration verification, and interaction rules were already in `doc/execution-semantics.md` §11, so the new section links there and does not repeat them. I did not move the "Downstream acceptance criteria" checklist or the sentence about the CTO and Security sign-off. These were implementation-time notes; the tests now hold that coverage. - §9.10 "Company Skill Policy Contract" → new `doc/company-skill-policy.md`. No focused doc had this contract. I did not move the "Required regression tests" phase checklist. - Did not move any other part of the specs. - Repointed code comments that cited spec sections: - `packages/shared/src/issue-write-denial.ts` (§9.3) → `doc/agent-permission-defaults.md` - `server/src/routes/issues.ts` (§9.9) → `doc/TASK-WATCHDOG.md`, "Authority contract" - `server/src/routes/issues.ts` (§9.3, §9.8.1 cross-issue budget) → `doc/agent-permission-defaults.md` - `ui/src/lib/interaction-audience.ts` and `ui/src/components/InteractionGovernancePanel.tsx` (§9.8.1) → `doc/execution-semantics.md` - `ui/src/lib/skill-policy-denial.ts`, `ui/src/pages/CompanySkills.tsx`, `ui/src/pages/CompanySkills.production.tsx`, `ui/src/pages/SkillStudio.tsx` (§9.10) → `doc/company-skill-policy.md` - `server/src/services/recovery/ownership-invariant-report.ts` (monitor deadline wait path) → `doc/execution-semantics.md` §8. That section already lists the one-shot monitor as a valid wait path. - Resynced the git blob pin for `packages/shared/src/issue-write-denial.ts` in `tests/runner-e2e/source-sdk-public-inputs.json`. The comment edit changed the file's hash, and the Runner support suite checks that pin. I used `node tests/runner-e2e/source-sdk-public-inputs.mjs <HEAD> --write`; only that one pin changed. - Updated `AGENTS.md` §1 so it does not name the deleted files. - Removed the links to the deleted files from `doc/plugins/PLUGIN_SPEC.md`. - Updated the `doc-maintenance` agent skill (`.agents/skills/doc-maintenance/`) so it no longer audits or stages `doc/SPEC.md`. - Removed or replaced references in `maps/README.md`, `maps/feature-map/README.md`, `maps/storybook-map/README.md`, `doc/PRODUCT.md`, `doc/CLIPHUB.md`, `doc/DEPLOYMENT-MODES.md`, `doc/DEVELOPING.md`, `doc/evals.md`, `doc/spec/agent-runs.md`, `doc/AGENTCOMPANIES_SPEC_INVENTORY.md`, `doc/connections/CONNECTOR-PLAYBOOK.md`, `doc/plugins/ideas-from-opencode.md`, `doc/execution-semantics.md`, `doc/TASK-WATCHDOG.md`, and `.devin/wiki.json`. - In `doc/execution-semantics.md`, the "admission is independent of cleanup and accounting" reference now states the rule inline: only a hard stop, an explicit pause, or an inactive company refuses admission. - Kept these references as they are: dated plans in `doc/plans/` and `docs/plans/`, the dated log `doc/logs/2026-05-24-cli-api-parity-e2e-log.md`, `releases/`, the transcript fixture `ui/src/fixtures/runTranscriptFixtures.ts` (it uses the filename only as sample text), and `docs/specs/external-task-protocol.md` (it refers to the Symphony project's own `SPEC.md`). ## Verification - `git grep -n "SPEC-implementation\|SPEC\.md"` (without `releases/`, and ignoring `PLUGIN_SPEC.md` citations) finds only the kept references listed above. - `grep -rn "§9\.\(3\|8\|9\|10\)" ui/src server/src packages/shared/src` finds no results. - `node scripts/check-maps.mjs`: "Maps aligned: 35 areas, 192 capability IDs". - `pnpm check:token-gates`: "All gates clean". - `pnpm exec vitest run --config tests/runner-e2e/vitest.config.ts tests/runner-e2e/source-sdk-public-type.test.ts tests/runner-e2e/source-sdk-evidence.test.ts`: 45 passed. These failed in CI before the pin resync. - `pnpm verify`: exit 2 ("Broader verification required") because `AGENTS.md` is a global CI input. Required CI supplies the broad coverage for this revision. - All code changes are comments only. No runtime behavior changes. The title uses `refactor:` because comments in source files changed. ## Risks - Low risk. The change removes docs and edits comments only. - A reader can lose context from spec sections that I did not move. The text stays in git history. The code and its tests are the source of truth. - External links to the two deleted files will return 404. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used - Anthropic Claude Opus 5.5 (`claude-opus-5-5`), in Claude Code with tool use (shell, file edits). Standard context window. ## 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 checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass (focused checks above; CI supplies broad coverage) - [x] I have added or updated tests where applicable (not applicable: docs and comments only) - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
337 lines
13 KiB
Markdown
337 lines
13 KiB
Markdown
# ClipHub — The Company Registry
|
|
|
|
**Download a company.**
|
|
|
|
ClipHub is the public registry where people share, discover, and download Paperclip company configurations. A company template is a portable artifact containing an entire org — agents, reporting structure, adapter configs, role definitions, seed tasks — ready to spin up with one command.
|
|
|
|
---
|
|
|
|
## What It Is
|
|
|
|
ClipHub is to Paperclip what a package registry is to a programming language. Paperclip already supports exportable org configs (see the [company package spec](../docs/companies/companies-spec.md)). ClipHub is the public directory where those exports live.
|
|
|
|
A user builds a working company in Paperclip — a dev shop, a marketing agency, a research lab, a content studio — exports the template, and publishes it to ClipHub. Anyone can browse, search, download, and spin up that company on their own Paperclip instance.
|
|
|
|
The tagline: **you can literally download a company.**
|
|
|
|
---
|
|
|
|
## What Gets Published
|
|
|
|
A ClipHub package is a **company template export** — the portable artifact format defined in the Paperclip spec. It contains:
|
|
|
|
| Component | Description |
|
|
|---|---|
|
|
| **Company metadata** | Name, description, intended use case, category |
|
|
| **Org chart** | Full reporting hierarchy — who reports to whom |
|
|
| **Agent definitions** | Every agent: name, role, title, capabilities description |
|
|
| **Adapter configs** | Per-agent adapter type and configuration (SOUL.md, HEARTBEAT.md, CLAUDE.md, process commands, webhook URLs — whatever the adapter needs) |
|
|
| **Seed tasks** | Optional starter tasks and initiatives to bootstrap the company's first run |
|
|
| **Budget defaults** | Suggested token/cost budgets per agent and per company |
|
|
|
|
Templates are **structure, not state.** No in-progress tasks, no historical cost data, no runtime artifacts. Just the blueprint.
|
|
|
|
### Sub-packages
|
|
|
|
Not every use case needs a whole company. ClipHub also supports publishing individual components:
|
|
|
|
- **Agent templates** — a single agent config (e.g. "Senior TypeScript Engineer", "SEO Content Writer", "DevOps Agent")
|
|
- **Team templates** — a subtree of the org chart (e.g. "Marketing Team: CMO + 3 reports", "Engineering Pod: Tech Lead + 4 Engineers")
|
|
- **Adapter configs** — reusable adapter configurations independent of any specific agent role
|
|
|
|
These can be mixed into existing companies. Download an agent, slot it into your org, assign a manager, go.
|
|
|
|
---
|
|
|
|
## Core Features
|
|
|
|
### Browse & Discover
|
|
|
|
The homepage surfaces companies across several dimensions:
|
|
|
|
- **Featured** — editorially curated, high-quality templates
|
|
- **Popular** — ranked by downloads, stars, and forks
|
|
- **Recent** — latest published or updated
|
|
- **Categories** — browseable by use case (see Categories below)
|
|
|
|
Each listing shows: name, short description, org size (agent count), category, adapter types used, star count, download count, and a mini org chart preview.
|
|
|
|
### Search
|
|
|
|
Search is **semantic, not keyword-only.** Powered by vector embeddings so you can search by intent:
|
|
|
|
- "marketing agency that runs facebook ads" → finds relevant company templates even if those exact words aren't in the title
|
|
- "small dev team for building APIs" → finds lean engineering orgs
|
|
- "content pipeline with writers and editors" → finds content studio templates
|
|
|
|
Also supports filtering by: category, agent count range, adapter types, star count, recency.
|
|
|
|
### Company Detail Page
|
|
|
|
Clicking into a company template shows:
|
|
|
|
- **Full description** — what this company does, how it operates, what to expect
|
|
- **Interactive org chart** — visual tree of every agent with role, title, and capabilities
|
|
- **Agent list** — expandable details for each agent (adapter type, config summary, role description)
|
|
- **Seed tasks** — the starter initiatives and tasks included
|
|
- **Budget overview** — suggested cost structure
|
|
- **Install command** — one-line CLI command to download and create
|
|
- **Version history** — changelog, semver, previous versions available
|
|
- **Community** — stars, comments, forks count
|
|
|
|
### Install & Fork
|
|
|
|
Two ways to use a template:
|
|
|
|
**Install (fresh start):**
|
|
```
|
|
paperclip install cliphub:<publisher>/<company-slug>
|
|
```
|
|
Downloads the template and creates a new company in your local Paperclip instance. You add your own API keys, set budgets, customize agents, and hit go.
|
|
|
|
**Fork:**
|
|
Forking creates a copy of the template under your own ClipHub account. You can modify it, republish it as your own variant, and the fork lineage is tracked. This enables evolutionary improvement — someone publishes a marketing agency, you fork it, add a social media team, republish.
|
|
|
|
### Stars & Comments
|
|
|
|
- **Stars** — bookmark and signal quality. Star count is a primary ranking signal.
|
|
- **Comments** — threaded discussion on each listing. Ask questions, share results, suggest improvements.
|
|
|
|
### Download Counts & Signals
|
|
|
|
Every install is counted. The registry tracks:
|
|
|
|
- Total downloads (all time)
|
|
- Downloads per version
|
|
- Fork count
|
|
- Star count
|
|
|
|
These signals feed into search ranking and discovery.
|
|
|
|
---
|
|
|
|
## Publishing
|
|
|
|
### Who Can Publish
|
|
|
|
Anyone with a GitHub account can publish to ClipHub. Authentication is via GitHub OAuth.
|
|
|
|
### How to Publish
|
|
|
|
From within Paperclip, export your company as a template, then publish:
|
|
|
|
```
|
|
paperclip export --template my-company
|
|
paperclip publish cliphub my-company
|
|
```
|
|
|
|
Or use the web UI to upload a template export directly.
|
|
|
|
### What You Provide
|
|
|
|
When publishing, you specify:
|
|
|
|
| Field | Required | Description |
|
|
|---|---|---|
|
|
| `slug` | yes | URL-safe identifier (e.g. `lean-dev-shop`) |
|
|
| `name` | yes | Display name |
|
|
| `description` | yes | What this company does and who it's for |
|
|
| `category` | yes | Primary category (see below) |
|
|
| `tags` | no | Additional tags for discovery |
|
|
| `version` | yes | Semver (e.g. `1.0.0`) |
|
|
| `changelog` | no | What changed in this version |
|
|
| `readme` | no | Extended documentation (markdown) |
|
|
| `license` | no | Usage terms |
|
|
|
|
### Versioning
|
|
|
|
Templates use semantic versioning. Each publish creates an immutable version. Users can install any version or default to `latest`. Version history and changelogs are visible on the detail page.
|
|
|
|
### The `sync` Command
|
|
|
|
For power users who maintain multiple templates:
|
|
|
|
```
|
|
paperclip cliphub sync
|
|
```
|
|
|
|
Scans your local exported templates and publishes any that are new or updated. Useful for maintaining a portfolio of company templates from a single repo.
|
|
|
|
---
|
|
|
|
## Categories
|
|
|
|
Company templates are organized by use case:
|
|
|
|
| Category | Examples |
|
|
|---|---|
|
|
| **Software Development** | Full-stack dev shop, API development team, mobile app studio |
|
|
| **Marketing & Growth** | Performance marketing agency, content marketing team, SEO shop |
|
|
| **Content & Media** | Content studio, podcast production, newsletter operation |
|
|
| **Research & Analysis** | Market research firm, competitive intelligence, data analysis team |
|
|
| **Operations** | Customer support org, internal ops team, QA/testing shop |
|
|
| **Sales** | Outbound sales team, lead generation, account management |
|
|
| **Finance & Legal** | Bookkeeping service, compliance monitoring, financial analysis |
|
|
| **Creative** | Design agency, copywriting studio, brand development |
|
|
| **General Purpose** | Starter templates, minimal orgs, single-agent setups |
|
|
|
|
Categories are not exclusive — a template can have one primary category plus tags for cross-cutting concerns.
|
|
|
|
---
|
|
|
|
## Moderation & Trust
|
|
|
|
### Verified Publishers
|
|
|
|
Publishers who meet certain thresholds (account age, published templates with good signals) earn a verified badge. Verified templates rank higher in search.
|
|
|
|
### Security Review
|
|
|
|
Company templates contain adapter configurations, which may include executable commands (process adapter) or webhook URLs (HTTP adapter). The moderation system:
|
|
|
|
1. **Automated scanning** — checks adapter configs for suspicious patterns (arbitrary code execution, exfiltration URLs, credential harvesting)
|
|
2. **Community reporting** — any signed-in user can flag a template. Auto-hidden after multiple reports pending review.
|
|
3. **Manual review** — moderators can approve, reject, or request changes
|
|
|
|
### Account Gating
|
|
|
|
New accounts have a waiting period before they can publish. This prevents drive-by spam.
|
|
|
|
---
|
|
|
|
## Architecture
|
|
|
|
ClipHub is a **separate service** from Paperclip itself. Paperclip is self-hosted; ClipHub is a hosted registry that Paperclip instances talk to.
|
|
|
|
### Integration Points
|
|
|
|
| Layer | Role |
|
|
|---|---|
|
|
| **ClipHub Web** | Browse, search, discover, comment, star — the website |
|
|
| **ClipHub API** | Registry API for publishing, downloading, searching programmatically |
|
|
| **Paperclip CLI** | `paperclipai install`, `paperclipai publish`, `paperclipai cliphub sync` — built into Paperclip |
|
|
| **Paperclip UI** | "Browse ClipHub" panel in the Paperclip web UI for discovering templates without leaving the app |
|
|
|
|
### Tech Stack
|
|
|
|
| Layer | Technology |
|
|
|---|---|
|
|
| Frontend | React + Vite (consistent with Paperclip) |
|
|
| Backend | TypeScript + Hono (consistent with Paperclip) |
|
|
| Database | PostgreSQL |
|
|
| Search | Vector embeddings for semantic search |
|
|
| Auth | GitHub OAuth |
|
|
| Storage | Template zips stored in object storage (S3 or equivalent) |
|
|
|
|
### Data Model (Sketch)
|
|
|
|
```
|
|
Publisher
|
|
id, github_id, username, display_name, verified, created_at
|
|
|
|
Template
|
|
id, publisher_id, slug, name, description, category,
|
|
tags[], readme, license, created_at, updated_at,
|
|
star_count, download_count, fork_count,
|
|
forked_from_id (nullable)
|
|
|
|
Version
|
|
id, template_id, version (semver), changelog,
|
|
artifact_url (zip), agent_count, adapter_types[],
|
|
created_at
|
|
|
|
Star
|
|
id, publisher_id, template_id, created_at
|
|
|
|
Comment
|
|
id, publisher_id, template_id, body, parent_id (nullable),
|
|
created_at, updated_at
|
|
|
|
Report
|
|
id, reporter_id, template_id, reason, created_at
|
|
```
|
|
|
|
---
|
|
|
|
## User Flows
|
|
|
|
### "I want to start a company"
|
|
|
|
1. Open ClipHub, browse by category or search "dev shop for building SaaS"
|
|
2. Find a template that fits — "Lean SaaS Dev Shop (CEO + CTO + 3 Engineers)"
|
|
3. Read the description, inspect the org chart, check the comments
|
|
4. Run `paperclipai install cliphub:acme/lean-saas-shop`
|
|
5. Paperclip creates the company locally with all agents pre-configured
|
|
6. Set your API keys, adjust budgets, add your initial tasks
|
|
7. Hit go
|
|
|
|
### "I built something great and want to share it"
|
|
|
|
1. Build and iterate on a company in Paperclip until it works well
|
|
2. Export: `paperclipai export --template my-agency`
|
|
3. Publish: `paperclipai publish cliphub my-agency`
|
|
4. Fill in description, category, tags on the web UI
|
|
5. Template is live — others can find and install it
|
|
|
|
### "I want to improve someone else's company"
|
|
|
|
1. Find a template on ClipHub that's close to what you need
|
|
2. Fork it to your account
|
|
3. Install your fork locally, modify the org (add agents, change configs, restructure teams)
|
|
4. Export and re-publish as your own variant
|
|
5. Fork lineage visible on both the original and your version
|
|
|
|
### "I just need one great agent, not a whole company"
|
|
|
|
1. Search ClipHub for agent templates: "senior python engineer"
|
|
2. Find a well-starred agent config
|
|
3. Install just that agent: `paperclipai install cliphub:acme/senior-python-eng --agent`
|
|
4. Assign it to a manager in your existing company
|
|
5. Done
|
|
|
|
---
|
|
|
|
## Relationship to Paperclip
|
|
|
|
ClipHub is **not required** to use Paperclip. You can build companies entirely from scratch without ever touching ClipHub. But ClipHub dramatically lowers the barrier to entry:
|
|
|
|
- **New users** get a working company in minutes instead of hours
|
|
- **Experienced users** share proven configurations with the community
|
|
- **The ecosystem** compounds — every good template makes the next company easier to build
|
|
|
|
ClipHub is to Paperclip what a package registry is to a language runtime: optional, but transformative.
|
|
|
|
---
|
|
|
|
## V1 Scope
|
|
|
|
### Must Have
|
|
|
|
- [ ] Template publishing (upload via CLI or web)
|
|
- [ ] Template browsing (list, filter by category)
|
|
- [ ] Template detail page (description, org chart, agent list, install command)
|
|
- [ ] Semantic search (vector embeddings)
|
|
- [ ] `paperclipai install cliphub:<publisher>/<slug>` CLI command
|
|
- [ ] GitHub OAuth authentication
|
|
- [ ] Stars
|
|
- [ ] Download counts
|
|
- [ ] Versioning (semver, version history)
|
|
- [ ] Basic moderation (community reporting, auto-hide)
|
|
|
|
### V2
|
|
|
|
- [ ] Comments / threaded discussion
|
|
- [ ] Forking with lineage tracking
|
|
- [ ] Agent and team sub-packages
|
|
- [ ] Verified publisher badges
|
|
- [ ] Automated security scanning of adapter configs
|
|
- [ ] "Browse ClipHub" panel in Paperclip web UI
|
|
- [ ] `paperclipai cliphub sync` for bulk publishing
|
|
- [ ] Publisher profiles and portfolios
|
|
|
|
### Not in Scope
|
|
|
|
- Paid / premium templates (everything is free and public, at least initially)
|
|
- Private registries (may be a future enterprise feature)
|
|
- Running companies on ClipHub (it's a registry, not a runtime — consistent with Paperclip's own philosophy)
|