You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Product spelling**: always write the product name as `acdc`, lowercase. Preserve other casing only in exact external quotations or case-sensitive identifiers and test inputs.
7
+
-**Worktree ownership**: inspect `git status --short` before editing. Preserve unrelated and staged work, and do not stage or commit unless the user explicitly asks.
8
+
-**Feature coverage**: use `--all-features` for standard test/build/clippy commands. When a task changes supported feature-off behavior, also run the applicable documented `--no-default-features` configuration.
-**Compact imports**: merge imports from the same crate/module into one `use` with braces, e.g. `use std::{borrow::Cow, io::Write};` — not separate `use std::borrow::Cow;` / `use std::io::Write;` lines
10
12
-**Update changelogs**: each crate has its own `CHANGELOG.md`; update `[Unreleased]` for affected crates. Entries describe what a user sees or is affected by — the new behavior, the attribute/option to reach it, and any divergence from `asciidoctor`. Never regurgitate internal mechanics (function/field names, struct changes, control flow); those belong in code/commits, not the changelog.
11
13
-**Surface converter warnings structurally**: user-relevant converter warnings should use `Warning` / `Diagnostics`, not `tracing::warn!`
12
14
-**Never use CLI for fixtures**: use the examples directly (CLI adds `last_updated` timestamps)
13
-
-**asciidoctor is reference**: when output differs, use `compare-asciidoc-output` agent
15
+
-**asciidoctor is reference**: compare one source using the built `acdc` CLI and the matching asciidoctor backend first. Compare observable behavior, not byte-identical output, and avoid temporary Rust harnesses. Use the `compare-asciidoc-output` agent only after a direct comparison confirms a divergence or deeper research is needed. For PDF comparisons, keep clearly named `*-acdc.pdf` and `*-asciidoctor.pdf` outputs; do not create raster previews unless the user asks.
16
+
17
+
## Validation workflow
18
+
19
+
- Never run Cargo commands concurrently against the same target directory.
20
+
- During implementation, run the smallest relevant package, test, or stable nextest expression, such as `-E 'test(/name/)'` rather than a generated fixture number.
21
+
- Use `--all-features` for standard validation. When changing feature-off behavior, also run the applicable documented `--no-default-features` checks.
22
+
- At a cross-crate, public-API, checklist, or commit boundary, run:
Copy file name to clipboardExpand all lines: acdc-cli/AGENTS.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,13 @@
8
8
9
9
`setext` is default-on as a build feature and exposes the runtime `--setext` compatibility flag. `highlighting` forwards to whichever of the HTML and terminal backends are selected without enabling either backend itself.
10
10
11
+
## Attribute overrides
12
+
13
+
- The CLI owns parsing of `-a` syntax only. Parser `Options` owns protected and caller-locked attribute decisions.
14
+
- Preserve the distinction between locked defaults and soft `@` assignments and unsets.
15
+
- Do not add CLI-only lock exceptions.
16
+
- Changes require CLI tests plus parser policy fixture and API tests.
17
+
11
18
## TCK compliance
12
19
13
20
The CLI supports the AsciiDoc TCK (Test Compatibility Kit) behind a feature flag.
Converter-side plumbing (`SubsFlags`, `effective_subs`, fixture naming) lives in `converters/AGENTS.md`.
25
25
26
+
## Document attribute policy
27
+
28
+
-`constants.rs` owns the static built-in read-only and API-only attribute protection.
29
+
-`Options` combines built-in protection with locks supplied by the caller.
30
+
- The CLI parses attribute assignment syntax, and converters may add unlocked defaults. Neither duplicates the parser's lock policy.
31
+
- Keep the policy internal. The public parser API should expose only stable caller intent, never converter-specific or test-specific fields and functions.
32
+
- When changing the policy, test document entries, parser `Options` and builder input, CLI `-a` input, locked and soft `@` assignments and unsets, and header/body exceptions. Compare both the official attribute documentation and the current asciidoctor implementation.
33
+
26
34
## Debugging
27
35
28
36
-**Grammar failures** → use `trace-parse` skill, then check `src/grammar/`
@@ -40,6 +48,8 @@ Regenerate parser fixtures:
40
48
cargo run -p acdc-parser --example generate_parser_fixtures --all-features
41
49
```
42
50
51
+
The generator rewrites all parser JSON fixtures. Record `git status --short` before running it and inspect every changed fixture afterward. Treat the `.adoc` file as the test input and the generated `.json` file as expected output. Use stable nextest expressions instead of generated fixture numbers when running one fixture test.
Copy file name to clipboardExpand all lines: converters/AGENTS.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,13 +43,23 @@ Shared utilities in `core/`:
43
43
explicitly, and `test_fixture` has the matching `.contains("subs")`
44
44
early-return.
45
45
46
+
## Test placement
47
+
48
+
- Use source and expected-output fixtures for rendered HTML, text, Typst, and other snapshot-like converter output.
49
+
- Use integration tests for properties that snapshots cannot prove, including structured diagnostics, PDF annotations, PDF objects and metadata, warnings, and end-to-end behavior.
50
+
46
51
## Debugging
47
52
48
-
-Use `compare-asciidoc-output` agent to diff converter output against asciidoctor
53
+
-Compare the same source with the built `acdc` CLI and the matching asciidoctor backend before using the `compare-asciidoc-output` agent. Compare observable behavior rather than byte-identical output.
49
54
- For fixture mismatches, run `regen-fixtures` skill (ask first)
50
55
51
56
## Fixture regeneration
52
57
58
+
- Get approval before regenerating fixtures.
59
+
- Record `git status --short` before regeneration.
60
+
- Run one generator at a time. Each generator may rewrite its full fixture corpus.
61
+
- Inspect status and the diff immediately afterward. Keep only intended changes or explicitly approved new baselines, and reject environment-only changes.
62
+
53
63
```bash
54
64
cargo run -p acdc-converters-html --example generate_html_fixtures --all-features
55
65
cargo run -p acdc-converters-terminal --example generate_terminal_fixtures --all-features
- The terminal fixture macro's boolean argument controls whether the test reads `.osc8.txt`. When it is `true`, the generic harness skips the fixture for terminals without OSC 8 support.
78
+
- A plain `.txt` file for that same fixture is unused unless a separate no-OSC8 assertion reads it.
79
+
- If both `.txt` and `.osc8.txt` are retained, add explicit coverage for both outputs.
80
+
- Test terminal capability-dependent behavior with both `TERM=dumb` and `TERM=xterm-ghostty`.
0 commit comments