Cadence-lang redesign + AI tools (MCP, Skills, LLM endpoints, AI Chat)#285
Cadence-lang redesign + AI tools (MCP, Skills, LLM endpoints, AI Chat)#285lmcmz wants to merge 125 commits intoonflow:mainfrom
Conversation
Complete rewrite of cadence-lang.org: - Fumadocs UI with TanStack Start router and Vite bundler - Tailwind CSS 4 with Geist font family (including Pixel display variants) - Custom Cadence syntax highlighting via Shiki + TextMate grammar - AI-native homepage: skills command, LogoLoop ticker, social proof section - AI toolkit section: Agent Skills, MCP Server, llms.txt, per-page AI actions - Theme toggle with View Transitions API sweep animation - StickerPeel draggable stickers (gsap + Draggable, SSR-safe) - SEO: JSON-LD structured data, sitemap, robots.txt - Env var VITE_SKILLS_ORG for org-agnostic skills command - All 82 docs migrated to content/docs/ with GFM admonitions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate from Docusaurus to Fumadocs + TanStack Start + Vite
- VITE_SKILLS_ORG env var controls homepage skills command org - Try/catch around Shiki codeToHtml with plain-text fallback - Add .vercel/output to .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate to Fumadocs + TanStack Start + Vite
- Set Nitro runtime to nodejs20.x (was defaulting to nodejs24.x) - Add buildCommand, installCommand, framework:null to vercel.json - Prevents Vercel from auto-detecting wrong framework Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix Vercel: nodejs20.x runtime + build config
- Remove cleanUrls/trailingSlash from vercel.json (may conflict with Nitro routing)
- Simplify vite.config.ts to bare nitro({ preset: 'vercel' })
- Remove .vercel/output from git tracking (already in .gitignore)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: simplify Vercel deployment config
The native binding (@takumi-rs/core-linux-x64-gnu) is not available in Vercel's serverless environment. Move to dynamic import so the module is only loaded when the OG image route is hit, with SVG fallback when the native binding is unavailable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: dynamic import for OG image native binding
…ibility and fumadocs theme
|
@zenabot27 is attempting to deploy a commit to the Flow Team on Vercel. A member of the Team first needs to authorize it. |
… sidebar context crash
…idebar llms links
…thub icons, remove llms from header
…rt ./ MDX links to absolute paths
…is visible on mobile
…-patterns and anti-patterns
TanStack Router's Link resolves `to` relative to the route pattern, not the actual page URL, breaking `./` and `../` relative links in MDX content. Add a custom link component that pre-resolves relative hrefs to absolute paths using standard URL resolution before passing to Fumadocs Link. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: resolve relative MDX links before passing to TanStack Router
- Dockerfile: multi-stage build, compiles LSP v2 from Outblock/cadence-tools rewrite/lsp-v2 branch - client.ts: add lspBinary option to spawn v2 binary directly instead of flow CLI - http.ts/index.ts: pass LSP_BINARY env var to LSPManager Set LSP_BINARY=/usr/local/bin/lsp-v2 to use v2, unset to fall back to v1. Flow CLI is still used for `flow dependencies install` (DepsWorkspace). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add LSP_BINARY env var to run integration tests against a standalone LSP binary instead of Flow CLI. All 30 tests pass with v2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chore: sync SKILL.md from docs changes
The debug endpoint leaked file paths, flow.json contents, and directory listings without authentication. The /health endpoint is sufficient for monitoring LSP status. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: integrate Cadence LSP v2 binary into MCP server
Add POST /api/security-scan that runs static analysis + LSP type check directly, bypassing the MCP tool call. This eliminates the need for Claude to re-output the entire contract code as tool arguments, which was extremely slow for large contracts (100KB+). Extract createApp() from http.ts for testability. Co-authored-by: ZenaBot <qq_agent_hao@proton.me> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ution (#13) Co-authored-by: ZenaBot <qq_agent_hao@proton.me> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
The rewrite/lsp-v2 branch has been merged to master with WASM slimming (47→22MB) and all Phase 1-3 LSP improvements. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@lmcmz The Language reference (https://cadence-lang.org/docs/language) menu structure and order should be preserved, the new site is all over the place. |
|
@lmcmz There is whole bunch of broken links in the language reference, see: |
Keep LLM endpoints accessible via settings only. Co-authored-by: ZenaBot <qq_agent_hao@proton.me> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
I started reviewing SKILL.md, but didn't get very far because there is a lot of bad advice. I assume you used AI to generate it.
I already spent a lot of time reviewing and added a bunch of advice to https://github.com/onflow/cadence-rules. Can you please import those rules into the AI that you're using to generate SKILL.md and have it re-generate it? Also make sure it knows about the few comments I already left here because I'm sure those apply to many of the skills in the rest of the file.
I also agree with Bastian about breaking this into smaller PRs. This is way too difficult to review as one big PR
| | Testing framework | https://cadence-lang.org/docs/testing-framework | | ||
| | Flow NFT Standard | https://github.com/onflow/flow-nft | | ||
| | Flow FT Standard | https://github.com/onflow/flow-ft | | ||
|
|
There was a problem hiding this comment.
Probably should include other repos in here like core contracts, bridge, hybrid custody, NFT storefront, etc
skills/cadence/SKILL.md
Outdated
| | `access(all)` | Everyone (public read, callable by anyone) | | ||
| | `access(self)` | Only within the type itself | | ||
| | `access(contract)` | Same contract | | ||
| | `access(account)` | Same account | |
There was a problem hiding this comment.
| | `access(account)` | Same account | | |
| | `access(account)` | Contracts within the same account | |
skills/cadence/SKILL.md
Outdated
| | `access(self)` | Only within the type itself | | ||
| | `access(contract)` | Same contract | | ||
| | `access(account)` | Same account | | ||
| | `access(E)` | Callers holding entitlement `E` | |
There was a problem hiding this comment.
| | `access(E)` | Callers holding entitlement `E` | | |
| | `access(E)` | Either callers holding the actual object or callers holding a reference to the object authorized with entitlement `E` | |
skills/cadence/SKILL.md
Outdated
| // 4. Borrow from another account | ||
| let receiver = getAccount(address).capabilities | ||
| .borrow<&{FungibleToken.Receiver}>(/public/receiver) | ||
| ?? panic("Account has no receiver capability") |
There was a problem hiding this comment.
Can you update all the error messages in here to have more descriptive messages that include values? For example, this one should be, "Account \(address) has no FungibleToken.Receiver capability at path /public/receiver"
skills/cadence/SKILL.md
Outdated
| transaction(amount: UFix64, recipient: Address) { | ||
|
|
||
| // Declare fields shared across phases | ||
| let vaultRef: auth(FungibleToken.Withdraw) &FungibleToken.Vault |
There was a problem hiding this comment.
This is an invalid type. It should be &{FungibleToken.Vault}. You'll need to update this type wherever else it is in these skills
skills/cadence/SKILL.md
Outdated
| // Access accounts — the ONLY phase with account access | ||
| prepare(signer: auth(BorrowValue) &Account) { | ||
| self.vaultRef = signer.storage | ||
| .borrow<auth(FungibleToken.Withdraw) &FungibleToken.Vault>( |
skills/cadence/SKILL.md
Outdated
| self.vaultRef = signer.storage | ||
| .borrow<auth(FungibleToken.Withdraw) &FungibleToken.Vault>( | ||
| from: /storage/vault | ||
| ) ?? panic("No vault found") |
There was a problem hiding this comment.
need descriptive error message here and everywhere else in this file with error messages
…, SKILL.md, bun migration - Fix 68 broken internal links across language reference, tutorials, ai-tools, and migration guide - Restore Language Reference sidebar menu order to match production site - SKILL.md: add repo links (core-contracts, bridge, hybrid-custody, nft-storefront), fix access(account)/access(E) descriptions, fix invalid &FungibleToken.Vault types, improve all panic messages with descriptive values - Convert relative ./links in index.mdx files to absolute paths (Fumadocs resolves ./ from index pages incorrectly) - Fix anchor slugs (#semicolons → #-semicolon, #accessing-objects → #borrowing-objects, etc.) - Migrate from npm to bun (remove package-lock.json, add bun.lockb) - Add scripts/check-links.mjs for link validation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@j1010001 Both issues have been addressed in the latest push: 1. Language Reference menu order — Restored to match the production site order 2. Broken links — All 68 broken links from the link-check report have been fixed. The root cause was @joshuahannan All SKILL.md review comments resolved:
|
|
Hey @joshuahannan @j1010001 — quick update on the review feedback: What's been fixed (latest push):
On splitting the PR: Review guide — where to focus:
Happy to hand off further iterations: Preview is live at https://cadence-lang.vercel.app/ for testing. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New MCP tool that validates JSON-CDC encoded arguments for Cadence scripts and transactions. Supports two modes: - Standalone: validates format, type names, and value correctness (integer ranges, Fix64 precision, Address format, nested types) - With source code: additionally verifies args match the entry function signature via LSP or regex fallback Stricter than FCL's @onflow/types — catches range overflows, invalid addresses, and type mismatches that FCL passes through silently. 220 tests with FCL-generated ground truth fixtures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This reverts commit 78a4c90.
…dk to 1.26.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Complete redesign of cadence-lang.org with AI-native developer tooling.
Preview: https://cadence-lang.vercel.app/
Site Redesign
MCP Server (
mcp-server/)search_docs,get_doc,cadence_check,cadence_hover,cadence_definition,cadence_symbolshttps://cadence-mcp.up.railway.appAI Skills
SKILL.md— one-command install vianpx skills add outblock/cadence-lang.orgLLM Endpoints
/llms.txt— concise site overview for LLM context/llms-full.txt— full documentation dump optimized for LLM context windowsAI Chat Panel
Fumadocs
meta.jsonfilesAI Tools Documentation (
content/docs/ai-tools/)Test plan
bun testinmcp-server/)https://cadence-mcp.up.railway.app/mcp