@event4u/agent-config 2.14.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent-src/commands/agents/user/accept.md +117 -0
- package/.agent-src/commands/agents/user/init.md +163 -0
- package/.agent-src/commands/agents/user/review.md +107 -0
- package/.agent-src/commands/agents/user/show.md +109 -0
- package/.agent-src/commands/agents/user/update.md +98 -0
- package/.agent-src/commands/agents/user.md +66 -0
- package/.agent-src/commands/agents.md +2 -0
- package/.agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/.agent-src/templates/scripts/work_engine/_lib/agent_settings.py +299 -20
- package/.claude-plugin/marketplace.json +7 -1
- package/CHANGELOG.md +145 -196
- package/README.md +29 -3
- package/config/agent-settings.template.yml +4 -0
- package/config/gitignore-block.txt +11 -0
- package/docs/architecture.md +1 -1
- package/docs/archive/CHANGELOG-pre-2.15.0.md +244 -0
- package/docs/catalog.md +8 -2
- package/docs/contracts/agent-user-schema.md +165 -0
- package/docs/contracts/command-clusters.md +1 -1
- package/docs/contracts/file-ownership-matrix.json +190 -0
- package/docs/examples/agent-user.example.md +21 -0
- package/docs/getting-started.md +1 -1
- package/docs/installation.md +221 -2
- package/package.json +1 -1
- package/scripts/_cli/cmd_doctor.py +238 -8
- package/scripts/_cli/cmd_migrate.py +6 -1
- package/scripts/_cli/cmd_prune.py +8 -3
- package/scripts/_cli/cmd_sync.py +7 -3
- package/scripts/_cli/cmd_uninstall.py +4 -3
- package/scripts/_cli/cmd_update.py +5 -1
- package/scripts/_cli/cmd_validate.py +6 -3
- package/scripts/_cli/cmd_versions.py +15 -2
- package/scripts/_lib/agent_settings.py +299 -20
- package/scripts/agent-config +64 -0
- package/scripts/install +39 -2
- package/scripts/install.py +171 -0
- package/scripts/install.sh +20 -0
- package/templates/agent-config-wrapper.sh +7 -0
- package/templates/minimal/.agent-settings.yml +23 -0
- package/templates/minimal/agents-gitkeep +2 -0
|
@@ -39,6 +39,42 @@
|
|
|
39
39
|
"load_context": [],
|
|
40
40
|
"load_context_eager": []
|
|
41
41
|
},
|
|
42
|
+
".agent-src.uncompressed/commands/agents/user.md": {
|
|
43
|
+
"kind": "command",
|
|
44
|
+
"rule_type": "orchestrator",
|
|
45
|
+
"load_context": [],
|
|
46
|
+
"load_context_eager": []
|
|
47
|
+
},
|
|
48
|
+
".agent-src.uncompressed/commands/agents/user/accept.md": {
|
|
49
|
+
"kind": "command",
|
|
50
|
+
"rule_type": null,
|
|
51
|
+
"load_context": [],
|
|
52
|
+
"load_context_eager": []
|
|
53
|
+
},
|
|
54
|
+
".agent-src.uncompressed/commands/agents/user/init.md": {
|
|
55
|
+
"kind": "command",
|
|
56
|
+
"rule_type": null,
|
|
57
|
+
"load_context": [],
|
|
58
|
+
"load_context_eager": []
|
|
59
|
+
},
|
|
60
|
+
".agent-src.uncompressed/commands/agents/user/review.md": {
|
|
61
|
+
"kind": "command",
|
|
62
|
+
"rule_type": null,
|
|
63
|
+
"load_context": [],
|
|
64
|
+
"load_context_eager": []
|
|
65
|
+
},
|
|
66
|
+
".agent-src.uncompressed/commands/agents/user/show.md": {
|
|
67
|
+
"kind": "command",
|
|
68
|
+
"rule_type": null,
|
|
69
|
+
"load_context": [],
|
|
70
|
+
"load_context_eager": []
|
|
71
|
+
},
|
|
72
|
+
".agent-src.uncompressed/commands/agents/user/update.md": {
|
|
73
|
+
"kind": "command",
|
|
74
|
+
"rule_type": null,
|
|
75
|
+
"load_context": [],
|
|
76
|
+
"load_context_eager": []
|
|
77
|
+
},
|
|
42
78
|
".agent-src.uncompressed/commands/analyze-reference-repo.md": {
|
|
43
79
|
"kind": "command",
|
|
44
80
|
"rule_type": null,
|
|
@@ -2902,6 +2938,160 @@
|
|
|
2902
2938
|
"via": "body_link",
|
|
2903
2939
|
"depth": 1
|
|
2904
2940
|
},
|
|
2941
|
+
{
|
|
2942
|
+
"source": ".agent-src.uncompressed/commands/agents/user.md",
|
|
2943
|
+
"target": ".agent-src.uncompressed/commands/agents/init.md",
|
|
2944
|
+
"type": "READ_ONLY",
|
|
2945
|
+
"via": "body_link",
|
|
2946
|
+
"depth": 1
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
"source": ".agent-src.uncompressed/commands/agents/user.md",
|
|
2950
|
+
"target": ".agent-src.uncompressed/commands/agents/user.md",
|
|
2951
|
+
"type": "WRITE",
|
|
2952
|
+
"via": "self",
|
|
2953
|
+
"depth": 0
|
|
2954
|
+
},
|
|
2955
|
+
{
|
|
2956
|
+
"source": ".agent-src.uncompressed/commands/agents/user/accept.md",
|
|
2957
|
+
"target": ".agent-src.uncompressed/commands/agents/user.md",
|
|
2958
|
+
"type": "READ_ONLY",
|
|
2959
|
+
"via": "body_link",
|
|
2960
|
+
"depth": 1
|
|
2961
|
+
},
|
|
2962
|
+
{
|
|
2963
|
+
"source": ".agent-src.uncompressed/commands/agents/user/accept.md",
|
|
2964
|
+
"target": ".agent-src.uncompressed/commands/agents/user/accept.md",
|
|
2965
|
+
"type": "WRITE",
|
|
2966
|
+
"via": "self",
|
|
2967
|
+
"depth": 0
|
|
2968
|
+
},
|
|
2969
|
+
{
|
|
2970
|
+
"source": ".agent-src.uncompressed/commands/agents/user/accept.md",
|
|
2971
|
+
"target": ".agent-src.uncompressed/commands/agents/user/review.md",
|
|
2972
|
+
"type": "READ_ONLY",
|
|
2973
|
+
"via": "body_link",
|
|
2974
|
+
"depth": 1
|
|
2975
|
+
},
|
|
2976
|
+
{
|
|
2977
|
+
"source": ".agent-src.uncompressed/commands/agents/user/accept.md",
|
|
2978
|
+
"target": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
2979
|
+
"type": "READ_ONLY",
|
|
2980
|
+
"via": "body_link",
|
|
2981
|
+
"depth": 1
|
|
2982
|
+
},
|
|
2983
|
+
{
|
|
2984
|
+
"source": ".agent-src.uncompressed/commands/agents/user/init.md",
|
|
2985
|
+
"target": ".agent-src.uncompressed/commands/agents/user.md",
|
|
2986
|
+
"type": "READ_ONLY",
|
|
2987
|
+
"via": "body_link",
|
|
2988
|
+
"depth": 1
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
"source": ".agent-src.uncompressed/commands/agents/user/init.md",
|
|
2992
|
+
"target": ".agent-src.uncompressed/commands/agents/user/init.md",
|
|
2993
|
+
"type": "WRITE",
|
|
2994
|
+
"via": "self",
|
|
2995
|
+
"depth": 0
|
|
2996
|
+
},
|
|
2997
|
+
{
|
|
2998
|
+
"source": ".agent-src.uncompressed/commands/agents/user/review.md",
|
|
2999
|
+
"target": ".agent-src.uncompressed/commands/agents/user.md",
|
|
3000
|
+
"type": "READ_ONLY",
|
|
3001
|
+
"via": "body_link",
|
|
3002
|
+
"depth": 1
|
|
3003
|
+
},
|
|
3004
|
+
{
|
|
3005
|
+
"source": ".agent-src.uncompressed/commands/agents/user/review.md",
|
|
3006
|
+
"target": ".agent-src.uncompressed/commands/agents/user/accept.md",
|
|
3007
|
+
"type": "READ_ONLY",
|
|
3008
|
+
"via": "body_link",
|
|
3009
|
+
"depth": 1
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
"source": ".agent-src.uncompressed/commands/agents/user/review.md",
|
|
3013
|
+
"target": ".agent-src.uncompressed/commands/agents/user/review.md",
|
|
3014
|
+
"type": "WRITE",
|
|
3015
|
+
"via": "self",
|
|
3016
|
+
"depth": 0
|
|
3017
|
+
},
|
|
3018
|
+
{
|
|
3019
|
+
"source": ".agent-src.uncompressed/commands/agents/user/review.md",
|
|
3020
|
+
"target": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3021
|
+
"type": "READ_ONLY",
|
|
3022
|
+
"via": "body_link",
|
|
3023
|
+
"depth": 1
|
|
3024
|
+
},
|
|
3025
|
+
{
|
|
3026
|
+
"source": ".agent-src.uncompressed/commands/agents/user/show.md",
|
|
3027
|
+
"target": ".agent-src.uncompressed/commands/agents/user.md",
|
|
3028
|
+
"type": "READ_ONLY",
|
|
3029
|
+
"via": "body_link",
|
|
3030
|
+
"depth": 1
|
|
3031
|
+
},
|
|
3032
|
+
{
|
|
3033
|
+
"source": ".agent-src.uncompressed/commands/agents/user/show.md",
|
|
3034
|
+
"target": ".agent-src.uncompressed/commands/agents/user/init.md",
|
|
3035
|
+
"type": "READ_ONLY",
|
|
3036
|
+
"via": "body_link",
|
|
3037
|
+
"depth": 1
|
|
3038
|
+
},
|
|
3039
|
+
{
|
|
3040
|
+
"source": ".agent-src.uncompressed/commands/agents/user/show.md",
|
|
3041
|
+
"target": ".agent-src.uncompressed/commands/agents/user/show.md",
|
|
3042
|
+
"type": "WRITE",
|
|
3043
|
+
"via": "self",
|
|
3044
|
+
"depth": 0
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
"source": ".agent-src.uncompressed/commands/agents/user/show.md",
|
|
3048
|
+
"target": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3049
|
+
"type": "READ_ONLY",
|
|
3050
|
+
"via": "body_link",
|
|
3051
|
+
"depth": 1
|
|
3052
|
+
},
|
|
3053
|
+
{
|
|
3054
|
+
"source": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3055
|
+
"target": ".agent-src.uncompressed/commands/agents/user.md",
|
|
3056
|
+
"type": "READ_ONLY",
|
|
3057
|
+
"via": "body_link",
|
|
3058
|
+
"depth": 1
|
|
3059
|
+
},
|
|
3060
|
+
{
|
|
3061
|
+
"source": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3062
|
+
"target": ".agent-src.uncompressed/commands/agents/user/accept.md",
|
|
3063
|
+
"type": "READ_ONLY",
|
|
3064
|
+
"via": "body_link",
|
|
3065
|
+
"depth": 1
|
|
3066
|
+
},
|
|
3067
|
+
{
|
|
3068
|
+
"source": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3069
|
+
"target": ".agent-src.uncompressed/commands/agents/user/init.md",
|
|
3070
|
+
"type": "READ_ONLY",
|
|
3071
|
+
"via": "body_link",
|
|
3072
|
+
"depth": 1
|
|
3073
|
+
},
|
|
3074
|
+
{
|
|
3075
|
+
"source": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3076
|
+
"target": ".agent-src.uncompressed/commands/agents/user/review.md",
|
|
3077
|
+
"type": "READ_ONLY",
|
|
3078
|
+
"via": "body_link",
|
|
3079
|
+
"depth": 1
|
|
3080
|
+
},
|
|
3081
|
+
{
|
|
3082
|
+
"source": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3083
|
+
"target": ".agent-src.uncompressed/commands/agents/user/show.md",
|
|
3084
|
+
"type": "READ_ONLY",
|
|
3085
|
+
"via": "body_link",
|
|
3086
|
+
"depth": 1
|
|
3087
|
+
},
|
|
3088
|
+
{
|
|
3089
|
+
"source": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3090
|
+
"target": ".agent-src.uncompressed/commands/agents/user/update.md",
|
|
3091
|
+
"type": "WRITE",
|
|
3092
|
+
"via": "self",
|
|
3093
|
+
"depth": 0
|
|
3094
|
+
},
|
|
2905
3095
|
{
|
|
2906
3096
|
"source": ".agent-src.uncompressed/commands/analyze-reference-repo.md",
|
|
2907
3097
|
"target": ".agent-src.uncompressed/commands/analyze-reference-repo.md",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 1
|
|
3
|
+
identity:
|
|
4
|
+
name: "Mathias"
|
|
5
|
+
nickname: "Matze"
|
|
6
|
+
language: "de"
|
|
7
|
+
role: "founder/engineer"
|
|
8
|
+
style:
|
|
9
|
+
formality: "informal"
|
|
10
|
+
pace: "pragmatic"
|
|
11
|
+
voice_sample: |
|
|
12
|
+
Mach das einfach. Wenn unklar, frag im Council. Tokenverbrauch ist ok,
|
|
13
|
+
aber stell mir keine Fragen — entscheide oder frag die AIs.
|
|
14
|
+
last_updated: "2026-05-15"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Notes
|
|
18
|
+
|
|
19
|
+
Pragmatic shipper. Prefers terse replies, real diffs, and named
|
|
20
|
+
trade-offs over hedged options. Council-first for anything that looks
|
|
21
|
+
like a contract decision.
|
package/docs/getting-started.md
CHANGED
|
@@ -146,7 +146,7 @@ Your agent now understands slash commands:
|
|
|
146
146
|
| `/quality-fix` | Run and fix all quality checks |
|
|
147
147
|
| `/chat-history` | Inspect the persistent chat-history log (read-only `show`) |
|
|
148
148
|
|
|
149
|
-
→ [Browse all
|
|
149
|
+
→ [Browse all 115 active commands](../.agent-src/commands/)
|
|
150
150
|
|
|
151
151
|
---
|
|
152
152
|
|
package/docs/installation.md
CHANGED
|
@@ -235,6 +235,57 @@ The global install puts `agent-config` on `$PATH` so the project
|
|
|
235
235
|
wrapper (`./agent-config`) can fall through to it when no
|
|
236
236
|
`node_modules/@event4u/agent-config/` exists.
|
|
237
237
|
|
|
238
|
+
### Global CLI + per-project settings (minimal flow)
|
|
239
|
+
|
|
240
|
+
For teams that want to keep the runtime global (one install per
|
|
241
|
+
machine) but still version a per-project `.agent-settings.yml` and a
|
|
242
|
+
project-local `agents/` folder, use the `--minimal` init:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# 1. Install the runtime once per machine
|
|
246
|
+
npm install -g @event4u/agent-config
|
|
247
|
+
|
|
248
|
+
# 2. Inside the project, write only the per-project shell
|
|
249
|
+
agent-config init --minimal
|
|
250
|
+
# or, without a global install:
|
|
251
|
+
npx @event4u/agent-config init --minimal
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
`--minimal` writes exactly three files into the project root:
|
|
255
|
+
|
|
256
|
+
- `.agent-settings.yml` — per-project cost profile, member config,
|
|
257
|
+
feature flags. Committed.
|
|
258
|
+
- `agents/.gitkeep` — placeholder so the directory is committed
|
|
259
|
+
before the first roadmap, decision, or council session lands.
|
|
260
|
+
- `./agent-config` — bash wrapper that pins
|
|
261
|
+
`AGENT_CONFIG_PROJECT_ROOT` to the project root and forwards every
|
|
262
|
+
subcommand to the globally installed CLI. Committed.
|
|
263
|
+
|
|
264
|
+
Nothing else — no `.augment/`, no `.claude/`, no `.cursor/`, no
|
|
265
|
+
`AGENTS.md`. The shipped tool payload stays in the user's home (or
|
|
266
|
+
the npx cache) and is shared across every project on the machine.
|
|
267
|
+
|
|
268
|
+
#### Decision table — `--minimal` vs full `init`
|
|
269
|
+
|
|
270
|
+
| Pick `--minimal` when | Pick full `init` when |
|
|
271
|
+
|---|---|
|
|
272
|
+
| Runtime is already installed globally (`npm i -g`). | First-time setup on a fresh machine. |
|
|
273
|
+
| Team wants one source of truth for skills / rules / commands across every repo (shared via the global install). | Team wants per-repo skills / rules / commands committed alongside the code. |
|
|
274
|
+
| `agents/` content (roadmaps, decisions) is the only per-project state worth committing. | `AGENTS.md`, `GEMINI.md`, or `.github/copilot-instructions.md` need project-specific overrides. |
|
|
275
|
+
| The repo runs in CI and you do not want to vendor the full payload. | The repo cannot rely on a global install (air-gapped, sandboxed CI without npm). |
|
|
276
|
+
| Migrating an existing project from the legacy `.git`-anchored install. | Starting a new project that has never seen `agent-config`. |
|
|
277
|
+
|
|
278
|
+
Nested-install guard: `init --minimal` refuses to run when an
|
|
279
|
+
ancestor already contains an anchor (`.git`, an `agents/` directory
|
|
280
|
+
with a marker, or another `.agent-settings.yml`). This prevents
|
|
281
|
+
shadow installs inside an existing project. Override with explicit
|
|
282
|
+
`--target <dir>` if the nesting is intentional.
|
|
283
|
+
|
|
284
|
+
`--minimal` does **not** pin `agent_config_version` — the project
|
|
285
|
+
follows whichever version the global CLI was installed at. Pin
|
|
286
|
+
explicitly by adding `agent_config_version: <semver>` to
|
|
287
|
+
`.agent-settings.yml` when you want a reproducible runtime.
|
|
288
|
+
|
|
238
289
|
### Installer orchestrator (`scripts/install`)
|
|
239
290
|
|
|
240
291
|
The orchestrator chains payload sync and bridge generation:
|
|
@@ -673,8 +724,176 @@ or sandbox testing:
|
|
|
673
724
|
- `AGENT_CONFIG_NO_EVENTS_LOG=1` — disables every write to
|
|
674
725
|
`agents/council-events.log` in-process. Quota counter and council
|
|
675
726
|
output stay untouched.
|
|
676
|
-
- `AGENT_CONFIG_LEGACY_ANCHOR=1` —
|
|
677
|
-
|
|
727
|
+
- `AGENT_CONFIG_LEGACY_ANCHOR=1` — reverts project-root discovery to
|
|
728
|
+
the pre-step-7 `.git`-only walk. See [Migration — Step 7 anchor
|
|
729
|
+
discovery](#migration--step-7-anchor-discovery) below for the
|
|
730
|
+
precedence rules and when to use this.
|
|
731
|
+
- `AGENT_CONFIG_PROJECT_ROOT=<abs-path>` — pins the resolved project
|
|
732
|
+
root, skipping the anchor walk entirely. Set automatically by the
|
|
733
|
+
`./agent-config` wrapper; set manually in CI when the working
|
|
734
|
+
directory is not a descendant of the project root.
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
|
|
738
|
+
## Migration — Step 7 anchor discovery
|
|
739
|
+
|
|
740
|
+
Before Step 7, the CLI located the project root by walking up for a
|
|
741
|
+
`.git` directory only. Step 7 widens the anchor set so non-git
|
|
742
|
+
projects (sparse checkouts, monorepo sub-trees, `agent-config`-only
|
|
743
|
+
worktrees) resolve correctly and so subdirectory invocations stop
|
|
744
|
+
falling back to `cwd`.
|
|
745
|
+
|
|
746
|
+
### Anchor precedence (D3 — cascade-conflict decision)
|
|
747
|
+
|
|
748
|
+
Walk up from CWD. The first ancestor containing a **boundary
|
|
749
|
+
anchor** wins:
|
|
750
|
+
|
|
751
|
+
1. `.git` (file or directory).
|
|
752
|
+
2. `agents/` directory containing **any** of `roadmaps/`,
|
|
753
|
+
`.ai-council.yml`, or `roadmaps-progress.md` — bare `agents/`
|
|
754
|
+
does **not** anchor (D1).
|
|
755
|
+
|
|
756
|
+
If no boundary anchor exists in any ancestor, the **outermost**
|
|
757
|
+
(closest-to-fs-root) `.agent-settings.yml` becomes the root. This
|
|
758
|
+
preserves the layered-settings cascade — see
|
|
759
|
+
[`agents/council-sessions/step-7-d3-cascade-conflict-decision.md`](../agents/council-sessions/step-7-d3-cascade-conflict-decision.md)
|
|
760
|
+
for the rationale.
|
|
761
|
+
|
|
762
|
+
When a single ancestor carries multiple anchors, the **diagnostic
|
|
763
|
+
anchor name** reported by `agent-config doctor` follows the D3
|
|
764
|
+
tie-break order (`.agent-settings.yml` > `agents/` > `.git`). The
|
|
765
|
+
resolved path is identical either way.
|
|
766
|
+
|
|
767
|
+
### Resolution precedence (which root wins)
|
|
768
|
+
|
|
769
|
+
In order, first match wins (Step 8 adds the `--root` flag at the top):
|
|
770
|
+
|
|
771
|
+
1. Global `--root <dir>` flag (Step 8) — escape hatch for monorepos.
|
|
772
|
+
2. Explicit `--project <dir>` / `--target <dir>` on the CLI.
|
|
773
|
+
3. `AGENT_CONFIG_PROJECT_ROOT=<abs-path>` env var.
|
|
774
|
+
4. Anchor walk from CWD (rules above).
|
|
775
|
+
5. Fallback to CWD.
|
|
776
|
+
|
|
777
|
+
The `./agent-config` wrapper sets step 3 to its own directory, so
|
|
778
|
+
subcommands invoked from a subdirectory still target the right root
|
|
779
|
+
even after `os.chdir`.
|
|
780
|
+
|
|
781
|
+
### Project-root override — `--root` (Step 8)
|
|
782
|
+
|
|
783
|
+
The global `--root <dir>` flag pins discovery to a specific directory.
|
|
784
|
+
It is parsed by the bash dispatcher **before** any subcommand and beats
|
|
785
|
+
every other channel, including the wrapper-pinned env var:
|
|
786
|
+
|
|
787
|
+
```bash
|
|
788
|
+
# Run doctor against a sibling project from anywhere
|
|
789
|
+
agent-config --root /work/projects/site-a doctor --context
|
|
790
|
+
|
|
791
|
+
# Equivalent — long-form `=` syntax
|
|
792
|
+
agent-config --root=/work/projects/site-a doctor --context
|
|
793
|
+
```
|
|
794
|
+
|
|
795
|
+
**Fail-loud validation.** Invalid paths exit with code `2` instead of
|
|
796
|
+
silently falling back to CWD:
|
|
797
|
+
|
|
798
|
+
```text
|
|
799
|
+
❌ agent-config: --root points to a path that does not exist: /nope
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
The same validation applies to `--project` and
|
|
803
|
+
`AGENT_CONFIG_PROJECT_ROOT` — every explicit override is checked.
|
|
804
|
+
|
|
805
|
+
**Wrapper coupling.** When the project-local `./agent-config` wrapper
|
|
806
|
+
runs, it pins `AGENT_CONFIG_PROJECT_ROOT` to its own directory. The
|
|
807
|
+
`--root` flag explicitly overrides that pin (the wrapper logs a stderr
|
|
808
|
+
hint when this happens), so monorepo sub-trees can target one another
|
|
809
|
+
without unpinning the wrapper.
|
|
810
|
+
|
|
811
|
+
### Monorepo semantics
|
|
812
|
+
|
|
813
|
+
Monorepos with multiple `agent-config` consumers (e.g. one package per
|
|
814
|
+
sub-tree) work out of the box because the anchor walk stops at the
|
|
815
|
+
**nearest** boundary anchor (`agents/<markers>` or `.git`). From inside
|
|
816
|
+
`packages/site-a/`, discovery resolves to `packages/site-a/`, not the
|
|
817
|
+
monorepo root.
|
|
818
|
+
|
|
819
|
+
When you need to invoke a sibling package's CLI from anywhere, use
|
|
820
|
+
`--root`:
|
|
821
|
+
|
|
822
|
+
```bash
|
|
823
|
+
# From the monorepo root, target site-b
|
|
824
|
+
agent-config --root packages/site-b validate
|
|
825
|
+
|
|
826
|
+
# From inside site-a, run a sync against site-b
|
|
827
|
+
agent-config --root ../site-b sync
|
|
828
|
+
```
|
|
829
|
+
|
|
830
|
+
`--root` is the recommended channel — explicit, fail-loud, and visible
|
|
831
|
+
in `doctor --context` output. Setting `AGENT_CONFIG_PROJECT_ROOT`
|
|
832
|
+
manually still works but is less discoverable.
|
|
833
|
+
|
|
834
|
+
### Diagnostics — `doctor --trace-root` and `--context`
|
|
835
|
+
|
|
836
|
+
Two read-only diagnostic flags surface how discovery resolved the
|
|
837
|
+
project root:
|
|
838
|
+
|
|
839
|
+
```bash
|
|
840
|
+
# Show every ancestor probed + winning anchor
|
|
841
|
+
agent-config doctor --trace-root
|
|
842
|
+
|
|
843
|
+
# Show effective root, origin, install mode, settings layers, wrapper
|
|
844
|
+
agent-config doctor --context
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
Sample `--trace-root` output:
|
|
848
|
+
|
|
849
|
+
```text
|
|
850
|
+
📍 start: /work/projects/site-a/src
|
|
851
|
+
📍 origin: agents-dir
|
|
852
|
+
trace:
|
|
853
|
+
· [boundary] /work/projects/site-a/src (no .git, no agents/)
|
|
854
|
+
✅ [boundary] /work/projects/site-a → agents-dir (agents/ has roadmaps/)
|
|
855
|
+
📍 resolved root: /work/projects/site-a (anchor: agents-dir)
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
Sample `--context` output:
|
|
859
|
+
|
|
860
|
+
```text
|
|
861
|
+
📍 project_root: /work/projects/site-a (origin: agents-dir)
|
|
862
|
+
📦 install_mode: full (source: marker-file)
|
|
863
|
+
…
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
Both flags accept `--json` for machine-readable output. The
|
|
867
|
+
`install_mode_source` is `marker-file` when
|
|
868
|
+
`agents/.agent-state/install-mode.txt` exists (written by the
|
|
869
|
+
installer since Step 8) and `heuristic` for back-compat installs.
|
|
870
|
+
|
|
871
|
+
### When to set `AGENT_CONFIG_LEGACY_ANCHOR=1`
|
|
872
|
+
|
|
873
|
+
Set this only as a temporary escape hatch — for example, when the
|
|
874
|
+
new anchor set surfaces an unexpected ancestor in a CI pipeline that
|
|
875
|
+
already passes the legacy walk. Behaviour:
|
|
876
|
+
|
|
877
|
+
- Walk up for `.git` only (Step-6 behaviour).
|
|
878
|
+
- `agents/` and `.agent-settings.yml` are ignored as anchors.
|
|
879
|
+
- Cascade order is unchanged — layered `.agent-settings.yml` files
|
|
880
|
+
still merge.
|
|
881
|
+
|
|
882
|
+
The kill-switch is scheduled for removal after one minor-version
|
|
883
|
+
soak (D5). File an issue if you need it longer-term so the precedence
|
|
884
|
+
table can absorb the missing case.
|
|
885
|
+
|
|
886
|
+
### Verifying the resolved root
|
|
887
|
+
|
|
888
|
+
```bash
|
|
889
|
+
agent-config doctor --context
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
prints the resolved project root, origin (`root-flag` / `explicit` /
|
|
893
|
+
`env` / anchor name / `cwd-fallback`), install mode, settings-layer
|
|
894
|
+
chain, and wrapper state. Use this when a command appears to read the
|
|
895
|
+
wrong `.agent-settings.yml`. Pair with `--trace-root` (above) when the
|
|
896
|
+
**anchor walk itself** needs debugging.
|
|
678
897
|
|
|
679
898
|
---
|
|
680
899
|
|
package/package.json
CHANGED