Skip to content

Remove embedded meta agent subcommand - #24

Merged
mateodelnorte merged 2 commits into
mainfrom
harmony-678-meta-agent-removal
May 19, 2026
Merged

mateodelnorte merged 2 commits into
mainfrom
harmony-678-meta-agent-removal

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • remove the built-in meta agent command group from meta_cli
  • delete the embedded guard/score implementation now owned by the standalone agent project
  • update meta init claude hook generation to call agent guard
  • drop unused dirs, regex, and toml dependencies

Verification

  • cargo test -p meta
  • bats tests/init.bats
  • ./target/debug/meta --help no longer lists agent
  • ./target/debug/meta agent guard exits unrecognized

Task: [[tasks/harmony-678]]

Summary by CodeRabbit

  • Documentation

    • Updated destructive-command safety documentation
  • Changes

    • PreToolUse hook command updated from meta agent guard to agent guard; now requires standalone agent CLI
    • Marketplace plugin registration now targets GitKB Claude plugin marketplace
    • Removed internal guard and scoring modules
    • Dependencies updated and consolidated

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 19, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cc6f8ed3-09c8-4ac8-a7cc-1ec755ac72dc

📥 Commits

Reviewing files that changed from the base of the PR and between 6e4f32c and ab34974.

📒 Files selected for processing (9)
  • .claude/agent-guard.toml
  • .claude/rules/meta-destructive-commands.md
  • Cargo.toml
  • src/agent_guard.rs
  • src/agent_score.rs
  • src/init.rs
  • src/lib.rs
  • src/main.rs
  • src/registry.rs
💤 Files with no reviewable changes (6)
  • src/lib.rs
  • .claude/agent-guard.toml
  • Cargo.toml
  • src/agent_score.rs
  • src/agent_guard.rs
  • src/main.rs

Walkthrough

This pull request removes the agent_guard and agent_score modules entirely and refactors hook execution to use a standalone agent CLI tool. The PreToolUse hook command changes from meta agent guard to agent guard, with runtime availability checking and marketplace registration migrated from harmony-labs to gitkb. Dependencies and test assertions are updated accordingly.

Changes

Agent module removal and CLI migration

Layer / File(s) Summary
Module removal and CLI restructuring
src/lib.rs, src/main.rs
Removes public exports of agent_guard and agent_score modules from the crate root and reorganizes the Commands enum and argument type definitions to consolidate the CLI structure.
Hook command and initialization updates
src/init.rs
Migrates the PreToolUse hook from meta agent guard to standalone agent guard; adds agent_cli_available() check that displays a warning if the agent CLI is not installed; updates marketplace registration to target gitkb/claude-plugins instead of harmony-labs; updates test expectations for generated settings and hook configuration.
Documentation, registry, and dependency consolidation
.claude/rules/meta-destructive-commands.md, Cargo.toml, src/registry.rs
Updates documentation to reference agent guard instead of meta agent guard; removes unused dependencies (toml, regex, dirs) and adds logging and archive-handling crates; tightens registry test to assert exact URL match for the gitkb meta-plugins repository.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 The agent now stands alone and true,
No longer wrapped in meta's clue,
With gitkb's banner held on high,
Dependencies trimmed—watch the project fly! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove embedded meta agent subcommand' directly and accurately describes the main change: deletion of the built-in meta agent command group and its implementations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch harmony-678-meta-agent-removal

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/init.rs (1)

394-396: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale comment to reflect GitKB organization.

The comment still mentions "Harmony Labs marketplace" but the implementation now registers the GitKB marketplace (line 421).

📝 Proposed fix
-/// Register the Harmony Labs marketplace with Claude Code (if available).
+/// Register the GitKB marketplace with Claude Code (if available).
 /// This is best-effort — if `claude` is not on PATH, skip silently.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/init.rs` around lines 394 - 396, Update the stale doc comment above the
conditional cfg(not(test)) block to say that the code registers the "GitKB
marketplace" with Claude Code instead of "Harmony Labs marketplace"; locate the
comment that starts "Register the Harmony Labs marketplace with Claude Code" in
init.rs (adjacent to the cfg(not(test)) block/registration logic) and replace
the old name so the comment accurately matches the implementation that registers
the GitKB marketplace.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/init.rs`:
- Line 308: The PreToolUse hook invokes the external "agent" CLI via the "agent
guard" command but lacks an availability check or documentation; add a runtime
check like the existing claude availability pattern by attempting
Command::new("agent").arg("--version")... and set an agent_available flag (e.g.,
agent_available) to detect absence, then print a yellow warning with install
instructions when false; additionally, update the success/usage output near the
PreToolUse registration message to note that PreToolUse hooks require the
standalone "agent" CLI (install from gitkb/agent) so users are informed.

In `@src/registry.rs`:
- Around line 2038-2040: Replace the loose substring checks in
test_default_registry_points_to_gitkb with an exact equality assertion against
the canonical default registry URL: instead of
assert!(DEFAULT_REGISTRY.contains("gitkb")) /
assert!(DEFAULT_REGISTRY.contains("meta-plugins")), use
assert_eq!(DEFAULT_REGISTRY, "<expected-default-registry-URL>") (put the exact
URL string your project intends as the default). This ensures the
DEFAULT_REGISTRY constant is exactly the expected URL and prevents false
positives.

---

Outside diff comments:
In `@src/init.rs`:
- Around line 394-396: Update the stale doc comment above the conditional
cfg(not(test)) block to say that the code registers the "GitKB marketplace" with
Claude Code instead of "Harmony Labs marketplace"; locate the comment that
starts "Register the Harmony Labs marketplace with Claude Code" in init.rs
(adjacent to the cfg(not(test)) block/registration logic) and replace the old
name so the comment accurately matches the implementation that registers the
GitKB marketplace.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: eafa0e9c-75f2-46a3-a069-5c13ee361eb6

📥 Commits

Reviewing files that changed from the base of the PR and between b3e74c1 and 6e4f32c.

📒 Files selected for processing (12)
  • .claude/agent-guard.toml
  • .claude/rules/meta-destructive-commands.md
  • .github/workflows/auto-format.yml
  • .github/workflows/ci.yml
  • .github/workflows/notify-downstream.yml
  • Cargo.toml
  • src/agent_guard.rs
  • src/agent_score.rs
  • src/init.rs
  • src/lib.rs
  • src/main.rs
  • src/registry.rs
💤 Files with no reviewable changes (6)
  • Cargo.toml
  • src/lib.rs
  • src/agent_score.rs
  • .claude/agent-guard.toml
  • src/agent_guard.rs
  • src/main.rs

Comment thread src/init.rs
Comment thread src/registry.rs Outdated
@mateodelnorte
mateodelnorte force-pushed the harmony-678-meta-agent-removal branch from 6e4f32c to ab34974 Compare May 19, 2026 01:59
@mateodelnorte
mateodelnorte merged commit 4d782e9 into main May 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant