Paperclip routine runtime service. Portability now exports routines as recurring TASK.md entries and imports recurring tasks back through this service.
server/src/services/company-export-readme.ts
Generates README.md and Mermaid org-chart for exported company packages.
server/src/services/index.ts
Re-exports companyPortabilityService.
4. Server — Routes
File
Endpoints
server/src/routes/companies.ts
POST /api/companies/:companyId/export — legacy export bundle POST /api/companies/:companyId/exports/preview — export preview POST /api/companies/:companyId/exports — export package POST /api/companies/import/preview — import preview POST /api/companies/import — perform import
Route registration lives in server/src/app.ts via companyRoutes(db, storage).
5. Server — Tests
File
Coverage
server/src/__tests__/company-portability.test.ts
Unit tests for the portability service (export, import, preview, manifest shape, agentcompanies/v1 version).
Integration tests for the portability HTTP endpoints.
6. CLI
File
Commands
cli/src/commands/client/company.ts
company export — exports a company package to disk (flags: --out, --include, --projects, --issues, --projectIssues). company import <fromPathOrUrl> — imports a company package from a file or folder (flags: positional source path/URL or GitHub shorthand, --include, --target, --companyId, --newCompanyName, --agents, --collision, --ref, --dryRun). Reads/writes portable file entries and handles .paperclip.yaml filtering.
7. UI — Pages
File
Role
ui/src/pages/CompanyExport.tsx
Export UI: preview, manifest display, file tree visualization, ZIP archive creation and download. Filters .paperclip.yaml based on selection. Shows manifest and README in editor.
Reusable file tree component for both import and export. Builds tree from CompanyPortabilityFileEntry items, parses frontmatter, shows action indicators (create/update/skip), and maps frontmatter field labels.
9. UI — Libraries
File
Role
ui/src/lib/portable-files.ts
Helpers for portable file entries: getPortableFileText, getPortableFileDataUrl, getPortableFileContentType, isPortableImageFile.
ui/src/lib/zip.ts
ZIP archive creation (createZipArchive) and reading (readZipArchive) — implements ZIP format from scratch for company packages. CRC32, DOS date/time encoding.
ui/src/lib/zip.test.ts
Tests for ZIP utilities; exercises round-trip with portability file entries and .paperclip.yaml content.
10. UI — API Client
File
Functions
ui/src/api/companies.ts
companiesApi.exportBundle, companiesApi.exportPreview, companiesApi.exportPackage, companiesApi.importPreview, companiesApi.importBundle — typed fetch wrappers for the portability endpoints.
11. Skills & Agent Instructions
File
Relevance
skills/paperclip/references/company-skills.md
Reference doc for company skill library workflow — install, inspect, update, assign. Skill packages are a subset of the agent companies spec.
server/src/services/company-skills.ts
Company skill management service — handles SKILL.md-based imports and company-level skill library.
server/src/services/agent-instructions.ts
Agent instructions service — resolves AGENTS.md paths for agent instruction loading.