@ainova-systems/intelligence 0.13.0 → 0.15.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 (35) hide show
  1. package/README.md +1 -1
  2. package/cli/commands/update.sh +9 -2
  3. package/cli/intelligence +1 -0
  4. package/cli/internal/package-update.sh +57 -9
  5. package/engine/ENGINE_SHA +1 -1
  6. package/engine/VERSION +1 -1
  7. package/engine/adapters/agents.sh +7 -12
  8. package/engine/lib/common.sh +57 -25
  9. package/engine/lib/contract.sh +1 -1
  10. package/package.json +1 -1
  11. package/packages/sync/agents/intelligence-architect.md +8 -14
  12. package/packages/sync/agents/intelligence-operator.md +3 -4
  13. package/packages/sync/references/conventions.md +24 -1
  14. package/packages/sync/rules/intelligence-authoring.md +1 -1
  15. package/packages/sync/skills/intelligence-learn-from-repository/SKILL.md +6 -7
  16. package/packages/sync/skills/intelligence-learn-from-session/SKILL.md +50 -0
  17. package/packages/sync/skills/intelligence-manage-adapters/SKILL.md +45 -0
  18. package/packages/sync/skills/intelligence-review-context/SKILL.md +54 -0
  19. package/packages/sync/skills/intelligence-review-context/references/audit-checks.md +56 -0
  20. package/packages/sync/skills/intelligence-review-context/references/compaction.md +57 -0
  21. package/packages/sync/skills/intelligence-update-context/SKILL.md +71 -0
  22. package/packages/sync/skills/intelligence-update-context/references/agents.md +31 -0
  23. package/packages/sync/skills/intelligence-update-context/references/rules.md +31 -0
  24. package/packages/sync/skills/intelligence-update-context/references/skills.md +34 -0
  25. package/packages/sync/skills/{intelligence-update → intelligence-upgrade}/SKILL.md +3 -3
  26. package/packages/sync/skills/intelligence-add-agent/SKILL.md +0 -62
  27. package/packages/sync/skills/intelligence-add-rule/SKILL.md +0 -54
  28. package/packages/sync/skills/intelligence-add-skill/SKILL.md +0 -53
  29. package/packages/sync/skills/intelligence-compact-context/SKILL.md +0 -118
  30. package/packages/sync/skills/intelligence-extract-skill/SKILL.md +0 -47
  31. package/packages/sync/skills/intelligence-install-adapter/SKILL.md +0 -45
  32. package/packages/sync/skills/intelligence-learn-from-context/SKILL.md +0 -88
  33. package/packages/sync/skills/intelligence-review-skills/SKILL.md +0 -101
  34. package/packages/sync/skills/intelligence-uninstall-adapter/SKILL.md +0 -24
  35. /package/packages/sync/skills/{intelligence-compact-context → intelligence-review-context}/references/principles.md +0 -0
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: intelligence-manage-adapters
3
+ description: "Enable, disable, or remove adapters and assess generated-output cleanup"
4
+ argument-hint: "<enable|disable|remove> <adapter-name>"
5
+ agent: intelligence-operator
6
+ ---
7
+
8
+ # Manage adapters
9
+
10
+ Operate existing built-in or project adapters through the CLI. Resolve the requested
11
+ action and adapter name as separate arguments; never pass the whole skill argument
12
+ string as an adapter name. The CLI owns target state, dependency checks, ignores,
13
+ scaffolding, and sync. Adapter implementation follows the public adapter guide.
14
+
15
+ 1. Run `intelligence adapter list` and identify the requested adapter, its source,
16
+ state, and output. If it does not exist, explain that implementation is needed
17
+ and point to `<module>/references/adapters.md`. This package does not include
18
+ an implementation skill; do not invoke a repository-only skill in consumers.
19
+
20
+ 2. For **enable**, run `intelligence adapter enable <name>`. If it requires the
21
+ shared `agents` target, enable that dependency first. Enabling performs a full
22
+ sync; require `IS_STATUS=ok` and inspect output for the selected adapter. Correct
23
+ Git policy in the contract instead of hand-editing `.gitignore` or ignoring a
24
+ shared output root.
25
+
26
+ 3. For **disable**, run `intelligence adapter disable <name>`. This changes target
27
+ state and deliberately retains output. For **remove**, read and retain the
28
+ contract's ownership information first so later cleanup remains attributable.
29
+ Disable an enabled project adapter, then run `intelligence adapter remove <name>`
30
+ (use `--apply` for already-approved non-interactive removal). Built-in adapter
31
+ source cannot be removed.
32
+
33
+ 4. Treat generated-output cleanup separately from disabling or removing source.
34
+ Inspect the contract's owned and managed paths, including dependencies and any
35
+ shared consumers. Present the exact deletion list and obtain approval before
36
+ deleting output. Preserve shared roots and hand-authored siblings. Remove obsolete
37
+ ignore entries only when no remaining adapter needs them. After disabling or
38
+ removing, sync remaining enabled adapters when any exist, and require
39
+ `IS_STATUS=ok` from that sync.
40
+
41
+ 5. Verify with `intelligence adapter list` and `intelligence status --check`:
42
+ requested target state is correct, retained files are intact, and only approved
43
+ adapter-owned output was deleted. Report state, output paths, and any remaining
44
+ implementation or cleanup work. Preserve CLI refusals instead of recreating
45
+ lifecycle mechanics manually.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: intelligence-review-context
3
+ description: "Audit rules, agents, and skills and propose behavior-preserving reductions"
4
+ argument-hint: "[rules|agents|skills|all] [compact]"
5
+ agent: intelligence-architect
6
+ ---
7
+
8
+ # Review project context
9
+
10
+ Audit the intelligence layer and propose improvements. Review and compaction
11
+ analysis are read-only: do not sync or edit while inspecting. Accepted changes
12
+ go through `intelligence-update-context`; this skill owns their review criteria.
13
+
14
+ ## Audit
15
+
16
+ 1. Read `<manifest>` and enumerate its configured rule, agent, and skill sources.
17
+ Read the `intelligence-authoring` rule and
18
+ `<module>/references/conventions.md`. Review project-owned sources; an installed
19
+ package finding belongs upstream. In a package's own repository, review its
20
+ authoritative source tree. Do not audit generated output prose. Its byte count
21
+ is the metadata-only exception.
22
+ 2. Record source line and byte counts, and git history when available: first
23
+ addition, last edit, and edit count. Find incoming references before proposing
24
+ an archive. Resolve the shared agents output from the manifest and measure its
25
+ bytes, or reuse a fresh `CONTEXT:` summary. Mark missing or stale measurements;
26
+ do not regenerate output during analysis.
27
+ 3. Read and apply [references/audit-checks.md](references/audit-checks.md). Reuse
28
+ these generic checks in any project-specific audit. Check subtraction before
29
+ proposing a split or rewrite: remove an unnecessary artifact, merge overlapping
30
+ owners, or replace prose with an existing deterministic gate where possible.
31
+ 4. When the user asks to compact context, or the audit proposes a merge, move,
32
+ deletion, scoping change, or size reduction, read
33
+ [references/compaction.md](references/compaction.md) and its principles. Build
34
+ the behavior ledger and draft the structural reduction before wording changes.
35
+ Review must preserve complete language and the layer's behavioral contract.
36
+ 5. Present a punch-list: finding, target file, proposed action, concrete draft,
37
+ reason, and priority (1: duplication, misplaced or unnecessary artifacts;
38
+ 3: description or naming polish). Compaction items also show the authoritative
39
+ owner, behavior preserved, estimated byte savings, and any change to meaning,
40
+ scope, or loading. Surface unverified reasons without silently rewriting them.
41
+
42
+ ## Accepted changes
43
+
44
+ 6. The user accepts items individually; a batch acceptance may cover named items.
45
+ Pass accepted proposals to `/intelligence-update-context`, with the behavior
46
+ ledger and additional checks. Reuse existing approval for those exact changes.
47
+ If fresh rendered measurements are needed, capture them only after apply is
48
+ authorized and before editing; record `<sync-cmd> --compact` output and require
49
+ `IS_STATUS=ok`. The authoring skill performs the final batch sync and status check.
50
+ 7. Verify each accepted finding against the resulting sources. For reductions,
51
+ complete the ledger comparison, measurements, and behavioral evaluation in
52
+ the compaction reference. Report each artifact as pass, fixed (what), or
53
+ flagged (for whom), plus unresolved proposals. A read-only review ends with
54
+ the evidenced punch-list; an apply run ends only after its checks complete.
@@ -0,0 +1,56 @@
1
+ # Audit checks
2
+
3
+ Apply these checks to the source groups resolved by the review skill.
4
+
5
+ | Check | What it is | Proposed action |
6
+ |---|---|---|
7
+ | **Duplicate content** | Two artifacts cover overlapping scope, or their descriptions share trigger phrases | `MERGE` — present both, propose one |
8
+ | **Misplaced content** | A checklist or procedure in an agent body; a convention in an agent; a workflow in a rule; expertise in a skill (the *Pick the right artifact* table in `intelligence-authoring`) | `MOVE` — a move, not a rewrite: both files change together |
9
+ | **Over the cap** | `SKILL.md` over 1000 lines, rule over 500, agent over 200 | `SPLIT` — two artifacts, or move detail into `references/<topic>.md` |
10
+ | **Shared instruction budget** | The measured shared agents output, or `agents-md` in sync's `CONTEXT:` summary, is over 32 KiB (32,768 bytes) | `COMPACT` — this is Intelligence's recommended maximum, not an adapter rejection threshold; use the compaction procedure in `intelligence-review-context` to reduce the owning sources without teaching terse output |
11
+ | **Rule links to a rule** | A markdown link from one rule to another (`R1`) | `UNLINK` — name the rule instead: always-on rules are inlined into `AGENTS.md` and the scoped channels carry only scoped rules, so the link is dead in at least one output |
12
+ | **Machine facts in a rule** | OS, shell, editor or a local absolute path (`R2`) | `MOVE` — these belong in a personal, gitignored `CLAUDE.md`; a rule is committed and read by everyone, including whoever is on another platform |
13
+ | **Literal path or command in a skill** | A path *outside the skill's own folder* baked into a procedure (`R3`) | `PARAMETERIZE` — a skill is *executed*, so a literal path breaks the moment the layout moves; resolve it from a rule or from `<manifest>`. **Exempt:** the skill's own bundle (`references/`, `scripts/`, `assets/` — content is co-located with its skill by default); rules and agents (describing the repository is their job); an example inside an output-format block; the resolution step itself |
14
+ | **Skill with no verification** | Nothing at the end proves the procedure worked (`R4`) | `FLAG` — a procedure that proves nothing is a note, or just the work: give it a verification, or delete it |
15
+ | **Pressure marker** | A heading or section named CRITICAL / MANDATORY / HARD RULE / READ FIRST, or a density of `MUST` / `NEVER` / `ALWAYS` with no reason beside it (`R5`) | `REWRITE` - plain heading, one reason per constraint; when several instructions are each marked critical the marker stops carrying information, so keep emphasis for the one instruction demonstrably under-weighted without it |
16
+ | **History narrative** | A PR number, incident id, commit SHA, date or "this session" inside a rule body (`R6`) | `REWRITE` - keep the causal sentence, drop the archaeology; a rule's authority is the behaviour it prescribes, and git history keeps the date |
17
+ | **Reserved prefix** | A project artifact named `intelligence-*` | `RENAME` — the prefix belongs to the sync package and collides in generated output |
18
+ | **Naming** | A skill that is not `<domain>-<verb>-<noun>`, or a domain invented rather than reused | `RENAME` — or introduce the new domain deliberately |
19
+ | **Stale** | No edits in 6+ months and nothing cross-references it | `ARCHIVE` — move to `<content-dir>/_archive/` |
20
+ | **Negative-framed judgement call** | "Never do X" where a positive default fits, outside safety / security / output-format | `REWRITE` — state the default; reserve NEVER for true must-nots |
21
+ | **Unbacked reason** | A rule asserts a *why* — a number, a measurement, a tool's behaviour — that nothing in the repo or in that tool's documentation supports | `FLAG` — an invented reason is worse than none: it sounds like evidence. Surface it with a draft; never rewrite the meaning yourself |
22
+ | **Always-on rule that should be scoped** | A concern that only matters in one area, loaded into every session and inlined into `AGENTS.md` | `SCOPE` — add `paths:`, or justify the cost out loud |
23
+ | **Weak / duplicate description** | Identical to a sibling, or too vague to choose between them | `DIFFERENTIATE` — add the distinguishing trigger |
24
+ | **Description over budget** | Over ~250 characters (the shared registry budget); over **1024** the tools reject the artifact outright | `TRIM` — keep the distinguishing trigger, drop the rest |
25
+ | **Missing frontmatter field** | `name` or `description` absent | `PATCH` — add it |
26
+ | **Orphan rule** | Nothing points at it and nothing loads it | `FLAG` — intentional, or dead? |
27
+
28
+ Detection commands, portable on purpose — no `\b` and no `-P`, so the same command works in Git Bash on Windows, on macOS (BSD grep) and on Linux. Run each over the source directories resolved in step 2, never over generated output:
29
+
30
+ ```sh
31
+ # Shared instruction budget — resolve this output path from <manifest>
32
+ wc -c "<agents-output>"
33
+
34
+ # R1 — a markdown link from one rule to another
35
+ grep -rnE '\]\([^)]*\.md\)' <rule-dirs>
36
+
37
+ # R2 — machine facts in a rule (a shell, someone's home directory, a drive letter)
38
+ grep -rinE 'powershell|cmd\.exe|/Users/|/home/|[A-Za-z]:[\\]' <rule-dirs>
39
+
40
+ # R3 — a path baked into a skill's steps, excluding the skill's own bundle
41
+ grep -rnE --include=SKILL.md '[A-Za-z0-9._-]+/[A-Za-z0-9._/-]+\.[A-Za-z0-9]+' <skill-dirs> \
42
+ | grep -vE '(^|[^A-Za-z0-9._/-])(references|scripts|assets)/'
43
+
44
+ # R4 — skills whose body never mentions verifying anything (-L lists files with NO match)
45
+ grep -riLE --include=SKILL.md 'verif|expect|assert|check|test|IS_STATUS' <skill-dirs>
46
+
47
+ # R5 - pressure markers: a heading or label named for urgency, then absolute-language density per file
48
+ grep -rnE '^#+ .*(CRITICAL|MANDATORY|HARD RULE|READ FIRST)|\((CRITICAL|MANDATORY|HARD RULE)\)' <rule-dirs> <agent-dirs> <skill-dirs>
49
+ grep -rcE '(MUST|NEVER|ALWAYS)' <rule-dirs> <agent-dirs> <skill-dirs> | grep -vE ':0$'
50
+
51
+ # R6 - history narrative in a rule body: PR numbers, incident ids, dates, "this session", commit SHAs
52
+ grep -rniE -e '(#|PR )[0-9]{3,}' -e '[0-9]{4}-[0-9]{2}-[0-9]{2}' -e 'this session|origin session' \
53
+ -e '`[0-9a-f]{7,40}`' <rule-dirs>
54
+ ```
55
+
56
+ `R4` is a coarse net, not a verdict: a skill that merely *mentions* a verification command anywhere passes it. Read the final step of every skill regardless — the question is whether something at the end **proves the work landed**, not whether the word appears. So are `R5` and `R6`: a `NEVER` that carries its reason and a date inside a frontmatter template are both legitimate hits, and the row's action applies only where the marker or the id is doing no work.
@@ -0,0 +1,57 @@
1
+ # Preserve behavior while compacting
2
+
3
+ Read [principles.md](principles.md) when preparing a structural or size reduction.
4
+ The review skill supplies the source inventory, audit findings, and baseline counts.
5
+
6
+ ## Behavior ledger
7
+
8
+ Before drafting, record each candidate's behavior, constraint, procedure, or
9
+ expertise; its authoritative owner; when it loads; the reason or example needed
10
+ to apply it; and the repository evidence or documentation supporting it. Similar
11
+ words with different scope, priority, or failure behavior are not duplicates.
12
+
13
+ ## Draft in this order
14
+
15
+ 1. Replace instructions with deterministic commands or gates the repository
16
+ already enforces where they cover the same behavior.
17
+ 2. Delete generic knowledge and directly readable facts unless their non-obvious
18
+ interpretation is the instruction.
19
+ 3. Keep one owner of duplicated guidance. Call skills by name without repeating
20
+ their procedure; let agents bind skills without copying their steps.
21
+ 4. Scope narrow rules with `paths:`. Move procedures to skills, constraints to
22
+ rules, and reusable expertise to agents.
23
+ 5. Move optional detail to skill-local references with exact read conditions.
24
+ An unconditional import spends the same context. A plain link is navigation,
25
+ not guaranteed loading; keep critical constraints in the executable core.
26
+ Large always-on rules need subtraction, scoping, or a gate, not a reference index.
27
+ 6. Tighten prose only after structural reductions. Keep complete sentences,
28
+ ordinary vocabulary, reasons that guide judgment, and one clarifying example.
29
+
30
+ Preserve triggers, boundaries, ordering, failure behavior, verification, and output
31
+ contracts. Keep descriptions distinguishable. Do not teach terse, abbreviated,
32
+ clipped, or vague responses, introduce dense acronyms or unexplained labels, or
33
+ remove grammar to reduce bytes. Response style changes require their own explicit
34
+ product requirement.
35
+
36
+ Proposals use `DELETE`, `MERGE`, `SCOPE`, `MOVE`, `REFERENCE`, or `REWRITE` and name
37
+ the owner, semantic contract, estimated savings, and any changed behavior or load
38
+ timing. Keep unapproved passages byte-for-byte; the review skill routes only
39
+ accepted proposals to the shared authoring procedure.
40
+
41
+ ## Verify the accepted result
42
+
43
+ 1. Compare the ledger with the diff. Each original behavior exists once in its
44
+ authoritative owner, was deliberately removed with approval, or is enforced by
45
+ the named deterministic mechanism. Check for dead links, unconditional reference
46
+ loads, conflicting instructions, and unintended scope expansion.
47
+ 2. After the authoring skill's successful sync and `intelligence status --check`,
48
+ compare source line and byte counts and rendered `agents-md` bytes with the
49
+ baseline. Reuse its `CONTEXT:` output; do not run a duplicate sync. Report bytes
50
+ and percentages for always-on and on-demand context separately. Label estimates
51
+ or unavailable baselines rather than reporting them as measured savings.
52
+ 3. When behavioral evaluation is available, exercise three prompts: a direct case
53
+ governed by the changed instruction, an adjacent judgment needing its reason,
54
+ and an ordinary explanation that reveals clipped language. Report explicitly
55
+ when this evaluation is unavailable: fewer bytes prove size, not quality.
56
+ 4. Report artifacts changed, behavior checks, measurements, and remaining owner
57
+ decisions. Return these results to the review skill's final report.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: intelligence-update-context
3
+ description: "Create, revise, or remove project rules, agents, and skills"
4
+ argument-hint: "[rule|agent|skill] [request or accepted proposals]"
5
+ agent: intelligence-architect
6
+ ---
7
+
8
+ # Update project context
9
+
10
+ Own the authoring procedure for rules, agents, and skills. A direct request,
11
+ accepted session lesson, repository-onboarding proposal, or review finding enters
12
+ the same procedure. Updating the layer can create a new artifact.
13
+
14
+ ## Resolve and draft
15
+
16
+ 1. Read `<manifest>` and resolve its `sources.rules`, `sources.agents`, and
17
+ `sources.skills` directories. `<content-dir>` names the project's content
18
+ directory; `<module>` is installed package content. Read the
19
+ `intelligence-authoring` rule and `<module>/references/conventions.md`.
20
+ Edit project-owned sources, never installed packages or generated output.
21
+ When working in a package's own repository, use its authoritative source tree.
22
+
23
+ 2. Inspect existing artifacts, including configured package sources, for overlap.
24
+ Prefer extending an existing owner, merging duplicates, or enforcing a
25
+ convention mechanically. Resolve the writable directory from the manifest;
26
+ create a pre-listed missing directory without changing the source list. Add a
27
+ source entry only when an accepted destination is outside the listed groups.
28
+
29
+ 3. Establish the evidence and artifact type. A constraint is a rule, a repeatable
30
+ procedure is a skill, and a persona or expertise boundary is an agent. Verify
31
+ repository claims in code or executable configuration. An accepted session
32
+ preference is evidence of the user's intent; an observed workflow supplies its
33
+ working steps. Preserve that evidence rather than inventing repository precedent.
34
+
35
+ 4. Reuse the existing domain vocabulary. If none fits, derive it from the project
36
+ name or component: for example `backend`, `frontend`, `devops`, `core`, or
37
+ `tests`. Project artifacts do not use the package-reserved `intelligence-`
38
+ prefix. Resolve an unclear scope before writing. Read only the relevant
39
+ artifact reference, for both new content and changes to existing content:
40
+ - Rule: [references/rules.md](references/rules.md).
41
+ - Agent: [references/agents.md](references/agents.md).
42
+ - Skill: [references/skills.md](references/skills.md).
43
+
44
+ 5. Draft the smallest change with its action, source path, evidence, and reason.
45
+ Supported actions include `CREATE`, `UPDATE`, `REMOVE` (`DELETE` in a review), `ARCHIVE`, `MERGE`,
46
+ `MOVE`, `SCOPE`, `REFERENCE`, and `REWRITE`. Preserve an upstream proposal's
47
+ behavior checklist, approval scope, and verification requirements. Present
48
+ changes to meaning, ownership, scope, or load timing that the user has not
49
+ already authorized. Accepted proposals do not need a second approval round.
50
+
51
+ ## Apply and verify
52
+
53
+ 6. Apply the authorized changes and update every affected invocation, link, and
54
+ agent binding. Archive to the project content directory's `_archive/` when
55
+ requested; remove only the accepted sources. For a move or merge, retain each
56
+ behavior once in its new owner. Preserve unapproved passages byte-for-byte.
57
+
58
+ 7. Check the relevant artifact reference, frontmatter, configured source coverage,
59
+ and all changed cross-references. Confirm the intended triggers, boundaries,
60
+ ordering, failure handling, and verification survived. Run tests for bundled
61
+ helpers or changed executable behavior using the project's verification gate.
62
+
63
+ 8. Run `/intelligence-sync` once after the complete batch, require `IS_STATUS=ok`,
64
+ then run `intelligence status --check`. Verify that each enabled target received
65
+ the intended artifacts and resources and that removed names are absent. When
66
+ called by onboarding, defer this batch's sync to its final migration check so
67
+ the accepted manifest header and content are verified together.
68
+
69
+ 9. Report the created, updated, removed, or archived artifacts and their checks.
70
+ Return control to the originating workflow for its additional semantic,
71
+ compaction, migration, or packaging verification; those checks remain required.
@@ -0,0 +1,31 @@
1
+ # Author an agent
2
+
3
+ 1. Reuse an agent covering the domain when possible. Name a new one
4
+ `<domain>-<role>` and determine its expertise from the source evidence.
5
+ 2. Select tier and access: implementation normally uses `heavy` and `full`;
6
+ review or validation uses `standard` and `readonly`; simple lookup uses
7
+ `light` and `readonly`. Check the target's actual permission mapping when
8
+ external read tools are required. If native read-only restrictions exclude
9
+ those tools, use `full` only with a clear read-only boundary in the body.
10
+ 3. Keep the body thin: Expertise, Boundaries, and Build & Verify. Carry its own
11
+ completion criteria and limitations. Reference constraints by name instead
12
+ of copying rules, and put reusable procedures in skills.
13
+ 4. Find relevant existing skills across the configured sources and link them in
14
+ `skills:`. Do not create a sibling skill or agent merely to fill a binding.
15
+
16
+ ```yaml
17
+ ---
18
+ name: <domain>-<role>
19
+ description: "When to use this agent"
20
+ tier: heavy
21
+ access: full
22
+ skills:
23
+ - <existing-skill>
24
+ ---
25
+ ```
26
+
27
+ Quote free-text YAML strings and escape embedded quotes; malformed scalars can
28
+ prevent discovery. Verify every skill binding resolves, the tier and access use
29
+ the supported vocabulary, and the body defines a role rather than a checklist.
30
+ Apply the agent size and description limits from the authoring conventions,
31
+ then return to the shared sync and verification steps.
@@ -0,0 +1,31 @@
1
+ # Author a rule
2
+
3
+ 1. Reuse an existing rule covering the scope. A new filename matches its domain,
4
+ such as `backend.md`, a named component, or `context.md` for global context.
5
+ 2. Choose `paths:` when the guidance applies to particular files. Omit it only
6
+ for intentionally project-wide guidance; a missing argument alone is not
7
+ evidence that every task needs the rule.
8
+ 3. Extract required patterns, invariants, architecture, relevant build commands,
9
+ and examples from the evidence. State judgment calls as positive defaults;
10
+ reserve absolute constraints for safety, security, and output contracts.
11
+ Pair a useful anti-pattern with its positive replacement.
12
+ 4. Write only the sections the evidence needs: Required patterns, Invariants,
13
+ Architecture, Build and test, Examples, and Patterns to recognize and replace.
14
+ Keep reasons that guide judgment and reference real examples. An accepted
15
+ user preference is identified as a preference, not a claim about existing code.
16
+
17
+ For a scoped rule:
18
+
19
+ ```yaml
20
+ ---
21
+ description: "Conventions for the named component"
22
+ paths:
23
+ - "<scope-glob>"
24
+ ---
25
+ ```
26
+
27
+ Verify that the globs match the intended files, each constraint has evidence,
28
+ and procedures have a skill owner. Name always-on rules rather than linking to
29
+ their source paths: their bodies are inlined in shared output. Apply the rule
30
+ size and description limits from the authoring conventions, then return to the
31
+ shared sync and verification steps.
@@ -0,0 +1,34 @@
1
+ # Author a skill
2
+
3
+ 1. Name it `<domain>-<verb>-<noun>`. Reuse established verbs: `add` adds a member,
4
+ `create` creates a container, `update` revises existing state, `run` executes
5
+ an operation, and `review` analyzes it. Preserve a distinct, discoverable task.
6
+ 2. Reuse an existing skill when its trigger and responsibility fit. For a new
7
+ skill, find a matching agent across configured sources. Bind it when useful;
8
+ if a new specialist is warranted, include that agent in the authoring proposal.
9
+ A skill can stand alone when no specialist is needed.
10
+ 3. Write concrete ordered steps from repository evidence or an observed workflow.
11
+ Keep decisions, failure handling, and a final proof of completion. A step
12
+ calling another skill names it and passes its inputs instead of copying it.
13
+ 4. Bundle helpers, templates, and optional detail beside `SKILL.md`. Require each
14
+ reference only for the condition that needs it. Resolve movable project paths
15
+ and commands from the manifest or project profile. Test executable helpers.
16
+ 5. Quote free-text YAML values, including descriptions and argument hints. Escape
17
+ embedded quotes or use a compatible quoted scalar. Keep `name` equal to the
18
+ directory name and make the description distinguish its trigger.
19
+
20
+ ```yaml
21
+ ---
22
+ name: <domain>-<verb>-<noun>
23
+ description: "What the skill does and when to use it"
24
+ argument-hint: "Expected arguments"
25
+ agent: <existing-agent>
26
+ ---
27
+ ```
28
+
29
+ Omit optional fields that do not apply. Add the skill to its matching agent's
30
+ `skills:` list when that agent is project-owned; propose an upstream change for
31
+ a package-owned agent instead of editing the installed copy. Verify bindings,
32
+ relative resource links, executable steps, and final success criteria. Apply the
33
+ 1000-line skill limit and other budgets from the authoring conventions, then
34
+ return to the shared sync and verification steps.
@@ -1,11 +1,11 @@
1
1
  ---
2
- name: intelligence-update
3
- description: "Interpret an update plan and verify breaking post-conditions"
2
+ name: intelligence-upgrade
3
+ description: "Upgrade Intelligence and installed packages with migration checks"
4
4
  argument-hint: "[@scope/name]"
5
5
  agent: intelligence-operator
6
6
  ---
7
7
 
8
- # Update intelligence
8
+ # Upgrade Intelligence and packages
9
9
 
10
10
  The CLI owns planning and application. This skill interprets the plan, reads
11
11
  the changelog across an engine-version gap, obtains approval, and verifies the
@@ -1,62 +0,0 @@
1
- ---
2
- name: intelligence-add-agent
3
- description: "Create new specialized agent"
4
- argument-hint: <domain> [description]
5
- ---
6
-
7
- # Add Agent
8
-
9
- ## Steps
10
-
11
- 1. **Determine domain prefix** (the scope is required):
12
- - **Reuse the existing domain when one fits**: list `<content-dir>/agents/` and `<content-dir>/skills/`. If a domain prefix is already established for the target area (`backend-`, `frontend-`, `devops-`), use it. Introduce a new domain only when the scope is materially different from all existing ones.
13
- - **When no existing domain fits**, derive from repo structure:
14
- - Single / root project → use the project codename from `<manifest>` → `project.name`
15
- - Backend service / API component → `backend-`
16
- - Frontend / web / UI component → `frontend-`
17
- - Infrastructure, IaC, CI/CD, deployment → `devops-`
18
- - Shared library / common / cross-cutting code → `core-`
19
- - Test suites (e2e, integration) → `tests-`
20
- - Tool-internal (intelligence-sync itself) → `intelligence-` (only inside the intelligence-sync repo — downstream projects must not use this prefix)
21
- - If the repo is a monorepo with named components (e.g., `apps/billing`, `services/auth`), prefer the component name as the domain (`billing-`, `auth-`).
22
- - **Every agent needs a domain prefix.** If the scope is unclear, ask the user before proceeding.
23
-
24
- 2. **Check existing agents**: Read `<content-dir>/agents/` to avoid duplicates. If an agent for this domain exists, ask user whether to update it instead.
25
-
26
- 3. **Determine tier and access**:
27
- - Developer agents: `tier: heavy`, `access: full`
28
- - Reviewer/validator agents: `tier: standard`, `access: readonly`
29
- - Simple lookup agents: `tier: light`, `access: readonly`
30
- - Caveat: `readonly`'s closed tools list also removes MCP and tool-search access. A reviewer
31
- that needs MCP reads takes `access: full` with a read-only boundary stated in its body.
32
-
33
- 4. **Analyze codebase**: Read source files in the domain's directory to determine:
34
- - Technology stack and frameworks
35
- - Architecture patterns
36
- - Build and test commands
37
- - Key conventions and forbidden patterns
38
-
39
- 5. **Create agent**: Write `<content-dir>/agents/<domain>-<role>.md` (create the directory if missing) with frontmatter:
40
- ```yaml
41
- ---
42
- name: <domain>-<role>
43
- description: "<when to use this agent - IDEs use this to suggest the agent>"
44
- tier: heavy|standard|light
45
- access: full|readonly
46
- skills:
47
- - <existing-skills-for-this-domain>
48
- ---
49
- ```
50
-
51
- **YAML safety (required):** **always wrap `description` (and any other free-text string field) in double quotes**, regardless of content. Codex CLI uses strict YAML — an unquoted colon, leading hyphen, or word that parses as boolean (`yes`, `no`, `true`) silently breaks the agent. Quoting unconditionally prevents the entire class of bug. If the value itself contains a double quote, escape it as `\"` or wrap it in single quotes so an inner quote does not terminate the scalar early.
52
-
53
- 6. **Write body** with sections: **Expertise** -> **Boundaries** -> **Build & Verify**
54
- - An agent is **thin**: who it is, where it stops, how it verifies. Everything else already reaches it.
55
- - **Do not tell the agent to read the rules.** Rules load on their own: Claude Code loads `.claude/rules/` into every custom subagent's startup context alongside `CLAUDE.md` (*Subagents → What loads at startup*), and Cursor / Copilot / Codex / Pi / opencode / Antigravity receive always-on rules inlined in `AGENTS.md`. A `Read <content-dir>/rules/<domain>.md before starting` line duplicates content the agent already has — double the tokens, and a second copy that drifts from the rule it copied.
56
- - **Point at a rule, never restate it.** If you want to copy a rule into the agent, the rule is in the wrong place — move it, do not clone it.
57
- - **Do carry** what is genuinely the agent's own: its boundaries ("if the app is not running, stop — do not hand-write the output"), its verification commands, its definition of done.
58
- - All content must come from actual codebase analysis.
59
-
60
- 7. **Link existing skills**: Find skills in `<content-dir>/skills/` matching this domain prefix and add them to the agent's `skills:` frontmatter.
61
-
62
- 8. **Run `/intelligence-sync`** to distribute to all enabled IDE targets.
@@ -1,54 +0,0 @@
1
- ---
2
- name: intelligence-add-rule
3
- description: "Create new intelligence rule"
4
- argument-hint: <name> [paths-glob]
5
- ---
6
-
7
- # Add Rule
8
-
9
- ## Steps
10
-
11
- 1. **Determine rule name from domain** (the scope is required):
12
- - **Reuse the existing domain when one fits**: list `<content-dir>/rules/`. If a rule file covers the target area (e.g., `backend.md`, `frontend.md`), extend it. Introduce a new domain only when the scope is materially different from all existing rules.
13
- - **When no existing rule fits**, derive the filename from repo structure:
14
- - Single / root project → use the project codename from `<manifest>` → `project.name` (e.g., `<codename>.md`)
15
- - Backend service / API component → `backend.md`
16
- - Frontend / web / UI component → `frontend.md`
17
- - Infrastructure, IaC, CI/CD, deployment → `devops.md`
18
- - Shared library / common / cross-cutting code → `core.md`
19
- - Test suites (e2e, integration) → `tests.md`
20
- - Always-loaded global context → `context.md`
21
- - If the repo is a monorepo with named components (e.g., `apps/billing`, `services/auth`), prefer the component name as the rule name (`billing.md`, `auth.md`).
22
- - **Rule filenames match the domain used by skills/agents.** If the scope is unclear, ask the user before proceeding.
23
-
24
- 2. **Check existing rules**: Read `<content-dir>/rules/` to detect overlapping scope — favor extending an existing rule over creating a new one.
25
-
26
- 3. **Determine scope**:
27
- - If paths glob provided — scoped rule with `paths:` frontmatter
28
- - If no paths — always-loaded rule (no `paths:` in frontmatter)
29
-
30
- 4. **Analyze codebase**: Read source files matching the scope to extract:
31
- - REQUIRED patterns (conventions consistently followed across the codebase — judgment calls expressed as positive defaults)
32
- - Invariants (true must-nots — safety, output format, security; not judgment calls)
33
- - Architecture patterns (layer dependencies, module structure)
34
- - Build and test commands specific to this scope
35
- - Anti-patterns observed in code, each paired with the positive replacement that should adopt instead
36
-
37
- 5. **Create rule**: Write `<content-dir>/rules/<name>.md` (create the directory if it does not exist — the sources list already covers it):
38
- ```yaml
39
- ---
40
- paths:
41
- - "<glob-pattern>"
42
- ---
43
- ```
44
-
45
- 6. **Write body** with sections: **REQUIRED** → **Invariants** → **Architecture** → **Build & Test** → **Examples** → **Patterns to recognize and replace** (optional)
46
- - Lead with REQUIRED (positive defaults) — the LLM follows the positive instruction first
47
- - Reserve **Invariants** for true must-nots — security, safety, output format. Use absolute language (MUST / NEVER) only here, never for judgment calls
48
- - **Patterns to recognize and replace** is reference documentation of anti-patterns paired with positive replacements — readers recognize the pattern, apply the replacement
49
- - Examples come from the actual codebase — reference real files
50
- - Every REQUIRED / Invariant / Pattern is backed by observed code
51
-
52
- 7. **Update `<manifest>` only when needed**: add the path to `sources.rules` only if the rule lives in a directory not already listed there — creating a pre-listed directory is enough.
53
-
54
- 8. **Run `/intelligence-sync`** to distribute to all enabled IDE targets.
@@ -1,53 +0,0 @@
1
- ---
2
- name: intelligence-add-skill
3
- description: "Create new skill"
4
- argument-hint: <domain> <verb-noun> [description]
5
- ---
6
-
7
- # Add Skill
8
-
9
- ## Steps
10
-
11
- 1. **Determine domain prefix** (the scope is required):
12
- - **Reuse the existing domain when one fits**: list `<content-dir>/skills/` and `<content-dir>/agents/`. If a domain prefix is already established for the target area (`backend-`, `frontend-`, `devops-`), use it. Introduce a new domain only when the scope is materially different from all existing ones.
13
- - **When no existing domain fits**, derive from repo structure:
14
- - Single / root project → use the project codename from `<manifest>` → `project.name`
15
- - Backend service / API component → `backend-`
16
- - Frontend / web / UI component → `frontend-`
17
- - Infrastructure, IaC, CI/CD, deployment → `devops-`
18
- - Shared library / common / cross-cutting code → `core-`
19
- - Test suites (e2e, integration) → `tests-`
20
- - Tool-internal (intelligence-sync itself) → `intelligence-` (only inside the intelligence-sync repo — downstream projects must not use this prefix)
21
- - If the repo is a monorepo with named components (e.g., `apps/billing`, `services/auth`), prefer the component name as the domain (`billing-`, `auth-`).
22
- - **Every skill needs a domain prefix.** If the scope is unclear, ask the user before proceeding.
23
-
24
- 2. **Determine naming**: Build full name as `<domain>-<verb>-<noun>` using convention:
25
- - `add-` — adds one new member to a set that already exists (a field on an existing type, a record among records)
26
- - `create-` — brings into existence the container nothing hosted before (MUST use `create-`, never `add-`)
27
- - `update-` — revises what is already there
28
- - `run-` — executes an operation (tests, build, sync)
29
- - `review-` — read-only analysis
30
-
31
- 3. **Check for existing agent**: Find an agent in `<content-dir>/agents/` matching the domain
32
- - If found — this skill will be linked to that agent
33
- - If not — ask user whether to create a new agent via `/intelligence-add-agent` first
34
-
35
- 4. **Analyze codebase patterns**: Read existing implementations to extract the repeatable steps this skill should automate. Each step must come from actual code patterns, not generic knowledge.
36
-
37
- 5. **Create skill**: Write `<content-dir>/skills/<full-name>/SKILL.md` (create the directory if missing — no config edit needed) with frontmatter:
38
- ```yaml
39
- ---
40
- name: <full-name>
41
- description: "<what it does and when to use>"
42
- argument-hint: "<expected arguments>"
43
- agent: <matching-agent-name>
44
- ---
45
- ```
46
-
47
- **YAML safety (required):** **always wrap `description`, `argument-hint` and any other free-text string value in double quotes**, regardless of content. Codex CLI uses strict YAML — an unquoted colon in `description: Build retrospective: monthly` parses as a nested mapping and the skill is rejected at startup. Quoting unconditionally removes the whole class of bug and makes lint trivial. If the value itself contains a double quote, escape it as `\"` or wrap the whole value in single quotes — e.g. `description: 'Use as a quick "what do we have" view'` — so an inner quote does not terminate the scalar early.
48
-
49
- 6. **Write steps**: Numbered, concrete, executable. Include verification (build/test) at the end. A step that dispatches to another skill names it and never restates its content.
50
-
51
- 7. **Update agent**: Add skill name to the `skills:` list in the matching agent's frontmatter.
52
-
53
- 8. **Run `/intelligence-sync`** to distribute to all enabled IDE targets.