diff --git a/.claude/commands/cch-release.md b/.claude/commands/cch-release.md index e67a25ac..1d4103dc 100644 --- a/.claude/commands/cch-release.md +++ b/.claude/commands/cch-release.md @@ -1,5 +1,5 @@ --- -description: Execute CCH release workflow - prepare, execute, verify, or hotfix releases +description: Execute RuleZ release workflow - prepare, execute, verify, or hotfix releases --- ## User Input @@ -8,9 +8,9 @@ description: Execute CCH release workflow - prepare, execute, verify, or hotfix $ARGUMENTS ``` -## CCH Release Workflow +## RuleZ Release Workflow -This command orchestrates the CCH release process using the `release-cch` skill. +This command orchestrates the RuleZ release process using the `release-rulez` skill. ### Quick Reference @@ -24,11 +24,11 @@ This command orchestrates the CCH release process using the `release-cch` skill. ### Workflow -1. **Load the release-cch skill**: Read `.claude/skills/release-cch/SKILL.md` for detailed instructions. +1. **Load the release-rulez skill**: Read `.claude/skills/release-rulez/SKILL.md` for detailed instructions. 2. **Read version** from `Cargo.toml` (single source of truth): ```bash - .claude/skills/release-cch/scripts/read-version.sh + .claude/skills/release-rulez/scripts/read-version.sh ``` 3. **Parse arguments** and execute the appropriate phase: @@ -39,9 +39,9 @@ This command orchestrates the CCH release process using the `release-cch` skill. **If `$ARGUMENTS` is `prepare`**: - Verify version is updated in `Cargo.toml` - - Run preflight checks: `.claude/skills/release-cch/scripts/preflight-check.sh` + - Run preflight checks: `.claude/skills/release-rulez/scripts/preflight-check.sh` - Create release branch: `git checkout -b release/v${VERSION}` - - Generate changelog: `.claude/skills/release-cch/scripts/generate-changelog.sh` + - Generate changelog: `.claude/skills/release-rulez/scripts/generate-changelog.sh` - Commit and push release branch - Create PR with release checklist @@ -53,7 +53,7 @@ This command orchestrates the CCH release process using the `release-cch` skill. - This triggers the release workflow **If `$ARGUMENTS` is `verify`**: - - Run verification: `.claude/skills/release-cch/scripts/verify-release.sh` + - Run verification: `.claude/skills/release-rulez/scripts/verify-release.sh` - Check workflow status - Verify release assets @@ -103,17 +103,17 @@ The release PR must pass all checks: After tagging, the workflow builds and uploads: -- `cch-linux-x86_64.tar.gz` -- `cch-linux-aarch64.tar.gz` -- `cch-macos-x86_64.tar.gz` -- `cch-macos-aarch64.tar.gz` -- `cch-windows-x86_64.exe.zip` +- `rulez-linux-x86_64.tar.gz` +- `rulez-linux-aarch64.tar.gz` +- `rulez-macos-x86_64.tar.gz` +- `rulez-macos-aarch64.tar.gz` +- `rulez-windows-x86_64.exe.zip` - `checksums.txt` ### Troubleshooting If something goes wrong, see: -- `.claude/skills/release-cch/references/troubleshooting.md` +- `.claude/skills/release-rulez/references/troubleshooting.md` - Or run `/cch-release verify` to diagnose ### Examples diff --git a/.claude/settings.local.json b/.claude/settings.local.json index b15e48fb..b07ac386 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -13,7 +13,7 @@ "Bash(for:*)", "Bash(do gh issue close $i -c \"Completed in PR #72 - RuleZ UI Milestone 1 scaffold implemented\")", "Bash(gh pr checks:*)", - "Bash(.claude/skills/release-cch/scripts/read-version.sh:*)", + "Bash(.claude/skills/release-rulez/scripts/read-version.sh:*)", "Bash(cch --version:*)", "Bash(cch --help:*)", "Bash(cch init --help:*)", @@ -61,9 +61,9 @@ "Bash(cargo build:*)", "Bash(./cch_cli/target/release/cch:*)", "Bash(./target/release/cch:*)", - "Bash(.claude/skills/release-cch/scripts/preflight-check.sh:*)", + "Bash(.claude/skills/release-rulez/scripts/preflight-check.sh:*)", "Bash(gh run list:*)", - "Bash(.claude/skills/release-cch/scripts/verify-release.sh)", + "Bash(.claude/skills/release-rulez/scripts/verify-release.sh)", "Bash(bunx playwright install:*)", "Bash(task ui:e2e)", "Bash(task:*)", @@ -72,7 +72,68 @@ "Bash(xargs kill -9)", "Bash(cargo test:*)", "Skill(gsd:plan-phase)", - "WebSearch" + "WebSearch", + "Bash(git reset:*)", + "Bash(gh secret set:*)", + "Bash(gh secret:*)", + "Bash(./e2e/run.sh:*)", + "Bash(bash --version)", + "Bash(/opt/homebrew/bin/bash:*)", + "Bash(/usr/local/bin/bash:*)", + "Bash(gh pr merge:*)", + "mcp__perplexity-ask__perplexity_ask", + "Bash(node:*)", + "Bash(cat:*)", + "Bash(head:*)", + "Bash(opencode auth:*)", + "Bash(# Test:*)", + "WebFetch(domain:opencode.ai)", + "Bash(# Try:*)", + "WebFetch(domain:gist.github.com)", + "Bash(grep:*)", + "Bash(rm:*)", + "Bash(# Let:*)", + "Bash(# Key:*)", + "Bash(echo:*)", + "WebFetch(domain:opencode.dev)", + "mcp__github__get_issue", + "Bash(echo opencode not found:*)", + "Bash(opencode run:*)", + "WebFetch(domain:raw.githubusercontent.com)", + "Bash(curl -s https://opencode.ai/config.json 2>/dev/null | python3 -m json.tool 2>/dev/null | grep -A 50 '\"hooks\"' | head -80 || echo \"no hooks in schema\")", + "Bash(echo no hooks found:*)", + "Bash(curl -s https://opencode.ai/config.json 2>/dev/null | python3 -c \"\nimport json, sys\nschema = json.load\\(sys.stdin\\)\nprops = schema.get\\('properties', {}\\)\nprint\\('Top-level properties:', list\\(props.keys\\(\\)\\)\\)\n\" 2>/dev/null)", + "Bash(curl -s https://opencode.ai/config.json 2>/dev/null | python3 -c \"\nimport json, sys\nschema = json.load\\(sys.stdin\\)\n# Print experimental section\nexp = schema.get\\('properties', {}\\).get\\('experimental', {}\\)\nprint\\('experimental section:'\\)\nprint\\(json.dumps\\(exp, indent=2\\)[:2000]\\)\n\" 2>/dev/null)", + "WebFetch(domain:deepwiki.com)", + "Skill(gsd:add-phase)", + "mcp__github__get_pull_request_status", + "Bash(git fetch origin main && git merge origin/main --ff-only 2>&1 || git rebase origin/main 2>&1)", + "Bash(git stash && git rebase origin/main 2>&1)", + "Bash(gh release:*)", + "Bash(tail:*)", + "Bash(git tag -d v2.0.0 && git push origin :refs/tags/v2.0.0 2>&1)", + "Bash(gh run:*)", + "Bash(gh issue:*)", + "Bash(chmod +x:*)", + "Bash(cargo fmt:*)", + "Bash(bash:*)", + "Bash(opencode debug:*)", + "Bash(./target/release/rulez opencode:*)", + "Bash(echo Could not fetch schema:*)", + "mcp__github__create_pull_request", + "Bash(gh pr:*)", + "mcp__github__merge_pull_request", + "Skill(gsd:health)", + "Bash(git status:*)", + "Bash(node -e \"console.log\\(require.resolve\\(''gsd-tools.cjs''\\)\\)\")", + "Read(//Users/richardhightower/clients/spillwave/src/rulez_plugin/$HOME/.claude/**)", + "Read(//Users/richardhightower/clients/spillwave/src/rulez_plugin/$HOME/.claude/get-shit-done*/**)", + "Bash(./target/debug/rulez:*)", + "Bash(cargo clippy:*)", + "Bash(cargo llvm-cov:*)", + "Bash(git tag:*)", + "Bash(cargo check:*)", + "Bash(.claude/skills/release-rulez/scripts/generate-changelog.sh:*)" ] }, "sandbox": { diff --git a/.claude/skills/release-cch/references/hotfix-workflow.md b/.claude/skills/release-cch/references/hotfix-workflow.md deleted file mode 100644 index 07ad5416..00000000 --- a/.claude/skills/release-cch/references/hotfix-workflow.md +++ /dev/null @@ -1,120 +0,0 @@ -# CCH Hotfix Workflow - -## When to Use - -Use a hotfix workflow when: - -- Critical bug found in production release -- Security vulnerability discovered -- Urgent patch needed without including unreleased features - -## Hotfix vs Regular Release - -| Aspect | Regular Release | Hotfix | -|--------|----------------|--------| -| Branch from | `main` | Existing tag (e.g., `v1.0.0`) | -| Branch name | `release/vX.Y.Z` | `hotfix/vX.Y.Z` | -| Version bump | Any (major/minor/patch) | Patch only | -| Scope | Full feature set | Minimal fix | - -## Hotfix Diagram - -``` - main branch - │ - v1.0.0 ──────────────┼──────────────────────── v1.1.0 (future) - │ │ - │ │ - ▼ │ - ┌─────────┐ │ - │ Hotfix │ │ - │ Branch │ │ - └────┬────┘ │ - │ │ - ▼ │ - hotfix/v1.0.1 │ - │ │ - ├── Fix bug │ - ├── Update version│ - ├── Update changelog - │ │ - ▼ │ - Create PR ────────────┤ - │ │ - ▼ │ - Merge to main ────────┤ - │ │ - ▼ │ - git tag v1.0.1 │ - │ │ - ▼ │ - Release workflow │ - │ │ - ▼ │ - v1.0.1 released │ -``` - -## Step-by-Step - -### 1. Create Hotfix Branch from Tag - -```bash -git fetch --tags -git checkout v1.0.0 -git checkout -b hotfix/v1.0.1 -``` - -### 2. Apply the Fix - -```bash -cd cch_cli -cargo fmt -cargo clippy --all-targets --all-features -- -D warnings -cargo test -``` - -### 3. Update Version - -```toml -[workspace.package] -version = "1.0.1" -``` - -### 4. Update Changelog - -```markdown -## [1.0.1] - YYYY-MM-DD - -### Fixed - -- Description of the hotfix -``` - -### 5. Commit and Push - -```bash -git add -A -git commit -m "fix: " -git push -u origin hotfix/v1.0.1 -``` - -### 6. Create PR and Merge - -```bash -gh pr create --title "fix: hotfix v1.0.1" --body "..." -gh pr merge --merge --delete-branch -``` - -### 7. Tag and Release - -```bash -git checkout main && git pull -git tag v1.0.1 -git push origin v1.0.1 -``` - -### 8. Verify - -```bash -.claude/skills/release-cch/scripts/verify-release.sh 1.0.1 -``` diff --git a/.claude/skills/release-cch/references/release-workflow.md b/.claude/skills/release-cch/references/release-workflow.md deleted file mode 100644 index e1816923..00000000 --- a/.claude/skills/release-cch/references/release-workflow.md +++ /dev/null @@ -1,132 +0,0 @@ -# CCH Release Workflow - -## Overview Diagram - -``` -┌─────────────────────────────────────────────────────────────────────┐ -│ PHASE 1: PREPARE │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ 1. Update version in Cargo.toml (manual) │ -│ │ │ -│ ▼ │ -│ 2. git checkout -b release/vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 3. Run preflight-check.sh ─────────────────────┐ │ -│ │ │ │ -│ ▼ ▼ │ -│ [All pass?] ──No──► Fix issues, retry │ -│ │ │ -│ Yes │ -│ │ │ -│ ▼ │ -│ 4. Generate/edit CHANGELOG.md │ -│ │ │ -│ ▼ │ -│ 5. git commit -m "chore: prepare vX.Y.Z release" │ -│ │ │ -│ ▼ │ -│ 6. git push -u origin release/vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 7. gh pr create │ -│ │ │ -│ ▼ │ -│ 8. Wait for CI (15 checks) ────────────────────┐ │ -│ │ │ │ -│ ▼ ▼ │ -│ [All green?] ──No──► Fix issues, push again │ -│ │ │ -│ Yes │ -│ │ │ -└──────────────────────────┼──────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────────────┐ -│ PHASE 2: EXECUTE │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ 1. gh pr merge --merge --delete-branch │ -│ │ │ -│ ▼ │ -│ 2. git checkout main && git pull │ -│ │ │ -│ ▼ │ -│ 3. git tag vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 4. git push origin vX.Y.Z ───────────► TRIGGERS RELEASE WORKFLOW │ -│ │ │ -└──────────────────────────┼──────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────────────┐ -│ PHASE 3: VERIFY │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ 1. gh run list / gh run view │ -│ │ │ -│ ▼ │ -│ 2. Wait for 5 build jobs + 1 release job │ -│ │ │ -│ ┌─────────────────┼─────────────────┐ │ -│ │ │ │ │ -│ ▼ ▼ ▼ │ -│ Linux x86_64 macOS x86_64 Windows x86_64 │ -│ Linux aarch64 macOS aarch64 │ -│ │ │ │ │ -│ └─────────────────┼─────────────────┘ │ -│ │ │ -│ ▼ │ -│ 3. Create Release job (uploads artifacts) │ -│ │ │ -│ ▼ │ -│ 4. gh release view vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 5. Verify 6 assets uploaded │ -│ - cch-linux-x86_64.tar.gz │ -│ - cch-linux-aarch64.tar.gz │ -│ - cch-macos-x86_64.tar.gz │ -│ - cch-macos-aarch64.tar.gz │ -│ - cch-windows-x86_64.exe.zip │ -│ - checksums.txt │ -│ │ -└─────────────────────────────────────────────────────────────────────┘ -``` - -## CI Checks Detail (15 total) - -| # | Check | Description | Time | -|---|-------|-------------|------| -| 1 | Format | `cargo fmt --check` | ~15s | -| 2 | Clippy | `cargo clippy -- -D warnings` | ~25s | -| 3 | Unit Tests | Core unit tests | ~30s | -| 4 | Code Coverage | Coverage report generation | ~55s | -| 5-10 | Integration Tests | One per user story (6 jobs) | ~30s each | -| 11-15 | Build Release | Cross-platform builds (5 jobs) | ~1-2m each | -| 16 | CI Success | Meta-check (all above pass) | ~5s | - -## Release Workflow Jobs - -The `.github/workflows/release.yml` runs: - -### Build Matrix (5 parallel jobs) - -| OS | Target | Output | -|----|--------|--------| -| ubuntu-latest | x86_64-unknown-linux-gnu | cch-linux-x86_64.tar.gz | -| ubuntu-latest | aarch64-unknown-linux-gnu | cch-linux-aarch64.tar.gz | -| macos-latest | x86_64-apple-darwin | cch-macos-x86_64.tar.gz | -| macos-latest | aarch64-apple-darwin | cch-macos-aarch64.tar.gz | -| windows-latest | x86_64-pc-windows-msvc | cch-windows-x86_64.exe.zip | - -### Create Release Job - -After all builds complete: - -1. Download all artifacts -2. Generate checksums: `sha256sum *.tar.gz *.zip > checksums.txt` -3. Create GitHub release with `softprops/action-gh-release` -4. Upload all assets diff --git a/.claude/skills/release-cch/README.md b/.claude/skills/release-rulez/README.md similarity index 73% rename from .claude/skills/release-cch/README.md rename to .claude/skills/release-rulez/README.md index d512e77e..1e1e9f32 100644 --- a/.claude/skills/release-cch/README.md +++ b/.claude/skills/release-rulez/README.md @@ -1,10 +1,10 @@ -# release-cch Skill +# release-rulez Skill -CCH release workflow automation for Claude Code. +RuleZ release workflow automation for Claude Code. ## Overview -This skill provides automated release workflows for the Claude Context Hooks (CCH) project, including: +This skill provides automated release workflows for the RuleZ project, including: - **Prepare Release**: Create branch, run checks, generate changelog, create PR - **Execute Release**: Merge PR, tag, push to trigger CI/CD @@ -13,20 +13,20 @@ This skill provides automated release workflows for the Claude Context Hooks (CC ## Usage -Invoke via the `/cch-release` command: +Invoke via the `/rulez-release` command: ```bash -/cch-release # Interactive mode -/cch-release prepare # Prepare a new release -/cch-release execute # Execute after PR merge -/cch-release verify # Verify release status -/cch-release hotfix v1.0.0 # Create hotfix +/rulez-release # Interactive mode +/rulez-release prepare # Prepare a new release +/rulez-release execute # Execute after PR merge +/rulez-release verify # Verify release status +/rulez-release hotfix v1.0.0 # Create hotfix ``` ## Structure ``` -.claude/skills/release-cch/ +.claude/skills/release-rulez/ ├── SKILL.md # Main skill documentation ├── README.md # This file ├── scripts/ @@ -63,8 +63,8 @@ All scripts are executable and can be run from the repo root: ## Migrated From -This skill was migrated from `.opencode/skill/release-cch/` to Claude Code format. +This skill was migrated from `.opencode/skill/release-rulez/` to Claude Code format. Key changes: - Path depth adjusted for `.claude/skills/` (5 levels vs 4) -- All path references updated to `.claude/skills/release-cch/` +- All path references updated to `.claude/skills/release-rulez/` diff --git a/.claude/skills/release-cch/SKILL.md b/.claude/skills/release-rulez/SKILL.md similarity index 56% rename from .claude/skills/release-cch/SKILL.md rename to .claude/skills/release-rulez/SKILL.md index b5d2fb69..e3496042 100644 --- a/.claude/skills/release-cch/SKILL.md +++ b/.claude/skills/release-rulez/SKILL.md @@ -1,13 +1,13 @@ --- -name: release-cch -description: CCH release workflow automation. Use when asked to "release CCH", "create a release", "prepare release", "tag version", "hotfix release", or "publish CCH". Covers version management from Cargo.toml, changelog generation from conventional commits, PR creation, tagging, hotfix workflows, and GitHub Actions release monitoring. +name: release-rulez +description: RuleZ release workflow automation. Use when asked to "release RuleZ", "create a release", "prepare release", "tag version", "hotfix release", or "publish RuleZ". Covers version management from Cargo.toml, changelog generation from conventional commits, PR creation, tagging, hotfix workflows, and GitHub Actions release monitoring. metadata: version: "1.0.0" - project: "cch" + project: "rulez" source_of_truth: "Cargo.toml" --- -# release-cch +# release-rulez ## Contents @@ -35,11 +35,11 @@ version = "1.0.0" | Platform | Target | Asset | |----------|--------|-------| -| Linux x86_64 | x86_64-unknown-linux-gnu | cch-linux-x86_64.tar.gz | -| Linux ARM64 | aarch64-unknown-linux-gnu | cch-linux-aarch64.tar.gz | -| macOS Intel | x86_64-apple-darwin | cch-macos-x86_64.tar.gz | -| macOS Apple Silicon | aarch64-apple-darwin | cch-macos-aarch64.tar.gz | -| Windows | x86_64-pc-windows-msvc | cch-windows-x86_64.exe.zip | +| Linux x86_64 | x86_64-unknown-linux-gnu | rulez-linux-x86_64.tar.gz | +| Linux ARM64 | aarch64-unknown-linux-gnu | rulez-linux-aarch64.tar.gz | +| macOS Intel | x86_64-apple-darwin | rulez-macos-x86_64.tar.gz | +| macOS Apple Silicon | aarch64-apple-darwin | rulez-macos-aarch64.tar.gz | +| Windows | x86_64-pc-windows-msvc | rulez-windows-x86_64.exe.zip | **Repository**: `SpillwaveSolutions/code_agent_context_hooks` @@ -67,7 +67,7 @@ What do you need? ```bash # Run from repo root -.claude/skills/release-cch/scripts/read-version.sh +.claude/skills/release-rulez/scripts/read-version.sh # Output: 1.0.0 ``` @@ -89,14 +89,14 @@ version = "1.1.0" # <- Update this ### 1.3 Create Release Branch ```bash -VERSION=$(.claude/skills/release-cch/scripts/read-version.sh) +VERSION=$(.claude/skills/release-rulez/scripts/read-version.sh) git checkout -b release/v${VERSION} ``` ### 1.4 Run Pre-flight Checks ```bash -.claude/skills/release-cch/scripts/preflight-check.sh +.claude/skills/release-rulez/scripts/preflight-check.sh ``` This validates: @@ -112,14 +112,14 @@ This validates: ### 1.5 Generate Changelog ```bash -VERSION=$(.claude/skills/release-cch/scripts/read-version.sh) -.claude/skills/release-cch/scripts/generate-changelog.sh ${VERSION} +VERSION=$(.claude/skills/release-rulez/scripts/read-version.sh) +.claude/skills/release-rulez/scripts/generate-changelog.sh ${VERSION} ``` ### 1.6 Commit and Push ```bash -VERSION=$(.claude/skills/release-cch/scripts/read-version.sh) +VERSION=$(.claude/skills/release-rulez/scripts/read-version.sh) git add CHANGELOG.md Cargo.toml git commit -m "chore: prepare v${VERSION} release" git push -u origin release/v${VERSION} @@ -128,24 +128,36 @@ git push -u origin release/v${VERSION} ### 1.7 Create Release PR ```bash -VERSION=$(.claude/skills/release-cch/scripts/read-version.sh) +VERSION=$(.claude/skills/release-rulez/scripts/read-version.sh) gh pr create --title "chore: prepare v${VERSION} release" --body "..." ``` -### 1.8 Wait for CI +### 1.8 Monitor CI and Auto-Merge -```bash -gh pr checks --watch +Use `/loop` to poll PR checks every 5 minutes. When all checks pass, automatically merge and continue to Phase 2 (tag and push). + +``` +/loop 5m check PR # status: run `gh pr checks `. If all checks pass, merge with `gh pr merge --squash --delete-branch`, then sync main (`git checkout main && git pull`), tag (`git tag v && git push origin v`), and verify the release workflow started. If checks are still pending, report status and wait. If any check failed, report the failure details and stop. ``` +**What the loop does each cycle:** +1. Runs `gh pr checks ` to get current status +2. If all checks pass -> auto-merges the PR, syncs main, creates and pushes the tag, verifies the release workflow triggered, then cancels the loop +3. If checks are pending -> reports progress (N/M passing) and waits for next cycle +4. If any check failed -> reports the failure, cancels the loop, and alerts the user + +**Important:** The loop handles the full Phase 1.8 -> Phase 2 transition automatically. Once the tag is pushed, proceed to Phase 3 (verify) manually or set up another loop. + --- ## Phase 2: Execute Release +> **Note:** If you used the `/loop` auto-merge in Phase 1.8, Phase 2 is already done. Skip to Phase 3. + ### 2.1 Merge the Release PR ```bash -gh pr merge --merge --delete-branch +gh pr merge --squash --delete-branch ``` ### 2.2 Sync Local Main @@ -158,7 +170,7 @@ git pull ### 2.3 Create and Push Tag ```bash -VERSION=$(.claude/skills/release-cch/scripts/read-version.sh) +VERSION=$(.claude/skills/release-rulez/scripts/read-version.sh) git tag v${VERSION} git push origin v${VERSION} ``` @@ -170,13 +182,13 @@ git push origin v${VERSION} ### 3.1 Monitor Workflow ```bash -.claude/skills/release-cch/scripts/verify-release.sh +.claude/skills/release-rulez/scripts/verify-release.sh ``` ### 3.2 Verify Release Assets ```bash -VERSION=$(.claude/skills/release-cch/scripts/read-version.sh) +VERSION=$(.claude/skills/release-rulez/scripts/read-version.sh) gh release view v${VERSION} ``` @@ -197,7 +209,7 @@ See [hotfix-workflow.md](references/hotfix-workflow.md) for detailed steps. | `preflight-check.sh` | Run all pre-release checks | `./scripts/preflight-check.sh [--json]` | | `verify-release.sh` | Monitor release workflow status | `./scripts/verify-release.sh [version]` | -All scripts are located in `.claude/skills/release-cch/scripts/`. +All scripts are located in `.claude/skills/release-rulez/scripts/`. --- diff --git a/.claude/skills/release-rulez/references/hotfix-workflow.md b/.claude/skills/release-rulez/references/hotfix-workflow.md new file mode 100644 index 00000000..b083a091 --- /dev/null +++ b/.claude/skills/release-rulez/references/hotfix-workflow.md @@ -0,0 +1,119 @@ +# RuleZ Hotfix Workflow + +## When to Use + +Use a hotfix workflow when: + +- Critical bug found in production release +- Security vulnerability discovered +- Urgent patch needed without including unreleased features + +## Hotfix vs Regular Release + +| Aspect | Regular Release | Hotfix | +|--------|----------------|--------| +| Branch from | `main` | Existing tag (e.g., `v1.0.0`) | +| Branch name | `release/vX.Y.Z` | `hotfix/vX.Y.Z` | +| Version bump | Any (major/minor/patch) | Patch only | +| Scope | Full feature set | Minimal fix | + +## Hotfix Diagram + +``` + main branch + | + v1.0.0 --------------+-------------------------- v1.1.0 (future) + | | + | | + v | + +---------+ | + | Hotfix | | + | Branch | | + +----+----+ | + | | + v | + hotfix/v1.0.1 | + | | + +-- Fix bug | + +-- Update version| + +-- Update changelog + | | + v | + Create PR ------------+ + | | + v | + Merge to main --------+ + | | + v | + git tag v1.0.1 | + | | + v | + Release workflow | + | | + v | + v1.0.1 released | +``` + +## Step-by-Step + +### 1. Create Hotfix Branch from Tag + +```bash +git fetch --tags +git checkout v1.0.0 +git checkout -b hotfix/v1.0.1 +``` + +### 2. Apply the Fix + +```bash +cargo fmt --all +cargo clippy --all-targets --all-features --workspace -- -D warnings +cargo test --tests --all-features --workspace +``` + +### 3. Update Version + +```toml +[workspace.package] +version = "1.0.1" +``` + +### 4. Update Changelog + +```markdown +## [1.0.1] - YYYY-MM-DD + +### Fixed + +- Description of the hotfix +``` + +### 5. Commit and Push + +```bash +git add -A +git commit -m "fix: " +git push -u origin hotfix/v1.0.1 +``` + +### 6. Create PR and Merge + +```bash +gh pr create --title "fix: hotfix v1.0.1" --body "..." +gh pr merge --merge --delete-branch +``` + +### 7. Tag and Release + +```bash +git checkout main && git pull +git tag v1.0.1 +git push origin v1.0.1 +``` + +### 8. Verify + +```bash +.claude/skills/release-rulez/scripts/verify-release.sh 1.0.1 +``` diff --git a/.claude/skills/release-rulez/references/release-workflow.md b/.claude/skills/release-rulez/references/release-workflow.md new file mode 100644 index 00000000..99bc8d1d --- /dev/null +++ b/.claude/skills/release-rulez/references/release-workflow.md @@ -0,0 +1,132 @@ +# RuleZ Release Workflow + +## Overview Diagram + +``` ++---------------------------------------------------------------------+ +| PHASE 1: PREPARE | ++---------------------------------------------------------------------+ +| | +| 1. Update version in Cargo.toml (manual) | +| | | +| v | +| 2. git checkout -b release/vX.Y.Z | +| | | +| v | +| 3. Run preflight-check.sh ---------------------+ | +| | | | +| v v | +| [All pass?] --No--> Fix issues, retry | +| | | +| Yes | +| | | +| v | +| 4. Generate/edit CHANGELOG.md | +| | | +| v | +| 5. git commit -m "chore: prepare vX.Y.Z release" | +| | | +| v | +| 6. git push -u origin release/vX.Y.Z | +| | | +| v | +| 7. gh pr create | +| | | +| v | +| 8. Wait for CI (15 checks) ----------------------+ | +| | | | +| v v | +| [All green?] --No--> Fix issues, push again | +| | | +| Yes | +| | | ++---------------------------------------------------------------------+ + | + v ++---------------------------------------------------------------------+ +| PHASE 2: EXECUTE | ++---------------------------------------------------------------------+ +| | +| 1. gh pr merge --merge --delete-branch | +| | | +| v | +| 2. git checkout main && git pull | +| | | +| v | +| 3. git tag vX.Y.Z | +| | | +| v | +| 4. git push origin vX.Y.Z -----------> TRIGGERS RELEASE WORKFLOW | +| | | ++---------------------------------------------------------------------+ + | + v ++---------------------------------------------------------------------+ +| PHASE 3: VERIFY | ++---------------------------------------------------------------------+ +| | +| 1. gh run list / gh run view | +| | | +| v | +| 2. Wait for 5 build jobs + 1 release job | +| | | +| +-----------------+-----------------+ | +| | | | | +| v v v | +| Linux x86_64 macOS x86_64 Windows x86_64 | +| Linux aarch64 macOS aarch64 | +| | | | | +| +-----------------+-----------------+ | +| | | +| v | +| 3. Create Release job (uploads artifacts) | +| | | +| v | +| 4. gh release view vX.Y.Z | +| | | +| v | +| 5. Verify 6 assets uploaded | +| - rulez-linux-x86_64.tar.gz | +| - rulez-linux-aarch64.tar.gz | +| - rulez-macos-x86_64.tar.gz | +| - rulez-macos-aarch64.tar.gz | +| - rulez-windows-x86_64.exe.zip | +| - checksums.txt | +| | ++---------------------------------------------------------------------+ +``` + +## CI Checks Detail (15 total) + +| # | Check | Description | Time | +|---|-------|-------------|------| +| 1 | Format | `cargo fmt --check` | ~15s | +| 2 | Clippy | `cargo clippy -- -D warnings` | ~25s | +| 3 | Unit Tests | Core unit tests | ~30s | +| 4 | Code Coverage | Coverage report generation | ~55s | +| 5-10 | Integration Tests | One per user story (6 jobs) | ~30s each | +| 11-15 | Build Release | Cross-platform builds (5 jobs) | ~1-2m each | +| 16 | CI Success | Meta-check (all above pass) | ~5s | + +## Release Workflow Jobs + +The `.github/workflows/release.yml` runs: + +### Build Matrix (5 parallel jobs) + +| OS | Target | Output | +|----|--------|--------| +| ubuntu-latest | x86_64-unknown-linux-gnu | rulez-linux-x86_64.tar.gz | +| ubuntu-latest | aarch64-unknown-linux-gnu | rulez-linux-aarch64.tar.gz | +| macos-latest | x86_64-apple-darwin | rulez-macos-x86_64.tar.gz | +| macos-latest | aarch64-apple-darwin | rulez-macos-aarch64.tar.gz | +| windows-latest | x86_64-pc-windows-msvc | rulez-windows-x86_64.exe.zip | + +### Create Release Job + +After all builds complete: + +1. Download all artifacts +2. Generate checksums: `sha256sum *.tar.gz *.zip > checksums.txt` +3. Create GitHub release with `softprops/action-gh-release` +4. Upload all assets diff --git a/.claude/skills/release-cch/references/troubleshooting.md b/.claude/skills/release-rulez/references/troubleshooting.md similarity index 81% rename from .claude/skills/release-cch/references/troubleshooting.md rename to .claude/skills/release-rulez/references/troubleshooting.md index 7f1ea1a5..6683d15b 100644 --- a/.claude/skills/release-cch/references/troubleshooting.md +++ b/.claude/skills/release-rulez/references/troubleshooting.md @@ -6,9 +6,9 @@ | Issue | Cause | Solution | |-------|-------|----------| -| "cargo fmt failed" | Code not formatted | `cd cch_cli && cargo fmt` | -| "clippy warnings" | Lint issues | `cd cch_cli && cargo clippy --fix` | -| "tests failed" | Broken tests | `cd cch_cli && cargo test` to reproduce | +| "cargo fmt failed" | Code not formatted | `cargo fmt --all` | +| "clippy warnings" | Lint issues | `cargo clippy --all-targets --all-features --workspace -- -D warnings` | +| "tests failed" | Broken tests | `cargo test --tests --all-features --workspace` to reproduce | | "not on correct branch" | Wrong branch | `git checkout main` or create release branch | | "uncommitted changes" | Dirty working dir | Commit or stash changes | @@ -25,21 +25,21 @@ **Format failure**: ```bash - cd cch_cli && cargo fmt + cargo fmt --all git add -A && git commit -m "style: fix formatting" git push ``` **Clippy failure**: ```bash - cd cch_cli && cargo clippy --all-targets --all-features -- -D warnings + cargo clippy --all-targets --all-features --workspace -- -D warnings git add -A && git commit -m "fix: address clippy warnings" git push ``` **Test failure**: ```bash - cd cch_cli && cargo test + cargo test --tests --all-features --workspace git add -A && git commit -m "fix: repair broken test" git push ``` diff --git a/.claude/skills/release-cch/scripts/generate-changelog.sh b/.claude/skills/release-rulez/scripts/generate-changelog.sh similarity index 99% rename from .claude/skills/release-cch/scripts/generate-changelog.sh rename to .claude/skills/release-rulez/scripts/generate-changelog.sh index 647febe0..8f696c08 100755 --- a/.claude/skills/release-cch/scripts/generate-changelog.sh +++ b/.claude/skills/release-rulez/scripts/generate-changelog.sh @@ -50,7 +50,7 @@ OTHER="" # Parse commits while IFS= read -r commit; do [ -z "$commit" ] && continue - + case "$commit" in feat!:*) msg="${commit#feat!: }" diff --git a/.claude/skills/release-cch/scripts/preflight-check.sh b/.claude/skills/release-rulez/scripts/preflight-check.sh similarity index 87% rename from .claude/skills/release-cch/scripts/preflight-check.sh rename to .claude/skills/release-rulez/scripts/preflight-check.sh index d72185d9..53c77282 100755 --- a/.claude/skills/release-cch/scripts/preflight-check.sh +++ b/.claude/skills/release-rulez/scripts/preflight-check.sh @@ -1,7 +1,7 @@ #!/bin/bash # # preflight-check.sh -# Pre-release verification checks for CCH +# Pre-release verification checks for RuleZ # # Usage: ./preflight-check.sh [--json] # @@ -9,7 +9,7 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# Path: .claude/skills/release-cch/scripts/ -> need to go up 4 levels +# Path: .claude/skills/release-rulez/scripts/ -> need to go up 4 levels REPO_ROOT="$(cd "$SCRIPT_DIR/../../../.." && pwd)" JSON_OUTPUT=false @@ -55,7 +55,7 @@ check_info() { # Header $JSON_OUTPUT || echo "" -$JSON_OUTPUT || echo -e "${BLUE}CCH Release Pre-flight Checks${NC}" +$JSON_OUTPUT || echo -e "${BLUE}RuleZ Release Pre-flight Checks${NC}" $JSON_OUTPUT || echo "==============================" $JSON_OUTPUT || echo "" @@ -83,36 +83,34 @@ fi # Check 3: Format check check_info "Running cargo fmt --check..." -cd "$REPO_ROOT/cch_cli" -if cargo fmt --check > /dev/null 2>&1; then +if cargo fmt --all --check > /dev/null 2>&1; then check_pass "cargo fmt --check passes" else - check_fail "cargo fmt --check failed - run 'cd cch_cli && cargo fmt'" + check_fail "cargo fmt --check failed - run 'cargo fmt --all'" fi # Check 4: Clippy check_info "Running cargo clippy..." -if cargo clippy --all-targets --all-features -- -D warnings > /dev/null 2>&1; then +if cargo clippy --all-targets --all-features --workspace -- -D warnings > /dev/null 2>&1; then check_pass "cargo clippy passes (no warnings)" else check_fail "cargo clippy has warnings/errors" - $JSON_OUTPUT || echo " Run: cd cch_cli && cargo clippy --all-targets --all-features -- -D warnings" + $JSON_OUTPUT || echo " Run: cargo clippy --all-targets --all-features --workspace -- -D warnings" fi # Check 5: Unit Tests check_info "Running cargo test..." -TEST_OUTPUT=$(cargo test 2>&1) +TEST_OUTPUT=$(cargo test --tests --all-features --workspace 2>&1) if echo "$TEST_OUTPUT" | grep -q "test result: ok"; then TEST_SUMMARY=$(echo "$TEST_OUTPUT" | grep "test result:" | head -1) check_pass "All unit tests pass: $TEST_SUMMARY" else check_fail "Unit tests failed" - $JSON_OUTPUT || echo " Run: cd cch_cli && cargo test" + $JSON_OUTPUT || echo " Run: cargo test --tests --all-features --workspace" fi # Check 5b: Integration Tests check_info "Running integration tests..." -cd "$REPO_ROOT" if [ -x "$REPO_ROOT/test/integration/run-all.sh" ]; then if command -v claude &> /dev/null; then INTEGRATION_OUTPUT=$("$REPO_ROOT/test/integration/run-all.sh" 2>&1) || true @@ -131,11 +129,9 @@ if [ -x "$REPO_ROOT/test/integration/run-all.sh" ]; then else check_fail "Integration test runner not found" fi -cd "$REPO_ROOT/cch_cli" # Check 6: Version in Cargo.toml check_info "Checking version..." -cd "$REPO_ROOT" VERSION=$("$SCRIPT_DIR/read-version.sh" 2>/dev/null || echo "") if [ -n "$VERSION" ]; then check_pass "Version: $VERSION" diff --git a/.claude/skills/release-cch/scripts/read-version.sh b/.claude/skills/release-rulez/scripts/read-version.sh similarity index 91% rename from .claude/skills/release-cch/scripts/read-version.sh rename to .claude/skills/release-rulez/scripts/read-version.sh index 406a9765..480b6e60 100755 --- a/.claude/skills/release-cch/scripts/read-version.sh +++ b/.claude/skills/release-rulez/scripts/read-version.sh @@ -11,7 +11,7 @@ set -e # Find repo root (where Cargo.toml with [workspace] lives) -# Path: .claude/skills/release-cch/scripts/ -> need to go up 4 levels +# Path: .claude/skills/release-rulez/scripts/ -> need to go up 4 levels SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/../../../.." && pwd)" diff --git a/.claude/skills/release-cch/scripts/verify-release.sh b/.claude/skills/release-rulez/scripts/verify-release.sh similarity index 92% rename from .claude/skills/release-cch/scripts/verify-release.sh rename to .claude/skills/release-rulez/scripts/verify-release.sh index b474c049..d6c21475 100755 --- a/.claude/skills/release-cch/scripts/verify-release.sh +++ b/.claude/skills/release-rulez/scripts/verify-release.sh @@ -25,7 +25,7 @@ BLUE='\033[0;34m' NC='\033[0m' echo "" -echo -e "${BLUE}CCH Release Verification: v${VERSION}${NC}" +echo -e "${BLUE}RuleZ Release Verification: v${VERSION}${NC}" echo "======================================" echo "" @@ -74,11 +74,11 @@ if [ -n "$ASSETS" ]; then done EXPECTED_ASSETS=( - "cch-linux-x86_64.tar.gz" - "cch-linux-aarch64.tar.gz" - "cch-macos-x86_64.tar.gz" - "cch-macos-aarch64.tar.gz" - "cch-windows-x86_64.exe.zip" + "rulez-linux-x86_64.tar.gz" + "rulez-linux-aarch64.tar.gz" + "rulez-macos-x86_64.tar.gz" + "rulez-macos-aarch64.tar.gz" + "rulez-windows-x86_64.exe.zip" "checksums.txt" ) diff --git a/.claude/skills/release-cch/templates/changelog-entry.md b/.claude/skills/release-rulez/templates/changelog-entry.md similarity index 100% rename from .claude/skills/release-cch/templates/changelog-entry.md rename to .claude/skills/release-rulez/templates/changelog-entry.md diff --git a/.claude/skills/release-cch/templates/pr-body.md b/.claude/skills/release-rulez/templates/pr-body.md similarity index 88% rename from .claude/skills/release-cch/templates/pr-body.md rename to .claude/skills/release-rulez/templates/pr-body.md index 487276ce..a598dd08 100644 --- a/.claude/skills/release-cch/templates/pr-body.md +++ b/.claude/skills/release-rulez/templates/pr-body.md @@ -1,6 +1,6 @@ ## Summary -Prepare for the v${VERSION} release of Claude Context Hooks (CCH). +Prepare for the v${VERSION} release of RuleZ. ## Changes @@ -34,7 +34,7 @@ Prepare for the v${VERSION} release of Claude Context Hooks (CCH). 4. Verify release: ```bash - .claude/skills/release-cch/scripts/verify-release.sh + .claude/skills/release-rulez/scripts/verify-release.sh ``` ## Build Targets diff --git a/.opencode/command/cch-release.md b/.opencode/command/cch-release.md index 53574662..a9fbe326 100644 --- a/.opencode/command/cch-release.md +++ b/.opencode/command/cch-release.md @@ -1,5 +1,5 @@ --- -description: Execute CCH release workflow - prepare, execute, verify, or hotfix releases +description: Execute RuleZ release workflow - prepare, execute, verify, or hotfix releases --- ## User Input @@ -8,9 +8,9 @@ description: Execute CCH release workflow - prepare, execute, verify, or hotfix $ARGUMENTS ``` -## CCH Release Workflow +## RuleZ Release Workflow -This command orchestrates the CCH release process using the `release-cch` skill. +This command orchestrates the RuleZ release process using the `release-rulez` skill. ### Quick Reference @@ -24,11 +24,11 @@ This command orchestrates the CCH release process using the `release-cch` skill. ### Workflow -1. **Load the release-cch skill**: Read `.opencode/skill/release-cch/SKILL.md` for detailed instructions. +1. **Load the release-rulez skill**: Read `.opencode/skill/release-rulez/SKILL.md` for detailed instructions. 2. **Read version** from `Cargo.toml` (single source of truth): ```bash - .opencode/skill/release-cch/scripts/read-version.sh + .opencode/skill/release-rulez/scripts/read-version.sh ``` 3. **Parse arguments** and execute the appropriate phase: @@ -39,9 +39,9 @@ This command orchestrates the CCH release process using the `release-cch` skill. **If `$ARGUMENTS` is `prepare`**: - Verify version is updated in `Cargo.toml` - - Run preflight checks: `.opencode/skill/release-cch/scripts/preflight-check.sh` + - Run preflight checks: `.opencode/skill/release-rulez/scripts/preflight-check.sh` - Create release branch: `git checkout -b release/v${VERSION}` - - Generate changelog: `.opencode/skill/release-cch/scripts/generate-changelog.sh` + - Generate changelog: `.opencode/skill/release-rulez/scripts/generate-changelog.sh` - Commit and push release branch - Create PR with release checklist @@ -53,7 +53,7 @@ This command orchestrates the CCH release process using the `release-cch` skill. - This triggers the release workflow **If `$ARGUMENTS` is `verify`**: - - Run verification: `.opencode/skill/release-cch/scripts/verify-release.sh` + - Run verification: `.opencode/skill/release-rulez/scripts/verify-release.sh` - Check workflow status - Verify release assets @@ -103,17 +103,17 @@ The release PR must pass all checks: After tagging, the workflow builds and uploads: -- `cch-linux-x86_64.tar.gz` -- `cch-linux-aarch64.tar.gz` -- `cch-macos-x86_64.tar.gz` -- `cch-macos-aarch64.tar.gz` -- `cch-windows-x86_64.exe.zip` +- `rulez-linux-x86_64.tar.gz` +- `rulez-linux-aarch64.tar.gz` +- `rulez-macos-x86_64.tar.gz` +- `rulez-macos-aarch64.tar.gz` +- `rulez-windows-x86_64.exe.zip` - `checksums.txt` ### Troubleshooting If something goes wrong, see: -- `.opencode/skill/release-cch/references/troubleshooting.md` +- `.opencode/skill/release-rulez/references/troubleshooting.md` - Or run `/cch-release verify` to diagnose ### Examples diff --git a/.opencode/skill/release-cch/references/release-workflow.md b/.opencode/skill/release-cch/references/release-workflow.md deleted file mode 100644 index f6f87bcb..00000000 --- a/.opencode/skill/release-cch/references/release-workflow.md +++ /dev/null @@ -1,158 +0,0 @@ -# CCH Release Workflow - -## Overview Diagram - -``` -┌─────────────────────────────────────────────────────────────────────┐ -│ PHASE 1: PREPARE │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ 1. Update version in Cargo.toml (manual) │ -│ │ │ -│ ▼ │ -│ 2. git checkout -b release/vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 3. Run preflight-check.sh ─────────────────────┐ │ -│ │ │ │ -│ ▼ ▼ │ -│ [All pass?] ──No──► Fix issues, retry │ -│ │ │ -│ Yes │ -│ │ │ -│ ▼ │ -│ 4. Generate/edit CHANGELOG.md │ -│ │ │ -│ ▼ │ -│ 5. git commit -m "chore: prepare vX.Y.Z release" │ -│ │ │ -│ ▼ │ -│ 6. git push -u origin release/vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 7. gh pr create │ -│ │ │ -│ ▼ │ -│ 8. Wait for CI (15 checks) ────────────────────┐ │ -│ │ │ │ -│ ▼ ▼ │ -│ [All green?] ──No──► Fix issues, push again │ -│ │ │ -│ Yes │ -│ │ │ -└──────────────────────────┼──────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────────────┐ -│ PHASE 2: EXECUTE │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ 1. gh pr merge --merge --delete-branch │ -│ │ │ -│ ▼ │ -│ 2. git checkout main && git pull │ -│ │ │ -│ ▼ │ -│ 3. git tag vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 4. git push origin vX.Y.Z ───────────► TRIGGERS RELEASE WORKFLOW │ -│ │ │ -└──────────────────────────┼──────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────────────┐ -│ PHASE 3: VERIFY │ -├─────────────────────────────────────────────────────────────────────┤ -│ │ -│ 1. gh run list / gh run view │ -│ │ │ -│ ▼ │ -│ 2. Wait for 5 build jobs + 1 release job │ -│ │ │ -│ ┌─────────────────┼─────────────────┐ │ -│ │ │ │ │ -│ ▼ ▼ ▼ │ -│ Linux x86_64 macOS x86_64 Windows x86_64 │ -│ Linux aarch64 macOS aarch64 │ -│ │ │ │ │ -│ └─────────────────┼─────────────────┘ │ -│ │ │ -│ ▼ │ -│ 3. Create Release job (uploads artifacts) │ -│ │ │ -│ ▼ │ -│ 4. gh release view vX.Y.Z │ -│ │ │ -│ ▼ │ -│ 5. Verify 6 assets uploaded │ -│ - cch-linux-x86_64.tar.gz │ -│ - cch-linux-aarch64.tar.gz │ -│ - cch-macos-x86_64.tar.gz │ -│ - cch-macos-aarch64.tar.gz │ -│ - cch-windows-x86_64.exe.zip │ -│ - checksums.txt │ -│ │ -└─────────────────────────────────────────────────────────────────────┘ -``` - -## CI Checks Detail (15 total) - -| # | Check | Description | Time | -|---|-------|-------------|------| -| 1 | Format | `cargo fmt --check` | ~15s | -| 2 | Clippy | `cargo clippy -- -D warnings` | ~25s | -| 3 | Unit Tests | Core unit tests | ~30s | -| 4 | Code Coverage | Coverage report generation | ~55s | -| 5-10 | Integration Tests | One per user story (6 jobs) | ~30s each | -| 11-15 | Build Release | Cross-platform builds (5 jobs) | ~1-2m each | -| 16 | CI Success | Meta-check (all above pass) | ~5s | - -## Release Workflow Jobs - -The `.github/workflows/release.yml` runs: - -### Build Matrix (5 parallel jobs) - -| OS | Target | Output | -|----|--------|--------| -| ubuntu-latest | x86_64-unknown-linux-gnu | cch-linux-x86_64.tar.gz | -| ubuntu-latest | aarch64-unknown-linux-gnu | cch-linux-aarch64.tar.gz | -| macos-latest | x86_64-apple-darwin | cch-macos-x86_64.tar.gz | -| macos-latest | aarch64-apple-darwin | cch-macos-aarch64.tar.gz | -| windows-latest | x86_64-pc-windows-msvc | cch-windows-x86_64.exe.zip | - -### Create Release Job - -After all builds complete: - -1. Download all artifacts -2. Generate checksums: `sha256sum *.tar.gz *.zip > checksums.txt` -3. Create GitHub release with `softprops/action-gh-release` -4. Upload all assets - -## Version Flow - -``` -Cargo.toml Git Tags GitHub Release - │ │ │ - ▼ ▼ ▼ -version = "1.0.0" ───────► v1.0.0 ────────────────► Release v1.0.0 - │ │ │ - │ │ ├─ Assets - │ │ ├─ Release notes - │ │ └─ Checksums - │ │ - ▼ ▼ -version = "1.1.0" ───────► v1.1.0 ────────────────► Release v1.1.0 -``` - -## Timing Expectations - -| Phase | Typical Duration | -|-------|-----------------| -| Prepare (manual) | 5-10 minutes | -| CI checks | 2-3 minutes | -| Review/Merge PR | Variable | -| Tag push to release | 3-5 minutes | -| **Total** | ~15-20 minutes (excluding review) | diff --git a/.opencode/skill/release-cch/SKILL.md b/.opencode/skill/release-rulez/SKILL.md similarity index 71% rename from .opencode/skill/release-cch/SKILL.md rename to .opencode/skill/release-rulez/SKILL.md index aa72d999..904e210e 100644 --- a/.opencode/skill/release-cch/SKILL.md +++ b/.opencode/skill/release-rulez/SKILL.md @@ -1,13 +1,13 @@ --- -name: release-cch -description: CCH release workflow automation. Use when asked to "release CCH", "create a release", "prepare release", "tag version", "hotfix release", or "publish CCH". Covers version management from Cargo.toml, changelog generation from conventional commits, PR creation, tagging, hotfix workflows, and GitHub Actions release monitoring. +name: release-rulez +description: RuleZ release workflow automation. Use when asked to "release RuleZ", "create a release", "prepare release", "tag version", "hotfix release", or "publish RuleZ". Covers version management from Cargo.toml, changelog generation from conventional commits, PR creation, tagging, hotfix workflows, and GitHub Actions release monitoring. metadata: version: "1.0.0" - project: "cch" + project: "rulez" source_of_truth: "Cargo.toml" --- -# release-cch +# release-rulez ## Contents @@ -35,11 +35,11 @@ version = "1.0.0" | Platform | Target | Asset | |----------|--------|-------| -| Linux x86_64 | x86_64-unknown-linux-gnu | cch-linux-x86_64.tar.gz | -| Linux ARM64 | aarch64-unknown-linux-gnu | cch-linux-aarch64.tar.gz | -| macOS Intel | x86_64-apple-darwin | cch-macos-x86_64.tar.gz | -| macOS Apple Silicon | aarch64-apple-darwin | cch-macos-aarch64.tar.gz | -| Windows | x86_64-pc-windows-msvc | cch-windows-x86_64.exe.zip | +| Linux x86_64 | x86_64-unknown-linux-gnu | rulez-linux-x86_64.tar.gz | +| Linux ARM64 | aarch64-unknown-linux-gnu | rulez-linux-aarch64.tar.gz | +| macOS Intel | x86_64-apple-darwin | rulez-macos-x86_64.tar.gz | +| macOS Apple Silicon | aarch64-apple-darwin | rulez-macos-aarch64.tar.gz | +| Windows | x86_64-pc-windows-msvc | rulez-windows-x86_64.exe.zip | **Repository**: `SpillwaveSolutions/code_agent_context_hooks` @@ -67,7 +67,7 @@ What do you need? ```bash # Run from repo root -.opencode/skill/release-cch/scripts/read-version.sh +.opencode/skill/release-rulez/scripts/read-version.sh # Output: 1.0.0 ``` @@ -89,14 +89,14 @@ version = "1.1.0" # <- Update this ### 1.3 Create Release Branch ```bash -VERSION=$(.opencode/skill/release-cch/scripts/read-version.sh) +VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh) git checkout -b release/v${VERSION} ``` ### 1.4 Run Pre-flight Checks ```bash -.opencode/skill/release-cch/scripts/preflight-check.sh +.opencode/skill/release-rulez/scripts/preflight-check.sh ``` This validates: @@ -107,13 +107,13 @@ This validates: - [ ] Clippy has no warnings - [ ] Format check passes -**IMPORTANT:** Integration tests are REQUIRED before any release. They validate that CCH works correctly with the real Claude CLI end-to-end. If Claude CLI is not installed, the preflight check will warn but not block - however, you should ensure integration tests pass in CI before releasing. +**IMPORTANT:** Integration tests are REQUIRED before any release. They validate that RuleZ works correctly with the real Claude CLI end-to-end. If Claude CLI is not installed, the preflight check will warn but not block - however, you should ensure integration tests pass in CI before releasing. ### 1.5 Generate Changelog ```bash -VERSION=$(.opencode/skill/release-cch/scripts/read-version.sh) -.opencode/skill/release-cch/scripts/generate-changelog.sh ${VERSION} +VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh) +.opencode/skill/release-rulez/scripts/generate-changelog.sh ${VERSION} ``` Review the output and update `CHANGELOG.md` as needed. The script parses conventional commits (`feat:`, `fix:`, `docs:`, `chore:`). @@ -121,7 +121,7 @@ Review the output and update `CHANGELOG.md` as needed. The script parses convent ### 1.6 Commit and Push ```bash -VERSION=$(.opencode/skill/release-cch/scripts/read-version.sh) +VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh) git add CHANGELOG.md Cargo.toml git commit -m "chore: prepare v${VERSION} release" git push -u origin release/v${VERSION} @@ -130,13 +130,13 @@ git push -u origin release/v${VERSION} ### 1.7 Create Release PR ```bash -VERSION=$(.opencode/skill/release-cch/scripts/read-version.sh) +VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh) gh pr create \ --title "chore: prepare v${VERSION} release" \ --body "$(cat < --watch All checks must pass before merging: - Format, Clippy, Unit Tests, Code Coverage -- **Integration Tests** (CCH + Claude CLI end-to-end validation) +- **Integration Tests** (RuleZ + Claude CLI end-to-end validation) - Build Release (5 platforms) - CI Success -**Note:** Integration tests validate that CCH hooks work correctly with the real Claude CLI. These are critical gate checks - do NOT skip them. +**Note:** Integration tests validate that RuleZ hooks work correctly with the real Claude CLI. These are critical gate checks - do NOT skip them. --- @@ -200,7 +200,7 @@ git pull ### 2.3 Create and Push Tag ```bash -VERSION=$(.opencode/skill/release-cch/scripts/read-version.sh) +VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh) git tag v${VERSION} git push origin v${VERSION} ``` @@ -214,7 +214,7 @@ This triggers the release workflow automatically. ### 3.1 Monitor Workflow ```bash -.opencode/skill/release-cch/scripts/verify-release.sh +.opencode/skill/release-rulez/scripts/verify-release.sh ``` Or manually: @@ -227,17 +227,17 @@ gh run view --watch ### 3.2 Verify Release Assets ```bash -VERSION=$(.opencode/skill/release-cch/scripts/read-version.sh) +VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh) gh release view v${VERSION} ``` Expected assets (6 total): -- cch-linux-x86_64.tar.gz -- cch-linux-aarch64.tar.gz -- cch-macos-x86_64.tar.gz -- cch-macos-aarch64.tar.gz -- cch-windows-x86_64.exe.zip +- rulez-linux-x86_64.tar.gz +- rulez-linux-aarch64.tar.gz +- rulez-macos-x86_64.tar.gz +- rulez-macos-aarch64.tar.gz +- rulez-windows-x86_64.exe.zip - checksums.txt ### 3.3 Announce Release @@ -270,7 +270,7 @@ git checkout -b hotfix/v1.0.1 Make the minimal fix needed, then run checks: ```bash -cd cch_cli && cargo fmt && cargo clippy --all-targets --all-features -- -D warnings && cargo test +cargo fmt --all && cargo clippy --all-targets --all-features --workspace -- -D warnings && cargo test --tests --all-features --workspace ``` ### 4.3 Update Version @@ -334,14 +334,14 @@ git push origin v1.0.1 ### 4.8 Verify Hotfix Release ```bash -.opencode/skill/release-cch/scripts/verify-release.sh 1.0.1 +.opencode/skill/release-rulez/scripts/verify-release.sh 1.0.1 ``` --- ## Integration Tests (Required) -Integration tests validate CCH works correctly with the real Claude CLI. **These must pass before any release.** +Integration tests validate RuleZ works correctly with the real Claude CLI. **These must pass before any release.** ### Running Integration Tests @@ -363,22 +363,22 @@ task integration-test-quick | Test | What It Validates | |------|-------------------| -| `01-block-force-push` | CCH blocks dangerous git operations | -| `02-context-injection` | CCH injects context for file types | -| `03-session-logging` | CCH creates proper audit logs | -| `04-permission-explanations` | CCH provides permission context | +| `01-block-force-push` | RuleZ blocks dangerous git operations | +| `02-context-injection` | RuleZ injects context for file types | +| `03-session-logging` | RuleZ creates proper audit logs | +| `04-permission-explanations` | RuleZ provides permission context | ### Prerequisites - Claude CLI installed and in PATH -- CCH binary built (auto-built by test runner) +- RuleZ binary built (auto-built by test runner) ### If Tests Fail 1. Check Claude CLI is installed: `which claude` -2. Check CCH builds: `cd cch_cli && cargo build --release` +2. Check RuleZ builds: `cargo build --release` 3. Run with debug: `DEBUG=1 ./test/integration/run-all.sh` -4. Check logs: `~/.claude/logs/cch.log` +4. Check logs: `~/.claude/logs/rulez.log` For details, see [Integration Test README](../../../test/integration/README.md). @@ -393,7 +393,7 @@ For details, see [Integration Test README](../../../test/integration/README.md). | `preflight-check.sh` | Run all pre-release checks (includes integration tests) | `./scripts/preflight-check.sh [--json]` | | `verify-release.sh` | Monitor release workflow status | `./scripts/verify-release.sh [version]` | -All scripts are located in `.opencode/skill/release-cch/scripts/`. +All scripts are located in `.opencode/skill/release-rulez/scripts/`. --- @@ -412,14 +412,14 @@ All scripts are located in `.opencode/skill/release-cch/scripts/`. ```bash # 1. Update version in Cargo.toml manually # 2. Create release branch -VERSION=$(.opencode/skill/release-cch/scripts/read-version.sh) +VERSION=$(.opencode/skill/release-rulez/scripts/read-version.sh) git checkout -b release/v${VERSION} # 3. Run checks -.opencode/skill/release-cch/scripts/preflight-check.sh +.opencode/skill/release-rulez/scripts/preflight-check.sh # 4. Generate changelog, review, commit -.opencode/skill/release-cch/scripts/generate-changelog.sh ${VERSION} +.opencode/skill/release-rulez/scripts/generate-changelog.sh ${VERSION} # Edit CHANGELOG.md as needed git add CHANGELOG.md Cargo.toml git commit -m "chore: prepare v${VERSION} release" @@ -436,7 +436,7 @@ git tag v${VERSION} git push origin v${VERSION} # 7. Verify -.opencode/skill/release-cch/scripts/verify-release.sh +.opencode/skill/release-rulez/scripts/verify-release.sh ``` ### Hotfix Release diff --git a/.opencode/skill/release-cch/references/hotfix-workflow.md b/.opencode/skill/release-rulez/references/hotfix-workflow.md similarity index 65% rename from .opencode/skill/release-cch/references/hotfix-workflow.md rename to .opencode/skill/release-rulez/references/hotfix-workflow.md index 8c7528eb..47bfa452 100644 --- a/.opencode/skill/release-cch/references/hotfix-workflow.md +++ b/.opencode/skill/release-rulez/references/hotfix-workflow.md @@ -1,4 +1,4 @@ -# CCH Hotfix Workflow +# RuleZ Hotfix Workflow ## When to Use @@ -21,37 +21,37 @@ Use a hotfix workflow when: ``` main branch - │ - v1.0.0 ──────────────┼──────────────────────── v1.1.0 (future) - │ │ - │ │ - ▼ │ - ┌─────────┐ │ - │ Hotfix │ │ - │ Branch │ │ - └────┬────┘ │ - │ │ - ▼ │ - hotfix/v1.0.1 │ - │ │ - ├── Fix bug │ - ├── Update version│ - ├── Update changelog - │ │ - ▼ │ - Create PR ────────────┤ - │ │ - ▼ │ - Merge to main ────────┤ - │ │ - ▼ │ - git tag v1.0.1 │ - │ │ - ▼ │ - Release workflow │ - │ │ - ▼ │ - v1.0.1 released │ + | + v1.0.0 --------------+-------------------------- v1.1.0 (future) + | | + | | + v | + +---------+ | + | Hotfix | | + | Branch | | + +----+----+ | + | | + v | + hotfix/v1.0.1 | + | | + +-- Fix bug | + +-- Update version| + +-- Update changelog + | | + v | + Create PR ------------+ + | | + v | + Merge to main --------+ + | | + v | + git tag v1.0.1 | + | | + v | + Release workflow | + | | + v | + v1.0.1 released | ``` ## Step-by-Step @@ -81,10 +81,9 @@ Make the minimal fix needed. Keep changes focused on the issue. # ... # Run all checks -cd cch_cli -cargo fmt -cargo clippy --all-targets --all-features -- -D warnings -cargo test +cargo fmt --all +cargo clippy --all-targets --all-features --workspace -- -D warnings +cargo test --tests --all-features --workspace ``` ### 3. Update Version @@ -170,7 +169,7 @@ git push origin v1.0.1 ### 9. Verify ```bash -.opencode/skill/release-cch/scripts/verify-release.sh 1.0.1 +.opencode/skill/release-rulez/scripts/verify-release.sh 1.0.1 ``` ## Important Notes @@ -193,19 +192,19 @@ git push origin v1.0.1 ``` v1.0.0 (initial release) - │ - ├── Bug found in production - │ - ▼ + | + +-- Bug found in production + | + v v1.0.1 (hotfix for critical bug) - │ - ├── Another bug found - │ - ▼ + | + +-- Another bug found + | + v v1.0.2 (another hotfix) Meanwhile, main branch continues: -v1.0.0 ──► development ──► v1.1.0 (includes v1.0.1, v1.0.2 fixes) +v1.0.0 --> development --> v1.1.0 (includes v1.0.1, v1.0.2 fixes) ``` ## Cherry-picking (Advanced) diff --git a/.opencode/skill/release-rulez/references/release-workflow.md b/.opencode/skill/release-rulez/references/release-workflow.md new file mode 100644 index 00000000..a8306790 --- /dev/null +++ b/.opencode/skill/release-rulez/references/release-workflow.md @@ -0,0 +1,158 @@ +# RuleZ Release Workflow + +## Overview Diagram + +``` ++---------------------------------------------------------------------+ +| PHASE 1: PREPARE | ++---------------------------------------------------------------------+ +| | +| 1. Update version in Cargo.toml (manual) | +| | | +| v | +| 2. git checkout -b release/vX.Y.Z | +| | | +| v | +| 3. Run preflight-check.sh ---------------------+ | +| | | | +| v v | +| [All pass?] --No--> Fix issues, retry | +| | | +| Yes | +| | | +| v | +| 4. Generate/edit CHANGELOG.md | +| | | +| v | +| 5. git commit -m "chore: prepare vX.Y.Z release" | +| | | +| v | +| 6. git push -u origin release/vX.Y.Z | +| | | +| v | +| 7. gh pr create | +| | | +| v | +| 8. Wait for CI (15 checks) ----------------------+ | +| | | | +| v v | +| [All green?] --No--> Fix issues, push again | +| | | +| Yes | +| | | ++---------------------------------------------------------------------+ + | + v ++---------------------------------------------------------------------+ +| PHASE 2: EXECUTE | ++---------------------------------------------------------------------+ +| | +| 1. gh pr merge --merge --delete-branch | +| | | +| v | +| 2. git checkout main && git pull | +| | | +| v | +| 3. git tag vX.Y.Z | +| | | +| v | +| 4. git push origin vX.Y.Z -----------> TRIGGERS RELEASE WORKFLOW | +| | | ++---------------------------------------------------------------------+ + | + v ++---------------------------------------------------------------------+ +| PHASE 3: VERIFY | ++---------------------------------------------------------------------+ +| | +| 1. gh run list / gh run view | +| | | +| v | +| 2. Wait for 5 build jobs + 1 release job | +| | | +| +-----------------+-----------------+ | +| | | | | +| v v v | +| Linux x86_64 macOS x86_64 Windows x86_64 | +| Linux aarch64 macOS aarch64 | +| | | | | +| +-----------------+-----------------+ | +| | | +| v | +| 3. Create Release job (uploads artifacts) | +| | | +| v | +| 4. gh release view vX.Y.Z | +| | | +| v | +| 5. Verify 6 assets uploaded | +| - rulez-linux-x86_64.tar.gz | +| - rulez-linux-aarch64.tar.gz | +| - rulez-macos-x86_64.tar.gz | +| - rulez-macos-aarch64.tar.gz | +| - rulez-windows-x86_64.exe.zip | +| - checksums.txt | +| | ++---------------------------------------------------------------------+ +``` + +## CI Checks Detail (15 total) + +| # | Check | Description | Time | +|---|-------|-------------|------| +| 1 | Format | `cargo fmt --check` | ~15s | +| 2 | Clippy | `cargo clippy -- -D warnings` | ~25s | +| 3 | Unit Tests | Core unit tests | ~30s | +| 4 | Code Coverage | Coverage report generation | ~55s | +| 5-10 | Integration Tests | One per user story (6 jobs) | ~30s each | +| 11-15 | Build Release | Cross-platform builds (5 jobs) | ~1-2m each | +| 16 | CI Success | Meta-check (all above pass) | ~5s | + +## Release Workflow Jobs + +The `.github/workflows/release.yml` runs: + +### Build Matrix (5 parallel jobs) + +| OS | Target | Output | +|----|--------|--------| +| ubuntu-latest | x86_64-unknown-linux-gnu | rulez-linux-x86_64.tar.gz | +| ubuntu-latest | aarch64-unknown-linux-gnu | rulez-linux-aarch64.tar.gz | +| macos-latest | x86_64-apple-darwin | rulez-macos-x86_64.tar.gz | +| macos-latest | aarch64-apple-darwin | rulez-macos-aarch64.tar.gz | +| windows-latest | x86_64-pc-windows-msvc | rulez-windows-x86_64.exe.zip | + +### Create Release Job + +After all builds complete: + +1. Download all artifacts +2. Generate checksums: `sha256sum *.tar.gz *.zip > checksums.txt` +3. Create GitHub release with `softprops/action-gh-release` +4. Upload all assets + +## Version Flow + +``` +Cargo.toml Git Tags GitHub Release + | | | + v v v +version = "1.0.0" -------> v1.0.0 ----------------> Release v1.0.0 + | | | + | | +- Assets + | | +- Release notes + | | +- Checksums + | | + v v +version = "1.1.0" -------> v1.1.0 ----------------> Release v1.1.0 +``` + +## Timing Expectations + +| Phase | Typical Duration | +|-------|-----------------| +| Prepare (manual) | 5-10 minutes | +| CI checks | 2-3 minutes | +| Review/Merge PR | Variable | +| Tag push to release | 3-5 minutes | +| **Total** | ~15-20 minutes (excluding review) | diff --git a/.opencode/skill/release-cch/references/troubleshooting.md b/.opencode/skill/release-rulez/references/troubleshooting.md similarity index 89% rename from .opencode/skill/release-cch/references/troubleshooting.md rename to .opencode/skill/release-rulez/references/troubleshooting.md index 20f97b87..16a9abd1 100644 --- a/.opencode/skill/release-cch/references/troubleshooting.md +++ b/.opencode/skill/release-rulez/references/troubleshooting.md @@ -6,9 +6,9 @@ | Issue | Cause | Solution | |-------|-------|----------| -| "cargo fmt failed" | Code not formatted | `cd cch_cli && cargo fmt` | -| "clippy warnings" | Lint issues | `cd cch_cli && cargo clippy --fix` | -| "tests failed" | Broken tests | `cd cch_cli && cargo test` to reproduce | +| "cargo fmt failed" | Code not formatted | `cargo fmt --all` | +| "clippy warnings" | Lint issues | `cargo clippy --all-targets --all-features --workspace -- -D warnings` | +| "tests failed" | Broken tests | `cargo test --tests --all-features --workspace` to reproduce | | "not on correct branch" | Wrong branch | `git checkout main` or create release branch | | "uncommitted changes" | Dirty working dir | Commit or stash changes | @@ -25,14 +25,14 @@ **Format failure**: ```bash - cd cch_cli && cargo fmt + cargo fmt --all git add -A && git commit -m "style: fix formatting" git push ``` **Clippy failure**: ```bash - cd cch_cli && cargo clippy --all-targets --all-features -- -D warnings + cargo clippy --all-targets --all-features --workspace -- -D warnings # Fix reported issues git add -A && git commit -m "fix: address clippy warnings" git push @@ -40,7 +40,7 @@ **Test failure**: ```bash - cd cch_cli && cargo test + cargo test --tests --all-features --workspace # Find and fix failing test git add -A && git commit -m "fix: repair broken test" git push @@ -111,7 +111,7 @@ gh run view --log **Solution**: ```bash # Read current version -.opencode/skill/release-cch/scripts/read-version.sh +.opencode/skill/release-rulez/scripts/read-version.sh # Should match your intended tag # If not, update Cargo.toml and re-run release diff --git a/.opencode/skill/release-cch/scripts/generate-changelog.sh b/.opencode/skill/release-rulez/scripts/generate-changelog.sh similarity index 99% rename from .opencode/skill/release-cch/scripts/generate-changelog.sh rename to .opencode/skill/release-rulez/scripts/generate-changelog.sh index 5393866b..3eb67b29 100755 --- a/.opencode/skill/release-cch/scripts/generate-changelog.sh +++ b/.opencode/skill/release-rulez/scripts/generate-changelog.sh @@ -59,7 +59,7 @@ OTHER="" # Parse commits while IFS= read -r commit; do [ -z "$commit" ] && continue - + case "$commit" in feat!:*) msg="${commit#feat!: }" diff --git a/.opencode/skill/release-cch/scripts/preflight-check.sh b/.opencode/skill/release-rulez/scripts/preflight-check.sh similarity index 89% rename from .opencode/skill/release-cch/scripts/preflight-check.sh rename to .opencode/skill/release-rulez/scripts/preflight-check.sh index 493054a6..96444ca2 100755 --- a/.opencode/skill/release-cch/scripts/preflight-check.sh +++ b/.opencode/skill/release-rulez/scripts/preflight-check.sh @@ -1,7 +1,7 @@ #!/bin/bash # # preflight-check.sh -# Pre-release verification checks for CCH +# Pre-release verification checks for RuleZ # # Usage: ./preflight-check.sh [--json] # @@ -65,7 +65,7 @@ check_info() { # Header $JSON_OUTPUT || echo "" -$JSON_OUTPUT || echo -e "${BLUE}CCH Release Pre-flight Checks${NC}" +$JSON_OUTPUT || echo -e "${BLUE}RuleZ Release Pre-flight Checks${NC}" $JSON_OUTPUT || echo "==============================" $JSON_OUTPUT || echo "" @@ -93,36 +93,34 @@ fi # Check 3: Format check check_info "Running cargo fmt --check..." -cd "$REPO_ROOT/cch_cli" -if cargo fmt --check > /dev/null 2>&1; then +if cargo fmt --all --check > /dev/null 2>&1; then check_pass "cargo fmt --check passes" else - check_fail "cargo fmt --check failed - run 'cd cch_cli && cargo fmt'" + check_fail "cargo fmt --check failed - run 'cargo fmt --all'" fi # Check 4: Clippy check_info "Running cargo clippy..." -if cargo clippy --all-targets --all-features -- -D warnings > /dev/null 2>&1; then +if cargo clippy --all-targets --all-features --workspace -- -D warnings > /dev/null 2>&1; then check_pass "cargo clippy passes (no warnings)" else check_fail "cargo clippy has warnings/errors" - $JSON_OUTPUT || echo " Run: cd cch_cli && cargo clippy --all-targets --all-features -- -D warnings" + $JSON_OUTPUT || echo " Run: cargo clippy --all-targets --all-features --workspace -- -D warnings" fi # Check 5: Unit Tests check_info "Running cargo test..." -TEST_OUTPUT=$(cargo test 2>&1) +TEST_OUTPUT=$(cargo test --tests --all-features --workspace 2>&1) if echo "$TEST_OUTPUT" | grep -q "test result: ok"; then TEST_SUMMARY=$(echo "$TEST_OUTPUT" | grep "test result:" | head -1) check_pass "All unit tests pass: $TEST_SUMMARY" else check_fail "Unit tests failed" - $JSON_OUTPUT || echo " Run: cd cch_cli && cargo test" + $JSON_OUTPUT || echo " Run: cargo test --tests --all-features --workspace" fi # Check 5b: Integration Tests check_info "Running integration tests..." -cd "$REPO_ROOT" if [ -x "$REPO_ROOT/test/integration/run-all.sh" ]; then # Check if Claude CLI is available if command -v claude &> /dev/null; then @@ -145,11 +143,9 @@ if [ -x "$REPO_ROOT/test/integration/run-all.sh" ]; then else check_fail "Integration test runner not found at test/integration/run-all.sh" fi -cd "$REPO_ROOT/cch_cli" # Check 6: Version in Cargo.toml check_info "Checking version..." -cd "$REPO_ROOT" VERSION=$("$SCRIPT_DIR/read-version.sh" 2>/dev/null || echo "") if [ -n "$VERSION" ]; then check_pass "Version: $VERSION" diff --git a/.opencode/skill/release-cch/scripts/read-version.sh b/.opencode/skill/release-rulez/scripts/read-version.sh similarity index 100% rename from .opencode/skill/release-cch/scripts/read-version.sh rename to .opencode/skill/release-rulez/scripts/read-version.sh diff --git a/.opencode/skill/release-cch/scripts/verify-release.sh b/.opencode/skill/release-rulez/scripts/verify-release.sh similarity index 93% rename from .opencode/skill/release-cch/scripts/verify-release.sh rename to .opencode/skill/release-rulez/scripts/verify-release.sh index 9bf7d883..a8454618 100755 --- a/.opencode/skill/release-cch/scripts/verify-release.sh +++ b/.opencode/skill/release-rulez/scripts/verify-release.sh @@ -31,7 +31,7 @@ BLUE='\033[0;34m' NC='\033[0m' echo "" -echo -e "${BLUE}CCH Release Verification: v${VERSION}${NC}" +echo -e "${BLUE}RuleZ Release Verification: v${VERSION}${NC}" echo "======================================" echo "" @@ -78,17 +78,17 @@ if [ -n "$ASSETS" ]; then echo "$ASSETS" | while read -r asset; do echo " - $asset" done - + # Verify expected assets EXPECTED_ASSETS=( - "cch-linux-x86_64.tar.gz" - "cch-linux-aarch64.tar.gz" - "cch-macos-x86_64.tar.gz" - "cch-macos-aarch64.tar.gz" - "cch-windows-x86_64.exe.zip" + "rulez-linux-x86_64.tar.gz" + "rulez-linux-aarch64.tar.gz" + "rulez-macos-x86_64.tar.gz" + "rulez-macos-aarch64.tar.gz" + "rulez-windows-x86_64.exe.zip" "checksums.txt" ) - + MISSING=0 for expected in "${EXPECTED_ASSETS[@]}"; do if ! echo "$ASSETS" | grep -q "$expected"; then @@ -96,7 +96,7 @@ if [ -n "$ASSETS" ]; then ((MISSING++)) || true fi done - + if [ $MISSING -gt 0 ]; then echo -e "${YELLOW}[WARN]${NC} $MISSING expected asset(s) missing" fi diff --git a/.opencode/skill/release-cch/templates/changelog-entry.md b/.opencode/skill/release-rulez/templates/changelog-entry.md similarity index 95% rename from .opencode/skill/release-cch/templates/changelog-entry.md rename to .opencode/skill/release-rulez/templates/changelog-entry.md index 636c7b59..fe07d687 100644 --- a/.opencode/skill/release-cch/templates/changelog-entry.md +++ b/.opencode/skill/release-rulez/templates/changelog-entry.md @@ -48,7 +48,7 @@ Replace `${DATE}` with today's date in YYYY-MM-DD format ### Added - Support for custom rule priorities -- New `cch status` command for quick health checks +- New `rulez status` command for quick health checks - Environment variable override for log level ### Fixed diff --git a/.opencode/skill/release-cch/templates/pr-body.md b/.opencode/skill/release-rulez/templates/pr-body.md similarity index 89% rename from .opencode/skill/release-cch/templates/pr-body.md rename to .opencode/skill/release-rulez/templates/pr-body.md index a6d64bd1..679c9866 100644 --- a/.opencode/skill/release-cch/templates/pr-body.md +++ b/.opencode/skill/release-rulez/templates/pr-body.md @@ -1,6 +1,6 @@ ## Summary -Prepare for the v${VERSION} release of Claude Context Hooks (CCH). +Prepare for the v${VERSION} release of RuleZ. ## Changes @@ -34,7 +34,7 @@ Prepare for the v${VERSION} release of Claude Context Hooks (CCH). 4. Verify release: ```bash - .opencode/skill/release-cch/scripts/verify-release.sh + .opencode/skill/release-rulez/scripts/verify-release.sh ``` ## Build Targets diff --git a/.planning/MILESTONES.md b/.planning/MILESTONES.md index f50852a3..ba130cb3 100644 --- a/.planning/MILESTONES.md +++ b/.planning/MILESTONES.md @@ -1,5 +1,14 @@ # Project Milestones: RuleZ (AI Policy Engine) +## v2.2.1 Cleanup, Sync Skills, CLI Help & UI Integration (Shipped: 2026-03-13) + +**Phases completed:** 29 phases, 79 plans, 8 tasks + +**Key accomplishments:** +- (none recorded) + +--- + ## v1.2 P2 Features (Shipped: 2026-02-07) **Delivered:** Advanced injection and conditional rule features for dynamic context generation and environment-aware rule activation. diff --git a/.planning/PROJECT.md b/.planning/PROJECT.md index 7481b605..c044153c 100644 --- a/.planning/PROJECT.md +++ b/.planning/PROJECT.md @@ -32,38 +32,27 @@ RuleZ positions itself as comparable to: ## Current State -### RuleZ Core (v1.4) +### RuleZ Core (v2.2.1) - Policy engine with blocking, injection, validation, inline scripting, schema validation -- CLI: init, install, uninstall, validate, logs, explain, debug, repl -- 634 tests, <3ms latency, comprehensive logging -- ~23,600 LOC Rust -- **v1.2 Features:** - - `inject_inline` - Embed context directly in YAML - - `inject_command` - Dynamic context via shell commands - - `enabled_when` - Conditional rule activation with expressions -- **v1.3 Features:** - - `prompt_match` - Regex intent routing with case-insensitive, anchored, AND/OR logic - - `require_fields` / `field_types` - Fail-closed field validation with dot-notation paths - - `validate_expr` - Inline evalexpr expressions with get_field() / has_field() - - `inline_script` - Shell scripts in YAML with timeout protection -- **v1.4 Features:** - - JSON Schema validation (fail-open, <0.1ms overhead) - - Debug CLI UserPromptSubmit support with LRU regex cache - - Cross-platform E2E test stabilization (macOS symlinks, Windows paths) - - CI matrix for E2E tests (ubuntu, macOS, Windows) - - Tauri CI build pipeline with E2E gate +- CLI: init, install, uninstall, validate, logs, explain, debug, repl, test, lint, upgrade +- Multi-CLI support: Claude Code, Gemini, Copilot, OpenCode (install/doctor commands) +- Parallel rule evaluation, config caching, globset matching +- E2E test harness across 5 CLIs (Claude Code, Gemini, Copilot, OpenCode, Codex) ### Mastering Hooks (Complete) - Claude Code skill for RuleZ mastery -- References: schema, CLI commands, patterns, troubleshooting -- Future: Convert to plugin format +- References: schema, 19+ CLI commands documented, patterns, troubleshooting +- Covers subagent hook patterns -### RuleZ UI (v1.5 Active) -- Tauri 2.0 desktop app — M1 scaffold complete -- 18 React components, 3 Zustand stores, Monaco YAML editor with schema validation -- Dual-mode architecture (Tauri desktop + web browser fallback) -- Playwright E2E tests with Page Object Model -- Known issues: Tauri backend still references `cch` binary (needs `rulez` update) +### RuleZ UI (Complete) +- Tauri 2.0 desktop app with Monaco YAML editor, log viewer, config management +- ConfigDiffView with Monaco DiffEditor for config comparison +- Debug simulator, onboarding wizard, settings panel +- Playwright E2E tests, CI builds on ubuntu/macOS/Windows + +### Release Skill (Complete) +- Renamed from `release-cch` to `release-rulez` (v2.2.1) +- Automated release workflow with preflight checks, changelog, and verification ## Requirements @@ -95,18 +84,11 @@ RuleZ positions itself as comparable to: - ✓ REQ-PERF-01..02: Performance quality gates (<0.1ms schema validation) — v1.4 - ✓ REQ-COMPAT-01..02: Cross-platform compatibility (CI matrix) — v1.4 -### Active — v1.5 RuleZ UI +### Active -- [ ] Fix cch→rulez binary references throughout Tauri backend and config -- [ ] Production-quality YAML editor with autocomplete, error markers, live preview -- [ ] Audit log viewer with filtering, search, and rule-to-log correlation -- [ ] Config management (global + project configs, import/export) -- [ ] Debug simulator improvements (real rulez binary integration, event replay) -- [ ] E2E test stabilization and expansion for all UI features -- [ ] Settings/preferences panel (theme, editor options, paths) -- [ ] Onboarding flow for first-time users +(No active requirements — planning next milestone) -See REQUIREMENTS.md for full requirement details with REQ-IDs. +See REQUIREMENTS.md for next milestone requirements when defined. ### Out of Scope @@ -166,6 +148,6 @@ See REQUIREMENTS.md for full requirement details with REQ-IDs. --- -*Last updated: 2026-02-10 after v1.5 milestone started* +*Last updated: 2026-03-13 after v2.2.1 milestone* *Reorganized as monorepo on 2026-02-06* *Renamed from CCH to RuleZ* diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 67db9e95..0df289e1 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -1,6 +1,6 @@ # RuleZ Roadmap -**Current Focus:** All milestones complete (v1.2–v2.1). Releasing v2.1.0. +**Current Focus:** All milestones complete (v1.2–v2.2.1). Planning next milestone. --- @@ -9,411 +9,34 @@ - ✅ **v1.2 P2 Features** — Phases 1-3 (shipped 2026-02-07) — [Archive](milestones/v1.2-ROADMAP.md) - ✅ **v1.3 Advanced Matching & Validation** — Phases 4-6 (shipped 2026-02-10) — [Archive](milestones/v1.3-ROADMAP.md) - ✅ **v1.4 Stability & Polish** — Phases 7-10 (shipped 2026-02-10) — [Archive](milestones/v1.4-ROADMAP.md) -- ✅ **v1.6 RuleZ UI** — Phases 11-17 (shipped 2026-02-12) -- ✅ **v1.7 Multi-Platform Hook Support** — Phases 18-21 (shipped 2026-02-13) -- ✅ **v1.8 Tool Name Canonicalization** — Phase 22 (shipped 2026-02-22) -- ✅ **v1.9 Multi-CLI E2E Testing** — Phases 23, 25 (shipped 2026-03-05) -- ✅ **v2.0 RuleZ Cleanup and Hardening** — Phase 28 (shipped 2026-03-05) -- ✅ **v2.1 Multi-CLI E2E Testing (continued)** — Phases 24, 26, 27 (shipped 2026-03-09) - ---- - -
-✅ v1.2 P2 Features (Phases 1-3) — SHIPPED 2026-02-07 - -### Phase 1: Inline Content Injection -- [x] 1/1 plans — inject_inline field - -### Phase 2: Command-Based Context Generation -- [x] 2/2 plans — inject_command field - -### Phase 3: Conditional Rule Activation -- [x] 3/3 plans — enabled_when field - -See [v1.2-ROADMAP.md](milestones/v1.2-ROADMAP.md) for full details. - -
- -
-✅ v1.3 Advanced Matching & Validation (Phases 4-6) — SHIPPED 2026-02-10 - -### Phase 4: Prompt Matching -- [x] 4/4 plans — regex intent routing with AND/OR logic - -### Phase 5: Field Validation -- [x] 3/3 plans — fail-closed field existence and type checks - -### Phase 6: Inline Script Blocks -- [x] 3/3 plans — evalexpr expressions and shell scripts in YAML - -See [v1.3-ROADMAP.md](milestones/v1.3-ROADMAP.md) for full details. - -
- -
-✅ v1.4 Stability & Polish (Phases 7-10) — SHIPPED 2026-02-10 - -### Phase 7: JSON Schema Validation -- [x] 2/2 plans — fail-open schema validation with <0.1ms overhead - -### Phase 8: Debug CLI Enhancements -- [x] 2/2 plans — UserPromptSubmit support, LRU regex cache - -### Phase 9: E2E Test Stabilization -- [x] 3/3 plans — canonical paths, symlink tests, CI matrix - -### Phase 10: Tauri CI Integration -- [x] 2/2 plans — E2E gate + multi-platform desktop builds - -See [v1.4-ROADMAP.md](milestones/v1.4-ROADMAP.md) for full details. - -
- ---- - -## ✅ v1.6 RuleZ UI (Complete) - -**Milestone Goal:** Production-ready desktop UI for RuleZ policy management with log viewer, config management, debug simulator, and onboarding. - -### Phase 11: Rename Fix + Settings Foundation -**Goal**: Fix cch→rulez binary references and establish settings infrastructure for all features -**Depends on**: Phase 10 -**Requirements**: RENAME-01, RENAME-02, RENAME-03, SET-01, SET-02, SET-03, SET-04, DBG-05 -**Success Criteria** (what must be TRUE): - 1. User sees "rulez" (not "cch") in all UI labels, button text, and window titles - 2. Tauri backend invokes `rulez debug` and `rulez validate` successfully - 3. User can configure theme, editor font size, and binary path from settings panel - 4. Settings persist across app restarts (theme, editor preferences, binary path) - 5. Binary path is auto-detected from PATH with fallback to manual configuration -**Plans**: 3 plans - -Plans: -- [x] 11-01: Rename sweep (UI labels, shell scope, log path) -- [x] 11-02: Settings store + binary path resolution -- [x] 11-03: Settings panel UI + live preferences - -### Phase 12: YAML Editor Enhancements -**Goal**: Production-quality Monaco integration with autocomplete, error markers, and memory management -**Depends on**: Phase 11 -**Requirements**: EDIT-01, EDIT-02, EDIT-03, EDIT-04, EDIT-05, EDIT-06 -**Success Criteria** (what must be TRUE): - 1. User gets schema-driven autocomplete suggestions when typing rule field names - 2. User sees inline error markers (red squiggles) for YAML syntax violations and schema mismatches - 3. User can click errors in error panel to jump directly to the corresponding line - 4. User can format/indent YAML on save or via keyboard shortcut - 5. Editor properly disposes Monaco models and workers when switching between files (no memory leaks after 10+ file switches) -**Plans**: 3 plans - -Plans: -- [x] 12-01: Schema hardening + YAML formatting provider -- [x] 12-02: Memory management & disposal patterns -- [x] 12-03: Format-on-save + integration verification - -### Phase 13: Log Viewer -**Goal**: High-performance audit log visualization with virtual scrolling and filtering -**Depends on**: Phase 12 -**Requirements**: LOG-01, LOG-02, LOG-03, LOG-04, LOG-05, LOG-06, LOG-07 -**Success Criteria** (what must be TRUE): - 1. User can view audit log entries from `~/.claude/logs/rulez.log` in a scrollable list - 2. User can filter log entries by text content, severity level, and time range - 3. Log viewer renders 100K+ entries at 60fps with virtual scrolling - 4. User can export filtered log results to JSON or CSV files - 5. User can copy individual log entries to clipboard -**Plans**: 3 plans - -Plans: -- [x] 13-01: Rust log parsing command + TypeScript types + Tauri wiring -- [x] 13-02: Log viewer UI with virtual scrolling, filtering, and Zustand store -- [x] 13-03: Export (JSON/CSV) + clipboard copy + integration verification - -### Phase 14: Config Management -**Goal**: Multi-scope config handling with import/export and live reload -**Depends on**: Phase 13 -**Requirements**: CFG-01, CFG-02, CFG-03, CFG-04, CFG-05, CFG-06 -**Success Criteria** (what must be TRUE): - 1. User can switch between global and project configs with visual indicator of active scope - 2. User can import config files from disk with YAML validation before applying - 3. User can export current config to a file (preserving comments and formatting) - 4. User sees config precedence (project overrides global) clearly indicated in the UI - 5. Config changes auto-reload when the file is modified externally (debounced file watching) -**Plans**: 3 plans - -Plans: -- [x] 14-01: Scope indicators + config precedence UI -- [x] 14-02: Import/export with validation -- [x] 14-03: File watching + external change detection - -### Phase 15: Debug Simulator -**Goal**: Real binary integration with step-by-step rule evaluation traces -**Depends on**: Phase 14 -**Requirements**: DBG-01, DBG-02, DBG-03, DBG-04 -**Success Criteria** (what must be TRUE): - 1. User can run debug simulation using the real `rulez debug` binary (not mock data) - 2. User sees step-by-step rule evaluation trace showing which rules matched and why - 3. User can save debug test cases (event + expected result) for reuse - 4. User can load and replay saved test cases from previous sessions -**Plans**: 3 plans - -Plans: -- [x] 15-01: CLI `--json` flag + full event type support -- [x] 15-02: Save/load test cases -- [x] 15-03: Integration wiring + E2E test fixes - -### Phase 16: Onboarding -**Goal**: First-run wizard to guide new users through setup -**Depends on**: Phase 15 -**Requirements**: OB-01, OB-02, OB-03, OB-04, OB-05 -**Success Criteria** (what must be TRUE): - 1. First-time users see a setup wizard on initial app launch - 2. Wizard detects whether `rulez` binary is installed and accessible via PATH - 3. Wizard generates a sample `hooks.yaml` config with documented example rules - 4. Wizard guides user through a test simulation to verify setup works - 5. User can re-run onboarding wizard from settings panel -**Plans**: 2 plans - -Plans: -- [x] 16-01: Onboarding wizard foundation + UI -- [x] 16-02: Settings panel integration + verification - -### Phase 17: E2E Testing -**Goal**: Comprehensive Playwright E2E test coverage for all UI features -**Depends on**: Phase 16 -**Requirements**: E2E-01, E2E-02, E2E-03 -**Success Criteria** (what must be TRUE): - 1. All new UI features have Playwright E2E tests in web mode - 2. E2E tests cover editor, log viewer, config management, simulator, settings, and onboarding - 3. E2E test suite passes in CI (GitHub Actions) on ubuntu, macOS, and Windows -**Plans**: TBD - -Plans: -- [x] 17-01: Comprehensive Feature Test Coverage -- [x] 17-02: CI Integration & Cross-Platform Matrix - ---- - -## ✅ v1.7 Multi-Platform Hook Support (Complete) - -**Milestone Goal:** Integrate RuleZ with OpenCode, Gemini CLI, and Copilot hook surfaces. - -### Phase 18: OpenCode Plugin Integration -**Goal**: Integrate RuleZ with OpenCode plugin lifecycle for policy enforcement and audit logging -**Depends on**: Phase 17 -**Requirements**: OPENCODE-01, OPENCODE-02, OPENCODE-03, OPENCODE-04, OPENCODE-05, OPENCODE-06 -**Success Criteria** (what must be TRUE): - 1. OpenCode lifecycle events emit RuleZ hook events with mapped context - 2. RuleZ allow/deny/inject decisions are enforced in the OpenCode flow - 3. OpenCode exposes RuleZ tools for on-demand policy checks - 4. Plugin config loads from `~/.config/opencode/plugins/rulez-plugin/` - 5. All OpenCode-RuleZ interactions are logged to an audit trail with plugin metadata -**Plans**: 3 plans - -Plans: -- [x] 18-01: OpenCode Event Capture + RuleZ Payload Mapping -- [x] 18-02: Policy Enforcement + Tool Registration -- [x] 18-03: Plugin Config + Audit Logging +- ✅ **v1.6 RuleZ UI** — Phases 11-17 (shipped 2026-02-12) — [Archive](milestones/v1.6-ROADMAP.md) +- ✅ **v1.7 Multi-Platform Hook Support** — Phases 18-21 (shipped 2026-02-13) — [Archive](milestones/v1.7-ROADMAP.md) +- ✅ **v1.8 Tool Name Canonicalization** — Phase 22 (shipped 2026-02-22) — [Archive](milestones/v1.8-ROADMAP.md) +- ✅ **v1.9 Multi-CLI E2E Testing** — Phases 23, 25 (shipped 2026-03-05) — [Archive](milestones/v1.9-ROADMAP.md) +- ✅ **v2.0 RuleZ Cleanup and Hardening** — Phase 28 (shipped 2026-03-05) — [Archive](milestones/v2.0-ROADMAP.md) +- ✅ **v2.1 Multi-CLI E2E Testing (continued)** — Phases 24, 26, 27 (shipped 2026-03-09) — [Archive](milestones/v2.1-ROADMAP.md) +- ✅ **v2.2.0 Subagent Hooks, DX, Performance & Enterprise** — Phases 29-36 (shipped 2026-03-11) — [Archive](milestones/v2.2.0-ROADMAP.md) +- ✅ **v2.2.1 Cleanup, Sync Skills, CLI Help & UI Integration** — Phase 29 (shipped 2026-03-13) — [Archive](milestones/v2.2.1-ROADMAP.md) --- ## Progress -**Execution Order:** -Phases execute in numeric order: 11 → 12 → 13 → 14 → 15 → 16 → 17 → 18 → 19 → 20 → 21 - | Phase | Milestone | Plans Complete | Status | Completed | |-------|-----------|----------------|--------|-----------| -| 1. Inline Content Injection | v1.2 | 1/1 | ✅ Complete | 2026-02-06 | -| 2. Command-Based Context | v1.2 | 2/2 | ✅ Complete | 2026-02-06 | -| 3. Conditional Rule Activation | v1.2 | 3/3 | ✅ Complete | 2026-02-07 | -| 4. Prompt Matching | v1.3 | 4/4 | ✅ Complete | 2026-02-09 | -| 5. Field Validation | v1.3 | 3/3 | ✅ Complete | 2026-02-09 | -| 6. Inline Script Blocks | v1.3 | 3/3 | ✅ Complete | 2026-02-09 | -| 7. JSON Schema Validation | v1.4 | 2/2 | ✅ Complete | 2026-02-10 | -| 8. Debug CLI Enhancements | v1.4 | 2/2 | ✅ Complete | 2026-02-10 | -| 9. E2E Test Stabilization | v1.4 | 3/3 | ✅ Complete | 2026-02-10 | -| 10. Tauri CI Integration | v1.4 | 2/2 | ✅ Complete | 2026-02-10 | -| 11. Rename Fix + Settings Foundation | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | -| 12. YAML Editor Enhancements | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | -| 13. Log Viewer | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | -| 14. Config Management | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | -| 15. Debug Simulator | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | -| 16. Onboarding | v1.6 | 2/2 | ✅ Complete | 2026-02-12 | -| 17. E2E Testing | v1.6 | 2/2 | ✅ Complete | 2026-02-11 | -| 18. OpenCode Plugin Integration | v1.7 | 3/3 | ✅ Complete | 2026-02-13 | -| 19. Gemini Hook Support | v1.7 | 3/3 | Superseded by Phase 20 | 2026-02-12 | -| 20. Gemini CLI Support | v1.7 | 5/5 | ✅ Complete | 2026-02-12 | -| 21. Copilot CLI Support | v1.7 | 4/4 | ✅ Complete | 2026-02-13 | -| 22. Tool Name Canonicalization | v1.8 | 2/2 | ✅ Complete | 2026-02-20 | - -### Phase 19: Gemini hooks support (Superseded) - -**Goal:** Translate Gemini CLI hook events into RuleZ policy evaluation with install tooling and documentation. -**Depends on:** Phase 18 -**Status:** Superseded — all work absorbed into Phase 20 which expanded to 5 plans covering the full scope. - -Plans: -- [x] 19-01 — Absorbed into 20-01 (Gemini hook adapter + runner) -- [x] 19-02 — Absorbed into 20-03 (Gemini install + settings integration) -- [x] 19-03 — Absorbed into 20-05 (Gemini integration docs) - -### Phase 20: Gemini CLI support and Gemini hooks support - -**Goal:** Finalize Gemini CLI integration with full event coverage, install tooling, diagnostics, and documentation. -**Depends on:** Phase 18 -**Plans:** 5 plans — all complete - -Plans: -- [x] 20-01-PLAN.md — Gemini hook adapter + event mapping -- [x] 20-02-PLAN.md — Gemini hook runner subcommand -- [x] 20-03-PLAN.md — Gemini install command + settings integration -- [x] 20-04-PLAN.md — Gemini doctor diagnostics command -- [x] 20-05-PLAN.md — Gemini integration docs + examples - -### Phase 21: Copilot CLI support and Copilot hooks support - -**Goal:** Integrate RuleZ with Copilot CLI hooks and VS Code chat participant for policy enforcement and diagnostics. -**Depends on:** Phase 20 -**Plans:** 4 plans — all complete - -Plans: -- [x] 21-01-PLAN.md — Copilot hook adapter + response translation -- [x] 21-02-PLAN.md — Copilot hook runner subcommand -- [x] 21-03-PLAN.md — Copilot hook install + doctor + wrapper scripts + docs -- [x] 21-04-PLAN.md — VS Code Copilot chat participant + LM summary - -### Phase 22: Tool Name Canonicalization Across Platforms - -**Goal:** Normalize platform-specific tool names to Claude Code's PascalCase canonical names at adapter ingestion time, so rules with `tools:` matchers work identically across all platforms -**Depends on:** Phase 21 -**Plans:** 2 plans - -Plans: -- [x] 22-01-PLAN.md — Fix adapter compile errors, correct Gemini mappings, update all adapter tests -- [x] 22-02-PLAN.md — Create TOOL-MAPPING.md cross-platform reference documentation - ---- - -## ✅ v1.9 Multi-CLI E2E Testing (Partial) - -**Milestone Goal:** Headless multi-CLI E2E/UAT test harness validating real integration behavior across 5 agent CLIs. Each CLI gets its own phase with full E2E testing. RuleZ-only scope. - -**Shared context:** [E2E-CONTEXT.md](E2E-CONTEXT.md) - -**Note:** Phases 24, 26, 27 moved to v2.1 milestone for continued E2E work. - -### Phase 23: Claude Code CLI E2E Testing -**Goal**: Establish the E2E test harness framework + Claude Code scenarios (install, hook-fire, deny, inject) -**Depends on**: Phase 22 -**Success Criteria** (what must be TRUE): - 1. E2E harness framework exists at `e2e/` with isolated workspace management - 2. `task e2e` entry point runs all scenarios and produces reports - 3. Claude Code passes all 4 core scenarios (install, hook-fire, deny, inject) - 4. Console ASCII table, JUnit XML, and Markdown summary reports generated -**Plans**: 2 plans - -Plans: -- [x] 23-01-PLAN.md — E2E harness framework (workspace isolation, assertions, reporting, Taskfile integration) -- [x] 23-02-PLAN.md — Claude Code adapter, fixtures, and 4 E2E scenarios (install, hook-fire, deny, inject) - -### Phase 24: Gemini CLI E2E Testing -**Goal**: Add Gemini CLI adapter + scenarios to the existing E2E harness -**Depends on**: Phase 23 -**Success Criteria** (what must be TRUE): - 1. Gemini CLI passes all 4 core scenarios (install, hook-fire, deny, inject) - 2. Headless invocation works reliably in CI - 3. Reports include Gemini row in CLI x scenario matrix -**Plans**: 2 plans - -Plans: -- [x] 24-01-PLAN.md — Gemini adapter library, fixtures, and run.sh integration -- [x] 24-02-PLAN.md — 4 Gemini E2E scenarios (install, hook-fire, deny, inject) - -### Phase 25: Copilot CLI E2E Testing -**Goal**: Add Copilot CLI adapter + scenarios to the existing E2E harness -**Depends on**: Phase 23 -**Success Criteria** (what must be TRUE): - 1. Copilot CLI passes all 4 core scenarios (install, hook-fire, deny, inject) - 2. Headless invocation works reliably in CI - 3. Reports include Copilot row in CLI x scenario matrix -**Plans**: 3 plans (2 original + 1 gap closure) - -Plans: -- [x] 25-01-PLAN.md — Copilot adapter library, fixtures, and run.sh integration -- [x] 25-02-PLAN.md — 4 Copilot E2E scenarios (install, hook-fire, deny, inject) -- [x] 25-03-PLAN.md — Auth check gap closure: add authentication verification to copilot_adapter_check - -### Phase 26: OpenCode CLI E2E Testing -**Goal**: Add OpenCode CLI adapter + scenarios to the existing E2E harness -**Depends on**: Phase 23 -**Success Criteria** (what must be TRUE): - 1. OpenCode CLI passes all 4 core scenarios (install, hook-fire, deny, inject) - 2. Headless invocation works reliably in CI - 3. Reports include OpenCode row in CLI x scenario matrix -**Plans**: 1 plan (executed outside GSD workflow via PR #108) - -### Phase 27: Codex CLI E2E Testing -**Goal**: Add Codex CLI adapter + scenarios (NO hooks support — limited scenario set) -**Depends on**: Phase 23 -**Success Criteria** (what must be TRUE): - 1. Codex CLI passes available scenarios (hooks NOT supported — hook scenarios skipped, not failed) - 2. Headless invocation works reliably in CI - 3. Reports include Codex row with skip markers for unsupported scenarios -**Plans**: 1 plan - -Plans: -- [x] 27-01-PLAN.md — Codex adapter, fixtures, 4 scenarios (install + 3 skip stubs), and run.sh integration - ---- - -| 23. Claude Code CLI E2E Testing | v1.9 | 2/2 | ✅ Complete | 2026-02-23 | -| 25. Copilot CLI E2E Testing | v1.9 | 3/3 | ✅ Complete | 2026-02-23 | -| 24. Gemini CLI E2E Testing | v2.1 | 2/2 | ✅ Complete | 2026-02-23 | -| 26. OpenCode CLI E2E Testing | v2.1 | 1/1 | ✅ Complete | 2026-03-06 | -| 27. Codex CLI E2E Testing | v2.1 | 1/1 | ✅ Complete | 2026-03-09 | - -| 28. RuleZ Cleanup and Hardening | v2.0 | 8/8 | ✅ Complete | 2026-03-05 | - -### Phase 28: RuleZ Cleanup and Hardening -**Goal**: Fix critical bugs, improve engine performance, update skill docs, and add auto-upgrade capability — addresses all 9 pending todos -**Depends on**: Phase 22 (no dependency on E2E phases 23-27) -**Success Criteria** (what must be TRUE): - 1. Invalid regex in command_match returns non-match (not silent match-all) and validates at startup - 2. Config cache invalidated when hooks.yaml changes (timestamp or CRC check) - 3. `rulez debug` exercises run action scripts identically to live hook path - 4. tool_input fields exposed in enabled_when eval context (source, command, path, etc.) - 5. Naive matchers replaced with globset crate for correct glob patterns - 6. Regex compilation cached with LRU + config cached with file-change invalidation - 7. Parallel rule evaluation available for large rule sets - 8. Log filtering offloaded to Web Worker or Rust command - 9. mastering-hooks skill docs use correct field names matching RuleZ binary schema - 10. `rulez upgrade` or equivalent auto-checks and upgrades binary to latest release -**Plans**: 8 plans - -Plans: -- [x] 28-01-PLAN.md — Regex fail-closed fix: 5 call sites in hooks.rs + debug.rs + command_match validation in config.rs -- [x] 28-02-PLAN.md — Fix mastering-hooks skill docs: 7 field name mismatches in hooks-yaml-schema.md + rule-patterns.md -- [x] 28-03-PLAN.md — tool_input fields in enabled_when eval context + mtime-based config cache -- [x] 28-04-PLAN.md — Fix debug run script trace: enrich JSON evaluations with action results -- [x] 28-05-PLAN.md — Replace naive contains() directory matching with globset crate -- [x] 28-06-PLAN.md — rulez upgrade subcommand using self_update crate -- [x] 28-07-PLAN.md — UI log filter debounce (200ms) in rulez-ui logStore + LogViewer -- [x] 28-08-PLAN.md — Parallel rule evaluation using tokio join_all for large rule sets - ---- - -## ✅ v2.0 RuleZ Cleanup and Hardening (Complete) - -**Milestone Goal:** Fix critical bugs, improve engine performance, update skill docs, and add auto-upgrade capability — addresses all 9 pending todos. - -Phase 28 complete — all 8 plans executed across 4 waves. See Phase 28 section above. - ---- - -## ✅ v2.1 Multi-CLI E2E Testing (Continued) — Complete - -**Milestone Goal:** Complete remaining CLI E2E testing for Gemini, OpenCode, and Codex. +| 1-3 | v1.2 | 6/6 | ✅ Complete | 2026-02-07 | +| 4-6 | v1.3 | 10/10 | ✅ Complete | 2026-02-10 | +| 7-10 | v1.4 | 9/9 | ✅ Complete | 2026-02-10 | +| 11-17 | v1.6 | 19/19 | ✅ Complete | 2026-02-12 | +| 18-21 | v1.7 | 15/15 | ✅ Complete | 2026-02-13 | +| 22 | v1.8 | 2/2 | ✅ Complete | 2026-02-22 | +| 23, 25 | v1.9 | 5/5 | ✅ Complete | 2026-03-05 | +| 28 | v2.0 | 8/8 | ✅ Complete | 2026-03-05 | +| 24, 26, 27 | v2.1 | 4/4 | ✅ Complete | 2026-03-09 | +| 29 | v2.2.1 | 2/2 | ✅ Complete | 2026-03-13 | -Phases 24, 26, 27 moved from v1.9 — all three phases complete. +**Total:** 29 phases, 80 plans, all complete across 11 milestones. --- -*Created 2026-02-06 — Updated 2026-03-09 v2.1 milestone complete (Phases 24, 26, 27 all done).* +*Created 2026-02-06 — Updated 2026-03-13 v2.2.1 milestone complete.* diff --git a/.planning/STATE.md b/.planning/STATE.md index 1302eb1b..26383b60 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -1,51 +1,46 @@ --- gsd_state_version: 1.0 -milestone: v2.1 -milestone_name: Multi-CLI E2E Testing +milestone: v2.2.1 +milestone_name: Cleanup, Sync Skills, CLI Help & UI Integration status: completed -stopped_at: All milestones complete — releasing v2.1.0 -last_updated: "2026-03-10T00:00:00.000Z" -last_activity: "2026-03-10 — v2.1.0 release prep: GSD sync, changelog, version bump" +stopped_at: v2.2.1 milestone complete +last_updated: "2026-03-13T00:30:00.000Z" +last_activity: "2026-03-13 — v2.2.1 milestone complete, preparing release" progress: - total_phases: 28 - completed_phases: 28 - total_plans: 78 - completed_plans: 78 + total_phases: 29 + completed_phases: 29 + total_plans: 80 + completed_plans: 80 --- # Project State ## Project Reference -See: .planning/PROJECT.md (updated 2026-02-12) +See: .planning/PROJECT.md (updated 2026-03-13) **Core value:** LLMs do not enforce policy. LLMs are subject to policy. -**Current focus:** All milestones complete (v1.2 through v2.1). Releasing v2.1.0. +**Current focus:** v2.2.1 complete — preparing release. +**v2.2.1:** Cleanup, Sync Skills, CLI Help & UI Integration — COMPLETE (Phase 29, shipped 2026-03-13) **v2.1:** Multi-CLI E2E Testing (continued) — COMPLETE (Phases 24, 26, 27, shipped 2026-03-09) **v2.0:** RuleZ Cleanup and Hardening — COMPLETE (Phase 28, shipped 2026-03-05) -**v1.9:** Multi-CLI E2E Testing (partial) — COMPLETE (Phases 23, 25, shipped 2026-03-05) -**v1.8:** Tool Name Canonicalization — COMPLETE (Phase 22, shipped 2026-02-22) -**v1.7:** Multi-Platform Hook Support — COMPLETE (all phases 18-21 done) -**v1.6:** RuleZ UI — COMPLETE (all phases 11-17 done) ## Current Position -Milestone: v2.1 — Multi-CLI E2E Testing — COMPLETE -All 28 phases across 10 milestones are complete. -All 78 plans executed successfully. -Status: Releasing v2.1.0 -Last activity: 2026-03-10 — v2.1.0 release prep +Milestone: v2.2.1 — Cleanup, Sync Skills, CLI Help & UI Integration — COMPLETE +All 29 phases across 11 milestones are complete. +All 80 plans executed successfully. +Status: Releasing v2.2.1 +Last activity: 2026-03-13 — v2.2.1 milestone complete -Next action: Tag and release v2.1.0 +Next action: Cut v2.2.1 release ## Performance Metrics **Velocity (all milestones):** -- Total plans completed: 78 +- Total plans completed: 80 - Average duration: ~3min per plan -- v1.5.0 released 2026-02-11 (first successful cross-platform binary release) -- v2.0.0 released 2026-03-05 (cleanup and hardening) -- v2.1.0 releasing 2026-03-10 (multi-CLI E2E complete) +- v2.2.1 releasing 2026-03-13 **By Milestone:** @@ -60,35 +55,20 @@ Next action: Tag and release v2.1.0 | v1.9 | 2 | 5 | Complete | 2026-03-05 | | v2.0 | 1 | 8 | Complete | 2026-03-05 | | v2.1 | 3 | 4 | Complete | 2026-03-09 | - -**Recent Trend:** -- v2.0 shipped in 1 day (8 plans across 4 waves) -- v2.1 shipped in 4 days (4 plans across 3 phases) -- All milestones complete, project in maintenance mode +| v2.2.1 | 1 | 2 | Complete | 2026-03-13 | ## Accumulated Context -### Roadmap Evolution - -- Phase 19 added: Gemini hooks support -- Phase 20 added: Gemini CLI support and Gemini hooks support -- Phase 21 added: Copilot CLI support and Copilot hooks support -- Phase 22 added: Tool Name Canonicalization Across Platforms -- Phases 23-27 added: Multi-CLI E2E Testing (Claude Code, Gemini, Copilot, OpenCode, Codex) -- Phase 28 added: RuleZ Cleanup and Hardening (all 9 pending todos: regex bug, debug bug, tool_input eval, globset, caching, parallel eval, log worker, skill docs, auto-upgrade) - ### Pending Todos - [ ] Offload Log Filtering to Web Worker or Rust (ui) — deferred, low priority -All other todos resolved in Phase 28. - ### Blockers/Concerns None active. ## Session Continuity -Last session: 2026-03-10 -Stopped at: v2.1.0 release -Next action: Release v2.1.0 +Last session: 2026-03-13 +Stopped at: v2.2.1 milestone complete +Next action: Cut v2.2.1 release diff --git a/.planning/milestones/v2.2.1-REQUIREMENTS.md b/.planning/milestones/v2.2.1-REQUIREMENTS.md new file mode 100644 index 00000000..268848e6 --- /dev/null +++ b/.planning/milestones/v2.2.1-REQUIREMENTS.md @@ -0,0 +1,202 @@ +# Requirements Archive: v2.2.1 Cleanup, Sync Skills, CLI Help & UI Integration + +**Archived:** 2026-03-13 +**Status:** SHIPPED + +For current requirements, see `.planning/REQUIREMENTS.md`. + +--- + +# Requirements: RuleZ UI v1.6 + +**Defined:** 2026-02-11 +**Core Value:** LLMs do not enforce policy. LLMs are subject to policy. + +## v1.6 Requirements + +Requirements for the RuleZ UI milestone. Each maps to roadmap phases. + +### Rename Fix + +- [ ] **RENAME-01**: User sees `rulez` (not `cch`) in all UI labels, commands, and config paths +- [ ] **RENAME-02**: Tauri backend invokes `rulez` binary (not `cch`) for debug and validation commands +- [ ] **RENAME-03**: Log file path defaults to `~/.claude/logs/rulez.log` (not `cch.log`) + +### YAML Editor + +- [ ] **EDIT-01**: User gets schema-driven autocomplete suggestions when typing YAML rule fields +- [ ] **EDIT-02**: User sees inline error markers (red squiggles) for invalid YAML syntax and schema violations +- [ ] **EDIT-03**: User can click errors in an error panel to jump to the corresponding line +- [ ] **EDIT-04**: User can format/indent YAML on save or via keyboard shortcut +- [ ] **EDIT-05**: Editor properly disposes Monaco models and workers when switching files (no memory leaks) +- [ ] **EDIT-06**: User sees a live preview panel showing parsed rules with matched event types and actions + +### Log Viewer + +- [ ] **LOG-01**: User can view audit log entries from `~/.claude/logs/rulez.log` in a scrollable list +- [ ] **LOG-02**: User can search/filter log entries by text content +- [ ] **LOG-03**: User can filter log entries by severity level (error, warn, info, debug) +- [ ] **LOG-04**: User can filter log entries by time range (date picker) +- [ ] **LOG-05**: Log viewer handles large files (100K+ entries) with virtual scrolling at 60fps +- [ ] **LOG-06**: User can export filtered log results to a file (JSON/CSV) +- [ ] **LOG-07**: User can copy individual log entries to clipboard + +### Config Management + +- [ ] **CFG-01**: User can switch between global (`~/.claude/hooks.yaml`) and project (`.claude/hooks.yaml`) configs +- [ ] **CFG-02**: User sees visual indicator of which config scope is active (global vs project) +- [ ] **CFG-03**: User can import a config file from disk (file picker, YAML validated before applying) +- [ ] **CFG-04**: User can export current config to a file +- [ ] **CFG-05**: User sees config precedence (project overrides global) clearly indicated in the UI +- [ ] **CFG-06**: Config changes auto-reload when the file is modified externally (file watching with debounce) + +### Debug Simulator + +- [ ] **DBG-01**: User can run debug simulation using the real `rulez debug` binary (not mock data) +- [ ] **DBG-02**: User sees step-by-step rule evaluation trace showing which rules matched and why +- [ ] **DBG-03**: User can save debug test cases (event + expected result) for reuse +- [ ] **DBG-04**: User can load and replay saved test cases +- [ ] **DBG-05**: Binary path is auto-detected from PATH with fallback to manual configuration + +### Settings + +- [ ] **SET-01**: User can toggle theme (light/dark/system) from a settings panel +- [ ] **SET-02**: User can configure editor font size and tab size +- [ ] **SET-03**: User can configure the path to the `rulez` binary +- [ ] **SET-04**: Settings persist across app restarts (Tauri store or equivalent) + +### Onboarding + +- [ ] **OB-01**: First-time users see a setup wizard on initial app launch +- [ ] **OB-02**: Wizard detects whether `rulez` binary is installed and accessible +- [ ] **OB-03**: Wizard generates a sample `hooks.yaml` config with documented example rules +- [ ] **OB-04**: Wizard guides user through a test simulation to verify setup works +- [ ] **OB-05**: User can re-run onboarding from settings panel + +### E2E Testing + +- [ ] **E2E-01**: All new UI features have Playwright E2E tests in web mode +- [ ] **E2E-02**: E2E tests cover editor, log viewer, config management, simulator, settings, and onboarding +- [ ] **E2E-03**: E2E test suite passes in CI (GitHub Actions) on ubuntu, macOS, and Windows + +## Future Requirements (v1.7+) + +### OpenCode Plugin Integration + +- [ ] **OPENCODE-01**: Emit RuleZ hook events from OpenCode plugin lifecycle (file.edited, tool.execute.before/after, session.updated) +- [ ] **OPENCODE-02**: Map OpenCode event context (project, directory, worktree, client SDK, shell $) to RuleZ event payload +- [ ] **OPENCODE-03**: Inject RuleZ responses (block/allow, inject context) back into OpenCode plugin flow +- [ ] **OPENCODE-04**: Register custom OpenCode tools that invoke RuleZ binary for policy checks +- [ ] **OPENCODE-05**: Support OpenCode plugin config (`~/.config/opencode/plugins/rulez-plugin/`) +- [ ] **OPENCODE-06**: Log all OpenCode-RuleZ interactions to audit trail with plugin metadata + +### Gemini CLI Hook Integration + +- [ ] **GEMINI-01**: Detect Gemini CLI hook events (write_file, replace, afterAgent) and translate to RuleZ format +- [ ] **GEMINI-02**: Map Gemini CLI hook matchers to RuleZ event types (PreToolUse, PostToolUse equivalents) +- [ ] **GEMINI-03**: Return structured JSON responses matching Gemini CLI hook response schema (deny/allow with reason) +- [ ] **GEMINI-04**: Support Gemini CLI extensions that bundle RuleZ hooks (`~/.gemini/hooks/`) +- [ ] **GEMINI-05**: Enable secret scanning and iterative loop patterns via RuleZ rules (e.g., "Ralph loop") +- [ ] **GEMINI-06**: Document Gemini CLI→RuleZ translation layer with installation guide + +### GitHub Copilot Extension Integration + +- [ ] **COPILOT-01**: Create VS Code Copilot Chat participant that queries RuleZ for policy decisions +- [ ] **COPILOT-02**: Integrate RuleZ with Copilot Language Model API for inline chat policy checks +- [ ] **COPILOT-03**: Support slash commands in Copilot Chat that trigger RuleZ debug/explain/validate +- [ ] **COPILOT-04**: Inject RuleZ context into Copilot prompts via Chat API message attachments +- [ ] **COPILOT-05**: Block/warn on Copilot code suggestions that violate RuleZ policies (pre-acceptance hook) +- [ ] **COPILOT-06**: Log all Copilot-RuleZ interactions to audit trail with extension metadata +- [ ] **COPILOT-07**: Publish VS Code extension to marketplace with RuleZ binary bundled or auto-downloaded + +## Future Requirements (v2+) + +### Deferred Differentiators + +- **DIFF-01**: Rule-to-log correlation (click log entry to see which rule fired) — requires log format changes +- **DIFF-02**: Replay saved events from logs (time-travel debugging) +- **DIFF-03**: Multi-config comparison with Monaco diff editor +- **DIFF-04**: Real-time log streaming (live tail in UI) + +### Out of Scope + +| Feature | Reason | +|---------|--------| +| Visual rule builder (drag-drop) | Conflicts with YAML-first design philosophy | +| AI-powered rule suggestions | Requires LLM integration, out of scope for desktop tool | +| Cloud sync for configs | Adds auth/server complexity, use git instead | +| Mobile app | Web-first approach, desktop is primary | +| Script sandboxing UI | Cross-platform complexity, defer to v2+ | + +## Traceability + +| Requirement | Phase | Status | +|-------------|-------|--------| +| RENAME-01 | Phase 11 | Pending | +| RENAME-02 | Phase 11 | Pending | +| RENAME-03 | Phase 11 | Pending | +| SET-01 | Phase 11 | Pending | +| SET-02 | Phase 11 | Pending | +| SET-03 | Phase 11 | Pending | +| SET-04 | Phase 11 | Pending | +| DBG-05 | Phase 11 | Pending | +| EDIT-01 | Phase 12 | Pending | +| EDIT-02 | Phase 12 | Pending | +| EDIT-03 | Phase 12 | Pending | +| EDIT-04 | Phase 12 | Pending | +| EDIT-05 | Phase 12 | Pending | +| EDIT-06 | Phase 12 | Pending | +| LOG-01 | Phase 13 | Pending | +| LOG-02 | Phase 13 | Pending | +| LOG-03 | Phase 13 | Pending | +| LOG-04 | Phase 13 | Pending | +| LOG-05 | Phase 13 | Pending | +| LOG-06 | Phase 13 | Pending | +| LOG-07 | Phase 13 | Pending | +| CFG-01 | Phase 14 | Pending | +| CFG-02 | Phase 14 | Pending | +| CFG-03 | Phase 14 | Pending | +| CFG-04 | Phase 14 | Pending | +| CFG-05 | Phase 14 | Pending | +| CFG-06 | Phase 14 | Pending | +| DBG-01 | Phase 15 | Pending | +| DBG-02 | Phase 15 | Pending | +| DBG-03 | Phase 15 | Pending | +| DBG-04 | Phase 15 | Pending | +| OB-01 | Phase 16 | Pending | +| OB-02 | Phase 16 | Pending | +| OB-03 | Phase 16 | Pending | +| OB-04 | Phase 16 | Pending | +| OB-05 | Phase 16 | Pending | +| E2E-01 | Phase 17 | Pending | +| E2E-02 | Phase 17 | Pending | +| E2E-03 | Phase 17 | Pending | +| OPENCODE-01 | Phase 18 | Pending | +| OPENCODE-02 | Phase 18 | Pending | +| OPENCODE-03 | Phase 18 | Pending | +| OPENCODE-04 | Phase 18 | Pending | +| OPENCODE-05 | Phase 18 | Pending | +| OPENCODE-06 | Phase 18 | Pending | +| GEMINI-01 | Phase 19 | Pending | +| GEMINI-02 | Phase 19 | Pending | +| GEMINI-03 | Phase 19 | Pending | +| GEMINI-04 | Phase 19 | Pending | +| GEMINI-05 | Phase 19 | Pending | +| GEMINI-06 | Phase 19 | Pending | +| COPILOT-01 | Phase 20 | Pending | +| COPILOT-02 | Phase 20 | Pending | +| COPILOT-03 | Phase 20 | Pending | +| COPILOT-04 | Phase 20 | Pending | +| COPILOT-05 | Phase 20 | Pending | +| COPILOT-06 | Phase 20 | Pending | +| COPILOT-07 | Phase 20 | Pending | + +**Coverage:** +- v1.6 requirements: 38 total +- v1.7 requirements: 19 total (6 OpenCode + 6 Gemini + 7 Copilot) +- Mapped to phases: 57/57 (100%) +- Unmapped: 0 + +--- +*Requirements defined: 2026-02-11* +*Last updated: 2026-02-11 after v1.7 phases added* diff --git a/.planning/milestones/v2.2.1-ROADMAP.md b/.planning/milestones/v2.2.1-ROADMAP.md new file mode 100644 index 00000000..b9ba97cc --- /dev/null +++ b/.planning/milestones/v2.2.1-ROADMAP.md @@ -0,0 +1,435 @@ +# RuleZ Roadmap + +**Current Focus:** All milestones complete (v1.2–v2.1). Releasing v2.1.0. + +--- + +## Milestones + +- ✅ **v1.2 P2 Features** — Phases 1-3 (shipped 2026-02-07) — [Archive](milestones/v1.2-ROADMAP.md) +- ✅ **v1.3 Advanced Matching & Validation** — Phases 4-6 (shipped 2026-02-10) — [Archive](milestones/v1.3-ROADMAP.md) +- ✅ **v1.4 Stability & Polish** — Phases 7-10 (shipped 2026-02-10) — [Archive](milestones/v1.4-ROADMAP.md) +- ✅ **v1.6 RuleZ UI** — Phases 11-17 (shipped 2026-02-12) +- ✅ **v1.7 Multi-Platform Hook Support** — Phases 18-21 (shipped 2026-02-13) +- ✅ **v1.8 Tool Name Canonicalization** — Phase 22 (shipped 2026-02-22) +- ✅ **v1.9 Multi-CLI E2E Testing** — Phases 23, 25 (shipped 2026-03-05) +- ✅ **v2.0 RuleZ Cleanup and Hardening** — Phase 28 (shipped 2026-03-05) +- ✅ **v2.1 Multi-CLI E2E Testing (continued)** — Phases 24, 26, 27 (shipped 2026-03-09) + +--- + +
+✅ v1.2 P2 Features (Phases 1-3) — SHIPPED 2026-02-07 + +### Phase 1: Inline Content Injection +- [x] 1/1 plans — inject_inline field + +### Phase 2: Command-Based Context Generation +- [x] 2/2 plans — inject_command field + +### Phase 3: Conditional Rule Activation +- [x] 3/3 plans — enabled_when field + +See [v1.2-ROADMAP.md](milestones/v1.2-ROADMAP.md) for full details. + +
+ +
+✅ v1.3 Advanced Matching & Validation (Phases 4-6) — SHIPPED 2026-02-10 + +### Phase 4: Prompt Matching +- [x] 4/4 plans — regex intent routing with AND/OR logic + +### Phase 5: Field Validation +- [x] 3/3 plans — fail-closed field existence and type checks + +### Phase 6: Inline Script Blocks +- [x] 3/3 plans — evalexpr expressions and shell scripts in YAML + +See [v1.3-ROADMAP.md](milestones/v1.3-ROADMAP.md) for full details. + +
+ +
+✅ v1.4 Stability & Polish (Phases 7-10) — SHIPPED 2026-02-10 + +### Phase 7: JSON Schema Validation +- [x] 2/2 plans — fail-open schema validation with <0.1ms overhead + +### Phase 8: Debug CLI Enhancements +- [x] 2/2 plans — UserPromptSubmit support, LRU regex cache + +### Phase 9: E2E Test Stabilization +- [x] 3/3 plans — canonical paths, symlink tests, CI matrix + +### Phase 10: Tauri CI Integration +- [x] 2/2 plans — E2E gate + multi-platform desktop builds + +See [v1.4-ROADMAP.md](milestones/v1.4-ROADMAP.md) for full details. + +
+ +--- + +## ✅ v1.6 RuleZ UI (Complete) + +**Milestone Goal:** Production-ready desktop UI for RuleZ policy management with log viewer, config management, debug simulator, and onboarding. + +### Phase 11: Rename Fix + Settings Foundation +**Goal**: Fix cch→rulez binary references and establish settings infrastructure for all features +**Depends on**: Phase 10 +**Requirements**: RENAME-01, RENAME-02, RENAME-03, SET-01, SET-02, SET-03, SET-04, DBG-05 +**Success Criteria** (what must be TRUE): + 1. User sees "rulez" (not "cch") in all UI labels, button text, and window titles + 2. Tauri backend invokes `rulez debug` and `rulez validate` successfully + 3. User can configure theme, editor font size, and binary path from settings panel + 4. Settings persist across app restarts (theme, editor preferences, binary path) + 5. Binary path is auto-detected from PATH with fallback to manual configuration +**Plans**: 3 plans + +Plans: +- [x] 11-01: Rename sweep (UI labels, shell scope, log path) +- [x] 11-02: Settings store + binary path resolution +- [x] 11-03: Settings panel UI + live preferences + +### Phase 12: YAML Editor Enhancements +**Goal**: Production-quality Monaco integration with autocomplete, error markers, and memory management +**Depends on**: Phase 11 +**Requirements**: EDIT-01, EDIT-02, EDIT-03, EDIT-04, EDIT-05, EDIT-06 +**Success Criteria** (what must be TRUE): + 1. User gets schema-driven autocomplete suggestions when typing rule field names + 2. User sees inline error markers (red squiggles) for YAML syntax violations and schema mismatches + 3. User can click errors in error panel to jump directly to the corresponding line + 4. User can format/indent YAML on save or via keyboard shortcut + 5. Editor properly disposes Monaco models and workers when switching between files (no memory leaks after 10+ file switches) +**Plans**: 3 plans + +Plans: +- [x] 12-01: Schema hardening + YAML formatting provider +- [x] 12-02: Memory management & disposal patterns +- [x] 12-03: Format-on-save + integration verification + +### Phase 13: Log Viewer +**Goal**: High-performance audit log visualization with virtual scrolling and filtering +**Depends on**: Phase 12 +**Requirements**: LOG-01, LOG-02, LOG-03, LOG-04, LOG-05, LOG-06, LOG-07 +**Success Criteria** (what must be TRUE): + 1. User can view audit log entries from `~/.claude/logs/rulez.log` in a scrollable list + 2. User can filter log entries by text content, severity level, and time range + 3. Log viewer renders 100K+ entries at 60fps with virtual scrolling + 4. User can export filtered log results to JSON or CSV files + 5. User can copy individual log entries to clipboard +**Plans**: 3 plans + +Plans: +- [x] 13-01: Rust log parsing command + TypeScript types + Tauri wiring +- [x] 13-02: Log viewer UI with virtual scrolling, filtering, and Zustand store +- [x] 13-03: Export (JSON/CSV) + clipboard copy + integration verification + +### Phase 14: Config Management +**Goal**: Multi-scope config handling with import/export and live reload +**Depends on**: Phase 13 +**Requirements**: CFG-01, CFG-02, CFG-03, CFG-04, CFG-05, CFG-06 +**Success Criteria** (what must be TRUE): + 1. User can switch between global and project configs with visual indicator of active scope + 2. User can import config files from disk with YAML validation before applying + 3. User can export current config to a file (preserving comments and formatting) + 4. User sees config precedence (project overrides global) clearly indicated in the UI + 5. Config changes auto-reload when the file is modified externally (debounced file watching) +**Plans**: 3 plans + +Plans: +- [x] 14-01: Scope indicators + config precedence UI +- [x] 14-02: Import/export with validation +- [x] 14-03: File watching + external change detection + +### Phase 15: Debug Simulator +**Goal**: Real binary integration with step-by-step rule evaluation traces +**Depends on**: Phase 14 +**Requirements**: DBG-01, DBG-02, DBG-03, DBG-04 +**Success Criteria** (what must be TRUE): + 1. User can run debug simulation using the real `rulez debug` binary (not mock data) + 2. User sees step-by-step rule evaluation trace showing which rules matched and why + 3. User can save debug test cases (event + expected result) for reuse + 4. User can load and replay saved test cases from previous sessions +**Plans**: 3 plans + +Plans: +- [x] 15-01: CLI `--json` flag + full event type support +- [x] 15-02: Save/load test cases +- [x] 15-03: Integration wiring + E2E test fixes + +### Phase 16: Onboarding +**Goal**: First-run wizard to guide new users through setup +**Depends on**: Phase 15 +**Requirements**: OB-01, OB-02, OB-03, OB-04, OB-05 +**Success Criteria** (what must be TRUE): + 1. First-time users see a setup wizard on initial app launch + 2. Wizard detects whether `rulez` binary is installed and accessible via PATH + 3. Wizard generates a sample `hooks.yaml` config with documented example rules + 4. Wizard guides user through a test simulation to verify setup works + 5. User can re-run onboarding wizard from settings panel +**Plans**: 2 plans + +Plans: +- [x] 16-01: Onboarding wizard foundation + UI +- [x] 16-02: Settings panel integration + verification + +### Phase 17: E2E Testing +**Goal**: Comprehensive Playwright E2E test coverage for all UI features +**Depends on**: Phase 16 +**Requirements**: E2E-01, E2E-02, E2E-03 +**Success Criteria** (what must be TRUE): + 1. All new UI features have Playwright E2E tests in web mode + 2. E2E tests cover editor, log viewer, config management, simulator, settings, and onboarding + 3. E2E test suite passes in CI (GitHub Actions) on ubuntu, macOS, and Windows +**Plans**: TBD + +Plans: +- [x] 17-01: Comprehensive Feature Test Coverage +- [x] 17-02: CI Integration & Cross-Platform Matrix + +--- + +## ✅ v1.7 Multi-Platform Hook Support (Complete) + +**Milestone Goal:** Integrate RuleZ with OpenCode, Gemini CLI, and Copilot hook surfaces. + +### Phase 18: OpenCode Plugin Integration +**Goal**: Integrate RuleZ with OpenCode plugin lifecycle for policy enforcement and audit logging +**Depends on**: Phase 17 +**Requirements**: OPENCODE-01, OPENCODE-02, OPENCODE-03, OPENCODE-04, OPENCODE-05, OPENCODE-06 +**Success Criteria** (what must be TRUE): + 1. OpenCode lifecycle events emit RuleZ hook events with mapped context + 2. RuleZ allow/deny/inject decisions are enforced in the OpenCode flow + 3. OpenCode exposes RuleZ tools for on-demand policy checks + 4. Plugin config loads from `~/.config/opencode/plugins/rulez-plugin/` + 5. All OpenCode-RuleZ interactions are logged to an audit trail with plugin metadata +**Plans**: 3 plans + +Plans: +- [x] 18-01: OpenCode Event Capture + RuleZ Payload Mapping +- [x] 18-02: Policy Enforcement + Tool Registration +- [x] 18-03: Plugin Config + Audit Logging + +--- + +## Progress + +**Execution Order:** +Phases execute in numeric order: 11 → 12 → 13 → 14 → 15 → 16 → 17 → 18 → 19 → 20 → 21 + +| Phase | Milestone | Plans Complete | Status | Completed | +|-------|-----------|----------------|--------|-----------| +| 1. Inline Content Injection | v1.2 | 1/1 | ✅ Complete | 2026-02-06 | +| 2. Command-Based Context | v1.2 | 2/2 | ✅ Complete | 2026-02-06 | +| 3. Conditional Rule Activation | v1.2 | 3/3 | ✅ Complete | 2026-02-07 | +| 4. Prompt Matching | v1.3 | 4/4 | ✅ Complete | 2026-02-09 | +| 5. Field Validation | v1.3 | 3/3 | ✅ Complete | 2026-02-09 | +| 6. Inline Script Blocks | v1.3 | 3/3 | ✅ Complete | 2026-02-09 | +| 7. JSON Schema Validation | v1.4 | 2/2 | ✅ Complete | 2026-02-10 | +| 8. Debug CLI Enhancements | v1.4 | 2/2 | ✅ Complete | 2026-02-10 | +| 9. E2E Test Stabilization | v1.4 | 3/3 | ✅ Complete | 2026-02-10 | +| 10. Tauri CI Integration | v1.4 | 2/2 | ✅ Complete | 2026-02-10 | +| 11. Rename Fix + Settings Foundation | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | +| 12. YAML Editor Enhancements | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | +| 13. Log Viewer | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | +| 14. Config Management | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | +| 15. Debug Simulator | v1.6 | 3/3 | ✅ Complete | 2026-02-12 | +| 16. Onboarding | v1.6 | 2/2 | ✅ Complete | 2026-02-12 | +| 17. E2E Testing | v1.6 | 2/2 | ✅ Complete | 2026-02-11 | +| 18. OpenCode Plugin Integration | v1.7 | 3/3 | ✅ Complete | 2026-02-13 | +| 19. Gemini Hook Support | v1.7 | 3/3 | Superseded by Phase 20 | 2026-02-12 | +| 20. Gemini CLI Support | v1.7 | 5/5 | ✅ Complete | 2026-02-12 | +| 21. Copilot CLI Support | v1.7 | 4/4 | ✅ Complete | 2026-02-13 | +| 22. Tool Name Canonicalization | v1.8 | 2/2 | ✅ Complete | 2026-02-20 | + +### Phase 19: Gemini hooks support (Superseded) + +**Goal:** Translate Gemini CLI hook events into RuleZ policy evaluation with install tooling and documentation. +**Depends on:** Phase 18 +**Status:** Superseded — all work absorbed into Phase 20 which expanded to 5 plans covering the full scope. + +Plans: +- [x] 19-01 — Absorbed into 20-01 (Gemini hook adapter + runner) +- [x] 19-02 — Absorbed into 20-03 (Gemini install + settings integration) +- [x] 19-03 — Absorbed into 20-05 (Gemini integration docs) + +### Phase 20: Gemini CLI support and Gemini hooks support + +**Goal:** Finalize Gemini CLI integration with full event coverage, install tooling, diagnostics, and documentation. +**Depends on:** Phase 18 +**Plans:** 5 plans — all complete + +Plans: +- [x] 20-01-PLAN.md — Gemini hook adapter + event mapping +- [x] 20-02-PLAN.md — Gemini hook runner subcommand +- [x] 20-03-PLAN.md — Gemini install command + settings integration +- [x] 20-04-PLAN.md — Gemini doctor diagnostics command +- [x] 20-05-PLAN.md — Gemini integration docs + examples + +### Phase 21: Copilot CLI support and Copilot hooks support + +**Goal:** Integrate RuleZ with Copilot CLI hooks and VS Code chat participant for policy enforcement and diagnostics. +**Depends on:** Phase 20 +**Plans:** 4 plans — all complete + +Plans: +- [x] 21-01-PLAN.md — Copilot hook adapter + response translation +- [x] 21-02-PLAN.md — Copilot hook runner subcommand +- [x] 21-03-PLAN.md — Copilot hook install + doctor + wrapper scripts + docs +- [x] 21-04-PLAN.md — VS Code Copilot chat participant + LM summary + +### Phase 22: Tool Name Canonicalization Across Platforms + +**Goal:** Normalize platform-specific tool names to Claude Code's PascalCase canonical names at adapter ingestion time, so rules with `tools:` matchers work identically across all platforms +**Depends on:** Phase 21 +**Plans:** 2 plans + +Plans: +- [x] 22-01-PLAN.md — Fix adapter compile errors, correct Gemini mappings, update all adapter tests +- [x] 22-02-PLAN.md — Create TOOL-MAPPING.md cross-platform reference documentation + +--- + +## ✅ v1.9 Multi-CLI E2E Testing (Partial) + +**Milestone Goal:** Headless multi-CLI E2E/UAT test harness validating real integration behavior across 5 agent CLIs. Each CLI gets its own phase with full E2E testing. RuleZ-only scope. + +**Shared context:** [E2E-CONTEXT.md](E2E-CONTEXT.md) + +**Note:** Phases 24, 26, 27 moved to v2.1 milestone for continued E2E work. + +### Phase 23: Claude Code CLI E2E Testing +**Goal**: Establish the E2E test harness framework + Claude Code scenarios (install, hook-fire, deny, inject) +**Depends on**: Phase 22 +**Success Criteria** (what must be TRUE): + 1. E2E harness framework exists at `e2e/` with isolated workspace management + 2. `task e2e` entry point runs all scenarios and produces reports + 3. Claude Code passes all 4 core scenarios (install, hook-fire, deny, inject) + 4. Console ASCII table, JUnit XML, and Markdown summary reports generated +**Plans**: 2 plans + +Plans: +- [x] 23-01-PLAN.md — E2E harness framework (workspace isolation, assertions, reporting, Taskfile integration) +- [x] 23-02-PLAN.md — Claude Code adapter, fixtures, and 4 E2E scenarios (install, hook-fire, deny, inject) + +### Phase 24: Gemini CLI E2E Testing +**Goal**: Add Gemini CLI adapter + scenarios to the existing E2E harness +**Depends on**: Phase 23 +**Success Criteria** (what must be TRUE): + 1. Gemini CLI passes all 4 core scenarios (install, hook-fire, deny, inject) + 2. Headless invocation works reliably in CI + 3. Reports include Gemini row in CLI x scenario matrix +**Plans**: 2 plans + +Plans: +- [x] 24-01-PLAN.md — Gemini adapter library, fixtures, and run.sh integration +- [x] 24-02-PLAN.md — 4 Gemini E2E scenarios (install, hook-fire, deny, inject) + +### Phase 25: Copilot CLI E2E Testing +**Goal**: Add Copilot CLI adapter + scenarios to the existing E2E harness +**Depends on**: Phase 23 +**Success Criteria** (what must be TRUE): + 1. Copilot CLI passes all 4 core scenarios (install, hook-fire, deny, inject) + 2. Headless invocation works reliably in CI + 3. Reports include Copilot row in CLI x scenario matrix +**Plans**: 3 plans (2 original + 1 gap closure) + +Plans: +- [x] 25-01-PLAN.md — Copilot adapter library, fixtures, and run.sh integration +- [x] 25-02-PLAN.md — 4 Copilot E2E scenarios (install, hook-fire, deny, inject) +- [x] 25-03-PLAN.md — Auth check gap closure: add authentication verification to copilot_adapter_check + +### Phase 26: OpenCode CLI E2E Testing +**Goal**: Add OpenCode CLI adapter + scenarios to the existing E2E harness +**Depends on**: Phase 23 +**Success Criteria** (what must be TRUE): + 1. OpenCode CLI passes all 4 core scenarios (install, hook-fire, deny, inject) + 2. Headless invocation works reliably in CI + 3. Reports include OpenCode row in CLI x scenario matrix +**Plans**: 1 plan (executed outside GSD workflow via PR #108) + +### Phase 27: Codex CLI E2E Testing +**Goal**: Add Codex CLI adapter + scenarios (NO hooks support — limited scenario set) +**Depends on**: Phase 23 +**Success Criteria** (what must be TRUE): + 1. Codex CLI passes available scenarios (hooks NOT supported — hook scenarios skipped, not failed) + 2. Headless invocation works reliably in CI + 3. Reports include Codex row with skip markers for unsupported scenarios +**Plans**: 1 plan + +Plans: +- [x] 27-01-PLAN.md — Codex adapter, fixtures, 4 scenarios (install + 3 skip stubs), and run.sh integration + +--- + +| 23. Claude Code CLI E2E Testing | v1.9 | 2/2 | ✅ Complete | 2026-02-23 | +| 25. Copilot CLI E2E Testing | v1.9 | 3/3 | ✅ Complete | 2026-02-23 | +| 24. Gemini CLI E2E Testing | v2.1 | 2/2 | ✅ Complete | 2026-02-23 | +| 26. OpenCode CLI E2E Testing | v2.1 | 1/1 | ✅ Complete | 2026-03-06 | +| 27. Codex CLI E2E Testing | v2.1 | 1/1 | ✅ Complete | 2026-03-09 | + +| 28. RuleZ Cleanup and Hardening | v2.0 | 8/8 | ✅ Complete | 2026-03-05 | + +### Phase 28: RuleZ Cleanup and Hardening +**Goal**: Fix critical bugs, improve engine performance, update skill docs, and add auto-upgrade capability — addresses all 9 pending todos +**Depends on**: Phase 22 (no dependency on E2E phases 23-27) +**Success Criteria** (what must be TRUE): + 1. Invalid regex in command_match returns non-match (not silent match-all) and validates at startup + 2. Config cache invalidated when hooks.yaml changes (timestamp or CRC check) + 3. `rulez debug` exercises run action scripts identically to live hook path + 4. tool_input fields exposed in enabled_when eval context (source, command, path, etc.) + 5. Naive matchers replaced with globset crate for correct glob patterns + 6. Regex compilation cached with LRU + config cached with file-change invalidation + 7. Parallel rule evaluation available for large rule sets + 8. Log filtering offloaded to Web Worker or Rust command + 9. mastering-hooks skill docs use correct field names matching RuleZ binary schema + 10. `rulez upgrade` or equivalent auto-checks and upgrades binary to latest release +**Plans**: 8 plans + +Plans: +- [x] 28-01-PLAN.md — Regex fail-closed fix: 5 call sites in hooks.rs + debug.rs + command_match validation in config.rs +- [x] 28-02-PLAN.md — Fix mastering-hooks skill docs: 7 field name mismatches in hooks-yaml-schema.md + rule-patterns.md +- [x] 28-03-PLAN.md — tool_input fields in enabled_when eval context + mtime-based config cache +- [x] 28-04-PLAN.md — Fix debug run script trace: enrich JSON evaluations with action results +- [x] 28-05-PLAN.md — Replace naive contains() directory matching with globset crate +- [x] 28-06-PLAN.md — rulez upgrade subcommand using self_update crate +- [x] 28-07-PLAN.md — UI log filter debounce (200ms) in rulez-ui logStore + LogViewer +- [x] 28-08-PLAN.md — Parallel rule evaluation using tokio join_all for large rule sets + +--- + +## ✅ v2.0 RuleZ Cleanup and Hardening (Complete) + +**Milestone Goal:** Fix critical bugs, improve engine performance, update skill docs, and add auto-upgrade capability — addresses all 9 pending todos. + +Phase 28 complete — all 8 plans executed across 4 waves. See Phase 28 section above. + +--- + +## ✅ v2.1 Multi-CLI E2E Testing (Continued) — Complete + +**Milestone Goal:** Complete remaining CLI E2E testing for Gemini, OpenCode, and Codex. + +Phases 24, 26, 27 moved from v1.9 — all three phases complete. + +### Phase 29: v2.2.1 cleanup — sync skills, CLI help, and UI integration + +**Goal:** Rename stale release-cch skill to release-rulez, document missing CLI commands in mastering-hooks, and wire ConfigDiffView into UI navigation +**Requirements**: CLEANUP-01, CLEANUP-02, CLEANUP-03, CLEANUP-04, CLEANUP-05 +**Depends on:** Phase 28 +**Success Criteria** (what must be TRUE): + 1. No "cch" references remain in skill directories (.claude/skills/ and .opencode/skill/) + 2. preflight-check.sh uses correct workspace-level paths + 3. mastering-hooks cli-commands.md documents all CLI commands including test, lint, upgrade, and platform installs + 4. ConfigDiffView is accessible via "Diff" button in UI header +**Plans:** 2/2 plans complete + +Plans: +- [ ] 29-01-PLAN.md — Rename release-cch to release-rulez + fix cch references in both skill copies +- [ ] 29-02-PLAN.md — Add missing CLI commands to mastering-hooks + wire ConfigDiffView into UI + +--- + +*Created 2026-02-06 — Updated 2026-03-12 Phase 29 planned (v2.2.1 cleanup).* diff --git a/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-01-PLAN.md b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-01-PLAN.md new file mode 100644 index 00000000..3fb66e6f --- /dev/null +++ b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-01-PLAN.md @@ -0,0 +1,171 @@ +--- +phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration +plan: 01 +type: execute +wave: 1 +depends_on: [] +files_modified: + - .claude/skills/release-rulez/SKILL.md + - .claude/skills/release-rulez/README.md + - .claude/skills/release-rulez/scripts/preflight-check.sh + - .claude/skills/release-rulez/scripts/read-version.sh + - .claude/skills/release-rulez/scripts/verify-release.sh + - .claude/skills/release-rulez/scripts/generate-changelog.sh + - .claude/skills/release-rulez/references/release-workflow.md + - .claude/skills/release-rulez/references/hotfix-workflow.md + - .claude/skills/release-rulez/references/troubleshooting.md + - .claude/skills/release-rulez/templates/pr-body.md + - .opencode/skill/release-rulez/SKILL.md + - .opencode/skill/release-rulez/README.md + - .opencode/skill/release-rulez/scripts/preflight-check.sh + - .opencode/skill/release-rulez/scripts/read-version.sh + - .opencode/skill/release-rulez/scripts/verify-release.sh + - .opencode/skill/release-rulez/scripts/generate-changelog.sh + - .opencode/skill/release-rulez/references/release-workflow.md + - .opencode/skill/release-rulez/references/hotfix-workflow.md + - .opencode/skill/release-rulez/references/troubleshooting.md + - .opencode/skill/release-rulez/templates/pr-body.md +autonomous: true +requirements: + - CLEANUP-01 + - CLEANUP-02 + - CLEANUP-05 + +must_haves: + truths: + - "No 'cch' references remain in any skill file under .claude/skills/release-rulez/" + - "No 'cch' references remain in any skill file under .opencode/skill/release-rulez/" + - "preflight-check.sh uses correct workspace-level paths (no cch_cli directory references)" + - "SKILL.md frontmatter has name: release-rulez and metadata.project: rulez" + - "Release asset names in docs use rulez-* prefix (not cch-*)" + artifacts: + - path: ".claude/skills/release-rulez/SKILL.md" + provides: "Renamed skill metadata with correct frontmatter" + contains: "name: release-rulez" + - path: ".claude/skills/release-rulez/scripts/preflight-check.sh" + provides: "Preflight script with correct repo paths" + contains: "REPO_ROOT" + - path: ".opencode/skill/release-rulez/SKILL.md" + provides: "OpenCode copy of renamed skill" + contains: "name: release-rulez" + key_links: + - from: ".claude/skills/release-rulez/SKILL.md" + to: ".claude/skills/release-rulez/scripts/" + via: "Script path references in SKILL.md" + pattern: "release-rulez/scripts/" +--- + + +Rename the release-cch skill directory to release-rulez and fix all stale "cch" references across both .claude/skills/ and .opencode/skill/ copies. + +Purpose: The binary was renamed from cch to rulez in commit 39e6185 (2026-02-06), but the skill directories and their contents still reference the old name. This causes incorrect guidance when the skill is invoked. The preflight-check.sh script also references a non-existent cch_cli directory. + +Output: Renamed skill directories with all 149+ occurrences of "cch" replaced with "rulez", and preflight-check.sh using correct workspace-level cargo commands. + + + +@/Users/richardhightower/.claude/get-shit-done/workflows/execute-plan.md +@/Users/richardhightower/.claude/get-shit-done/templates/summary.md + + + +@.planning/PROJECT.md +@.planning/ROADMAP.md +@.planning/STATE.md +@.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-RESEARCH.md + + + + + + Task 1: Rename release-cch to release-rulez and fix all cch references in .claude/skills/ + .claude/skills/release-rulez/ (entire directory, renamed from release-cch/) + +1. Copy `.claude/skills/release-cch/` to `.claude/skills/release-rulez/` (use git mv or cp + git rm to preserve history). +2. In ALL files under `.claude/skills/release-rulez/`, replace every occurrence of "cch" with "rulez" using context-appropriate replacements: + - `release-cch` -> `release-rulez` (directory/skill names) + - `cch` -> `rulez` (binary name, asset names, metadata) + - `cch_cli` -> `rulez` (directory paths in preflight-check.sh) + - `CCH` -> `RuleZ` (uppercase project name references) + - `cch-linux-x86_64.tar.gz` -> `rulez-linux-x86_64.tar.gz` (and similar asset names) +3. In SKILL.md frontmatter, update: `name: release-rulez`, `description:` (replace "CCH" with "RuleZ"), `metadata.project: "rulez"` +4. In preflight-check.sh specifically: + - Replace `cd "$REPO_ROOT/cch_cli"` with `cd "$REPO_ROOT"` (lines ~86, ~134) + - Update cargo commands to use `--workspace` flag since the repo now uses workspace-level commands + - Update any error messages referencing "cch_cli" directory +5. In SKILL.md body, update all script path references from `.claude/skills/release-cch/scripts/` to `.claude/skills/release-rulez/scripts/` +6. In release-workflow.md and SKILL.md, update the asset names table (5 platforms) from `cch-*` to `rulez-*` +7. Delete the old `.claude/skills/release-cch/` directory after confirming the new one is complete. + +IMPORTANT: Do NOT blindly sed the word "cch" -- some contexts may need "RuleZ" (the product name) instead. Use judgment based on context: binary references -> "rulez", project name -> "RuleZ", directory paths -> "rulez". + + + grep -ri "cch" .claude/skills/release-rulez/ | grep -v "\.git" | wc -l | xargs test 0 -eq + + +- .claude/skills/release-rulez/ directory exists with all files +- .claude/skills/release-cch/ directory is deleted +- Zero occurrences of "cch" (case-insensitive) in any file under release-rulez/ +- SKILL.md frontmatter has name: release-rulez, metadata.project: rulez +- preflight-check.sh uses $REPO_ROOT (not $REPO_ROOT/cch_cli) and workspace-level cargo commands +- Asset names in docs use rulez-* prefix + + + + + Task 2: Mirror all changes to .opencode/skill/release-rulez/ + .opencode/skill/release-rulez/ (entire directory, renamed from release-cch/) + +1. Copy `.opencode/skill/release-cch/` to `.opencode/skill/release-rulez/` (use git mv or cp + git rm). +2. Apply the exact same cch -> rulez replacements as Task 1 across all files in the directory. +3. Verify the .opencode copy has the same content as the .claude copy (they should mirror each other). +4. Delete the old `.opencode/skill/release-cch/` directory. +5. Search the entire repo for any remaining references to `release-cch` path and fix them (e.g., in .claude/settings.local.json or other config files). + +Note: The .opencode/skill/ copy has 80 occurrences across 8 files (vs 69 in .claude/skills/). Both must be fully cleaned. + + + grep -ri "cch" .opencode/skill/release-rulez/ | grep -v "\.git" | wc -l | xargs test 0 -eq + + +- .opencode/skill/release-rulez/ directory exists with all files +- .opencode/skill/release-cch/ directory is deleted +- Zero occurrences of "cch" (case-insensitive) in any file under .opencode/skill/release-rulez/ +- No remaining references to "release-cch" path anywhere in the repo + + + + + + +```bash +# Verify no cch references in either skill directory +grep -ri "cch" .claude/skills/release-rulez/ | wc -l # Should be 0 +grep -ri "cch" .opencode/skill/release-rulez/ | wc -l # Should be 0 + +# Verify old directories are gone +test ! -d .claude/skills/release-cch && echo "PASS: old claude dir removed" +test ! -d .opencode/skill/release-cch && echo "PASS: old opencode dir removed" + +# Verify no remaining release-cch path references in repo +grep -r "release-cch" . --include="*.md" --include="*.sh" --include="*.json" --include="*.yaml" --include="*.yml" | grep -v ".git/" | wc -l # Should be 0 + +# Verify preflight-check.sh doesn't reference cch_cli +grep "cch_cli" .claude/skills/release-rulez/scripts/preflight-check.sh | wc -l # Should be 0 + +# Verify SKILL.md frontmatter +grep "name: release-rulez" .claude/skills/release-rulez/SKILL.md # Should match +grep 'project: "rulez"' .claude/skills/release-rulez/SKILL.md # Should match +``` + + + +- Both skill directories renamed from release-cch to release-rulez +- All 149+ cch references replaced with rulez/RuleZ across 17 files +- preflight-check.sh uses correct workspace paths +- No stale release-cch references anywhere in the repository + + + +After completion, create `.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-01-SUMMARY.md` + diff --git a/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-01-SUMMARY.md b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-01-SUMMARY.md new file mode 100644 index 00000000..d18be44b --- /dev/null +++ b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-01-SUMMARY.md @@ -0,0 +1,124 @@ +--- +phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration +plan: 01 +subsystem: skills +tags: [release-workflow, naming, cleanup, skill-migration] + +# Dependency graph +requires: [] +provides: + - "Renamed release-cch skill to release-rulez in .claude/skills/" + - "Renamed release-cch skill to release-rulez in .opencode/skill/" + - "Fixed preflight-check.sh to use workspace-level cargo commands" + - "Updated all asset names from cch-* to rulez-*" +affects: [release-workflow, skill-loading] + +# Tech tracking +tech-stack: + added: [] + patterns: + - "Workspace-level cargo commands instead of subdirectory cd" + +key-files: + created: + - ".claude/skills/release-rulez/SKILL.md" + - ".claude/skills/release-rulez/scripts/preflight-check.sh" + - ".opencode/skill/release-rulez/SKILL.md" + - ".opencode/skill/release-rulez/scripts/preflight-check.sh" + modified: + - ".claude/settings.local.json" + - ".claude/commands/cch-release.md" + - ".opencode/command/cch-release.md" + - "AGENTS.md" + +key-decisions: + - "Used workspace-level cargo commands (--workspace, --all) instead of cd into cch_cli subdirectory" + - "Updated AGENTS.md skill reference as deviation Rule 3 (blocking remaining release-cch reference)" + +patterns-established: + - "Skill directories must match binary name (release-rulez, not release-cch)" + +requirements-completed: [CLEANUP-01, CLEANUP-02, CLEANUP-05] + +# Metrics +duration: 13min +completed: 2026-03-12 +--- + +# Phase 29 Plan 01: Rename Release Skill Summary + +**Renamed release-cch skill to release-rulez across .claude/skills/ and .opencode/skill/ with 149+ cch references replaced and preflight scripts fixed for workspace-level cargo commands** + +## Performance + +- **Duration:** 13 min +- **Started:** 2026-03-12T23:51:32Z +- **Completed:** 2026-03-13T00:04:51Z +- **Tasks:** 2 +- **Files modified:** 25 + +## Accomplishments +- Renamed both .claude/skills/release-cch/ and .opencode/skill/release-cch/ to release-rulez +- Replaced all cch/CCH references with rulez/RuleZ across 21 files (skills, scripts, commands, AGENTS.md, settings) +- Fixed preflight-check.sh in both copies to use workspace-level cargo commands instead of cd into non-existent cch_cli directory +- Updated all release asset names from cch-* to rulez-* prefix across docs, scripts, and commands +- Zero remaining release-cch references in active code (only in .planning/ historical docs) + +## Task Commits + +Each task was committed atomically: + +1. **Task 1: Rename release-cch to release-rulez in .claude/skills/** - `401811a` (feat) +2. **Task 2: Mirror all changes to .opencode/skill/release-rulez/** - `3aaefec` (feat) + +## Files Created/Modified +- `.claude/skills/release-rulez/` - All 11 files (renamed from release-cch, all cch refs replaced) +- `.opencode/skill/release-rulez/` - All 10 files (renamed from release-cch, all cch refs replaced) +- `.claude/settings.local.json` - Updated 4 permission paths from release-cch to release-rulez +- `.claude/commands/cch-release.md` - Updated skill paths and asset names +- `.opencode/command/cch-release.md` - Updated skill paths and asset names +- `AGENTS.md` - Updated skill entry name, description, and location + +## Decisions Made +- Used workspace-level cargo commands (`cargo fmt --all`, `cargo clippy --workspace`, `cargo test --workspace`) instead of `cd "$REPO_ROOT/cch_cli"` since the repo uses workspace-level builds +- Replaced "CCH" with "RuleZ" (product name) and "cch" with "rulez" (binary/asset name) based on context + +## Deviations from Plan + +### Auto-fixed Issues + +**1. [Rule 3 - Blocking] Fixed AGENTS.md release-cch reference** +- **Found during:** Task 2 (repo-wide reference scan) +- **Issue:** AGENTS.md still referenced release-cch in skill name, description, and location +- **Fix:** Updated skill entry to release-rulez with RuleZ description and correct path +- **Files modified:** AGENTS.md +- **Verification:** grep confirms zero remaining release-cch references in active code +- **Committed in:** 3aaefec (Task 2 commit) + +**2. [Rule 3 - Blocking] Fixed cch-release.md command files** +- **Found during:** Task 1 and Task 2 (repo-wide reference scan) +- **Issue:** Both .claude/commands/cch-release.md and .opencode/command/cch-release.md referenced release-cch paths and had cch-* asset names +- **Fix:** Updated all skill path references and asset names in both command files +- **Files modified:** .claude/commands/cch-release.md, .opencode/command/cch-release.md +- **Verification:** grep confirms zero cch references in command files +- **Committed in:** 401811a (Task 1), 3aaefec (Task 2) + +--- + +**Total deviations:** 2 auto-fixed (2 blocking) +**Impact on plan:** Both auto-fixes necessary to eliminate all release-cch references. No scope creep. + +## Issues Encountered +None + +## User Setup Required +None - no external service configuration required. + +## Next Phase Readiness +- Release skill fully renamed and functional +- All script paths updated, ready for next release cycle +- No blockers for subsequent plans + +--- +*Phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration* +*Completed: 2026-03-12* diff --git a/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-02-PLAN.md b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-02-PLAN.md new file mode 100644 index 00000000..18e9dcaa --- /dev/null +++ b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-02-PLAN.md @@ -0,0 +1,230 @@ +--- +phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration +plan: 02 +type: execute +wave: 1 +depends_on: [] +files_modified: + - mastering-hooks/references/cli-commands.md + - rulez-ui/src/stores/uiStore.ts + - rulez-ui/src/components/layout/Header.tsx + - rulez-ui/src/components/layout/MainContent.tsx +autonomous: true +requirements: + - CLEANUP-03 + - CLEANUP-04 + +must_haves: + truths: + - "mastering-hooks cli-commands.md documents rulez test, rulez lint, rulez upgrade commands" + - "mastering-hooks cli-commands.md documents rulez gemini install, rulez copilot install, rulez opencode install commands" + - "User can navigate to ConfigDiffView via a 'Diff' button in the UI header" + - "ConfigDiffView renders when mainView is set to 'diff'" + artifacts: + - path: "mastering-hooks/references/cli-commands.md" + provides: "Complete CLI command reference with all 7 missing commands" + contains: "rulez test" + - path: "rulez-ui/src/stores/uiStore.ts" + provides: "MainView type updated with 'diff' option" + contains: '"diff"' + - path: "rulez-ui/src/components/layout/Header.tsx" + provides: "Diff button in view switcher" + contains: "setMainView" + - path: "rulez-ui/src/components/layout/MainContent.tsx" + provides: "Diff view routing" + contains: "ConfigDiffView" + key_links: + - from: "rulez-ui/src/components/layout/Header.tsx" + to: "rulez-ui/src/stores/uiStore.ts" + via: "setMainView('diff') call" + pattern: 'setMainView.*diff' + - from: "rulez-ui/src/components/layout/MainContent.tsx" + to: "rulez-ui/src/components/config/ConfigDiffView.tsx" + via: "conditional render when mainView === 'diff'" + pattern: "mainView.*diff" +--- + + +Add 7 missing CLI commands to mastering-hooks documentation and wire the existing ConfigDiffView component into the RuleZ UI navigation. + +Purpose: Users asking about `rulez test`, `rulez lint`, or platform-specific install commands get no guidance from the mastering-hooks skill because those commands were added in v2.2 but never documented. The ConfigDiffView component was built in Phase 34 but never connected to the UI routing, so users cannot access it. + +Output: Complete CLI reference documentation and a working "Diff" view accessible from the UI header. + + + +@/Users/richardhightower/.claude/get-shit-done/workflows/execute-plan.md +@/Users/richardhightower/.claude/get-shit-done/templates/summary.md + + + +@.planning/PROJECT.md +@.planning/ROADMAP.md +@.planning/STATE.md +@.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-RESEARCH.md + + + + +From rulez-ui/src/stores/uiStore.ts: +```typescript +export type MainView = "editor" | "logs"; +// ... store with setMainView: (view: MainView) => void +``` + +From rulez-ui/src/components/layout/Header.tsx: +```typescript +// View switcher buttons for "Editor" and "Logs" using: +// onClick={() => setMainView("editor")} and setMainView("logs") +// with conditional className based on mainView === "editor" etc. +``` + +From rulez-ui/src/components/config/ConfigDiffView.tsx: +```typescript +// Existing component with Monaco DiffEditor - already fully implemented +// Just needs to be imported and rendered in MainContent.tsx +``` + + + + + + + Task 1: Add missing CLI commands to mastering-hooks cli-commands.md + mastering-hooks/references/cli-commands.md + +Read the full existing `mastering-hooks/references/cli-commands.md` to understand the current documentation format. + +For each missing command, run `cargo run -p rulez -- --help` (or read the Rust source files) to get the exact flags and usage. Then add documentation following the existing pattern in cli-commands.md: + +```markdown +### command-name + +Description paragraph. + +\`\`\`bash +rulez command [OPTIONS] + +Options: + --flag Description +\`\`\` + +**Examples**: +\`\`\`bash +rulez command --example +\`\`\` +``` + +Add these 7 commands (consult Rust source for accurate flags): + +1. **rulez test** (from `rulez/src/cli/test.rs`) -- Run batch test scenarios against rules. Accepts a YAML test file with scenarios, reports pass/fail for each, exits with code 1 if any fail. + +2. **rulez lint** (from `rulez/src/cli/lint.rs`) -- Lint configuration for issues: duplicate rule names, overlapping rules, dead rules, missing descriptions. + +3. **rulez upgrade** (from `rulez/src/cli/upgrade.rs`) -- Self-update the rulez binary to the latest GitHub release. + +4. **rulez gemini install** (from `rulez/src/cli/gemini_install.rs`) -- Install RuleZ hooks for Gemini CLI. + +5. **rulez copilot install** (from `rulez/src/cli/copilot_install.rs`) -- Install RuleZ hooks for GitHub Copilot CLI. + +6. **rulez opencode install** (from `rulez/src/cli/opencode_install.rs`) -- Install RuleZ hooks for OpenCode. + +7. **rulez [gemini|copilot|opencode] doctor** -- Diagnostic commands for each platform integration (check the actual CLI source to confirm exact syntax). + +Place the new commands in logical order within the existing document. Group the platform-specific commands (install/doctor) together under a "## Multi-Platform Commands" heading after the core commands. + +Do NOT document internal plumbing commands like `gemini hook`, `copilot hook`, `opencode hook` -- those are hook handlers invoked by the platform, not user-facing. + + + grep -c "### test\|### lint\|### upgrade\|### gemini install\|### copilot install\|### opencode install" mastering-hooks/references/cli-commands.md | xargs test 6 -le + + +- cli-commands.md contains documentation for all 7 new commands +- Each command entry follows the existing format (description, usage block, options, examples) +- Flags and options are accurate (verified against Rust source or --help output) +- Platform commands grouped under a clear heading +- No internal/plumbing commands documented + + + + + Task 2: Wire ConfigDiffView into UI navigation + rulez-ui/src/stores/uiStore.ts, rulez-ui/src/components/layout/Header.tsx, rulez-ui/src/components/layout/MainContent.tsx + +Follow the established pattern for adding the "Logs" view. Make these three changes: + +1. **uiStore.ts**: Update the `MainView` type union from `"editor" | "logs"` to `"editor" | "logs" | "diff"`. + +2. **Header.tsx**: Add a "Diff" button to the view switcher div, right after the "Logs" button. Use the exact same styling pattern as the existing buttons: +```typescript + +``` + +3. **MainContent.tsx**: Add the diff view case. Import `ConfigDiffView` from `../config/ConfigDiffView` and add a conditional block: +```typescript +if (mainView === "diff") { + return ( +
+ +
+ ); +} +``` + +Place this after the existing logs check and before the default editor return. + +The ConfigDiffView component already exists at `rulez-ui/src/components/config/ConfigDiffView.tsx` -- it uses Monaco DiffEditor and is fully implemented. No changes needed to that component. +
+ + cd rulez-ui && npx tsc --noEmit 2>&1 | tail -5 + + +- MainView type includes "diff" option +- Header shows "Editor | Logs | Diff" view switcher +- Clicking "Diff" renders ConfigDiffView component +- TypeScript compiles without errors +- No changes to ConfigDiffView.tsx itself (already complete) + +
+ +
+ + +```bash +# Verify CLI docs have new commands +grep -c "rulez test\|rulez lint\|rulez upgrade\|rulez gemini\|rulez copilot\|rulez opencode" mastering-hooks/references/cli-commands.md # Should be >= 7 + +# Verify UI type updated +grep '"diff"' rulez-ui/src/stores/uiStore.ts # Should match + +# Verify Header has Diff button +grep 'setMainView.*diff' rulez-ui/src/components/layout/Header.tsx # Should match + +# Verify MainContent routes to ConfigDiffView +grep 'ConfigDiffView' rulez-ui/src/components/layout/MainContent.tsx # Should match + +# TypeScript compile check +cd rulez-ui && npx tsc --noEmit +``` + + + +- mastering-hooks cli-commands.md documents all 17+ commands (10 existing + 7 new) +- ConfigDiffView accessible via "Diff" button in UI header view switcher +- TypeScript compiles cleanly with the new routing + + + +After completion, create `.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-02-SUMMARY.md` + diff --git a/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-02-SUMMARY.md b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-02-SUMMARY.md new file mode 100644 index 00000000..4a2e688f --- /dev/null +++ b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-02-SUMMARY.md @@ -0,0 +1,95 @@ +--- +phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration +plan: 02 +subsystem: docs, ui +tags: [cli-reference, mastering-hooks, tauri, react, zustand, config-diff] + +# Dependency graph +requires: + - phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration + provides: "Phase 34 ConfigDiffView component, v2.2 CLI commands (test, lint, upgrade, platform install/doctor)" +provides: + - "Complete CLI command reference in mastering-hooks skill (17+ commands)" + - "ConfigDiffView accessible via Diff button in UI header" +affects: [mastering-hooks, rulez-ui] + +# Tech tracking +tech-stack: + added: [] + patterns: ["View switcher pattern extended with diff view"] + +key-files: + created: [] + modified: + - mastering-hooks/references/cli-commands.md + - rulez-ui/src/stores/uiStore.ts + - rulez-ui/src/components/layout/Header.tsx + - rulez-ui/src/components/layout/MainContent.tsx + +key-decisions: + - "Grouped platform commands under Multi-Platform Commands heading for clarity" + - "Included doctor commands alongside install commands (9 total new entries, not just 7)" + +patterns-established: + - "View routing: add to MainView type, add button in Header, add conditional in MainContent" + +requirements-completed: [CLEANUP-03, CLEANUP-04] + +# Metrics +duration: 5min +completed: 2026-03-12 +--- + +# Phase 29 Plan 02: CLI Docs and UI Diff View Summary + +**Added 9 missing CLI commands to mastering-hooks reference and wired ConfigDiffView into UI navigation via Diff button** + +## Performance + +- **Duration:** 5 min +- **Started:** 2026-03-12T23:51:32Z +- **Completed:** 2026-03-12T23:56:32Z +- **Tasks:** 2 +- **Files modified:** 4 + +## Accomplishments +- Documented rulez test, lint, upgrade commands with accurate flags from Rust source +- Documented gemini/copilot/opencode install and doctor commands (6 platform commands) +- Wired existing ConfigDiffView into UI with Editor | Logs | Diff view switcher +- TypeScript compiles cleanly with all changes + +## Task Commits + +Each task was committed atomically: + +1. **Task 1: Add missing CLI commands to mastering-hooks cli-commands.md** - `c750400` (docs) +2. **Task 2: Wire ConfigDiffView into UI navigation** - `dfd6e32` (feat) + +## Files Created/Modified +- `mastering-hooks/references/cli-commands.md` - Added 9 new command entries (test, lint, upgrade, gemini install/doctor, copilot install/doctor, opencode install/doctor) +- `rulez-ui/src/stores/uiStore.ts` - Extended MainView type with "diff" +- `rulez-ui/src/components/layout/Header.tsx` - Added Diff button to view switcher +- `rulez-ui/src/components/layout/MainContent.tsx` - Added diff view routing to ConfigDiffView + +## Decisions Made +- Grouped platform commands under "Multi-Platform Commands" heading for clarity +- Included doctor commands alongside install commands (9 total new entries vs 7 planned) -- doctor commands were in the CLI source and logically belong with install docs + +## Deviations from Plan + +None - plan executed exactly as written. + +## Issues Encountered +None + +## User Setup Required +None - no external service configuration required. + +## Next Phase Readiness +- CLI documentation now covers all rulez commands +- ConfigDiffView is accessible in the UI +- Ready for next plan in phase + +--- +*Phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration* +*Completed: 2026-03-12* diff --git a/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-RESEARCH.md b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-RESEARCH.md new file mode 100644 index 00000000..40b98704 --- /dev/null +++ b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-RESEARCH.md @@ -0,0 +1,262 @@ +# Phase 29: v2.2.1 Cleanup - Sync Skills, CLI Help, and UI Integration - Research + +**Researched:** 2026-03-12 +**Domain:** Skill documentation, CLI consistency, UI routing +**Confidence:** HIGH + +## Summary + +This is a cleanup/sync phase addressing documentation and wiring gaps that accumulated across phases 29-36 (v2.2 milestone). The work is entirely non-Rust -- it involves renaming stale "cch" references in shell scripts and markdown files, adding missing CLI command documentation to the mastering-hooks skill, and wiring an existing but unrouted React component (ConfigDiffView) into the UI app. + +All five gaps have been verified through direct codebase inspection. The `release-cch` skill has 69 occurrences of "cch" across 9 files in `.claude/skills/` and 80 occurrences across 8 files in `.opencode/skill/`. The `preflight-check.sh` script references `cch_cli` directory paths that no longer exist (the Rust workspace root is now `rulez/`). The `mastering-hooks` skill's `cli-commands.md` documents 10 commands but is missing `test`, `lint`, `upgrade`, and all multi-platform install commands (`gemini install`, `copilot install`, `opencode install`). The `ConfigDiffView` component exists at `rulez-ui/src/components/config/ConfigDiffView.tsx` but is only imported in that single file -- no route, no navigation button, no way for users to reach it. + +**Primary recommendation:** Tackle this as five independent work items: (1) preflight-check.sh path fix, (2) release-cch -> release-rulez rename, (3) add missing CLI commands to mastering-hooks docs, (4) wire ConfigDiffView into UI, (5) verify the opencode skill copy is also updated. + +## Standard Stack + +This phase involves no new libraries or dependencies. All work is on existing files. + +### Core Files to Modify + +| Location | File Count | Change Type | +|----------|-----------|-------------| +| `.claude/skills/release-cch/` | 9 files | Rename cch -> rulez (69 occurrences) | +| `.opencode/skill/release-cch/` | 8 files | Rename cch -> rulez (80 occurrences) | +| `mastering-hooks/references/cli-commands.md` | 1 file | Add 7 missing command docs | +| `rulez-ui/src/` | ~4 files | Wire ConfigDiffView into navigation | + +### Technologies in Play + +| Technology | Version | Purpose | Notes | +|-----------|---------|---------|-------| +| Bash scripts | N/A | preflight-check.sh, read-version.sh, verify-release.sh | Path references to fix | +| Markdown | N/A | Skill documentation, references | Bulk rename cch -> rulez | +| React 18 | 18.x | UI components | Wire ConfigDiffView | +| Zustand | (existing) | UI state (uiStore.ts) | Add "diff" to MainView type | +| Monaco DiffEditor | (existing) | ConfigDiffView component | Already implemented, just unrouted | + +## Architecture Patterns + +### Skill Directory Structure (existing) +``` +.claude/skills/release-cch/ # <-- directory name needs renaming + SKILL.md # Skill metadata + workflow + scripts/ + preflight-check.sh # References cch_cli paths + read-version.sh # Minor cch reference + verify-release.sh # cch references in asset names + generate-changelog.sh + references/ + release-workflow.md # cch asset names in tables/diagrams + hotfix-workflow.md # cch references + troubleshooting.md # cch references + templates/ + pr-body.md # cch references + README.md # cch references +``` + +### UI Navigation Pattern (existing) +``` +Header.tsx + - View switcher: "Editor" | "Logs" <-- needs "Diff" option added + - Drives `mainView` state in uiStore + +uiStore.ts + - MainView type: "editor" | "logs" <-- needs "diff" added + - RightPanelTab type: "simulator" | "tree" | "settings" + +MainContent.tsx + - Switches on mainView: editor | logs <-- needs diff case + - ConfigDiffView already exists at components/config/ConfigDiffView.tsx +``` + +### Pattern: Adding a New Main View to RuleZ UI + +1. **uiStore.ts**: Add `"diff"` to `MainView` type union +2. **Header.tsx**: Add "Diff" button to view switcher (alongside Editor/Logs) +3. **MainContent.tsx**: Add `if (mainView === "diff")` case returning `` + +This follows the exact pattern used when the "Logs" view was added. + +### Mastering-Hooks CLI Reference Pattern + +The existing `cli-commands.md` follows this pattern for each command: +```markdown +### command-name + +Description paragraph. + +\`\`\`bash +rulez command [OPTIONS] + +Options: + --flag Description +\`\`\` + +**Examples**: +\`\`\`bash +rulez command --example +\`\`\` +``` + +New commands to document should follow this exact format. + +### Anti-Patterns to Avoid +- **Partial rename**: Do NOT rename just the visible text while leaving directory names unchanged. The directory `.claude/skills/release-cch/` should be renamed to `.claude/skills/release-rulez/` so Claude Code can discover it properly. +- **Forgetting the OpenCode copy**: The `.opencode/skill/release-cch/` directory mirrors `.claude/skills/release-cch/` and has the same stale references. Both must be updated together. + +## Don't Hand-Roll + +| Problem | Don't Build | Use Instead | Why | +|---------|-------------|-------------|-----| +| Bulk rename | Manual find-replace | `sed -i` or targeted edits | 149 total occurrences across 17 files | +| ConfigDiffView | New component | Existing `ConfigDiffView.tsx` | Already fully implemented with Monaco DiffEditor | +| CLI command docs | Guessing at flags | `rulez --help` output | Source of truth is Rust clap definitions | + +## Common Pitfalls + +### Pitfall 1: Breaking Script Paths After Directory Rename +**What goes wrong:** If the skill directory is renamed from `release-cch` to `release-rulez`, all internal script references using relative paths (`SCRIPT_DIR`) will still work. But any external references in SKILL.md or README that hardcode `.claude/skills/release-cch/scripts/...` will break. +**How to avoid:** Search the entire repo for references to `release-cch` path after renaming. + +### Pitfall 2: preflight-check.sh Still References cch_cli Directory +**What goes wrong:** `preflight-check.sh` does `cd "$REPO_ROOT/cch_cli"` on lines 86 and 134. This directory no longer exists -- the Rust workspace uses `rulez/` as the crate directory. +**How to avoid:** Replace `cch_cli` with `rulez` in all `cd` commands and error messages. Also update the Cargo workspace-relative commands since the repo now uses workspace-level `cargo` commands (per CLAUDE.md: `cargo fmt --all --check`, `cargo clippy --all-targets --all-features --workspace`). + +### Pitfall 3: Release Asset Names in Documentation +**What goes wrong:** The `release-workflow.md` and `SKILL.md` list asset names as `cch-linux-x86_64.tar.gz`, `cch-macos-aarch64.tar.gz`, etc. But the actual GitHub Actions workflow already uses `rulez-*` names (verified: no `cch-` or `cch_` references in `.github/workflows/`). +**How to avoid:** Update all asset name references in skill docs to use `rulez-*` prefix. + +### Pitfall 4: Forgetting to Update Skill Metadata +**What goes wrong:** The SKILL.md frontmatter has `name: release-cch` and `metadata.project: "cch"`. Claude Code uses this metadata for skill discovery. Stale names mean the skill may not trigger correctly. +**How to avoid:** Update the YAML frontmatter in SKILL.md: `name: release-rulez`, `metadata.project: "rulez"`, and update the description text. + +### Pitfall 5: Missing CLI Commands in Mastering-Hooks +**What goes wrong:** Users ask about `rulez test` or `rulez lint` and the skill has no documentation for them, leading to incorrect guidance. +**How to avoid:** Document all seven missing commands by consulting the Rust source: +- `rulez test` (cli/test.rs) -- batch test scenarios +- `rulez lint` (cli/lint.rs) -- config linting +- `rulez upgrade` (cli/upgrade.rs) -- self-update +- `rulez gemini install` (cli/gemini_install.rs) -- Gemini CLI setup +- `rulez copilot install` (cli/copilot_install.rs) -- Copilot setup +- `rulez opencode install` (cli/opencode_install.rs) -- OpenCode setup +- `rulez doctor` -- diagnostic commands + +## Code Examples + +### UI: Adding "Diff" View to Header.tsx +```typescript +// In the view switcher div, add alongside Editor and Logs buttons: + +``` + +### UI: Adding Diff Case to MainContent.tsx +```typescript +// After the logs check: +if (mainView === "diff") { + return ( +
+ +
+ ); +} +``` + +### UI: Updating uiStore.ts Type +```typescript +export type MainView = "editor" | "logs" | "diff"; +``` + +### preflight-check.sh: Path Fix +```bash +# OLD (broken): +cd "$REPO_ROOT/cch_cli" + +# NEW (correct - use workspace-level commands): +cd "$REPO_ROOT" +# Then update cargo commands to use --workspace flag +``` + +## State of the Art + +| Old State | Current State | Impact | +|-----------|--------------|--------| +| Binary named `cch` | Binary renamed to `rulez` (commit 39e6185, 2026-02-06) | Skill docs still say cch | +| No `test`/`lint` commands | Added in Phase 30/36 (v2.2) | Not documented in mastering-hooks | +| No multi-platform install docs | Gemini/Copilot/OpenCode install commands exist | Not documented in cli-commands.md | +| ConfigDiffView created (Phase 34) | Component exists but unrouted | Users cannot access it | +| GitHub workflows used `cch-*` asset names | Workflows already updated to `rulez-*` | Only skill docs are stale | + +## Open Questions + +1. **Should the skill directory be renamed?** + - What we know: The directory is `.claude/skills/release-cch/`. Claude Code discovers skills by directory name + SKILL.md frontmatter. + - What's unclear: Whether renaming the directory will break any cached references in Claude Code. + - Recommendation: YES, rename to `release-rulez`. Update the SKILL.md frontmatter `name` field. Claude Code re-scans on each session so no caching issue. + +2. **Should `rulez hook` commands be documented?** + - What we know: CLI source has `gemini_hook.rs`, `copilot_hook.rs`, `opencode_hook.rs` alongside the install commands. + - What's unclear: Whether these are user-facing or internal plumbing. + - Recommendation: Document `install` and `doctor` commands. The `hook` commands are the actual hook handlers invoked by the platform -- they are plumbing, not user-facing. + +## Validation Architecture + +### Test Framework +| Property | Value | +|----------|-------| +| Framework | Rust (cargo test) + Vitest (UI) | +| Config file | `Cargo.toml` (workspace), `rulez-ui/vite.config.ts` | +| Quick run command | `cargo test --tests --all-features --workspace` | +| Full suite command | `cargo llvm-cov --all-features --workspace --no-report` | + +### Phase Requirements -> Test Map + +This is a cleanup/documentation phase. Most changes are to markdown and shell scripts which do not have automated tests. The UI wiring change can be validated: + +| Req ID | Behavior | Test Type | Automated Command | File Exists? | +|--------|----------|-----------|-------------------|-------------| +| CLEANUP-01 | preflight-check.sh uses correct paths | manual | Run `bash .claude/skills/release-rulez/scripts/preflight-check.sh` | N/A | +| CLEANUP-02 | No "cch" references in skill files | manual | `grep -ri cch .claude/skills/release-rulez/` should return 0 | N/A | +| CLEANUP-03 | CLI commands documented | manual | Visual inspection of cli-commands.md | N/A | +| CLEANUP-04 | ConfigDiffView accessible in UI | smoke | `cd rulez-ui && npx vitest run` | Depends on existing tests | +| CLEANUP-05 | OpenCode skill copy updated | manual | `grep -ri cch .opencode/skill/release-rulez/` should return 0 | N/A | + +### Sampling Rate +- **Per task commit:** `cargo fmt --all --check && cargo clippy --all-targets --all-features --workspace -- -D warnings` +- **Per wave merge:** `cargo test --tests --all-features --workspace` +- **Phase gate:** Full CI pipeline before push + +### Wave 0 Gaps +None -- this phase modifies documentation and UI wiring only. No new test infrastructure needed. + +## Sources + +### Primary (HIGH confidence) +- Direct codebase inspection of all files referenced in this research +- `grep -ri cch` across skill directories -- verified exact counts +- UI component inspection -- confirmed ConfigDiffView is unrouted +- CLI source files -- confirmed `test.rs`, `lint.rs`, `upgrade.rs`, `gemini_install.rs`, `copilot_install.rs`, `opencode_install.rs` exist +- GitHub workflows -- confirmed no stale `cch` references in `.github/workflows/` + +## Metadata + +**Confidence breakdown:** +- Stale cch references: HIGH - direct grep counts verified +- preflight-check.sh fix: HIGH - read the script, confirmed `cch_cli` paths +- Missing CLI docs: HIGH - compared cli-commands.md against actual CLI source files +- ConfigDiffView wiring: HIGH - read all UI routing code, confirmed no references +- UI wiring pattern: HIGH - existing Editor/Logs pattern is clear + +**Research date:** 2026-03-12 +**Valid until:** 2026-04-12 (stable -- no external dependencies) diff --git a/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-VALIDATION.md b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-VALIDATION.md new file mode 100644 index 00000000..e5e43eb6 --- /dev/null +++ b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-VALIDATION.md @@ -0,0 +1,74 @@ +--- +phase: 29 +slug: v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration +status: draft +nyquist_compliant: false +wave_0_complete: false +created: 2026-03-12 +--- + +# Phase 29 — Validation Strategy + +> Per-phase validation contract for feedback sampling during execution. + +--- + +## Test Infrastructure + +| Property | Value | +|----------|-------| +| **Framework** | cargo test (Rust) + grep/diff verification (docs/skills) | +| **Config file** | Cargo.toml | +| **Quick run command** | `cargo test --tests --all-features --workspace` | +| **Full suite command** | `cargo clippy --all-targets --all-features --workspace -- -D warnings && cargo test --tests --all-features --workspace` | +| **Estimated runtime** | ~30 seconds | + +--- + +## Sampling Rate + +- **After every task commit:** Run `cargo test --tests --all-features --workspace` +- **After every plan wave:** Run full suite command +- **Before `/gsd:verify-work`:** Full suite must be green +- **Max feedback latency:** 30 seconds + +--- + +## Per-Task Verification Map + +| Task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status | +|---------|------|------|-------------|-----------|-------------------|-------------|--------| +| 29-01-01 | 01 | 1 | Stale cch refs | grep | `grep -r "cch" .claude/skills/release-cch/ --include="*.md" --include="*.sh" \| wc -l` | ✅ | ⬜ pending | +| 29-01-02 | 01 | 1 | preflight-check.sh | grep | `grep "cch_cli" .claude/skills/release-cch/preflight-check.sh \| wc -l` | ✅ | ⬜ pending | +| 29-02-01 | 02 | 1 | CLI docs sync | diff | `diff <(cargo run -- --help 2>&1) /dev/null` | ✅ | ⬜ pending | +| 29-03-01 | 03 | 2 | UI routing | grep | `grep -r "ConfigDiffView\|config-diff" rulez-ui/src/ \| wc -l` | ✅ | ⬜ pending | + +*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky* + +--- + +## Wave 0 Requirements + +*Existing infrastructure covers all phase requirements.* + +--- + +## Manual-Only Verifications + +| Behavior | Requirement | Why Manual | Test Instructions | +|----------|-------------|------------|-------------------| +| UI ConfigDiffView accessible | UI routing | Visual verification | Launch app, verify "Diff" button appears in header and opens diff view | +| Skill loads correctly | Skill rename | Claude Code skill loading | Run `/release-cch` (or renamed) and verify it loads | + +--- + +## Validation Sign-Off + +- [ ] All tasks have `` verify or Wave 0 dependencies +- [ ] Sampling continuity: no 3 consecutive tasks without automated verify +- [ ] Wave 0 covers all MISSING references +- [ ] No watch-mode flags +- [ ] Feedback latency < 30s +- [ ] `nyquist_compliant: true` set in frontmatter + +**Approval:** pending diff --git a/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-VERIFICATION.md b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-VERIFICATION.md new file mode 100644 index 00000000..4432e75b --- /dev/null +++ b/.planning/phases/29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration/29-VERIFICATION.md @@ -0,0 +1,109 @@ +--- +phase: 29-v2-2-1-cleanup-sync-skills-cli-help-and-ui-integration +verified: 2026-03-12T21:30:00Z +status: passed +score: 9/9 must-haves verified +re_verification: false +--- + +# Phase 29: v2.2.1 Cleanup Verification Report + +**Phase Goal:** Rename stale release-cch skill to release-rulez, document missing CLI commands in mastering-hooks, and wire ConfigDiffView into UI navigation +**Verified:** 2026-03-12T21:30:00Z +**Status:** passed +**Re-verification:** No -- initial verification + +## Goal Achievement + +### Observable Truths + +| # | Truth | Status | Evidence | +|---|-------|--------|----------| +| 1 | No "cch" references remain in .claude/skills/release-rulez/ | VERIFIED | grep -ri "cch" returns 0 matches | +| 2 | No "cch" references remain in .opencode/skill/release-rulez/ | VERIFIED | grep -ri "cch" returns 0 matches | +| 3 | preflight-check.sh uses correct workspace-level paths | VERIFIED | Uses `cd "$REPO_ROOT"` not `cd "$REPO_ROOT/cch_cli"`, no cch_cli references | +| 4 | SKILL.md frontmatter has name: release-rulez and metadata.project: rulez | VERIFIED | Both .claude and .opencode copies have correct frontmatter | +| 5 | Release asset names in docs use rulez-* prefix | VERIFIED | SKILL.md script paths reference release-rulez/scripts/ | +| 6 | mastering-hooks cli-commands.md documents rulez test, lint, upgrade | VERIFIED | All 3 commands documented with flags and examples (19 total headings) | +| 7 | mastering-hooks cli-commands.md documents gemini/copilot/opencode install | VERIFIED | All 3 install + 3 doctor commands documented | +| 8 | User can navigate to ConfigDiffView via Diff button in UI header | VERIFIED | Header.tsx has `setMainView("diff")` onClick handler | +| 9 | ConfigDiffView renders when mainView is set to diff | VERIFIED | MainContent.tsx imports ConfigDiffView and renders on `mainView === "diff"` | + +**Score:** 9/9 truths verified + +### Required Artifacts + +| Artifact | Expected | Status | Details | +|----------|----------|--------|---------| +| `.claude/skills/release-rulez/SKILL.md` | Renamed skill metadata | VERIFIED | Contains `name: release-rulez`, `project: "rulez"` | +| `.claude/skills/release-rulez/scripts/preflight-check.sh` | Correct repo paths | VERIFIED | Uses REPO_ROOT, workspace-level cargo | +| `.opencode/skill/release-rulez/SKILL.md` | OpenCode copy | VERIFIED | Same frontmatter as .claude copy | +| `mastering-hooks/references/cli-commands.md` | Complete CLI reference | VERIFIED | 19 command sections including 9 new | +| `rulez-ui/src/stores/uiStore.ts` | MainView with "diff" | VERIFIED | `type MainView = "editor" \| "logs" \| "diff"` | +| `rulez-ui/src/components/layout/Header.tsx` | Diff button | VERIFIED | `setMainView("diff")` button present | +| `rulez-ui/src/components/layout/MainContent.tsx` | Diff view routing | VERIFIED | Imports and renders ConfigDiffView | + +### Key Link Verification + +| From | To | Via | Status | Details | +|------|----|-----|--------|---------| +| `.claude/skills/release-rulez/SKILL.md` | `scripts/` | Script path references | WIRED | References `.claude/skills/release-rulez/scripts/` paths | +| `Header.tsx` | `uiStore.ts` | `setMainView('diff')` | WIRED | onClick handler calls setMainView | +| `MainContent.tsx` | `ConfigDiffView.tsx` | Conditional render | WIRED | Import + `if (mainView === "diff")` guard | + +### Requirements Coverage + +| Requirement | Source Plan | Description | Status | Evidence | +|-------------|------------|-------------|--------|----------| +| CLEANUP-01 | 29-01 | preflight-check.sh uses correct paths | SATISFIED | No cch_cli references, uses $REPO_ROOT | +| CLEANUP-02 | 29-01 | No "cch" references in skill files | SATISFIED | 0 matches in both directories | +| CLEANUP-03 | 29-02 | CLI commands documented | SATISFIED | 19 commands in cli-commands.md | +| CLEANUP-04 | 29-02 | ConfigDiffView accessible in UI | SATISFIED | Diff button wired in Header, renders in MainContent | +| CLEANUP-05 | 29-01 | OpenCode skill copy updated | SATISFIED | 0 cch references in .opencode/skill/release-rulez/ | + +**Note:** CLEANUP-01 through CLEANUP-05 are not formally defined in REQUIREMENTS.md. They are referenced in ROADMAP.md and mapped in RESEARCH.md. Descriptions above are derived from RESEARCH.md validation matrix. + +### Anti-Patterns Found + +| File | Line | Pattern | Severity | Impact | +|------|------|---------|----------|--------| +| (none) | - | - | - | No anti-patterns found in modified files | + +### Stale References (Info) + +16 `release-cch` references remain in `docs/` and `.speckit/` directories (historical planning docs). These are not in scope for this phase but may cause confusion if those docs are consulted. + +- `docs/plans/sdd_claude_tasks.md` (9 references) +- `docs/wiki-mapping.yml` (5 references) +- `docs/validation/README.md` (1 reference) +- `.speckit/features/integration-testing/tasks.md` (2 references) + +**Severity:** Info -- these are historical/archival docs, not active skill files. + +### Commit Verification + +| Commit | Message | Status | +|--------|---------|--------| +| `401811a` | feat(29-01): rename release-cch skill to release-rulez in .claude/skills/ | VERIFIED | +| `3aaefec` | feat(29-01): mirror release-rulez rename to .opencode/skill/ and fix all references | VERIFIED | +| `c750400` | docs(29-02): add 9 missing CLI commands to mastering-hooks reference | VERIFIED | +| `dfd6e32` | feat(29-02): wire ConfigDiffView into UI navigation | VERIFIED | + +### Human Verification Required + +### 1. ConfigDiffView UI Interaction + +**Test:** Start the Tauri dev server, click the "Diff" button in the header view switcher +**Expected:** ConfigDiffView renders with Monaco DiffEditor showing config comparison +**Why human:** Visual rendering and interactive behavior cannot be verified programmatically + +### 2. View Switcher Button Styling + +**Test:** Click through Editor, Logs, and Diff buttons in the header +**Expected:** Active button is highlighted, others are muted; all three views render correctly +**Why human:** CSS styling and visual state transitions need visual inspection + +--- + +_Verified: 2026-03-12T21:30:00Z_ +_Verifier: Claude (gsd-verifier)_ diff --git a/AGENTS.md b/AGENTS.md index c5c53c96..fe1cfcf7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -184,9 +184,9 @@ Step-by-step process: -release-cch -CCH release workflow automation. Use when asked to "release CCH", "create a release", "prepare release", "tag version", "hotfix release", or "publish CCH". Covers version management from Cargo.toml, changelog generation from conventional commits, PR creation, tagging, hotfix workflows, and GitHub Actions release monitoring. -.opencode/skill/release-cch/SKILL.md +release-rulez +RuleZ release workflow automation. Use when asked to "release RuleZ", "create a release", "prepare release", "tag version", "hotfix release", or "publish RuleZ". Covers version management from Cargo.toml, changelog generation from conventional commits, PR creation, tagging, hotfix workflows, and GitHub Actions release monitoring. +.opencode/skill/release-rulez/SKILL.md diff --git a/CHANGELOG.md b/CHANGELOG.md index fc295ab7..fe3499b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to RuleZ (AI Policy Engine) will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.2.1] - 2026-03-13 + +### Fixed + +- **Renamed release-cch skill to release-rulez** — Fixed 149+ stale "cch" references across `.claude/skills/` and `.opencode/skill/` directories +- **Fixed broken preflight-check.sh** — Updated stale `cch_cli/` directory path to use workspace-level cargo commands + +### Added + +- **9 missing CLI commands documented** — Added `test`, `lint`, `upgrade`, `gemini install`, `gemini doctor`, `copilot install`, `copilot doctor`, `opencode install`, `opencode doctor` to mastering-hooks reference +- **ConfigDiffView wired into UI** — Added "Diff" button to header with routing to Monaco DiffEditor component + ## [2.2.0] - 2026-03-12 ### Added diff --git a/Cargo.toml b/Cargo.toml index b3c6fe5a..c4db12a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ exclude = ["rulez-ui/src-tauri"] resolver = "2" [workspace.package] -version = "2.2.0" +version = "2.2.1" authors = ["Rick Hightower "] license = "MIT OR Apache-2.0" edition = "2024" diff --git a/mastering-hooks/references/cli-commands.md b/mastering-hooks/references/cli-commands.md index de04598e..099407a2 100644 --- a/mastering-hooks/references/cli-commands.md +++ b/mastering-hooks/references/cli-commands.md @@ -404,6 +404,307 @@ rulez run security-check --dry-run --- +### test + +Run batch test scenarios against your rules configuration. Accepts a YAML test file defining scenarios with expected outcomes (allow, block, or inject), reports pass/fail for each, and exits with code 1 if any test fails. + +```bash +rulez test [OPTIONS] + +Options: + -v, --verbose Show detailed output for each test case (e.g., block reasons) +``` + +**Test file format** (`tests.yaml`): + +```yaml +tests: + - name: "Block force push" + event_type: PreToolUse + tool: Bash + command: "git push --force" + expected: block + + - name: "Allow normal read" + event_type: PreToolUse + tool: Read + path: "src/main.rs" + expected: allow + + - name: "Inject Python standards" + event_type: PreToolUse + tool: Write + path: "app.py" + expected: inject +``` + +Each test case supports fields: `name`, `event_type`, `tool`, `command`, `path`, `prompt`, and `expected` (one of `allow`, `block`, `inject`). + +**Examples**: + +```bash +# Run all test scenarios +rulez test tests.yaml + +# Verbose output (shows block reasons on failure) +rulez test tests.yaml --verbose +``` + +**Sample output**: + +``` +Running 3 test(s) from tests.yaml +============================================================ + + PASS Block force push + PASS Allow normal read + FAIL Inject Python standards + expected: inject, actual: allow + +============================================================ +2 passed, 1 failed, 3 total +``` + +--- + +### lint + +Analyze rule configuration for quality issues: duplicate rule names, overlapping rules, dead (disabled) rules, missing descriptions, invalid regex, conflicting actions, and missing priorities. + +```bash +rulez lint [OPTIONS] + +Options: + -c, --config Path to configuration file (default: .claude/hooks.yaml) + -v, --verbose Show detailed analysis (e.g., glob consolidation suggestions) +``` + +Diagnostics are categorized by severity: +- **ERROR** -- Issues that will cause incorrect behavior (duplicate names, no matchers, conflicting actions) +- **WARN** -- Issues worth investigating (overlapping rules, dead rules, missing descriptions, invalid regex) +- **INFO** -- Optimization suggestions (missing priority, glob consolidation) + +Exits with code 1 if any errors are found. + +**Examples**: + +```bash +# Lint default config +rulez lint + +# Lint a specific file +rulez lint --config /path/to/hooks.yaml + +# Show verbose analysis with optimization hints +rulez lint --verbose +``` + +**Sample output**: + +``` +rulez lint -- Rule Quality Analysis +================================== + +Loaded 5 rules from .claude/hooks.yaml + +[ERROR] duplicate-rule-name: Rules at positions 1 and 3 both have the name 'block-push' +[WARN] dead-rule: Rule 'old-checker' is disabled (metadata.enabled: false) -- consider removing it +[WARN] no-description: Rule 'quick-fix' has no description +[INFO] missing-priority: Rule 'standards' has no explicit priority (using default 0) + +Summary: 1 error, 2 warnings, 1 info +``` + +--- + +### upgrade + +Self-update the rulez binary to the latest GitHub release. Downloads the appropriate binary for your platform and replaces the current installation. + +```bash +rulez upgrade [OPTIONS] + +Options: + --check Only check for updates, do not install +``` + +**Examples**: + +```bash +# Check if an update is available +rulez upgrade --check + +# Download and install the latest version +rulez upgrade +``` + +**Sample output**: + +``` +Current version: 2.2.0 +Checking GitHub releases for latest version... +Latest version: 2.3.0 +Upgrade available: 2.2.0 -> 2.3.0 +Downloading and installing 2.3.0... +Successfully upgraded to 2.3.0! +Restart rulez to use the new version. +``` + +--- + +## Multi-Platform Commands + +RuleZ supports multiple AI coding assistants. Each platform has `install` and `doctor` subcommands. + +### gemini install + +Install RuleZ hooks for Gemini CLI. Registers hook entries in Gemini's `settings.json` for all supported events. + +```bash +rulez gemini install [OPTIONS] + +Options: + --scope Settings scope: project, user, or system (default: project) + -b, --binary Path to rulez binary (auto-detected if not specified) + --print Print JSON snippet without writing (alias: --dry-run) +``` + +**Events registered**: BeforeTool, AfterTool, BeforeAgent, AfterAgent, BeforeModel, AfterModel, BeforeToolSelection, SessionStart, SessionEnd, Notification, PreCompact + +**Examples**: + +```bash +# Install for current project +rulez gemini install + +# Install for user scope +rulez gemini install --scope user + +# Preview what would be written +rulez gemini install --print +``` + +--- + +### gemini doctor + +Diagnose Gemini hook installation and configuration. + +```bash +rulez gemini doctor [OPTIONS] + +Options: + --json Output machine-readable JSON +``` + +**Examples**: + +```bash +# Run diagnostics +rulez gemini doctor + +# Machine-readable output +rulez gemini doctor --json +``` + +--- + +### copilot install + +Install RuleZ hooks for GitHub Copilot CLI. Creates hook files in `.github/hooks/` and wrapper scripts. + +```bash +rulez copilot install [OPTIONS] + +Options: + -b, --binary Path to rulez binary (auto-detected if not specified) + --print Print JSON snippet without writing (alias: --dry-run) +``` + +**Events registered**: preToolUse, postToolUse + +**Examples**: + +```bash +# Install for current project +rulez copilot install + +# Preview the hooks file +rulez copilot install --print +``` + +--- + +### copilot doctor + +Diagnose Copilot hook installation and configuration. + +```bash +rulez copilot doctor [OPTIONS] + +Options: + --json Output machine-readable JSON +``` + +**Examples**: + +```bash +rulez copilot doctor +rulez copilot doctor --json +``` + +--- + +### opencode install + +Install RuleZ hooks for OpenCode. Registers hook entries in OpenCode's settings for all supported events. + +```bash +rulez opencode install [OPTIONS] + +Options: + --scope Settings scope: project or user (default: project) + -b, --binary Path to rulez binary (auto-detected if not specified) + --print Print JSON snippet without writing (alias: --dry-run) +``` + +**Events registered**: file.edited, tool.execute.before, tool.execute.after, session.updated + +**Examples**: + +```bash +# Install for current project +rulez opencode install + +# Install for user scope +rulez opencode install --scope user + +# Preview what would be written +rulez opencode install --print +``` + +--- + +### opencode doctor + +Diagnose OpenCode hook installation and configuration. + +```bash +rulez opencode doctor [OPTIONS] + +Options: + --json Output machine-readable JSON +``` + +**Examples**: + +```bash +rulez opencode doctor +rulez opencode doctor --json +``` + +--- + ## Exit Codes | Code | Meaning | diff --git a/rulez-ui/src/components/layout/Header.tsx b/rulez-ui/src/components/layout/Header.tsx index 5426023b..f8e5af2f 100644 --- a/rulez-ui/src/components/layout/Header.tsx +++ b/rulez-ui/src/components/layout/Header.tsx @@ -72,6 +72,18 @@ export function Header() { > Logs + {/* Mode indicator */} diff --git a/rulez-ui/src/components/layout/MainContent.tsx b/rulez-ui/src/components/layout/MainContent.tsx index fb3cd360..59d3b879 100644 --- a/rulez-ui/src/components/layout/MainContent.tsx +++ b/rulez-ui/src/components/layout/MainContent.tsx @@ -8,6 +8,7 @@ import { EditorToolbar } from "../editor/EditorToolbar"; import { ValidationPanel } from "../editor/ValidationPanel"; import { YamlEditor } from "../editor/YamlEditor"; import { FileTabBar } from "../files/FileTabBar"; +import { ConfigDiffView } from "../config/ConfigDiffView"; import { LogViewer } from "../logs/LogViewer"; export function MainContent() { @@ -72,6 +73,14 @@ export function MainContent() { ); } + if (mainView === "diff") { + return ( +
+ +
+ ); + } + return (
{/* Tab bar */} diff --git a/rulez-ui/src/stores/uiStore.ts b/rulez-ui/src/stores/uiStore.ts index 0f147164..f4f3e9d9 100644 --- a/rulez-ui/src/stores/uiStore.ts +++ b/rulez-ui/src/stores/uiStore.ts @@ -1,7 +1,7 @@ import { create } from "zustand"; export type RightPanelTab = "simulator" | "tree" | "settings"; -export type MainView = "editor" | "logs"; +export type MainView = "editor" | "logs" | "diff"; interface UIState { sidebarOpen: boolean;