feat: support custom ADR directory via config.json paths field#293
Merged
Conversation
Allow projects to store ADRs in a directory other than the default `.archgate/adrs/` by adding a `paths` section to `.archgate/config.json`. This supports monorepo setups where ADRs live alongside other docs (e.g., `docs/adrs/`). - Add `PathsConfigSchema` with relative-path validation (no absolute paths, no `..` traversal) to `ProjectConfigSchema` - Add `resolvedProjectPaths()` in project-config.ts that layers config-aware overrides on top of the default paths - Update engine loader, ADR commands, rules shim, and install-info to use resolved paths instead of hardcoded defaults - Broaden `findProjectRoot()` to detect `.archgate/lint/` as a project marker (covers projects that moved ADRs out of `.archgate/adrs/`) - Write `rules.d.ts` to both `.archgate/` and the custom ADR directory parent so triple-slash references resolve correctly - Add Configuration reference page (EN + PT-BR) with full schema docs, path validation rules, and monorepo example - Update 7 existing doc pages (EN + PT-BR) with cross-links to the new configuration reference Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Deploying archgate-cli with
|
| Latest commit: |
7767003
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://92e1de4b.archgate-cli.pages.dev |
| Branch Preview URL: | https://feature-custom-adr-directory.archgate-cli.pages.dev |
The custom directory feature covers a special case — no need to advertise it across every page. Keep it documented only in the Configuration reference page where users who need it will find it. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Add ARCHGATE_PROJECT_CEILING env var (analogous to git's GIT_CEILING_DIRECTORIES) to prevent findProjectRoot() from walking above the test temp directory. Without this, tests that assert "no project found" fail on machines where ~/.archgate/adrs/ exists. Applied to the integration test harness (subprocess env), command tests (Bun.env), and path unit tests. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
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
pathsfield to.archgate/config.jsonallowing projects to store ADRs and rules in a custom directory (e.g.,docs/adrs/) instead of the default.archgate/adrs/adr list/show/create/update,check,review-context) automatically respect the configured directory..traversal segments for securityTest plan
bun run validatepasses (lint, typecheck, format, tests, ADR checks, knip, build)pathsconfig work identicallypaths.adrsin config, move ADRs there, verifyadr list,adr create,checkall use the custom dir..segments are rejected by the schemarules.d.tsis written to both.archgate/and the custom ADR directory parentfindProjectRoot()detects projects via.archgate/adrs/or.archgate/lint/