Coding
PromptBeginner5 minmarkdown
Nano Banana Pro
Agent skill for nano-banana-pro
7
- `src/tree_rewriter/`: core library. Primary entry points: `rewrite`, `when`, `bottom_up`, `first`, `all`, and `_` (wildcard).
Sign in to like and favorite skills
src/tree_rewriter/: core library. Primary entry points: rewrite, when, bottom_up, first, all, and _ (wildcard).examples/: runnable demos for manual testing and showcasing patterns.README.md and DESIGN.md: usage, DSL, and design rationale.pyproject.toml: packaging and dev tools config (ruff, mypy, pytest, coverage).tests/ mirroring modules, e.g., tests/test_rewrite.py.python -m venv .venv && source .venv/bin/activate && pip install -e .[dev]ruff check . — fast style and import checks.mypy . — strict settings; keep green.python examples/arithmetic_simplifier.py (adjust file to explore others).python -m pip install build && python -m build — produces wheel/sdist.snake_case; classes CapWords; modules snake_case.mypy strict passing. Use ruff to maintain consistency.pytest. Place tests in tests/ with test_*.py files.from tree_rewriter import rewrite, when, _, bottom_up def test_identity_add_zero(): rule = bottom_up(when('+', 0, _).then(lambda x: x)) assert rewrite(('+', 'x', 0), rule) == 'x'
feat: add commutative helper, fix: prevent non-terminating rule).Closes #123).ruff check ., mypy ., and tests (when present) locally; ensure examples still run.