Skip to content

docs: prefer JSON GitKB commands in agent guidance - #12

Merged
mateodelnorte merged 1 commit into
mainfrom
json-agent-guidance
May 19, 2026
Merged

mateodelnorte merged 1 commit into
mainfrom
json-agent-guidance

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Update the bundled GitKB Claude skill to use --json for code-intelligence commands that support it.
  • Update SessionStart guidance so Claude prefers git-kb code ... --json and preserves complete symbol IDs/stable fields.
  • Mirror JSON-safe examples in the plugin README and test setup.
  • Add BATS assertions for the JSON-safe SessionStart prompt.

Tests

  • make lint
  • make test
  • make release-check

KB: [[prefer-json-output-in-claude-plugin-guidance]]

Summary by CodeRabbit

  • Documentation

    • Updated CLI examples and guidance to prefer JSON output for code-intelligence commands, and clarified recommended doctor → index sequence and richer initialization guidance across session contexts.
  • Tests

    • Adjusted test expectations to match expanded guidance and JSON command examples; refined test setup to align with JSON-oriented invocation behavior.

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: da92f606-a80a-4e08-8b00-63cd4c76945f

📥 Commits

Reviewing files that changed from the base of the PR and between 19f708a and 86f7009.

📒 Files selected for processing (5)
  • plugin/README.md
  • plugin/scripts/session-start.sh
  • plugin/skills/gitkb/SKILL.md
  • tests/helpers/setup.bash
  • tests/session-start.bats

Walkthrough

The PR standardizes GitKB CLI documentation and guidance to consistently recommend the --json flag. The SessionStart hook guidance, README examples, SKILL documentation, and test assertions are all updated to promote JSON output across code-intelligence workflows, replacing prior non-JSON command variants.

Changes

JSON Output Standardization in GitKB CLI Documentation

Layer / File(s) Summary
SessionStart hook guidance updates
plugin/scripts/session-start.sh
The hook's injected CONTEXT is expanded with more prescriptive GitKB guidance for four CLI states: missing, full .kb ready, Git repo without .kb, and outside Git repo. New guidance includes additional command examples and consistent --json flag usage.
Public documentation of JSON-based CLI workflow
plugin/README.md, plugin/skills/gitkb/SKILL.md
README command example block and SKILL.md tables are updated to replace non-JSON command variants with --json equivalents for doctor, symbols, callers, callees, impact, dead, and query commands. The "Prefer Code Intelligence Over Grep" table and "without .kb" cheat sheet now emphasize JSON output and stable field/ID guarantees.
Test setup and assertions for updated guidance
tests/helpers/setup.bash, tests/session-start.bats
Test helper adjusts argument formatting for --json option, and test assertions are expanded to verify the hook emits the new JSON-oriented guidance across state variations including canonical setup, init-free code-intelligence workflows, and install guidance scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • gitkb/gitkb-claude-plugin#3: Both PRs modify plugin/scripts/session-start.sh's injected CONTEXT/guidance and overlap on JSON-oriented command examples and hook message construction.
  • gitkb/gitkb-claude-plugin#9: Both PRs change SessionStart hook guidance and related SKILL.md content around preferring git-kb code over grep and recommending specific code-intel commands.

Poem

🐰 I hopped through docs and tests today,

Tucked --json flags where examples lay.
From hook to README, a tidy trail,
Stable IDs and outputs prevail.
🥕 Hooray for tidy JSON mail!

🚥 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 'docs: prefer JSON GitKB commands in agent guidance' directly and clearly summarizes the main change across all modified files—updating documentation and test guidance to prefer JSON-formatted GitKB commands.
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 json-agent-guidance

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: 1

🤖 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 `@plugin/scripts/session-start.sh`:
- Line 18: Update the CONTEXT string in session-start.sh to remove all
occurrences of the non-existent --json flag from the promoted git-kb commands;
specifically edit the example mentions like "git-kb code doctor --json", "git-kb
code index" usage guidance and the generic "git-kb code ... --json" reference so
they instead show the commands without --json (e.g., "git-kb code doctor",
"git-kb code index", and related "git-kb code ..." commands), leaving the rest
of the installation and init instructions unchanged.
🪄 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: f3e29546-d3a6-4c75-b667-8cab121b6b90

📥 Commits

Reviewing files that changed from the base of the PR and between 5c28832 and 19f708a.

📒 Files selected for processing (5)
  • plugin/README.md
  • plugin/scripts/session-start.sh
  • plugin/skills/gitkb/SKILL.md
  • tests/helpers/setup.bash
  • tests/session-start.bats

Comment thread plugin/scripts/session-start.sh Resolved
@mateodelnorte
mateodelnorte force-pushed the json-agent-guidance branch from 19f708a to 86f7009 Compare May 19, 2026 18:17
@mateodelnorte
mateodelnorte merged commit bc2854b into main May 19, 2026
2 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