@softspark/ai-toolkit 1.6.0 → 1.7.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/CHANGELOG.md CHANGED
@@ -7,6 +7,34 @@ Versioning follows [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ---
9
9
 
10
+ ## v1.7.0 — Offline-First SLM Compilation (2026-04-11)
11
+
12
+ ### Added
13
+ - **`compile-slm` command** — compiles full toolkit (20K+ tokens) into a minimal system prompt for Small Language Models (2K-16K tokens). Supports 4 compression levels (ultra-light, light, standard, extended), 4 output formats (raw, ollama, json-string, aider), persona-aware scoring, and language-aware rule filtering. `scripts/compile_slm.py`
14
+ - **`offline-slm` profile** — `manifest.json` profile for offline/air-gapped installs
15
+ - **Post-compilation validator** — checks constitution presence, budget compliance, guard hooks, output sanity
16
+ - **Integration guides** — step-by-step setup for Ollama, LM Studio, Aider, Continue.dev printed after compilation
17
+ - **61 tests** for compile-slm (token counter, parser, compression, packer, emitter, formats, CLI, determinism, budget compliance, validator, guides)
18
+
19
+ ### Fixed
20
+ - **Skill counts** — synced stale count 91 → 92 across README.md (3 locations) and manifest.json
21
+ - **KB frontmatter validation** — `kb/history/` excluded from category-dir match (archived plans keep original category)
22
+
23
+ ---
24
+
25
+ ## v1.6.1 — IDE Rule Format Compliance Audit (2026-04-10)
26
+
27
+ ### Fixed
28
+ - **Cline rules path** — changed `.cline/rules/` to `.clinerules/` directory per official Cline 3.7+ docs. Old path was silently ignored by Cline
29
+ - **Augment frontmatter type** — changed `auto_attached` to `agent_requested` per official Augment docs
30
+ - **Aider config** — added `CONVENTIONS.md` to `read:` list in `.aider.conf.yml` so Aider auto-loads the conventions we generate
31
+
32
+ ### Changed
33
+ - **`add-rule` help text** — now lists all supported editors (was missing Augment, Roo, Aider, Antigravity)
34
+ - Legacy `.clinerules` single-file is auto-migrated to `.clinerules/` directory on next install
35
+
36
+ ---
37
+
10
38
  ## v1.6.0 — IDE Language Rules Propagation, Planning Docs, Cloud Security Pack (2026-04-10)
11
39
 
12
40
  ### Added
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # ai-toolkit
2
2
 
3
- > Professional-grade AI coding toolkit with multi-platform support. Machine-enforced safety, 91 skills, 44 agents, expanded lifecycle hooks, persona presets, experimental opt-in plugin packs, and benchmark tooling — works with Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, and Google Antigravity, ready in 60 seconds.
3
+ > Professional-grade AI coding toolkit with multi-platform support. Machine-enforced safety, 92 skills, 44 agents, expanded lifecycle hooks, persona presets, experimental opt-in plugin packs, and benchmark tooling — works with Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, and Google Antigravity, ready in 60 seconds.
4
4
 
5
5
  [![CI](https://github.com/softspark/ai-toolkit/actions/workflows/ci.yml/badge.svg)](https://github.com/softspark/ai-toolkit/actions/workflows/ci.yml)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
7
  [![Skills](https://img.shields.io/badge/skills-92-brightgreen)](app/skills/)
8
8
  [![Agents](https://img.shields.io/badge/agents-44-blue)](app/agents/)
9
- [![Tests](https://img.shields.io/badge/tests-451%20passing-success)](tests/)
9
+ [![Tests](https://img.shields.io/badge/tests-512%20passing-success)](tests/)
10
10
 
11
11
  ---
12
12
 
@@ -21,7 +21,7 @@ ai-toolkit install
21
21
  npx @softspark/ai-toolkit install
22
22
  ```
23
23
 
24
- **That's it.** Claude Code picks up 91 skills, 44 agents, quality hooks, and the safety constitution automatically.
24
+ **That's it.** Claude Code picks up 92 skills, 44 agents, quality hooks, and the safety constitution automatically.
25
25
 
26
26
  ### Update
27
27
 
@@ -110,6 +110,19 @@ ai-toolkit eject /path/to # export to custom directory
110
110
 
111
111
  Replaces all symlinks with real files, inlines rules into CLAUDE.md, copies constitution and architecture. After eject you can `npm uninstall -g @softspark/ai-toolkit`.
112
112
 
113
+ ### Compile for Local Models (Ollama, LM Studio, Aider)
114
+
115
+ ```bash
116
+ ai-toolkit compile-slm # auto-detect model, default budget
117
+ ai-toolkit compile-slm --model-size 8b # 2K token budget for 8B models
118
+ ai-toolkit compile-slm --model-size 32b --lang python # 8K budget + Python rules
119
+ ai-toolkit compile-slm --persona backend-lead # boost backend-relevant skills
120
+ ai-toolkit compile-slm --format ollama # Ollama Modelfile SYSTEM block
121
+ ai-toolkit compile-slm --dry-run # preview what gets included
122
+ ```
123
+
124
+ Compiles the full toolkit (20K+ tokens) into a minimal system prompt that fits SLM context windows. Preserves safety constitution, compresses skills, and packs by value density. Supports 4 output formats: `raw`, `ollama`, `json-string`, `aider`.
125
+
113
126
  ---
114
127
 
115
128
  ## Platform Support
@@ -121,7 +134,7 @@ Replaces all symlinks with real files, inlines rules into CLAUDE.md, copies cons
121
134
  | Windsurf | `~/.codeium/.../global_rules.md` + `.windsurf/rules/*.md` | `ai-toolkit install` / `--local` | global + project |
122
135
  | Gemini CLI | `~/.gemini/GEMINI.md` | `ai-toolkit install` | global |
123
136
  | GitHub Copilot | `.github/copilot-instructions.md` | `ai-toolkit install --local` | project |
124
- | Cline | `.clinerules` + `.cline/rules/*.md` | `ai-toolkit install --local` | project |
137
+ | Cline | `.clinerules/*.md` | `ai-toolkit install --local` | project |
125
138
  | Roo Code | `.roomodes` + `.roo/rules/*.md` | `ai-toolkit install --local` | project |
126
139
  | Aider | `.aider.conf.yml` + `CONVENTIONS.md` | `ai-toolkit install --local` | project |
127
140
  | Augment | `.augment/rules/ai-toolkit-*.md` | `ai-toolkit install --local` | project |
@@ -159,7 +172,7 @@ ai-toolkit/
159
172
  │ │ ├── backend-specialist.md
160
173
  │ │ ├── security-architect.md
161
174
  │ │ └── ... (41 more)
162
- │ ├── skills/ # 91 skills (task / hybrid / knowledge)
175
+ │ ├── skills/ # 92 skills (task / hybrid / knowledge)
163
176
  │ │ ├── commit/ # /commit slash command
164
177
  │ │ ├── review/ # /review slash command
165
178
  │ │ ├── clean-code/ # knowledge skill (auto-loaded)
@@ -535,9 +548,9 @@ When `--editors` is used alongside detected or explicit languages, language rule
535
548
  |--------|-------------------|------------|
536
549
  | Cursor | `.cursor/rules/ai-toolkit-lang-<lang>.mdc` | `globs` per file type (e.g. `**/*.py`) |
537
550
  | Windsurf | `.windsurf/rules/ai-toolkit-lang-<lang>.md` | always loaded |
538
- | Cline | `.cline/rules/ai-toolkit-lang-<lang>.md` | always loaded |
551
+ | Cline | `.clinerules/ai-toolkit-lang-<lang>.md` | always loaded |
539
552
  | Roo Code | `.roo/rules/ai-toolkit-lang-<lang>.md` | always loaded |
540
- | Augment | `.augment/rules/ai-toolkit-lang-<lang>.md` | `auto_attached` with globs |
553
+ | Augment | `.augment/rules/ai-toolkit-lang-<lang>.md` | `agent_requested` with globs |
541
554
  | Antigravity | `.agent/rules/ai-toolkit-lang-<lang>.md` | always loaded |
542
555
 
543
556
  Registered rules (`ai-toolkit add-rule`) are also propagated to directory-based editor configs as `ai-toolkit-custom-<name>` files.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-toolkit",
3
3
  "description": "Professional-grade Claude Code toolkit with persona presets, skill security auditor, expanded lifecycle hooks, experimental opt-in plugin packs, benchmark harvesting, and multi-tool support.",
4
- "version": "1.6.0",
4
+ "version": "1.7.0",
5
5
  "author": {
6
6
  "name": "SoftSpark",
7
7
  "url": "https://github.com/softspark"
@@ -312,6 +312,9 @@ Language rules are propagated to **all configured editors** — not just Claude.
312
312
  ### Extension API (`inject-hook`)
313
313
  The `inject_section_cli.py` script provides a stable marker-based injection API. Any tool can add sections to `CLAUDE.md`, `constitution.md`, or `ARCHITECTURE.md` without overwriting user content, using `<!-- TOOLKIT:START:<id> -->` / `<!-- TOOLKIT:END:<id> -->` markers.
314
314
 
315
+ ### SLM Compilation (`compile-slm`)
316
+ `scripts/compile_slm.py` compiles the full toolkit (20K+ tokens) into a minimal system prompt for Small Language Models (2K-16K tokens). Pipeline: Parse → Score → Compress → Pack → Emit. Supports 4 compression levels (ultra-light, light, standard, extended), 4 output formats (raw, ollama, json-string, aider), persona-aware scoring, and language-aware rule filtering. Profile `offline-slm` in `manifest.json`. Constitution is always included (non-negotiable).
317
+
315
318
  ### Manifest Install (`--modules`, `--auto-detect`)
316
319
  `manifest.json` defines all installable components as named modules. Install individual modules with `ai-toolkit install --modules <name>` or let the installer detect which language rules to add based on project files (e.g. `package.json` → `rules-typescript`, `go.mod` → `rules-golang`).
317
320
 
package/bin/ai-toolkit.js CHANGED
@@ -48,6 +48,7 @@ const SCRIPT_COMMANDS = {
48
48
  'benchmark-ecosystem': { script: 'benchmark_ecosystem.py', toolkitCwd: true },
49
49
  'evaluate': { script: 'evaluate_skills.py', toolkitCwd: true },
50
50
  'stats': { script: 'stats.py' },
51
+ 'compile-slm': { script: 'compile_slm.py' },
51
52
  };
52
53
 
53
54
  // ---------------------------------------------------------------------------
@@ -83,7 +84,7 @@ const COMMANDS = {
83
84
  'copilot-instructions': 'Generate .github/copilot-instructions.md',
84
85
  'gemini-md': 'Generate GEMINI.md for Gemini CLI',
85
86
  'cline-rules': 'Generate .clinerules for Cline (legacy)',
86
- 'cline-dir-rules': 'Generate .cline/rules/*.md for Cline (recommended)',
87
+ 'cline-dir-rules': 'Generate .clinerules/*.md for Cline (recommended)',
87
88
  'roo-modes': 'Generate .roomodes for Roo Code',
88
89
  'roo-dir-rules': 'Generate .roo/rules/*.md shared rules for Roo Code',
89
90
  'aider-conf': 'Generate .aider.conf.yml for Aider',
@@ -92,6 +93,7 @@ const COMMANDS = {
92
93
  'augment-dir-rules': 'Generate .augment/rules/ai-toolkit-*.md for Augment (recommended)',
93
94
  'antigravity-rules': 'Generate .agent/rules/ and .agent/workflows/ for Google Antigravity',
94
95
  'agents-md': 'Regenerate AGENTS.md from agent definitions',
96
+ 'compile-slm': 'Compile toolkit into a minimal SLM system prompt (--budget, --model-size, --dry-run)',
95
97
  'llms-txt': 'Generate llms.txt and llms-full.txt',
96
98
  'generate-all': 'Generate all platform configs at once (agents, cursor, windsurf, copilot, gemini, cline, roo, aider, augment, antigravity, llms)',
97
99
  help: 'Show this help message',
@@ -12,17 +12,19 @@ tags:
12
12
  - context-optimization
13
13
  - privacy
14
14
  doc_type: plan
15
- status: proposed
15
+ status: completed
16
16
  created: "2026-04-10"
17
- last_updated: "2026-04-10"
18
- completion: "0%"
17
+ last_updated: "2026-04-11"
18
+ completion: "100%"
19
+ completed: "2026-04-11"
19
20
  description: "Lightweight profile for ai-toolkit optimized for Small Language Models (SLMs) running locally via Ollama, LM Studio, or similar. Compiles a minimal instruction set that fits within 4K-8K system prompt budgets while preserving critical safety guardrails. Targets air-gapped, privacy-first, and cost-sensitive development workflows."
20
21
  ---
21
22
 
22
23
  # Plan: Offline-First SLM Profile — Lightweight Mode for Local Models
23
24
 
24
- **Status:** Proposed
25
- **Completion:** 0%
25
+ **Status:** Completed
26
+ **Completion:** 100%
27
+ **Completed:** 2026-04-11
26
28
  **Created:** 2026-04-10
27
29
  **Origin:** Enterprise IP security requirements (air-gapped environments), cost-sensitive solo developers, and the growing adoption of local models (Ollama, LM Studio, llamafile). Current toolkit emits 20K+ token system prompts that exceed SLM context windows and degrade small model performance.
28
30
  **Estimated Effort:** 4-5 weeks (1 person)
@@ -64,6 +64,7 @@ ai-toolkit/
64
64
  plugin.py # Plugin pack management (install, remove, list, status)
65
65
  benchmark_ecosystem.py # Generates ecosystem benchmark snapshot
66
66
  harvest_ecosystem.py # Writes machine-readable ecosystem harvest JSON
67
+ compile_slm.py # Compiles toolkit into minimal SLM system prompt (2K-16K tokens)
67
68
  tests/ # Bats test suite
68
69
  benchmarks/ # Benchmark tasks + results
69
70
  kb/ # Knowledge base
@@ -108,7 +109,7 @@ Machine (global) Project (local)
108
109
  - `--editors cursor,aider` — install only selected editors
109
110
  - (no flag) — auto-detect from existing project files; `update --local` picks up whatever editors already have configs
110
111
 
111
- Each editor gets both legacy single-file format (for backwards compat) and new directory-based format (`.cursor/rules/*.mdc`, `.windsurf/rules/*.md`, `.cline/rules/*.md`, `.roo/rules/*.md`, `.augment/rules/ai-toolkit-*.md`, `.agent/rules/*.md`, `CONVENTIONS.md`). Hooks are global-only — not merged into project settings.
112
+ Each editor gets directory-based format (`.cursor/rules/*.mdc`, `.windsurf/rules/*.md`, `.clinerules/*.md`, `.roo/rules/*.md`, `.augment/rules/ai-toolkit-*.md`, `.agent/rules/*.md`, `CONVENTIONS.md`). Hooks are global-only — not merged into project settings.
112
113
 
113
114
  ## CLI Commands
114
115
 
@@ -132,7 +133,7 @@ Each editor gets both legacy single-file format (for backwards compat) and new d
132
133
  | `copilot-instructions` | `./` | Generates `.github/copilot-instructions.md` |
133
134
  | `gemini-md` | `./` | Generates `GEMINI.md` |
134
135
  | `cline-rules` | `./` | Generates `.clinerules` (legacy) |
135
- | `cline-dir-rules` | `./` | Generates `.cline/rules/*.md` |
136
+ | `cline-dir-rules` | `./` | Generates `.clinerules/*.md` |
136
137
  | `roo-modes` | `./` | Generates `.roomodes` |
137
138
  | `roo-dir-rules` | `./` | Generates `.roo/rules/*.md` |
138
139
  | `aider-conf` | `./` | Generates `.aider.conf.yml` |
@@ -260,6 +260,21 @@ depends-on: clean-code, api-patterns
260
260
  - Reported in `evaluate_skills.py` quality metrics
261
261
  - No runtime autoloading — Claude loads knowledge skills contextually based on topic matching
262
262
 
263
+ ### SLM Compilation (`compile-slm`)
264
+
265
+ Compiles the full toolkit into a minimal system prompt for local Small Language Models (Ollama, LM Studio, Aider, Continue.dev). Pipeline: Parse → Score → Compress → Pack → Validate → Emit.
266
+
267
+ | Flag | Purpose |
268
+ |------|---------|
269
+ | `--model-size` | 7b/8b/14b/32b/70b — auto-selects budget + compression level |
270
+ | `--budget` | Token budget override (2K-16K) |
271
+ | `--persona` | Boost persona-relevant skills in scoring |
272
+ | `--lang` | Include language-specific rules |
273
+ | `--format` | Output: raw, ollama, json-string, aider |
274
+ | `--dry-run` | Preview included components + token utilization |
275
+
276
+ Profile `offline-slm` in `manifest.json` — installs core only, then compiles.
277
+
263
278
  ### Executable Scripts (18 total, stdlib-only, JSON output)
264
279
 
265
280
  | Skill | Script | Purpose |