feat: add product name variable system (Phase 1 — infrastructure)#347
feat: add product name variable system (Phase 1 — infrastructure)#347rachaelrenk wants to merge 4 commits into
Conversation
Adds a hybrid variable system that makes future product renames (e.g.,
Oz → Warp branding) a one-line change in src/data/vars.ts.
Changes:
- src/data/vars.ts: single source of truth for product names and URLs.
Keys are stable future-facing identifiers; values hold current Oz names.
- src/plugins/vars-transform.ts: Vite plugin that substitutes {{TOKEN}}
placeholders in .mdx frontmatter before any parser runs, with
frontmatter-scoped validation to catch typos at build time.
- tsconfig.json: adds @data/* path alias alongside @components/*.
- astro.config.mjs: registers varsTransformPlugin in vite.plugins.
- AGENTS.md: adds 'Content variables' section (before SEO/AEO) with
Option A (MDX import) and Option B (frontmatter) usage docs; fixes
three .warp/references/terminology.md paths → .agents/references/.
- .agents/references/terminology.md: adds note pointing to the vars
system and AGENTS.md for usage instructions.
No existing .mdx content is modified — infrastructure only.
Co-Authored-By: Oz <oz-agent@warp.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ucture example Show frontmatter → import → prose in one code block so placement is unambiguous. Add note that Options A and B can coexist in the same file. Co-Authored-By: Oz <oz-agent@warp.dev>
…c, procedural, and quickstart templates
Each template now includes a [VARS] instruction block showing where to add the
import statement and how to use {VARS.KEY} in prose and {{TOKEN}} in frontmatter.
Co-Authored-By: Oz <oz-agent@warp.dev>
… skills Templates: - conceptual.md, faq.md, troubleshooting.md, reference.md: add [VARS] instruction block - guide-page.md: add vars import note alongside existing VideoEmbed import Skills: - draft_docs/SKILL.md: add product name variables rule to critical formatting section (step 6.5) and pre-publish checklist (step 9); this propagates to all draft_* skills that delegate to it - draft_feature_doc/SKILL.md: fix incorrect .warp/ path refs -> .agents/; add explicit Product name variables section - style_lint/SKILL.md: add hardcoded product name strings check to terminology checks section - review-docs-pr/SKILL.md: add product name variables to review focus (step 6) Co-Authored-By: Oz <oz-agent@warp.dev>
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds the first phase of a product-name variable system for the docs site, including a VARS data module, a Vite transform for frontmatter tokens, path alias support, and authoring guidance/templates. I found two correctness issues that should be fixed before merge: the transform rewrites body content while claiming body token examples are safe, and the style-lint guidance documents enforcement that the diff does not implement.
Concerns
- The Vite transform performs replacement across the entire
.mdxsource, so known-token examples in body prose or code fences can be silently changed instead of only frontmatter being transformed. - The style-lint skill now says hardcoded product-name strings are reported, but no corresponding
style_lint.pycheck is added in this PR.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| - **Deprecated terminology**: "whitelist" (→ "allowlist"), "blacklist"/"blocklist" (→ "denylist") | ||
| - **External product names**: "Github" (→ "GitHub"), "github actions" (→ "GitHub Actions"), "MacOS" (→ "macOS"), "A.I." (→ "AI") | ||
| - **Unrecognized terms** (warning): Bolded terms that look like product names but aren't in `terminology.md`. Flags candidates for glossary addition — not errors, just suggestions. | ||
| - **Hardcoded product name strings**: Product name strings that have a corresponding key in `src/data/vars.ts` but appear as literal text rather than variable syntax. Reports instances of known strings like "Oz CLI", "Oz web app", "oz.warp.dev", "Oz dashboard", "Oz run" (any value currently in `src/data/vars.ts`) in body prose and frontmatter. These are flagged as `⚠️ [IMPORTANT]` in PR context and reported (not auto-fixed) — they should use `{VARS.KEY}` in prose and `{{TOKEN}}` in frontmatter. |
There was a problem hiding this comment.
style_lint.py reports, but the diff does not add the corresponding check to .agents/skills/style_lint/style_lint.py; implement the check or make this manual guidance so authors do not get a false sense of enforcement.
| if (!id.endsWith('.mdx')) return null; | ||
| let result = code; | ||
| for (const [key, value] of Object.entries(VARS)) { | ||
| result = result.replaceAll(`{{${key}}}`, value as string); |
There was a problem hiding this comment.
{{WARP_AGENT_CLI}} will be rewritten to the current value; restrict substitution to the matched frontmatter block and leave the body unchanged.
Adds a hybrid variable system to make future product renames (e.g., Oz → Warp branding) a one-line change in
src/data/vars.ts.Background research and rationale: Investigate: Product Name Variables | Implementation plan
Three-phase rollout
Phase 1 — Infrastructure (this PR): Sets up the variable system. No existing content is modified. Variable values use current Oz naming.
Phase 2 — Adoption (ongoing from today): All new content authored by humans and agents uses vars for product names. Existing files are not touched yet — migrating twice before the rename is confirmed would be avoidable churn.
Phase 3 — Rename execution (when timing is confirmed): Update
vars.tsvalues to new Warp names. Run a migration script to replace hardcoded strings in existing body prose and addimport { VARS }statements. Frontmatter titles and descriptions (Option B) update automatically on next build — no script needed for those. Human QA +Phase 3 — Rename execution (when timing is confirmed): Updatevars.tsvalues to new Warp names. Run a migration script to replace hardcoded strings in existing body prose and addimport { VARS }statements. Frontmatter titles and descriptions (Option B) update automa pr**Phase 3 — Rename e that references the variable on next build.src/plugins/vars-transform.ts(new)Vite plugin that intercepts
.mdxfiles before any parser and substitutes{{TOKEN}}placeholders with values fromVARS. Validates the frontmatter block only — if any{{TOKEN}}remains unresolved there, the build fails with a clear error and file path. Body prose can legitimately contain{{...}}patterns as code examples.tsconfig.jsonAdds
"@data/*": ["src/data/*"]path alias alongside the existing@components/*.astro.config.mjsImports
varsTransformPluginand registers it invite.plugins.AGENTS.md.warp/references/terminology.mdpaths →.agents/references/terminology.md.agents/references/terminology.mdAdds a note at the top pointing to
src/data/vars.tsand the Content variables section ofAGENTS.md..agents/templates/(all 8 templates)Every template now includes a
[VARS]instruction block showing authors exactly where to add the import and how to use both option syntaxes. Since most content is agent-generated from these templates, this is the most direct enforcement path for new content..agents/skills/draft_docs/SKILL.mdAdds product name variables to the critical formatting rules (step 6.5) and the pre-publish checklist (step 9). All other
draft_*skills delegate to this one, so the rule propagates to all of them automatically..agents/skills/draft_feature_doc/SKILL.mdFixes incorrect
.warp/path references →.agents/. Adds an explicitProduct name variablessection..agents/skills/style_lint/SKILL.mdAdds a
Hardcoded prAdds aHardcoded prAdds aHardcoded prAdds aHardcoded prAdds aHardcoded prAdds aHardcresponding var insrc/data/vars.ts..agents/skills/review-docs-pr/SKILL.mdAdds product name variable checking as review focus item #6.
How to use
Option A — body prose (MDX imports):
Place the import immediately after the frontmatter closing
---, before any prose. Both A and B can appear in the same file.Option B — frontmatter only (Vite transform):
Conversation: https://staging.warp.dev/conversation/26018d67-0b6c-42a0-a393-ad006bb469ef
Run: https://oz.staging.warp.dev/runs/019f8143-6946-7e78-ac88-1a4274687573
This PR was generated with Oz.