Get the FREE Ultimate OpenClaw Setup Guide →

new

npx machina-cli add skill HCS412/contractkit/new --openclaw
Files (1)
SKILL.md
2.2 KB

ContractKit: New Project

Scaffold a new smart contract project from a template.

Process

1. Gather Requirements

Ask the user for the following (use defaults if not specified):

ParameterDefaultOptions
Blueprinterc20erc20, erc721, escrow, vault
Project nameRequiredAny valid name
Token symbolRequired for erc20/erc7213-5 uppercase letters
Output directory./contractkit-projects/<slug>Any path

2. Create Project

  1. Create output directory
  2. Copy template from plugins/contractkit/templates/<blueprint>/
  3. Replace placeholders in all files:
    • {{PROJECT_NAME}} → project name
    • {{PROJECT_SLUG}} → lowercase slug
    • {{TOKEN_NAME}} → project name (for tokens)
    • {{TOKEN_SYMBOL}} → token symbol

3. Initialize Project

cd <project_directory>
forge install OpenZeppelin/openzeppelin-contracts --no-commit
forge install foundry-rs/forge-std --no-commit

4. Verify

forge fmt
forge build
forge test

If tests fail, diagnose and fix before completing.

5. Report Success

Print:

  • Project location
  • Next steps:
    cd <project>
    /contractkit:test     # Run tests
    /contractkit:local    # Start local chain
    /contractkit:deploy local  # Deploy locally
    

Example Usage

User: /contractkit:new

Response: "What blueprint would you like? (erc20, erc721, escrow, vault)"

User: "erc20"

Response: "What's the project/token name?"

User: "MyToken"

Response: "What's the token symbol? (e.g., MTK)"

User: "MTK"

Then execute the process above.

Template Locations

Templates are in the plugin directory:

  • plugins/contractkit/templates/erc20/
  • plugins/contractkit/templates/erc721/
  • plugins/contractkit/templates/escrow/
  • plugins/contractkit/templates/vault/

Placeholder Reference

PlaceholderReplaced With
{{PROJECT_NAME}}User's project name
{{PROJECT_SLUG}}Lowercase, hyphenated slug
{{TOKEN_NAME}}Token name (same as project name)
{{TOKEN_SYMBOL}}User's symbol (uppercase)

Source

git clone https://github.com/HCS412/contractkit/blob/main/plugins/contractkit/skills/new/SKILL.mdView on GitHub

Overview

Scaffold a new smart contract project by selecting a blueprint (erc20, erc721, escrow, vault), naming the project, and applying placeholders. It copies the chosen template, applies project-specific identifiers, and prepares a Forge-based workflow with dependencies.

How This Skill Works

Choose a blueprint and provide required details (project name, token symbol, output directory). The tool copies the corresponding template from plugins/contractkit/templates/<blueprint>/ and replaces placeholders such as {{PROJECT_NAME}}, {{PROJECT_SLUG}}, {{TOKEN_NAME}}, and {{TOKEN_SYMBOL}}. Finally, initialize dependencies with Forge and verify the setup with forge fmt, forge build, and forge test.

When to Use It

  • Starting a brand-new contract project from a standard template (erc20, erc721, escrow, vault).
  • Creating a token or NFT project by supplying a project name and symbol.
  • Onboarding a team to a consistent scaffolding workflow with placeholder-based templates.
  • Setting up a local Forge workflow by installing dependencies and running fmt, build, and tests.
  • Generating a ready-to-run skeleton for demonstrations or quick deployments.

Quick Start

  1. Step 1: Gather requirements (blueprint, project name, token symbol, output dir).
  2. Step 2: Copy the selected template and replace placeholders ({{PROJECT_NAME}}, {{PROJECT_SLUG}}, {{TOKEN_NAME}}, {{TOKEN_SYMBOL}}).
  3. Step 3: Initialize dependencies and verify (forge install; forge fmt, forge build, forge test).

Best Practices

  • Define required inputs up front (blueprint, name, symbol, output dir) before starting.
  • Validate required fields (project name, symbol for tokens) to ensure template replacements succeed.
  • Use descriptive PROJECT_NAME and PROJECT_SLUG to keep identifiers clear.
  • Run forge fmt, then forge build and forge test to catch issues early.
  • Document the final project location and next steps after scaffold completes.

Example Use Cases

  • Scaffold ERC20 project named MyToken with symbol MTK.
  • Create ERC721 project named ArtToken with symbol ART.
  • Set up an escrow contract scaffold for a payment workflow.
  • Generate a vault template for asset custody.
  • Create a new contract kit project skeleton for demos.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers