agy-superpowers 5.2.3 → 5.2.4

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": "agy-superpowers",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
4
4
  "description": "Superpowers skills library for Google Antigravity agent — scaffold .agent/ with one command",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,80 @@
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # CLAUDE.md
6
+
7
+ Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
8
+
9
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
10
+
11
+ > **TL;DR — 4 rules to always follow:**
12
+ > 1. **Think first** — State assumptions, ask when unclear, present tradeoffs before acting.
13
+ > 2. **Simplicity** — Minimum code that solves the problem. If it could be 50 lines, don't write 200.
14
+ > 3. **Surgical** — Touch only what the request requires. Don't improve adjacent code.
15
+ > 4. **Verify** — Define success criteria upfront. Don't claim done without running the check.
16
+
17
+ ## 1. Think Before Coding
18
+
19
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
20
+
21
+ Before implementing:
22
+
23
+ - State your assumptions explicitly. If uncertain, ask.
24
+ - If multiple interpretations exist, present them - don't pick silently.
25
+ - If a simpler approach exists, say so. Push back when warranted.
26
+ - If something is unclear, stop. Name what's confusing. Ask.
27
+
28
+ ## 2. Simplicity First
29
+
30
+ **Minimum code that solves the problem. Nothing speculative.**
31
+
32
+ - No features beyond what was asked.
33
+ - No abstractions for single-use code.
34
+ - No "flexibility" or "configurability" that wasn't requested.
35
+ - No error handling for impossible scenarios.
36
+ - If you write 200 lines and it could be 50, rewrite it.
37
+
38
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
39
+
40
+ ## 3. Surgical Changes
41
+
42
+ **Touch only what you must. Clean up only your own mess.**
43
+
44
+ When editing existing code:
45
+
46
+ - Don't "improve" adjacent code, comments, or formatting.
47
+ - Don't refactor things that aren't broken.
48
+ - Match existing style, even if you'd do it differently.
49
+ - If you notice unrelated dead code, mention it - don't delete it.
50
+
51
+ When your changes create orphans:
52
+
53
+ - Remove imports/variables/functions that YOUR changes made unused.
54
+ - Don't remove pre-existing dead code unless asked.
55
+
56
+ The test: Every changed line should trace directly to the user's request.
57
+
58
+ ## 4. Goal-Driven Execution
59
+
60
+ **Define success criteria. Loop until verified.**
61
+
62
+ Transform tasks into verifiable goals:
63
+
64
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
65
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
66
+ - "Refactor X" → "Ensure tests pass before and after"
67
+
68
+ For multi-step tasks, state a brief plan:
69
+
70
+ ```
71
+ 1. [Step] → verify: [check]
72
+ 2. [Step] → verify: [check]
73
+ 3. [Step] → verify: [check]
74
+ ```
75
+
76
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
77
+
78
+ ---
79
+
80
+ **These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
@@ -5,6 +5,8 @@ alwaysApply: true
5
5
 
6
6
  # Code Styles
7
7
 
8
+ > **Core rule:** ESM only (`import`/`export`), single quotes, semicolons always, camelCase vars, 2-space indent, zero npm dependencies, no TypeScript.
9
+
8
10
  <HARD-GATE>
9
11
  Before writing, modifying, or generating ANY code, you MUST read this file and strictly follow every rule defined below.
10
12
  If a section is empty, skip it — but never skip reading this file.
@@ -19,51 +21,48 @@ Delete the placeholder comments and replace them with your actual conventions.
19
21
 
20
22
  ## Naming Conventions
21
23
 
22
- <!-- Examples:
23
- - Variables: camelCase
24
- - Components: PascalCase
25
- - Files: kebab-case
26
- - Constants: UPPER_SNAKE_CASE
27
- -->
24
+ - Variables & functions: `camelCase`
25
+ - Constants: `UPPER_SNAKE_CASE`
26
+ - Files & folders: `kebab-case`
27
+ - No PascalCase (no classes/components in this project)
28
28
 
29
29
  ## File & Folder Structure
30
30
 
31
- <!-- Examples:
32
- - Feature-based folder structure
33
- - One component per file
34
- - Index files for barrel exports
35
- -->
31
+ - `bin/` — CLI entry points only
32
+ - `scripts/` build/utility scripts, not shipped
33
+ - `template/` files copied to user's `.agent/` on `init`
34
+ - `.agent/` agent rules, skills, workflows (not in `files[]`)
35
+ - One responsibility per file; no barrel index files needed
36
36
 
37
37
  ## Formatting
38
38
 
39
- <!-- Examples:
40
39
  - Indentation: 2 spaces
41
- - Max line length: 100
42
- - Semicolons: always / never
43
- - Quotes: single / double
44
- -->
40
+ - Quotes: **single quotes** (`'`) everywhere
41
+ - Semicolons: **always**
42
+ - Max line length: 100 characters (soft limit)
43
+ - Trailing commas: yes (ES2017+)
45
44
 
46
45
  ## Comments & Documentation
47
46
 
48
- <!-- Examples:
49
- - JSDoc for public functions
50
- - No obvious comments
51
- - TODO format: // TODO(username): description
52
- -->
47
+ - File path comment on line 2: `// bin/init.js`
48
+ - Usage comment where non-obvious: `// Usage: ...`
49
+ - No obvious comments ("increment i by 1")
50
+ - No JSDoc unless the function is exported as a public API
53
51
 
54
52
  ## Patterns & Conventions
55
53
 
56
- <!-- Examples:
57
- - State management: Zustand
58
- - Error handling: try/catch with custom error classes
59
- - Async: async/await over .then()
60
- - Imports order: external internal → types
61
- -->
54
+ - Module system: **ESM** (`import`/`export`) — `"type": "module"` in package.json
55
+ - Async: `async/await` over `.then()`
56
+ - Error handling: `console.error()` + `process.exit(1)` for CLI errors
57
+ - File system: Node.js `fs` (sync preferred for CLI scripts — simple, no callback hell)
58
+ - `__dirname` workaround for ESM: `path.dirname(fileURLToPath(import.meta.url))`
59
+ - Imports order: Node built-ins → npm packages → local files
62
60
 
63
61
  ## Anti-Patterns (DO NOT)
64
62
 
65
- <!-- Examples:
66
- - No any type in TypeScript
67
- - No console.log in production code
68
- - No inline styles in React components
69
- -->
63
+ - No TypeScript — this project is plain JavaScript
64
+ - No `require()` ESM only
65
+ - No `console.log` in production paths for errors — use `console.error()`
66
+ - No dependencies in `package.json` — keep the CLI zero-dependency
67
+ - No dynamic `import()` unless absolutely necessary
68
+ - No `any` guesses — if path/logic is unclear, fail loudly with a message
@@ -5,6 +5,8 @@ alwaysApply: true
5
5
 
6
6
  # Debug Confirmation Policy
7
7
 
8
+ > **Core rule:** NEVER write fix code before presenting Root Cause + Evidence + Proposed Fix and getting explicit user confirmation.
9
+
8
10
  <HARD-GATE>
9
11
  When you identify a bug, error, test failure, or any code that needs fixing —
10
12
  whether the user asked you to fix it, or you discovered it yourself —
@@ -15,6 +15,8 @@ This gate applies exclusively to `.agent/rules/` files.
15
15
 
16
16
  # File Length Policy
17
17
 
18
+ > **Core rule:** Before writing to any `.agent/rules/` file, check its size. If adding content would exceed 12,000 characters total, create a new file instead.
19
+
18
20
  ## Hard Limit: 12,000 Characters Per File
19
21
 
20
22
  Every file in `.agent/rules/` has a **hard character limit of 12,000 characters**.
@@ -1,5 +1,12 @@
1
+ ---
2
+ description: Git write operations — check auto_commit before any git write command
3
+ alwaysApply: true
4
+ ---
5
+
1
6
  # Git Policy
2
7
 
8
+ > **Core rule:** Before ANY git write operation, read `.agent/config.yml` — if `auto_commit: false`, skip the operation and print "Skipping git operation (auto_commit: false)."
9
+
3
10
  <HARD-GATE>
4
11
  Before running ANY git write operation — git add, git commit, git push,
5
12
  git pull, git merge, git tag, git branch -d, git branch -D, git worktree remove,
@@ -5,6 +5,8 @@ alwaysApply: true
5
5
 
6
6
  # Language Matching Policy
7
7
 
8
+ > **Core rule:** Always respond in the same language the user writes in. Switch immediately when user switches. Code/commits/filenames stay in English.
9
+
8
10
  <HARD-GATE>
9
11
  You MUST respond in the same language the user is writing in.
10
12
 
@@ -5,6 +5,8 @@ alwaysApply: true
5
5
 
6
6
  # Scratch Scripts Policy
7
7
 
8
+ > **Core rule:** NEVER use `/tmp/` — always use `.agent/tmp/` and set `Cwd` to workspace root. `/tmp/` causes `run_command` to hang forever.
9
+
8
10
  > **PRIORITY: CRITICAL** — Violating this rule causes commands to hang and freeze the conversation.
9
11
 
10
12
  ## The Rule
@@ -5,6 +5,8 @@ alwaysApply: true
5
5
 
6
6
  # Superpowers Skills Integration
7
7
 
8
+ > **Core rule:** Before any implementation/debugging/planning action, check if a skill applies and read its SKILL.md. Skip only for trivial factual questions with zero implementation.
9
+
8
10
  This workspace uses the **Superpowers** skills library located in `superpowers/skills/`.
9
11
  All skills are symlinked into `.agent/skills/` and are automatically available.
10
12
 
@@ -12,6 +14,8 @@ All skills are symlinked into `.agent/skills/` and are automatically available.
12
14
 
13
15
  **Before any response or action**, check if a relevant skill applies. If there's even a 1% chance a skill applies, read it via `view_file` on its `SKILL.md` and follow it exactly.
14
16
 
17
+ **Exception (per CLAUDE.md §1):** Skip the skill check for trivial tasks — simple factual questions, one-line answers, or requests that clearly involve zero implementation (e.g., "what does X mean?", "how do I spell Y?"). If in doubt, check anyway.
18
+
15
19
  ## Available Skills
16
20
 
17
21
  ### Development Workflow
@@ -76,3 +76,20 @@ After all tasks complete and verified:
76
76
  - **superpowers:using-git-worktrees** - REQUIRED: Set up isolated workspace before starting
77
77
  - **superpowers:writing-plans** - Creates the plan this skill executes
78
78
  - **superpowers:finishing-a-development-branch** - Complete development after all tasks
79
+
80
+ ---
81
+
82
+ ## Rules Checklist — Run Before Reporting Each Task Complete
83
+
84
+ <HARD-GATE>
85
+ Before marking any task as done and reporting to the user, verify all of these:
86
+
87
+ - [ ] **Language** — Am I responding in the same language the user wrote in?
88
+ - [ ] **Git ops** — Did I check `auto_commit` in `.agent/config.yml` before any git write operation?
89
+ - [ ] **Debug gate** — Did I present analysis + get confirmation BEFORE writing any bug fix?
90
+ - [ ] **Simplicity** — Could this code be written in fewer lines without losing clarity?
91
+ - [ ] **Surgical** — Did I touch ONLY what the task required? No adjacent "improvements"?
92
+ - [ ] **Evidence** — Am I about to claim success? Have I actually run the verification command?
93
+
94
+ If any box is unchecked → fix it before reporting.
95
+ </HARD-GATE>
@@ -321,3 +321,19 @@ From debugging sessions:
321
321
  - Random fixes approach: 2-3 hours of thrashing
322
322
  - First-time fix rate: 95% vs 40%
323
323
  - New bugs introduced: Near zero vs common
324
+
325
+ ---
326
+
327
+ ## Rules Checklist — Run Before Reporting Fix Complete
328
+
329
+ <HARD-GATE>
330
+ After completing Phase 4, before telling the user the bug is fixed:
331
+
332
+ - [ ] **Language** — Responding in the user's language?
333
+ - [ ] **Debug gate** — Did I present Root Cause + Evidence + Proposed Fix and get confirmation BEFORE implementing? (debug-confirmation-policy)
334
+ - [ ] **Git ops** — If I committed the fix: did I check `auto_commit` in `.agent/config.yml` first?
335
+ - [ ] **Surgical** — Did I fix ONLY the root cause? No bundled refactoring or unrelated changes?
336
+ - [ ] **Verification** — Have I actually run the test/command to confirm the fix works? Not just "should work now"?
337
+
338
+ If any box is unchecked → go back and fix it before reporting.
339
+ </HARD-GATE>
@@ -369,3 +369,19 @@ Otherwise → not TDD
369
369
  ```
370
370
 
371
371
  No exceptions without your human partner's permission.
372
+
373
+ ---
374
+
375
+ ## Behavioral Rules Checklist — Run Before Reporting Implementation Complete
376
+
377
+ <HARD-GATE>
378
+ After TDD cycle is done, before telling the user the feature is implemented:
379
+
380
+ - [ ] **Language** — Responding in the user's language?
381
+ - [ ] **Simplicity** — Is this the minimum code that satisfies the tests? No speculative features added?
382
+ - [ ] **Surgical** — Did I touch only the files this feature requires? No unrelated refactoring?
383
+ - [ ] **Git ops** — If committing: checked `auto_commit` in `.agent/config.yml` first?
384
+ - [ ] **Evidence** — Did I actually run all tests and see them pass? Not just "they should pass"?
385
+
386
+ If any box is unchecked → fix before reporting.
387
+ </HARD-GATE>
@@ -137,3 +137,25 @@ From 24 failure memories:
137
137
  Run the command. Read the output. THEN claim the result.
138
138
 
139
139
  This is non-negotiable.
140
+
141
+ ---
142
+
143
+ ## Behavioral Rules Final Check — The Last Gate Before Responding
144
+
145
+ <HARD-GATE>
146
+ This is the final checkpoint. Before sending your response to the user:
147
+
148
+ **Technical verification (above):**
149
+ - [ ] Ran the verification command — not "should pass", actual output seen
150
+ - [ ] Exit code / test count / build result confirms the claim
151
+
152
+ **Behavioral rules (don't forget these during implementation):**
153
+ - [ ] **Language** — Response is in the user's language?
154
+ - [ ] **Debug gate** — If this was a bug fix: did I get confirmation before implementing? (debug-confirmation-policy)
155
+ - [ ] **Git ops** — Any git write op: checked `auto_commit` in `.agent/config.yml`?
156
+ - [ ] **Simplicity** — No features beyond what was asked? No speculative abstractions?
157
+ - [ ] **Surgical** — Changed only what was necessary? No "while I'm here" edits?
158
+
159
+ All boxes checked? → Send response.
160
+ Any box unchecked? → Fix it first.
161
+ </HARD-GATE>
@@ -155,3 +155,19 @@ After saving the plan, offer execution choice:
155
155
  **If Inline Execution chosen:**
156
156
  - **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
157
157
  - Batch execution with checkpoints for review
158
+
159
+ ---
160
+
161
+ ## Rules Checklist — Run Before Handing Off Plan
162
+
163
+ <HARD-GATE>
164
+ Before presenting the plan to the user or dispatching to executing agent:
165
+
166
+ - [ ] **Language** — Plan explanation is in the user's language?
167
+ - [ ] **No placeholders** — Zero TBD/TODO/"implement later" entries in the plan?
168
+ - [ ] **YAGNI** — Every task maps to an explicit requirement? No speculative tasks?
169
+ - [ ] **Git step in plan** — Each task's commit step says to check `auto_commit` in `.agent/config.yml`?
170
+ - [ ] **Self-review done** — Ran the Self-Review section (spec coverage, placeholder scan, type consistency)?
171
+
172
+ If any box is unchecked → fix plan before handing off.
173
+ </HARD-GATE>