Skip to content

obsidian-bases: fix the YAML quoting rule, list arithmetic operators and random() - #174

Open
luchasarie wants to merge 1 commit into
obsidianmd:mainfrom
luchasarie:bases-syntax-accuracy
Open

luchasarie wants to merge 1 commit into
obsidianmd:mainfrom
luchasarie:bases-syntax-accuracy

Conversation

@luchasarie

Copy link
Copy Markdown

Three small accuracy fixes in the obsidian-bases skill, checked against the Bases docs.

  1. YAML quoting. Troubleshooting says strings containing any of : { } [ ] , & * # ? | - < > = % @ (plus backtick and !) "must be quoted". yaml (1.2) and js-yaml (1.1) both read Q&A, 50%, x,y, a=b and Status-Active as plain strings. What breaks is : or a trailing :, #, a leading - or ? , and a leading indicator character. The rule now says that and keeps "when in doubt, quote". Covers item 2 of Docs suggestions: data-trust note for CLI/Headless, YAML quoting wording, CLI failure example, knap overwrite policy #171. Not tested against Obsidian's own YAML parser.
  2. Operators. The table only had comparison and boolean operators. Added + - * / % and ( ) and renamed it "Operators", since the formula examples already use arithmetic.
  3. random() added to FUNCTIONS_REFERENCE.md.

Source for 2 and 3: obsidianmd/obsidian-help, en/Bases/Bases syntax.md and en/Bases/Functions.md. claude plugin validate . --strict passes.

🤖 Generated with Claude Code

…ors and random()

The Troubleshooting section says strings containing any of `: { } [ ] , & * # ? | - < > = % @ ` !` "must be quoted". Most of those are fine in the middle of a plain value. A YAML 1.2 parser (`yaml`) and a YAML 1.1 parser (`js-yaml`) both read `Q&A`, `50%`, `x,y`, `a=b`, `Status-Active` and `a|b` as plain strings. What breaks is `: ` or a trailing `:`, ` #`, a leading `- ` or `? `, and a leading `[ ] { } , & * # | > ' " % @ ` !`. State that rule, and keep "when in doubt, quote".

Two things the Bases docs list that the skill leaves out:
- The arithmetic operators `+ - * / %` and `( )`. The "Filter Operators" table only had comparison and boolean operators, though the formula examples use arithmetic. Rename it to "Operators".
- The global `random()` function, missing from FUNCTIONS_REFERENCE.md.

Source: obsidianmd/obsidian-help, en/Bases/Bases syntax.md ("Arithmetic operators") and en/Bases/Functions.md (`random()`).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant