Add sprout-cli agent skill to nest initialization#613
Merged
Conversation
59513f8 to
21e60fb
Compare
5af942b to
3474e1e
Compare
6efb35d to
f10c655
Compare
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. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
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.
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
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.
Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Reformat code after rebasing onto main (which includes PR #614's nest.rs additions). No logic changes. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Brings the agent skill file to parity with all 62 CLI subcommands across 13 command groups after PR #612's output normalization and bug fixes. Adds 5 missing command groups (social, repos, upload, mem, pack), 5 missing subcommands in existing groups (channels update/ add-member/remove-member, workflows update/delete), missing flags (--file, --mention, --kinds, --depth-limit, --limit), fixes output contract inaccuracies (channels get pubkey field, workflows list pubkey, exit code 5, feed description), and restructures the Quick Reference table by output pattern for scannability. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Documents the new --limit flag on channels list and the global --format json|compact flag added in PR #612. Compact mode reduces read output: channels → {channel_id, name}, messages → {id, content, created_at}, users → {pubkey, display_name}. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Add missing send-diff optional flags, mark repos create --name as optional, document --owner on all mem subcommands, add --allow-empty to mem patch, remove dead --depth-limit from thread example, and document social set-list --content. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
The skill duplicated the CLI's own per-subcommand --help (usage, flags, examples). Rewrite to teach what --help can't: discovery, conventions (UUID vs hex, stdin -, --format), output asymmetries, error/exit contract, polling. Point to 'sprout <cmd> --help' for the rest. 630 deletions, 78 insertions. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
Source audit (crates/sprout-cli/) caught five wrong claims inherited from or worsened by the original file: - No --format flag exists; removed all references. - Reads are NOT normalized — every read prints the raw relay /query response (raw Nostr events with sig). Reframed accordingly. - canvas get returns kind:40100 event JSON, not a markdown string. - Default get kinds are [9, 40002], not the 5-kind list. - --kind on send is dead code (#[allow(dead_code)]); send is always kind:9. Removed the forum-routing claim. Also: feed ordering is relay-determined, not a CLI guarantee. Every retained claim verified against source + live binary. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
650 → 100 lines (85% reduction). Agents can discover flags via `sprout --help` — the skill now documents only what --help can't: output contracts, compact format projections, behavioral gotchas, mem patch workflow, and polling pattern. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
f10c655 to
604939d
Compare
wpfleger96
added a commit
that referenced
this pull request
May 22, 2026
rustfmt fixes after rebase onto main (extra blank lines in lib.rs and nest.rs). Bump nest.rs file size override from 800 to 960 to account for skill file init code merged from #613. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
wpfleger96
added a commit
that referenced
this pull request
May 22, 2026
rustfmt fixes after rebase onto main (extra blank lines in lib.rs and nest.rs). Bump nest.rs file size override from 800 to 960 to account for skill file init code merged from #613. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
wpfleger96
added a commit
that referenced
this pull request
May 22, 2026
rustfmt fixes after rebase onto main (extra blank lines in lib.rs and nest.rs). Bump nest.rs file size override from 800 to 960 to account for skill file init code merged from #613. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
wpfleger96
added a commit
that referenced
this pull request
May 23, 2026
rustfmt fixes after rebase onto main (extra blank lines in lib.rs and nest.rs). Bump nest.rs file size override from 800 to 960 to account for skill file init code merged from #613. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
wpfleger96
added a commit
that referenced
this pull request
May 26, 2026
rustfmt fixes after rebase onto main (extra blank lines in lib.rs and nest.rs). Bump nest.rs file size override from 800 to 960 to account for skill file init code merged from #613. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
wpfleger96
added a commit
that referenced
this pull request
May 26, 2026
rustfmt fixes after rebase onto main (extra blank lines in lib.rs and nest.rs). Bump nest.rs file size override from 800 to 960 to account for skill file init code merged from #613. Signed-off-by: Will Pfleger <wpfleger@block.xyz>
This was referenced May 28, 2026
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
SKILL.mdcovering all 13 CLI command groups and 62 subcommands (messaging, channels, canvas, reactions, DMs, users, workflows, feed, social, repos, upload, mem, pack), 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.Skill content covers:
SPROUT_PRIVATE_KEY,SPROUT_RELAY_URL, output conventions, error format, exit codes 0-5)-)sig(social/repos), raw markdown (canvas get), pretty-printed blob descriptors (upload), stderr-only progress (mem write commands)--sincecursor advancement)Implementation:
nest_skill.mdwith YAML frontmatter (name: sprout-cli,version: 1) compiled in viainclude_str!ensure_nest_at()to create.claude/skills/sprout-cli/and writeSKILL.md; sets 700 Unix permissions on all three intermediate dirs — symlink-safeCompanion to #612 — the skill documents the CLI's behavior after the parity fixes land.