feat(affordance): usage guidance for shortcuts and per-command skills#1793
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughThis PR adds affordance-ref metadata for commands, extends affordance markdown parsing with skills merging and verbatim shortcut headings, updates help rendering to use the new metadata and skill filesystem, and refreshes related affordance and contact documentation. ChangesAffordance ref, skills merge, and help rendering
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1793 +/- ##
=======================================
Coverage 74.42% 74.42%
=======================================
Files 860 860
Lines 89754 89827 +73
=======================================
+ Hits 66797 66852 +55
- Misses 17779 17795 +16
- Partials 5178 5180 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@d43f41a8a0714e7044b79f9b0defdf352d9f1452🧩 Skill updatenpx skills add larksuite/cli#feat/affordance-usage-guidance -y -g |
f749710 to
592497b
Compare
592497b to
750c1e5
Compare
Extend the affordance overlay (per-command --help guidance) beyond generated service-API methods to +-prefixed shortcuts, and let a command point at specific related skills. - shortcuts render the same guidance block as methods, from `## +cmd` entries in affordance/<domain>.md; the lookup coordinate is unified in cmdmeta (SetAffordanceRef/AffordanceRef) so both share one path - PrepareShortcutHelp composes onto the command's captured base, so a shortcut's PostMount-authored Long (e.g. the docs "read the skill" directive) is preserved, not clobbered - a per-command `### Skills` section merges with the domain `> skill:` default (deduped, domain first); an entry may be a bare skill name or a name/relpath reference (lark-contact/references/x.md), validated against the embedded skill tree and dropped when unresolved - +-prefixed headings resolve verbatim (no space->dot folding) - guide contact's +search-user / +get-user shortcuts, dropping the +search-user Go tips now covered by the overlay's examples and lead Tips precedence: a shortcut's overlay `### Tips` replace its Go Tips field.
750c1e5 to
d43f41a
Compare
What
Extends the affordance overlay (per-command
--helpguidance authored inaffordance/<domain>.md) beyond generated service-API methods to+-prefixed shortcuts, and lets a command point at specific related skills.Changes
## +cmdentries. The affordance lookup coordinate is unified incmdmeta(SetAffordanceRef/AffordanceRef) so method and shortcut help share one path (the two packages can't import each other;cmdmetais the neutral layer).PrepareShortcutHelpcomposes onto the command's captured base, so a shortcut that sets a hand-authoredLongin PostMount (e.g. the docs shortcuts' "agents MUST read the skill / MUST NOT grep local SKILL.md" directive) keeps it — the affordance block is appended below, never clobbered. Re-render is idempotent.### Skills: merges with the domain> skill:default (deduped, domain first). An entry may be a bare skill name or aname/relpathreference (e.g.lark-contact/references/lark-contact-search-user.md) so a command can point at its own reference rather than only re-listing the domain skill. Each is validated against the embedded skill tree and dropped when it doesn't resolve, so help never prints an unopenableskills readpointer.+heading resolution:+-prefixed headings key verbatim (no space→dot folding).+search-user/+get-usershortcuts (each points at its own reference).Tips precedence
A shortcut may carry a Go
Tipsfield and an overlay### Tips. The overlay wins and replaces the Go tips (not merged) — documented in code and README; keep tips in one place.Testing
PrepareShortcutHelp(compose/idempotency/PostMount-preservation), related-skill stat gating both directions (existing renders, typo/bad-reference dropped, nil FS suppresses),### Skillsmerge/dedup,+heading verbatim.go build ./...,go vet, and the affected package tests are green on anorigin/mainbase.Summary by CodeRabbit
+-prefixed shortcut headings are now matched verbatim.Tipsoverlay replaces (rather than merges) any base tips.+search-userand+get-user.