@ainova-systems/intelligence 0.14.0 → 0.16.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.
- package/cli/commands/source.sh +177 -0
- package/cli/intelligence +5 -0
- package/cli/internal/check.sh +7 -0
- package/cli/lib/cli-common.sh +85 -0
- package/cli/lib/manifest.sh +97 -26
- package/engine/ENGINE_SHA +1 -1
- package/engine/VERSION +1 -1
- package/engine/lib/common.sh +9 -1
- package/engine/lib/contract.sh +1 -1
- package/package.json +1 -1
- package/packages/sync/agents/intelligence-architect.md +8 -14
- package/packages/sync/agents/intelligence-operator.md +3 -4
- package/packages/sync/references/conventions.md +3 -1
- package/packages/sync/rules/intelligence-authoring.md +1 -1
- package/packages/sync/skills/intelligence-learn-from-repository/SKILL.md +6 -7
- package/packages/sync/skills/intelligence-learn-from-session/SKILL.md +50 -0
- package/packages/sync/skills/intelligence-manage-adapters/SKILL.md +45 -0
- package/packages/sync/skills/intelligence-review-context/SKILL.md +54 -0
- package/packages/sync/skills/intelligence-review-context/references/audit-checks.md +56 -0
- package/packages/sync/skills/intelligence-review-context/references/compaction.md +57 -0
- package/packages/sync/skills/intelligence-update-context/SKILL.md +74 -0
- package/packages/sync/skills/intelligence-update-context/references/agents.md +31 -0
- package/packages/sync/skills/intelligence-update-context/references/rules.md +31 -0
- package/packages/sync/skills/intelligence-update-context/references/skills.md +34 -0
- package/packages/sync/skills/{intelligence-update → intelligence-upgrade}/SKILL.md +3 -3
- package/packages/sync/skills/intelligence-add-agent/SKILL.md +0 -62
- package/packages/sync/skills/intelligence-add-rule/SKILL.md +0 -54
- package/packages/sync/skills/intelligence-add-skill/SKILL.md +0 -53
- package/packages/sync/skills/intelligence-compact-context/SKILL.md +0 -118
- package/packages/sync/skills/intelligence-extract-skill/SKILL.md +0 -47
- package/packages/sync/skills/intelligence-install-adapter/SKILL.md +0 -45
- package/packages/sync/skills/intelligence-learn-from-context/SKILL.md +0 -88
- package/packages/sync/skills/intelligence-review-skills/SKILL.md +0 -101
- package/packages/sync/skills/intelligence-uninstall-adapter/SKILL.md +0 -24
- /package/packages/sync/skills/{intelligence-compact-context → intelligence-review-context}/references/principles.md +0 -0
|
@@ -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.
|
|
File without changes
|