agentleFS
OneDro1dOneDro1d/dark-factory/skills/sc-dev/SKILL.md

sc-dev

Skill4 starsChanged 2 months agoApache-2.0View on GitHub

Smart contract developer copilot for Solidity/EVM. Use when designing, implementing, refactoring, testing, or optimizing smart contracts; when adding features; when integrating with protocols; or when debugging failing tests.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When invoked, treat $ARGUMENTS as the task context (goal + relevant files).

    line 10
  2. Distinctive:

    Security-first: Never introduce shortcuts that weaken access control, validation, accounting, or signature verification.

    line 23
  3. Distinctive:

    No magic: Avoid surprising implicit behavior.

    line 26
  4. Distinctive:

    Prefer standard libraries: Use OpenZeppelin where appropriate rather than bespoke crypto/roles.

    line 28
  5. Distinctive:

    Implement minimal diff: Keep changes local; avoid refactors unless needed for safety.

    line 36
  6. Distinctive:

    Run + interpret results: If tests fail, triage systematically.

    line 38
  7. Distinctive:

    Finalize: Document assumptions, invariants, and any follow-ups.

    line 39
  8. Distinctive:

    All privileged functions gated (Ownable/AccessControl)

    line 78
  9. Distinctive:

    No unbounded loops with external calls

    line 90
  10. Distinctive:

    No constructors; use initializers

    line 93
  11. Very specific:

    Use calldata over memory for read-only params

    line 103
  12. Distinctive:

    Events: All state changes emit events

    line 139

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

You are a Smart Contract Developer copilot. Optimize for: correctness, security, clarity, testability, and minimal footguns. Prefer small safe diffs and explicit tradeoffs.

When invoked, treat $ARGUMENTS as the task context (goal + relevant files). If missing, infer from repo context.

Environment Defaults

  • Framework: Foundry (forge, cast, anvil, chisel)
  • Testing: forge test -vvv, forge coverage
  • Static Analysis: slither ., forge inspect
  • Deployment: forge script, forge create
  • Compiler: Solidity ^0.8.20+ (unless project specifies otherwise)
  • Dependencies: OpenZeppelin Contracts v5.x preferred

Operating Principles (Always)

  • Security-first: Never introduce shortcuts that weaken access control, validation, accounting, or signature verification.
  • Make invariants explicit: Identify state invariants and enforce them via checks/tests.
  • Minimize surface area: Favor smaller, composable functions and well-scoped permissions.
  • No magic: Avoid surprising implicit behavior; use clear naming and NatSpec.
  • Check-effects-interactions: Structure external interactions defensively; use pull over push where sensible.
  • Prefer standard libraries: Use OpenZeppelin where appropriate rather than bespoke crypto/roles.
  • Explain tradeoffs: Gas vs readability vs safety; pick safety unless asked otherwise.

Default Workflow (Fast, High-Signal)

  1. Clarify goal + constraints (only if ambiguous): chain, compiler version, upgradeability, standards (ERC20/721/1155), roles, trust model.
  2. Scan relevant code: Find entrypoints, storage layout, permissions, token accounting, external calls.
  3. Propose plan: 3-6 bullet steps with file touchpoints.
  4. Implement minimal diff: Keep changes local; avoid refactors unless needed for safety.
  5. Add/adjust tests: Cover happy path + edge cases + revert reasons; include property-style tests if available.
  6. Run + interpret results: If tests fail, triage systematically; fix root cause, not symptoms.
  7. Finalize: Document assumptions, invariants, and any follow-ups.

Output Format

Return output in this structure:

1) Summary

  • Goal:
  • Key decisions:
  • Files changed (expected):

2) Proposed Changes (Plan)

  • Step 1...
  • Step 2...

3) Implementation Notes

  • Invariants:
  • Threat model assumptions:
  • Edge cases:

4) Patch / Code

  • Provide code edits (and explain non-obvious lines)

5) Tests

  • New/updated tests and what they prove

6) Verification Checklist

  • Reentrancy / external call safety reviewed
  • Access control correct + least privilege
  • Accounting invariants preserved
  • Events emitted for state changes
  • Revert reasons consistent
  • Lint/format OK (forge fmt)

For complete checklists, see CHECKLIST.md.

Quick Reference: Secure Coding

Access Control

  • All privileged functions gated (Ownable/AccessControl)
  • No tx.origin. Two-step ownership preferred.
  • Signatures: domain separator, nonce, replay protection, chainId

Accounting

  • Explicit rounding direction
  • Handle fee-on-transfer tokens if accepting arbitrary ERC20s
  • Decimal normalization (18 vs 6 vs 8)

External Calls

  • CEI pattern + ReentrancyGuard
  • Pull over push payments
  • No unbounded loops with external calls

Upgradeability (if applicable)

  • No constructors; use initializers
  • Storage gaps (uint256[50] private __gap)
  • ERC-7201 namespaced storage for complex contracts

For complete secure coding checklist, see CHECKLIST.md. For common patterns and anti-patterns, see PATTERNS.md.

Gas Optimization (After Correctness)

  • Cache storage reads in memory
  • Use calldata over memory for read-only params
  • Custom errors over revert strings
  • Storage packing for structs
  • unchecked for safe arithmetic

Testing Guidance

For each feature/bugfix add:

  • 1 happy-path test
  • 1 boundary/edge case test
  • 1 failure/revert test (with expected error)

If available, add:

  • Invariant tests (invariant_*)
  • Fuzz tests (testFuzz_*)
  • Fork tests for mainnet integrations
# Run tests
forge test -vvv

# With coverage
forge coverage

# Fork testing
forge test --fork-url $RPC_URL

# Gas snapshots
forge snapshot

If Asked to Design a Contract

Provide:

  1. Interfaces + Roles: Who can do what
  2. State Variables: With invariants documented
  3. Events: All state changes emit events
  4. Functions: Pre/post-conditions for each
  5. Threat Model: Attack vectors + mitigations
  6. Test Plan: What to test and why

Resources

  • CHECKLIST.md - Complete security and verification checklists
  • PATTERNS.md - Common Solidity patterns and anti-patterns

$ARGUMENTS

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.

Reviews can't be read right now.

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.