Skip to content
Back to skills

Cairo Snforge Troubleshooting

ASecurity

Diagnose and fix common snforge test errors including Sierra compilation failures, cost computation cycles, and version mismatches; use when tests fail with cryptic errors even though `scarb build` succeeds.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
code-qualitydebugging

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill cairo-snforge-troubleshooting --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cairo Snforge Troubleshooting?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cairo Snforge Troubleshooting
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-cairo-snforge-troubleshooting/badge)](https://www.skillsdirectory.com/skills/david-li0406-cairo-snforge-troubleshooting)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cairo-snforge-troubleshooting
description: Diagnose and fix common snforge test errors including Sierra compilation failures, cost computation cycles, and version mismatches; use when tests fail with cryptic errors even though `scarb build` succeeds.
---

# Cairo snforge Troubleshooting

## Overview
Guide debugging snforge test failures, particularly Sierra compilation errors that occur after successful Cairo compilation.

## Quick Use
- Read `references/common-errors.md` before diagnosing.
- Check `Scarb.toml` settings first - `enable-gas = false` causes many issues.
- Verify toolchain version compatibility (snforge, universal-sierra-compiler, Cairo).
- Generic implementations need proper trait bounds.

## Response Checklist
- If error mentions "cycle during cost computation": check `enable-gas` setting.
- If error mentions "universal-sierra-compiler": check version compatibility.
- If generic code fails: ensure `+Drop<T>`, `+Copy<T>` bounds and struct derives.
- If `scarb build` passes but `scarb test` fails: issue is test-specific compilation.

## Common Error Patterns

### "unexpected cycle during cost computation"
**Cause**: `enable-gas = false` in `[cairo]` section of `Scarb.toml`
**Fix**: Remove `enable-gas = false` or set to `true`

### "Error while compiling Sierra"
**Cause**: Version mismatch between Cairo and universal-sierra-compiler
**Fix**: Run `snfoundryup` to update toolchain

### Generic impl compilation issues
**Cause**: Missing trait bounds on generic implementations
**Fix**: Add `+Drop<T>`, `+Copy<T>` to impl and `#[derive(Drop, Copy)]` to structs

## Example Requests
- "My tests fail with 'unexpected cycle during cost computation'"
- "snforge test fails but scarb build works"
- "universal-sierra-compiler error after Cairo upgrade"

Files in this skill

  • SKILL.md1.8 KB
  • references/common-errors.md3.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…