plutus
Copilot instructions1.6k starsChanged 2 years agoApache-2.0View on GitHub
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. MANDATORY: You MUST use Nix for development. All builds and tests require the Nix environment. Do not attempt to build without Nix - it will fail due to missing dependencies and specific toolchain requirements. Install Nix first if not available: Enter the development shell: Your prompt will change to indicate you're in the Nix shell…
- Pipes a download into a shell
We split this copilot-instructions.md into the rules it gives an agent
20 rules. About 0 are common, 13 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 3
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …
- Distinctive: line 7
MANDATORY: You MUST use Nix for development: All builds and tests require the Nix environment.
- Distinctive: line 89
Run all tests (30-60 minutes):
- Distinctive: line 94
Run specific test suites:
- Distinctive: line 117
ALWAYS run these validation steps after making changes:
- Very specific: line 154
Run with: cabal test haskell-conformance and cabal test agda-conformance
- Distinctive: line 173
If you commit outside the Nix shell, you may get:
- Distinctive: line 180
CRITICAL: Always run formatting before committing or CI will fail.
- Very specific: line 241
Note: When modifying .lagda files, regenerate Haskell modules with:
- Distinctive: line 254
When modifying core functionality:
- Distinctive: line 257
Regenerate golden files: if evaluator behavior changes
- Very specific: line 258
Check multiple GHC versions: if touching plutus-tx-plugin
- Very specific: line 306
Update cost model data in plutus-core/cost-model/data/
- Very specific: line 313
Update corresponding Agda code in plutus-metatheory/src/
- Very specific: line 315
Test conformance extensively: cabal test plutus-metatheory
- Very specific: line 316
Check performance impact: cabal run plutus-benchmark
- Distinctive: line 320
Test with multiple GHC versions:
- Distinctive: line 324
Update golden tests for all GHC versions if needed
- Distinctive: line 331
All tests: 30-60 minutes (timeout: 90+ minutes)
- Distinctive: line 335
Always set appropriate timeouts and wait for completion.
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions 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.
Files
Plutus Core Development Instructions
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
Critical Development Environment Requirements
MANDATORY: You MUST use Nix for development. All builds and tests require the Nix environment. Do not attempt to build without Nix - it will fail due to missing dependencies and specific toolchain requirements.
Nix Environment Setup
Install Nix first if not available:
curl -L https://nixos.org/nix/install | shEnter the development shell:
nix develop --no-warn-dirty --accept-flake-configYour prompt will change to indicate you're in the Nix shell environment. This shell provides all required tools including:
- Correct GHC version with all Haskell dependencies
- Cabal build tool
- Haskell Language Server (HLS)
- Pre-commit hooks and formatting tools
- Documentation build tools
Building the Project
Essential Pre-Build Steps
# Always run these before building
cabal updatePrimary Build Commands
CRITICAL BUILD TIMING - NEVER CANCEL BUILDS:
Build the core library (15-30 minutes):
cabal build plutus-core # NEVER CANCEL - takes 15-30 minutes, timeout: 45+ minutesBuild all packages (45-90 minutes):
cabal build all # NEVER CANCEL - takes 45-90 minutes, timeout: 120+ minutesBuild specific packages:
cabal build plutus-tx # 10-20 minutes
cabal build plutus-ledger-api # 10-15 minutes
cabal build plutus-tx-plugin # 15-25 minutes
cabal build cardano-constitution # 5-10 minutes
cabal build plutus-executables # 10-15 minutesBuilt Executables
The build produces these command-line tools:
cabal run plutus # Plutus Core evaluator and tools
cabal run pir # Plutus IR tools
cabal run plc # Plutus Core compiler
cabal run uplc # Untyped Plutus Core toolsExample: Evaluate a Plutus Core program:
cabal run plc evaluate -- -h # Show help for evaluation optionsAlternative GHC Versions
The project supports multiple GHC versions. Use specific shells:
nix develop --no-warn-dirty --accept-flake-config .#ghc96 # Primary (default)
nix develop --no-warn-dirty --accept-flake-config .#ghc98 # Alternative
nix develop --no-warn-dirty --accept-flake-config .#ghc910 # AlternativeTesting
Test Suite Execution
CRITICAL TESTING TIMING - NEVER CANCEL TESTS:
Run all tests (30-60 minutes):
cabal test all # NEVER CANCEL - takes 30-60 minutes, timeout: 90+ minutesRun specific test suites:
cabal test plutus-core-test # 15-25 minutes
cabal test untyped-plutus-core-test # 10-15 minutes
cabal test plutus-ir-test # 10-15 minutes
cabal test plutus-tx-test # 10-15 minutes
cabal test plutus-ledger-api-test # 5-10 minutesGolden Test Regeneration
Regenerate all golden test files:
./scripts/regen-goldens.sh # NEVER CANCEL - takes 45-75 minutes, timeout: 120+ minutesFor plugin tests with multiple GHC versions:
nix develop .#ghc96 --command cabal test plutus-tx-plugin --test-options=--acceptValidation Scenarios
ALWAYS run these validation steps after making changes:
- Build validation:
cabal build all --ghc-options=-Werror # Must pass with no warnings - Test validation:
cabal test all # All tests must pass - Specific functionality tests:
# Test Plutus Core evaluator cabal run plc evaluate -- --help # Test conformance (if modifying core evaluator) cabal run haskell-conformance -- --help cabal run agda-conformance -- --help # Test benchmarks (if modifying performance-critical code) cabal run plutus-benchmark-nofib-tests -- --help - Formatting validation:
stylish-haskell --config .stylish-haskell.yaml --check <modified-files> cabal-fmt --check <modified-cabal-files>
Performance and Conformance Testing
The repository includes specialized test suites:
Conformance tests (validate evaluator correctness):
plutus-conformance/- Compare Haskell vs Agda implementations- Run with:
cabal test haskell-conformanceandcabal test agda-conformance
Benchmark tests (validate performance):
plutus-benchmark/- Performance regression tests- Run with:
cabal test plutus-benchmark-nofib-tests
Development Tools and Linting
Pre-commit Hooks and Formatting
Pre-commit hooks are defined in the Nix shell configuration and run automatically on commit. The Nix environment provides the following formatting tools:
# These tools are available in the Nix shell:
stylish-haskell --config .stylish-haskell.yaml <files> # Haskell formatting
cabal-fmt <cabal-files> # Cabal file formatting
fourmolu --mode inplace <files> # Alternative Haskell formatterIf you commit outside the Nix shell, you may get:
pre-commit not found. Did you forget to activate your virtualenv?In this case, use git commit --no-verify or ensure you're in the Nix environment.
CRITICAL: Always run formatting before committing or CI will fail.
Linting
Two hlint configurations exist:
./.hlint.yaml- Suggested hints for editors./.github/.hlint.yaml- Enforced hints for CI
Haskell Language Server
HLS is available in the Nix shell as haskell-language-server (not haskell-language-server-wrapper). Configure your editor to use this binary.
Documentation Building
Haddock Documentation
Build API documentation (60-90 minutes):
./scripts/combined-haddock.sh _haddock all # NEVER CANCEL - takes 60-90 minutes, timeout: 120+ minutesDocusaurus Site
Navigate to documentation directory:
cd doc/docusaurusInstall dependencies and build (10-15 minutes):
yarn # Install dependencies - 2-5 minutes
yarn build # Build site - 5-10 minutes
yarn start # Development serverPackage Structure and Key Locations
Core Packages
- plutus-core/ - Core language implementation and evaluator
- plutus-tx/ - Plutus Tx compiler and libraries
- plutus-tx-plugin/ - GHC plugin for Plutus Tx compilation
- plutus-ledger-api/ - Ledger integration APIs
- plutus-metatheory/ - Agda mechanized metatheory (formal proofs)
- plutus-executables/ - Command-line tools (plc, uplc, pir)
- plutus-benchmark/ - Performance and regression tests
- plutus-conformance/ - Evaluator correctness validation
Agda Metatheory
The plutus-metatheory/ package contains formal verification in Agda:
# Build the Agda evaluator
cabal build plutus-metatheory
# Run the Agda-based evaluator (equivalent to plc)
cabal run plc-agda -- --help
# Test conformance between Haskell and Agda implementations
cabal test plutus-metatheoryNote: When modifying .lagda files, regenerate Haskell modules with:
generate-malonzo-code # Available in Nix shellImportant Files
- cabal.project - Main project configuration
- CONTRIBUTING.adoc - Detailed contribution guidelines
- scripts/ - Build and utility scripts
- .github/workflows/ - CI/CD pipeline definitions
Common Development Patterns
When modifying core functionality:
- Always check plutus-core/README.md for package-specific guidance
- Update tests in corresponding test/ directories
- Regenerate golden files if evaluator behavior changes
- Check multiple GHC versions if touching plutus-tx-plugin
CI Requirements
The CI pipeline requires:
- No compiler warnings (builds with
-Werror) - All tests passing across all supported GHC versions
- Proper formatting (stylish-haskell, cabal-fmt)
- No lint violations per
.github/.hlint.yaml
Troubleshooting Common Issues
Build Failures
- "package not found" → Run
cabal updatein the Nix shell - Network issues with CHaP → Ensure you're in proper Nix environment with
nix develop - Missing dependencies → Exit and re-enter
nix develop --no-warn-dirty --accept-flake-config - "could not find module" → Clean and rebuild:
cabal clean && cabal build all
Plugin Issues
- Cross-compilation problems → Use GHC version conditionals in .cabal files
- GHC version mismatch → Use appropriate
nix develop .#ghc<version>shell - "orphan instances" warnings → Add
-Wno-orphansto specific modules if safe
Memory Issues During Build
- OOM during compilation → Add to cabal.project.local:
package plutus-core ghc-options: -fexternal-interpreter - GHCi link errors with recursion-schemes → Same fix as above
Test Failures
- Golden test mismatches → Regenerate with
./scripts/regen-goldens.sh - Conformance test failures → Check if changes affect evaluator semantics
- Plugin test failures → Test with all supported GHC versions
Environment Issues
- HLS not working → Ensure you're using
haskell-language-server(not-wrapper) - Formatting errors in CI → Run formatting tools before commit:
stylish-haskell --config .stylish-haskell.yaml -i <files> cabal-fmt -i <cabal-files>
Development Workflow Examples
Adding a New Built-in Function
- Modify
plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs - Update cost model data in
plutus-core/cost-model/data/ - Regenerate golden tests:
./scripts/regen-goldens.sh - Test conformance:
cabal test haskell-conformance agda-conformance - Run benchmarks:
cabal test plutus-benchmark-nofib-tests
Modifying the Evaluator
- Make changes in
plutus-core/untyped-plutus-core/ - Update corresponding Agda code in
plutus-metatheory/src/ - Regenerate Haskell from Agda:
generate-malonzo-code - Test conformance extensively:
cabal test plutus-metatheory - Check performance impact:
cabal run plutus-benchmark
Working with Plutus Tx
- Changes to
plutus-tx/may require plugin updates inplutus-tx-plugin/ - Test with multiple GHC versions:
nix develop .#ghc96 --command cabal test plutus-tx-plugin - Update golden tests for all GHC versions if needed
Essential Timing Reminders
NEVER CANCEL ANY BUILD OR TEST COMMAND
- Full builds: 45-90 minutes (timeout: 120+ minutes)
- All tests: 30-60 minutes (timeout: 90+ minutes)
- Haddock generation: 60-90 minutes (timeout: 120+ minutes)
- Golden test regeneration: 45-75 minutes (timeout: 120+ minutes)
Always set appropriate timeouts and wait for completion. Cancelled builds waste time and may leave the environment in an inconsistent state.
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about IntersectMBO/plutus
- cardano-foundation/CIPs“CIP-0194? | Plutus Core builtin `matchDataConstr`”GitHub · Jul 31, 2026 · 2 reactions
- mlabs-haskell/lambda-buffers“Planning: LambdaBuffers Cardano Conway upgrades”GitHub · Aug 8, 2024 · 1 reactions
- Plutonomicon/plutarch-plutus“Run plutus optimization pipeline on compile via `Config` option”GitHub · Jul 26, 2024 · 1 reactions
- cardano-foundation/CIPs“CIP-0058: integers vs. byteStrings for cryptographic applications”GitHub · Apr 8, 2024 · 1 reactions
- IntersectMBO/cardano-api“[FR] - Change representation of cost models in the code to JSON string”GitHub · Apr 3, 2024 · 1 reactions
The biggest 5 of 48 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 48
Talked about on GitHub (48 times).
On GitHub · 48
- Jul 31, 2026CIP-0194? | Plutus Core builtin `matchDataConstr` — cardano-foundation/CIPs2 reactions · 8 comments
- Aug 8, 2024Planning: LambdaBuffers Cardano Conway upgrades — mlabs-haskell/lambda-buffers1 reaction
- Jul 26, 2024Run plutus optimization pipeline on compile via `Config` option — Plutonomicon/plutarch-plutus1 reaction · 1 comment
- Apr 8, 2024CIP-0058: integers vs. byteStrings for cryptographic applications — cardano-foundation/CIPs1 reaction · 33 comments
- Apr 3, 2024[FR] - Change representation of cost models in the code to JSON string — IntersectMBO/cardano-api1 reaction · 19 comments
43 more on GitHub
- Feb 26, 2024Shells are more prescriptive about using the installed packages — ican-group/haskell.nix1 reaction · 1 comment
- Oct 27, 2026fix(cek): give chooseData six arguments under Plutus V4 — blinklabs-io/plutigo0 reactions · 2 comments
- Oct 27, 2026cek: chooseData takes seven arguments under Plutus V4 — blinklabs-io/plutigo0 reactions
- Oct 27, 2026Checkable spec, D0: pre-register EigenCore-0 (Lean 4 reference interpreter, replay and observation theorems, ref_diff harness) — InauguralSystems/EigenScript0 reactions · 8 comments
- Oct 26, 2026Upstream compatibility review: bac5bdb0e8df17a241d34116e529f3de — orbistry/aiken-to-nash0 reactions
- Oct 19, 2026Upstream compatibility review: 09871406901bb07b213fa726daa5d630 — orbistry/aiken-to-nash0 reactions
- Oct 12, 2026Upstream compatibility review: f55cca218ab41ffec2fa5ce350b17b1a — orbistry/aiken-to-nash0 reactions
- Oct 5, 2026Upstream compatibility review: 2c609c13cf738663c3cc5856add267a2 — orbistry/aiken-to-nash0 reactions
- Aug 18, 2026CIP-0156 | Specify index count limit for `multiIndexArray` — cardano-foundation/CIPs0 reactions · 1 comment
- Aug 7, 2026Check the conformance of flat decoding — pragma-org/amaru0 reactions
- Aug 2, 2026[clientlib] Reject tagged and indefinite-length SerialisedScript CBOR like node 11.0.1 — bloxbean/julc0 reactions · 3 comments
- Aug 1, 2026Match Plutus handling of short cost-model parameter arrays — bloxbean/julc0 reactions · 2 comments
- Aug 1, 2026julc-vm-java discards protocol version and cannot select PV11 builtin semantics — bloxbean/julc0 reactions · 1 comment
- Jul 15, 2026Integrate PlutusV4 context — IntersectMBO/cardano-ledger0 reactions
- Jun 20, 2026plutus-core seems to be benchmarking eval-only (decode excluded), while every other VM is decode+eval — SAIB-Inc/cardano-plutus-vm-benchmarksays it tested it0 reactions
- May 22, 2026feat(uplc): term/constant flat codec (UPLC-2 part 2) — michaeljfazio/dugite0 reactions
- May 20, 2026submissions: add Plinth 1.64.0.0 production measurements — IntersectMBO/UPLC-CAPE0 reactions · 1 comment
- Apr 9, 2026Bump ouroboros-consensus to ^>=3.0 and plutus to ^>=1.61 — IntersectMBO/cardano-api0 reactions
- Feb 12, 2026Bump cardano crypto class — IntersectMBO/cardano-ledger0 reactions · 3 comments
- Jan 13, 2026refactor: update cost models — blinklabs-io/plutigo0 reactions · 13 comments
- Dec 18, 2025Dykstra HF — mlabs-haskell/lambda-buffers0 reactions
- Nov 24, 2025Consider ADRs — tweag/cardano-cls0 reactions · 1 comment
- Nov 24, 2025Add fixes for profiling — ican-group/haskell.nix0 reactions
- Nov 19, 2025feat: add array builtin test scripts for E2E testing — mkoura/plutus-scripts-e2esays it tested it0 reactions · 1 comment
- Nov 18, 2025Add support for nothunks == 0.3.* — IntersectMBO/ouroboros-consensus0 reactions
- Nov 18, 2025Add support for nothunks == 0.3.* — IntersectMBO/cardano-ledger0 reactions
- Sep 30, 2025Error in further invocations of --cache — MarcWeber/hasktags0 reactions
- Sep 5, 2025Wrong relative paths in error messages when building a multi-package project — haskell/cabal0 reactions · 3 comments
- Sep 2, 2025Todo's for dumping PIR — basetunnel/plutus-cert0 reactions
- Jun 16, 2025CIP-118 - Nested Transactions — IntersectMBO/cardano-ledger0 reactions · 1 comment
- May 28, 2025Node release v10.6.0 — IntersectMBO/cardano-node0 reactions · 4 comments
- May 19, 2025Support built-in type array — basetunnel/plutus-cert0 reactions
- Jan 8, 2025Rebasing dumping PIR ASTs — basetunnel/plutus-cert0 reactions
- Jan 2, 2025Write scripts to file after deployment — input-output-hk/wsc-poc0 reactions · 1 comment
- Nov 2, 2024Proposal: Cross-Implementation Benchmarking Dataset for Plutus Performance — HarmonicLabs/plutus-machinesays it tested it0 reactions · 1 comment
- Nov 2, 2024Proposal: Cross-Implementation Benchmarking Dataset for Plutus Performance — HeliosLang/uplcsays it tested it0 reactions · 1 comment
- Nov 2, 2024Proposal: Cross-Implementation Benchmarking Dataset for Plutus Performance — scalus3/scalussays it tested it0 reactions · 1 comment
- Oct 28, 2024Refactor Symbolic Cardano to use Symbolic List — zkFold/symbolic0 reactions
- Jul 2, 2024Discuss: PlutusTx Eq instance generation should delegate to BuiltinData equality — mlabs-haskell/lambda-buffers0 reactions · 2 comments
- Jun 30, 2024Make Blueprint generation work — mlabs-haskell/cem-script0 reactions
- Jun 6, 2024Rust codegen: Plutus.Map configuration — mlabs-haskell/lambda-buffers0 reactions · 1 comment
- Apr 20, 2024Add datatype support into Plutus plugin — mlabs-haskell/cem-script0 reactions
- Feb 17, 2024Plutus Tx code review — input-output-hk/partner-chains-smart-contracts0 reactions
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
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
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.

