@event4u/agent-config 2.1.0 → 2.2.1

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.
Files changed (38) hide show
  1. package/.agent-src/rules/no-cheap-questions.md +11 -2
  2. package/.agent-src/skills/readme-writing-package/SKILL.md +24 -0
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +69 -0
  5. package/README.md +71 -6
  6. package/docs/DISTRIBUTION_CHECKLIST.md +7 -6
  7. package/docs/architecture.md +1 -1
  8. package/docs/contracts/tier-3-contrib-plugin.md +129 -0
  9. package/docs/decisions/ADR-007-agent-discovery-scopes.md +286 -0
  10. package/docs/decisions/ADR-008-installed-tools-manifest.md +160 -0
  11. package/docs/decisions/INDEX.md +2 -0
  12. package/docs/getting-started.md +1 -1
  13. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +32 -0
  14. package/docs/guidelines/agent-infra/installed-tools-manifest.md +135 -0
  15. package/docs/installation.md +83 -27
  16. package/docs/setup/per-ide/aider.md +1 -1
  17. package/docs/setup/per-ide/claude-code.md +1 -1
  18. package/docs/setup/per-ide/claude-desktop.md +8 -4
  19. package/docs/setup/per-ide/cline.md +2 -2
  20. package/docs/setup/per-ide/codex.md +1 -1
  21. package/docs/setup/per-ide/copilot.md +2 -2
  22. package/docs/setup/per-ide/cursor.md +2 -2
  23. package/docs/setup/per-ide/gemini-cli.md +1 -1
  24. package/docs/setup/per-ide/windsurf.md +2 -2
  25. package/docs/troubleshooting.md +4 -4
  26. package/package.json +1 -1
  27. package/scripts/_cli/cmd_export.py +157 -0
  28. package/scripts/_cli/cmd_sync.py +162 -0
  29. package/scripts/_cli/cmd_update.py +23 -1
  30. package/scripts/_cli/cmd_validate.py +164 -0
  31. package/scripts/_lib/installed_lock.py +160 -0
  32. package/scripts/_lib/installed_tools.py +237 -0
  33. package/scripts/agent-config +78 -1
  34. package/scripts/install +43 -10
  35. package/scripts/install.py +975 -14
  36. package/templates/agent-config-wrapper.sh +1 -1
  37. package/templates/consumer-settings/README.md +1 -1
  38. package/templates/marketing-copy.yml +6 -5
@@ -98,6 +98,22 @@ Commands:
98
98
  Flags: --check (read-only) | --to <version> (explicit pin)
99
99
  migrate One-shot migration off legacy composer / npm install paths
100
100
  Flags: --dry-run (detect only)
101
+ init One-shot project install. Forwards to `scripts/install`
102
+ with all args. Entry point for `npx @event4u/agent-config init`.
103
+ Flags: --tools=<list> | --ai=<list> | --yes | --force
104
+ global Install to user-scope paths (~/.claude/, ~/.cursor/, …)
105
+ Forwards to `scripts/install --global` (ADR-007).
106
+ Flags: --tools=<list> | --ai=<list> | --yes | --force
107
+ export Eject a tool's canonical content into a chosen path
108
+ (real file, no symlink). Idempotent; --force overrides
109
+ content drift. See `./agent-config export --list`.
110
+ Flags: --tool=<id> | --output=<path> | --force | --list
111
+ sync Replay agents/installed-tools.lock — re-installs any
112
+ tool whose bridge marker is missing locally (ADR-008).
113
+ Flags: --dry-run | --force | --project=<path>
114
+ validate Read-only drift detection on the manifest
115
+ (marker missing, scope divergence, version drift).
116
+ Exits 1 on drift. Flags: --quiet | --skip-version-check
101
117
  help Show this help
102
118
  --version, -V Print package version
103
119
 
@@ -126,6 +142,15 @@ Examples:
126
142
  ./agent-config council:estimate prompt.txt
127
143
  ./agent-config council:run prompt.txt --output agents/council-sessions/out.json --confirm
128
144
  ./agent-config council:render agents/council-sessions/out.json
145
+ ./agent-config init --tools=claude-code,cursor --yes
146
+ ./agent-config global --tools=claude-code --yes
147
+ ./agent-config global --ai=cursor,windsurf
148
+ ./agent-config export --list
149
+ ./agent-config export --tool=agents-md --output=AGENTS.md
150
+ ./agent-config export --tool=copilot-instructions --output=.github/copilot-instructions.md
151
+ ./agent-config sync --dry-run
152
+ ./agent-config sync
153
+ ./agent-config validate
129
154
 
130
155
  All commands operate on the CURRENT DIRECTORY (your project root).
131
156
  The CLI is strictly consumer-facing. Maintainer tasks live in Taskfile.yml.
@@ -524,6 +549,53 @@ cmd_migrate() {
524
549
  exec env PYTHONPATH="$PACKAGE_ROOT" python3 -m scripts._cli.cmd_migrate "$@"
525
550
  }
526
551
 
552
+ # `agent-config init` — project-scope install entry point. Forwards
553
+ # unmodified args to the bash installer. This is the canonical
554
+ # `npx @event4u/agent-config init` consumer entry point (replaces the
555
+ # deprecated @event4u/create-agent-config wrapper package).
556
+ cmd_init() {
557
+ local script
558
+ script="$(resolve_script "scripts/install")" || return 1
559
+ exec bash "$script" "$@"
560
+ }
561
+
562
+ # `agent-config global` — user-scope install entry point. Forwards to the
563
+ # bash installer with `--global` set (ADR-007). Phase 1.2 of
564
+ # road-to-global-first-install.md. The bash wrapper handles option parsing
565
+ # and forwards to `scripts/install.py --global`, where `install_global()`
566
+ # currently scaffolds the per-tool anchor paths from USER_SCOPE_PATHS.
567
+ # Concrete writes land in Phase 1.5 (export) and Phase 1.6 (lockfile).
568
+ cmd_global() {
569
+ local script
570
+ script="$(resolve_script "scripts/install")" || return 1
571
+ exec bash "$script" --global "$@"
572
+ }
573
+
574
+ # `agent-config export` — write a tool's canonical content into a
575
+ # user-chosen path. ADR-007 D3 / Phase 1.5 of
576
+ # road-to-global-first-install.md. Replaces the rejected symlink-bridge.
577
+ # See scripts/_cli/cmd_export.py for the registry and idempotency logic.
578
+ cmd_export() {
579
+ require_python3
580
+ exec env PYTHONPATH="$PACKAGE_ROOT" python3 -m scripts._cli.cmd_export "$@"
581
+ }
582
+
583
+ # `agent-config sync` — replay agents/installed-tools.lock (ADR-008
584
+ # Phase 3.3). Re-installs any tool whose bridge marker is missing on
585
+ # disk. Typical onboarding flow: clone → `./agent-config sync` → done.
586
+ cmd_sync() {
587
+ require_python3
588
+ exec env PYTHONPATH="$PACKAGE_ROOT" python3 -m scripts._cli.cmd_sync "$@"
589
+ }
590
+
591
+ # `agent-config validate` — read-only drift detection (ADR-008 Phase 3.4).
592
+ # Surfaces marker-missing, scope-divergence, and version-drift; exits 1 on
593
+ # any drift. Never edits the manifest or re-runs the installer.
594
+ cmd_validate() {
595
+ require_python3
596
+ exec env PYTHONPATH="$PACKAGE_ROOT" python3 -m scripts._cli.cmd_validate "$@"
597
+ }
598
+
527
599
  main() {
528
600
  local cmd="${1-}"
529
601
  [[ $# -gt 0 ]] && shift || true
@@ -564,6 +636,11 @@ main() {
564
636
  council:render) cmd_council render "$@" ;;
565
637
  update) cmd_update "$@" ;;
566
638
  migrate) cmd_migrate "$@" ;;
639
+ init) cmd_init "$@" ;;
640
+ global) cmd_global "$@" ;;
641
+ export) cmd_export "$@" ;;
642
+ sync) cmd_sync "$@" ;;
643
+ validate) cmd_validate "$@" ;;
567
644
  help|--help|-h|"") usage ;;
568
645
  --version|-V) print_version ;;
569
646
  *)
@@ -584,7 +661,7 @@ main() {
584
661
  maybe_pin_reexec() {
585
662
  local cmd="${1-}"
586
663
  case "$cmd" in
587
- help|--help|-h|--version|-V|update|migrate|"") return 0 ;;
664
+ help|--help|-h|--version|-V|update|migrate|init|"") return 0 ;;
588
665
  esac
589
666
  if ! command -v python3 >/dev/null 2>&1; then
590
667
  return 0
package/scripts/install CHANGED
@@ -17,7 +17,10 @@
17
17
  # --profile <name> Cost profile for bridges (minimal|balanced|full)
18
18
  # --tools <list> Comma-separated tool IDs to install (default: all).
19
19
  # Valid: claude-code,claude-desktop,cursor,windsurf,
20
- # cline,gemini-cli,copilot,augment,aider,codex,all
20
+ # cline,gemini-cli,copilot,augment,aider,codex,
21
+ # roocode,continue,kilocode,zed,jetbrains,kiro,all
22
+ # --ai <list> Alias for --tools (same IDs). When both are passed
23
+ # the comma-separated values are unioned.
21
24
  # --list-tools Print supported tool IDs with descriptions, then exit
22
25
  # --yes, -y Non-interactive mode: do not prompt (default for non-TTY)
23
26
  # --force Overwrite existing bridge files
@@ -26,12 +29,22 @@
26
29
  # --quiet Suppress non-error output
27
30
  # --skip-sync Skip payload sync (install.sh)
28
31
  # --skip-bridges Skip bridge files (install.py)
32
+ # --global Install to user-scope paths (~/.claude/, ~/.cursor/, …)
33
+ # instead of project-locally. Implies --skip-sync (the
34
+ # payload sync stage is project-only). See ADR-007.
35
+ # --scope <mode> Override scope detection: auto | project | global | prompt.
36
+ # auto = honor multi-signal detection (Phase 1.3)
37
+ # project = force project-local install
38
+ # global = force user-scope install (same as --global)
39
+ # prompt = always show the 3-option chooser
40
+ # --custom-path <d> Use <d> as the project root when prompted; rejected with
41
+ # --scope=global / --global.
29
42
  # --help, -h Show this help
30
43
  #
31
44
  # Examples:
32
45
  # bash scripts/install # everything (default)
33
46
  # bash scripts/install --tools=claude-code,cursor # only those two
34
- # bash scripts/install --tools=cursor --yes # CI-friendly
47
+ # bash scripts/install --ai=cursor --yes # alias form (CI-friendly)
35
48
  # bash scripts/install --list-tools # show catalog
36
49
 
37
50
  set -uo pipefail
@@ -53,12 +66,15 @@ QUIET=false
53
66
  SKIP_SYNC=false
54
67
  SKIP_BRIDGES=false
55
68
  LIST_TOOLS=false
69
+ GLOBAL=false
70
+ SCOPE=""
71
+ CUSTOM_PATH=""
56
72
 
57
73
  # Single source of truth for valid tool IDs (also referenced by install.sh / install.py).
58
- VALID_TOOLS="claude-code claude-desktop cursor windsurf cline gemini-cli copilot augment aider codex all"
74
+ VALID_TOOLS="claude-code claude-desktop cursor windsurf cline gemini-cli copilot augment aider codex roocode continue kilocode zed jetbrains kiro all"
59
75
 
60
76
  show_help() {
61
- sed -n '3,29p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
77
+ sed -n '3,48p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
62
78
  }
63
79
 
64
80
  list_tools() {
@@ -66,19 +82,26 @@ list_tools() {
66
82
  Supported --tools IDs (default: all):
67
83
 
68
84
  claude-code .claude/rules, .claude/skills, .claude/commands, .claude/settings.json
69
- claude-desktop ~/Library/Application Support/Claude/ (global, see Phase 4 docs)
85
+ claude-desktop .claude-desktop/agent-config.md marker (global-scope tool see ADR-007)
70
86
  cursor .cursor/rules, .cursor/commands (legacy .cursorrules also written)
71
87
  windsurf .windsurf/rules, .windsurf/workflows (legacy .windsurfrules also written)
72
88
  cline .clinerules/ symlinks
73
89
  gemini-cli GEMINI.md, .gemini/settings.json
74
90
  copilot .github/copilot-instructions.md, .vscode/settings.json
75
91
  augment .augment/ payload + settings (substrate — recommended for every install)
76
- aider AGENTS.md (Linux Foundation cross-tool contract; always written)
77
- codex AGENTS.md (same as aider — no extra action)
92
+ aider .aider/agent-config.md marker (wire via `read:` in .aider.conf.yml)
93
+ codex .codex/agent-config.md marker (Codex reads AGENTS.md directly)
94
+ roocode .roo/rules/agent-config.md marker (Roo Code auto-discovery)
95
+ continue .continue/rules/agent-config.md marker (Continue.dev auto-discovery)
96
+ kilocode .kilocode/rules/agent-config.md marker (Kilo Code auto-discovery)
97
+ zed .zed/agent-config.md marker (Zed reads .rules at project root)
98
+ jetbrains .jetbrains/agent-config.md marker (JetBrains AI Assistant)
99
+ kiro .kiro/steering/agent-config.md marker (Kiro auto-discovery)
78
100
  all every ID above (the default; backward-compatible)
79
101
 
80
102
  Examples:
81
103
  --tools=claude-code,cursor project-local install for those two surfaces
104
+ --ai=cursor alias for --tools=cursor
82
105
  --tools=all equivalent to omitting the flag
83
106
  EOF
84
107
  }
@@ -110,8 +133,10 @@ while [[ $# -gt 0 ]]; do
110
133
  --target=*) TARGET_DIR="${1#*=}"; shift ;;
111
134
  --profile) PROFILE="$2"; shift 2 ;;
112
135
  --profile=*) PROFILE="${1#*=}"; shift ;;
113
- --tools) TOOLS="$2"; TOOLS_EXPLICIT=true; shift 2 ;;
114
- --tools=*) TOOLS="${1#*=}"; TOOLS_EXPLICIT=true; shift ;;
136
+ --tools) TOOLS="${TOOLS:+$TOOLS,}$2"; TOOLS_EXPLICIT=true; shift 2 ;;
137
+ --tools=*) TOOLS="${TOOLS:+$TOOLS,}${1#*=}"; TOOLS_EXPLICIT=true; shift ;;
138
+ --ai) TOOLS="${TOOLS:+$TOOLS,}$2"; TOOLS_EXPLICIT=true; shift 2 ;;
139
+ --ai=*) TOOLS="${TOOLS:+$TOOLS,}${1#*=}"; TOOLS_EXPLICIT=true; shift ;;
115
140
  --list-tools) LIST_TOOLS=true; shift ;;
116
141
  --yes|-y) YES=true; shift ;;
117
142
  --force) FORCE=true; shift ;;
@@ -120,6 +145,11 @@ while [[ $# -gt 0 ]]; do
120
145
  --quiet) QUIET=true; shift ;;
121
146
  --skip-sync) SKIP_SYNC=true; shift ;;
122
147
  --skip-bridges) SKIP_BRIDGES=true; shift ;;
148
+ --global) GLOBAL=true; SKIP_SYNC=true; shift ;;
149
+ --scope) SCOPE="$2"; shift 2 ;;
150
+ --scope=*) SCOPE="${1#*=}"; shift ;;
151
+ --custom-path) CUSTOM_PATH="$2"; shift 2 ;;
152
+ --custom-path=*) CUSTOM_PATH="${1#*=}"; shift ;;
123
153
  --help|-h) show_help; exit 0 ;;
124
154
  *) err "Unknown argument: $1"; show_help >&2; exit 1 ;;
125
155
  esac
@@ -138,7 +168,7 @@ fi
138
168
  # Otherwise we fall through to the backward-compatible "all" default.
139
169
  prompt_tools() {
140
170
  local choice picked tool i=0
141
- local -a menu=(claude-code claude-desktop cursor windsurf cline gemini-cli copilot augment aider codex)
171
+ local -a menu=(claude-code claude-desktop cursor windsurf cline gemini-cli copilot augment aider codex roocode continue kilocode zed jetbrains kiro)
142
172
  echo ""
143
173
  echo " 📦 Pick the tools to install (comma-separated numbers, blank = all):"
144
174
  for tool in "${menu[@]}"; do
@@ -263,6 +293,9 @@ run_bridges() {
263
293
  [[ -n "$PROFILE" ]] && args+=(--profile="$PROFILE")
264
294
  $FORCE && args+=(--force)
265
295
  $QUIET && args+=(--quiet)
296
+ $GLOBAL && args+=(--global)
297
+ [[ -n "$SCOPE" ]] && args+=(--scope="$SCOPE")
298
+ [[ -n "$CUSTOM_PATH" ]] && args+=(--custom-path="$CUSTOM_PATH")
266
299
  args+=(--tools="$TOOLS")
267
300
  "$python_bin" "$INSTALL_PY" "${args[@]}"
268
301
  }