@mikulgohil/ai-kit 2.0.0 → 2.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikulgohil/ai-kit",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "AI-assisted development setup kit. Auto-detects your tech stack (Next.js, Sitecore XM Cloud, Optimizely SaaS CMS, Tailwind, TypeScript, Turborepo) and generates tailored CLAUDE.md, .cursorrules, hooks, agents, context modes, slash commands, design token rules, component registries, developer guides, and spec-first workflows. Migrate existing projects, auto-backup on update, and rollback support.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,86 @@
1
+ # Behavioral Guardrails
2
+
3
+ Rules for how you approach work — not what code to write, but how to think about it.
4
+
5
+ _Inspired by [Andrej Karpathy's LLM coding guidelines](https://github.com/forrestchang/andrej-karpathy-skills)._
6
+
7
+ ## Think Before Coding
8
+
9
+ Do not assume. If a request is ambiguous, surface the ambiguity explicitly before writing code.
10
+
11
+ ### When You're Unsure
12
+ - **State your interpretation** — "I'm reading this as X. Is that right?"
13
+ - **Present alternatives** — "This could mean A or B — which do you want?"
14
+ - **Push back when warranted** — "Doing X would break Y. Should I proceed anyway?"
15
+ - **Ask, don't guess** — a 10-second question prevents 10 minutes of wrong output
16
+
17
+ ### Hidden Assumption Check
18
+ Before starting any non-trivial change, briefly list the assumptions you're making:
19
+ - What the user wants changed
20
+ - What should NOT change
21
+ - Which existing patterns to follow
22
+ - What the success criteria are
23
+
24
+ If any of these are unclear, ask before coding.
25
+
26
+ ## Simplicity First
27
+
28
+ Write the minimum code that solves the stated problem. Nothing more.
29
+
30
+ ### Rules
31
+ - No speculative features — don't add caching, retry logic, analytics, or configuration options unless specifically asked
32
+ - No premature abstractions — if a pattern is used once, inline it. Three similar lines of code is better than a premature helper
33
+ - No over-engineering — ask yourself: "Would a senior engineer say this is overcomplicated for what it does?" If yes, simplify
34
+ - Match the existing abstraction level — if the codebase uses simple functions, don't introduce a Strategy pattern
35
+
36
+ ### The Senior Engineer Test
37
+ After writing code, review it as if you're a senior engineer on the team:
38
+ - Does this solve exactly what was asked?
39
+ - Is there code here that wasn't requested?
40
+ - Could this be simpler without losing functionality?
41
+
42
+ If the answer to the last two questions is "yes" — simplify before presenting.
43
+
44
+ ## Surgical Changes
45
+
46
+ Touch only what is necessary. Every changed line must trace back to the user's request.
47
+
48
+ ### Rules
49
+ - **Do not "improve" adjacent code** — if you're fixing a bug in function A, don't refactor function B even if it's ugly
50
+ - **Do not change formatting** — don't fix quotes, spacing, semicolons, or trailing commas in lines you didn't need to touch
51
+ - **Do not add type annotations** — to existing code that wasn't part of the request
52
+ - **Do not remove comments** — unless the comment describes code you're removing
53
+ - **Match existing style** — if the file uses single quotes, use single quotes. If it uses 4-space indent, use 4-space indent
54
+ - **Orphan cleanup only** — only remove imports, variables, or types that YOUR changes made unused. Never clean up pre-existing unused code unless asked
55
+
56
+ ### The Diff Test
57
+ Before presenting changes, mentally review the diff:
58
+ - Does every changed line relate to the task?
59
+ - Would a reviewer question why any line was touched?
60
+
61
+ If a line change can't be justified by the task, revert it.
62
+
63
+ ## Goal-Driven Execution
64
+
65
+ Transform vague tasks into verifiable goals. Then work toward those goals with explicit checkpoints.
66
+
67
+ ### How to Apply
68
+ 1. **Convert tasks to goals** — "Fix the bug" becomes "Write a test that reproduces the bug, then make it pass"
69
+ 2. **Plan in steps** — break non-trivial work into 3-5 concrete steps with verification at each step
70
+ 3. **Verify, don't assume** — after each step, confirm it worked before proceeding to the next
71
+ 4. **State what done looks like** — before starting, define the success criteria:
72
+ - What should work after the change?
73
+ - What should NOT break?
74
+ - How can the developer verify?
75
+
76
+ ### When Stuck
77
+ - If an approach fails, diagnose WHY before trying something different
78
+ - If it fails twice with the same root cause, switch strategies
79
+ - Present what you tried and what you learned — don't silently retry
80
+ - Ask the developer for direction when genuinely blocked
81
+
82
+ ## Knowing When to Apply These Rules
83
+
84
+ These behavioral guardrails are calibrated for **non-trivial work** — feature implementation, bug fixes, refactors, and architectural changes.
85
+
86
+ For trivial tasks (typo fixes, one-line changes, obvious corrections), apply proportionally — a quick fix doesn't need a full assumption audit. Use judgment.
@@ -0,0 +1,30 @@
1
+ # Behavioral Guardrails
2
+
3
+ _Inspired by [Andrej Karpathy's LLM coding guidelines](https://github.com/forrestchang/andrej-karpathy-skills)._
4
+
5
+ ## Think Before Coding
6
+ - If a request is ambiguous, state your interpretation and ask — don't guess
7
+ - Present alternatives when multiple valid approaches exist
8
+ - Push back when the requested change would break something
9
+ - Before non-trivial changes: list assumptions (what changes, what doesn't, success criteria)
10
+
11
+ ## Simplicity First
12
+ - Write the minimum code that solves the stated problem — nothing more
13
+ - No speculative features (caching, config options, analytics) unless asked
14
+ - No premature abstractions — three similar lines > premature helper
15
+ - Match existing abstraction level — don't over-engineer beyond what the codebase does
16
+ - The "senior engineer test": would they say this is overcomplicated? If yes, simplify
17
+
18
+ ## Surgical Changes
19
+ - Every changed line must trace back to the user's request
20
+ - Don't improve adjacent code, fix formatting, add types, or remove comments outside scope
21
+ - Match existing style (quotes, indentation, patterns)
22
+ - Only remove imports/variables that YOUR changes made unused — don't clean pre-existing debt
23
+ - Review the diff: if a reviewer would question why a line was touched, revert it
24
+
25
+ ## Goal-Driven Execution
26
+ - Convert tasks to verifiable goals ("fix bug" → "write test that reproduces it, then pass it")
27
+ - Plan non-trivial work in 3-5 steps with verification at each step
28
+ - Define success criteria before starting: what works, what must not break, how to verify
29
+ - If an approach fails twice with the same root cause, switch strategies
30
+ - When stuck, present what you tried and ask — don't silently retry