@ainova-systems/intelligence 0.14.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 (29) hide show
  1. package/engine/ENGINE_SHA +1 -1
  2. package/engine/VERSION +1 -1
  3. package/engine/lib/contract.sh +1 -1
  4. package/package.json +1 -1
  5. package/packages/sync/agents/intelligence-architect.md +8 -14
  6. package/packages/sync/agents/intelligence-operator.md +3 -4
  7. package/packages/sync/references/conventions.md +1 -1
  8. package/packages/sync/rules/intelligence-authoring.md +1 -1
  9. package/packages/sync/skills/intelligence-learn-from-repository/SKILL.md +6 -7
  10. package/packages/sync/skills/intelligence-learn-from-session/SKILL.md +50 -0
  11. package/packages/sync/skills/intelligence-manage-adapters/SKILL.md +45 -0
  12. package/packages/sync/skills/intelligence-review-context/SKILL.md +54 -0
  13. package/packages/sync/skills/intelligence-review-context/references/audit-checks.md +56 -0
  14. package/packages/sync/skills/intelligence-review-context/references/compaction.md +57 -0
  15. package/packages/sync/skills/intelligence-update-context/SKILL.md +71 -0
  16. package/packages/sync/skills/intelligence-update-context/references/agents.md +31 -0
  17. package/packages/sync/skills/intelligence-update-context/references/rules.md +31 -0
  18. package/packages/sync/skills/intelligence-update-context/references/skills.md +34 -0
  19. package/packages/sync/skills/{intelligence-update → intelligence-upgrade}/SKILL.md +3 -3
  20. package/packages/sync/skills/intelligence-add-agent/SKILL.md +0 -62
  21. package/packages/sync/skills/intelligence-add-rule/SKILL.md +0 -54
  22. package/packages/sync/skills/intelligence-add-skill/SKILL.md +0 -53
  23. package/packages/sync/skills/intelligence-compact-context/SKILL.md +0 -118
  24. package/packages/sync/skills/intelligence-extract-skill/SKILL.md +0 -47
  25. package/packages/sync/skills/intelligence-install-adapter/SKILL.md +0 -45
  26. package/packages/sync/skills/intelligence-learn-from-context/SKILL.md +0 -88
  27. package/packages/sync/skills/intelligence-review-skills/SKILL.md +0 -101
  28. package/packages/sync/skills/intelligence-uninstall-adapter/SKILL.md +0 -24
  29. /package/packages/sync/skills/{intelligence-compact-context → intelligence-review-context}/references/principles.md +0 -0
package/engine/ENGINE_SHA CHANGED
@@ -1 +1 @@
1
- a9cf448bc3f2944c988ce57581822df081195ca2
1
+ b12551947be83587f4f74e79c5a56765a18dd52f
package/engine/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.0
1
+ 0.15.0
@@ -53,7 +53,7 @@ stamp_schema_version() {
53
53
  # --- bash ↔ skill status contract -------------------------------------------
54
54
  # Bash is the deterministic, fail-closed core: it never guesses. Any state it
55
55
  # cannot resolve safely is reported as a machine-readable status line on
56
- # stdout plus a stable exit code, and the intelligence-update SKILL (the
56
+ # stdout plus a stable exit code, and the intelligence-upgrade SKILL (the
57
57
  # intelligent layer) decides what to do. Codes are part of the public
58
58
  # contract — do not renumber.
59
59
  IS_RC_OK=0 # success (synced / migrated / nothing to do)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainova-systems/intelligence",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
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"
@@ -4,14 +4,10 @@ description: "Design and prune the intelligence layer - rule vs skill vs agent,
4
4
  tier: heavy
5
5
  access: full
6
6
  skills:
7
- - intelligence-add-rule
8
- - intelligence-add-agent
9
- - intelligence-add-skill
10
- - intelligence-extract-skill
11
- - intelligence-compact-context
12
- - intelligence-review-skills
7
+ - intelligence-update-context
8
+ - intelligence-review-context
13
9
  - intelligence-learn-from-repository
14
- - intelligence-learn-from-context
10
+ - intelligence-learn-from-session
15
11
  ---
16
12
 
17
13
  # Intelligence architect
@@ -44,14 +40,12 @@ The per-artifact checks are procedure, so they live in the meta-skills rather th
44
40
 
45
41
  | Skill | Use it to |
46
42
  |---|---|
47
- | `intelligence-add-rule` / `intelligence-add-agent` / `intelligence-add-skill` | author one artifact |
48
- | `intelligence-extract-skill` | turn an observed workflow into a skill |
49
- | `intelligence-compact-context` | reduce context without changing behavior or teaching terse output |
50
- | `intelligence-review-skills` | audit the layer for duplication, drift, size, hardcoded paths |
43
+ | `intelligence-update-context` | create, revise, or remove rules, agents, and skills |
44
+ | `intelligence-review-context` | audit the layer and propose reductions that preserve behavior |
51
45
  | `intelligence-learn-from-repository` | recover and complete first-time repository onboarding |
52
- | `intelligence-learn-from-context` | fold one later session lesson into an established layer |
46
+ | `intelligence-learn-from-session` | capture session lessons and observed workflows |
53
47
  | `intelligence-sync` | project the source to every tool channel |
54
- | `intelligence-update` | interpret and apply the CLI's unified update plan |
55
- | `intelligence-install-adapter` / `intelligence-uninstall-adapter` | research and manage a tool adapter |
48
+ | `intelligence-upgrade` | interpret and apply the CLI's unified update plan |
49
+ | `intelligence-manage-adapters` | enable, disable, remove, and assess output cleanup |
56
50
 
57
51
  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.
@@ -5,9 +5,8 @@ tier: standard
5
5
  access: full
6
6
  skills:
7
7
  - intelligence-sync
8
- - intelligence-update
9
- - intelligence-install-adapter
10
- - intelligence-uninstall-adapter
8
+ - intelligence-upgrade
9
+ - intelligence-manage-adapters
11
10
  ---
12
11
 
13
12
  # Intelligence operator
@@ -27,7 +26,7 @@ the operation in prose.
27
26
  ## Boundaries
28
27
 
29
28
  - **Every flow goes through its skill.** The steps and their guards live in `intelligence-sync`,
30
- `intelligence-update`, `intelligence-install-adapter` and `intelligence-uninstall-adapter`;
29
+ `intelligence-upgrade` and `intelligence-manage-adapters`;
31
30
  improvising around them produces an unverified version of the same work.
32
31
  - **Operating is not authoring.** A change to what an artifact says - a rule body, an agent persona,
33
32
  a skill's steps - belongs to `intelligence-architect` and the authoring meta-skills. This agent
@@ -422,7 +422,7 @@ The public lifecycle is deliberately compact:
422
422
 
423
423
  Implement Intelligence schema changes as idempotent structural checks. Stage and verify replacement state before deleting or replacing prior state. A stale engine refuses a manifest whose `schema_version` is a newer major; a newer minor or patch within the same major warns once and proceeds without restamping the project. Normal project entry points close a behind-project gap through lifecycle preflight.
424
424
 
425
- Breaking changelog entries use a `### Breaking` checklist of verifiable post-conditions. The update skill reads every release across the version gap, chooses the package/CLI/project command sequence and verifies those conditions after the deterministic command completes.
425
+ Breaking changelog entries use a `### Breaking` checklist of verifiable post-conditions. The `intelligence-upgrade` skill reads every release across the version gap, chooses the package/CLI/project command sequence and verifies those conditions after the deterministic command completes.
426
426
 
427
427
  ### Engine status contract
428
428
 
@@ -109,6 +109,6 @@ The goal is subtraction, above. These are only the line past which something is
109
109
 
110
110
  ## Verifying a change to this layer
111
111
 
112
- The per-artifact checks are a procedure, not a constraint to hold in mind while doing other work — so they live in the meta-skills, not here. Invoke the one that matches what you are doing: `intelligence-add-rule`, `intelligence-add-agent`, `intelligence-add-skill`, `intelligence-extract-skill`, `intelligence-review-skills`, `intelligence-learn-from-repository`, `intelligence-learn-from-context`, `intelligence-sync`, `intelligence-update`, `intelligence-install-adapter`, `intelligence-uninstall-adapter`.
112
+ The per-artifact authoring checks belong to `intelligence-update-context`. Session learning, repository onboarding, and accepted review findings use that same procedure. Invoke `intelligence-learn-from-session` to capture a lesson or workflow, `intelligence-learn-from-repository` for initial migration and recovery, and `intelligence-review-context` for audits and reductions. Operational work uses `intelligence-sync`, `intelligence-upgrade`, or `intelligence-manage-adapters`.
113
113
 
114
114
  A change to this layer is done when `<sync-cmd>` reports `IS_STATUS=ok` and the skill you invoked reports clean.
@@ -39,8 +39,7 @@ mechanics; this skill supplies repository judgement.
39
39
 
40
40
  5. Read `<manifest>` and resolve the configured source directories. Load
41
41
  `<module>/references/conventions.md` and the bundled
42
- `intelligence-add-rule`, `intelligence-add-skill`, and
43
- `intelligence-add-agent` skills before proposing authored content. When
42
+ `intelligence-update-context` skill before proposing authored content. When
44
43
  preserved or legacy instructions exist, also read
45
44
  `<module>/references/onboarding-migration.md` and use its inventory,
46
45
  reverse-mapping, packaging-safety, and stale-reference procedures.
@@ -87,10 +86,10 @@ explains itself well.
87
86
 
88
87
  ## Apply after approval
89
88
 
90
- 9. Apply only accepted proposals. Delegate new artifacts to
91
- `intelligence-add-rule`, `intelligence-add-skill`, or
92
- `intelligence-add-agent`; update an existing project-owned artifact directly
93
- when smaller, and edit an accepted manifest header directly. Never edit
89
+ 9. Apply only accepted proposals. Pass all artifact changes to
90
+ `intelligence-update-context`, retaining the migration evidence and acceptance
91
+ scope. Defer its batch sync to step 10 so the accepted manifest header and
92
+ content are verified together. Edit an accepted header directly. Never edit
94
93
  installed package content or generated tool output.
95
94
  10. Run `intelligence sync`, then `intelligence status --check`. Inspect the
96
95
  relevant generated `AGENTS.md`, Cursor rules, Claude rules, and any
@@ -106,6 +105,6 @@ explains itself well.
106
105
 
107
106
  ## Later learning
108
107
 
109
- After onboarding is complete, use `/intelligence-learn-from-context` to capture
108
+ After onboarding is complete, use `/intelligence-learn-from-session` to capture
110
109
  a durable lesson from a working session. It does not repeat repository
111
110
  onboarding.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: intelligence-learn-from-session
3
+ description: "Capture session lessons and workflows in project context"
4
+ agent: intelligence-architect
5
+ ---
6
+
7
+ # Learn from a session
8
+
9
+ Capture a durable preference, working pattern, recurring friction, or successful
10
+ workflow from a session in an established Intelligence project. This skill owns
11
+ identifying and generalizing the lesson; `intelligence-update-context` owns writing it.
12
+
13
+ ## Verify readiness
14
+
15
+ 1. Locate `<manifest>`, `<content-dir>`, and `<module>`, then run
16
+ `intelligence status --check`. Missing or inconsistent setup, an onboarding
17
+ pending header, or unresolved preserved instructions routes to
18
+ `/intelligence-learn-from-repository` for repair and migration. Stop session
19
+ capture until onboarding is complete. A retained backup manifest or converted
20
+ legacy config alone does not mean onboarding is incomplete.
21
+
22
+ ## Analyze and propose
23
+
24
+ 2. Identify the lesson from the conversation or explicit user input. For a
25
+ workflow, list the actual steps performed, user decisions, branches, failure
26
+ recovery, and verification. Retain the sequence that worked.
27
+ 3. Generalize the evidence by removing instance-specific filenames, dates, and
28
+ phrasing. Keep the reason needed to apply the lesson to the next task. Prefer
29
+ a positive instruction such as "Default to one recommendation" for "Stop
30
+ generating three options". Preserve safety prohibitions; confirm a translation
31
+ if changing the negation changes meaning. Keep a negative example only when
32
+ paired with its replacement and useful for recognizing the pattern.
33
+ 4. Inspect configured sources for an existing owner. A preference or constraint
34
+ belongs in a rule, path-specific context in a scoped rule, an observed
35
+ repeatable procedure in a skill, and a persona or expertise boundary in an
36
+ agent. Prefer extending an existing artifact over adding a sibling.
37
+ 5. Present each proposal with its action (`CREATE`, `UPDATE`, or `ARCHIVE`),
38
+ source path, concrete draft, and one-line reason. This phase is read-only;
39
+ only user-accepted lessons become persistent instructions. Reuse approval
40
+ already given for the exact proposal.
41
+
42
+ ## Apply and verify
43
+
44
+ 6. Pass accepted proposals and their session evidence to
45
+ `/intelligence-update-context`. It handles artifact-specific authoring,
46
+ references, a single batch sync, and the final status check.
47
+ 7. Compare the resulting source changes with the accepted lesson. For a workflow,
48
+ verify that its decisions, working steps, recovery, and proof of completion
49
+ remain executable without this conversation. Report the saved lesson, its
50
+ owner, and verification; a session-specific transcript is not completion.
@@ -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.
@@ -1,118 +0,0 @@
1
- ---
2
- name: intelligence-compact-context
3
- description: "Reduce rules, agents, and skills without changing behavior or teaching terse output"
4
- argument-hint: "[target: rules|agents|skills|all]"
5
- agent: intelligence-architect
6
- ---
7
-
8
- # Compact intelligence context
9
-
10
- Reduce persistent and on-demand prompt cost by changing structure before wording.
11
- The result must preserve the layer's behavioral contract and ordinary, complete
12
- language; a smaller file is not a success if agents become terse, vague, or less
13
- reliable.
14
-
15
- ## Analyze
16
-
17
- 1. Resolve `<manifest>`, `<content-dir>`, and `<module>`. Enumerate the source
18
- directories declared under `sources.rules`, `sources.agents`, and
19
- `sources.skills`; skip installed package sources and generated adapter output.
20
-
21
- 2. Read `<module>/references/conventions.md`, the `intelligence-authoring` rule,
22
- and [references/principles.md](references/principles.md). The reference
23
- explains which forms of indirection save context and which merely move text.
24
-
25
- 3. Run `<sync-cmd> --compact` and save the `CONTEXT:` line as the baseline,
26
- including its rendered `agents-md` byte count. Record individual source-file
27
- byte and line counts for the requested target.
28
-
29
- 4. Invoke `intelligence-review-skills` for the same target. Reuse its findings
30
- for duplication, misplaced content, scope, stale artifacts, pressure markers,
31
- history narrative, and description budget; do not reproduce its audit.
32
-
33
- 5. Build a semantic ledger before drafting edits. For every candidate passage,
34
- record:
35
-
36
- - the behavior, constraint, procedure, or expertise it carries;
37
- - its one authoritative owner;
38
- - when it must load;
39
- - the reason or example needed to apply it correctly;
40
- - the repository evidence or external documentation that supports it.
41
-
42
- Two passages are duplicates only when those meanings match. Similar wording
43
- with different scope, priority, or failure behavior is not duplication.
44
-
45
- ## Draft the compaction
46
-
47
- 6. Apply structural reductions in this order:
48
-
49
- 1. Replace an instruction with a deterministic gate or command when the
50
- repository already enforces it.
51
- 2. Delete generic knowledge and facts the agent can read directly from the
52
- repository, unless a non-obvious interpretation is the instruction.
53
- 3. Keep one owner for duplicated guidance and remove the copies. A skill may
54
- invoke another skill by name; an agent may list a skill; neither restates
55
- the called artifact.
56
- 4. Add `paths:` to rules that matter only in part of the repository.
57
- 5. Move multi-step procedures from rules or agents into skills, and move
58
- reusable constraints or expertise to the artifact type that owns them.
59
- 6. Move optional skill detail into skill-local `references/` and state the
60
- exact condition that requires each file. Do not use an always-loaded
61
- import or an unconditional read step and call that compaction.
62
- 7. Tighten prose only after the preceding reductions are exhausted.
63
-
64
- 7. Preserve language quality while tightening prose:
65
-
66
- - Use complete grammatical sentences and ordinary project vocabulary.
67
- - Preserve the reason when it guides judgment, and keep one minimal example
68
- when the rule would otherwise be ambiguous.
69
- - Preserve triggers, boundaries, ordering, failure behavior, verification,
70
- and output contracts exactly.
71
- - Shorten descriptions by retaining the unique trigger that distinguishes a
72
- sibling; never reduce them to vague labels.
73
- - Do not add instructions telling agents to be terse, abbreviated, clipped,
74
- or concise unless that response style is an explicit product requirement.
75
- - Do not turn prose into fragments, dense acronyms, slash-separated phrases,
76
- or unexplained labels. Compression targets redundancy, not grammar.
77
-
78
- 8. Treat references according to load behavior:
79
-
80
- - A conditional skill reference saves startup context.
81
- - An always-loaded import improves organization but does not save context.
82
- - A plain link is navigation, not guaranteed instruction loading; never hide
83
- a critical constraint behind one.
84
- - An always-on rule that is too large normally needs deletion, scoping, a
85
- gate, or conversion of its procedure into a skill—not a reference index.
86
-
87
- ## Approval and apply
88
-
89
- 9. Present a proposal grouped as `DELETE`, `MERGE`, `SCOPE`, `MOVE`,
90
- `REFERENCE`, or `REWRITE`. For each item show the owner, semantic contract,
91
- estimated bytes saved, and any behavior that could change. Ask for approval
92
- before changing meaning, ownership, scope, or load timing.
93
-
94
- 10. Apply only accepted items to project-owned sources. Preserve unapproved
95
- passages byte-for-byte and never edit generated output or installed package
96
- sources locally.
97
-
98
- ## Verify
99
-
100
- 11. Compare the semantic ledger with the diff. Every original behavior must be
101
- present once in its authoritative owner, deliberately removed with approval,
102
- or enforced by the named deterministic mechanism. Check that no move created
103
- a dead link, unconditional reference load, conflicting instruction, or
104
- broader scope.
105
-
106
- 12. Run `<sync-cmd> --compact`, require `IS_STATUS=ok`, then run
107
- `intelligence status --check`. Compare the new `CONTEXT:` line and per-file
108
- counts with the baseline.
109
-
110
- 13. Exercise three representative prompts when the environment supports agent
111
- evaluation: one direct case governed by a compacted instruction, one adjacent
112
- judgment case that needs its reason, and one ordinary explanation that would
113
- reveal clipped language. If behavioral evaluation is unavailable, report
114
- that explicitly; a smaller byte count proves size reduction, not quality.
115
-
116
- 14. Report bytes and percentage saved for always-on and custom context, the
117
- before-and-after `agents-md` size, the artifacts changed, the semantic
118
- checks performed, and any remaining item that needs an owner decision.
@@ -1,47 +0,0 @@
1
- ---
2
- name: intelligence-extract-skill
3
- description: "Extract observed workflow into a reusable skill"
4
- argument-hint: "<skill-name-hint> [target: skill|rule|agent]"
5
- ---
6
-
7
- # Extract Skill
8
-
9
- Use when a workflow that ran during this session should become a reusable artifact — same sequence will be needed again by this user or by someone else using shared intelligence. Starts from observed session behavior instead of design-from-scratch.
10
-
11
- ## When to use this vs `intelligence-add-skill`
12
-
13
- - `intelligence-add-skill` — design from scratch / from codebase analysis
14
- - `intelligence-extract-skill` — extract from the conversation that just happened
15
-
16
- Both end at the same artifact format. Extract starts from observed behavior, so the steps already exist as real working procedure.
17
-
18
- ## Steps
19
-
20
- 1. **Identify the pattern from session**: list the concrete steps the assistant or user-and-assistant performed during the conversation. Include user decisions at each branch and assistant actions.
21
-
22
- 2. **Generalize**: strip session-specific details (file names, dates, specific phrasing), keep the repeatable structure. The artifact should work for the next instance of this task type, not just the one that ran.
23
-
24
- 3. **Determine artifact type**:
25
- - Multi-step workflow with concrete steps → **skill**
26
- - Behavioral preference / constraint / pattern to default to → **rule** (use `intelligence-learn-from-context` for single preferences from session)
27
- - Knowledge area / persona / expertise scope → **agent**
28
-
29
- 4. **Determine domain prefix** (for skill / agent): reuse the existing domain when one fits — list `<content-dir>/skills/` and `<content-dir>/agents/`. Derive from repo structure only when no existing domain matches.
30
-
31
- 5. **Determine naming** (for skill): `<domain>-<verb>-<noun>` with convention verbs — `add-` (one new member of a set that already exists), `create-` (the container itself, where nothing hosted it), `update-` (revise what is there), `run-` (execute), `review-` (read-only analysis).
32
-
33
- 6. **Check for matching agent**: if creating a skill and an agent already covers the domain, link via `agent:` frontmatter. If no matching agent and one is warranted, call `intelligence-add-agent` first.
34
-
35
- 7. **Write the artifact** by delegating to the relevant `intelligence-add-*` skill (`intelligence-add-skill` / `intelligence-add-rule` / `intelligence-add-agent`). The add-* skills carry the authoring conventions — no need to duplicate them here.
36
-
37
- 8. **Run sync**: `/intelligence-sync` to distribute to all enabled IDE targets.
38
-
39
- ## Authoring guidance
40
-
41
- Follow the **Authoring Discipline** section in `<module>/references/conventions.md` when writing the artifact body — size budgets (<500 lines for SKILL.md body), imperative form, explain WHY, reserve absolute language for true invariants, lead with positive defaults.
42
-
43
- ## Related skills
44
-
45
- - `intelligence-add-skill` — design new skill from scratch
46
- - `intelligence-learn-from-context` — capture a behavioral preference from session (often → rule update)
47
- - `intelligence-review-skills` — audit existing artifacts for duplication, staleness, discipline issues
@@ -1,45 +0,0 @@
1
- ---
2
- name: intelligence-install-adapter
3
- description: "Research, implement, and enable a tool adapter"
4
- argument-hint: <adapter-name>
5
- agent: intelligence-operator
6
- ---
7
-
8
- # Install an adapter
9
-
10
- The CLI owns adapter inventory, scaffolding, target state, and sync. This skill
11
- owns the judgement a program cannot infer: how the target tool represents
12
- rules, agents, and skills.
13
-
14
- ## Steps
15
-
16
- 1. Run `intelligence adapter list`. If `$ARGUMENTS` already exists, enable it
17
- with `intelligence adapter enable $ARGUMENTS`; that command also runs a full
18
- sync. Continue at verification.
19
-
20
- 2. For a missing adapter, research the tool's current authoritative
21
- documentation: discovery paths, frontmatter/schema, scoping, naming,
22
- agents, skills, and whether it reads `AGENTS.md`. Record links and separate
23
- verified behavior from assumptions.
24
-
25
- 3. Run `intelligence adapter create $ARGUMENTS`, then keep
26
- `adapter_contract_$ARGUMENTS()` aligned with every path the adapter writes
27
- and implement `sync_to_$ARGUMENTS()` in the scaffolded project adapter. Follow
28
- `<module>/references/adapters.md` and the closest built-in. Keep writes beneath
29
- the configured output, make reruns idempotent, distinguish exclusive
30
- `owned` paths from marker-based/shared `managed` paths, and declare exact
31
- legacy, preserved, dependency, ignore, and include records when applicable.
32
-
33
- 4. Run `bash -n` on the project adapter, then
34
- `intelligence adapter enable $ARGUMENTS`. If the CLI says the adapter
35
- requires `agents`, enable that adapter first.
36
-
37
- The CLI derives generated-output ignores from the adapter contract. Do not
38
- edit `.gitignore` manually; correct the contract when policy is wrong, and
39
- never ignore a shared output root.
40
-
41
- 5. Require `IS_STATUS=ok`, inspect generated files against the researched
42
- format, deliberately fail a later test adapter to prove transactional
43
- rollback when contributing a built-in, run the tool's validator when one exists, and finish with
44
- `intelligence status --check`. Report evidence, output paths, and any
45
- unsupported artifact type.
@@ -1,88 +0,0 @@
1
- ---
2
- name: intelligence-learn-from-context
3
- description: "Capture one approved lesson from a session in an established Intelligence project"
4
- ---
5
-
6
- # Learn from Context
7
-
8
- Use after repository onboarding is complete and a meaningful preference,
9
- working pattern, or recurring friction emerged during the current session and
10
- should persist. It runs analyze (read-only), then apply after approval. This
11
- skill extends an established project; it does not perform first-run repository
12
- analysis or migrate legacy instructions.
13
-
14
- ## Onboarding gate
15
-
16
- 1. Locate `<manifest>`, `<content-dir>`, and `<module>`, then run
17
- `intelligence status --check`.
18
- 2. If setup is missing or inconsistent, stop and ask the user to repair it with
19
- `intelligence init`; then use `/intelligence-learn-from-repository`. Do not
20
- reproduce CLI mechanics.
21
- 3. If the generated header says onboarding is pending, or preserved legacy
22
- evidence still has unresolved instructions, stop and route to
23
- `/intelligence-learn-from-repository`. A retained
24
- `<content-dir>/_backup/manifest.tsv` or converted legacy config alone does
25
- not mean onboarding is incomplete; those may remain as intentionally kept
26
- evidence after the transitional header and conflicts are resolved.
27
-
28
- ## Principle: positive framing
29
-
30
- LLMs follow whatever is named. Negation ("never do X") often draws attention to X. Positive framing ("default to Y", "prefer Y") steers behavior more cleanly.
31
-
32
- This skill translates user-stated lessons before encoding:
33
- - "Don't use NOT-comparison structures" → "State positively what IS"
34
- - "Stop generating 3 options" → "Default to one strong recommendation"
35
- - "Never push toward architecture framing" → "Reflect the user's framing in their own words first"
36
-
37
- The original negative pattern stays in the rule body as an illustrative example (paired with positive replacement), but the LLM-facing instruction is positive.
38
-
39
- ## Phase A — Analyze (read-only)
40
-
41
- 1. **Read authoring conventions first.** The paths below are localized to this project at sync time: `<content-dir>/` is the project content directory, `<module>/` the installed sync package, and `<manifest>` the root manifest. The meta-skills live in `<module>/skills/`, not directly under the content directory. Load `<module>/skills/intelligence-add-rule/SKILL.md`, `<module>/skills/intelligence-add-skill/SKILL.md`, `<module>/skills/intelligence-add-agent/SKILL.md`, and `<module>/references/conventions.md` (Authoring Discipline section). This skill writes nothing on its own — it delegates to the add-* skills, which carry the authoring conventions.
42
-
43
- 2. **Capture the lesson** from session context or user input. Strip session-specific detail, keep the underlying pattern.
44
-
45
- 3. **Translate to positive form**:
46
- - "Never do X" → "Default to Y"
47
- - "Stop doing Y" → "Do Z instead"
48
- - Already-positive lessons keep as-is.
49
- Confirm the translation with the user if removing the negation changes meaning.
50
-
51
- 4. **Route to the right artifact type**:
52
- - Behavioral preference, tone, communication style → **rule** (`<content-dir>/rules/<name>.md`)
53
- - Multi-step repeatable workflow → use `intelligence-extract-skill` instead
54
- - Knowledge scope / persona / expertise area → **agent**
55
- - Project-specific context tied to a path → scoped rule with `paths:` frontmatter
56
-
57
- 5. **Check for an existing artifact to extend**: list the target directory and read titles. When the lesson fits an existing artifact's scope, propose `UPDATE` rather than `CREATE`. Artifact proliferation costs context space.
58
-
59
- 6. **Output the proposal list** — one entry per change, each with:
60
- - Action: `CREATE` / `UPDATE` / `ARCHIVE`
61
- - Target file path
62
- - Brief draft of the change (positive framing applied)
63
- - One-line reasoning
64
-
65
- **No files are written in this phase.**
66
-
67
- ## User approval gate
68
-
69
- Present the proposal list to the user. User accepts or rejects per item. Only accepted items move to Phase B.
70
-
71
- ## Phase B — Apply (after approval)
72
-
73
- 7. For each accepted item, delegate to the appropriate add-* skill or edit directly:
74
- - `CREATE` rule → call `intelligence-add-rule`
75
- - `CREATE` skill → call `intelligence-add-skill`
76
- - `CREATE` agent → call `intelligence-add-agent`
77
- - `UPDATE` existing artifact → edit the file directly, applying the proposed change
78
- - `ARCHIVE` → move to `<content-dir>/_archive/` and update cross-references that point at it
79
-
80
- 8. Run `intelligence sync` once all accepted items are applied. Require
81
- `IS_STATUS=ok`, then run `intelligence status --check`.
82
-
83
- ## Related skills
84
-
85
- - `intelligence-learn-from-repository` — first-run onboarding and legacy instruction migration; use it before this skill
86
- - `intelligence-extract-skill` — when the lesson is a multi-step workflow to be made reusable
87
- - `intelligence-review-skills` — broader audit across existing intelligence/ artifacts
88
- - `intelligence-add-rule`, `intelligence-add-skill`, `intelligence-add-agent` — each authors one artifact; Phase B delegates to them
@@ -1,101 +0,0 @@
1
- ---
2
- name: intelligence-review-skills
3
- description: "Audit the intelligence layer for duplication, drift, size, hardcoded paths and framing"
4
- argument-hint: "[target: rules|agents|skills|all]"
5
- agent: intelligence-architect
6
- ---
7
-
8
- # Review the intelligence layer
9
-
10
- Read-only audit of the project's rules, agents and skills, ending in a punch-list. This skill owns the **generic** audit — everything true of any repository. A project that adds laws of its own layers a thin project audit on top and invokes this one; it never re-implements these checks.
11
-
12
- The name uses "skills" as shorthand for all AI artifacts (rules, agents, and skills).
13
-
14
- ## Scope: what to read, and what to leave alone
15
-
16
- 1. **Resolve the layout — never assume folder names.** `<content-dir>/` is the project content directory, `<module>/` the installed sync package, `<manifest>` the root manifest — all localized to this project at sync time. Read authoring conventions from `<module>/references/conventions.md` and the `intelligence-authoring` rule.
17
-
18
- 2. **Enumerate from `<manifest>`, not from a guessed path.** The artifacts are exactly the directories listed under `sources.rules`, `sources.agents` and `sources.skills` — there may be several groups, they may be nested, and installed packages live under `.intelligence/packages/`. Take the list from the manifest; a literal `intelligence/rules/` is wrong in any project that named things differently.
19
-
20
- 3. **Skip installed package sources.** Sources under `<module>/` (`<module>/rules`, `<module>/agents`, `<module>/skills/intelligence-*`) are package-owned and restored by CLI lifecycle operations, so a local "fix" is not durable. Never propose a project-local edit to them. If one is wrong, make an upstream proposal instead.
21
-
22
- 4. **Never read or edit generated output** (`.claude/`, `.cursor/`, `.github/`, `.codex/`, `.agents/`, `.pi/`, `.opencode/`, `AGENTS.md`). Sync owns those entirely; the finding always belongs to the source. Reading its byte count from sync's `CONTEXT:` summary or a byte-count command is the metadata-only exception—do not open the output to audit its prose.
23
-
24
- ## Steps
25
-
26
- 5. **Pull git history** (when available) for each artifact — last edit, edit count, first-add date. A stale candidate has no recent edits *and* nothing cross-referencing it.
27
-
28
- 6. **Run the detection checks.** Resolve the shared agents target output from `<manifest>` and measure only its byte count; use the `agents-md` value when a fresh `CONTEXT:` summary is already available. Apply the shared instruction budget below, but do not run sync during this read-only audit. Judgement decides; the checks only make a finding evidence rather than an impression.
29
-
30
- | Check | What it is | Proposed action |
31
- |---|---|---|
32
- | **Duplicate content** | Two artifacts cover overlapping scope, or their descriptions share trigger phrases | `MERGE` — present both, propose one |
33
- | **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 |
34
- | **Over the cap** | `SKILL.md` over 1000 lines, rule over 500, agent over 200 | `SPLIT` — two artifacts, or move detail into `references/<topic>.md` |
35
- | **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 `intelligence-compact-context` to reduce the owning sources without teaching terse output |
36
- | **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 |
37
- | **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 |
38
- | **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 |
39
- | **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 |
40
- | **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 |
41
- | **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 |
42
- | **Reserved prefix** | A project artifact named `intelligence-*` | `RENAME` — the prefix belongs to the sync package and collides in generated output |
43
- | **Naming** | A skill that is not `<domain>-<verb>-<noun>`, or a domain invented rather than reused | `RENAME` — or introduce the new domain deliberately |
44
- | **Stale** | No edits in 6+ months and nothing cross-references it | `ARCHIVE` — move to `<content-dir>/_archive/` |
45
- | **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 |
46
- | **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 |
47
- | **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 |
48
- | **Weak / duplicate description** | Identical to a sibling, or too vague to choose between them | `DIFFERENTIATE` — add the distinguishing trigger |
49
- | **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 |
50
- | **Missing frontmatter field** | `name` or `description` absent | `PATCH` — add it |
51
- | **Orphan rule** | Nothing points at it and nothing loads it | `FLAG` — intentional, or dead? |
52
-
53
- 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:
54
-
55
- ```sh
56
- # Shared instruction budget — resolve this output path from <manifest>
57
- wc -c "<agents-output>"
58
-
59
- # R1 — a markdown link from one rule to another
60
- grep -rnE '\]\([^)]*\.md\)' <rule-dirs>
61
-
62
- # R2 — machine facts in a rule (a shell, someone's home directory, a drive letter)
63
- grep -rinE 'powershell|cmd\.exe|/Users/|/home/|[A-Za-z]:[\\]' <rule-dirs>
64
-
65
- # R3 — a path baked into a skill's steps, excluding the skill's own bundle
66
- grep -rnE --include=SKILL.md '[A-Za-z0-9._-]+/[A-Za-z0-9._/-]+\.[A-Za-z0-9]+' <skill-dirs> \
67
- | grep -vE '(^|[^A-Za-z0-9._/-])(references|scripts|assets)/'
68
-
69
- # R4 — skills whose body never mentions verifying anything (-L lists files with NO match)
70
- grep -riLE --include=SKILL.md 'verif|expect|assert|check|test|IS_STATUS' <skill-dirs>
71
-
72
- # R5 - pressure markers: a heading or label named for urgency, then absolute-language density per file
73
- grep -rnE '^#+ .*(CRITICAL|MANDATORY|HARD RULE|READ FIRST)|\((CRITICAL|MANDATORY|HARD RULE)\)' <rule-dirs> <agent-dirs> <skill-dirs>
74
- grep -rcE '(MUST|NEVER|ALWAYS)' <rule-dirs> <agent-dirs> <skill-dirs> | grep -vE ':0$'
75
-
76
- # R6 - history narrative in a rule body: PR numbers, incident ids, dates, "this session", commit SHAs
77
- grep -rniE -e '(#|PR )[0-9]{3,}' -e '[0-9]{4}-[0-9]{2}-[0-9]{2}' -e 'this session|origin session' \
78
- -e '`[0-9a-f]{7,40}`' <rule-dirs>
79
- ```
80
-
81
- `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.
82
-
83
- 7. **Ask subtraction first.** Before proposing any `SPLIT`, `REWRITE` or `PATCH`, ask whether the artifact should exist at all, whether two should become one, and whether the rule could be replaced by a gate the model cannot skip. A deletion is a better outcome than a tidy-up, and the punch-list should say so when it is true.
84
-
85
- 8. **Build the punch-list**: finding, target file, proposed action, one-line reasoning, priority (1 = high-impact: duplication, misplaced content, an artifact that should not exist; 3 = low: description tweaks). Read-only — this skill writes nothing.
86
-
87
- ## User approval gate
88
-
89
- The user accepts items individually; bulk-accept for low-impact tweaks is fine. Anything that changes **meaning** (a law, a boundary, a gate, an unbacked reason) is surfaced with a draft and left to the human who owns it — never auto-fixed.
90
-
91
- ## Apply phase
92
-
93
- 9. Accepted items go to `intelligence-learn-from-context` Phase B, which owns the write machinery — do not invent a second apply path. Pass the action, the target file, the drafted change and the reasoning.
94
-
95
- 10. Run `/intelligence-sync` once, after all accepted items are applied, and report one line per artifact: **pass / fixed (what) / flagged (for whom)**.
96
-
97
- ## Related skills
98
-
99
- - `intelligence-learn-from-context` — single-session lesson capture; this skill delegates accepted edits to its Phase B
100
- - `intelligence-extract-skill` — when the audit surfaces a workflow that should become a skill
101
- - `intelligence-compact-context` — approval-gated structural compaction when the shared instruction budget or source size needs reduction
@@ -1,24 +0,0 @@
1
- ---
2
- name: intelligence-uninstall-adapter
3
- description: "Disable an adapter and assess its generated output"
4
- argument-hint: <adapter-name>
5
- agent: intelligence-operator
6
- ---
7
-
8
- # Uninstall an adapter
9
-
10
- 1. Run `intelligence adapter list`, then
11
- `intelligence adapter disable $ARGUMENTS`. Disabling changes target state
12
- and deliberately keeps generated output.
13
- 2. If generated files should also be removed, inspect the adapter's cleanup
14
- block to identify exactly what it owns. Show that list and obtain approval
15
- before deleting it; never delete a shared output root.
16
- 3. For a project adapter that should be deleted, run
17
- `intelligence adapter remove $ARGUMENTS` after it is disabled. This prompts
18
- by default (`--apply` is the explicit non-interactive form) and also keeps
19
- generated output. Built-in adapter source cannot be removed.
20
- 4. Remove obsolete `.gitignore` entries only when no remaining adapter needs
21
- them. Sync the remaining enabled adapters when any exist.
22
- 5. Verify with `intelligence adapter list` and `intelligence status --check`:
23
- the adapter is disabled or removed as requested, retained files are intact,
24
- and only approved adapter-owned output was deleted.