chore(bootstrap) regenerate .claude/agents/ via /agent-bootstrap - #265
Conversation
Refresh the project-specific agent suite by running the full bootstrap workflow (project-doc-ingestor → language/domain detection → expertise mapping → decomposition → prompt generation → validation). The new suite is decomposed into 16 specialist critic agents that align with the current desktop architecture: split api-architect into gateway-ops and cloud-relay, auth-security-expert into gateway-auth and command- signing, devops-architect into electron-build and ci-release. Adds analytics-integration-expert, observability-architect, realtime-arch, caching-strategist, frontend-architect, authorization-architect, database-architect alongside refreshed test-strategist, security- privacy, typescript-expert, and gateway-operations-architect prompts. - Add 12 new agents under .claude/agents/ matching the decomposed spec - Update 4 existing tracked agents (gateway-operations-architect, security-privacy, test-strategist, typescript-expert) to the new critic-mode format (Execution Modes / Critic Responsibilities / Reference Guidance / review-delta.schema.json output contract) - Remove 7 superseded legacy agents (cloud-command-executor-specialist, cloud-connection-specialist, electron-specialist, gateway-core- architect, git-operations-expert, persistence-expert, process- management-expert) — replaced by the new specialists - Sync tracked .claude/settings/critic-gates.json with the regenerated critic-gates config that maps the new agent suite Testing: ran the full /agent-bootstrap pipeline; phases 1–8 all completed with the final validator reporting 16/16 agents pass and 0 blocking issues (5 low-severity warnings about color reuse and large agent files, all within budget). Risks: None for runtime — these are AI critic agent definitions used by the /code workflow, not application code. Reviewers should sanity- check that the new agent suite reflects current domain ownership. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
thadeusb
left a comment
There was a problem hiding this comment.
Regen checks out. Walked the gate config against the suite (16 files, 16 referenced critics, zero dangling refs to the 7 deleted agents) and spot-checked the grounding: ports, the deny-list, security.ts, origin-policy.ts, the signing modules are all real, not hallucinated. One thing flagged: the main-process lifecycle (tray/window/preload) lost its pattern coverage when electron-specialist got split.
Addresses PR #265 review feedback from @thadeusb. When electron- specialist was split into specialists, the previous moduleCritics entry for the `electron`/`ipc`/`preload`/`tray`/`window`/`browserwindow`/ `auto-update` vocabulary lost its routing. Changes to `apps/desktop/src/main/{preload,tray,window,app,app-lifecycle}.ts` were matching only the 3 baseCritics with no domain specialist in the gate. - frontend-architect: claim the main-process platform layer explicitly in Role + Project Context. Add a new responsibility domain "Main-Process Lifecycle, Window & Tray Management" with blocking/major/minor severities covering single-instance lock, hide-to-tray on macOS, tray state synchronization, devtools gating, app shutdown flush, BrowserWindow webPreferences, and auto-update UX surfacing - Fix incorrect preload path in Project Context (was src/renderer/preload.ts, actually src/main/preload.ts) - critic-gates.json: add a moduleCritics entry mapping electron/ipc/ preload/tray/window/browserwindow/main-process/app-lifecycle/ single-instance/hide-to-tray/context-bridge patterns to frontend-architect Testing: confirmed apps/desktop/src/main/{preload,tray,window, app-lifecycle}.ts now match the new pattern entry; JSON validates; frontend-architect.md still passes the agent-prompt-validator structural checks (6→7 responsibility domains, well under section count and file size budgets). Risks: None for runtime. Reviewer should confirm frontend-architect is the right home for tray/window/lifecycle (vs spinning up a dedicated main-process specialist), or push back and the routing can move. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses points 1-3 of the post-merge comparison with PR 123 of
claude-plugins (the merged-clean reference bootstrap PR).
1. .gitignore carve-out (mirrors PR 123's pattern). Ignore everything
under .closedloop-ai/ EXCEPT the bootstrap plugin's documented
durable outputs:
- bootstrap-metadata.json (tracks generated agents for --update)
- settings/critic-gates.json (critic selection for /code)
Ephemeral run state under .closedloop-ai/bootstrap/<ts>/ remains
ignored.
2. Move critic-gates.json from the legacy tracked snapshot location
(.claude/settings/critic-gates.json) to the README-canonical
location (.closedloop-ai/settings/critic-gates.json). Git records
this as a rename — content is identical. The legacy path was a
closedloop-electron-specific convention with no plugin caller
(grep confirms zero references in *.ts / *.json / *.mjs / *.sh /
*.md / Justfile across the repo). Eliminates the drift hazard
where the next /agent-bootstrap run would only write to the
canonical path, leaving the snapshot stale.
3. Commit .closedloop-ai/bootstrap-metadata.json so --update mode has
the generation manifest on a fresh clone. Added the
pre_existing_agents schema field (empty []) — this PR replaced all
prior tracked agents, but future hand-curated agents added
alongside the bootstrap suite belong here so they're spared by
--update.
Testing: git check-ignore confirms the canonical paths are tracked
and ephemeral state (bootstrap/<ts>/, code-review/*) stays ignored.
JSON validity verified for both critic-gates.json and
bootstrap-metadata.json.
Risks: None for runtime. Reviewers on a stale checkout will see the
legacy .claude/settings/critic-gates.json disappear — restore via
rebase or accept the move; the canonical location is the README's
documented source of truth.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses @thadeusb's reply on PR #265 review thread: prefers a dedicated desktop platform architect over expanding frontend- architect's scope. Splits the main-process platform layer out as its own specialist and narrows frontend-architect back to renderer UI / browser-ish concerns. This reverts the in-place expansion from 6c27c2d and applies the decomposition principle from the bootstrap README instead. NEW: desktop-platform-architect (cyan, 6 responsibility domains) - Application Lifecycle & Single-Instance Lock - BrowserWindow Management & webPreferences Hardening - Tray State & Menu Management - Hide-to-Tray Semantics & macOS Quirks - Preload Script & contextBridge IPC Bridge - Auto-Update UX Integration (handoff: release pipeline → ci-release-architect) Covers apps/desktop/src/main/{app,app-lifecycle,window,tray, preload}.ts and the contextBridge IPC surface. Explicit cross-agent handoffs documented for release pipeline (ci-release-architect), renderer UI (frontend-architect), and build packaging (electron- build-architect). frontend-architect: narrowed to 5 renderer-only domains - iframe Shell & postMessage Protocol - Vite 6.x Build Configuration - Tailwind CSS 3.4 Configuration - Renderer HTML Shell & CSP - Renderer Bundle Performance & Hygiene (new domain replaces removed IPC/preload/lifecycle sections) Removed the IPC bridge, preload-safety, and main-process lifecycle responsibility domains. Scope statement now explicitly hands those off to desktop-platform-architect. critic-gates.json: the moduleCritics entry routing electron/ipc/ preload/tray/window/browserwindow/main-process/app-lifecycle/ single-instance/hide-to-tray/context-bridge patterns now points to desktop-platform-architect (was frontend-architect, added in 6c27c2d). Also added macos/dock/native-menu/auto-update-ux patterns to that entry. bootstrap-metadata.json: added desktop-platform-architect entry with split_from / split_reason fields documenting the post-review decomposition. Testing: - Both agents pass YAML, structure, section-ordering, and file-size checks (20K / 16K, well under the 150KB blocking limit) - 17 critics referenced in critic-gates.json resolve to 17 agent files (no orphans, no dangling refs) - JSON validity verified for both edited config files - No files under apps/desktop/** changed — version-check workflow remains correctly skipped Risks: None for runtime — agent prompt definitions only. Reviewer should sanity-check that desktop-platform-architect's six domains match the macOS-first hide-to-tray design and that frontend- architect's narrowed scope doesn't leave any renderer concern homeless. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The PR's earlier commits only touched .claude/, .closedloop-ai/, and .gitignore — none under apps/desktop/**. The Desktop Version Bump Check workflow has a `paths: apps/desktop/**` trigger filter, so it never fired. Branch protection requires it to be reported, so GitHub marks the PR mergeable_state=blocked despite all 4 actual checks passing. Touching apps/desktop/package.json with the required version increment satisfies both halves: the path filter triggers the workflow, and the bumped version passes the workflow's actual check. Also merges origin/main (0.15.105 → 0.15.106 bump is on top of the freshly-pulled main). No conflicts — my .claude/ + .closedloop-ai/ changes are orthogonal to the desktop source updates from main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| "critics": ["security-privacy", "authorization-architect"] | ||
| }, | ||
| { | ||
| "patterns": ["command", "signing", "key", "admin-key", "managed-key"], |
There was a problem hiding this comment.
Routing generic command to command-signing-expert does not replace the deleted cloud-command-executor-specialist. Changes to cloud-command-executor.ts queueing, replay/sequence, cancel/timeout, gateway-token dispatch, and retention behavior will match command but not a cloud relay/executor owner. Add explicit executor/cloud relay ownership and patterns such as cloud-command-executor, queue, replay, sequence, cancel, timeout, and retention.
| "critics": ["security-privacy", "command-signing-expert"] | ||
| }, | ||
| { | ||
| "patterns": ["gateway", "operations", "router", "routes", "api", "endpoint", "rest"], |
There was a problem hiding this comment.
This row routes generic gateway terms, but the deleted git-operations-expert and process-management-expert routing is not recreated. Paths and work items containing git, worktree, diff, terminal, process, spawn, pid, child_process, or kill can now fall through to only base critics even though gateway-operations-architect claims the operation/process families. Add those patterns to an equivalent owner or keep dedicated replacement critics.
| "critics": ["cloud-relay-architect", "realtime-architect"] | ||
| }, | ||
| { | ||
| "patterns": ["realtime", "watcher", "stream", "tailer", "postmessage", "iframe"], |
There was a problem hiding this comment.
postmessage and iframe currently select only realtime-architect, but these are privileged sidecar/renderer authorization surfaces in this app. That misses checks for trustedAction, loopback origin restrictions, and IPC/contextBridge write access. Add authorization-architect here or include postmessage/iframe/trusted-action/sidecar in the authorization row.
| @@ -4,7 +4,13 @@ dist | |||
| .idea | |||
| .vscode | |||
| .claude/ | |||
There was a problem hiding this comment.
The PR treats .claude/agents/*.md as durable bootstrap output, but .claude/ remains ignored. Future /agent-bootstrap --update runs that add or split an agent can update visible .closedloop-ai metadata/gates while the new prompt file stays hidden from normal git status/git add, leaving fresh clones with gates that reference a missing critic. Unignore the durable agent path, e.g. .claude/agents/ and .claude/agents/*.md, while keeping ephemeral .claude state ignored.
| # - settings/ (critic-gates.json — critic selection for /code) | ||
| .closedloop-ai/* | ||
| !.closedloop-ai/bootstrap-metadata.json | ||
| !.closedloop-ai/settings/ |
There was a problem hiding this comment.
This exception exposes the whole .closedloop-ai/settings/ directory even though the durable contract is only .closedloop-ai/settings/critic-gates.json. Any future local/generated settings file under that directory becomes unignored and easy to commit accidentally. Keep the directory traversal exception, then re-ignore .closedloop-ai/settings/* and explicitly unignore .closedloop-ai/settings/critic-gates.json.
| - `apps/desktop/src/main/app-lifecycle.ts` — shutdown sequencing (electron-store flush, activity-log flush, cloud-relay disconnect) | ||
| - `apps/desktop/src/main/window.ts` — `BrowserWindow` creation, `ready-to-show`, show/hide transitions, position persistence | ||
| - `apps/desktop/src/main/tray.ts` — tray icon, context menu, state sync with cloud-relay / sessions / errors | ||
| - `apps/desktop/src/main/preload.ts` — typed `electronAPI` surface via contextBridge (lives in `src/main/` even though it loads into the renderer, per Electron's preload model) |
There was a problem hiding this comment.
The current preload contract is window.desktopApi from apps/desktop/src/main/preload.ts, and there is no src/shared/electron-api.ts or shared IPC-channel constants contract today. This prompt will tell critics to enforce nonexistent electronAPI/shared-constant conventions and produce false findings. Align the agent with the current desktopApi/inline-channel pattern, or add the shared contract before making the agent enforce it.
|
|
||
| - Build order: `tsc` → `pnpm build:agent-monitor` (runs `build-agent-monitor.mjs`) → Vite bundle → `stage-packaging-app.mjs` → `electron-builder` | ||
| - Patch application in `build-agent-monitor.mjs` is deterministic and ordered — new patches must be appended, not inserted, unless ordering is explicitly justified | ||
| - Generated files in `.generated/agent-monitor/` are committed to the repo so CI does not need to re-run the full upstream resolution on every build |
There was a problem hiding this comment.
apps/desktop/.generated/agent-monitor/ is ignored by .gitignore, so this existing-pattern statement is backwards. A critic following it can require committing generated runtime output that the repo explicitly excludes. Replace this with the actual rule: source/stamp/materialization inputs are committed, generated output is rebuilt by build-agent-monitor.mjs/pnpm build:agent-monitor, and generated output is not hand-edited.
| @@ -0,0 +1,278 @@ | |||
| { | |||
| "bootstrap_version": "0.1.0", | |||
| "last_run": "2026-06-02T14:36:19Z", | |||
There was a problem hiding this comment.
last_run is earlier than the new desktop-platform-architect.generated timestamp (2026-06-02T17:30:00Z later in this file). Because this file is the durable update-mode manifest, a stale run timestamp makes the snapshot internally inconsistent for future bootstrap/update tooling. Regenerate the metadata or set last_run to the actual latest generation timestamp.
main advanced 2 commits after the initial Phase 0 merge, putting PR #264 behind/conflicting again: - #266 "Scope browser command keys to active targets" (touches app.ts, command-key-*, contracts.ts) - #265 ".claude/agents regenerate via /agent-bootstrap" (docs/config) - Resolve the lone conflict: package.json version -> 0.15.107 (above main's 0.15.106; single bump for the branch). - app.ts and .gitignore auto-merged cleanly (#266's command-key additions compose with the in-process agent-DB wiring). - No dependency or lockfile changes from the two new commits. Testing: - just desktop-typecheck passes (tsc --noEmit, exit 0) - just desktop-test passes (exit 0; 0 failures; 14 skips unchanged: 13 CI-standard generated-gated + 2 documented FEA-1497 retarget-skips) - git merge-base --is-ancestor origin/main HEAD holds after this commit Risks: - Test-affecting changes are limited to merge resolution; no production logic authored here. main remains a moving target (further advances need further merges before final merge to main).
Summary
Refresh of the project-specific agent suite under
.claude/agents/by running the full/agent-bootstrappipeline. The bootstrap re-analyzedCLAUDE.md, language counts, and domain signals and produced a decomposed 16-agent critic suite that matches the current closedloop-electron architecture.Commits in this PR:
ada8896— Initial bootstrap output (16 agents, 7 orphan deletions, 4 refreshes).6c27c2d— Coverage-gap fix: main-process Electron lifecycle (tray/window/preload/app) lost critic routing whenelectron-specialistwas split; expandedfrontend-architectscope + added newmoduleCriticspattern. (Addresses @thadeusb's review comment.)9e4c3d6— Move durable bootstrap outputs to README-canonical paths (.closedloop-ai/settings/critic-gates.json,.closedloop-ai/bootstrap-metadata.json) with a.gitignorecarve-out mirroring claude-plugins PR #123. Drops the legacy.claude/settings/critic-gates.jsonsnapshot (no callers; was a drift trap).Scope-handoff table — where each removed legacy agent's responsibilities went
The previous tracked suite had 11 agents. This PR replaces them with the bootstrap's decomposed 16-agent suite. Here is exactly where each legacy concern lives now, so a reviewer doesn't need to reconstruct it from the diff:
cloud-command-executor-specialistcloud-relay-architect. Authorized-command execution and key approval →command-signing-expert.cloud-connection-specialistcloud-relay-architect. FS-watcher / live-session monitoring concerns →realtime-architect.electron-specialistwebPreferences, IPC bridge via contextBridge →frontend-architect(scope expanded in commit6c27c2d). Multi-step packaging (tsc + Vite + agent-monitor build + electron-builder + asar-external) →electron-build-architect. Auto-update flow →ci-release-architect(release side) +frontend-architect(tray-menu UX side). safeStorage credential encryption →security-privacy.gateway-core-architectgateway-operations-architect. Token validation + auth headers →gateway-auth-architect. NDJSON bridging onto cloud relay →cloud-relay-architect.git-operations-expertgateway-operations-architect(git is one operation family among many; no separate specialist needed given the decomposition principle).persistence-expertdatabase-architect.process-management-expertgateway-operations-architect(terminal/spawn handlers live there). Approved-command execution policy →command-signing-expert. Sandbox path enforcement on spawn →authorization-architect.The 4 names that survived (with refreshed content):
test-strategist,security-privacy,typescript-expert,gateway-operations-architect— all reformatted to the AGENT_FORMAT.md critic-mode + legacy-mode structure.Decomposition rationale
Three monolithic candidates were rated HIGH complexity by the decomposer and split into specialists:
api-architect→gateway-operations-architect+cloud-relay-architect. Two fundamentally different transports (HTTP gateway vs Socket.IO cloud relay) with different test surfaces.auth-security-expert→gateway-auth-architect+command-signing-expert. Session-token auth (challenge-exchange, X-Desktop-Session-Token) and command signing (authorized-command-key-store, command-signature-verifier) have different lifecycles and attack models.devops-architect→electron-build-architect+ci-release-architect. Multi-step local build (tsc + Vite + agent-monitor + electron-builder) and CI/CD release automation (GitHub Actions, electron-updater, pnpm supply-chain) require different expertise and rarely change together.7 other domain candidates were kept monolithic where decomposition wouldn't meaningfully improve output (
database-architect,caching-strategist,realtime-architect,authorization-architect,observability-architect,analytics-integration-expert,frontend-architect).Files committed at README-canonical paths
.claude/agents/*.md(16).closedloop-ai/settings/critic-gates.json/codeworkflow (perplugins/bootstrap/README.md).closedloop-ai/bootstrap-metadata.json--updatemode; includes emptypre_existing_agents: []schema field.gitignoreTest plan
/agent-bootstrapphases 1–9 end-to-end; final validator reports 16/16 PASS, 0 blocking issues.agent-prompt-validator— every agent has proper YAML front matter, valid model/color/tools/skills,## Execution Modesfirst H2,Critic Responsibilitieswith Blocking/Major/Minor severities,review-delta.schema.jsonoutput contract.bootstrap-validator— DAG integrity: every critic incritic-gates.jsonresolves to a generated agent file; no orphan critics; required agents (test-strategist,security-privacy) present and critic-capable.git check-ignoreconfirms ephemeral.closedloop-ai/bootstrap/<timestamp>/and.closedloop-ai/code-review/*remain gitignored; only the two documented durable outputs are tracked..claude/settings/critic-gates.json(the now-removed legacy snapshot) — zero matches across*.ts,*.json,*.mjs,*.sh,*.md,Justfile.gateway-auth-architect.mdvs the challenge-exchange code inapps/desktop/src/server/command-signing-expert.mdvsauthorized-command-key-storeandcommand-signature-verifierelectron-build-architect.mdvsbuild-agent-monitor.mjsandstage-packaging-app.mjsfrontend-architect.mdDomain 7 (Main-Process Lifecycle, Window & Tray) vsapps/desktop/src/main/{preload,tray,window,app,app-lifecycle}.tsRisks
None for runtime — these files are AI critic-agent definitions consumed by the
/codeplanning workflow, not application code. They do not affect the desktop app's build, packaging, or runtime behavior.The main reviewer responsibility is content review: are the right specialists named, are their responsibility boundaries sensible (see scope-handoff table above), and do the critic-gates patterns route correctly?
🤖 Generated with Claude Code