Skip to content

pstack W6: plugin packs #12

Open
Open

Description

@ibetitsmike

Xum created this issue on behalf of @ibetitsmike.

Part of #4.

Workspace brief from the pstack parity plan (local plan page "Running pstack on the Coder Agents Fork"; the PRD is local to Mike's Mac and not reproduced here). Claim numbers such as 1.3 or shared.2 refer to the plan page.

W6 · Plugin packs · mike/plugin-packs

Task. PRD 6.7, 6.9 and 6.10.

Background. The agent watches ~/.claude/plugins/cache but ignores manifests (agent/agentcontext/defaults.go:9-21); KindPlugin exists (resolve.go:844). pstack v0.15.36 has plugin.json (agent-plugins.org schema) and .cursor-plugin/plugin.json, 58 skills and 2 agents. Upstream plugin PR coder#29323 is closed and FE PR coder#30577 is stale: read them for design, do not merge them.

Scope.

  1. Manifests: .claude-plugin/plugin.json, .cursor-plugin/plugin.json, plugin.json, in the watched cache and in installed packs (R7.1, R7.4, R7.5).
  2. Install from a Git URL, path and ref into a tier (chatd.plugins, plugin_resources); coderd fetches once and pins the commit; update is explicit (R7.2); enable per project and chat (R7.3); organization source allowlist (R7.6).
  3. Rules: .cursor/rules/*.mdc, ~/.cursor/rules, ~/.coder/rules with alwaysApply and globs (R9.1, R9.2) beside resolve.go:48-52.
  4. Sticky skills (R10.1): chat_pinned_skills, re-injected like the todo list.

Acceptance (PRD 6.7). Installing pstack from cursor/plugins at v0.15.36 exposes its skills as slash commands and its agents as spawn_agent types, with no manual copying.

Constraints. Experiment fork-plugin-packs. Fork PR #2 already takes the table names plugins, plugin_user_links, plugin_link_codes and plugin_chat_bindings for server-side chat plugins, so W6 uses plugin_packs and plugin_pack_resources. Fetch only from allowlisted HTTPS hosts, with size limits and no submodules. Starts after W1 merges; pinned skills reuse W4's re-injection in generation.go, so W4 merges first.


Rules for every workspace

Topic Rule
Runner One Xum workspace per brief (W0 runs as W0a and W0b), started from fork main at its wave start. Every implementation runs implement-flow with the workstream issue as its input and the brief as the plan.
Branches mike/<topic> for the workspace; stacked PR branches mike/<topic>-<n>-<slug>. Local name equals remote name. Never push to main.
PR size 500 changed lines at most per PR, generated code excepted (reviewer-friendly-pr). Stack with gh stack; the extension is not installed on the Mac today (gh extension install github/gh-stack), else use explicit-base PRs.
Schema Fork tables are chatd graph nodes: go run ./coderd/database/migrations/chatdmig/cmd/chatdmig new <name> -requires <node or upstream:name>. Never edit a node that ran. No edits to dump.sql, queries.sql.go, querier.go, dbmock or numbered migrations.
Queries coderd/database/forkdb only (created by W0). Every method goes through the forkdb authz wrapper. A forkdb write that belongs with an upstream write runs in the same transaction, through the W0 accessor (database.Store exposes only InTx, coderd/database/db.go:22-31).
Authorization Chat-owned rows authorize through the owning chat (dbauthz.go:6513-6522 pattern). Agent and plugin rows reuse the skill RBAC objects. No new RBAC resources, no new API key scopes. Tools run as the chatd subject, which can read and update every chat (dbauthz.go:807-817): a tool that touches a chat other than its own runs as the owner (asOwner, chattool/listtemplates.go:437-443).
Upstream files One hook line per hot file (plan shared.2). Logic lives in new fork files. Hot files: turn_environment.go, chatd.go, subagent*.go, codersdk/chats.go, deployment.go, dbauthz.go, chat_routes.go, AgentChatInput, AgentChatPageView.
Open upstream PRs If a workspace needs an open coder/coder PR, W0 or W7 merges its branch into the fork with a merge commit. Its migrations go through chatdmig route into the chatd schema. Sync conflicts are solved later (Mike, 2026-11-08).
Flags Each feature is behind its fork-* experiment in codersdk/fork_experiments.go. With the flag off, tool lists, routes and UI match upstream.
API Swagger annotations on new public endpoints. Audited types update enterprise/audit/table.go.
chatd docs coderd/x/chatd/ARCHITECTURE.md gets TODO lines only. Mike writes the text.
Validation Go suites run in Colima: a postgres:17 container, plus golang:<go.mod version>-bookworm --network container:<pg> with volumes coder-gen-gomod and coder-gen-gocache and postgresql-client-17 from PGDG. chatdmig tests use CHATDMIG_TEST_DATABASE_URL='postgres://[email protected]:5432/postgres?sslmode=disable'. Never create a postgres role on the live Postgres. Frontend: site/AGENTS.md commands plus frontend-deep-review for any site/ diff.
Review implement-flow ends with codex-review-loop; Codex is installed (2026-11-08). If @codex review gets no reply within 30 minutes, tell the lead and run code-quality-review with Opus until Codex answers. Mike (2026-11-09): fix real defects in the PR's own change; drop scope creep and defensive bikeshedding with a one-line reply and a resolved thread, no follow-up issue. Upstream is only a sync source: never report or file anything upstream.
UAT coder-agents-uat through Coder MCP on the local deployment (http://127.0.0.1:3000, templates devcontainer or docker, RUNBOOK "Running a branch in a dev container workspace"). The remote agent runs scripts/develop.sh for the branch inside its workspace (plan decision uat). Never coder-local use a branch build: that replaces Mike's daily server.
Ready When a PR meets the merge bar, send the lead (task_send_message to 8ac7791132) READY #<pr> <head sha> with the CI, Codex, UAT and open-thread evidence, then wait. Never merge yourself.
Merge The lead merges (Mike, 2026-11-08). Merge bar: green fork-ci on the exact head, a clean Codex verdict, or Codex findings that were all fixed or dropped under the scope rule (the lead confirms each drop), no unresolved threads, UAT PASS on the head or on a SHA whose later commits only answer review, and a lead review of the diff against the brief. Squash, except sync and upstream stack PRs, which take a merge commit. A merge to fork main deploys Mike's daily server through autodeploy within about 5 minutes plus a drain of up to 30 minutes, so the lead merges one PR at a time and waits until Fork ops reports the deploy healthy. Experiments stay off on that server until Mike enables them.
Follow-ups A defect in merged code or on the daily server becomes an issue in ibetitsmike/coder with label followup. Fork ops triages it; an accepted one gets its own workspace running implement-flow.

Activity

  1. added
    pstack-parity
    on Nov 8, 2026
  2. ibetitsmike commented on Nov 10, 2026

    @ibetitsmike
    OwnerAuthor

    PR1 (manifest-aware plugin pack discovery) is open as draft #156: the agentcontext resolver discovers packs (Claude Code, Cursor and agent-plugins.org manifests) among scan roots, emits their declared skills and agents like ordinary containers, and a chatd gate drops pack contributions from the prompt and context popup while fork-plugins is off. origin/main is merged at 3315517; fork-ci and Codex verdicts pending, then the :3100 UAT through ops. Install (PR2), per-chat enable (PR3), rules (PR4) and pinned skills (PR5) follow.

    Xum commented on behalf of @ibetitsmike.

  3. ibetitsmike commented on Nov 17, 2026

    @ibetitsmike
    OwnerAuthor

    Coder Agents acted on behalf of @ibetitsmike.

    Coverage check of the W6 scope on main, 2026-11-17 (read-only code review at ed5b24c; later merges did not touch these areas):

    1. Manifests: implemented. agent/agentcontext/fork_plugins.go reads .claude-plugin/plugin.json, .cursor-plugin/plugin.json and plugin.json in ~/.claude/plugins/cache and in managed packs under ~/.coder/plugins/.
    2. Install, pin, update, enable, allowlist: implemented. The chatdmig nodes add plugin_packs, plugin_pack_resources, plugin_pack_sources, the enablement tables and chat_excluded_plugin_packs. The fetch in coderd/x/pluginpacks/fetch.go allows HTTPS only, has size limits and skips submodules. Updates are explicit. Packs are enabled per project and per chat. Enablement writes are audited since feat(coderd): audit agent definition and plugin pack enablement changes #381.
    3. Rules: implemented in agent/agentcontext/fork_rules.go, for .cursor/rules/*.mdc, ~/.cursor/rules and ~/.coder/rules, with alwaysApply and globs.
    4. Pinned skills: implemented behind fork-pinned-skills, with chat_pinned_skills, its routes and re-injection.
    5. Acceptance: pack skills show in the / menu and pack agents become spawn_agent types. Pack commands/ entries are not emitted as separate commands (KindCommand is reserved). That is outside the acceptance text.

    What is left is the end-to-end acceptance run: install pstack v0.15.36 from cursor/plugins on a live server and confirm its skills and agents. That run belongs with #13 (W7 adapter and end-to-end checks, needs-mike), so this issue stays open until that evidence exists.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pstack-parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions