add-language
Add one tree-sitter language to the fs3 scanner — grammar wiring, fixture, whole-tree test. Use when extending fs3-parsers language coverage.
- License 许可
- MIT
- 最近更新
- 2026-11-05
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- add-language
- description
- Add one tree-sitter language to the fs3 scanner — grammar wiring, fixture, whole-tree test. Use when extending fs3-parsers language coverage.
03 SKILL.md 正文
add-language — extend the fs3 scanner by one language
Extraction is generic — there is no step 6. The full write-up with worked examples lives at the end of docs/services/scanner.md (read it first); this is the packet form. Authored from the scanner build (worker mollusk, 2026-08-26).
The 5 steps
- Grammar crate → workspace deps +
crates/parsers/Cargo.toml. - ONE line in
[crates.fs3-parsers].externalofcrates/testkit/arch-allowlist.toml— or the drift check bites. - Extension + grammar registered in
Language::for_extension/grammar(crates/parsers). - A fixture file with real NESTING and a construct a naive substring classifier would wrongly turn into an element (the grep-trap).
- A whole-tree expectation test (kind/subkind/address/sibling_order/span as one table) plus an
invents_nothingnegative.
Touch core/src/classify.rs ONLY when the grammar's declaration kinds are shaped unlike every other's: a bare-word declaration earns a BARE_DECLS entry, a new suffix earns a DECL_SUFFIXES entry — a per-language branch never.
The four traps (each cost real time once — don't pay again)
- Hint substrings are near-miss magnets (
'mod'vs Java/C#modifiers) — safe only behind the declaration-shape gate; pin near-misses with a test. - Wrapper nodes (e.g. Python
decorated_definition) must be spliced through, or every decorated function twins. - tree-sitter error recovery yields name fields that are PRESENT AND EMPTY — refuse
Some(""). - Point-node grammars (markdown) need ranges synthesised in fs3 code.
Rules (inherited, non-negotiable)
scanstays pure — no IO/DB/async; unknown/binary degrade to a one-element tree, never an error.- Addresses are non-unique by design (
struct X+impl Xshare one);(address, span.start_line)identifies a node — never inventX#2. - Gates:
cargo test -p fs3-parsers+ arch drift green. Fixture + expectation land in the SAME commit as the wiring. - Shared-file staging discipline: ruling
.harness/government/rulings/2026-08-26-commit-push-as-you-go.md. - Report per repo convention; update
docs/services/scanner.md's language table.
04 同仓库更多 Skills
flowspace
暂无简介
pij-team
Deterministic prime→pm→coders→reviewer delivery pipeline — scaffold a plan worktree, author plan + impl-guide, dispatch a pij PM from templated ddoc packets, fan out coders per composable-service units, compose, cross-model review. Use when farming a plan out to a team, or when asked to run the pij-team flow.
flowspace
暂无简介
add-provider
Build one fs3 provider adapter (Embedder/Summarizer) end-to-end as an independent worker packet — module, stub tests, keyed contract leg, snap-in recipe. Use when adding any new LLM/embedding provider to fs3-providers.