Phase 1: Scaffold
Plugin manifest, CLI-routed hooks, bash wrapper for SubQ detection, explicit --event flags, multi-provider repo structure. Three sub-phases shipped across 6 commits.
SHIPPED
Phase 1 / 1.5 / 1.75
Replaced bun-invoked TypeScript with CLI-routed shell commands. The plugin became a pure declaration shell—zero executable code, zero runtime dependencies.
Phase 2: Hook Ingestion
Monorepo packages for normalization, handler logic, and envelope contracts. CLI thin forwarder reads stdin, wraps in hook envelope, forwards to local RPC server.
BUILDING
packages/hooks + packages/contracts
Server delegates to packages/hooks for provider-specific normalization and handling. packages/contracts defines hook envelope types, decision types, and provider identity.
Phase 3: PreCompact & Handoff
Noise filtering for PreCompact, structured handoff extraction for Stop, and session-end observation recording. The intelligence layer that makes compaction lossless. Deferred post-launch—context-pack optimization is the current priority.
DEFERRED
Noise Filter → Handoff → Record
PreCompact returns a blocking replace decision with structured context. Stop extracts handoff from transcript. Both record observations in SQLite. Postponed to focus on context-pack optimization for launch.
packages/providers Claude parser to extract structured handoff YAML.
packages/store SQLite repository. Session-end observations enable cross-session continuity.
Phase 4: Skill Generator
Canonical SkillDefinition TypeScript objects in the SubQ CLI monorepo. A generator emits provider-specific SKILL.md files at build time.
BUILDING
Definitions & Generator
6 canonical skill definitions wired into loadAllSkills(). Generator runs as subq skills generate --provider claude|codex|gemini|all.
- id
- Unique skill identifier, e.g.
"subq-search". - title
- Human-readable name shown in skill listings.
- description
- ~100 tokens loaded at session start (progressive disclosure).
- trigger
- When the skill fires:
"User or auto"vs"User-invoked". - body
- Full instructions loaded on invocation, not at startup.
- subqCommand
- The SubQ CLI command this skill delegates to.
- providerOverrides
- Optional per-provider customization for Claude, Codex, or Gemini.
Phase 5: Integration Tests
End-to-end testing: hook envelope → server → decision → provider-native stdout. Degradation behavior. Cross-provider parity. README finalization.
PLANNED
E2E Validation
Verify the full hook lifecycle for each event and provider combination. Test degradation when the server is unreachable and when SubQ is not initialized.
Phase 6: Setup & Doctor
subq setup --claude|--codex|--gemini wires hooks, generates skills, and bootstraps guidance files. subq doctor verifies installation health across all providers.
PLANNED
Provider Adapters & Verification
Thin provider adapters handle install/verify/uninstall recipes. Core orchestrator handles detection, UX, state, and verification.
- id
"claude"|"codex"|"gemini"- detect()
- Is this provider’s CLI installed and in PATH?
- install()
- Wire up hooks + skills + guidance for this provider.
- verify()
- Are hooks firing? Skills discoverable? CLI reachable?
- uninstall()
- Remove all SubQ integration for this provider.
- generateSkills()
- Emit provider-specific SKILL.md files from canonical definitions.
Phase 7: Daemon & Desktop
macOS app for running the conversation daemon, collecting agent traces, displaying analytics, and handling skill approval notifications. Preferred over a pure Linux daemon for native notification support.
PLANNED
macOS App & Daemon
Native Mac app runs a background daemon that collects conversations and agent traces when sessions end. Displays analytics dashboard and triggers skill refresh approvals via native notifications or a local web UI.
Dependencies
Runtime requirements and branch strategy for the monorepo work.
subq CLI installed and in PATH—the only runtime requirement for end users. No bun, no node_modules.
rc/plugin-system branch in subq-code for monorepo work. Contains server infrastructure and package foundations.
apps/server)—Greg’s architecture foundation for hook handling, actions, and crons.
packages/contracts, packages/store, packages/hooks—new packages from SubQ Code Next architecture.
Verification
Nine-point checklist. Each item must pass before the plugin is considered complete.
Plugin Structure
claude plugin add subquadratic-ai/subq-utility-plugin succeeds, hooks.json discovered automatically.
Hook Invocation
Each event fires subq hooks --provider claude --event <event>, reads stdin, returns stdout JSON.
SessionStart
Codebase context injected as additionalContext in the hook response.
Stop
Handoff YAML written, RPC server terminated cleanly.
StopFailure
Rate-limit advisory displayed, additionalContext suggests SubQ as alternative.
Fallback
If RPC server is unreachable, hooks fall back to direct subq code subprocess.
Skills
Each /subq-* skill listed and invocable from the host AI’s skill menu.
No Bun
Verify hooks work with only subq in PATH. No bun, no node_modules, no runtime dependencies.
Daemon
macOS app launches daemon, collects traces on session end, surfaces analytics, and delivers skill approval notifications.