add-parserlisted
Install: claude install-skill radimsem/remindb
# Add a parser for a new file format
remindb's `pkg/parser/` package turns raw source bytes into a slice of `*ContextNode` trees. Adding a format means routing one new extension through `ParseBytes` and emitting nodes that match the conventions every other format already follows.
## Where the format lands
Five files. Skipping any one of them ships a half-wired format.
| File | What changes |
|---|---|
| `pkg/parser/<format>.go` | New file — the parser itself |
| `pkg/parser/parser.go` | Add a `case` to the `ParseBytes` switch |
| `pkg/parser/<format>_test.go` | New file — table tests over fixture strings |
| `pkg/parser/fuzz_test.go` | Add 2–4 `f.Add(...)` seeds to `FuzzParseBytes` |
| `pkg/parser/testdata/` (optional) | Drop a sample file if tests are easier with a real fixture |
## The parser file shape
Mirror `pkg/parser/yaml.go` exactly. The pattern is from `.claude/rules/go-concise.md` §4 ("Namespace prefix-sharing helpers via a struct"): an empty struct provides the namespace, a free function is the entry point, methods drop the prefix.
```go
package parser
import "fmt"
type TomlParser struct{}
func parseToml(path string, data []byte) ([]*ContextNode, error) {
return TomlParser{}.parse(path, data)
}
func (p TomlParser) parse(path string, data []byte) ([]*ContextNode, error) {
// ... format-specific decode ...
if err != nil {
return nil, fmt.Errorf("failed to parse: toml %s: %w", path, err)
}
return []*ContextNode{buildNode(path, ""