Skip to content

fix: CLI help and docs papercuts#897

Merged
rohitg00 merged 2 commits into
mainfrom
fix/cli-docs-papercuts
Jun 10, 2026
Merged

fix: CLI help and docs papercuts#897
rohitg00 merged 2 commits into
mainfrom
fix/cli-docs-papercuts

Conversation

@rohitg00

@rohitg00 rohitg00 commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Batch of DX papercuts:

  • the connect agent list in --help is now derived from the adapter registry (18 agents, was a stale 9-name list)
  • unknown --tools values warn and name the valid set instead of silently meaning all
  • claude-code, hermes, and openclaw protocol notes point at real doc URLs (the docs/*.md paths never existed)
  • skill count corrected to 15 in the connect summary and AGENTS.md (said 8 and 4)
  • INSTALL_FOR_AGENTS.md names the real 8 core tools (consolidate, diagnose, lesson_save, reflect were missing; export, audit, governance delete were wrongly listed)
  • tool-count consistency test extended to guard the skill counts and the core tool sentence so they cannot drift again

Summary by CodeRabbit

  • Documentation

    • Updated release stats (skills count 4 → 15) and core tools list/descriptions
    • Updated connector documentation links to GitHub/integration pages
    • Updated CLI guidance to reference installing 15 skills
  • New Features

    • CLI validates the --tools option (accepts only "all" or "core")
    • Agent help output now lists known agents dynamically with improved wrapping
  • Tests

    • Added checks ensuring skills/tool counts match documentation and filesystem

- derive the connect agent list in --help from the adapter registry (18 agents, was a stale 9-name list)
- warn on unknown --tools values instead of silently treating them as all
- point claude-code, hermes, and openclaw protocol notes at real doc URLs (the docs/*.md paths never existed)
- correct skill count to 15 in the connect summary and AGENTS.md
- name the real 8 core tools in INSTALL_FOR_AGENTS.md
- extend the tool-count consistency test to guard skill counts and the core tool sentence
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentmemory Ready Ready Preview, Comment Jun 10, 2026 10:56pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c69ba086-ad15-4f91-8c20-bddbc9787849

📥 Commits

Reviewing files that changed from the base of the PR and between b4fbebd and b0595f3.

📒 Files selected for processing (1)
  • plugin/skills/agentmemory-agents/REFERENCE.md
✅ Files skipped from review due to trivial changes (1)
  • plugin/skills/agentmemory-agents/REFERENCE.md

📝 Walkthrough

Walkthrough

Updates project to reflect 15 agentmemory skills, defines a new core tools set, adds dynamic connect help with --tools validation, consolidates connector docs to GitHub links, and adds tests ensuring docs and CLI match filesystem-derived skill/tool counts.

Changes

Skills and Core Tools Update

Layer / File(s) Summary
CLI help and tools argument validation
src/cli.ts
knownAgents() is imported and rendered via wrapList() in connect [agent] help. The --tools argument is validated to accept only "all" or "core", warning and defaulting to "all" for others, and sets AGENTMEMORY_TOOLS.
Documentation and stats reflecting 15 skills and new core tools
AGENTS.md, INSTALL_FOR_AGENTS.md, src/cli/connect/index.ts
AGENTS.md skill count updated to 15; INSTALL_FOR_AGENTS.md core tool list rewritten to the new 8-tool core set; post-wire "Next:" message now references installing 15 skills.
Connector documentation URL consolidation
src/cli/connect/claude-code.ts, src/cli/connect/hermes.ts, src/cli/connect/openclaw.ts, plugin/skills/agentmemory-agents/REFERENCE.md
protocolNote/adapter reference rows updated to point to GitHub README/integrations locations instead of local docs/*.md links.
Consistency tests for skill and tool counts
test/tool-count-consistency.test.ts
Adds filesystem-backed tests using readdirSync to assert that plugin/skills directory counts match the skill count shown in docs/CLI and that INSTALL_FOR_AGENTS.md contains the computed core tool sentence from ESSENTIAL_TOOLS.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • rohitg00/agentmemory#709: Prior PR added the original npx skills add ... "Next:" hint (8 skills) that this PR updates to 15.
  • rohitg00/agentmemory#650: Defines AGENTMEMORY_TOOLS behavior and getVisibleTools() filtering that the CLI --tools validation and core set text rely on.
  • rohitg00/agentmemory#852: Related work around ESSENTIAL_TOOLS and test assertions for tool counts; connects to the new consistency tests here.

Poem

🐰 Fifteen skills hop into the light,
Help that matches agents, wrapped just right,
Docs and CLI now sing the same tune,
Tests keep counts steady like the moon,
A little rabbit cheers—huzzah, commune!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: CLI help and docs papercuts' clearly and concisely summarizes the primary changes: fixing developer experience issues in the CLI help text and documentation references.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cli-docs-papercuts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/cli/connect/claude-code.ts (1)

43-45: ⚡ Quick win

Extract duplicated URL to a constant.

The same GitHub URL appears in both docs (line 43) and protocolNote (line 45). Consider extracting it to a constant to prevent drift.

♻️ Proposed refactor
+const DOCS = "https://github.com/rohitg00/agentmemory#claude-code-one-block-paste-it";
+
 export const adapter: ConnectAdapter = {
   name: "claude-code",
   displayName: "Claude Code",
   category: "native",
-  docs: "https://github.com/rohitg00/agentmemory#claude-code-one-block-paste-it",
+  docs: DOCS,
   protocolNote:
-    "→ Using MCP. Hooks are also available — see https://github.com/rohitg00/agentmemory#claude-code-one-block-paste-it.",
+    `→ Using MCP. Hooks are also available — see ${DOCS}.`,
🤖 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/cli/connect/claude-code.ts` around lines 43 - 45, Extract the duplicated
GitHub URL used in the docs and protocolNote object properties into a single
constant (e.g., CLAUDE_CODE_DOCS_URL) and replace both occurrences with that
constant; update the definition near the top of the module and reference the
constant in the docs and protocolNote fields so the URL is maintained in one
place and cannot drift.
src/cli/connect/openclaw.ts (1)

11-13: ⚡ Quick win

Extract duplicated URL to a constant.

The same GitHub URL appears in both docs (line 11) and protocolNote (line 13). Extract it to a constant to prevent drift.

♻️ Proposed refactor
+const DOCS = "https://github.com/rohitg00/agentmemory/tree/main/integrations/openclaw";
+
 export const adapter = createJsonMcpAdapter({
   name: "openclaw",
   displayName: "OpenClaw",
   category: "native",
   detectDir: join(homedir(), ".openclaw"),
   configPath: join(homedir(), ".openclaw", "openclaw.json"),
-  docs: "https://github.com/rohitg00/agentmemory/tree/main/integrations/openclaw",
+  docs: DOCS,
   protocolNote:
-    "→ Using MCP. Hooks are also available — see https://github.com/rohitg00/agentmemory/tree/main/integrations/openclaw.",
+    `→ Using MCP. Hooks are also available — see ${DOCS}.`,
 });
🤖 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/cli/connect/openclaw.ts` around lines 11 - 13, Extract the duplicated
GitHub URL used in openclaw's metadata into a single constant (e.g.,
OPENCLAW_DOCS_URL) at the top of src/cli/connect/openclaw.ts and replace the
inline URL in both the docs field and inside protocolNote with that constant
(use string/template concatenation as needed for the arrow/prefix in
protocolNote). Ensure the constant name is descriptive and update both
references so the file no longer contains the same literal URL twice.
src/cli/connect/hermes.ts (1)

16-17: ⚡ Quick win

Reuse the existing DOCS constant.

The protocolNote hardcodes the GitHub URL that's already defined in the DOCS constant (line 9). The docs field already uses this constant (line 15)—protocolNote should follow the same pattern.

♻️ Proposed refactor
   protocolNote:
-    "→ Using MCP. Hooks are also available — see https://github.com/rohitg00/agentmemory/tree/main/integrations/hermes.",
+    `→ Using MCP. Hooks are also available — see ${DOCS}.`,
🤖 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/cli/connect/hermes.ts` around lines 16 - 17, The protocolNote currently
hardcodes the GitHub URL; change it to reuse the existing DOCS constant (the
same one used by the docs field) by referencing DOCS when constructing
protocolNote so the URL stays centralized; update the protocolNote string (in
the object that defines protocolNote and docs) to interpolate or concatenate
DOCS instead of the literal
"https://github.com/rohitg00/agentmemory/tree/main/integrations/hermes".
🤖 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/cli.ts`:
- Around line 211-217: The code warns on invalid toolsMode but still persists
the original value; update the branch that checks toolsMode (the if block
referencing toolsMode !== "all" && toolsMode !== "core") to normalize the value
before writing the env: set toolsMode = "all" (or desired fallback) inside that
block and then assign process.env["AGENTMEMORY_TOOLS"] = toolsMode so the
normalized value is persisted; ensure the p.log.warn message remains informative
and uses the normalized value if needed.

---

Nitpick comments:
In `@src/cli/connect/claude-code.ts`:
- Around line 43-45: Extract the duplicated GitHub URL used in the docs and
protocolNote object properties into a single constant (e.g.,
CLAUDE_CODE_DOCS_URL) and replace both occurrences with that constant; update
the definition near the top of the module and reference the constant in the docs
and protocolNote fields so the URL is maintained in one place and cannot drift.

In `@src/cli/connect/hermes.ts`:
- Around line 16-17: The protocolNote currently hardcodes the GitHub URL; change
it to reuse the existing DOCS constant (the same one used by the docs field) by
referencing DOCS when constructing protocolNote so the URL stays centralized;
update the protocolNote string (in the object that defines protocolNote and
docs) to interpolate or concatenate DOCS instead of the literal
"https://github.com/rohitg00/agentmemory/tree/main/integrations/hermes".

In `@src/cli/connect/openclaw.ts`:
- Around line 11-13: Extract the duplicated GitHub URL used in openclaw's
metadata into a single constant (e.g., OPENCLAW_DOCS_URL) at the top of
src/cli/connect/openclaw.ts and replace the inline URL in both the docs field
and inside protocolNote with that constant (use string/template concatenation as
needed for the arrow/prefix in protocolNote). Ensure the constant name is
descriptive and update both references so the file no longer contains the same
literal URL twice.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: b288936b-c4b4-4d3e-991c-38bd1ebc4638

📥 Commits

Reviewing files that changed from the base of the PR and between 25e7701 and b4fbebd.

📒 Files selected for processing (8)
  • AGENTS.md
  • INSTALL_FOR_AGENTS.md
  • src/cli.ts
  • src/cli/connect/claude-code.ts
  • src/cli/connect/hermes.ts
  • src/cli/connect/index.ts
  • src/cli/connect/openclaw.ts
  • test/tool-count-consistency.test.ts

Comment thread src/cli.ts
Comment on lines +211 to 217
if (toolsMode !== "all" && toolsMode !== "core") {
p.log.warn(
`Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`,
);
}
process.env["AGENTMEMORY_TOOLS"] = toolsMode;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize invalid --tools values before writing env.

At Line 216, invalid input is still persisted (AGENTMEMORY_TOOLS=<invalid>), even though Line 213 says fallback is all. Persist the normalized value instead.

Suggested fix
 const toolsMode = args[toolsIdx + 1]!;
+const normalizedToolsMode =
+  toolsMode === "all" || toolsMode === "core" ? toolsMode : "all";
 if (toolsMode !== "all" && toolsMode !== "core") {
   p.log.warn(
     `Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`,
   );
 }
-process.env["AGENTMEMORY_TOOLS"] = toolsMode;
+process.env["AGENTMEMORY_TOOLS"] = normalizedToolsMode;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (toolsMode !== "all" && toolsMode !== "core") {
p.log.warn(
`Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`,
);
}
process.env["AGENTMEMORY_TOOLS"] = toolsMode;
}
const normalizedToolsMode =
toolsMode === "all" || toolsMode === "core" ? toolsMode : "all";
if (toolsMode !== "all" && toolsMode !== "core") {
p.log.warn(
`Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`,
);
}
process.env["AGENTMEMORY_TOOLS"] = normalizedToolsMode;
}
🤖 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/cli.ts` around lines 211 - 217, The code warns on invalid toolsMode but
still persists the original value; update the branch that checks toolsMode (the
if block referencing toolsMode !== "all" && toolsMode !== "core") to normalize
the value before writing the env: set toolsMode = "all" (or desired fallback)
inside that block and then assign process.env["AGENTMEMORY_TOOLS"] = toolsMode
so the normalized value is persisted; ensure the p.log.warn message remains
informative and uses the normalized value if needed.

@rohitg00 rohitg00 merged commit f3dc7f8 into main Jun 10, 2026
7 checks passed
@rohitg00 rohitg00 deleted the fix/cli-docs-papercuts branch June 10, 2026 23:00
@mintlify

mintlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Docs PR opened: https://github.com/mintlify-community/docs-agentmemory-abc2951c/pull/2

Updated the connect agents page to list 18 supported agents including OpenCode, and documented the new --tools validation behavior.

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