Commit graph

190 commits

Author SHA1 Message Date
dan 9df3aedc2f fix: prevent Stop hook infinite loop via stop_hook_active check
When Claude continues after a Stop hook block, the next Stop hook
invocation has stop_hook_active: true. Detect this and allow exit
to break the loop and prevent stack overflow crash.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 09:34:15 -08:00
dan 020458c9b8 fix: review-gate Stop hook output format and test harness
- Change exit code to 2 (Claude Code blocking signal)
- Output JSON to stderr with decision: block and reason fields
- Add integration test harness for live Claude testing
- Update unit tests for new JSON output format
- Add hooks.json example for Stop hook

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 08:23:46 -08:00
dan 4130dd4614 test: add review-gate unit tests (43 tests)
Tests cover:
- All CLI commands (check, enable, approve, reject, status, list, clean)
- Exit codes (0 for allow, 1 for block)
- State file creation and JSON structure
- Session ID auto-detection from env vars
- Multiple issues in reject
- Workflow reset (re-enable after approve)
- Error handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 23:09:33 -08:00
dan 061556e003 bd sync: 2026-01-09 20:39:37 2026-01-09 20:39:37 -08:00
dan 91b6c842a2 feat: add review-gate skill for cross-agent quality enforcement
- CLI tool with check/enable/approve/reject/status commands
- Stop hook integration for Claude Code blocking
- Adversarial reviewer prompt template
- Dual-publish structure (SKILL.md + .claude-plugin)
- Session ID auto-detection from env vars or git state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:39:34 -08:00
dan 4d298c1e22 bd sync: 2026-01-09 19:59:51 2026-01-09 19:59:51 -08:00
dan beace9046d bd sync: 2026-01-09 19:51:10 2026-01-09 19:51:10 -08:00
dan 75c5edb86c docs: cross-agent enforcement architecture design
Comprehensive design covering:
- Abstract layers (message passing, memory, enforcement)
- Four enforcement strategies:
  - Hook-based (Claude/Gemini)
  - Orchestrator-enforced (OpenCode/Codex)
  - Validator sidecar (universal)
  - Proxy-based (API interception)
- Circuit breakers (semantic drift, three-strike, budget)
- Adversarial reviewer pattern
- State flow diagram
- Implementation phases

Based on web research via orch (gemini --websearch).

Addresses: skills-8sj

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 19:51:09 -08:00
dan 8c033eedd1 docs: add Gemini path fix (includeDirectories setting)
Gemini CLI can access ~/.claude/skills/ via:
  settings.json: { "context": { "includeDirectories": ["~/.claude/skills"] } }
  or CLI: gemini --include-directories ~/.claude/skills

Closes: skills-8nl, skills-bo8

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 19:35:28 -08:00
dan f7483edcf3 bd sync: 2026-01-09 19:33:03 2026-01-09 19:33:03 -08:00
dan 52fe241734 bd sync: 2026-01-09 19:01:55 2026-01-09 19:01:55 -08:00
dan c14075ae7e docs: web research on cross-agent patterns (via orch)
Key findings from gemini --websearch:
- Manager-Worker orchestration (Maestro pattern)
- alice/idle adversarial review gates (emes)
- Git-as-state for agent coordination
- tissue for machine-first issue tracking
- Circuit breakers: semantic drift, three-strike, budget limits
- Sandboxing: Wasm and Docker playgrounds

Validates our direction: beads, orch, file-based coordination.
Gaps: orchestrator-enforced gates, agent messaging, sandboxing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:50:37 -08:00
dan e367be6cb6 bd sync: 2026-01-09 17:32:23 2026-01-09 17:32:23 -08:00
dan ec2d856c05 docs: add agent capability matrix for cross-agent design
Comprehensive comparison of Claude Code, Gemini CLI, OpenCode, and Codex:
- Hooks/lifecycle events (Claude/Gemini best, OpenCode most comprehensive)
- Subagent spawning (MCP is universal bridge)
- File access (Gemini has path restrictions - skills-bo8)
- Sandboxing (Codex has OS-level, others approval-based)
- State persistence (need external store for cross-agent)

Key finding: Orchestrator pattern works across all agents.
Stop hooks only in Claude/Gemini - others need protocol-based gates.

Closes: skills-fqu

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 17:32:17 -08:00
dan c94def1c61 bd sync: 2026-01-09 17:14:41 2026-01-09 17:14:41 -08:00
dan a87f2f4950 bd sync: 2026-01-09 16:57:16 2026-01-09 16:57:16 -08:00
dan 4773abe56f docs: correct alice framing - adversarial agent review for automation
alice is for reviewing AGENT work in unattended/autonomous contexts,
not code review. Key use cases:
- Autonomous runs on ops-jrz1
- CI/CD pipelines with agents
- High-stakes changes without human oversight

Added hybrid approach recommendation: use alice concepts (Stop hook,
adversarial methodology) with our infrastructure (beads, orch).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 16:45:49 -08:00
dan 144bafd2b5 bd sync: 2026-01-09 16:43:51 2026-01-09 16:43:51 -08:00
dan 239c758dc7 docs: research idle/alice quality gate mechanism
Comprehensive analysis of emes idle/alice plugin:
- Hook chain (6 hooks, Stop is key blocker)
- State management via jwz (topic-based messaging)
- alice agent (read-only Opus reviewer)
- Circuit breakers against infinite loops

Conclusion: alice pattern is overkill for code-review (we ARE the
reviewer). More useful: "review reminder" hook that checks if
code-review was run before exit on significant changes.

Closes: skills-9jk

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 16:43:46 -08:00
dan 1b943742bd bd sync: 2026-01-09 16:19:14 2026-01-09 16:19:14 -08:00
dan 5a7891656a feat: convert all skills to dual-publish pattern
Add Claude plugin structure (.claude-plugin/plugin.json) and auto-discovery
(skills/<name>.md) to 15 skills. orch was already converted.

Skills converted:
- ai-tools-doctor, bd-issue-tracking, code-review, doc-review
- niri-window-capture, ops-review, playwright-visit, screenshot-latest
- spec-review, tufte-press, update-opencode, update-spec-kit
- web-research, web-search, worklog

Marketplace now lists all 16 skills for /plugin install.

Closes: skills-1ks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 16:19:09 -08:00
dan f6ec653a83 bd sync: 2026-01-09 16:06:50 2026-01-09 16:06:50 -08:00
dan a198b31add docs: clarify deployment strategy (beads local, tissue remote)
Local (skills, dotfiles): beads + our dual-publish
Remote (ops-jrz1 VPS): tissue + emes ecosystem

They coexist by environment, not replacing each other.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 16:06:45 -08:00
dan 8a76f4e9cb docs: add plugin systems comparison (ours vs claude vs emes)
Compares three approaches:
- Our system: cross-agent, Nix, lenses
- Claude plugins: official, hooks, marketplace
- emes: mechanical enforcement, tissue, idle, jwz

Living document for iterating on architecture.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 15:39:19 -08:00
dan a84066c1dd docs: add ADR-005 for dual-publish plugin architecture
Captures the decision to maintain both:
- Nix deployment (cross-agent: Gemini, OpenCode)
- Claude plugin system (hooks, marketplace)

Documents trade-offs, consequences, and mitigations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 11:44:15 -08:00
dan 3e3363e35d bd sync: 2026-01-09 11:21:36 2026-01-09 11:21:36 -08:00
dan d97c96be4c feat: add marketplace.json and update dual-publish guide
- Create .claude-plugin/marketplace.json at repo root
- Register orch as first dual-publish plugin
- Update emes-conversion-guide.md to explain dual-publish pattern
- Cross-agent support (Gemini, OpenCode) via Nix
- Claude plugin system for hooks and /plugin install UX

Part of skills-6x1 (emes plugin architecture epic)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 11:21:32 -08:00
dan 7bbf79e947 bd sync: 2026-01-09 11:03:44 2026-01-09 11:03:44 -08:00
dan f24b2bb518 feat: add emes plugin structure to orch skill
- Add .claude-plugin/plugin.json with metadata
- Copy SKILL.md to skills/orch.md for auto-discovery
- Keep original SKILL.md for Nix backward compat
- Add emes-conversion-guide.md documenting the pattern

Part of skills-6x1 (emes plugin architecture epic)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 11:03:37 -08:00
dan fe51d14889 bd sync: 2026-01-06 16:29:22 2026-01-06 16:29:22 -08:00
dan 853bf347e4 test: add deploy-skill.sh config injection tests (21 tests)
Covers:
- Basic injection (config inserted before closing brace)
- Idempotency (no duplicates on re-run)
- Multiple injections (different configs can coexist)
- File not found handling (graceful skip)
- Brace structure preservation (nested braces work)
- inject_home_file wrapper (builds correct Nix block)
- Already present detection
- Edge cases (empty props, minimal file)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 16:29:12 -08:00
dan 112d43a4c3 refactor(deploy): move functions to top of file (code-review) 2026-01-03 12:16:01 -08:00
dan f00c0e7e20 bd sync: 2026-01-03 12:13:49 2026-01-03 12:13:49 -08:00
dan e605f26cb1 refactor(specify): simplify branch generation and add main (skills-lzk) 2026-01-03 12:13:21 -08:00
dan 6200abc32f feat(scripts): add atomic file operations and safe temp files (skills-7bu) 2026-01-03 12:08:51 -08:00
dan e164285c6c feat(nix): consolidate skill list into skills.nix (skills-8v0) 2026-01-03 12:06:18 -08:00
dan c186c77fd2 refactor(deploy): dedupe injection calls in deploy-skill.sh (skills-dnm) 2026-01-03 12:02:43 -08:00
dan 1108dda5ef chore: bd doctor --fix and sync 2026-01-03 11:58:37 -08:00
dan ff1d294d59 docs: worklog for agent update tests and bug fix 2026-01-02 02:30:03 -08:00
dan bb0d1463b0 bd sync: 2026-01-01 23:12:09 2026-01-01 23:12:09 -08:00
dan 955b6905cc test: add agent file update tests and fix section ordering bug
33 tests covering:
- Basic functionality (tech/change entries)
- Missing section handling
- Timestamp updates
- Idempotency (no duplicates)
- Change entry limits (max 2 kept)
- Database entries
- Tech entry placement
- Edge cases (empty, NEEDS CLARIFICATION, EOF)
- format_technology_stack function

Bug fixed: Recent Changes section was skipped when preceded by
Active Technologies section. The ## header was caught by generic
"close tech section on any ##" logic before reaching Recent Changes
handling. Reordered conditions to check for Recent Changes first.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 23:12:01 -08:00
dan 23b374e5bf bd sync: 2026-01-01 21:53:44 2026-01-01 21:53:44 -08:00
dan c09fcb18bb test: add branch name generation tests
27 test cases covering:
- Stop word filtering (a, to, the, add, etc.)
- Acronym detection (API, UI, DB, CLI kept)
- Word count limits (3 normally, 4 when exactly 4)
- Special character handling (parens, dots, underscores)
- Unicode handling (preserved, CJK filtered)
- Edge cases (empty, whitespace, all stop words)
- Fallback logic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 21:53:43 -08:00
dan f33f7ae690 refactor: reorganize lens directory structure
Symmetric layout for review lenses:
- ~/.config/lenses/code/  <- code-review lenses
- ~/.config/lenses/ops/   <- ops-review lenses

Updated:
- modules/ai-skills.nix deployment paths
- skills/code-review/SKILL.md lens references
- skills/code-review/lenses/README.md examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 21:25:01 -08:00
dan 1e9d6cb93d docs: add first markdown-format worklog
Tests the new worklog template with YAML frontmatter.
Documents ops-review Phase 3 completion and worklog migration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 21:17:27 -08:00
dan 5ffdf0a2a5 refactor: migrate worklog skill from org-mode to markdown
- Convert template to markdown with YAML frontmatter
- Update suggest-filename.sh to output .md extension
- Update find-related-logs.sh to parse both formats (backward compat)
- Update SKILL.md references

Existing .org worklogs remain readable by find-related-logs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 21:13:21 -08:00
dan 0f6824cbda bd sync: 2026-01-01 21:02:43 2026-01-01 21:02:43 -08:00
dan fa97fca041 feat: complete ops-review skill with all 10 lenses
Phase 2 lenses (reliability):
- idempotency: safe re-run, atomic ops, convergence
- supply-chain: pinning, provenance, build-time network
- observability: health checks, logging, metrics

Phase 3 lenses (architecture):
- nix-hygiene: statix/deadnix patterns, module design
- resilience: timeouts, retries, resource limits
- orchestration: ordering, dependencies, coupling

All lenses validated via orch consensus (gemini, gpt, flash-or).
Testing delegated to target repos: dotfiles-je5, prox-setup-kqg.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 21:02:39 -08:00
dan a8ab3c1b1b Add idempotency lens, sync beads 2026-01-01 18:46:39 -08:00
dan 64c1c9350e bd sync: 2026-01-01 17:36:29 2026-01-01 17:36:29 -08:00