agentleFS
cybasecuritycybasecurity/clarity-skills/skills/clarity-start/SKILL.md

clarity-start

Skill2 starsChanged 31 days agoMITView on GitHub

Start here for any Clarity (.clar) or Stacks smart-contract task: contracts, tokens, vaults, DeFi, tests, deployment, audits, sBTC or protocol integration, and questions about Clarity behavior, versions or addresses. Writing or changing a contract also needs clarity-scholar and clarity-security; this skill names the rest.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Privileged setters: check the caller, print an event and validate input.

    line 49
  2. Distinctive:

    Capital that is out: never freezes deposits or claims and counts at what it can still return, not at the amount released (liquidity).

    line 56
  3. Distinctive:

    Complete exits: every leg has a tested path back to the vault (test the entire operation).

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clarity: start here

This skill is a router. Read the request (and any task file it points to), then load every skill whose row matches, in the same turn, before writing code, reviewing or answering from memory. The rules live in those skills, not here: models routinely get Clarity wrong from Solidity habits and older Clarity versions.

Load by task

TaskLoad
How Clarity code behaves: what an expression returns, what aborts or rolls back, what the VM checks at deployment or call timeclarity-scholar and clarity-security
Write or refactor a contract (vault, token, protocol)clarity-scholar and clarity-security; clarity-assets if it holds or moves tokens
Tests, new project setup, coverageclarity-testing; clarity-fuzzing for invariants/property tests
Integrate Zest, Granite, Bitflow, Stacks Swap, Hermetica, USDCx, Pythclarity-protocols for addresses and calls; clarity-ecosystem for position contracts and when two or more protocols compose; clarity-oracles for prices
Deploy, publish, initializeclarity-deployment; clarity-environments for testnet/devnet differences
Works in one environment (simnet, devnet, testnet, mainnet) but not another; where to testclarity-environments
Audit, review, find bugsclarity-auditor and clarity-security (always both: the auditor holds the method and PoC rules, security holds the A01-A29 patterns and native-behavior tables); clarity-assets when tokens move
Upgradeable design, replacing logic or a contract, v2 migrationclarity-upgrades; clarity-governance for who may approve
DAO, multisig, admin roles, timelocksclarity-governance
Execution cost, block limitsclarity-optimizer
Language version or epoch questions, compile errors on a keywordclarity-epochs
SIP-010/009/013 tokens, SIP-018 signaturesclarity-sip-compliance
Off-chain scripts, events, indexers, sBTC deposit historyclarity-apis
Bitcoin transaction proofs, sBTC settlementclarity-bitcoin-proofs
PoX stakingclarity-staking
Wallet connection, frontends, Ledgerclarity-wallets
Boot contracts, SIP trait addresses, chain mechanicsclarity-system-integration
  • Load only what the task needs; install the whole bundle so sibling links resolve.
  • A build usually needs clarity-scholar, clarity-security and clarity-testing; add the integration skills only for the protocols actually used.
  • New projects: toolchain and test setup in clarity-testing; which Clarity version to target in clarity-epochs.
  • Principals, traits and function signatures come from clarity-protocols (protocols) and clarity-system-integration (boot contracts, SIP traits), never from memory.
  • Exact VM text for any function: python3 <skills>/clarity-scholar/scripts/lookup_function.py 'as-contract?' (<skills> is the directory holding the skill folders).

Before calling a contract done

Each line is a common defect; its link holds the rule and how to test it. Fix each failing item that applies instead of reporting it as unmet. Skip items for features the contract does not have; when an item conflicts with a design the user asked for, say so instead of silently reshaping the design.

  • Trait arguments checked against the stored principal for their role (security A02).
  • Upgrade targets, when the contract has them: the exact staged target is required at activation after the delay, with no bypass; by default typed (target <logic-trait>) and probed before the delay (make a contract upgradable).
  • Privileged setters check the caller, print an event and validate input; sensitive changes (fund-moving roles, prices, code) are fixed or timelocked, and a protocol holding user funds has an instant pause; contract roles reject wallets (security, governance).
  • Outflows bounded by exact as-contract? allowances, share-token burns included, and protocol calls with the contract's own assets made inside the scope (security A04, allowance scope).
  • Zero, self and dust amounts skipped or rejected deliberately, and a dust request cannot block a queue (security A27, liquidity).
  • Valuation at redeemable value, times a verified on-chain oracle price for assets other than the vault's unit (a keeper- or admin-supplied price only when the design accepts that trust, bounded and disclosed); never cost basis or a spot price (value).
  • Lazer prices verified with every check (price checks).
  • Share mints resist first-deposit inflation (security A29).
  • Minimums and deadlines are non-zero and chosen by the signer; operator swaps also have an oracle floor (protocol calls).
  • Capital that is out never freezes deposits or claims and counts at what it can still return, not at the amount released (liquidity).
  • Protocol call shapes match the deployed contracts, and each position is accounted for by the contract that owns it: by default a one-owner position contract per protocol, or direct calls with explicit per-position accounting (position contracts, what differs between protocols).
  • Complete exits: every leg has a tested path back to the vault (test the entire operation).
  • Real contracts exercised at a pinned height at least once, and clarinet check passes on its own from requirements (mainnet forks).
  • Tests drive public functions through attacker contracts, with 0, 1, maximum amounts and failure rollback (attacker contracts).
  • Deployment prep, when the task includes deployment or the contract needs initialization, uses the project's deployment tooling or an executable Clarinet plan or release script. A plan can handle straightforward releases; recommend a resumable script for more complex setup, verification, signatures, waits or transaction postconditions constructed in code (release script rules).

Reference baseline

Source pins for this skill; each linked skill keeps its own dates and pins.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.