docs: zero-to-hero tutorial + reference + AgentSkill (takeover of #63) - #138
Open
vpavlin wants to merge 4 commits into
Open
docs: zero-to-hero tutorial + reference + AgentSkill (takeover of #63)#138vpavlin wants to merge 4 commits into
vpavlin wants to merge 4 commits into
Conversation
This was referenced Apr 24, 2026
vpavlin
force-pushed
the
docs/tutorial-reference-takeover
branch
from
May 18, 2026 10:04
186ed4a to
1f81834
Compare
Adds a guided tutorial, a five-part reference (CLI, IDL, macros, types, client-gen), and an AgentSkill for agent-driven SPEL work. Verified end to end against a live LEZ v0.2.4 sequencer before publishing: scaffold, the tutorial's program exactly as written, generate-idl, make setup/deploy, initialize, increment, and `spel inspect <PDA> --type CounterState` returning count 5. Content is current with main as of #267, including the parts that landed after this work was first written: - witness exchange: --export, --co-signer, `spel sign`, `spel submit` (#246) - `program-id` (the v0.5.0 rename of `inspect <FILE>`) - --spel-git, and the flag-order rule for `init` (#255) - private PDAs: --npk/--vpk and the v0.2.1 derivation formula (#256) - a Claims section covering rule 7, ClaimedNonDefaultAccount and AccountAlreadyInitialized, and the ClaimedIfDefault a signer now emits (#262) - chained calls as the supported way to touch accounts a program does not own Originally opened as a takeover of #63. Co-Authored-By: Jimmy Claw <jimmy@claw.dev> Co-Authored-By: Vaclav Pavlin <vaclav.pavlin@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9qsH6Um6shweCPEN3Z6ph
vpavlin
force-pushed
the
docs/tutorial-reference-takeover
branch
from
September 7, 2026 07:11
baafcb3 to
d714ead
Compare
Findings from handing the tutorial to a fresh agent with no SPEL context. The tutorial claimed three times that `make idl` skips file-level #[account_type] structs and that only `spel generate-idl` picks them up, pointing at a placeholder issue link with no number. Tested all four combinations on one project with both crates on the same framework commit: top-level + spel generate-idl -> RegistryEntry top-level + make idl -> RegistryEntry in-module + spel generate-idl -> RegistryEntry in-module + make idl -> RegistryEntry The producers agree; the warning was wrong and is removed. Replaced with the real caveat: guest and examples/ are separate crates with separate lockfiles, so a version skew between them changes which framework generates the IDL (#269). ProgramContext had zero mentions across every doc, yet `spel init` emits it in the generated initialize — so a newcomer meets an unexplained parameter in their own scaffolded code. Documented in macros.md. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9qsH6Um6shweCPEN3Z6ph
Swept the docs for confident assertions and tested the checkable ones.
Removed, verified against the codebase:
- `SpelOutput::states_only` and `with_chained_calls` were documented as
available-but-deprecated. Neither exists in any Rust source; SpelOutput has
only `execute` and `execute_with_claims`. Documented the latter instead.
- `into_parts` returns SpelOutputParts, not the tuple the table claimed.
Corrected in the AgentSkill gotchas:
- a gotcha about "empty string arguments dropped by logoscore" — logoscore is a
different product and appears nowhere in SPEL; an empty string arg is passed
through, verified by dry-run.
- "Account flags use --{name}-account suffix" — they are just `--{name}`;
`spel initialize --owner <id>` is what works.
- "Instruction names transform: snake_case -> kebab-case" implied kebab is
required. The CLI matches both:
`snake_to_kebab(&ix.name) == cmd || ix.name == cmd`.
Checked and left alone: the `--` separator rule is correct — without it
`--value` is misparsed, confirmed by dry-run.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9qsH6Um6shweCPEN3Z6ph
spel-client-gen accepts --target, --module-name and --ffi-lib-path; the reference listed only --idl, --out-dir and --help. Verified the rest of that page by running the tool against a real IDL: it produces the documented client/ffi/header artifacts, emits one extern "C" function per instruction taking a JSON string, and includes wallet_path. Also checked and found accurate, so left alone: - idl.md's schema (discriminator, execution, instruction_type, metadata, spec, variant, visibility are all real optional fields, absent from a simple program's IDL only because they are unused) - every relative doc link resolves, and no anchor points at a missing heading Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9qsH6Um6shweCPEN3Z6ph
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.
Summary
Takes over #63 (author unavailable) and refreshes every added doc to match the current
spelCLI. The original commits from @jimmy-claw are preserved on this branch; a single takeover commit sits on top with Jimmy asCo-Authored-By.Closes #63.
What changed vs #63
Between March (when Jimmy wrote the docs) and now, v0.2.0 shipped with a large CLI overhaul. The docs on #63 still referenced the old
lez-cliworld. This PR fixes that:lez-cli → spel,lez_cli → spel_cli,lez-client-gen → spel-client-gen,lez-framework[-core|-macros] → spel-framework[-core|-macros],LezOutput/LezError/LezResult/LezIdl → Spel*across every added file. KeptLEZ(the zone),lez-multisig(the external repo), and the macro names#[lez_program]/#[instruction]/#[account]as-is.spel.tomlconfig — new[program]/[programs.<name>]discovery is now documented incli.md, the tutorial's Step 8, the skill'scli-ref.md,quickstart.md, andSKILL.md. Also noted thatinitscaffolds aspel.tomlby default (verified inspel-cli/src/init.rs).--dry-run[=text|json]— covers full-tx resolution output, JSON mode suppressing preamble, and the u128/nonce decimal-string precision note. Includes example text and JSON output blocks that matchspel-cli/src/tx.rs.--separator — every multi-flag example now uses--when mixing global flags with instruction flags; added an explicit "Invocation Syntax" section plus a gotcha entry explaining why.--program <NAME|HEX|FILE>— documented the three-way resolution.--program-idis marked deprecated.pdasection and dry-run examples show theseeds: [program_id, "state", Account(x), Arg(y)]output format.cli.md:37— resolved inline: theinitsection now explicitly says "scaffolding" andinitrefer to the same operation.cargo install --path spel→cargo install --path spel-cli # installs as the spel binary.Files touched
Test plan
docs/reference/cli.mdagainstspel --helpon mainspel-cli/src/tx.rsrender functions (print_dry_run_text/print_dry_run_json)spel.tomlagainst a real programgrep -rnE "lez-cli|lez_cli|lez-client-gen|lez-framework|LezOutput|LezError|LezResult|LezIdl" docs/ skills/returns no matches🤖 Generated with Claude Code