-
Notifications
You must be signed in to change notification settings - Fork 0
feat: bootstrap production-grade starknet-skills foundation #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c608d03
feat: bootstrap production-grade starknet-skills v0.1 structure
omarespejel 6be006b
feat(audits): add batch pdf fetch and extraction pipeline
omarespejel 45e4f25
fix(audits): sanitize extracted filenames for spaced urls
omarespejel c1ee502
feat(datasets): add audit-to-skills pipeline schemas and initial corpus
omarespejel 675e045
docs(skills): wire modules to normalized and distilled audit dataset
omarespejel 37757d1
fix(pr-1): address review comments on toolchain security and eval input
omarespejel 3feacb8
fix(pr-1): address remaining review threads across docs and validators
omarespejel 694f7d2
fix(pipeline): harden url/path validation and schema strictness
omarespejel 653ae5b
fix(pr-1): resolve remaining review comments and harden audit pipeline
omarespejel ba2cc54
fix(pipeline): align schema strictness and preserve decode visibility
omarespejel 488ab2b
chore(quality): harden audit pipeline and add CI quality gate
omarespejel 26cde68
fix(review): harden schema validation and extraction pipeline
omarespejel fbeb9a5
fix(ci): make quality smoke tests self-contained
omarespejel 8c1f6b0
fix(greptile): harden pipeline checks and pin CI actions
omarespejel 4684bf9
fix(ci): pin ruff action to valid v3 commit sha
omarespejel fbba6e3
harden skill repo format and adopt progressive disclosure
omarespejel b81b0c0
add enforceable skill contract validator and CI gate
omarespejel 3b68cfd
enforce production-grade skill contracts and onboarding
omarespejel da71e2d
align cairo-testing docs with snforge 0.56 CLI flags
omarespejel 49254b6
add baseline parity checks and fix stale toolchain guidance
omarespejel 728c006
add explicit trail-of-bits parity checks and workflow links
omarespejel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "name": "starknet-skills", | ||
| "version": "0.1.0", | ||
| "description": "Cairo/Starknet reasoning and audit-quality skills", | ||
| "author": "keep-starknet-strange" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| .DS_Store | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # Local tooling | ||
| .venv/ | ||
| .env | ||
|
|
||
| # Python cache | ||
| __pycache__/ | ||
| *.pyc | ||
|
|
||
| # Local audit ingest artifacts | ||
| datasets/audits/raw/* | ||
| !datasets/audits/raw/.gitkeep | ||
| datasets/audits/extracted/* | ||
| !datasets/audits/extracted/.gitkeep | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Repo Context | ||
|
|
||
| This repository is for reasoning-grade Cairo/Starknet skills. | ||
|
|
||
| ## Hard Boundary | ||
|
|
||
| - Keep operational SDK/protocol usage content out of this repo. | ||
| - Keep this repo focused on correctness, security patterns, and evaluation-backed guidance. | ||
|
|
||
| ## Editing Rules | ||
|
|
||
| - Keep root skill modules concise. | ||
| - Move large details to `references/` and `workflows/`. | ||
| - Do not expand scope without accompanying eval updates. | ||
|
|
||
| ## Evaluation Rules | ||
|
|
||
| - Detection quality changes must add or update evaluation cases. | ||
| - Prefer held-out regressions from `datasets/audits/`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Contributing | ||
|
|
||
| ## Quality Bar | ||
|
|
||
| Every change must satisfy both tests: | ||
|
|
||
| 1. Would a strong stock model still get this wrong without this content? | ||
| 2. Does this change improve deterministic quality outcomes (fewer misses, fewer false positives, better remediation quality)? | ||
|
|
||
| If both answers are not yes, do not add the content. | ||
|
|
||
| ## Required Structure in Skill Files | ||
|
|
||
| Each `SKILL.md` must include: | ||
|
|
||
| - `When to Use` | ||
| - `When NOT to Use` | ||
|
|
||
| Security/audit skills must also include: | ||
|
|
||
| - `Rationalizations to Reject` | ||
|
|
||
| Keep entry skills short and link one level deep to `references/` and `workflows/`. | ||
|
|
||
| ## Evaluation-Driven Changes | ||
|
|
||
| Skill changes that affect detection or remediation quality must include one of: | ||
|
|
||
| - New/updated case in `evals/cases/` | ||
| - Updated benchmark scorecard in `evals/scorecards/` | ||
|
|
||
| No merge without green quality gates: | ||
|
|
||
| - formatting/build/tests | ||
| - static analysis where applicable | ||
| - evaluator pass threshold | ||
|
|
||
| ## Audit Data Handling | ||
|
|
||
| When ingesting external audits into `datasets/audits/`: | ||
|
|
||
| - redact confidential or client-identifying material | ||
| - preserve technical root cause and exploitability detail | ||
| - tag confidence and provenance for every finding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,37 @@ | ||
| # starknet-skills | ||
|
|
||
| Production-grade skills for high-quality Cairo and Starknet security engineering. | ||
|
|
||
| This repository is focused on reasoning quality, audit rigor, and deterministic quality gates. | ||
| Operational SDK and protocol execution playbooks belong in `starknet-agentic` / `starkzap`. | ||
|
|
||
| ## Scope Boundary | ||
|
|
||
| - In scope: Cairo correctness, security review patterns, Starknet architectural facts, testing and hardening workflows. | ||
| - Out of scope: runtime tool execution guides (MCP tool usage, SDK call recipes, protocol operation runbooks). | ||
|
|
||
| ## Modules | ||
|
|
||
| - `cairo-auditor/` — flagship workflow skill for Cairo security review. | ||
| - `cairo-contract-authoring/` — contract structure and implementation patterns. | ||
| - `cairo-testing/` — Starknet Foundry testing and fuzzing workflows. | ||
| - `cairo-optimization/` — performance and low-level Cairo optimization rules. | ||
| - `cairo-toolchain/` — build/declare/deploy/verification and release operations. | ||
| - `account-abstraction/` — Starknet account abstraction and account-security semantics. | ||
| - `starknet-network-facts/` — network-level constraints and chain behavior guardrails. | ||
| - `openzeppelin-cairo/` — OpenZeppelin Cairo composition and hardening patterns. | ||
|
|
||
| ## Data + Evals | ||
|
|
||
| - `datasets/audits/` stores normalized findings extracted from real audits. | ||
| - `evals/` stores held-out evaluation cases and scorecards. | ||
|
|
||
| Do not merge skill changes without updating or passing the corresponding evaluation set. | ||
|
|
||
| ## Initial Source Imports | ||
|
|
||
| v0.1 seeds several modules from existing `starknet-agentic` skills and then constrains them to this repo boundary. | ||
|
|
||
| ## License | ||
|
|
||
| MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| name: starknet-skills | ||
| description: Router skill for Cairo/Starknet high-quality coding and auditing. Use this first to pick a focused module. | ||
| --- | ||
|
|
||
| # Starknet Skills Router | ||
|
|
||
| Use this file to choose the smallest relevant module. | ||
|
|
||
| ## Start Here | ||
|
|
||
| - For contract security review: `cairo-auditor/SKILL.md` | ||
| - For writing new contracts: `cairo-contract-authoring/SKILL.md` | ||
| - For testing and fuzzing: `cairo-testing/SKILL.md` | ||
| - For gas/perf optimization: `cairo-optimization/SKILL.md` | ||
| - For build/declare/deploy/release operations: `cairo-toolchain/SKILL.md` | ||
| - For account abstraction rules and risks: `account-abstraction/SKILL.md` | ||
| - For Starknet network constraints: `starknet-network-facts/SKILL.md` | ||
| - For OpenZeppelin Cairo usage and footguns: `openzeppelin-cairo/SKILL.md` | ||
|
|
||
| ## Routing Policy | ||
|
|
||
| - Prefer one module first. | ||
| - Add a second module only when blocked. | ||
| - Keep context narrow and evidence-based. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| name: account-abstraction | ||
| description: Starknet account abstraction correctness and security guidance for validate/execute paths, nonces, signatures, and session policies. | ||
| --- | ||
|
|
||
| # Account Abstraction | ||
|
|
||
| ## When to Use | ||
|
|
||
| - Reviewing account contract validation and execution paths. | ||
| - Designing session-key policy boundaries. | ||
| - Validating nonce and signature semantics. | ||
|
|
||
| ## When NOT to Use | ||
|
|
||
| - General contract authoring not involving account semantics. | ||
|
|
||
| ## Core Focus | ||
|
|
||
| - `__validate__` constraints and DoS resistance. | ||
| - `__execute__` policy enforcement correctness. | ||
| - Replay protection and domain separation. | ||
| - Privileged selector and self-call protection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # References | ||
|
|
||
| Account abstraction threat models, selector policy examples, and replay-protection references. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # cairo-auditor | ||
|
|
||
| Flagship security workflow module for Cairo/Starknet auditing. | ||
|
|
||
| - `SKILL.md` contains orchestration policy and output contract. | ||
| - `references/vulnerability-db/` stores generalized vulnerability patterns. | ||
| - `references/audit-findings/` stores normalized findings from historical audits. | ||
| - `workflows/` contains runbooks for default/deep/targeted operation. | ||
|
omarespejel marked this conversation as resolved.
|
||
| - `agents/` contains agent-specific instructions for parallel scans. | ||
| - `scripts/` contains extraction and normalization utilities. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| name: cairo-auditor | ||
| description: Security audit workflow for Cairo/Starknet contracts. Use for pre-merge and pre-release vulnerability discovery, triage, and remediation planning. | ||
| allowed-tools: [Bash, Read, Glob, Grep, Task] | ||
| --- | ||
|
|
||
| # Cairo Auditor | ||
|
|
||
| Workflow skill for systematic Cairo contract security review. | ||
|
|
||
| ## When to Use | ||
|
|
||
| - Reviewing contract changes before merge. | ||
| - Performing release-gate security checks. | ||
| - Triaging suspicious Cairo/Starknet patterns from code review or incidents. | ||
|
|
||
| ## When NOT to Use | ||
|
|
||
| - Writing new contract features from scratch. | ||
| - Deployment-only tasks. | ||
| - SDK or protocol operation guides. | ||
|
|
||
| ## Rationalizations to Reject | ||
|
|
||
| - "Tests pass so this is safe." | ||
| - "This pattern is standard in EVM so it is safe in Cairo." | ||
| - "The edge case is impossible in production." | ||
| - "We can skip replay/domain checks because signatures are temporary." | ||
|
|
||
| ## Modes | ||
|
|
||
| - `default`: whole-package review using scoped file discovery. | ||
| - `deep`: default + adversarial reasoning pass + strict false-positive gate. | ||
| - `targeted`: explicit file-path review for fast PR iteration. | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. Discover in-scope Cairo files. | ||
| 2. Run vectorized scans using vulnerability patterns in `references/vulnerability-db/`. | ||
| 3. Correlate with historical findings in `references/audit-findings/`. | ||
| 4. Merge and deduplicate findings by root cause. | ||
| 5. Run false-positive verification gate. | ||
| 6. Emit prioritized report with remediation guidance and test requirements. | ||
|
|
||
| ## Reporting Contract | ||
|
|
||
| Each finding must include: | ||
|
|
||
| - severity | ||
| - file/function location | ||
| - root cause | ||
| - exploit path | ||
| - fix recommendation | ||
| - required regression test | ||
|
|
||
|
omarespejel marked this conversation as resolved.
|
||
| ## Evidence Sources | ||
|
|
||
| - canonical patterns: `references/vulnerability-db/` | ||
| - audit-derived cases: `references/audit-findings/` | ||
| - evaluator regressions: `../../evals/cases/` | ||
|
omarespejel marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Output Rule | ||
|
|
||
| Only report actionable findings with confidence >= medium unless `deep` mode is requested. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0.1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Adversarial Agent | ||
|
|
||
| Construct concrete exploit paths for candidate findings. | ||
| Reject findings that cannot produce a realistic attack path under stated assumptions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Vector Scan Agent | ||
|
|
||
| Scan assigned files for pattern matches against `../references/vulnerability-db/`. | ||
| Do not report stylistic issues. Report only security-relevant findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Audit Findings Corpus | ||
|
|
||
| This directory stores normalized findings extracted from historical audits. | ||
|
|
||
| Do not store confidential client identifiers. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.