@softspark/ai-toolkit 4.30.3 → 4.32.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 (80) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/README.md +32 -25
  3. package/app/.claude-plugin/plugin.json +1 -1
  4. package/app/agents/code-reviewer.md +14 -0
  5. package/app/agents/frontend-specialist.md +27 -24
  6. package/app/agents/infrastructure-validator.md +2 -2
  7. package/app/claude-app/hooks/hooks.json +4 -2
  8. package/app/claude-app/skills/ai-toolkit-rules/SKILL.md +74 -17
  9. package/app/hooks/quality-gate.sh +9 -2
  10. package/app/hooks.json +4 -2
  11. package/app/personas/frontend-lead.md +20 -12
  12. package/app/rules/claude-toolkit-rules.md +4 -1
  13. package/app/rules/common/git-team.md +33 -0
  14. package/app/rules/common/git-workflow.md +6 -20
  15. package/app/rules/common/performance.md +25 -1
  16. package/app/rules/common/testing.md +7 -1
  17. package/app/rules/edit-discipline.md +37 -0
  18. package/app/skills/app-builder/SKILL.md +37 -6
  19. package/app/skills/claude-toolkit-rules/SKILL.md +37 -0
  20. package/app/skills/design-engineering/SKILL.md +87 -102
  21. package/app/skills/design-engineering/reference/animation-recipes.md +67 -0
  22. package/app/skills/design-engineering/reference/component-craft.md +28 -0
  23. package/app/skills/documentation-standards/SKILL.md +1 -1
  24. package/app/skills/edit-discipline/SKILL.md +50 -0
  25. package/app/skills/git-conventions/SKILL.md +18 -0
  26. package/app/skills/output-mode/SKILL.md +41 -0
  27. package/app/skills/quality-gates/SKILL.md +23 -0
  28. package/app/skills/review/SKILL.md +10 -0
  29. package/benchmarks/ecosystem-doctor-snapshot.json +17 -15
  30. package/bin/ai-toolkit.js +2 -0
  31. package/kb/procedures/{ecosystem-sync-sop.md → sop-ecosystem-sync.md} +2 -2
  32. package/kb/procedures/{maintenance-sop.md → sop-maintenance.md} +6 -3
  33. package/kb/procedures/{post-release-testing-sop.md → sop-post-release-testing.md} +3 -3
  34. package/kb/procedures/sop-pre-commit.md +96 -0
  35. package/kb/procedures/{release-preparation-sop.md → sop-release.md} +6 -6
  36. package/kb/reference/architecture-overview.md +1 -1
  37. package/kb/reference/cli-reference.md +3 -2
  38. package/kb/reference/copilot-compatibility.md +1 -1
  39. package/kb/reference/global-install-model.md +16 -3
  40. package/kb/reference/hooks-catalog.md +5 -3
  41. package/kb/reference/language-rules.md +28 -10
  42. package/kb/reference/licensing.md +2 -2
  43. package/kb/reference/quick-wins-implementation-summary.md +1 -1
  44. package/kb/reference/supported-tools-registry.md +2 -2
  45. package/kb/reference/unique-features.md +2 -1
  46. package/kb/troubleshooting/plugin-double-load.md +1 -1
  47. package/llms-full.txt +1016 -871
  48. package/llms.txt +6 -5
  49. package/manifest.json +2 -2
  50. package/package.json +6 -2
  51. package/scripts/benchmark_ecosystem.py +0 -1
  52. package/scripts/check_split.py +11 -9
  53. package/scripts/claude_app.py +5 -7
  54. package/scripts/codex_skill_adapter.py +4 -12
  55. package/scripts/compile_slm.py +10 -26
  56. package/scripts/doctor.py +322 -0
  57. package/scripts/evaluate_skills.py +1 -1
  58. package/scripts/frontmatter.py +452 -29
  59. package/scripts/generate_augment_rules.py +4 -4
  60. package/scripts/generate_cursor_mdc.py +2 -3
  61. package/scripts/generate_language_rules_skills.py +8 -14
  62. package/scripts/generate_llms_txt.py +1 -15
  63. package/scripts/generate_opencode_agents.py +0 -1
  64. package/scripts/generate_opencode_skills.py +2 -20
  65. package/scripts/generate_toolkit_rules_skills.py +189 -0
  66. package/scripts/generate_windsurf_rules.py +0 -1
  67. package/scripts/generator_base.py +0 -1
  68. package/scripts/inject_hook_cli.py +15 -2
  69. package/scripts/inject_mcp_cli.py +1 -2
  70. package/scripts/install.py +32 -1
  71. package/scripts/install_git_hooks.py +0 -1
  72. package/scripts/install_steps/ai_tools.py +65 -25
  73. package/scripts/install_steps/markers.py +6 -6
  74. package/scripts/install_steps/skill_scope.py +188 -0
  75. package/scripts/instruction_core.py +5 -8
  76. package/scripts/merge-hooks.py +13 -3
  77. package/scripts/pack_codebase.py +1 -1
  78. package/scripts/surface_manifest.py +6 -7
  79. package/scripts/validate.py +181 -12
  80. /package/kb/procedures/{release-verification-sop.md → sop-release-verification.md} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,129 @@ Versioning follows [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ---
9
9
 
10
+ ## v4.32.0 - Context budget: scoped rules, scoped language skills, doctor budget checks (2026-09-04)
11
+
12
+ ### Added
13
+
14
+ - **`install --language-skills detected|all`.** Language knowledge skills
15
+ (`<lang>-rules`, `<lang>-patterns`) for languages no registered project uses
16
+ are turned off through `skillOverrides` in `~/.claude/settings.json`. The
17
+ entries the toolkit wrote are tracked in `state.json` and restored when a
18
+ newly registered project brings the language back; a user's own override is
19
+ never touched; with no registered project on disk nothing is disabled. `all`
20
+ restores everything and persists the choice.
21
+ - **`doctor` check 12, Context Budget.** Estimated resident tokens of the
22
+ model-visible skill listing (against `skillListingBudgetFraction`), the agent
23
+ listing, and always-loaded user memory, plus skills with zero recorded use in
24
+ both Claude Code's counters and the toolkit's `stats.json`. Read-only; prints
25
+ the `skillOverrides` key to paste.
26
+ - **`doctor` check 13, Permission Rules.** Warns on `permissions.allow`
27
+ wildcards that pre-approve execution or writes: interpreters, task runners,
28
+ package installs, `gh api`, `curl`/`wget`, `git fetch`/`pull`, destructive
29
+ commands, `find -exec`. Never edits.
30
+ - **`validate.py` skill description budget.** Error over 1024 characters (the
31
+ Agent Skills cap), warning over 400, and an error for an unquoted description
32
+ containing `: ` or ` #` (strict YAML drops every field, `allowed-tools`
33
+ included). Applied to plugin-pack skills too.
34
+ - **`git-team` common rule.** Branching, pull-request, and review conventions
35
+ moved out of `git-workflow` into a rule that ships with `--profile strict`
36
+ only, via a new `profiles:` frontmatter gate. See `DECISIONS.md`.
37
+ - **One frontmatter parser.** `scripts/frontmatter.py` now parses the whole
38
+ toolkit subset (scalars, quoted scalars, `>-`/`|` blocks, block and flow
39
+ lists, nested maps) strictly and is the only parser; twelve private
40
+ strip/parse copies in `validate.py`, `doctor.py`, `install_steps/ai_tools.py`,
41
+ `claude_app.py`, `compile_slm.py`, `surface_manifest.py`, `instruction_core.py`,
42
+ `check_split.py`, `codex_skill_adapter.py`, `generate_opencode_skills.py`, and
43
+ `generate_language_rules_skills.py` are gone. Every shipped `app/` and `kb/`
44
+ Markdown file parses under the strict grammar (pytest corpus test).
45
+ - **Repo dev tooling, stdlib runtime.** `requirements-dev.txt` + `pytest.ini`
46
+ + `mypy.ini` (pytest, ruff, mypy) and a `python-quality` CI job:
47
+ `npm run test:py` (348 pytest tests under `tests/python/`), `npm run lint:py`
48
+ (ruff `E,F`, rule set in `package.json`), `npm run typecheck:py` (mypy
49
+ `--strict` over an allowlist). No `pyproject.toml`: the toolkit's own
50
+ `quality-gate.sh` reads one as "Python project, run `ruff check .`", which
51
+ is not what an npm-first repo wants. Nothing is added to the published
52
+ package or to user machines. See `DECISIONS.md` for why no runtime
53
+ dependency.
54
+
55
+ ### Changed
56
+
57
+ - **Common rules are path-scoped from their source.** `app/rules/common/*.md`
58
+ may declare `paths:`; the generated `.claude/rules/ai-toolkit-*.md` copies it.
59
+ `testing` and `performance` load only for matching files; `coding-style`,
60
+ `git-workflow`, and `security` stay always-on. The `.claude/CLAUDE.md` index
61
+ now lists which rules are always-on and which are path-scoped instead of
62
+ claiming lazy loading for all of them.
63
+ - **Stop hooks `quality-check.sh` and `save-session.sh` run with
64
+ `"async": true`.** Both are advisory and always exit 0; the linter was the
65
+ bulk of a 3.3 s median Stop chain. `quality-gate.sh` (exit 2) and
66
+ `stop-search-check.sh` stay synchronous.
67
+ - **`git-workflow` is the solo-safe core** (commit format, no secrets, `main`
68
+ deployable, tags, recovery). Version 2.0.0.
69
+
70
+ ### Fixed
71
+
72
+ - **`quality-gate.sh` runs ruff only for projects that configured it.** A bare
73
+ `pyproject.toml` (build metadata, pytest/mypy tables) used to trigger
74
+ `ruff check .` on every Stop under whatever ruff configuration the machine
75
+ resolves; found when this repository's own gate went red on 348 unrelated
76
+ findings. Ruff now needs `ruff.toml`, `.ruff.toml`, or a `[tool.ruff]` table.
77
+ - **Codex/DSH skill sync no longer flattens nested frontmatter.** Native
78
+ (non-adapted) skills had their frontmatter re-rendered line by line, which
79
+ turned a `hooks:` block into stray top-level `PreToolUse:` / `- matcher:`
80
+ lines. The frontmatter now passes through verbatim.
81
+ - **Hook merge de-duplicates legacy untagged toolkit hooks by command identity.**
82
+ Scheduling fields (`async`, `timeout`, `statusMessage`, ...) no longer defeat
83
+ the match, so adding one in `app/hooks.json` does not leave existing installs
84
+ running the old and the new copy side by side. Fixed in both
85
+ `scripts/merge-hooks.py` and `scripts/inject_hook_cli.py`.
86
+ - **Test count.** Bats increased from 1931 to 1966; 348 pytest tests added under
87
+ `tests/python/` (run by the new `python-quality` CI job).
88
+
89
+ ### Ecosystem
90
+
91
+ - Ecosystem doctor run for this minor release: 12 tools drifted since the
92
+ v4.30.3 snapshot, all class A (content edits with no heading delta) or class
93
+ C (Cline gained a "Resources" heading, Codex CLI a "ChatGPT Work" heading;
94
+ neither adds a surface the toolkit integrates). Tracked versions moved:
95
+ Claude Code 2.1.252 -> 2.1.260 (its hooks documentation now lists the
96
+ `async` command-hook field this release relies on), Codex CLI 0.151.0 ->
97
+ 0.153.2. No generator changed; snapshot refreshed.
98
+
99
+ ## v4.31.0 - Toolkit rules reach every editor (2026-09-03)
100
+
101
+ ### Added
102
+
103
+ - The five top-level rule files in `app/rules/` ship as knowledge skills,
104
+ generated by `scripts/generate_toolkit_rules_skills.py` and wired as
105
+ `npm run generate:toolkit-rules`. Ten bats tests cover generation,
106
+ idempotence, and the content of the new rule.
107
+ - `app/rules/edit-discipline.md`: change files with the `edit` and `write`
108
+ tools rather than rewriting them through `bash`, and show `git diff` before
109
+ reporting a file-changing task as done.
110
+
111
+ ### Fixed
112
+
113
+ - **Every toolkit rule was inert outside Claude Code.** They existed only as
114
+ Claude Code user-level files under `~/.claude/rules/`, and the global
115
+ `CLAUDE.md` carried a pointer to them rather than their content — a Claude
116
+ Code idiom that assumes `/memory`. DeepSeek Harness reads `AGENTS.md`,
117
+ `AGENTS.local.md`, `CLAUDE.md` and `CLAUDE.local.md` and has no
118
+ rules-directory support at all, so under DSH the rules were named in an
119
+ injected file and never loaded. That is why an agent there kept rewriting
120
+ tracked files with `sed` while a rule forbidding exactly that sat unread.
121
+
122
+ Skills are discovered by every editor that reads the shared catalogue, and
123
+ the catalogue injects each skill's *description* into the session. The
124
+ descriptions are therefore written as the rule itself in one imperative
125
+ line: in context whether or not the body is loaded.
126
+
127
+ Verified against a live DSH session — the agent loaded `edit-discipline`
128
+ unprompted, used `write` and `edit` instead of `bash`, and rendered the
129
+ change as a diff.
130
+
131
+ ---
132
+
10
133
  ## v4.30.3 - Copilot health-check compatibility (2026-09-02)
11
134
 
12
135
  ### Fixed
package/README.md CHANGED
@@ -1,30 +1,35 @@
1
1
  # ai-toolkit
2
2
 
3
- > AI coding toolkit with machine-enforced safety, 109 skills, 44 agents, lifecycle hooks, persona presets, opt-in plugin packs, and benchmark tooling. DSH is available as a separate explicit developer-preview target.
3
+ > AI coding toolkit with machine-enforced safety, 114 skills, 44 agents, lifecycle hooks, persona presets, opt-in plugin packs, and benchmark tooling. DSH is available as a separate explicit developer-preview target.
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: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
7
- [![Skills](https://img.shields.io/badge/skills-109-brightgreen)](app/skills/)
7
+ [![Skills](https://img.shields.io/badge/skills-114-brightgreen)](app/skills/)
8
8
  [![Agents](https://img.shields.io/badge/agents-44-blue)](app/agents/)
9
- [![Tests](https://img.shields.io/badge/tests-1921%20passing-success)](tests/)
10
-
11
- ## What's New in v4.30.3
12
-
13
- **v4.30.3** corrects the post-release health check for the managed DSH and
14
- plugin-owned MCP release:
15
-
16
- - `ai-toolkit doctor` now extracts `1.0.80` from the official Copilot CLI output
17
- `GitHub Copilot CLI 1.0.80.` instead of treating sentence punctuation as an
18
- invalid SemVer suffix.
19
- - Complete-token validation remains fail closed for malformed versions such as
20
- `1.2.3.4`, invalid prerelease identifiers, and leading-zero numeric fields.
21
- - The DSH cold-add regression keeps its legacy-timeout coverage with macOS CI
22
- process-startup headroom, removing the release-blocking timing flake.
23
- - Release tags now require green Ubuntu and macOS branch CI for the exact commit
24
- before the publish workflow can start.
25
- - The release retains the explicit DSH lifecycle, plugin-owned MCP/rules, portable
26
- recovery gates, and the exact DSH package set published in v4.30.2. Test count:
27
- 1920 -> 1921.
9
+ [![Tests](https://img.shields.io/badge/tests-1966%20passing-success)](tests/)
10
+
11
+ ## What's New in v4.32.0
12
+
13
+ **v4.32.0** cuts what every session pays for before you type, and adds the
14
+ checks that keep it cut:
15
+
16
+ - Common rules are path-scoped from their source: `testing` and `performance`
17
+ load only for matching files, and the project `.claude/CLAUDE.md` index says
18
+ which rules are always-on instead of claiming lazy loading for all of them.
19
+ - Language knowledge skills follow your projects: `install --language-skills
20
+ detected` (default) turns off `<lang>-rules`/`<lang>-patterns` skills for
21
+ languages no registered project uses, reversibly, and restores them when a
22
+ project brings the language back.
23
+ - `ai-toolkit doctor` gains a Context Budget check (est. resident tokens,
24
+ zero-use skills) and a Permission Rules check (over-broad `permissions.allow`
25
+ wildcards). Both read-only.
26
+ - One strict frontmatter parser replaces twelve private copies; `validate.py`
27
+ now rejects descriptions over 1024 characters or unquoted ones containing
28
+ `: `. Every shipped Markdown file parses under the strict grammar.
29
+ - Team-only git conventions moved to a `git-team` rule that ships with
30
+ `--profile strict`; `quality-gate.sh` lints with ruff only when the project
31
+ configured ruff; advisory Stop hooks run in the background. Test count:
32
+ 1931 -> 1966 bats + 348 pytest.
28
33
 
29
34
  See [CHANGELOG.md](CHANGELOG.md) for full history.
30
35
 
@@ -60,7 +65,9 @@ ai-toolkit install
60
65
  npx @softspark/ai-toolkit install
61
66
  ```
62
67
 
63
- **That's it.** Claude Code picks up 109 skills, 44 agents, quality hooks, and the safety constitution automatically.
68
+ **That's it.** Claude Code picks up 114 skills, 44 agents, quality hooks, and the safety constitution automatically.
69
+
70
+ Language knowledge skills (`rust-rules`, `kotlin-patterns`, ...) are scoped to the languages your registered projects use: once you have run `ai-toolkit install --local` in at least one project, the global install turns the other languages' skills off through `skillOverrides` in `~/.claude/settings.json` so their descriptions stop loading into every session. A new project in a new language turns its skills back on. `ai-toolkit install --language-skills all` keeps every language skill on and remembers that choice; `ai-toolkit doctor` shows the resulting context budget.
64
71
 
65
72
  **Windows:** WSL is the recommended runtime. Native Windows works when Git Bash is available for hook scripts; dependency hints cover `winget`, Chocolatey, and Scoop. See [Windows Support](kb/reference/windows-support.md).
66
73
 
@@ -186,7 +193,7 @@ See [CLI Reference](kb/reference/cli-reference.md) for all commands and options.
186
193
  |-----------|-------|-------------|
187
194
  | `skills/` (task) | 32 | Slash commands: `/commit`, `/build`, `/deploy`, `/test`, `/mcp-builder`, ... |
188
195
  | `skills/` (hybrid) | 31 | Slash commands with agent knowledge base |
189
- | `skills/` (knowledge) | 46 | Domain knowledge auto-loaded by agents (includes 13 `<lang>-rules` skills) |
196
+ | `skills/` (knowledge) | 51 | Domain knowledge auto-loaded by agents (includes 13 `<lang>-rules` skills) |
190
197
  | `agents/` | 44 | Specialized agents across 10 categories |
191
198
  | `hooks/` | 28 entries / 14 events + statusLine | Quality gates, path safety, prompt governance, loop guard, session lifecycle |
192
199
  | `plugins/` | 2 packs | Opt-in packs that install files of their own (memory, enterprise) |
@@ -202,7 +209,7 @@ See [CLI Reference](kb/reference/cli-reference.md) for all commands and options.
202
209
  ai-toolkit/
203
210
  ├── app/
204
211
  │ ├── agents/ # 44 agent definitions
205
- │ ├── skills/ # 109 skills (task / hybrid / knowledge)
212
+ │ ├── skills/ # 114 skills (task / hybrid / knowledge)
206
213
  │ ├── rules/ # Source rules synced into Claude/editor rule files
207
214
  │ ├── hooks/ # Hook scripts (29 entries, 14 lifecycle events)
208
215
  │ ├── claude-app/ # Generated Chat/Cowork plugin rules, hooks, instructions
@@ -341,7 +348,7 @@ Need multi-agent coordination?
341
348
  | opencode Compatibility | [kb/reference/opencode-compatibility.md](kb/reference/opencode-compatibility.md) |
342
349
  | GitHub Copilot Compatibility | [kb/reference/copilot-compatibility.md](kb/reference/copilot-compatibility.md) |
343
350
  | DSH Compatibility | [kb/reference/dsh-compatibility.md](kb/reference/dsh-compatibility.md) |
344
- | Maintenance SOP | [kb/procedures/maintenance-sop.md](kb/procedures/maintenance-sop.md) |
351
+ | Maintenance SOP | [kb/procedures/sop-maintenance.md](kb/procedures/sop-maintenance.md) |
345
352
 
346
353
  ---
347
354
 
@@ -3,7 +3,7 @@
3
3
  "name": "ai-toolkit",
4
4
  "displayName": "AI Toolkit",
5
5
  "description": "Professional-grade engineering skills, agents, rules, and lifecycle guardrails for Claude Code, Claude Chat, and Cowork.",
6
- "version": "4.30.3",
6
+ "version": "4.32.0",
7
7
  "author": {
8
8
  "name": "SoftSpark",
9
9
  "url": "https://github.com/softspark"
@@ -59,6 +59,13 @@ Before reviewing, gather context using available tools:
59
59
  - Secrets management
60
60
  - IAM/permissions scope
61
61
 
62
+ ### 5. Frontend & UI Craft (Anti-Slop Audit)
63
+ - Generic AI tells: gradient text headlines, purple/blue washes, 3-column card clichés, nested cards
64
+ - Missing interactive states: lacking focus-visible, active, disabled, loading, error, success
65
+ - Input stability: layout shifts caused by changing border-widths
66
+ - Mobile responsiveness: horizontal scroll risk, clickable affordance text wrapping
67
+ - Fabricated content: invented metrics, fake testimonials, mock OS/browser chrome
68
+
62
69
  ## Review Checklist
63
70
 
64
71
  ### Security (check first)
@@ -78,6 +85,13 @@ Before reviewing, gather context using available tools:
78
85
  - [ ] Tests cover critical paths
79
86
  - [ ] Documentation is accurate
80
87
 
88
+ ### Frontend & UI Craft
89
+ - [ ] No gradient headlines (`background-clip: text`) or purple/blue gradient heroes
90
+ - [ ] Interactive elements implement all 8 states
91
+ - [ ] Inputs maintain constant 1px border-width (zero layout shift)
92
+ - [ ] Mobile responsive: `overflow-x: clip`, single-line button text
93
+ - [ ] No invented metrics, fake testimonials, or mock chrome
94
+
81
95
  ### Performance
82
96
  - [ ] No obvious N+1 queries
83
97
  - [ ] Resources are properly cleaned up
@@ -104,15 +104,17 @@ hybrid_search_kb("[UI patterns, accessibility]")
104
104
  - Image optimization
105
105
  - Bundle analysis
106
106
 
107
- ### Design Craft (impeccable-inspired — guidance, not mandate)
108
- Frontend is craft as much as system. Seven domains, one concrete rule each:
109
- - **Typography** — reject Arial/Inter defaults; pair display + text on a modular scale; enable OpenType features when they serve content
110
- - **Color** — prefer OKLCH; tint neutrals; no pure `#000`; verify gray-on-color contrast
111
- - **Spatial** — consistent spacing scale (4/8/12/16/24/32/48); do not nest cards in cards
112
- - **Motion** — no bounce/elastic easing; stagger reveals; respect `prefers-reduced-motion`
113
- - **Interaction** — replace default focus outlines, never just remove; loaders show progress; errors name the remedy
114
- - **Responsive** — mobile-first; `clamp()` for fluid type; container queries for component-level behavior
115
- - **UX Writing** — button labels = verb + object; errors = cause + remedy; empty states earn their screen
107
+ ### Design Craft & Anti-Slop Standards
108
+ Frontend is craft as much as system. Core non-negotiables:
109
+ - **Typography (2+1 Rule)** — Reject Inter/system-default with no pairing; pair display + text on a modular scale; display headers are strictly roman (`font-style: normal`, never italic emphasis words in headlines); max 3 font families, outlier face in at most 2 slots.
110
+ - **Color & Locked Tokens** — Prefer OKLCH; tint neutral surfaces toward anchor hue (>=0.005 chroma); no pure `#000`/`#fff`; lock tokens to CSS variables (`var(--color-accent)`) without inline hex/rgb improvisation; accent area <=5% of viewport.
111
+ - **Spatial & Macrostructures** — Reject default-attractor rhythm (Hero → 3 features → CTA → footer); choose distinct macrostructures (Bento Grid, Long Document, Marquee, Stat-Led, Workbench, FAQ, Manifesto); do not nest cards in cards or use thick side stripes.
112
+ - **8 Interactive States** — Every interactive component MUST implement all 8 states: default, hover, focus-visible, active, disabled, loading, error, success.
113
+ - **Input Stability (Zero Layout Shift)** — Constant 1px `border-width` across all states; reserve 2px transparent outline at rest; input height = button height (>=44px floor); reserve 1lh helper text slot.
114
+ - **Responsive Non-Negotiables** — Mobile-first (320px–768px verified); `overflow-x: clip` on `html` and `body`; clickable buttons/links never wrap to 2 lines; image grid tracks use `minmax(0, 1fr)`.
115
+ - **Motion** — No bounce/elastic easing; GPU-accelerated transforms; faster exit than enter; respect `prefers-reduced-motion`.
116
+ - **Content Honesty & No Fake Chrome** — Never invent metrics, testimonials, or fake logos; do not hand-draw fake browser/phone frames.
117
+ - **Pre-Emit Self-Critique** — Score output 1–5 on Philosophy, Hierarchy, Execution, Specificity, Restraint, Variety (all >=3).
116
118
 
117
119
  ### AI-Native UI (inspired by 21st.dev)
118
120
  For agentic / LLM-powered products: streaming messages, tool-call expandables, agent-plan visualizations, prompt boxes with inline controls, spending guardrails in UI, retry/stop affordances, draft preservation across navigation.
@@ -122,13 +124,13 @@ For agentic / LLM-powered products: streaming messages, tool-call expandables, a
122
124
  ### Component Design
123
125
  ✅ Single responsibility per component
124
126
  ✅ Props interface with TypeScript
125
- ✅ Accessible by default (ARIA, keyboard)
126
- ✅ Responsive mobile-first
127
+ ✅ Accessible by default (ARIA, keyboard, focus-visible)
128
+ ✅ Responsive mobile-first with 8 interactive states
127
129
  ✅ Error boundaries for failure handling
128
130
 
129
131
  ❌ Don't create god components
130
- ❌ Don't inline all styles
131
- ❌ Don't skip accessibility
132
+ ❌ Don't inline all styles or improvise tokens mid-render
133
+ ❌ Don't skip accessibility or interactive states
132
134
 
133
135
  ### State Management
134
136
  ✅ Colocate state near usage
@@ -138,7 +140,7 @@ For agentic / LLM-powered products: streaming messages, tool-call expandables, a
138
140
 
139
141
  ### Performance
140
142
  ✅ Lazy load routes and heavy components
141
- ✅ Optimize images (next/image, @nuxt/image)
143
+ ✅ Optimize images (next/image, @nuxt/image, fetchpriority for LCP)
142
144
  ✅ Minimize bundle size
143
145
  ✅ Use virtualization for long lists
144
146
 
@@ -147,18 +149,19 @@ For agentic / LLM-powered products: streaming messages, tool-call expandables, a
147
149
  ### Engineering
148
150
  ❌ **Prop drilling** → Use context or state management
149
151
  ❌ **Unnecessary re-renders** → Memoize appropriately
150
- ❌ **Layout shift** → Reserve space, use skeleton
152
+ ❌ **Layout shift** → Reserve space, use skeleton, constant 1px input borders
151
153
  ❌ **Giant components** → Split into smaller units
152
154
 
153
- ### Taste (the LLM defaults — reject on sight)
154
- Arial / Inter / system-default type with no intentional pairing
155
- Gray text on colored backgrounds (contrast failure)
156
- Pure `#000` black use tinted near-black
157
- Cards nested inside cards flatten with type + spacing hierarchy
158
- Bounce / elastic easing curves (feel dated)
159
- Purple gradients (the generic-LLM tell)
160
- Motion that ignores `prefers-reduced-motion`
161
- Generic stock illustrations for empty states
155
+ ### Taste & AI-Slop (Reject on Sight)
156
+ Saturated purple-to-pink/blue full-bleed gradient heroes or gradient headline text (`background-clip: text`)
157
+ 3-equal-column cards with icon-above-heading tiles (the generic AI template)
158
+ Cards nested inside cards or cards with thick side-stripe borders
159
+ Missing interactive states (only styling default + hover, forgetting focus/active/disabled/error/loading)
160
+ Changing `border-width` on input focus/hover causing layout shifts
161
+ Italic headings or single-word italic emphasis in headlines
162
+ Pure `#000` / `#fff` flat backgrounds with zero tint
163
+ Invented metrics ("+47% conversion"), fake testimonials, or placeholder stock logos
164
+ ❌ Re-drawn fake browser bars / phone chrome
162
165
  ❌ Emoji standing in for proper icons
163
166
 
164
167
  ## 🔴 MANDATORY: Post-Code Validation
@@ -18,7 +18,7 @@ Ensure deployments are successful, services are healthy, and rollback procedures
18
18
  ```python
19
19
  # ALWAYS call this FIRST - NO TEXT BEFORE
20
20
  smart_query(query="deployment validation: {service}")
21
- get_document(path="procedures/maintenance-sop.md")
21
+ get_document(path="procedures/sop-maintenance.md")
22
22
  hybrid_search_kb(query="health check {service}", limit=10)
23
23
  ```
24
24
 
@@ -172,7 +172,7 @@ deployment:
172
172
  status: successful
173
173
  rollback_tested: yes
174
174
  kb_references:
175
- - kb/procedures/maintenance-sop.md
175
+ - kb/procedures/sop-maintenance.md
176
176
  next_agent: documenter
177
177
  instructions: |
178
178
  Update deployment documentation with any changes
@@ -151,7 +151,8 @@
151
151
  "hooks": [
152
152
  {
153
153
  "type": "command",
154
- "command": "AI_TOOLKIT_DIR=\"${CLAUDE_PLUGIN_ROOT}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/quality-check.sh\""
154
+ "command": "AI_TOOLKIT_DIR=\"${CLAUDE_PLUGIN_ROOT}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/quality-check.sh\"",
155
+ "async": true
155
156
  }
156
157
  ]
157
158
  },
@@ -160,7 +161,8 @@
160
161
  "hooks": [
161
162
  {
162
163
  "type": "command",
163
- "command": "AI_TOOLKIT_DIR=\"${CLAUDE_PLUGIN_ROOT}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/save-session.sh\""
164
+ "command": "AI_TOOLKIT_DIR=\"${CLAUDE_PLUGIN_ROOT}\" \"${CLAUDE_PLUGIN_ROOT}/hooks/save-session.sh\"",
165
+ "async": true
164
166
  }
165
167
  ]
166
168
  },
@@ -23,7 +23,10 @@ Shared AI development toolkit — lifecycle hooks, safety constitution, multi-pl
23
23
 
24
24
  ## Path Safety
25
25
  - NEVER guess or hallucinate user home directory paths
26
- - Use `~` or `$HOME` instead of hardcoded `/Users/<username>/` or `/home/<username>/`
26
+ - Use `~` or `$HOME` instead of a hardcoded `/Users` or `/home` prefix followed
27
+ by a user name. The literal prefix is deliberately not written out here: the
28
+ plugin export scans shipped files for exactly that pattern, so an example of
29
+ the mistake would be indistinguishable from the mistake.
27
30
  - When an absolute path is needed, run `echo $HOME` first to get the correct value
28
31
 
29
32
  ## User Preferences
@@ -32,6 +35,46 @@ Shared AI development toolkit — lifecycle hooks, safety constitution, multi-pl
32
35
  - **Methodology:** Provide >=3 alternatives. Use Socratic questioning.
33
36
  - **Review:** Apply "Devil's Advocate" critique to decisions.
34
37
 
38
+ ## Source: `app/rules/edit-discipline.md`
39
+
40
+ # Edit Discipline & Reviewable Changes
41
+
42
+ ## Edit files with the editing tools, not the shell
43
+
44
+ Use the `edit` and `write` tools to change a file. Do not rewrite tracked files
45
+ through `bash` with `sed`, `awk`, `tee`, a heredoc, or `>` redirection.
46
+
47
+ This is not a style preference. A shell rewrite is opaque to the host: the
48
+ session records a command, not a change. An `edit` call records which file
49
+ changed and how, so the interface can render it, a reviewer can read it, and a
50
+ later turn can cite it. A `sed` line records none of that, and the only way to
51
+ find out what happened is to read the file again.
52
+
53
+ The shell remains correct for what it is for: running builds, tests, linters,
54
+ git, package managers, and generators that own their own output.
55
+
56
+ ## Show the change before calling the work done
57
+
58
+ Before reporting a file-changing task as finished, show what changed:
59
+
60
+ ```bash
61
+ git diff -- <paths> # tracked files
62
+ git status --short # what is new or removed
63
+ ```
64
+
65
+ Paste the diff into the reply, or state precisely why it is too large and
66
+ summarise it by file with the counts. A task that reports success without
67
+ showing the change asks the reader to take the result on trust, and the reader
68
+ is the one who has to decide whether to commit it.
69
+
70
+ For an untracked file, show the content you wrote, not a description of it.
71
+
72
+ ## Why both halves matter together
73
+
74
+ Editing through the tools makes a change *recordable*; showing the diff makes it
75
+ *reviewed*. Either alone leaves the person deciding whether to ship blind to
76
+ something they are accountable for.
77
+
35
78
  ## Source: `app/rules/git-conventions.md`
36
79
 
37
80
  # Git Conventions
@@ -164,27 +207,22 @@ Default response mode for this project is **concise**. The `brand-voice` skill (
164
207
  - Magic numbers/strings: use named constants.
165
208
  - Mutable global state: use dependency injection instead.
166
209
 
167
- ## Source: `app/rules/common/git-workflow.md`
210
+ ## Source: `app/rules/common/git-team.md`
168
211
 
169
- # Git Workflow Rules
212
+ # Git Team Workflow Rules
170
213
 
171
- ## Commit Messages
172
- - Use conventional commits: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`.
173
- - First line: imperative mood, max 72 chars (`feat: add user registration endpoint`).
174
- - Body (optional): explain *why*, not *what*. The diff shows what.
175
- - Reference tickets: `fix: prevent duplicate orders (PROJ-456)`.
176
-
177
- ## Commit Practices
178
- - Commit small, atomic changes. One commit = one logical change.
179
- - Never commit: secrets, `.env` files, build artifacts, large binaries.
180
- - Never commit broken code to `main`. Use feature branches.
181
- - Squash fixup commits before merging to keep history clean.
214
+ These rules assume more than one person merges into `main`. They ship only with
215
+ the `strict` profile; a solo maintainer who commits straight to `main` is not
216
+ doing anything wrong, and a reviewer that keeps flagging "use a feature branch"
217
+ in that setting is noise. The solo-safe core (commit format, no secrets, no
218
+ force-push) lives in `git-workflow`.
182
219
 
183
220
  ## Branching
184
- - `main` is always deployable. Protect it with required reviews and CI.
185
- - Feature branches: `feat/user-registration`, `fix/order-total-calc`.
221
+ - Protect `main` with required reviews and CI. Never commit broken code to it.
222
+ - Work on feature branches: `feat/user-registration`, `fix/order-total-calc`.
223
+ - Rebase feature branches on `main` before opening a PR to keep linear history.
224
+ - Squash fixup commits before merging to keep history clean.
186
225
  - Delete branches after merge. Stale branches are clutter.
187
- - Rebase feature branches on main before PR to keep linear history.
188
226
 
189
227
  ## Pull Requests
190
228
  - Keep PRs small: <400 lines changed. Split large features into stacked PRs.
@@ -197,6 +235,25 @@ Default response mode for this project is **concise**. The `brand-voice` skill (
197
235
  - Approve with comments if nits only. Block for: bugs, security, missing tests.
198
236
  - Respond to reviews within 24 hours. Do not let PRs rot.
199
237
 
238
+ ## Source: `app/rules/common/git-workflow.md`
239
+
240
+ # Git Workflow Rules
241
+
242
+ Solo-safe core: everything here holds whether one person or twenty merge into
243
+ `main`. Branching, pull-request, and review conventions for teams live in
244
+ `git-team` and ship only with the `strict` profile.
245
+
246
+ ## Commit Messages
247
+ - Use conventional commits: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`.
248
+ - First line: imperative mood, max 72 chars (`feat: add user registration endpoint`).
249
+ - Body (optional): explain *why*, not *what*. The diff shows what.
250
+ - Reference tickets: `fix: prevent duplicate orders (PROJ-456)`.
251
+
252
+ ## Commit Practices
253
+ - Commit small, atomic changes. One commit = one logical change.
254
+ - Never commit: secrets, `.env` files, build artifacts, large binaries.
255
+ - `main` is always deployable: run the project's gates before every commit that lands there.
256
+
200
257
  ## Tags and Releases
201
258
  - Use semantic versioning: MAJOR.MINOR.PATCH.
202
259
  - Tag releases: `git tag v1.2.3`. Automate changelog from commits.
@@ -98,8 +98,15 @@ if [ -f .claude/test-cohesion-map.json ] || \
98
98
  fi
99
99
 
100
100
  if [ -f pyproject.toml ] || [ -f setup.py ]; then
101
- if require_command ruff; then
102
- run_required "ruff found errors" "head -30" ruff check .
101
+ # Lint only what the project itself configured. A bare pyproject.toml
102
+ # (build metadata, pytest/mypy tables) says nothing about ruff, and running
103
+ # `ruff check .` under whatever config the machine resolves turns the Stop
104
+ # gate red on findings the project never signed up for (v4.32.0 postmortem:
105
+ # 348 findings in a repo whose ruff rule set lives in a package.json script).
106
+ if [ -f ruff.toml ] || [ -f .ruff.toml ] || grep -qs '^\[tool\.ruff' pyproject.toml; then
107
+ if require_command ruff; then
108
+ run_required "ruff found errors" "head -30" ruff check .
109
+ fi
103
110
  fi
104
111
  if [ -d src ] && [ "$PROFILE" = "strict" ]; then
105
112
  if require_command mypy; then
package/app/hooks.json CHANGED
@@ -167,7 +167,8 @@
167
167
  "hooks": [
168
168
  {
169
169
  "type": "command",
170
- "command": "\"$HOME/.softspark/ai-toolkit/hooks/quality-check.sh\""
170
+ "command": "\"$HOME/.softspark/ai-toolkit/hooks/quality-check.sh\"",
171
+ "async": true
171
172
  }
172
173
  ]
173
174
  },
@@ -177,7 +178,8 @@
177
178
  "hooks": [
178
179
  {
179
180
  "type": "command",
180
- "command": "\"$HOME/.softspark/ai-toolkit/hooks/save-session.sh\""
181
+ "command": "\"$HOME/.softspark/ai-toolkit/hooks/save-session.sh\"",
182
+ "async": true
181
183
  }
182
184
  ]
183
185
  },
@@ -8,26 +8,34 @@
8
8
  - Names specific failure modes; rejects vague advice like "use good design"
9
9
 
10
10
  ## Design Craft Priorities
11
- Impeccable frontend covers seven domains. One concrete rule per domain (guidance, not mandate):
11
+ Core frontend craft covers eight domains (guidance, not mandate):
12
12
 
13
- 1. **Typography** — Reject Arial/Inter as defaults. Pair display + text faces on a modular scale (e.g., 1.125 / 1.25 / 1.333). Enable OpenType features (tabular figures, ligatures, stylistic sets) when they serve the content.
14
- 2. **Color & Contrast** — Prefer OKLCH over HSL/RGB for perceptual uniformity. Tint neutrals toward the brand hue (pure grays feel sterile). Never pure `#000` use tinted near-black. Gray-on-color frequently fails contrast; verify.
15
- 3. **Spatial** — Consistent spacing scale (e.g., 4/8/12/16/24/32/48), not ad-hoc pixel values. Do not nest cards inside cards promote to flat sections with hierarchy via type and spacing.
16
- 4. **Motion** — Easing conveys mass and intent. Avoid bounce/elastic curves (feel dated). Stagger sequential reveals. Always respect `prefers-reduced-motion`.
17
- 5. **Interaction** — Replace default focus outlines; never just remove them. Loading states show progress, not just spinners. Errors name the remedy, not just the failure.
18
- 6. **Responsive** — Mobile-first. Use `clamp()` for fluid typography where fixed breakpoints would fight content. Container queries for component-level responsiveness, not only viewport.
19
- 7. **UX Writing** — Button labels = verb + object ("Save changes", not "OK"). Error messages = cause + remedy. Empty states earn their screen with value, not apologies.
13
+ 1. **Typography (2+1 Rule)** — Reject Arial/Inter as unconsidered defaults. Pair display + text faces on a modular scale. Display headers are strictly roman (`font-style: normal`, never single-word italic emphasis in headlines). Max 3 font families; outlier face used in at most 2 slots.
14
+ 2. **Color & Locked Tokens** — Prefer OKLCH over HSL/RGB for perceptual uniformity. Tint neutrals toward the brand hue (pure grays feel sterile; minimum 0.005 chroma). Never pure `#000` or `#fff`. Lock tokens to CSS variables (`var(--color-accent)`) without mid-render inline hex/rgb improvisation. Keep accent area <=5% of viewport.
15
+ 3. **Spatial & Macrostructures** — Consistent spacing scale (e.g., 4/8/12/16/24/32/48), not ad-hoc pixel values. Break the repetitive Hero 3 features CTA footer template by choosing intentional macrostructures (Bento Grid, Long Document, Marquee, Stat-Led, Workbench, FAQ, Manifesto). Do not nest cards inside cards or use thick side stripes.
16
+ 4. **Motion** — Easing conveys mass and intent. Avoid bounce/elastic curves (feel dated). Stagger sequential reveals. Exit faster than enter. Always respect `prefers-reduced-motion`.
17
+ 5. **Interaction & 8 States** — Every interactive element implements all 8 states: default, hover, focus-visible, active, disabled, loading, error, success. Maintain constant 1px `border-width` on inputs across all states (zero layout shift) with a reserved 2px transparent outline. Input height equals button height (>=44px floor).
18
+ 6. **Responsive Non-Negotiables** — Mobile-first (320px–768px verified). Apply `overflow-x: clip` on `html` and `body` (never `hidden`). Buttons, nav links, and CTAs never wrap to 2 lines. Use `minmax(0, 1fr)` for image grid tracks.
19
+ 7. **UX Writing** — Button labels = verb + object ("Save changes", not "OK"). Error messages = cause + remedy. Empty states earn their screen with value, not apologies. Never invent fake metrics or testimonials.
20
+ 8. **Pre-Emit Self-Critique** — Score output 1–5 on Philosophy, Hierarchy, Execution, Specificity, Restraint, Variety (all >=3).
20
21
 
21
- ## Anti-Patterns (Taste Failures)
22
+ ## Anti-Patterns (Taste & AI-Slop Failures)
22
23
  The LLM defaults — reject on sight:
24
+ - Saturated purple-to-pink/blue full-bleed gradient heroes or gradient headline text (`background-clip: text`)
25
+ - Cliché 3-equal-column cards with icon-above-heading tiles
26
+ - Cards nested inside cards or cards with thick side-stripe borders
23
27
  - Arial / Inter / system-default typography with no intentional pairing
28
+ - Italic headings or single-word italic emphasis in headlines
29
+ - Changing `border-width` on input focus/hover causing layout shifts
30
+ - Missing interactive states (only styling default + hover)
31
+ - Buttons or links wrapping to two lines on mobile
24
32
  - Gray text on colored backgrounds (contrast failure)
25
- - Pure `#000` black (use tinted near-black instead)
26
- - Cards nested inside cards
33
+ - Pure `#000` black or `#fff` flat surfaces (use tinted neutrals)
27
34
  - Bounce / elastic easing curves
28
- - Purple gradients (the generic-LLM tell)
29
35
  - Motion that ignores `prefers-reduced-motion`
30
36
  - Generic stock illustrations for empty states
37
+ - Fake re-drawn browser bars or phone chrome
38
+ - Invented metrics ("+47% conversion"), fake testimonials, or placeholder stock logos
31
39
  - Emoji standing in for proper icons (outside branded contexts)
32
40
  - Everything centered because no layout opinion was formed
33
41
 
@@ -11,7 +11,10 @@ Shared AI development toolkit — lifecycle hooks, safety constitution, multi-pl
11
11
 
12
12
  ## Path Safety
13
13
  - NEVER guess or hallucinate user home directory paths
14
- - Use `~` or `$HOME` instead of hardcoded `/Users/<username>/` or `/home/<username>/`
14
+ - Use `~` or `$HOME` instead of a hardcoded `/Users` or `/home` prefix followed
15
+ by a user name. The literal prefix is deliberately not written out here: the
16
+ plugin export scans shipped files for exactly that pattern, so an example of
17
+ the mistake would be indistinguishable from the mistake.
15
18
  - When an absolute path is needed, run `echo $HOME` first to get the correct value
16
19
 
17
20
  ## User Preferences