Skip to content

Add context guide, skill files and dev scripts#1132

Open
anvacaru wants to merge 6 commits into
masterfrom
claude-integration
Open

Add context guide, skill files and dev scripts#1132
anvacaru wants to merge 6 commits into
masterfrom
claude-integration

Conversation

@anvacaru
Copy link
Copy Markdown
Contributor

@anvacaru anvacaru commented Apr 9, 2026

Adds Claude Code support for the Kontrol repo: a context guide for navigating the codebase, three workflow skills, and two developer scripts.

  • CLAUDE.md/AGENTS.md: guide covering project structure, K semantic definitions, CLI commands, cheatcode inventory (Foundry and Kontrol-proprietary), testing conventions, dev workflow, and gotchas.

  • Skills

  • /build - runs scripts/build-kontrol, captures output, surfaces K compiler errors on failure

  • /add-cheatcode - step-by-step guide for adding a new cheatcode (K rule, selector, Solidity test, CI registration)

  • /update-expected-output — runs golden file regeneration for foundry / CSE+minimize / end-to-end suites; recommends scoping with --foundry/--cse/--end-to-end and -k test_name

  • Scripts

  • scripts/build-kontrol — K version check/install, uv sync, kdist clean+build

  • scripts/selector — computes ABI function selector as decimal integer (wraps cast sig)

  • scripts/update-expected-output — pytest .expected file regeneration with per-suite flags and parallel worker tuning

@anvacaru anvacaru marked this pull request as ready for review April 24, 2026 07:23
Copy link
Copy Markdown
Contributor

@juliankuners juliankuners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

Comment thread AGENTS.md
| ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| `build-kontrol` | Full build: K version check/install, `uv sync`, `kdist clean+build`. |
| `selector "<sig>"` | Compute the ABI function selector for `<sig>` as a decimal integer (uses `cast sig`). |
| `update-expected-output [--foundry] [--cse] [--end-to-end] [-k <filter>]` | Wrapper script over the make recipes to egenerate expected-output snapshots. Pass a suite flag to target one suite; `-k` scopes to a single test. Runs all suites if no flag given. |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: egenerate -> generate

Suggested change
| `update-expected-output [--foundry] [--cse] [--end-to-end] [-k <filter>]` | Wrapper script over the make recipes to egenerate expected-output snapshots. Pass a suite flag to target one suite; `-k` scopes to a single test. Runs all suites if no flag given. |
| `update-expected-output [--foundry] [--cse] [--end-to-end] [-k <filter>]` | Wrapper script over the make recipes to generate expected-output snapshots. Pass a suite flag to target one suite; `-k` scopes to a single test. Runs all suites if no flag given. |

Comment thread AGENTS.md

# 2. After any Python change: format then run all checkers + unit tests
make format # auto-format (autoflake + isort + black)
make # check (flake8, mypy, autoflake, isort, black) + unit tests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this test make check explicitely. While make will run make check, test-unit is explicitely called in Step 3 as well, so please adapt either for consistency.

Suggested change
make # check (flake8, mypy, autoflake, isort, black) + unit tests
make check # check (flake8, mypy, autoflake, isort, black) + unit tests

Comment thread scripts/build-kontrol
Comment on lines +16 to +19
install_k() {
echo "Installing or updating K to version $REQUIRED_VERSION..."
kup install k.openssl.secp256k1 --version "$REQUIRED_VERSION"
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we instead make use of the available nix develop shell? This way, the kup installed version of K is not changed.
See e.g.:

nix develop --command uv run kdist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants