Skip to content

chore(skill): refresh solana-add-idl for post-#228 VisualizerContext API#281

Open
shahan-khatchadourian-anchorage wants to merge 1 commit into
shahankhatch/228-lint-diagnostics-refactorfrom
shahankhatch/solana-add-idl-skill-refresh
Open

chore(skill): refresh solana-add-idl for post-#228 VisualizerContext API#281
shahan-khatchadourian-anchorage wants to merge 1 commit into
shahankhatch/228-lint-diagnostics-refactorfrom
shahankhatch/solana-add-idl-skill-refresh

Conversation

@shahan-khatchadourian-anchorage
Copy link
Copy Markdown
Contributor

Summary

Stacked on top of #255. Refreshes the solana-add-idl scaffolding skill so newly-generated presets compile against the wire-data VisualizerContext introduced in #255.

Changes

  • Replaces the broken squads_multisig template reference (preset doesn't exist in this repo) with dflow_aggregator, a real working example of the post-feat: attested transaction lint diagnostics in SignablePayload #228 pattern.
  • Adds explicit guidance for the new accessor pattern at the top of visualize_tx_commands: context.resolve_program_id()? / context.resolve_accounts()? / context.data(). These replace the removed context.current_instruction() and surface unresolved indices with precise error messages.
  • Updates the "Required imports" list to match real preset code (BTreeMap for deterministic named-accounts ordering, AccountMeta, OnceLock).
  • Drops redundant Some(hex::encode(...)) second arg in create_raw_data_field calls — the helper falls back to the same lowercase hex by default.
  • Verify step exercises both feature configs (diagnostics on/off) so newly scaffolded presets work for parser_cli and parser_app alike.

Test plan

  • cargo fmt --check, make lint clean
  • Scaffold a fresh preset using the updated skill on a sample IDL and verify it compiles + tests cleanly in both feature configs

🤖 Generated with Claude Code

The skill scaffolds new IDL-based Solana visualizer presets. Two updates:

- Replace the broken `squads_multisig` template reference (preset doesn't
  exist in this repo) with `dflow_aggregator`, which is a real working
  example of the post-#228 wire-data pattern.
- Add explicit guidance for the new accessor pattern at the top of
  `visualize_tx_commands`: `context.resolve_program_id()?` /
  `context.resolve_accounts()?` / `context.data()`. These replace the
  removed `context.current_instruction()` and surface unresolved indices
  with precise error messages.
- Update the "Required imports" list to match real preset code (BTreeMap
  for deterministic named-accounts ordering, AccountMeta, OnceLock).
- Drop the redundant `Some(hex::encode(...))` second arg in
  `create_raw_data_field` calls — the helper falls back to the same
  lowercase hex by default.
- Verify step now exercises both feature configs (diagnostics on/off) so
  newly scaffolded presets work for parser_cli and parser_app alike.

Stacked on top of #255.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the solana-add-idl Claude skill documentation so newly scaffolded Solana IDL-based presets match the post-#228/#255 VisualizerContext wire-data API and compile under both diagnostics feature configurations.

Changes:

  • Switches the recommended template preset from the nonexistent squads_multisig to dflow_aggregator and adds guidance for the wire-data accessor pattern (resolve_program_id / resolve_accounts / data).
  • Refreshes the “required imports” list to align with current preset implementations (e.g., BTreeMap, AccountMeta, OnceLock) and documents deterministic named-account ordering.
  • Expands the verify commands to run clippy/tests with diagnostics both enabled and disabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- `use` statements at top of module, never inside functions
- Inline format strings: `format!("{variable}")` not `format!("{}", variable)`
- Use `create_text_field` and `create_raw_data_field` from `visualsign::field_builders` — never construct field structs directly
- For raw-data fields, pass `None` as the second arg of `create_raw_data_field` — the helper falls back to lowercase byte-by-byte hex; `Some(hex::encode(data))` is redundant
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.

2 participants