feat(005): add skillrig show for a human-friendly full skill view#19
Conversation
Review Summary by QodoAdd
WalkthroughsDescription• Adds skillrig show command with info alias for reading complete skill details • Implements exact-name lookup primitive FindSkill in skillcore for point-lookup matching • Renders full untruncated descriptions in human-friendly format and JSON output • Closes issue #17 by exposing complete skill records that search truncates to ~80 chars • Extends CLI documentation, skill routing, and integration test suite with show-specific scenarios Diagramflowchart LR
A["User invokes<br/>skillrig show SKILL"] --> B["Resolve origin<br/>via config/env"]
B --> C["Load catalog<br/>index.json"]
C --> D["FindSkill exact<br/>name lookup"]
D --> E["Render full record"]
E --> F["Human output<br/>with complete desc"]
E --> G["JSON output<br/>origin + skill"]
H["Unknown skill"] --> I["Exit 1 with<br/>what/why/fix"]
File Changes1. internal/cli/show.go
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
152 rules 1. show getwd error lacks fix
|
Adds `skillrig show <skill>` (alias `info`), a Query-pattern command that prints ONE origin skill's complete record — most importantly its full, untruncated description, which `search` clips to ~80 chars and which a human otherwise could only recover via `--json | jq` (issue #17). show reuses search's resolver + catalog-load + convention-gate path (AP-04) and dispatches to a single new exact-name lookup primitive, skillcore.FindSkill. A named skill the origin does not publish is exit 1 with what/why/fix navigation (distinct from search, where an empty query is exit 0). --json emits {origin, skill} with the whole catalog entry. Co-evolution: extends the consolidated skillrig skill (routing row + references/show.md + description keywords), the cli.md command list + Query pattern classification, and the root README. Quickstart contract in specledger/004-show-skill/quickstart.md maps 1:1 to TestQuickstart_Show*. Closes #17 https://claude.ai/code/session_01SAczAuBfsd2hTEGrFBsmQZ
Resolves the actionable Qodo findings on the show command: - getwd error now carries a fix: line. Extracted a single usageCannotGetwd helper (repo.go) and routed every command's os.Getwd failure through it (show/search/add/verify/index/init), so the what/why/fix cannot drift per command (AP-06 discipline). - "search failed" misattribution: generalized mapSearchError into mapCatalogError(cmd, origin, err); search passes "search", show passes "show", so an unclassified failure names the real command. - Terminal-injection hardening: catalog text is fetched and untrusted, so human output now strips control bytes / neutralizes ANSI escapes via sanitizeTerminal (single-line fields drop newlines; show's description body keeps them). Applied to both show and search; --json is never sanitized. Added unit coverage. - show unit test now asserts output SHAPE (exact header/field lines + footer-as-final-line), not only substrings. - cli.md: scoped the 80-char/newline truncation rule to compact LIST output and documented show as the deliberate full-detail exception (issue #17) — show intentionally prints the complete description. The full-description behavior (Qodo #2) and the runnable footer (Qodo #3) are intentional: show exists to print the untruncated description, and per the agentskills.io spec a skill `name` is a lowercase alphanumeric-hyphen slug (no leading/trailing hyphen, no spaces), so the footer command is always shell/cobra-safe for conformant origins. https://claude.ai/code/session_01SAczAuBfsd2hTEGrFBsmQZ
d4f4bd8 to
d97495b
Compare
The 004 slot is taken by the 004-doctor branch (skillrig doctor). Move this feature's quickstart contract to specledger/005-show-skill/ and update the integration-suite references to match. No behavior change. https://claude.ai/code/session_01SAczAuBfsd2hTEGrFBsmQZ
skillrig show for a human-friendly full skill viewskillrig show for a human-friendly full skill view
Hermes review + e2e test recommendationI reviewed PR #19 ( Suggested e2e shapeAdd coverage to the existing true-auth workflow in
I implemented this locally as Verification runPassed locally: Note: plain Review findingOne correctness issue still looks worth fixing before merge: |
Addresses the Hermes/sakul-learning review on PR #19: - Footer runnability (also Qodo #3): the `skillrig add <name>` hint now routes the name through shellSafeSkillArg — a spec-conformant agentskills.io slug is emitted bare, while a non-conformant name (leading dash, spaces, metacharacters that only a malformed origin could publish) is single-quoted and `--`-guarded so the printed command stays runnable in a shell and under cobra. Unit-tested. - True e2e coverage: TestE2E_FullWorkflow now runs init -> search -> show -> add over the real auth-gated git http-backend remote, for both the default branch and @staging. The show step asserts exit 0 / empty stderr, a parseable {origin, skill}, that origin preserves the configured reference (incl. @staging), the point-lookup name, and populated record fields. The @staging case targets the branch-only `staging-only` skill, proving show reads the @ref'd catalog. Verified green with `make test-e2e` (real git-http-backend + token gate). The full-description behavior remains intentional (issue #17). Enforcing the name slug at ingestion (index/lint) is still the right system-wide invariant and is left as a follow-up. https://claude.ai/code/session_01SAczAuBfsd2hTEGrFBsmQZ
|
Thanks @sakul-learning — both points addressed in eb58ba0 (no patch hand-off needed, I implemented them directly): e2e coverage — Footer runnability — agreed, and with two reviewers on it I made the footer shell/cobra-safe rather than only deferring to ingestion. Full suite, Generated by Claude Code |
Hermes follow-up reviewI re-checked the full PR comment thread and the latest head commit My earlier concern is sufficiently addressed:
I verified locally on the latest PR head: Only remaining note is non-blocking: enforcing the agentskills.io slug invariant at ingestion/index/lint would still be a useful follow-up, but this PR now defensively handles the consumer-side footer and covers the show path e2e. |
Adds
skillrig show <skill>(aliasinfo), a Query-pattern command thatprints ONE origin skill's complete record — most importantly its full,
untruncated description, which
searchclips to ~80 chars and which ahuman otherwise could only recover via
--json | jq(issue #17).show reuses search's resolver + catalog-load + convention-gate path
(AP-04) and dispatches to a single new exact-name lookup primitive,
skillcore.FindSkill. A named skill the origin does not publish is exit 1
with what/why/fix navigation (distinct from search, where an empty query
is exit 0). --json emits {origin, skill} with the whole catalog entry.
Co-evolution: extends the consolidated skillrig skill (routing row +
references/show.md + description keywords), the cli.md command list +
Query pattern classification, and the root README. Quickstart contract in
specledger/004-show-skill/quickstart.md maps 1:1 to TestQuickstart_Show*.
Closes #17
https://claude.ai/code/session_01SAczAuBfsd2hTEGrFBsmQZ