Skip to content

feat(cli): self-document jrag enums in --help; decouple skill from agent persona#400

Merged
HumanBean17 merged 4 commits into
masterfrom
cli-skill-self-documenting
Jul 7, 2026
Merged

feat(cli): self-document jrag enums in --help; decouple skill from agent persona#400
HumanBean17 merged 4 commits into
masterfrom
cli-skill-self-documenting

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

Summary

Two related improvements to the CLI agent-facing surface (jrag + the explore-codebase-cli skill / explorer-rag-cli agent).

1. jrag is now self-documenting for enum filters

--role / --exclude-role / --java-kind / --framework / --capability now carry choices= (16 sites across find / inspect / http-routes / resolve_parent / implementations / search), so:

  • jrag <cmd> --help lists the valid values inline (--role {CONTROLLER,SERVICE,…}).
  • Mistyped values are rejected with the accepted set (proposal §9).
  • Flexible casing is preserved via a case-normalizing type= (controllerCONTROLLER, scheduled-taskSCHEDULED_TASK, Spring-MVCspring_mvc).

The choice sets are hardcoded module constants rather than imported — import mcp_v2 costs ~0.7s and would triple --help latency, and build_parser is documented to import no backend modules. Drift is guarded by tests/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:

  • Skill description no longer enumerates tools — it states when to use the skill (the body's job is how).
  • Skill body drops the read-only principle, the H1 title, and the "when to use" intro. A skill is invoked on demand by any agent — including a dev agent mid-research — so it must not impose a read-only persona.
  • Skill body treats jrag --help as the spec: slimmed the duplicated command/flag reference, kept only the judgment --help can't carry (resolve-first contract, edge semantics, FQN format).
  • Agent keeps its read-only persona + toolkit (appropriate for a dedicated subagent) and gains an explicit self-contained rule: never invoke the /explore-codebase-cli skill or spawn another explorer.

install_data mirrors re-synced via scripts/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.py21 passed.
  • tests/test_installer.py106 passed (surface deploy verified).
  • Full jrag suite — 255 passed (prior run; jrag.py unchanged since).

🤖 Generated with Claude Code

HumanBean17 and others added 4 commits July 7, 2026 10:27
…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>
@HumanBean17 HumanBean17 merged commit 101bbdf into master Jul 7, 2026
3 checks passed
@HumanBean17 HumanBean17 deleted the cli-skill-self-documenting branch July 7, 2026 14:50
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