Add sprout-cli agent skill to nest initialization#613
Draft
wpfleger96 wants to merge 3 commits into
Draft
Conversation
Agents migrating from the MCP server to the CLI have no structured guidance on command usage, output formats, or polling patterns. Ships a 1,350-word SKILL.md covering all 12 command groups, written to ~/.sprout/.claude/skills/sprout-cli/ on first launch using the same idempotent O_CREAT|O_EXCL pattern as AGENTS.md.
Four inaccuracies in nest_skill.md caught by comparing against CLI source:
1. canvas get returns a JSON array of kind:40100 events (markdown in
`content`), not a plain markdown string. Agents parsing this as a
raw string would get the Nostr event wrapper, not the content.
2. reactions get returns a raw JSON array of kind:7 events, not the
aggregated {"reactions": [...]} shape. No aggregation happens in
cmd_get_reactions.
3. Error stderr category field values were placeholder text ("input error",
"network/relay error") instead of the actual enum values emitted by
error.rs: user_error, relay_error, network_error, auth_error, key_error.
4. set-presence documents as working but cmd_set_presence has an explicit
comment noting it always fails — kind:20001 is ephemeral and the relay
rejects it over HTTP POST. Added a "this will fail" caveat.
Also fixes a permission gap in nest.rs: create_dir_all(".claude/skills/
sprout-cli") created the intermediate .claude/ and .claude/skills/ dirs
with umask-default permissions (typically 755), but only the final
sprout-cli/ dir was chmod'd to 700. Lock down all three dirs in the
skill path, matching how NEST_DIRS are handled. Test updated to assert
all three dirs get 700 on Unix.
Docstring for ensure_nest_at updated to mention SKILL.md.
Sync SKILL.md descriptions with post-review CLI output shapes: canvas
get returns markdown string or null (not event array), reactions get
returns grouped {emoji, count, pubkeys} (not raw events), users get
always returns array, workflows get documents normalized shape, workflows
runs notes empty-result limitation. Quick reference table updated.
59513f8 to
21e60fb
Compare
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.
Agents migrating from the MCP server to the CLI have no structured guidance on command usage, output formats, or polling patterns. The existing
~/.sprout/AGENTS.mdstill documents MCP tools, not CLI commands.Ships a ~1,350-word
SKILL.mdcovering all 12 CLI command groups (messaging, channels, canvas, reactions, DMs, users, workflows, feed, plus environment/conventions/polling sections), written to~/.sprout/.claude/skills/sprout-cli/SKILL.mdon first launch. Uses the same idempotentO_CREAT|O_EXCLpattern asAGENTS.mdso user edits are never overwritten.nest_skill.mdwith YAML frontmatter (name: sprout-cli,version: 1) and a quick-reference table of the 18 most-used subcommandsensure_nest_at()to create.claude/skills/sprout-cli/and writeSKILL.md; sets 700 Unix permissions on all three intermediate dirs (.claude/,.claude/skills/,.claude/skills/sprout-cli/) — symlink-safeSecond commit corrects skill content inaccuracies found during review, and third commit syncs descriptions with post-parity CLI output shapes:
canvas getreturns markdown string ornull(not a JSON array of events)reactions getreturns{"reactions": [{emoji, count, pubkeys}]}(not raw kind:7 events)users getalways returns an array, even for single profile lookupsworkflows getdocuments normalized return shape ({workflow_id, content, created_at, pubkey})workflows runsnotes empty-result limitation (run history is DB-backed, not event-based)error.rsenum variantsset-presencecaveat added (ephemeral kind rejected by HTTP bridge)Companion to #612 — the skill documents the CLI's behavior after the parity fixes land.