feat(adr): support custom domains via archgate domain commands#212
Merged
Conversation
Projects can now register custom ADR domain → prefix mappings beyond the built-in five (backend/frontend/data/architecture/general). Custom domains live in `.archgate/config.json` and are merged with defaults at read time, letting repos capture categories like `security` / `SEC` or `ml-ops` / `MLOPS` without forking the CLI. - Add `archgate domain list | add <name> <prefix> | remove <name>` - Relax ADR frontmatter domain to a kebab-case string (from rigid enum) so ADRs with custom domains parse cleanly - Resolve ID prefixes via merged config in create/update paths - Capture `custom_domain_added` / `custom_domain_removed` telemetry events to inform whether any custom category should be promoted to a default Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploying archgate-cli with
|
| Latest commit: |
30fe6dc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://81d917f6.archgate-cli.pages.dev |
| Branch Preview URL: | https://feat-custom-adr-domains.archgate-cli.pages.dev |
Use projectPath / projectPaths from helpers/paths.ts instead of joining `.archgate` segments inline, matching the rest of the codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move `archgate domain ...` to `archgate adr domain ...` so the command lives next to the other ADR subcommands (create, list, show, update) it pairs with. No behavior changes — only the invocation path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Updates the CLI reference and concept pages (EN + pt-br) to cover the new custom-domain workflow introduced in this PR: - reference/cli/adr: new `## archgate adr domain` section with subcommand table, naming rules, and examples; `--domain` option descriptions cross-link to the new section - reference/adr-schema: relax the `domain` field description from a rigid enum to a registered kebab-case string; update the validation error example to match the new "lowercase kebab-case" message - concepts/domains: add a "Custom Domains" section covering naming rules, when to prefer a built-in, and AI-agent guidance - guides/writing-adrs + concepts/adrs: note the custom-domain path alongside the built-in five - regenerate docs/public/llms-full.txt Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add an Archgate rule that flags CLI commands shipped without a
reference page and reference pages that have no corresponding command.
Discovered by dogfooding: the telemetry command had no docs page.
- .archgate/adrs/ARCH-015: ADR + companion rules.ts that cross-checks
src/commands/<name>.ts | <name>/index.ts against
docs/src/content/docs/reference/cli/<name>.mdx (index.mdx exempt)
- docs/.../reference/cli/telemetry.mdx (+pt-br mirror): backfill the
missing page so the new rule passes on this branch
- tests/commands/adr/domain/{add,list,remove}.test.ts: split the
previously-combined domain.test.ts so ARCH-005 (test-mirrors-src)
is happy with the nested adr/domain/*.ts sources
- Strip stale /pt-br/ prefixes from internal MDX links in the earlier
docs commit (GEN-002 no-locale-prefix-in-links)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
archgate domain list | add <name> <prefix> | remove <name>for managing custom ADR domain → prefix mappings.domainto a kebab-case string (from a rigid enum) so ADRs using custom domains parse cleanly. Built-in validation/prefix resolution happens via the merged config at the command layer..archgate/config.json; built-ins stay hard-coded and can't be overwritten or removed.custom_domain_added/custom_domain_removedtelemetry events so we can see which categories repos actually adopt and decide whether to promote any to defaults.Why
Several repos already use domains outside the built-in five (e.g.
security,ml-ops). Today the Zod enum rejects their ADRs at parse time and the CLI can't auto-generate IDs for them. This unblocks those repos without abandoning the opinionated built-ins.Paired plugin-side PR (agent guidance — "ask first, register only when no built-in fits") is in the plugins repo.
Test plan
bun run lintcleanbun run typecheckcleanbun run format:checkcleanproject-confighelpers +domaincommand)archgate domain add security SEC && archgate adr create --title "Token storage" --domain securityauto-generatesSEC-001custom_domain_addedevent lands in PostHog withdomain_name/prefix/total_custom_domainspropertiesNote: pre-existing Windows integration-test timeouts on
mainare unrelated — reproduced on clean HEAD.🤖 Generated with Claude Code