When strict YAML cannot load a rule (for example unquoted globs), the
line-based fallback treated trigger: '' as native and left the rule
without an activation trigger. Read the trigger value by hand, drop a
trailing comment and surrounding quotes, and only treat a nonblank value
as native.
Refs #3548
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Treat a rule as native only when its parsed `trigger` is a non-empty
string, so empty, comment-only, and blank-string triggers are adapted.
The line check is kept only as the fallback for native rules whose
unquoted globs cannot be parsed as YAML.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An empty `trigger:` line is not a usable activation trigger, so adapt
the rule instead of passing it through unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rule that already declares a trigger may carry unquoted
`globs: **/*.ts`, which js-yaml rejects as an alias. Detect an existing
trigger before parsing so native rules, and the adapter's own output,
pass through unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plain YAML scalar cannot start with `*`, so `globs: **/*.py` is not
valid YAML for a strict parser. Emit the joined globs as a quoted string
and have the adapter tests parse the emitted frontmatter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Antigravity only attaches a workspace rule when its frontmatter declares
a trigger. The antigravity target copied rules verbatim: common rules
have no frontmatter and language rules carry Claude's `paths:` list, so
every ECC rule landed in .agents/rules/ and was never loaded.
Add an antigravity-rule-frontmatter content transform and apply it to
rule pack files on both the manifest and legacy install paths. Rules
without frontmatter become `trigger: always_on`; `paths:` becomes
`trigger: glob` with matching `globs:`. A rule that already declares a
trigger is left alone, and rules/README.md stays inert. Canonical rule
sources are unchanged.
Fixes#3548
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>