AGENTS
AGENTS Guide for ASTQuery (Raku 6.d)
Setup:
zef install --/test --test-depends --deps-only .(installs deps)Install test runner:
zef install --/test App::Prove6Run all tests:
prove6 -I. tRun single test file:
prove6 -I. t/02-ASTQuery.rakutest(orraku -I. t/<file>)Syntax check (lint):
raku -I. -c lib/ASTQuery.rakumod lib/ASTQuery/*.rakumodInstall locally:
zef install .(optional)CLI:
raku -I. bin/ast-query.raku(if needed)Imports: Put
useat top; declareunit module|classfirst; export withis export.Formatting: Use tabs for indentation; one
useper line; keep lines readable (<100 cols); trailing commas in multi-line lists.Types: Prefer typed signatures (
Str,Bool,Callable), subsets +where; useproto/multidispatch as in repo.Naming: CamelCase for types/modules; hyphenated method names (e.g.,
validate-descendant); lower-case sub names; ALLCAPS env vars.Errors: Use
failfor programmer errors; returnFalsefor predicate no-match; wrap risky code inCATCH { default { ... } }.Debug: Gate notes behind
%*ENV<ASTQUERY_DEBUG>; usenote, notsay, in library code.Tests: Use
use Test; done-testing;with.rakutestfiles; preferisa-ok,is-deeply,ok.AST use:
use experimental :rakuastwhere needed; avoid breaking matcher/API gists.Public API: Modify exports in
lib/ASTQuery.rakumodcarefully; keep signatures stable.Docs: Keep Pod6 in modules; update README examples if changing query syntax.
Cursor/Copilot: No Cursor or Copilot rule files present.
CI parity: Match GitHub Actions:
prove6 -I. ton macOS/Ubuntu latest Raku.Coverage:
zef install --/test App::RaCoCo(once). Runraku -I. tools/coverage.rakuto compute total coverage; it printspercent=<number>.Pre-commit check: Before every commit, run
raku -I. tools/coverage-check.rakuwhich updates.coverage-baselineand tells you if coverage decreased vs. last commit.Commits: Follow Conventional Commits (feat, fix, docs, chore, refactor, test, perf, build, ci, revert); imperative mood; optional scope; add body/footers when relevant (e.g., BREAKING CHANGE:, Closes #123).
Independent of what language is being used on conversation, the generated code, comments, documentation, etc will ALWAY be in English.