ccc-browse · diff

git:20260728.38c269b to git:20261013.fbe187d

66 added, 190 removed. Audit A to A.

---
name: ccc-browse
- description: "Visual, filterable catalog of every CC Commander skill, agent, and command. Cascades from broad category picker into 4-at-a-time detail cards. Use when the user types…"
+ description: "Browse every CC Commander skill, agent and domain: publish the searchable Cockpit catalog page after consent, or drill in four at a time with pickers and launch one. Use when the user asks what Commander can do, wants the catalog, or types $ccc-browse."
allowed-tools:
- Read
- Glob
- Grep
- Bash
- Artifact
+ - Agent
- AskUserQuestion
- argument-hint: "[domains | workflows | agents | all]"
+ argument-hint: "[cockpit | domains | workflows | agents | all]"
+ model: sonnet
+ effort: low
---
- # $ccc-browse — Skill + Agent Catalog
-
- A click-first browser for the entire CC Commander surface: 11 CCC domains, 9 workflow skills, 22 specialist agents, plus meta skills. User never scrolls a wall of markdown — we cascade through `AskUserQuestion` 4-at-a-time.
-
- ## Response shape (EVERY time)
-
- Output exactly these three sections in order:
-
- ### 1. Brand header (one line, markdown)
+ # $ccc-browse — the Commander catalog
- ```
- **CC Commander** · v{VERSION} · Browser · 60 skills · 22 agents · 11 domains
- ```
+ **CC Commander** · $ccc-browse · find a skill or agent by clicking, then run it without leaving the flow.
- Read `VERSION` from `${CLAUDE_PLUGIN_ROOT}/.codex-plugin/plugin.json`.
+ ## When to use / when not to
- ### 2. Context strip (one paragraph, markdown)
+ - Use when the user asks what Commander can do, wants to find a skill or agent, or wants the Cockpit page.
+ - Use `$ccc-console` for live agent, cost and safety numbers; `$ccc-suggest` when the user wants a recommendation rather than a catalog.
- Count categories live with a single Bash call:
- - `ls ${CLAUDE_PLUGIN_ROOT}/skills/ | wc -l` → total skills
- - `ls ${CLAUDE_PLUGIN_ROOT}/agents/*.md | wc -l` → agents
- - `ls ${CLAUDE_PLUGIN_ROOT}/skills/ccc-* -d 2>/dev/null | wc -l` → ccc-* skills
+ ## What happens
- Render:
+ ### 1. Header and live counts
- > 🧭 Catalog: `<N>` skills · `<M>` agents · `<K>` CCC domains · filter by category below.
+ Run one Bash call and read every number from it; never type a count from memory:
- ### 3. The picker — `AskUserQuestion` with the Cockpit + 4 categories
+ ```bash
+ R="${CLAUDE_PLUGIN_ROOT:-commander/cowork-plugin}"
+ node -p "JSON.parse(require('fs').readFileSync('$R/.claude-plugin/plugin.json','utf8')).version"
+ ls -d "$R"/skills/*/ | wc -l
+ ls "$R"/agents/*.md | wc -l
+ ls -d "$R"/skills/ccc-*/ | wc -l
+ ```
- **Never dump a numbered list. Never ask the user to type a name.** Call `AskUserQuestion`:
+ Print one line: `**CC Commander** · v<version> · Browser · <skills> skills · <agents> agents`, then one sentence inviting a pick.
- ```
- question: "What do you want to browse?"
- header: "CC Commander catalog"
- multiSelect: false
- options:
- - label: "🎛️ Open the Commander Cockpit — the whole catalog, clickable"
- description: "Generate and publish the searchable, offline catalog as a living Artifact page."
- preview: "Every Commander skill, agent, idea, and prompt pattern in one private client-side page."
- - label: "🎯 Domains (11)"
- description: "MEGA skills — design, marketing, saas, devops, seo, testing, security, data, research, mobile, makeover."
- preview: "Each domain bundles 8-45 sub-skills behind one entry point. Pick one to drill in."
- - label: "🛠️ Workflows (9)"
- description: "Step-by-step skills — plan, build, review, ship, start, learn, xray, linear, fleet."
- preview: "These are the click-first workflows you'll use 80% of the time."
- - label: "🤖 Agents (15)"
- description: "Specialist personas — architect, builder, debugger, reviewer, qa, security, designer, devops, pm, writer, researcher, data, content, perf, fleet."
- preview: "Each agent has a persona voice. Delegate to one from any /ccc flow."
- - label: "🗺️ Show everything as grid"
- description: "One-shot overview — sorted table of all skills + agents with one-line descriptions."
- preview: "No cascading. Dump once and let the user scan. Use when they're window-shopping."
- ```
+ ### 2. Root picker
- Recommendation (⭐):
- - User asks for the full, visual, searchable, or offline catalog → ⭐ "🎛️ Open the Commander Cockpit — the whole catalog, clickable"
- - First-time browser (no prior `$ccc-browse` use in session) → ⭐ "Workflows (9)" — most actionable
- - User came from `$ccc-start` → ⭐ "Domains (11)"
- - Argument `all` passed → skip picker, go straight to grid
+ An argument skips it: `cockpit` (step 3), `domains`, `workflows`, `agents` (step 4), `all` (step 5). Otherwise ask with AskUserQuestion (Codex: a plain-text numbered question):
- ## Handle the selection
+ - 🟢 Open the Commander Cockpit — the whole catalog as one searchable private page
+ - Domains — the big topic routers (design, marketing, devops, …)
+ - Workflows — plan, build, review, ship and the other click-first flows
+ - Agents — the specialist agents you can delegate to
- ### Commander Cockpit → generate and publish the living page
+ Recommend the Cockpit when the user asked for the full, visual or searchable catalog; recommend Workflows on a first visit; recommend Domains when the user came from `$ccc-start`. Put the recommended option first. After any cascade, offer "Show everything as a table" (step 5) as a follow-up.
- 1. Use the same stable path on every run: `<scratchpad>/commander-cockpit.html`. Do not add timestamps or alternate filenames; republishing the same file preserves the living page URL. **`$ccc-console publish` deliberately writes to this same path** (v7.4.0, Kevin's call): the Cockpit and the console snapshot share one living Commander page rather than minting a fifth URL, so keep the favicon `🎛️` in both and never move this path.
- 2. Run the generator — **prefer the in-plugin copy first** (works for every install, marketplace or dev checkout), falling back to the repo-root shim only if that path doesn't exist:
+ ### 3. Commander Cockpit (consent-gated publish)
+ 1. First publish this session: ask with AskUserQuestion.
+ - Question: "Publish the Cockpit as a private claude.ai page? Skill and agent names, plus the local usage counts the page bakes in, leave this machine."
+ - 🟢 Publish — create or update the private page
+ - Browse here instead — pickers only, nothing uploads
+ - Cancel
+ Publish only on an explicit yes. Running `$ccc-browse` again later in this session is the refresh consent.
+ 2. Build onto the shared Commander path (`$ccc-console publish` writes this same path, so both keep one URL):
```bash
+ mkdir -p "<scratchpad>"
if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/build-cockpit.mjs" ]; then
node "${CLAUDE_PLUGIN_ROOT}/scripts/build-cockpit.mjs" --out <scratchpad>/commander-cockpit.html
else
node scripts/build-cockpit.mjs --out <scratchpad>/commander-cockpit.html
fi
```
-
- (v7.3.0: the real builder ships inside the plugin at `${CLAUDE_PLUGIN_ROOT}/scripts/build-cockpit.mjs` — see W2+/codex 7. A marketplace-only install still produces a full Cockpit; it just won't have the 467-skill ecosystem catalog to merge in — the generator degrades that gracefully, never crashing.)
- 3. Publish that exact file with the Artifact tool using:
- - title: `Commander Cockpit`
- - favicon: `🎛️`
- - description: `Every Commander skill, agent, idea and prompt pattern — clickable, searchable, offline.`
- - capabilities: `{downloads: true}` — enables the ⬇ Save button for edited agent profiles; the page feature-detects this capability and hides the button elsewhere.
- 4. **First publish this session** → ask before publishing (skill/agent names and any local telemetry the page bakes in leave the machine for the artifact URL). **Every later run of `$ccc-browse`** → invoking the skill again IS the refresh consent: republish the same file path to the same URL without re-asking. Say that the page is fully client-side and nothing leaves the page beyond that one publish. To refresh later: run `$ccc-browse` again — same URL updates in place; viewers reload.
-
- If neither generator path exists (very old cached plugin version), say so and fall back to the existing category browse flow below; do not fabricate a Cockpit artifact.
-
- > **v7.4.0 — the Cockpit is the console's artifact-side catalog.** The Cockpit's heavy client-side tabs (Enhance, Prompts, Ideas, Agent manager) stay here, on a full-width page where they work; `$ccc-console`'s Launch tab is the compact, one-click version for the 680px inline widget. Same product, two surfaces — mention `$ccc-console` when the user wants the live agent/usage/safety picture rather than the catalog.
-
- > **v7.3.0:** the Cockpit's 8th tab, **Prompts**, is a searchable browser across 4 sources — Anthropic's Claude Code docs prompt library, the CCC field-tested prompt library (+ patterns + course modules), the repo's `prompts/` templates, and a ReadyIQ teaser (agent names + descriptions only). Each entry offers Copy and "✨ Enhance" (hands it straight to the Enhance tab).
-
- > **On Codex:** some panels may be empty on Codex today — Safety's failure hotspots, Mission Control's agent roster, and Usage's savings hero are fed from Claude-only hooks right now. A follow-up workstream wires the matching Codex telemetry.
-
- ### Domains (11) → cascade
-
- Read `${CLAUDE_PLUGIN_ROOT}/skills/` glob for `ccc-<name>` directories excluding meta (`ccc`, `ccc-start`, `ccc-browse`, `ccc-plan`, etc.).
-
- First `AskUserQuestion` (4 of 11):
- ```
- - 🎨 ccc-design · 41 sub-skills · UI/UX, animation, a11y
- - 📢 ccc-marketing · 46 sub-skills · CRO, content, SEO, growth
- - 💼 ccc-saas · 21 sub-skills · auth, billing, multi-tenant
- - ⋯ Next 4 domains
- ```
-
- Second `AskUserQuestion` (4 of 11):
- ```
- - 🚀 ccc-devops · 21 sub-skills · CI/CD, deploys, infra
- - 🔎 ccc-seo · 20 sub-skills · technical + AI search
- - 🧪 ccc-testing · 15 sub-skills · TDD, E2E, coverage
- - ⋯ Next 3 domains
- ```
-
- Third `AskUserQuestion` (3 of 11 + back):
- ```
- - 🔐 ccc-security · 8 sub-skills · OWASP, secrets, CVE
- - 📊 ccc-data · 8 sub-skills · SQL, ETL, viz
- - 🔬 ccc-research · 8 sub-skills · competitive, lit review
- - ↩️ Back to categories
- ```
-
- (One more pass for ccc-mobile + ccc-makeover.)
-
- On pick → invoke that domain's skill (e.g. `ccc-design`) which runs its own sub-picker.
-
- ### Workflows (9) → cascade
-
- Workflows = the click-first skills. Cascade 4-at-a-time:
-
- First picker:
- ```
- - 🚀 $ccc-start · first-run onboarding
- - 📋 $ccc-plan · feature planning flow
- - 🔨 $ccc-build · scaffold web/API/CLI/mobile
- - 🔍 $ccc-review · audit diff/security/perf
- ```
-
- Second picker:
- ```
- - 🚢 $ccc-ship · deploy + PR workflow
- - 🎓 $ccc-learn · extract patterns from session
- - 🩻 $ccc-xray · full project health scorecard
- - 📌 $ccc-linear · Linear issue board
- ```
-
- Third picker:
- ```
- - ⚙️ $ccc-fleet · parallel agent batch work
- - ↩️ Back to categories
- ```
-
- On pick → invoke the skill inline.
-
- ### Agents (15) → cascade
-
- Read `${CLAUDE_PLUGIN_ROOT}/agents/*.md` frontmatter. Cascade 4-at-a-time across 4 pickers:
-
- Pass 1: architect, builder, debugger, reviewer
- Pass 2: qa-engineer, security-auditor, performance-engineer, designer
- Pass 3: devops-engineer, product-manager, technical-writer, researcher
- Pass 4: data-analyst, content-strategist, fleet-worker, ↩️ Back
-
- Each option:
- - `label: "<emoji> <name>"`
- - `description: "<first sentence of agent's frontmatter description>"`
- - `preview: "Best for: <one-line use case>. Model: <opus|sonnet>. Trigger: $ccc-<flow>."`
-
- On pick → offer two actions via second `AskUserQuestion`:
- ```
- - "Delegate a task to <agent> now" → prompts for task, calls Agent tool
- - "Show me the full persona definition" → Read the .md file, render it
- - "Which flows use this agent?" → Grep for the agent name in skills/
- - "↩️ Back"
- ```
-
- ### Show everything as grid → one-shot dump
-
- Render a single markdown table, sorted alphabetically:
+ A marketplace-only install builds the plugin catalog without the repo's ecosystem catalog; that is expected. If neither builder exists, say so and continue with step 4.
+ 3. Publish with the Artifact tool and `capabilities: {"downloads": true}` (the agent manager's "save as file" button; the page hides it where the viewer cannot save files):
+ - Already published from this path in this session: publish the same `file_path`; omit `icon` and `capabilities`.
+ - Otherwise: `action: "list"`, find "Commander Cockpit", `action: "read"` its `url`, then publish `file_path` with that `url` and the `capabilities`. If none exists, publish `file_path`, the `capabilities`, `icon: "dashboard"` and `description: "Every Commander skill, agent, idea and prompt pattern, searchable and offline."`.
+ - On Codex or without the Artifact tool: give the user the HTML file path.
+ 4. Reply with the title, the URL, and one line: the page runs entirely in the browser; copy buttons put a command on the clipboard to paste here, because a published page cannot send prompts into the session.
- ```markdown
- | Type | Name | One-liner |
- |------|------|-----------|
- | 🤖 agent | architect | System design, trade-offs, tech selection |
- | 🎯 domain | ccc-design | 41 skills — UI/UX, animation, a11y |
- | 🛠️ workflow | ccc-build | Scaffold web/API/CLI/mobile from spec |
- | ... | ... | ... |
- ```
+ ### 4. Cascades: domains, workflows, agents
- After the grid, one `AskUserQuestion` with 4 follow-ups: "Launch one" / "Filter by keyword" / "Browse categories instead" / "Done".
+ Follow [references/cascades.md](references/cascades.md). In short: read names and descriptions from disk, show four per AskUserQuestion with "Next" and "Back" options, and on a pick offer to run it now.
- ## Anti-patterns — DO NOT do these
+ ### 5. Everything as a table
- - ❌ Render a single markdown list with 30+ rows and ask the user to type a name
- - ❌ Dump raw HTML in code blocks expecting artifact rendering
- - ❌ Output ASCII banners or box-drawing tables for the catalog
- - ❌ Put more than 4 options in a cascade `AskUserQuestion` — the five-option root picker is the sole exception; always include a "Back" option on cascades
- - ❌ Read every agent .md eagerly up front — read on demand only
- - ❌ Reference legacy CLI browse commands — this is Desktop-plugin only
+ One markdown table sorted by name: `| Type | Name | One-liner |`, built from the same frontmatter reads as step 4. Then ask with AskUserQuestion:
- ## Brand rules
+ - 🟢 Launch one — name it and it runs now
+ - Filter by keyword
+ - Browse by category — back to step 2
+ - Done
- - **Always read `VERSION` from plugin.json** — never hardcode.
- - **One-line descriptions only** in picker options — detail goes in the `preview` field.
- - **Back option on every cascade past level 1** — lets users un-dive without restarting.
- - **Counts always live** — read from filesystem, never hardcode "39 sub-skills" if the count can shift.
+ ### 6. Dispatch a pick
- ## Dispatch after selection
+ Read the picked skill's `SKILL.md` frontmatter (or the agent's `.md`), say in one sentence what will happen, then run it in place: invoke the skill, or delegate with the Agent tool for an agent after asking for the task. The user never has to retype a command.
- After a user picks any skill or agent, the handler:
- 1. Reads the SKILL.md (or agent .md) frontmatter
- 2. Echoes one paragraph of what's about to happen
- 3. Invokes the skill/agent inline
+ ## Done when
- Never require the user to leave `$ccc-browse` and type another slash command. We stay in-flow.
+ - Cockpit: the builder exited 0 and the Artifact tool returned a URL, which you reported.
+ - Cascade: the user's pick was dispatched, or they chose Done.
+ - Every count you showed came from the step 1 command output.
- ## Tips for the agent executing this skill
+ ## Guardrails
- 1. Parallel the three count Bash calls into one. Saves a turn.
- 2. When cascading, maintain a simple state in your responses: "Page 1 of 3 · 4 of 11 shown".
- 3. If `argument-hint` is `domains`, `workflows`, `agents`, or `all`, skip the root picker and jump to that path.
- 4. Agent descriptions are in `${CLAUDE_PLUGIN_ROOT}/agents/*.md` frontmatter — read the whole file only on user drill-in.
+ - Never publish without the step 3 consent, and never move `<scratchpad>/commander-cockpit.html`.
+ - Never dump a long list and ask the user to type a name; never put more than four options in a cascade picker.
+ - Never hardcode a version, skill count, agent count or sub-skill count.
+ - Read agent files on drill-in, not all up front.
- ---
+ ## See also
- **Bottom line:** one-click Cockpit + four top-level categories → cascaded 4-at-a-time pickers → user drills in → we dispatch to the target skill. No scrolling, no typing, no numbered lists.
+ - `$ccc-console` — live agents, cost and safety, inline
+ - `$ccc-start` — first-run onboarding
+ - `$ccc-suggest` — the next best action
---
> ⚙️ **Fable contract:** plan before build · verifier ≠ worker · prove before alarm · loops need gates · leave durable state — `rules/fable-method.md`
> (On Codex, present these options as a numbered list and ask the user to reply with a number — AskUserQuestion is Claude-only.)