panache
AGENTS.md246 starsChanged 22 days agoMITView on GitHub
Use this file for durable, high-signal guidance. - Panache is a Rust 2024 workspace with a root panache crate (library + CLI). - Workspace crates are crates/panache-parser, crates/panache-formatter, and crates/panache-wasm. - editors/zed is intentionally outside the workspace. - The parser captures a lossless CST; the formatter owns style policy. - Keep parser policy separate from formatter and linter policy. - Use typed syntax wrappers in downstream code, including the linter and language server, rather than raw kind matching where wrappers…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-lint-ruleSkill
- add-syntax-constructSkill
- commonmark-conformanceSkill
- external-toolsSkill
- html-conformanceSkill
- linter-investigationSkill
- math-parser-formatterSkill
- pandoc-ir-migrateSkill
- perf-investigationSkill
- smoke-test-triageSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
55 rules. About 0 are common, 38 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈38
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 3
Use this file for durable, high-signal guidance.
- Distinctive: line 17
Keep parser policy separate from formatter and linter policy.
- Distinctive: line 18
Use typed syntax wrappers in downstream code, including the linter and language server, rather than raw kind matching where wrappers exist.
- Distinctive: line 23
Run these commands before and after non-trivial changes:
- Distinctive: line 43
Use existing fixture layouts rather than ad-hoc test directories.
- Distinctive: line 44
Keep expected-output updates intentional and reviewed.
- Distinctive: line 45
Prefer stable substring and ordering assertions for CLI diagnostics.
- Distinctive: line 49
Do not hand-edit generated files.
- Very specific: line 60
Use Conventional Commits per CONTRIBUTING.md.
- Distinctive: line 61
Do not push or open pull requests unless explicitly asked.
- Very specific: line 62
Do not skip hooks with --no-verify.
- Very specific: line 63
Do not hand-edit CHANGELOG.md.
- Very specific: line 64
Only v* CLI releases should publish GitHub release assets in this repository.
- Distinctive: line 71
Keep parsing single-pass: block parsing followed by inline emission.
- Distinctive: line 78
Treat Pandoc-native output as the behavioral reference for parser ambiguity.
- Distinctive: line 79
Add focused parser tests or fixtures before changing behavior, and review CST snapshot diffs intentionally.
- Distinctive: line 84
Keep math parsing lossless and tolerant.
- Distinctive: line 89
Keep formatting policy out of the math parser, and add focused parser fixtures for new behavior.
- Distinctive: line 94
Keep YAML parsing CST-first, lossless, indentation-aware, and trivia-preserving.
- Distinctive: line 96
Use one core parser model for plain and hashpipe-prefixed YAML.
- Distinctive: line 97
Keep host-to-embedded range mapping explicit and deterministic.
- Distinctive: line 103
Keep conformance work incremental.
- Distinctive: line 104
Never add allowlist entries without rerunning the relevant report and confirming that the example or case passes.
- Distinctive: line 108
If parser structure changes user-visible formatting, add or update formatter golden cases.
- Very specific: line 113
Run conformance only under Flavor::CommonMark.
- Very specific: line 115
Treat spec.txt and byte-equal HTML after shared <li> whitespace normalization as the source of truth.
- Distinctive: line 117
Do not hand-edit generated reports or vendored spec fixtures.
- Very specific: line 121
Run conformance only under Flavor::Pandoc, and treat pandoc -f markdown -t native as the behavioral reference.
- Very specific: line 123
Do not hand-edit generated reports or expected.native corpus outputs.
- Distinctive: line 124
Never fix Pandoc divergence in the projector when the CST is wrong.
- Very specific: line 129
Treat each yaml-test-suite case directory as the source of truth.
- Distinctive: line 131
Keep triage and regression reports reproducible and harness-generated.
- Very specific: line 136
Run a focused golden parser case with cargo test -p panache-parser --test golden_parser_cases <case_name>.
- Distinctive: line 144
When idempotency fails, inspect the parser CST shape before adding a formatter workaround.
- Very specific: line 147
Keep formatter core logic in crates/panache-formatter.
- Distinctive: line 152
Add or update the smallest relevant formatter golden and documentation for user-visible formatting changes.
- Very specific: line 157
Treat crates/panache-formatter/src/formatter/yaml/STYLE.md as the source of truth for YAML formatting rules.
- Very specific: line 159
Keep one YAML output path through format_yaml, shared by plain metadata and hashpipe formatting.
- Distinctive: line 161
Treat cross-validation mismatches as formatter, parser, or oracle bugs to diagnose, not accepted divergence.
- Very specific: line 163
Keep pretty_yaml as a development-only reference with no runtime dependency.
- Distinctive: line 164
Ensure every YAML corpus case is idempotent.
- Very specific: line 170
Run a focused golden formatter case with cargo test --test golden_cases <case_name>.
- Distinctive: line 180
Add auto-fixes only when replacements preserve document intent.
- Distinctive: line 183
Keep CLI diagnostics concise without regressing language-server mappings.
- Distinctive: line 185
Add focused lint tests, and synchronize documentation for user-visible changes.
- Very specific: line 187
Keep rule explanations in src/linter/rules/docs/ and executable examples in each rule's examples().
- Distinctive: line 201
Keep UTF-16/UTF-8 position conversion correct.
- Distinctive: line 204
Treat Salsa cancellation as the concurrency boundary.
- Distinctive: line 206
Prefer typed syntax wrappers and shared conversion and state helpers.
- Distinctive: line 208
Add targeted protocol-visible tests, and update the language-server guide for user-visible behavior changes.
- Distinctive: line 213
Keep settings aligned across implementation, schema, and README.
- Very specific: line 216
Keep panache lsp startup explicit and predictable.
- Distinctive: line 226
Keep canonical keys kebab-case.
- Distinctive: line 231
Add focused tests for parsing, precedence, and merge changes.
- Distinctive: line 232
Update documentation when keys, defaults, or enums change.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Panache agent guide
Use this file for durable, high-signal guidance.
Project overview
- Panache is a Rust 2024 workspace with a root
panachecrate (library + CLI). - Workspace crates are
crates/panache-parser,crates/panache-formatter, andcrates/panache-wasm. editors/zedis intentionally outside the workspace.
Project-wide guidance
Architecture and ownership
- The parser captures a lossless CST; the formatter owns style policy.
- Keep parser policy separate from formatter and linter policy.
- Use typed syntax wrappers in downstream code, including the linter and language server, rather than raw kind matching where wrappers exist.
Validation
Run these commands before and after non-trivial changes:
cargo check --workspace
cargo test --workspace
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo fmt -- --checkUseful targeted commands:
cargo test --test golden_cases <case_name>
cargo test -p panache-parser --test golden_parser_cases <case_name>
cargo run -- debug format --checks all document.qmdTests and fixtures
- Assert one user-visible behavior at a time with minimal brittleness.
- Use existing fixture layouts rather than ad-hoc test directories.
- Keep expected-output updates intentional and reviewed.
- Prefer stable substring and ordering assertions for CLI diagnostics.
Generated artifacts
Do not hand-edit generated files. Regenerate them using existing project commands. Important generated outputs include:
docs/reference/cli.qmddocs/reference/_formatter-presets-details.qmddocs/reference/_linter-presets-details.qmddocs/reference/_linter-rules.qmd(task docs:rules)panache.schema.json
Commits and releases
- Use Conventional Commits per
CONTRIBUTING.md. - Do not push or open pull requests unless explicitly asked.
- Do not skip hooks with
--no-verify. - Do not hand-edit
CHANGELOG.md. - Only
v*CLI releases should publish GitHub release assets in this repository.
Parser
Core invariants
- Keep parsing single-pass: block parsing followed by inline emission.
- Preserve every source byte, including structural markers, whitespace, and trivia, in the CST.
- Reuse existing dispatchers and parser utilities; do not introduce post-parse repair passes.
- CommonMark and Pandoc are different dialects. Use
Dialectfor structural parser differences andExtensionsfor feature toggles. - Treat Pandoc-native output as the behavioral reference for parser ambiguity.
- Add focused parser tests or fixtures before changing behavior, and review CST snapshot diffs intentionally.
Math
- Keep math parsing lossless and tolerant; parsing must not hard-fail.
- Report diagnostics through side channels rather than encoding errors as CST structure.
- Emit only
MATH_*token kinds for math-content internals. - Pass flavor-specific behavior through parser options, never global state.
- Keep formatting policy out of the math parser, and add focused parser fixtures for new behavior.
YAML
- Keep YAML parsing CST-first, lossless, indentation-aware, and trivia-preserving.
- Use one core parser model for plain and hashpipe-prefixed YAML.
- Keep host-to-embedded range mapping explicit and deterministic.
- Guard behavior with yaml-test-suite parity, losslessness checks, and focused deterministic tests.
Conformance
- Keep conformance work incremental; avoid broad rewrites in one session.
- Never add allowlist entries without rerunning the relevant report and confirming that the example or case passes.
- Parser behavior changes require focused parser fixtures; conformance allowlists are regression guards, not primary behavior specifications.
- If parser structure changes user-visible formatting, add or update formatter golden cases.
CommonMark
- Run conformance only under
Flavor::CommonMark; keep the HTML renderer test-only. - Treat
spec.txtand byte-equal HTML after shared<li>whitespace normalization as the source of truth. - Do not hand-edit generated reports or vendored spec fixtures.
Pandoc
- Run conformance only under
Flavor::Pandoc, and treatpandoc -f markdown -t nativeas the behavioral reference. - Do not hand-edit generated reports or
expected.nativecorpus outputs. - Never fix Pandoc divergence in the projector when the CST is wrong; fix the parser shape first.
YAML
- Treat each yaml-test-suite case directory as the source of truth; check both
test.eventanderrorcontracts before allowlisting it. - Keep triage and regression reports reproducible and harness-generated.
Tests
- Parser golden fixtures live in
crates/panache-parser/tests/fixtures/cases/. - Run a focused golden parser case with
cargo test -p panache-parser --test golden_parser_cases <case_name>.
Formatter
Core invariants
- Enforce idempotency:
format(format(x)) == format(x). - When idempotency fails, inspect the parser CST shape before adding a formatter workaround.
- Reuse existing wrapping, list, table, and related helpers.
- Keep formatter core logic in
crates/panache-formatter; keep host runtime and process integration, including external tools and CLI/language-server wiring, in top-levelsrc/. crates/panache-formattermust remain dependency-lean. Do not move external process execution into it.- Add or update the smallest relevant formatter golden and documentation for user-visible formatting changes.
YAML
- Treat
crates/panache-formatter/src/formatter/yaml/STYLE.mdas the source of truth for YAML formatting rules. - Keep one YAML output path through
format_yaml, shared by plain metadata and hashpipe formatting. - Treat cross-validation mismatches as formatter, parser, or oracle bugs to diagnose, not accepted divergence.
- Keep
pretty_yamlas a development-only reference with no runtime dependency. - Ensure every YAML corpus case is idempotent.
Tests and debugging
- Formatter golden fixtures live in
tests/fixtures/cases/and must be registered intests/golden_cases.rs. - Run a focused golden formatter case with
cargo test --test golden_cases <case_name>. cargo run -- format <file>edits files in place. Use stdin or--checkfor inspection.
Linter
Diagnostics and fixes
- Prioritize accurate rule codes, severity, spans, and precise diagnostics.
- Add auto-fixes only when replacements preserve document intent.
- Rules produce structured diagnostics; shared CLI and language-server paths own presentation and position mapping.
- Keep CLI diagnostics concise without regressing language-server mappings.
- Reuse shared linter orchestration instead of duplicating flows.
- Add focused lint tests, and synchronize documentation for user-visible changes.
- Keep rule explanations in
src/linter/rules/docs/and executable examples in each rule'sexamples(). Regenerate the reference withtask docs:rules.
Tests and debugging
- The linter documentation parity gate is
tests/linter_rules_docs.rs. - The lint cache can mask linter changes. Use
cargo run -- clean --allor--no-cachewhen debugging.
Language server
Document state and protocol
- Preserve open, change, save, and close behavior and stable document state.
- Keep UTF-16/UTF-8 position conversion correct.
- The main thread is the sole writer of
GlobalStateand the Salsa database; workers operate on read-only snapshots. - Treat Salsa cancellation as the concurrency boundary; keep Salsa mutation on the main thread.
- Prefer typed syntax wrappers and shared conversion and state helpers.
- Make state transitions explicit; avoid silent failure paths.
- Add targeted protocol-visible tests, and update the language-server guide for user-visible behavior changes.
Editor integrations
- Keep settings aligned across implementation, schema, and README.
- Preserve activation behavior for supported languages and workspaces.
- Reuse existing process, download, and configuration helpers.
- Keep
panache lspstartup explicit and predictable. - Validate changes with
npm run compileineditors/code/.
Configuration
Discovery and merging
- Preserve configuration discovery precedence and explicit
--configfailure behavior. - Merge deterministically: flavor defaults first, then user overrides.
- Keep canonical keys kebab-case; aliases are compatibility shims.
- Make deprecations explicit and actionable.
Schema and tests
- Add focused tests for parsing, precedence, and merge changes.
- Update documentation when keys, defaults, or enums change.
- Regenerate
panache.schema.jsonwithUPDATE_EXPECTED=1 cargo test config_schema, and review the diff. - The configuration schema parity gate is
tests/config_schema.rs.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

