Skip to content

Add Cadence plugin marketplace with 7 skills for Flow development#18

Merged
0xLisanAlGaib merged 7 commits intomainfrom
cadence-rules-pr
Apr 9, 2026
Merged

Add Cadence plugin marketplace with 7 skills for Flow development#18
0xLisanAlGaib merged 7 commits intomainfrom
cadence-rules-pr

Conversation

@0xLisanAlGaib
Copy link
Copy Markdown
Contributor

Summary

  • Set up this repository as a Claude Code plugin marketplace for the Flow blockchain ecosystem
  • Convert onflow/cadence-rules into structured Claude Code skills with progressive disclosure (metadata → SKILL.md → reference files)
  • Integrate blockchain query skills from the internal Flow CLI plugin
  • Add security audit and code scaffold skills based on Dapper Labs patterns

Plugin: cadence — 7 skills, 41 files, 4,636 lines

Skill References Purpose
cadence-lang 13 Cadence language fundamentals: access control, entitlements, resources, contracts, transactions, interfaces, accounts, references, capabilities, conditions, security, anti-patterns, design patterns
cadence-tokens 2 NFT/FT token development: NonFungibleToken/FungibleToken conformance, MetadataViews, modular NFT architectures
cadence-defi-actions 5 DeFi Actions framework: Source/Sink/Swapper composition, IncrementFi connectors, restaking workflows, AutoBalancer
cadence-audit 2 Security audit: severity-rated findings (Critical/High/Medium/Low), structured review format, project-wide audit workflow
cadence-scaffold 3 Code generation: interactive scaffolding for contracts, transactions, and DeFi transactions
flow-cli-query 2 Blockchain queries: Flow CLI commands and FindLabs historical API (findapi)
flow-project-setup 2 Project configuration: flow.json, FCL, deployment, debugging, gas optimization

Architecture

  • Each SKILL.md description (~100 words) includes explicit TRIGGER when and DO NOT TRIGGER when sections for accurate skill routing
  • SKILL.md body (~200 words) provides overview + navigation map to reference files
  • Reference files (200-300 lines) are modular, single-topic, with code examples

Test plan

  • Install marketplace: /plugin marketplace add onflow/flow-ai-tools
  • Install plugin: /plugin install cadence@flow-claude-code-plugins
  • Verify cadence-lang triggers on Cadence syntax questions
  • Verify cadence-tokens triggers on NFT/FT contract questions
  • Verify cadence-audit triggers on "review my contract" prompts
  • Verify cadence-scaffold triggers on "create a new contract" prompts
  • Verify flow-cli-query triggers on "check account balance" prompts
  • Verify flow-project-setup triggers on "configure flow.json" prompts
  • Verify skills do NOT cross-trigger on adjacent topics

Set up this repository as a Claude Code plugin marketplace for the Flow  ecosystem. Convert onflow/cadence-rules into structured skills
with progressive disclosure (metadata → SKILL.md → reference files).

Plugin: cadence (7 skills, 37 files)
- cadence-lang: Language fundamentals (13 reference files covering access
  control, resources, contracts, transactions, interfaces, accounts,
  references, capabilities, conditions, security, anti-patterns, patterns)
- cadence-tokens: NFT/FT token development (2 references)
- cadence-defi-actions: DeFi Actions framework composition (5 references)
- cadence-audit: Security audit with severity-rated review format (2 references)
- cadence-scaffold: Interactive code generation templates (3 references)
- flow-cli-query: Blockchain data queries via Flow CLI and findapi (2 references)
- flow-project-setup: Project configuration and deployment workflow (2 references)
Extract entitlements content from access-control.md into new
entitlements.md with full coverage of entitlement mappings, Identity
mapping, include composition, owned-values-are-fully-entitled rule,
and account entitlements from official Cadence docs.
High severity:
- Remove all `defer` references (5 files) — Cadence does not have defer
- Fix insecure public minting capability labeled "Secure" in nft-standards.md
- Restrict access(all) on resource-typed fields in token-patterns.md

Medium severity:
- Replace pre-1.0 address imports with string imports (3 files)
- Rewrite non-functional FT pattern with Minter, Burner.burn(), events
- Fix cadence-lang reference count: 13 → 14 in CLAUDE.md and README.md
@0xLisanAlGaib
Copy link
Copy Markdown
Contributor Author

Fixes for 6 correctness issues across skill reference files

High Severity

  1. defer contradiction (5 files) — Cadence does NOT have defer. Removed all defer code examples and guidance from resources.md, security-best-practices.md, scaffold-transaction.md, and review-format.md. Replaced with explicit "handle resources before panic-prone operations" patterns, consistent with audit-checklist.md.

  2. Public minting capability labeled "Secure" (nft-standards.md) — The "Secure Capability Management" example published a Minter at a public path, allowing anyone to mint unlimited NFTs. Rewrote with entitlement-gated minting (access(Mint)), no public capability, and an explicit anti-pattern warning.

  3. access(all) on resource-typed fields (token-patterns.md) — Resource dictionary traits changed to access(self), nftUUID made immutable (let), registerModule restricted to access(account), and updateValue/evolveAccumulative on the Trait interface restricted to access(contract).

Medium Severity

  1. Pre-1.0 import syntax (3 files) — Replaced import X from 0xADDRESS with string imports (import "X") in query-blockchain.md, workflow.md, and imports.md. Added mainnet address reference table for CLI users.

  2. Non-functional FT pattern (token-patterns.md) — Rewrote the FT example with: Minter resource that updates totalSupply, Burner.burn() in deposit(), 4 standard events (TokensMinted, TokensBurned, TokensDeposited, TokensWithdrawn), and minter saved to storage in init().

  3. Reference count mismatchcadence-lang has 14 reference files; updated both CLAUDE.md and README.md from 13 → 14.

Covers @onflow/react-sdk with 4 reference files:
- setup: FlowProvider, Next.js integration, theming, dark mode
- hooks: 20 Cadence hooks (query, mutate, auth, events, accounts,
  blocks, NFT metadata, scheduled transactions, randomness)
- cross-vm: 7 Cross-VM hooks (batch EVM transactions, token/NFT
  bridging between Cadence and Flow EVM, cross-chain balances)
- components: 7 UI components (Connect, TransactionButton,
  TransactionDialog, NftCard, Profile, ScheduledTransactionList)
Delete skill directory and remove all references from SKILL.md
descriptions, README, and CLAUDE.md.
New skill: flow-cli with 3 reference files (commands-overview, accounts,
project) covering the full Flow CLI command reference.

Add "Companion Skills" sections to all 8 SKILL.md files, pointing to
cadence-lang as the foundation skill and cross-referencing related skills
for each domain. Add "See also" cross-references within key reference
files (nft-standards, safety-testing, scaffold-contract, scaffold-
transaction, hooks, accounts, project, audit-checklist) to guide Claude
to the most relevant skill for each task context.
Copy link
Copy Markdown
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Nice! I mostly had a look at the cadence-audit and especially cadence-lang skill and they overall look good to me. We probably need to try these out and iteratively improve them based on feedback

@@ -0,0 +1,179 @@
# Flow React SDK — UI Components
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

what do you think about putting this in a different plugin? e.g. dapp or something higher level. it doesn't seem like it should exist under cadence. same for the flow-project-setup

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

alternatively, we could rename the plugin so something more general and include all of the skills under the single plugin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All these skills are very intertwined. I want to make sure that they trigger each other. A separate plugin might make this more difficult.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can create a separate plugin later and AB test how they trigger each other, but for now I will dump everything here

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

that's fair. maybe we just rename it to something like flow-dev?

Verified against official Cadence docs (cadence-lang.org). Fixes:

1. Entitlement declarations: remove erroneous access(all) prefix from
   all entitlement declarations (correct: `entitlement E`, not
   `access(all) entitlement E`) — 11 occurrences across 7 files

2. Capability controller deletion: change from incorrect
   account.capabilities.storage.delete(id) to correct
   controller.delete() — 4 occurrences across 3 files

3. Account entitlement names: replace non-existent
   IssueStorageCapabilityController with StorageCapabilities,
   PublishCapability with Capabilities — 10 occurrences across 8 files.
   Add correct fine-grained names: AddContract, UpdateContract,
   RemoveContract, PublishInboxCapability, ClaimInboxCapability

4. Contract updatability rules: correct major errors per official docs.
   Removing fields IS valid (was listed as invalid). Reordering fields
   IS valid (was listed as invalid). Adding new fields is NOT valid
   (init doesn't re-run). Updated in contracts.md, workflow.md,
   accounts.md

5. Transaction post-conditions: add note that `result` is only
   available in function post-conditions, not transaction
   post-conditions (transactions don't return values)
@0xLisanAlGaib 0xLisanAlGaib merged commit 1002c70 into main Apr 9, 2026
@peterargue peterargue deleted the cadence-rules-pr branch April 9, 2026 20:47
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.

3 participants