@event4u/agent-config 2.0.0 → 2.2.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.
Files changed (41) hide show
  1. package/.agent-src/commands/fix/{pr-bots.md → pr-bot-comments.md} +3 -3
  2. package/.agent-src/commands/fix/{pr.md → pr-comments.md} +6 -6
  3. package/.agent-src/commands/fix/{pr-developers.md → pr-developer-comments.md} +3 -3
  4. package/.agent-src/commands/fix.md +6 -6
  5. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +2 -2
  6. package/.agent-src/rules/no-cheap-questions.md +11 -2
  7. package/.agent-src/skills/readme-writing-package/SKILL.md +24 -0
  8. package/.claude-plugin/marketplace.json +4 -4
  9. package/CHANGELOG.md +79 -0
  10. package/README.md +76 -12
  11. package/docs/architecture.md +2 -2
  12. package/docs/catalog.md +3 -3
  13. package/docs/contracts/command-clusters.md +3 -3
  14. package/docs/contracts/file-ownership-matrix.json +9 -9
  15. package/docs/contracts/tier-3-contrib-plugin.md +129 -0
  16. package/docs/decisions/ADR-007-agent-discovery-scopes.md +278 -0
  17. package/docs/decisions/ADR-008-installed-tools-manifest.md +160 -0
  18. package/docs/decisions/INDEX.md +2 -0
  19. package/docs/getting-started.md +16 -25
  20. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +32 -0
  21. package/docs/guidelines/agent-infra/installed-tools-manifest.md +135 -0
  22. package/docs/installation.md +116 -49
  23. package/docs/migrations/commands-1.15.0.md +3 -3
  24. package/docs/setup/per-ide/claude-desktop.md +8 -4
  25. package/docs/skills-catalog.md +23 -2
  26. package/docs/troubleshooting.md +20 -32
  27. package/llms.txt +22 -1
  28. package/package.json +1 -1
  29. package/scripts/_cli/cmd_export.py +157 -0
  30. package/scripts/_cli/cmd_sync.py +162 -0
  31. package/scripts/_cli/cmd_update.py +23 -1
  32. package/scripts/_cli/cmd_validate.py +164 -0
  33. package/scripts/_lib/installed_lock.py +160 -0
  34. package/scripts/_lib/installed_tools.py +237 -0
  35. package/scripts/agent-config +62 -0
  36. package/scripts/install +68 -13
  37. package/scripts/install.py +984 -33
  38. package/scripts/install.sh +6 -11
  39. package/templates/agent-config-wrapper.sh +40 -25
  40. package/templates/consumer-settings/README.md +2 -2
  41. package/scripts/setup.sh +0 -230
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
@@ -186,12 +216,10 @@ if [[ -z "$SOURCE_DIR" ]]; then
186
216
  SOURCE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
187
217
  fi
188
218
 
189
- # Auto-detect target: PROJECT_ROOT env, or derive from vendor/node_modules path, else cwd
219
+ # Auto-detect target: PROJECT_ROOT env, or derive from node_modules path, else cwd
190
220
  if [[ -z "$TARGET_DIR" ]]; then
191
221
  if [[ -n "${PROJECT_ROOT:-}" ]]; then
192
222
  TARGET_DIR="$PROJECT_ROOT"
193
- elif [[ "$SOURCE_DIR" == */vendor/event4u/agent-config ]]; then
194
- TARGET_DIR="$(cd "$SOURCE_DIR/../../.." && pwd)"
195
223
  elif [[ "$SOURCE_DIR" == */node_modules/@event4u/agent-config ]]; then
196
224
  TARGET_DIR="$(cd "$SOURCE_DIR/../../.." && pwd)"
197
225
  elif [[ "$SOURCE_DIR" == */node_modules/*/agent-config ]]; then
@@ -201,6 +229,30 @@ if [[ -z "$TARGET_DIR" ]]; then
201
229
  fi
202
230
  fi
203
231
 
232
+ # Source-repo guard: refuse to install into the agent-config dev tree itself.
233
+ # Mirrors packages/create-agent-config/src/install.js — defense-in-depth so a
234
+ # direct `bash scripts/install` from inside the source checkout (without the
235
+ # Node wrapper) cannot corrupt .augment/ symlinks. Override for self-tests:
236
+ # AGENT_CONFIG_ALLOW_SELF_INSTALL=1.
237
+ if [[ "${AGENT_CONFIG_ALLOW_SELF_INSTALL:-0}" != "1" ]]; then
238
+ self_marker=""
239
+ if [[ -d "$TARGET_DIR/.agent-src.uncompressed" ]]; then
240
+ self_marker=".agent-src.uncompressed/"
241
+ elif [[ -f "$TARGET_DIR/package.json" ]] && \
242
+ grep -qE '"name"[[:space:]]*:[[:space:]]*"@event4u/(create-)?agent-config"' "$TARGET_DIR/package.json" 2>/dev/null; then
243
+ self_marker='package.json::name === "@event4u/(create-)agent-config"'
244
+ fi
245
+ if [[ -n "$self_marker" ]]; then
246
+ err "Refusing to install agent-config into its own source checkout."
247
+ echo " Target: $TARGET_DIR" >&2
248
+ echo " Detected: $self_marker" >&2
249
+ echo " Run \`task sync\` to regenerate .agent-src/ + .augment/ from" >&2
250
+ echo " .agent-src.uncompressed/ instead. To force this anyway, set" >&2
251
+ echo " AGENT_CONFIG_ALLOW_SELF_INSTALL=1." >&2
252
+ exit 2
253
+ fi
254
+ fi
255
+
204
256
  # Find python3 for the bridges stage (optional until SKIP_BRIDGES=false)
205
257
  find_python() {
206
258
  local candidate path
@@ -241,6 +293,9 @@ run_bridges() {
241
293
  [[ -n "$PROFILE" ]] && args+=(--profile="$PROFILE")
242
294
  $FORCE && args+=(--force)
243
295
  $QUIET && args+=(--quiet)
296
+ $GLOBAL && args+=(--global)
297
+ [[ -n "$SCOPE" ]] && args+=(--scope="$SCOPE")
298
+ [[ -n "$CUSTOM_PATH" ]] && args+=(--custom-path="$CUSTOM_PATH")
244
299
  args+=(--tools="$TOOLS")
245
300
  "$python_bin" "$INSTALL_PY" "${args[@]}"
246
301
  }