Skip to content

feat: complete plugin-clipper restructure and v0.1.0 feature set#4

Merged
lx-0 merged 30 commits intomainfrom
feat/paperclip-plugin-impl
Mar 19, 2026
Merged

feat: complete plugin-clipper restructure and v0.1.0 feature set#4
lx-0 merged 30 commits intomainfrom
feat/paperclip-plugin-impl

Conversation

@lx-0
Copy link
Member

@lx-0 lx-0 commented Mar 18, 2026

Summary

  • Replaces standalone Clipper CLI with a native Paperclip plugin (Company Wizard)
  • Adds interactive wizard UI with manual and AI-powered configuration paths
  • Implements full provisioning pipeline: templates → assembly → Paperclip API

Key changes

  • Worker (src/worker.ts): three actions — preview-files, start-provision, check-auth; resolveCompaniesDir() helper with companiesDir config fallback to ~/.paperclip/instances/default/companies; template auto-download via ensureTemplatesDir(); bootstrap issue immediately set to todo so CEO agent inbox can find it
  • Manifest (src/manifest.ts): companiesDir, templatesPath, templatesRepoUrl, paperclipEmail, paperclipPassword config fields ordered via x-order; added issues.update capability
  • UI (src/ui/): full wizard state machine (WizardContext + reducer), preset/module/role selection, inline file preview+edit in ConfigReview, real-time provisioning log; improved loading screen with spinner and GitHub download notice
  • Templates: 14 presets, 22 modules (all with description), 17 optional roles; Engineer moved from base to optional

Test plan

  • Build passes (pnpm build)
  • Typechecks pass (pnpm typecheck)
  • Logic tests pass (pnpm test:logic)
  • Plugin loads in Paperclip UI — loading screen shows spinner + message
  • Config fields appear in correct order (companiesDir → templatesPath → templatesRepoUrl → email → password)
  • Config test passes with valid credentials
  • Wizard completes end-to-end: preset → modules → roles → review → provision
  • CEO agent can find bootstrap issue in inbox (status todo)

🤖 Generated with Claude Code


Note

Low Risk
Low risk: changes are limited to CI/workflow tooling, gitignore, and documentation updates with no runtime code path modifications.

Overview
Repository tooling has been modernized for the Company Wizard plugin. CI now adds a dedicated gitleaks secret-scan job and switches the test workflow from npm to pnpm with separate typecheck, build, and test steps.

Docs and contributor-facing metadata were refreshed to reflect the Company Wizard plugin branding and workflow (README/CLAUDE/CONTRIBUTING/CHANGELOG/AGENTS/ROADMAP), .gitignore was reorganized for plugin artifacts and secrets, and the pre-commit hook was simplified to run only lint-staged.

Written by Cursor Bugbot for commit 2172523. This will update automatically on new commits. Configure here.

lx-0 and others added 3 commits March 17, 2026 08:15
…tion

This commit introduces the plugin-clipper, a Paperclip plugin that provides an AI-powered wizard for bootstrapping agent companies from composable templates. Key additions include:

- New `.gitignore` to exclude build artifacts and dependencies.
- `esbuild.config.mjs` for bundling the plugin with PostCSS and Tailwind support.
- `package.json` defining the plugin's metadata, scripts, and dependencies.
- `PLAN.md` outlining the plugin's structure and current status.
- Initial `README.md` detailing installation and usage instructions.
- Configuration files for Rollup and TypeScript.
- Core plugin logic in `src/worker.ts` and UI components in `src/ui/`.
- Manifest file for plugin registration and capabilities.

This foundational setup enables further development and integration into the Paperclip ecosystem.
- Collapse plugin-clipper/ and web/ subdirs into root; all source now at src/
- Add worker.ts, manifest.ts, sync-plugin.sh and full UI component set
- Add descriptions to all 22 modules
- Make engineer an optional role; add to 13 presets and pr-review activatesWithRoles
- Task assignTo falls back to CEO if named role is absent
- Add companiesDir, templatesRepoUrl config fields; templatesPath auto-downloads from GitHub
- Bootstrap issue set to todo on creation so CEO agent inbox sees it
- Add issues.update capability; add x-order support to manifest fields
- Improve loading screen with spinner and informative copy
- Update CHANGELOG with full v0.1.0 feature set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0946260196

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lx-0 and others added 4 commits March 19, 2026 01:10
@paperclipai/plugin-sdk and @paperclipai/shared are now published to npm
(2026.318.0). Removes the file: references and pnpm.overrides block so
CI can install dependencies from a clean clone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds anthropicApiKey (secret-ref) to the instance config schema and a
new ai-chat worker action that proxies messages to the Anthropic API
using the configured key. The UI no longer calls Anthropic directly or
asks the user to enter/store a key in localStorage — it calls the worker
action via usePluginAction instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Engineer was moved from a base role to optional. Tests that assumed
engineer was always assembled now either pass it explicitly in
extraRoleNames or update their expectations accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- worker: pass --branch to git clone so non-default branches are checked
  out correctly when templatesRepoUrl targets a specific branch
- worker: use toPascalCase(companyName) for previewCompanyDir so preview
  paths match the actual paths created during provisioning
- ui: check error before loading guard so template load failures surface
  immediately instead of showing an infinite spinner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lx-0
Copy link
Member Author

lx-0 commented Mar 19, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a3da922111

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lx-0 and others added 2 commits March 19, 2026 01:46
- Reject fileOverrides paths that escape companyDir (path traversal guard:
  resolve + prefix-check before writing)
- Merge module-derived roleAdapterOverrides for CEO into adapterConfig so
  flags like chrome:true from website-relaunch are not silently dropped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename manifest id from paperclipai.plugin-clipper to
yesterday-ai.plugin-paperclip-company-wizard to match the published
npm package name. Updates sync-plugin.sh paths and DB queries accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lx-0
Copy link
Member Author

lx-0 commented Mar 19, 2026

@codex verify whether your previous review comments are fully addressed. Resolve any threads that are fixed, and comment on any that still need changes.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d0dfb5b9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lx-0 and others added 2 commits March 19, 2026 02:13
Instead of leaving the CEO without an instructions path and expecting
them to self-configure via the bootstrap task, set instructionsFilePath
to the assembled agents/ceo/AGENTS.md and cwd to companyDir (falling
back to user-specified cwd) directly at agent creation time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both error-state Back buttons were hardcoded to GO_TO summary, which
isn't part of AI_STEPS. Now they check state.path and route to
ai-wizard (AI flow) or summary (manual flow) accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lx-0 lx-0 requested a review from YyRemy March 19, 2026 01:26
lx-0 and others added 2 commits March 19, 2026 02:26
- tsconfig: switch module/moduleResolution to ESNext/bundler (correct
  for esbuild projects; removes requirement for .js extensions on imports)
- Add @types/react-dom devDependency
- Add src/vite.d.ts for ?raw import declarations
- Fix hover-card useRef() calls to pass undefined (React 19 types require
  an initial value argument)
- ci.yml: add pnpm typecheck step before build
- Add secret-scan.yml (Gitleaks) matching agentic-foundation config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
YyRemy
YyRemy previously approved these changes Mar 19, 2026
Copy link
Collaborator

@YyRemy YyRemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Code Review

Verdict: APPROVE

Validation

  • The PR does what it claims: it replaces the standalone flow with a native Paperclip plugin, adds the wizard UI, and wires the provisioning pipeline through the worker.
  • Scope is large, but internally coherent: manifest, worker, UI, templates, docs, and CI all move in the same direction.

Verification

  • I spot-checked the worker/manifest/UI wiring and did not find a blocking correctness or security issue in the implementation itself.
  • The provisioning flow, config handling, and bootstrap issue creation all line up with the PR narrative.

Minor note

  • Non-blocking smell: worker.ts supports cfg.paperclipUrl, but manifest.ts does not expose a paperclipUrl instance config field. If non-default / remote Paperclip URLs should be configurable from plugin settings (not just env), that setting still needs to be surfaced explicitly.

Per request I am not merging this PR.

…fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e54fdf02b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lx-0 and others added 2 commits March 19, 2026 02:41
Remove private flag, add files field to include dist/ and templates/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const jsonMatch = text.match(/\{[\s\S]*\}/);
if (!jsonMatch) return null;
try {
const config = JSON.parse(jsonMatch[0]);

P2 Badge Parse a bounded JSON block from AI replies

The config extractor uses a greedy pattern (/\{[\s\S]*\}/) that grabs from the first { to the last } in the entire response. If the model includes any extra braces before/after the config (common with explanatory text or multiple blocks), JSON.parse fails and the AI path reports "Could not parse configuration" even though a valid config object is present. Switching to a bounded/non-greedy JSON block extraction avoids these false negatives.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lx-0 and others added 2 commits March 19, 2026 02:48
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lx-0 and others added 5 commits March 19, 2026 02:52
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces greedy regex that grabbed first-to-last brace, which fails when
the model wraps the config in explanatory text containing extra braces.
Now extracts all top-level JSON objects and returns the first valid one
with the expected shape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… overrides on config change

- GitHub tree URL parser now uses greedy branch capture so URLs like
  .../tree/feature/my-branch/templates resolve correctly
- SET_PRESET, SET_MODULES, SET_ROLES now clear fileOverrides so stale
  preview edits are not applied after the user changes their configuration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1cd22c998

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…arser

- applyConfigToState now expands module dependencies (via requires fields)
  so AI-selected modules like ci-cd automatically pull in github-repo
- Revert greedy branch regex to single-segment branch with greedy subpath,
  fixing the regression where main/templates/v2 was parsed as branch
  main/templates and subpath v2. Branch names with slashes are unsupported.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b4ebd5ac8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Align UI toPascalCase with logic version (filter(Boolean), preserve casing)
- Extract getPluginSettingsUrl to shared utils, remove duplicates
- Remove unused ThemeToggle, showBack, ArrowLeft/Paperclip/Sun/Moon imports
- Move misplaced provisioning comment above start-provision action
- Guard config.modules/roles with Array.isArray before filtering (Codex P1)
- Remove window.scrollY/scrollX offsets from fixed-position hover-card

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@YyRemy YyRemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Code Review

Verdict: REQUEST_CHANGES

Validation

  • The implementation is substantial and the worker/UI wiring is real.
  • But after a stricter reread, the delivered behavior does not fully match the way the PR and README frame the feature.

Verification

  • The current provisioning flow creates a company, a single CEO agent, and one bootstrap issue. It does not provision the full team during the wizard run, even though the user-facing framing strongly implies that it does.
  • The flow also has no compensation/rollback if a downstream step fails after company creation, which can leave partially provisioned state behind while this action is presented as a successful end-to-end provisioner.

Risk Assessment

  • Risk: Medium. The code is not obviously unsafe, but the mismatch between product claim and actual behavior plus partial-provision failure handling makes this too misleading/fragile for approval.

Please either narrow the claims/copy to describe this as a CEO bootstrap flow, or complete the missing provisioning/cleanup behavior.

lx-0 and others added 2 commits March 19, 2026 11:41
- Wrap CEO agent + bootstrap issue creation in try/catch: on failure,
  attempt to delete the partially created company so users are not left
  with an empty stub. Report cleanup result in the provision log.
- Add deleteCompany() to PaperclipClient
- Update README to accurately describe what provisioning creates (company
  + CEO + bootstrap task) and that the CEO sets up the rest on first heartbeat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d code

- Changed `templatesRepoUrl` default value to point to the correct GitHub repository for templates.
- Updated README, CHANGELOG, and CLAUDE files to reflect the new plugin source.
- Ensured all instances of the old repository reference were replaced with the new one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Corrected the URL for the CI badge in the README to ensure it points to the appropriate GitHub Actions workflow.
…in README

- Included installation command for the Paperclip company wizard plugin to enhance user guidance.
@lx-0 lx-0 merged commit 5df66ff into main Mar 19, 2026
4 checks passed
@lx-0 lx-0 deleted the feat/paperclip-plugin-impl branch March 19, 2026 19:01
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

| **`website-relaunch`** | website-relaunch, github-repo, pr-review, backlog, auto-assign, stall-detection + UI Designer + PO | Relaunch a website with external design assets |
| **`repo-maintenance`** | triage, codebase-onboarding, dependency-management, release-management, github-repo, pr-review, backlog, auto-assign, stall-detection + Code Reviewer + PO | Maintain an existing repository |
| **`build-game`** | game-design, tech-stack, github-repo, backlog, auto-assign, stall-detection + Game Designer + Game Artist + Audio Designer | Build a game from idea to release |
| **`launch-pack`** | vision-workshop, market-analysis, competitive-intel, brand-identity, tech-stack, architecture-plan, launch-mvp, github-repo, backlog, auto-assign, stall-detection + CTO + CMO | Full executive team launch: strategy, tech, and marketing from day one |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

launch-pack preset missing Engineer despite technical modules

Medium Severity

The launch-pack preset includes technical modules (github-repo, tech-stack, architecture-plan, launch-mvp) but its roles array only has cto and cmo — no engineer. Since Engineer is no longer a base role, companies created with this preset will have no implementing engineer. Every other preset with github-repo explicitly includes Engineer. The graceful fallback means the CEO handles implementation, but this seems unintentional given the preset's scope.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants