Skip to content

feat: add product name variable system (Phase 1 — infrastructure)#347

Open
rachaelrenk wants to merge 4 commits into
mainfrom
rrenk/product-name-variables
Open

feat: add product name variable system (Phase 1 — infrastructure)#347
rachaelrenk wants to merge 4 commits into
mainfrom
rrenk/product-name-variables

Conversation

@rachaelrenk

@rachaelrenk rachaelrenk commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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.ts values to new Warp names. Run a migration script to replace hardcoded strings in existing body prose and add import { 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): Update vars.ts values to new Warp names. Run a migration script to replace hardcoded strings in existing body prose and add import { 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 .mdx files before any parser and substitutes {{TOKEN}} placeholders with values from VARS. 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.json

Adds "@data/*": ["src/data/*"] path alias alongside the existing @components/*.

astro.config.mjs

Imports varsTransformPlugin and registers it in vite.plugins.

AGENTS.md

  • Adds a "Content variables" section (before SEO/AEO) documenting both usage options and constraints, with a complete file-structure example showing where the import goes
  • Fixes 3 incorrect .warp/references/terminology.md paths → .agents/references/terminology.md

.agents/references/terminology.md

Adds a note at the top pointing to src/data/vars.ts and the Content variables section of AGENTS.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.md

Adds 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.md

Fixes incorrect .warp/ path references → .agents/. Adds an explicit Product name variables section.

.agents/skills/style_lint/SKILL.md

Adds a Hardcoded prAdds a Hardcoded prAdds a Hardcoded prAdds a Hardcoded prAdds a Hardcoded prAdds a Hardcresponding var in src/data/vars.ts.

.agents/skills/review-docs-pr/SKILL.md

Adds 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.

---
title: "{{WARP_AGENT_CLI}} reference"
description: "Use the {{WARP_AGENT_CLI}} to run and manage agents."
---
import { VARS } from '@data/vars';

Use the {VARS.WARP_AGENT_CLI} to run agents from the command line.

Option B — frontmatter only (Vite transform):

---
title: Getting started with {{WARP_AGENT_CLI}}
description: Learn how to use the {{WARP_AGENT_CLI}} to run and manage agents.
---

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.

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>
@cla-bot cla-bot Bot added the cla-signed label Jul 20, 2026
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 20, 2026 9:52pm

Request Review

…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>
@rachaelrenk
rachaelrenk marked this pull request as ready for review July 20, 2026 23:06
@oz-for-oss

oz-for-oss Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@rachaelrenk

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 .mdx source, 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.py check 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] This documents hardcoded product-name strings as something 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] This replaces known tokens across the entire MDX source before only validating frontmatter, so body prose or code examples that intentionally show {{WARP_AGENT_CLI}} will be rewritten to the current value; restrict substitution to the matched frontmatter block and leave the body unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants