This guide shows you how to use the pcl-assertion-workflow skill to create a local assertion project in an existing protocol repository and verify it with pcl.
Prerequisites
Before you begin, make sure you have:
1. Start the agent in the protocol repository
Give the agent access to the repository that contains the protocol contracts. Do not give it deployment credentials for this task; project creation and testing are local operations.
Ask it to inspect the existing Foundry configuration, dependency layout, contracts, tests, and invariant documentation before proposing changes.
2. Request the project
Use a prompt like this:
The explicit boundary at the end keeps project creation separate from deployment.
3. Review the proposed invariants
Before allowing implementation, confirm that each proposed assertion:
- Protects a security-relevant property
- Observes external state rather than duplicating a local
require
- Names the contracts and state transitions it covers
- Has a narrow trigger strategy
- Can be exercised by both passing and failing tests
If an invariant is ambiguous, refine it before the agent writes Solidity.
4. Review the generated project
The exact structure should follow the host repository, but a typical result includes:
The agent may also update foundry.toml, remappings.txt, or dependency files. Review those changes for overlap with existing profiles and remappings.
5. Verify the project
Give the agent this verification prompt:
Review the test output and ask the agent to summarize:
- Which assertion functions executed
- Which protected calls were tested
- How each negative test proves the assertion invalidates a transaction
- Any invariant or execution path that remains untested
Passing tests do not prove that the chosen invariant is correct or complete. Review the assertion logic and threat model before moving to deployment.
6. Prepare for deployment
Before handing the project to a deployment agent:
- Commit or otherwise preserve the reviewed local changes
- Confirm that
assertions/credible.toml names every protected contract and assertion
- Decide on staging or production
- Identify the target chain and protocol manager wallet
Continue with How to Deploy Projects Through Agentic PCL.