Skip to content

fix(installer): resolve Antigravity slash command failures#1817

Closed
n-zhi wants to merge 3 commits intobmad-code-org:mainfrom
n-zhi:fix/antigravity-slash-commands
Closed

fix(installer): resolve Antigravity slash command failures#1817
n-zhi wants to merge 3 commits intobmad-code-org:mainfrom
n-zhi:fix/antigravity-slash-commands

Conversation

@n-zhi
Copy link
Copy Markdown

@n-zhi n-zhi commented Mar 5, 2026

A better solution might be to wrap the default template fields in double quotes and symlink the antigravity templates, similar to the Claude ones. However, this requires more thorough testing (at least with Claude, which I don't personally use). See questions regarding field wrapping. I also really need clarification on the naming conventions of the commands: #1821

I decided to implement a (not so) quick fix for #1816 to get Antigravity working while a proper architectural fix for templates is discussed.

What

I created new artifact-typed templates for Antigravity as the installer expects by design.

Why

Fixes #1816 (not the architectural part) and #1744

How

Root case analysis is in #1816

Changes:

  • Replaced generic antigravity.md with specific artifact-typed templates (antigravity-agent.md, antigravity-workflow.md, etc.). Templates are created from the corresponding default-*.md files.
  • Removed the incompatible 'name' field from the Antigravity templates
  • Removed wrapping single quotes from the 'description' field to satisfy Antigravity requirements
  • Updated fields wrapping in Antigravity templates to use double quotes instead of single quotes.

Testing

All functional tests are passing. Slash commands in Antigravity are working. There are some linting errors, but they are not related to the changes in this PR.

I investigated the issues related to #1744 and found that none of the templates generated via the
npx bmad-method install --directory . --modules bmm --tools antigravity --yes
command contained single quotes (') in their description fields.
To test this further, I manually created two files using the word "don't" (once and twice, respectively) in the description. Both loaded correctly in Antigravity. Consequently, I believe #1744 stems from the issues described in #1816 rather than escaping errors. This PR addresses all known issues regarding the loading of slash commands in Antigravity.

…plate names

Investigating the command-loading failures in Antigravity revealed a structural bug introduced in commit 27c18e0. The ConfigDrivenIdeSetup class resolves template names by appending an artifact type suffix to the platform’s template_type, expecting specific files like antigravity-workflow.md or antigravity-agent.md.

Previously, only a generic antigravity.md was provided, causing the loadTemplate() fallback mechanism to silently use default-*.md templates. These default templates inject standard YAML frontmatter (name and quoted description) which Antigravity rejects.

Changes:
- Replaced generic antigravity.md with specific artifact-typed templates (antigravity-agent.md, antigravity-workflow.md, etc.)
- Removed redundant 'name' field from Antigravity templates
- Removed wrapping single quotes from 'description' field to satisfy Antigravity requirements
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

Adds four artifact-specific Antigravity templates and a YAML workflow variant under tools/cli/installers/lib/ide/templates/combined, and removes the prior generic antigravity.md; new templates embed project-relative load instructions and CRITICAL activation/workflow directives.

Changes

Cohort / File(s) Summary
Antigravity agent/task/tool/workflow templates
tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md, tools/cli/installers/lib/ide/templates/combined/antigravity-task.md, tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md, tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md
Added artifact-specific templates with YAML frontmatter and instructions to load and follow corresponding BMAD files at {project-root}/{{bmadFolderName}}/{{path}}. The agent template includes a CRITICAL <agent-activation> 6-step activation block.
Antigravity workflow YAML variant
tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md
New YAML-focused template that loads core {project-root}/{{bmadFolderName}}/core/tasks/workflow.xml, passes the workflow-config {project-root}/{{bmadFolderName}}/{{path}}, and marks execution steps as CRITICAL.
Removed generic template
tools/cli/installers/lib/ide/templates/combined/antigravity.md
Deleted the single generic Antigravity template so artifact-specific filenames match installer lookup expectations.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Possibly related issues

  • #1816 — Reports installer fallback due to missing artifact-specific templates and YAML frontmatter problems for Antigravity; directly relates to adding artifact-specific files.

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(installer): resolve Antigravity slash command failures' accurately describes the main change—creating artifact-typed templates to fix Antigravity command-loading failures.
Linked Issues check ✅ Passed The PR successfully addresses the structural bug in #1816 by creating artifact-typed templates (antigravity-agent.md, antigravity-workflow.md, etc.) and resolves #1744 by using double-quoted field wrapping.
Out of Scope Changes check ✅ Passed All changes—replacing generic antigravity.md with artifact-typed templates and updating field quoting—are directly scoped to resolve the identified installer template-loading bugs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the purpose (fixing Antigravity slash command failures), what was changed (replacing generic template with artifact-typed templates), and why these changes were made.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md`:
- Line 13: The step "WAIT for user input before proceeding" in the
antigravity-agent.md template is unsafe for non-interactive/CI runs; change it
to only prompt interactively and provide a non-interactive escape by checking a
CI or NONINTERACTIVE environment variable or an explicit flag (e.g.,
--yes/--no-wait), and/or implement a reasonable timeout fallback; locate the
literal "WAIT for user input before proceeding" in the template and replace it
with conditional logic or instructions that mention the environment
variable/flag and timeout so automated runs skip the prompt automatically.
- Line 8: The README template hardcodes the folder name `_bmad` in the LOAD
path, which ignores the renderer-supported variable; update the template line
that currently reads "LOAD the FULL agent file from
{project-root}/_bmad/{{path}}" to use the renderer variable instead, e.g., "LOAD
the FULL agent file from {project-root}/{{bmadFolderName}}/{{path}}", so the
template respects custom bmadFolderName values (modify the antigravity-agent.md
template where the LOAD line appears).

In `@tools/cli/installers/lib/ide/templates/combined/antigravity-task.md`:
- Line 7: The template antigravity-task.md assumes the variable {{path}} is
safe; add an upstream normalization/validation step wherever {{path}} is
supplied (the generator that renders antigravity-task.md) to: 1) reject absolute
paths (leading '/') and any path containing '..', 2) collapse redundant
separators and dot segments (e.g., normalize with a canonicalize function), and
3) either sanitize by removing leading slashes and resolving '.' segments or
return an error if any '..' remains; ensure the rendered string used in "Read
the entire task file at: {project-root}/{{bmadFolderName}}/{{path}}" only
contains the validated normalized relative path.
- Line 2: The YAML frontmatter value description: {{description}} is unquoted
and can break parsing when the description contains colons or hashes; update the
template(s) so the description is quoted (e.g., change description:
{{description}} to description: "{{description}}") in antigravity-task.md and
the other affected templates (antigravity-tool.md, antigravity-workflow.md,
antigravity-workflow-yaml.md, antigravity-agent.md) to ensure safe rendering.

In `@tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md`:
- Line 7: The template directly interpolates {{path}} into "Read the entire tool
file at: {project-root}/{{bmadFolderName}}/{{path}}" which allows
path-traversal; before rendering validate and normalize the value of {{path}} in
the generator code: reject or canonicalize any input containing ".." or leading
"/" and resolve it against the repo root (or the bmadFolderName directory) to
ensure the resulting path stays inside the repo; if the normalized path escapes
the repo, fail generation or sanitize to a safe relative path. Ensure this check
is applied wherever the template engine substitutes {{path}} (the template for
antigravity-tool.md and the generator function that prepares template
variables).
- Line 2: The YAML frontmatter in the template antigravity-tool.md currently
injects the description unquoted (`description: {{description}}`) which can
break on colons, hashes, or newlines; change that to a quoted scalar by wrapping
the template variable in quotes (e.g., `description: "{{description}}"`) so the
description is always treated as a string and matches the pattern used in other
templates like default-tool.md.

In
`@tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md`:
- Line 2: The description field uses an unquoted template placeholder
({{description}}) which can break YAML when substituted; update the template so
the description scalar is quoted (wrap the {{description}} placeholder in double
quotes) to match other templates and prevent YAML parsing failures when the
inserted text contains special characters.

In `@tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md`:
- Line 5: The template antigravity-workflow.md currently instructs direct file
execution (LOAD the FULL {project-root}/{{bmadFolderName}}/{{path}}), but
antigravity-workflow-yaml.md routes execution via core/tasks/workflow.xml,
creating two different engines for the same artifact class; fix by choosing one
execution path and making both artifacts reference it—either update
antigravity-workflow.md to instruct routing through core/tasks/workflow.xml
(replace the direct-LOAD instruction with the workflow.xml invocation and
include any required parameters), or update antigravity-workflow-yaml.md to
perform direct file execution and ensure both artifacts advertise the same
artifact class and engine; verify the artifact class string and any task names
in core/tasks/workflow.xml, antigravity-workflow.md, and
antigravity-workflow-yaml.md match exactly.
- Line 2: The frontmatter description fields use unquoted template interpolation
which can break YAML when description contains reserved characters; update the
templates to quote the interpolation (e.g., change description: {{description}}
to description: "{{description}}") in antigravity-workflow.md and apply the same
fix to antigravity-agent.md, antigravity-tool.md, antigravity-task.md, and
antigravity-workflow-yaml.md so all description frontmatter uses a quoted
"{{description}}" scalar.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 93c74b53-66ea-45b9-b8b5-1124889158c4

📥 Commits

Reviewing files that changed from the base of the PR and between 259e8a1 and 71cbe72.

📒 Files selected for processing (6)
  • tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-task.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity.md
💤 Files with no reviewable changes (1)
  • tools/cli/installers/lib/ide/templates/combined/antigravity.md

Comment thread tools/cli/installers/lib/ide/templates/combined/antigravity-task.md Outdated
Comment thread tools/cli/installers/lib/ide/templates/combined/antigravity-task.md
Comment thread tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md Outdated
Comment thread tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md
Comment thread tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md Outdated
Comment thread tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md Outdated
@n-zhi n-zhi marked this pull request as draft March 5, 2026 00:36
This prevents command loading errors when the description contains a colon followed by a space (': ').
@n-zhi n-zhi marked this pull request as ready for review March 5, 2026 01:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

♻️ Duplicate comments (1)
tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md (1)

13-13: ⚠️ Potential issue | 🟠 Major

Unconditional WAIT still risks non-interactive deadlock.

This must define a non-interactive bypass (CI flag, no-wait option, or timeout).

Based on learnings, this pattern is treated as systemic from default-derived templates and should be fixed holistically, not piecemeal.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md` at line
13, The unconditional "WAIT" step in the antigravity-agent.md template can
deadlock non-interactive runs; modify the template to support a non-interactive
bypass by checking common CI indicators (e.g., CI env var) and a runtime option
(e.g., a --no-wait or NO_WAIT env var) or a default timeout, so that the "WAIT"
prompt is skipped when CI=true, NO_WAIT=true, or when a --no-wait flag is passed
(or after the timeout elapses); update the template text and any install wrapper
logic that renders this step so it documents and honors the no-wait/timeout/CI
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md`:
- Around line 7-10: The <agent-activation> template currently instructs
unconditional LOAD/READ/FOLLOW of external agent files from
{project-root}/_bmad/{{path}} and the <activation> section, which is unsafe;
modify the activation flow to validate and guard the loaded artifact before
execution: implement integrity checks (e.g., cryptographic signature or checksum
verification) and an allowlist of permitted agent IDs or paths, reject or
sandbox any file failing validation, and explicitly parse and validate the
<activation> section against a strict schema before applying its steps (update
the code that handles LOAD/READ/FOLLOW to perform these checks and to log/raise
errors on validation failure).
- Line 10: Replace the vague directive "FOLLOW every step in the <activation>
section precisely" with explicit loop-prevention/idempotency guidance: state
that implementations must detect and short-circuit repeated activation attempts
(e.g., an "already-activated" flag), enforce a max retry/recursion depth or
timeout, and treat activation steps as idempotent (no-op if already applied);
refer to the <activation> tag and the "FOLLOW every step" phrase so maintainers
know where to add the guard behavior.
- Line 9: The phrase "READ its entire contents" is unbounded and must be
replaced with a bounded-read directive: change the template instruction (the
literal "READ its entire contents") to specify chunking or a token/byte limit
(e.g., "READ up to N tokens/bytes or in sequential chunks of size M with overlap
K, providing chunk indices") and include explicit chunking semantics for large
artifacts (how to request next chunk and how to combine results); ensure the new
text gives concrete limits and a clear protocol for incremental reads so the
agent will never attempt an unbounded full-file read.
- Around line 11-12: The template currently assumes the artifacts "DISPLAY the
welcome/greeting as instructed" and "PRESENT the numbered menu" always exist;
make these steps conditional by checking for the presence of the
welcome/greeting and numbered menu artifacts before rendering them (e.g., only
render "DISPLAY the welcome/greeting..." if a welcome/greeting artifact exists,
and only render "PRESENT the numbered menu" if a numbered menu artifact exists),
and add simple fallbacks/messages when each is absent (e.g., skip the section or
output a default brief instruction) so runtime behavior is robust.
- Line 5: Replace the absolute instruction line that reads "You must fully
embody this agent's persona and follow all activation instructions exactly as
specified. NEVER break character until given an exit command." with a bounded
formulation that removes the word "NEVER" and allows higher-priority/safety
overrides and graceful interruption—for example: require the agent to remain
in-role unless overridden by higher-priority instructions or an explicit exit
command, and to follow activation instructions subject to safety and
interruptibility. Update the surrounding template text so the activation
requirement emphasizes conditional adherence (e.g., "stay in role unless
overridden by higher-priority instructions or an exit command") and retains
explicit instruction-following behavior without enforcing an absolute,
unconditional constraint.
- Line 8: The template loads files using the unsanitized template variable
"{{path}}" (seen in antigravity-agent.md line "LOAD the FULL agent file from
{project-root}/_bmad/{{path}}"), which allows path traversal/absolute paths; fix
by validating and sanitizing "{{path}}" at generation time: reject or normalize
any values containing "../", leading "/" or null bytes, and restrict to an
allowed subpath whitelist or a basename-only policy in the generator that
renders this template (the code that expands "{{path}}"); update the generator
that produces these antigravity/default templates to perform the checks and add
generator+template tests asserting traversal inputs are rejected and valid safe
paths resolve correctly.
- Line 2: The YAML frontmatter breaks when description contains double quotes;
add an escaping helper (e.g., escapeYamlDoubleQuoted) that first replaces
backslashes with double-backslashes and then escapes double quotes, then ensure
renderTemplate uses this helper to transform data.description before performing
"{{description}}" interpolation in renderTemplate; also apply the same
transformation wherever descriptions are injected (the description interpolation
sites in agent-command-generator, workflow-command-generator, and
task-tool-command-generator) so all generated templates use the escaped value.

---

Duplicate comments:
In `@tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md`:
- Line 13: The unconditional "WAIT" step in the antigravity-agent.md template
can deadlock non-interactive runs; modify the template to support a
non-interactive bypass by checking common CI indicators (e.g., CI env var) and a
runtime option (e.g., a --no-wait or NO_WAIT env var) or a default timeout, so
that the "WAIT" prompt is skipped when CI=true, NO_WAIT=true, or when a
--no-wait flag is passed (or after the timeout elapses); update the template
text and any install wrapper logic that renders this step so it documents and
honors the no-wait/timeout/CI behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 86f5d0e7-4856-47fd-925f-d176d14e81f9

📥 Commits

Reviewing files that changed from the base of the PR and between 71cbe72 and 2896a46.

📒 Files selected for processing (5)
  • tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-task.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-task.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md

@n-zhi n-zhi marked this pull request as draft March 5, 2026 12:27
…ity templates

The 'name' field is supported in Antigravity workflows. The previous loading issues were caused by single quotes wrapping the YAML frontmatter values, not the presence of the field itself. This update synchronizes Antigravity templates with default ones while ensuring double quotes are used for 'name' and 'description' fields.
@n-zhi n-zhi marked this pull request as ready for review March 5, 2026 14:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (2)
tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md (2)

6-6: Avoid hard absolute persona lock wording.

Line 6’s “while staying in character” framing can conflict with higher-priority safety/system directives. Use bounded wording that explicitly allows override by higher-priority instructions.

Based on learnings: replace absolute role constraints with bounded formulations across default/antigravity templates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md`
at line 6, Replace the absolute phrase "while staying in character" on line 6 of
the combined/antigravity-workflow-yaml.md template with a bounded formulation
that permits higher-priority overrides (e.g., "while generally maintaining the
specified persona, unless overridden by higher-priority system instructions").
Update any similar occurrences in the same template to use the same bounded
wording so the persona guidance does not conflict with system/safety directives.

3-3: Escape {{description}} before interpolation to avoid YAML corruption.

description: "{{description}}" still breaks when description contains embedded " or backslashes. Add centralized escaping in the renderer and use it for every template expansion.

Based on learnings: implement a shared escapeYamlDoubleQuote helper in tools/cli/installers/lib/ide/_config-driven.js and apply it everywhere {{description}} is interpolated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md`
at line 3, Create a shared escaping helper escapeYamlDoubleQuote in
tools/cli/installers/lib/ide/_config-driven.js that replaces backslashes and
double-quotes with YAML-safe escaped sequences and export it; then update the
template renderer (the function responsible for expanding templates, e.g.,
renderTemplate / the template expansion path in _config-driven.js) to call
escapeYamlDoubleQuote when inserting any {{description}} value and replace
occurrences in templates such as combined/antigravity-workflow-yaml.md so the
description is passed through the helper before interpolation to prevent YAML
corruption.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md`:
- Line 12: The "Follow workflow.xml instructions EXACTLY" step grants
unrestricted authority; update the workflow processing logic that handles
workflow.xml (the LOAD/READ/FOLLOW chains) to enforce a strict JSON/JSON Schema
or XSD validation against a predefined schema, implement an allowlist of
permitted operations/verbs, reject any unknown directives and malformed
structure, and ensure the processor fails closed by refusing to execute when
validation or allowlist checks fail; locate the code that parses/applies
workflow.xml directives (the FOLLOW handler for workflow content) and add schema
validation, an operation allowlist, and explicit error paths that abort
execution on invalid input.
- Line 12: Add loop-prevention and idempotency to the recursive workflow
instruction by introducing an "already-activated" marker and a configurable max
recursion depth check whenever the template executes "Follow workflow.xml
instructions EXACTLY"; specifically, set and check an activation flag (e.g.,
already-activated) before re-processing any loaded instructions and
increment/validate a depth counter (e.g., workflow-recursion-depth with a
MAX_RECURSION constant) to abort further expansion when exceeded, and apply the
same activation-flag + max-depth semantics across other templates that can
re-trigger workflow execution.
- Line 13: The step "Save outputs after EACH section when generating any
documents from templates" is non-idempotent and must be made deterministic:
update the template/process that implements this behavior so that saves use
explicit overwrite/merge/versioning semantics, perform atomic writes (write to a
temp file and rename), and include a retry-safe policy (e.g., replace existing
artifact by default, or append with version suffix when configured); ensure the
generator exposes a flag or parameter (overwrite: boolean | merge | version) and
that the save routine checks and enforces idempotency before writing to avoid
duplicate artifacts.
- Line 13: The template currently enforces "Save outputs after EACH section"
unconditionally; change this to guard persistence behind a configurable artifact
policy check so writes only occur when allowed. Update the template logic that
performs the save (the block referencing "Save outputs after EACH section") to:
1) consult an artifact policy flag (e.g., artifactPolicy.allowPersist or
similar), 2) scope saves to approved artifact types/names, 3) redact or exclude
known sensitive keys before persisting, and 4) fall back to keeping intermediate
content in-memory or writing to an encrypted/temp store when persistence is
disallowed; ensure these checks are applied to the affected templates that use
the same save pattern.
- Around line 10-11: The template injects the user-provided {{path}} into
"{project-root}/{{bmadFolderName}}/{{path}}" and passes it as the
'workflow-config' parameter to the workflow.xml instructions without
sanitization; update the generator that renders this template to validate and
harden {{path}} by rejecting any path containing ".." segments, any absolute
paths (leading "/" or drive letters), and any null bytes, and normalize the path
(e.g., resolve and ensure it remains inside the expected
{project-root}/{{bmadFolderName}} directory) before rendering or passing it to
workflow.xml so traversal escapes cannot occur.
- Line 11: The template currently passes the path
{project-root}/{{bmadFolderName}}/{{path}} as the 'workflow-config' parameter
without validation; update the logic that constructs/passes 'workflow-config'
(the code invoking the workflow.xml instructions) to first verify the file
exists, has an allowed extension (e.g., .yaml or .yml), and validate its
schema/shape (e.g., required top-level keys and types) using your
YAML/JSON-schema validator before invoking workflow.xml; on validation failure
surface a clear error/exit (or skip activation) so workflow.xml never receives
invalid input.

---

Nitpick comments:
In
`@tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md`:
- Line 6: Replace the absolute phrase "while staying in character" on line 6 of
the combined/antigravity-workflow-yaml.md template with a bounded formulation
that permits higher-priority overrides (e.g., "while generally maintaining the
specified persona, unless overridden by higher-priority system instructions").
Update any similar occurrences in the same template to use the same bounded
wording so the persona guidance does not conflict with system/safety directives.
- Line 3: Create a shared escaping helper escapeYamlDoubleQuote in
tools/cli/installers/lib/ide/_config-driven.js that replaces backslashes and
double-quotes with YAML-safe escaped sequences and export it; then update the
template renderer (the function responsible for expanding templates, e.g.,
renderTemplate / the template expansion path in _config-driven.js) to call
escapeYamlDoubleQuote when inserting any {{description}} value and replace
occurrences in templates such as combined/antigravity-workflow-yaml.md so the
description is passed through the helper before interpolation to prevent YAML
corruption.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 83efa358-6e64-49d9-9183-cabaaee3a08d

📥 Commits

Reviewing files that changed from the base of the PR and between 2896a46 and 603780e.

📒 Files selected for processing (5)
  • tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-task.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow-yaml.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • tools/cli/installers/lib/ide/templates/combined/antigravity-task.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-agent.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-workflow.md
  • tools/cli/installers/lib/ide/templates/combined/antigravity-tool.md

@n-zhi
Copy link
Copy Markdown
Author

n-zhi commented Mar 5, 2026

Diffs with default templates (only field wrapping is different):

diff --git "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-agent.md" "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-agent.md"
index f8ad9380..f1e2437a 100644
--- "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-agent.md"
+++ "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-agent.md"
@@ -2,2 +2,2 @@
-name: '{{name}}'
-description: '{{description}}'
+name: "{{name}}"
+description: "{{description}}"
diff --git "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-task.md" "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-task.md"
index b865d6ff..30920e83 100644
--- "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-task.md"
+++ "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-task.md"
@@ -2,2 +2,2 @@
-name: '{{name}}'
-description: '{{description}}'
+name: "{{name}}"
+description: "{{description}}"
diff --git "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-tool.md" "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-tool.md"
index 11c6aac8..2c97bad9 100644
--- "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-tool.md"
+++ "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-tool.md"
@@ -2,2 +2,2 @@
-name: '{{name}}'
-description: '{{description}}'
+name: "{{name}}"
+description: "{{description}}"
diff --git "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-workflow-yaml.md" "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-workflow-yaml.md"
index 4a8da26e..8c131765 100644
--- "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-workflow-yaml.md"
+++ "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-workflow-yaml.md"
@@ -2,2 +2,2 @@
-name: '{{name}}'
-description: '{{description}}'
+name: "{{name}}"
+description: "{{description}}"

diff --git "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-workflow.md" "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-workflow.md"
index c8ad4045..3f2df4c4 100644
--- "a/tools\\cli\\installers\\lib\\ide\\templates\\combined\\default-workflow.md"
+++ "b/tools\\cli\\installers\\lib\\ide\\templates\\combined\\antigravity-workflow.md"
@@ -2,2 +2,2 @@
-name: '{{name}}'
-description: '{{description}}'
+name: "{{name}}"
+description: "{{description}}"

@alexeyv
Copy link
Copy Markdown
Collaborator

alexeyv commented Mar 7, 2026

Closing this — the all-is-skills refactor (#1834) migrated Antigravity to skill_format: true, which rewrites frontmatter via yaml.stringify() on output. This makes the quoting fixes here moot.

The artifact-typed template bodies (e.g. the steps in antigravity-agent.md)
might still be needed — currently Antigravity falls back to the generic default-*.md bodies. If
you find those don't work correctly in skills mode, feel free to reopen with a rebased version.

Thanks for the thorough root cause analysis in #1816!

By the way, you don't really need to activate agents - launching workflows in Gemini's default persona works fine and ready.

@alexeyv alexeyv closed this Mar 7, 2026
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.

[BUG] systematic problems with templates\combined

2 participants