@ainova-systems/intelligence 0.11.0-rc.7 → 0.11.0-rc.8

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 (50) hide show
  1. package/README.md +15 -16
  2. package/cli/commands/adapter.sh +153 -0
  3. package/cli/commands/init.sh +113 -22
  4. package/cli/commands/package.sh +30 -0
  5. package/cli/commands/registry.sh +4 -2
  6. package/cli/commands/status.sh +12 -4
  7. package/cli/commands/sync.sh +7 -20
  8. package/cli/commands/update.sh +76 -70
  9. package/cli/engine-package.yaml +2 -2
  10. package/cli/intelligence +10 -12
  11. package/cli/{commands/doctor.sh → internal/check.sh} +32 -14
  12. package/cli/{commands/migrate.sh → internal/migrate-v1.sh} +114 -25
  13. package/cli/{commands/add.sh → internal/package-add.sh} +3 -3
  14. package/cli/{commands/list.sh → internal/package-list.sh} +9 -4
  15. package/cli/{commands/remove.sh → internal/package-remove.sh} +3 -3
  16. package/cli/{commands/search.sh → internal/package-search.sh} +4 -4
  17. package/cli/internal/package-update.sh +97 -0
  18. package/cli/{commands/install.sh → internal/restore.sh} +3 -3
  19. package/cli/internal/target-state.sh +57 -0
  20. package/cli/{commands/upgrade.sh → internal/upgrade-v2.sh} +48 -8
  21. package/cli/lib/cli-common.sh +133 -7
  22. package/cli/lib/lockfile.sh +1 -1
  23. package/cli/lib/manifest.sh +86 -0
  24. package/cli/lib/registry.sh +4 -4
  25. package/engine/ENGINE_SHA +1 -1
  26. package/engine/adapters/_template.sh +10 -9
  27. package/engine/adapters/agents.sh +11 -11
  28. package/engine/adapters/opencode.sh +1 -1
  29. package/engine/lib/common.sh +14 -22
  30. package/engine/lib/contract.sh +14 -14
  31. package/engine/sync.sh +25 -20
  32. package/package.json +1 -1
  33. package/packages/sync/agents/intelligence-architect.md +5 -3
  34. package/packages/sync/agents/intelligence-operator.md +10 -13
  35. package/packages/sync/references/adapters.md +252 -0
  36. package/packages/sync/references/conventions.md +385 -0
  37. package/packages/sync/rules/intelligence-authoring.md +6 -6
  38. package/packages/sync/skills/intelligence-add-agent/SKILL.md +5 -5
  39. package/packages/sync/skills/intelligence-add-rule/SKILL.md +3 -3
  40. package/packages/sync/skills/intelligence-add-skill/SKILL.md +3 -3
  41. package/packages/sync/skills/intelligence-extract-skill/SKILL.md +2 -2
  42. package/packages/sync/skills/intelligence-install-adapter/SKILL.md +29 -22
  43. package/packages/sync/skills/intelligence-learn-from-context/SKILL.md +3 -3
  44. package/packages/sync/skills/intelligence-learn-from-repository/SKILL.md +55 -0
  45. package/packages/sync/skills/intelligence-review-skills/SKILL.md +6 -6
  46. package/packages/sync/skills/intelligence-sync/SKILL.md +13 -9
  47. package/packages/sync/skills/intelligence-uninstall-adapter/SKILL.md +19 -37
  48. package/packages/sync/skills/intelligence-update/SKILL.md +34 -156
  49. package/packages/sync/docs/ADAPTERS.md +0 -214
  50. package/packages/sync/docs/CONVENTIONS.md +0 -456
@@ -1,22 +1,21 @@
1
1
  #!/bin/bash
2
- # intelligence-sync: Adapter template
3
- # Copy this file to create a new IDE adapter.
2
+ # Intelligence CLI: project adapter template
3
+ # Scaffold this file with: intelligence adapter create <name>
4
4
  #
5
5
  # This file is NOT executable as-is — `<name>` placeholders below would be
6
6
  # parsed by bash as input redirection (`<` operator). Replace every
7
7
  # occurrence with your adapter name before sourcing.
8
8
  #
9
9
  # Required:
10
- # 1. Name the file: <ide-name>.sh (e.g., myide.sh)
11
- # 2. Replace every `<name>` placeholder with your adapter name
12
- # 3. Implement sync_to_<name>() function
13
- # 4. Add target to config.yaml:
10
+ # 1. Implement sync_to_<name>() and its three content transforms
11
+ # 2. Enable it after implementation: intelligence adapter enable <name>
12
+ # This adds the target to intelligence.yaml when it is absent:
14
13
  # targets:
15
14
  # <name>: { enabled: true, output: ".<name>" }
16
15
  #
17
16
  # The sync_to_<name>() function receives:
18
17
  # $1 = repo_root — absolute path to the project root
19
- # $2 = config_file — absolute path to config.yaml
18
+ # $2 = config_file — absolute path to intelligence.yaml
20
19
  # $3 = output_dir — absolute path to the output directory (e.g., .myide/)
21
20
  #
22
21
  # Available library functions (from lib/common.sh):
@@ -29,10 +28,12 @@
29
28
  # get_model_default(ide, tier) — hardcoded default for ide:tier
30
29
  # map_access_to_claude_tools(access) — full->"" (no tools list; inherits all), readonly->restricted
31
30
  # map_access_to_claude_disallowed(access) — readonly->"Write, Edit", full->""
32
- # read_yaml_list(config, section) — read list from config.yaml
31
+ # read_yaml_list(manifest, section) — read a source list from intelligence.yaml
33
32
  # get_target_field(config, target, field) — read a target's config field
34
33
 
35
- source "$(dirname "${BASH_SOURCE[0]}")/../lib/common.sh"
34
+ # Project adapters are sourced by engine/sync.sh after the shared library is
35
+ # loaded. Keep this template position-independent: after scaffolding it lives
36
+ # under the project's content directory, not beside engine/lib/.
36
37
 
37
38
  # Sync rules for <agent-name>
38
39
  # Typical transformations:
@@ -21,8 +21,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/../lib/common.sh"
21
21
  # one document Cursor, Copilot and Codex all read as canonical.
22
22
  # The defaults only cover an adapter driven directly (tests); sync.sh always
23
23
  # exports both.
24
- agents_md_umbrella_rel() {
25
- printf '%s' "${IS_UMBRELLA_REL:-intelligence}"
24
+ agents_md_content_rel() {
25
+ printf '%s' "${IS_CONTENT_REL:-intelligence}"
26
26
  }
27
27
 
28
28
  agents_md_module_rel() {
@@ -196,14 +196,14 @@ agents_md_append_rules_list() {
196
196
  # Path-scoped rules stay in tool-specific channels (.cursor/rules/,
197
197
  # .github/instructions/) so monorepo scoping is preserved.
198
198
  if [ "${#global_rule_files[@]}" -gt 0 ]; then
199
- local umbrella_rel
200
- umbrella_rel="$(agents_md_umbrella_rel "$repo_root")"
199
+ local content_rel
200
+ content_rel="$(agents_md_content_rel "$repo_root")"
201
201
  {
202
202
  echo "---"
203
203
  echo ""
204
204
  echo "## Project Context"
205
205
  echo ""
206
- echo "<!-- Inlined from always-on rules in $umbrella_rel/rules/ -->"
206
+ echo "<!-- Inlined from always-on rules in $content_rel/rules/ -->"
207
207
  echo ""
208
208
  } >> "$output"
209
209
  local rf
@@ -240,17 +240,17 @@ sync_to_agents() {
240
240
 
241
241
  mkdir -p "$(dirname "$output_file")"
242
242
 
243
- local umbrella_rel module_rel
244
- umbrella_rel="$(agents_md_umbrella_rel "$repo_root")"
243
+ local content_rel module_rel
244
+ content_rel="$(agents_md_content_rel "$repo_root")"
245
245
  module_rel="$(agents_md_module_rel "$repo_root")"
246
246
 
247
247
  # These two strings are written into a COMMITTED file. An absolute path here
248
248
  # means the derivation failed, and a machine-specific path in AGENTS.md is
249
249
  # worse than a failed sync — fail loudly instead.
250
- case "$umbrella_rel$module_rel" in
250
+ case "$content_rel$module_rel" in
251
251
  /*|*:[\\/]*)
252
252
  echo " ERROR: AGENTS.md paths did not resolve relative to the repo root:" >&2
253
- echo " umbrella='$umbrella_rel' module='$module_rel' repo_root='$repo_root'" >&2
253
+ echo " content='$content_rel' module='$module_rel' repo_root='$repo_root'" >&2
254
254
  return 1
255
255
  ;;
256
256
  esac
@@ -261,7 +261,7 @@ sync_to_agents() {
261
261
 
262
262
  {
263
263
  echo "<!-- Generated by intelligence-sync. Do not edit manually. -->"
264
- echo "<!-- Source: $umbrella_rel/ | Sync: $sync_cmd -->"
264
+ echo "<!-- Source: $content_rel/ | Sync: $sync_cmd -->"
265
265
  echo ""
266
266
  } > "$output_file"
267
267
 
@@ -270,7 +270,7 @@ sync_to_agents() {
270
270
  {
271
271
  echo "## Intelligence"
272
272
  echo ""
273
- echo "Source of truth: \`$umbrella_rel/\` | Sync: \`$sync_cmd\`"
273
+ echo "Source of truth: \`$content_rel/\` | Sync: \`$sync_cmd\`"
274
274
  echo ""
275
275
  } >> "$output_file"
276
276
 
@@ -29,7 +29,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/../lib/common.sh"
29
29
  # Strip frontmatter, return body only.
30
30
  # Direct call to the shared `strip_frontmatter` helper in lib/common.sh —
31
31
  # duplicating the awk block here would violate the "all parsing in common.sh"
32
- # convention (see CLAUDE.md / docs/CONVENTIONS.md).
32
+ # convention (see CLAUDE.md / packages/sync/references/conventions.md).
33
33
 
34
34
  sync_opencode_skills() {
35
35
  local repo_root="$1"
@@ -16,16 +16,14 @@ normalize_file_to_lf() {
16
16
 
17
17
  # --- Layout tokens -----------------------------------------------------------
18
18
  #
19
- # The umbrella folder is named by the project (`intelligence/`, `Intelligence/`,
20
- # a codename) — so an artifact SHIPPED BY THE ENGINE cannot write that name
21
- # down. A rule that scopes itself to the intelligence layer needs `paths:` to
22
- # say "the umbrella", and an agent body needs to name the sync command. Both are
23
- # spelled with tokens, expanded here at output time:
19
+ # The content directory is named by the project (`intelligence/`,
20
+ # `Intelligence/`, a codename), so package-shipped artifacts cannot hardcode
21
+ # it. Layout-sensitive paths and commands use tokens expanded at output time:
24
22
  #
25
- # <umbrella> -> the repo-relative umbrella dir (e.g. `Intelligence`)
26
- # <module> -> the repo-relative engine module (e.g. `Intelligence/sync`)
23
+ # <content-dir> -> the repo-relative project content dir (e.g. `Intelligence`)
24
+ # <module> -> the repo-relative sync package store path
27
25
  #
28
- # Values come from IS_UMBRELLA_REL / IS_MODULE_REL, which sync.sh derives from
26
+ # Values come from IS_CONTENT_REL / IS_MODULE_REL, which the CLI derives from
29
27
  # the detected layout (never hardcoded) and exports before any adapter runs.
30
28
  # Expansion happens in EVERY generated file, frontmatter and body alike, so a
31
29
  # scoped rule reaches Claude's `paths:`, Cursor's `globs:` and Copilot's
@@ -34,24 +32,18 @@ normalize_file_to_lf() {
34
32
  # finalize_output_file <file>
35
33
  # The single exit gate for every file an adapter writes: expand layout tokens,
36
34
  # then normalize CRLF -> LF. Adapters MUST call this (not normalize_file_to_lf)
37
- # on each output — a missed call ships a literal `<umbrella>` into an IDE.
35
+ # on each output — a missed call ships a literal `<content-dir>` into an IDE.
38
36
  finalize_output_file() {
39
37
  local target="$1"
40
- local umb="${IS_UMBRELLA_REL:-intelligence}"
41
- local mod="${IS_MODULE_REL:-intelligence/sync}"
42
- # `<sync-cmd>` is how engine content says "run a sync": vendored setups
43
- # expand it to the script invocation (built from $mod, so it reproduces the
44
- # exact pre-token string), the CLI overrides it via IS_SYNC_CMD
45
- # (`intelligence sync`). `<manifest>` names the project's config file the
46
- # same way: `config.yaml` vendored, `intelligence.yaml` under the CLI
47
- # (IS_MANIFEST_NAME).
48
- local sc="${IS_SYNC_CMD:-bash $mod/scripts/sync.sh}"
49
- local mf="${IS_MANIFEST_NAME:-config.yaml}"
38
+ local content="${IS_CONTENT_REL:-intelligence}"
39
+ local mod="${IS_MODULE_REL:-.intelligence/packages/@ainova-systems/sync}"
40
+ local sc="${IS_SYNC_CMD:-intelligence sync}"
41
+ local mf="${IS_MANIFEST_NAME:-intelligence.yaml}"
50
42
  local tmp_file="$target.tmp"
51
43
  # Literal (index-based) substitution, not gsub: a regex replacement would
52
44
  # give `&` in a path its special meaning, and POSIX awk has no way to pass a
53
45
  # replacement string verbatim.
54
- awk -v umb="$umb" -v mod="$mod" -v sc="$sc" -v mf="$mf" '
46
+ awk -v content="$content" -v mod="$mod" -v sc="$sc" -v mf="$mf" '
55
47
  function repl(s, from, to, out, i) {
56
48
  out = ""
57
49
  while ((i = index(s, from)) > 0) {
@@ -65,7 +57,7 @@ finalize_output_file() {
65
57
  $0 = repl($0, "<sync-cmd>", sc)
66
58
  $0 = repl($0, "<manifest>", mf)
67
59
  $0 = repl($0, "<module>", mod)
68
- $0 = repl($0, "<umbrella>", umb)
60
+ $0 = repl($0, "<content-dir>", content)
69
61
  print
70
62
  }
71
63
  ' "$target" > "$tmp_file"
@@ -798,7 +790,7 @@ warn_unsynced() {
798
790
  # from its location — it comes from the env contract the CLI exports.
799
791
  local intel_basename
800
792
  if [ "${IS_CLI:-0}" = "1" ]; then
801
- intel_basename="$(basename "${IS_UMBRELLA_REL:-intelligence}")"
793
+ intel_basename="$(basename "${IS_CONTENT_REL:-intelligence}")"
802
794
  else
803
795
  intel_basename="$(basename "$(dirname "$config_file")")"
804
796
  fi
@@ -1,16 +1,16 @@
1
1
  #!/bin/bash
2
- # shellcheck disable=SC2034 # IS_RC_*/IS_VERSION_KEY are the public bash<->CLI contract, consumed by the scripts that source this lib
2
+ # shellcheck disable=SC2034 # IS_RC_*/IS_SCHEMA_VERSION_KEY are the public bash<->CLI contract, consumed by the scripts that source this lib
3
3
  # intelligence-sync: the version and status contract.
4
4
  # Source this file — never execute directly.
5
5
  #
6
6
  # Two things live here, and both are contracts other programs depend on:
7
- # * the applied-schema stamp (`sync_version` in the manifest) with its
7
+ # * the applied-schema stamp (`schema_version` in the manifest) with its
8
8
  # read / write / compare helpers, and
9
9
  # * the IS_STATUS / IS_RC_* codes every engine flow reports.
10
10
  #
11
- # Schema migrations themselves are NOT here: the CLI owns them (v2 migrations
12
- # live in `intelligence upgrade`), and a v1 project is brought forward by the
13
- # archived v1 engine before `intelligence migrate` converts it.
11
+ # Schema migrations themselves are NOT here: the CLI owns them behind
12
+ # `intelligence init`, and a v1 project is brought forward by the archived v1
13
+ # engine before `intelligence init` converts it.
14
14
 
15
15
  # The applied-schema version is a managed key in the manifest.
16
16
  #
@@ -18,13 +18,13 @@
18
18
  # Anything else in the manifest may be reshaped; the name, location and shape of
19
19
  # this key never are - so any engine, however old or new, can always read "what
20
20
  # schema is this?" before parsing the rest.
21
- IS_VERSION_KEY="sync_version"
21
+ IS_SCHEMA_VERSION_KEY="schema_version"
22
22
 
23
- # read_engine_stamp <config_file> → applied version, or "" if absent.
24
- read_engine_stamp() {
23
+ # read_schema_version <config_file> → applied version, or "" if absent.
24
+ read_schema_version() {
25
25
  local cf="$1"
26
26
  [ -f "$cf" ] || return 0
27
- awk -v k="$IS_VERSION_KEY" '
27
+ awk -v k="$IS_SCHEMA_VERSION_KEY" '
28
28
  { sub(/\r$/, "") }
29
29
  $0 ~ "^" k ":" {
30
30
  v = $0; sub(/^[^:]*:[[:space:]]*/, "", v)
@@ -35,14 +35,14 @@ read_engine_stamp() {
35
35
  ' "$cf"
36
36
  }
37
37
 
38
- # stamp_version <config_file> <version> — idempotent, transactional upsert of
38
+ # stamp_schema_version <config_file> <version> — idempotent, transactional upsert of
39
39
  # the contract key (replace in place if present, else append at top level).
40
40
  # No-op if config.yaml does not exist yet (pre-bootstrap).
41
- stamp_version() {
41
+ stamp_schema_version() {
42
42
  local cf="$1" ver="$2"
43
43
  [ -f "$cf" ] || return 0
44
44
  local tmp="$cf.ver.tmp"
45
- awk -v k="$IS_VERSION_KEY" -v val="$ver" '
45
+ awk -v k="$IS_SCHEMA_VERSION_KEY" -v val="$ver" '
46
46
  { sub(/\r$/, "") }
47
47
  $0 ~ "^" k ":" { print k ": \"" val "\""; found=1; next }
48
48
  { print }
@@ -62,7 +62,7 @@ IS_RC_CONFIG_MISSING=2 # no manifest found
62
62
  IS_RC_AMBIGUOUS=3 # conflicting state; agent/human-only — bash never emits this itself
63
63
  IS_RC_AHEAD=4 # project stamped newer than this engine understands
64
64
  IS_RC_ABORTED_INCOMPLETE=5 # staged state incomplete; the project was left untouched
65
- IS_RC_NEEDS_UPDATE=6 # pending schema changes (stamp < engine) — run `intelligence upgrade` first
65
+ IS_RC_NEEDS_UPDATE=6 # pending schema changes (stamp < engine) — run `intelligence init --apply`
66
66
 
67
67
  # is_status <code-name> [detail] — emit one parseable line for the skill.
68
68
  is_status() {
@@ -106,7 +106,7 @@ _ver_gt() {
106
106
  # conflict, else 0.
107
107
  check_version_compat() {
108
108
  local cf="$1" stamp eng
109
- stamp="$(read_engine_stamp "$cf")"
109
+ stamp="$(read_schema_version "$cf")"
110
110
  [ -n "$stamp" ] || return 0
111
111
  eng="$(engine_version)"
112
112
  [ -n "$eng" ] || return 0
package/engine/sync.sh CHANGED
@@ -7,7 +7,7 @@
7
7
  #
8
8
  # CONFIG_FILE the project's manifest (intelligence.yaml at the root)
9
9
  # REPO_ROOT the project root
10
- # IS_UMBRELLA_REL the project's content dir, repo-relative
10
+ # IS_CONTENT_REL the project's content dir, repo-relative
11
11
  # IS_MODULE_REL the installed sync package, repo-relative
12
12
  # IS_PROTECTED_DIRS dirs an adapter output may never overlap
13
13
  #
@@ -35,21 +35,21 @@ _vc_rc=0
35
35
  check_version_compat "$_cf" || _vc_rc=$?
36
36
  if [ "$_vc_rc" -ne 0 ]; then exit "$_vc_rc"; fi
37
37
 
38
- # Schema gap → refuse. sync is a PURE synchronizer: it never migrates, so a
39
- # project behind this engine must be brought forward by `intelligence upgrade`
40
- # first. An ABSENT stamp means the same thing — a manifest with no
41
- # `sync_version` must not silently sync past a schema change.
42
- _stamp="$(read_engine_stamp "$_cf")"
38
+ # Schema gap → refuse. sync is a PURE synchronizer: it never changes schemas,
39
+ # so the CLI lifecycle preflight must align the project first. An ABSENT stamp
40
+ # means the same thing — a manifest with no
41
+ # `schema_version` must not silently sync past a schema change.
42
+ _stamp="$(read_schema_version "$_cf")"
43
43
  _eng="$(engine_version)"
44
44
  if [ -z "$_stamp" ]; then
45
- is_status needs-update "stamped= engine=$_eng (no sync_version)"
46
- echo "ERROR: the manifest has no sync_version — schema un-applied." >&2
47
- echo " Run: intelligence upgrade" >&2
45
+ is_status needs-update "stamped= engine=$_eng (no schema_version)"
46
+ echo "ERROR: the manifest has no schema_version — schema un-applied." >&2
47
+ echo " Run: intelligence init --apply" >&2
48
48
  exit "$IS_RC_NEEDS_UPDATE"
49
49
  elif [ -n "$_eng" ] && _ver_gt "$_eng" "$_stamp"; then
50
50
  is_status needs-update "stamped=$_stamp engine=$_eng"
51
51
  echo "ERROR: project at $_stamp but engine is $_eng — pending schema changes." >&2
52
- echo " Run: intelligence upgrade" >&2
52
+ echo " Run: intelligence init --apply" >&2
53
53
  exit "$IS_RC_NEEDS_UPDATE"
54
54
  fi
55
55
 
@@ -64,19 +64,19 @@ CONFIG_FILE="$(cd "$(dirname "$CONFIG_FILE")" && pwd)/$(basename "$CONFIG_FILE")
64
64
 
65
65
  # Layout tokens for generated output (see finalize_output_file in common.sh).
66
66
  # Package-shipped rules/agents cannot hardcode the content dir's name — the
67
- # project chooses it — so they write `<umbrella>` / `<module>` and every adapter
67
+ # project chooses it — so they write `<content-dir>` / `<module>` and every adapter
68
68
  # expands them on the way out.
69
- IS_UMBRELLA_REL="${IS_UMBRELLA_REL:-intelligence}"
69
+ IS_CONTENT_REL="${IS_CONTENT_REL:-intelligence}"
70
70
  # No vendor default: the CLI always exports the package path (derived from its
71
71
  # distribution data), so a bare invocation must say so rather than guess.
72
72
  if [ -z "${IS_MODULE_REL:-}" ]; then
73
73
  echo "ERROR: the engine needs IS_MODULE_REL (exported by the intelligence CLI)." >&2
74
74
  exit 1
75
75
  fi
76
- export IS_UMBRELLA_REL IS_MODULE_REL
76
+ export IS_CONTENT_REL IS_MODULE_REL
77
77
 
78
- # Project-owned adapters live in the content dir: <umbrella>/adapters/.
79
- INTELLIGENCE_DIR="$REPO_ROOT/$IS_UMBRELLA_REL"
78
+ # Project-owned adapters live in the content dir: <content-dir>/adapters/.
79
+ INTELLIGENCE_DIR="$REPO_ROOT/$IS_CONTENT_REL"
80
80
 
81
81
  TARGET_FILTER="${1:-}"
82
82
 
@@ -132,8 +132,8 @@ done
132
132
  # Adapters come from two places, discovered by filename (minus `.sh`,
133
133
  # `_template` excluded):
134
134
  #
135
- # 1. Built-in — shipped inside the CLI, replaced wholesale on every upgrade
136
- # 2. Project — <umbrella>/adapters/, owned by the project and never touched
135
+ # 1. Built-in — shipped inside the CLI, replaced with each CLI installation
136
+ # 2. Project — <content-dir>/adapters/, owned by the project and never touched
137
137
  #
138
138
  # A custom adapter therefore belongs in the content dir's `adapters/`; the
139
139
  # built-in directory lives inside the installed CLI and is not the project's to
@@ -183,7 +183,12 @@ while [ "$adapter_idx" -lt "$adapter_count" ]; do
183
183
 
184
184
  # Check if target is enabled in config
185
185
  enabled=$(is_target_enabled "$CONFIG_FILE" "$adapter")
186
- if [ "$enabled" != "1" ] && [ -z "$TARGET_FILTER" ]; then
186
+ if [ "$enabled" != "1" ]; then
187
+ if [ -n "$TARGET_FILTER" ]; then
188
+ echo "ERROR: Adapter '$TARGET_FILTER' is disabled in $CONFIG_FILE." >&2
189
+ echo " Enable it first: intelligence adapter enable $TARGET_FILTER" >&2
190
+ exit 1
191
+ fi
187
192
  continue
188
193
  fi
189
194
 
@@ -227,7 +232,7 @@ warn_unsynced "$REPO_ROOT" "$CONFIG_FILE"
227
232
  report_model_drift "$CONFIG_FILE"
228
233
 
229
234
  echo ""
230
- # sync.sh never migrates (`intelligence upgrade` owns that), so success is
231
- # always ok.
235
+ # sync.sh never changes project schemas (the CLI preflight owns that), so
236
+ # success is always ok.
232
237
  is_status ok "synced=$synced"
233
238
  echo "=== Done: $synced target(s) synced ==="
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainova-systems/intelligence",
3
- "version": "0.11.0-rc.7",
3
+ "version": "0.11.0-rc.8",
4
4
  "description": "Build, version and distribute AI agent intelligence across your organization — one CLI, versioned Intelligence Packages, and a sync engine for Claude Code, Cursor, Copilot, Codex, Pi and OpenCode.",
5
5
  "bin": {
6
6
  "intelligence": "bin/intelligence.js"
@@ -9,12 +9,13 @@ skills:
9
9
  - intelligence-add-skill
10
10
  - intelligence-extract-skill
11
11
  - intelligence-review-skills
12
+ - intelligence-learn-from-repository
12
13
  - intelligence-learn-from-context
13
14
  ---
14
15
 
15
16
  # Intelligence architect
16
17
 
17
- Owns `<umbrella>/` itself: what the layer is made of, and what it is allowed to grow into. Not the project's code — the instructions that shape how everyone else writes it.
18
+ Owns `<content-dir>/` itself: what the layer is made of, and what it is allowed to grow into. Not the project's code — the instructions that shape how everyone else writes it.
18
19
 
19
20
  ## Expertise
20
21
 
@@ -45,9 +46,10 @@ The per-artifact checks are procedure, so they live in the meta-skills rather th
45
46
  | `intelligence-add-rule` / `intelligence-add-agent` / `intelligence-add-skill` | author one artifact |
46
47
  | `intelligence-extract-skill` | turn an observed workflow into a skill |
47
48
  | `intelligence-review-skills` | audit the layer for duplication, drift, size, hardcoded paths |
49
+ | `intelligence-learn-from-repository` | propose the initial project-owned layer from repository evidence |
48
50
  | `intelligence-learn-from-context` | fold a session's lessons back into the layer |
49
51
  | `intelligence-sync` | project the source to every tool channel |
50
- | `intelligence-update` | update or migrate the engine |
51
- | `intelligence-install-adapter` / `intelligence-uninstall-adapter` | turn a tool channel on or off |
52
+ | `intelligence-update` | interpret and apply the CLI's unified update plan |
53
+ | `intelligence-install-adapter` / `intelligence-uninstall-adapter` | research and manage a tool adapter |
52
54
 
53
55
  A change is done when the sync is green and the skill you invoked reports clean. Size is a separate judgement: the caps are ceilings, not quotas, and a short artifact is not a defect.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: intelligence-operator
3
- description: "Run the engine's mechanical flows - sync, update, adapter install and removal"
3
+ description: "Interpret CLI plans and operate sync, update, and adapter flows"
4
4
  tier: standard
5
5
  access: full
6
6
  skills:
@@ -12,20 +12,17 @@ skills:
12
12
 
13
13
  # Intelligence operator
14
14
 
15
- Operates the engine: projects the source tree to every enabled tool channel, updates or migrates the
16
- engine, turns tool channels on and off. What the layer contains - which rules, agents and skills
15
+ Operates the CLI: projects the source tree to every enabled tool channel, interprets and applies update
16
+ plans, and manages adapters. What the layer contains - which rules, agents and skills
17
17
  exist and what they say - is `intelligence-architect`'s judgement; this agent runs the machinery
18
18
  that ships it.
19
19
 
20
20
  ## Expertise
21
21
 
22
- The status contract (`<module>/docs/CONVENTIONS.md`, Migration & Module Contract). Every flow
23
- here is deterministic and fail-closed: the sync is a pure synchronizer that refuses across an
24
- un-applied schema, the update flow stages, verifies and only then commits, and every flow
25
- reports `IS_STATUS`. The work is running the right flow, reading the code it returns, and doing
26
- what that code says - including stopping. The guards carry the decisions, which is why this agent
27
- runs on the standard tier: the failure mode is a loud refusal and a retry, not a plausible wrong
28
- answer.
22
+ The CLI and engine status contract. Mechanical flows are deterministic and
23
+ fail-closed; the agent reads their result, selects the next supported command,
24
+ checks changelog post-conditions, and stops on a refusal instead of recreating
25
+ the operation in prose.
29
26
 
30
27
  ## Boundaries
31
28
 
@@ -35,7 +32,7 @@ answer.
35
32
  - **Operating is not authoring.** A change to what an artifact says - a rule body, an agent persona,
36
33
  a skill's steps - belongs to `intelligence-architect` and the authoring meta-skills. This agent
37
34
  ships what exists and never decides what should exist.
38
- - **A state the engine refuses to resolve goes to a human.** `ambiguous` and every other non-ok
35
+ - **A state the CLI refuses to resolve goes to a human.** `ambiguous` and every other non-ok
39
36
  status exists so that nobody guesses past a refusal; report the code and its detail, do the one
40
37
  thing the contract names for it, and stop rather than force a way through.
41
38
 
@@ -45,5 +42,5 @@ answer.
45
42
  <sync-cmd> # expect IS_STATUS=ok
46
43
  ```
47
44
 
48
- Done is the invoked skill reporting its own success criteria met: `IS_STATUS=ok` (`migrated` counts,
49
- for an update), per-target counts matching the sources, and no warning left unhandled.
45
+ Done is the invoked skill reporting its own success criteria met: `IS_STATUS=ok`,
46
+ per-target counts matching the sources, and no warning left unhandled.