Skip to content

Add sprout-cli agent skill to nest initialization#613

Draft
wpfleger96 wants to merge 4 commits into
mainfrom
cli-agent-skill
Draft

Add sprout-cli agent skill to nest initialization#613
wpfleger96 wants to merge 4 commits into
mainfrom
cli-agent-skill

Conversation

@wpfleger96
Copy link
Copy Markdown
Collaborator

@wpfleger96 wpfleger96 commented May 18, 2026

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.md still documents MCP tools, not CLI commands.

Ships a ~1,350-word SKILL.md covering 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.md on first launch. Uses the same idempotent O_CREAT|O_EXCL pattern as AGENTS.md so user edits are never overwritten.

  • Creates nest_skill.md with YAML frontmatter (name: sprout-cli, version: 1) and a quick-reference table of the 18 most-used subcommands
  • Extends ensure_nest_at() to create .claude/skills/sprout-cli/ and write SKILL.md; sets 700 Unix permissions on all three intermediate dirs (.claude/, .claude/skills/, .claude/skills/sprout-cli/) — symlink-safe
  • Adds 3 unit tests: file creation, idempotent no-overwrite, and 700 permissions (the permissions test asserts all three dirs in the skill path)

Second commit corrects skill content inaccuracies found during review, and third commit syncs descriptions with post-parity CLI output shapes:

  • canvas get returns markdown string or null (not a JSON array of events)
  • reactions get returns {"reactions": [{emoji, count, pubkeys}]} (not raw kind:7 events)
  • users get always returns an array, even for single profile lookups
  • workflows get documents normalized return shape ({workflow_id, content, created_at, pubkey})
  • workflows runs notes empty-result limitation (run history is DB-backed, not event-based)
  • Error stderr categories corrected to match error.rs enum variants
  • set-presence caveat added (ephemeral kind rejected by HTTP bridge)

Companion to #612 — the skill documents the CLI's behavior after the parity fixes land.

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.
Reformat code after rebasing onto main (which includes PR #614's
nest.rs additions). No logic changes.
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