agentleFS
jolarsjolars/panache/AGENTS.md

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…

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
  1. Distinctive:

    Use this file for durable, high-signal guidance.

    line 3
  2. Distinctive:

    Keep parser policy separate from formatter and linter policy.

    line 17
  3. Distinctive:

    Use typed syntax wrappers in downstream code, including the linter and language server, rather than raw kind matching where wrappers exist.

    line 18
  4. Distinctive:

    Run these commands before and after non-trivial changes:

    line 23
  5. Distinctive:

    Use existing fixture layouts rather than ad-hoc test directories.

    line 43
  6. Distinctive:

    Keep expected-output updates intentional and reviewed.

    line 44
  7. Distinctive:

    Prefer stable substring and ordering assertions for CLI diagnostics.

    line 45
  8. Distinctive:

    Do not hand-edit generated files.

    line 49
  9. Very specific:

    Use Conventional Commits per CONTRIBUTING.md.

    line 60
  10. Distinctive:

    Do not push or open pull requests unless explicitly asked.

    line 61
  11. Very specific:

    Do not skip hooks with --no-verify.

    line 62
  12. Very specific:

    Do not hand-edit CHANGELOG.md.

    line 63
  13. Very specific:

    Only v* CLI releases should publish GitHub release assets in this repository.

    line 64
  14. Distinctive:

    Keep parsing single-pass: block parsing followed by inline emission.

    line 71
  15. Distinctive:

    Treat Pandoc-native output as the behavioral reference for parser ambiguity.

    line 78
  16. Distinctive:

    Add focused parser tests or fixtures before changing behavior, and review CST snapshot diffs intentionally.

    line 79
  17. Distinctive:

    Keep math parsing lossless and tolerant.

    line 84
  18. Distinctive:

    Keep formatting policy out of the math parser, and add focused parser fixtures for new behavior.

    line 89
  19. Distinctive:

    Keep YAML parsing CST-first, lossless, indentation-aware, and trivia-preserving.

    line 94
  20. Distinctive:

    Use one core parser model for plain and hashpipe-prefixed YAML.

    line 96
  21. Distinctive:

    Keep host-to-embedded range mapping explicit and deterministic.

    line 97
  22. Distinctive:

    Keep conformance work incremental.

    line 103
  23. Distinctive:

    Never add allowlist entries without rerunning the relevant report and confirming that the example or case passes.

    line 104
  24. Distinctive:

    If parser structure changes user-visible formatting, add or update formatter golden cases.

    line 108
  25. Very specific:

    Run conformance only under Flavor::CommonMark.

    line 113
  26. Very specific:

    Treat spec.txt and byte-equal HTML after shared <li> whitespace normalization as the source of truth.

    line 115
  27. Distinctive:

    Do not hand-edit generated reports or vendored spec fixtures.

    line 117
  28. Very specific:

    Run conformance only under Flavor::Pandoc, and treat pandoc -f markdown -t native as the behavioral reference.

    line 121
  29. Very specific:

    Do not hand-edit generated reports or expected.native corpus outputs.

    line 123
  30. Distinctive:

    Never fix Pandoc divergence in the projector when the CST is wrong.

    line 124
  31. Very specific:

    Treat each yaml-test-suite case directory as the source of truth.

    line 129
  32. Distinctive:

    Keep triage and regression reports reproducible and harness-generated.

    line 131
  33. Very specific:

    Run a focused golden parser case with cargo test -p panache-parser --test golden_parser_cases <case_name>.

    line 136
  34. Distinctive:

    When idempotency fails, inspect the parser CST shape before adding a formatter workaround.

    line 144
  35. Very specific:

    Keep formatter core logic in crates/panache-formatter.

    line 147
  36. Distinctive:

    Add or update the smallest relevant formatter golden and documentation for user-visible formatting changes.

    line 152
  37. Very specific:

    Treat crates/panache-formatter/src/formatter/yaml/STYLE.md as the source of truth for YAML formatting rules.

    line 157
  38. Very specific:

    Keep one YAML output path through format_yaml, shared by plain metadata and hashpipe formatting.

    line 159
  39. Distinctive:

    Treat cross-validation mismatches as formatter, parser, or oracle bugs to diagnose, not accepted divergence.

    line 161
  40. Very specific:

    Keep pretty_yaml as a development-only reference with no runtime dependency.

    line 163
  41. Distinctive:

    Ensure every YAML corpus case is idempotent.

    line 164
  42. Very specific:

    Run a focused golden formatter case with cargo test --test golden_cases <case_name>.

    line 170
  43. Distinctive:

    Add auto-fixes only when replacements preserve document intent.

    line 180
  44. Distinctive:

    Keep CLI diagnostics concise without regressing language-server mappings.

    line 183
  45. Distinctive:

    Add focused lint tests, and synchronize documentation for user-visible changes.

    line 185
  46. Very specific:

    Keep rule explanations in src/linter/rules/docs/ and executable examples in each rule's examples().

    line 187
  47. Distinctive:

    Keep UTF-16/UTF-8 position conversion correct.

    line 201
  48. Distinctive:

    Treat Salsa cancellation as the concurrency boundary.

    line 204
  49. Distinctive:

    Prefer typed syntax wrappers and shared conversion and state helpers.

    line 206
  50. Distinctive:

    Add targeted protocol-visible tests, and update the language-server guide for user-visible behavior changes.

    line 208
  51. Distinctive:

    Keep settings aligned across implementation, schema, and README.

    line 213
  52. Very specific:

    Keep panache lsp startup explicit and predictable.

    line 216
  53. Distinctive:

    Keep canonical keys kebab-case.

    line 226
  54. Distinctive:

    Add focused tests for parsing, precedence, and merge changes.

    line 231
  55. Distinctive:

    Update documentation when keys, defaults, or enums change.

    line 232

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Panache agent guide

Use this file for durable, high-signal guidance.

Project overview

  • 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.

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 -- --check

Useful 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.qmd

Tests 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.qmd
  • docs/reference/_formatter-presets-details.qmd
  • docs/reference/_linter-presets-details.qmd
  • docs/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 Dialect for structural parser differences and Extensions for 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.txt and 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 treat pandoc -f markdown -t native as the behavioral reference.
  • Do not hand-edit generated reports or expected.native corpus 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.event and error contracts 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-level src/.
  • crates/panache-formatter must 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.md as 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_yaml as 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 in tests/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 --check for 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's examples(). Regenerate the reference with task 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 --all or --no-cache when 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 GlobalState and 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 lsp startup explicit and predictable.
  • Validate changes with npm run compile in editors/code/.

Configuration

Discovery and merging

  • Preserve configuration discovery precedence and explicit --config failure 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.json with UPDATE_EXPECTED=1 cargo test config_schema, and review the diff.
  • The configuration schema parity gate is tests/config_schema.rs.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.