feat(cli): self-document jrag enums in --help; decouple skill from agent persona#400
Merged
Conversation
…ent persona - jrag: add choices= + case-normalizing type= to --role/--exclude-role/--java-kind/--framework/--capability (16 sites); `jrag <cmd> --help` now lists valid values and rejects mistyped ones. Choice sets are hardcoded module constants (sourced from mcp_v2 / java_ontology, kept in sync by tests/test_jrag_enum_choices.py) so --help stays fast — build_parser imports no backend modules. - skill (explore-codebase-cli): treat `jrag --help` as the spec and slim the duplicated command/flag reference. Drop persona constraints that don't belong in a reusable skill — the read-only principle, the H1/"when to use" intro, and the tool enumeration from the description. A skill is invoked on demand by any agent (incl. a dev agent mid-research); it teaches how, not when. - agent (explorer-rag-cli): add a self-containment rule — never invoke the /explore-codebase-cli skill or spawn another explorer; the methodology is baked in. - install_data mirrors re-synced via scripts/sync_agent_artifacts.py. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related improvements to the CLI agent-facing surface (
jrag+ theexplore-codebase-cliskill /explorer-rag-cliagent).1.
jragis now self-documenting for enum filters--role/--exclude-role/--java-kind/--framework/--capabilitynow carrychoices=(16 sites acrossfind/inspect/http-routes/resolve_parent/implementations/search), so:jrag <cmd> --helplists the valid values inline (--role {CONTROLLER,SERVICE,…}).type=(controller→CONTROLLER,scheduled-task→SCHEDULED_TASK,Spring-MVC→spring_mvc).The choice sets are hardcoded module constants rather than imported —
import mcp_v2costs ~0.7s and would triple--helplatency, andbuild_parseris documented to import no backend modules. Drift is guarded bytests/test_jrag_enum_choices.py, which cross-checks the constants against the canonical literals (mcp_v2.Role/DeclarationSymbolKind/Framework,java_ontology.VALID_CAPABILITIES).2. Skill ≠ Agent (decouple persona from reusable methodology)
The CLI skill had drifted into reading like the agent's system prompt. Fixed:
descriptionno longer enumerates tools — it states when to use the skill (the body's job is how).jrag --helpas the spec: slimmed the duplicated command/flag reference, kept only the judgment--helpcan't carry (resolve-first contract, edge semantics, FQN format)./explore-codebase-cliskill or spawn another explorer.install_datamirrors re-synced viascripts/sync_agent_artifacts.py; shipped artifacts deploy verbatim.Test status
tests/test_jrag_enum_choices.py(new) — enum cross-check + flexible-casing + rejection.tests/test_agent_skills_static.py— 21 passed.tests/test_installer.py— 106 passed (surface deploy verified).jragsuite — 255 passed (prior run;jrag.pyunchanged since).🤖 Generated with Claude Code