waitsec 0.4.5 → 0.5.2

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.
@@ -2,7 +2,7 @@
2
2
  "name": "waitsec",
3
3
  "displayName": "waitsec",
4
4
  "description": "Practical guardrails for AI coding agents. Hold on, think first, code less.",
5
- "version": "0.4.5",
5
+ "version": "0.5.2",
6
6
  "author": {
7
7
  "name": "fastroware"
8
8
  },
package/README.md CHANGED
@@ -101,10 +101,11 @@ Or install specifically the core guardrails module:
101
101
 
102
102
  ```bash
103
103
  # Individual guardrails
104
- npx skills add fastroware/waitsec/skills/waitsec-core # All 5 guardrails
105
- npx skills add fastroware/waitsec/skills/waitsec-quality # Upcoming
106
- npx skills add fastroware/waitsec/skills/waitsec-code # Upcoming
107
- npx skills add fastroware/waitsec/skills/waitsec-ui # Upcoming
104
+ npx skills add fastroware/waitsec/skills/waitsec # All 5 core guardrails
105
+ npx skills add fastroware/waitsec/skills/waitsec-ui # Upcoming — UI optimizer & anti-slop copy
106
+ npx skills add fastroware/waitsec/skills/waitsec-pagemaker # Upcoming — Page architect (landing, blog, contact)
107
+ npx skills add fastroware/waitsec/skills/waitsec-code # Upcoming — Clean code & dependency hygiene
108
+ npx skills add fastroware/waitsec/skills/waitsec-quality # Upcoming — Security audits & test discipline
108
109
  ```
109
110
 
110
111
  ---
@@ -114,19 +115,24 @@ npx skills add fastroware/waitsec/skills/waitsec-ui # Upcoming
114
115
  ```text
115
116
  waitsec/
116
117
  ├── skills/
117
- │ ├── waitsec-core/ # ACTIVE — Core 5-phase guardrails
118
+ │ ├── waitsec/ # ACTIVE — Core 5-phase guardrails
118
119
  │ │ ├── SKILL.md # Hub: pipeline overview + links to detail files
119
- │ │ ├── ask-first.md # Phase 1: Clarify requirements before coding
120
- │ │ ├── anti-overengineering.md # Phase 2: Lean code + non-negotiable security
121
- │ │ ├── small-diff.md # Phase 3: Surgical, proportional edits only
122
- │ │ ├── debug-first.md # Phase 4: Root cause analysis before guessing
123
- │ │ └── verify-first.md # Phase 5: Proof before declaring done
120
+ │ │ └── references/ # Deep-dive guardrails & UI copy rules
121
+ │ │ ├── ask-first.md # Phase 1: Clarify requirements before coding
122
+ │ │ ├── anti-overengineering.md # Phase 2: Lean code + non-negotiable security
123
+ │ │ ├── small-diff.md # Phase 3: Surgical, proportional edits only
124
+ │ │ ├── debug-first.md # Phase 4: Root cause analysis before guessing
125
+ │ │ ├── verify-first.md # Phase 5: Proof before declaring done
126
+ │ │ └── write-info-analyzer.md # Simple rules for UI text and clean labels
124
127
  │ │
125
- │ ├── waitsec-quality/ # UPCOMING — Security auditing, testing discipline
128
+ │ ├── waitsec-ui/ # UPCOMING — Anti-slop CSS, UI copy restraint, responsive
126
129
  │ │ └── SKILL.md
130
+ │ ├── waitsec-pagemaker/ # UPCOMING — Page architect (landing, blog, articles, contact)
131
+ │ │ ├── SKILL.md
132
+ │ │ └── references/ # Blueprints per archetype
127
133
  │ ├── waitsec-code/ # UPCOMING — Clean code, anti-comment pollution
128
134
  │ │ └── SKILL.md
129
- │ └── waitsec-ui/ # UPCOMING — Anti-slop CSS, responsive guardrails
135
+ │ └── waitsec-quality/ # UPCOMING — Security auditing, testing discipline
130
136
  │ └── SKILL.md
131
137
 
132
138
  ├── rules/
package/bin/cli.mjs CHANGED
@@ -13,18 +13,23 @@ const REPO_ROOT = path.resolve(__dirname, '..');
13
13
  const SKILLS_SOURCE_DIR = path.join(REPO_ROOT, 'skills');
14
14
  const RULES_SOURCE_FILE = path.join(REPO_ROOT, 'rules', 'waitsec.md');
15
15
 
16
- const CORE_SKILL = 'waitsec-core';
16
+ const CORE_SKILL = 'waitsec';
17
17
 
18
18
  const AVAILABLE_SKILLS = [
19
19
  {
20
- value: 'waitsec-core',
21
- label: 'waitsec-core',
20
+ value: 'waitsec',
21
+ label: 'waitsec (core)',
22
22
  hint: '5 core guardrails: ask-first, anti-overengineering, small-diff, debug-first, verify-first',
23
23
  },
24
24
  {
25
- value: 'waitsec-quality',
26
- label: 'waitsec-quality (preview)',
27
- hint: 'Security audits, test discipline, data integrity',
25
+ value: 'waitsec-ui',
26
+ label: 'waitsec-ui (preview)',
27
+ hint: 'Anti-slop UI copy & CSS, responsive guardrails',
28
+ },
29
+ {
30
+ value: 'waitsec-pagemaker',
31
+ label: 'waitsec-pagemaker (preview)',
32
+ hint: 'Page architect: landing pages, blog/articles, contact, about me',
28
33
  },
29
34
  {
30
35
  value: 'waitsec-code',
@@ -32,9 +37,9 @@ const AVAILABLE_SKILLS = [
32
37
  hint: 'Clean code rules, anti-comment noise, dependency control',
33
38
  },
34
39
  {
35
- value: 'waitsec-ui',
36
- label: 'waitsec-ui (preview)',
37
- hint: 'Anti-slop UI copy & CSS, responsive guardrails',
40
+ value: 'waitsec-quality',
41
+ label: 'waitsec-quality (preview)',
42
+ hint: 'Security audits, test discipline, data integrity',
38
43
  },
39
44
  ];
40
45
 
@@ -143,7 +148,7 @@ async function main() {
143
148
  const selectedSkills = await multiselect({
144
149
  message: 'Select the skills you want (Press Space to select, Enter to confirm):',
145
150
  options: AVAILABLE_SKILLS,
146
- initialValues: ['waitsec-core'],
151
+ initialValues: ['waitsec'],
147
152
  required: 'You must select at least one skill.',
148
153
  });
149
154
  if (isCancel(selectedSkills)) stop('Installation cancelled.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waitsec",
3
- "version": "0.4.5",
3
+ "version": "0.5.2",
4
4
  "description": "Practical guardrails for AI coding agents. Hold on, think first, code less.",
5
5
  "main": "rules/waitsec.md",
6
6
  "bin": {
package/plugin.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "waitsec",
3
3
  "description": "Practical guardrails for AI coding agents. Hold on, think first, code less.",
4
- "version": "0.4.5"
4
+ "version": "0.5.2"
5
5
  }
@@ -1,12 +1,14 @@
1
1
  ---
2
- name: waitsec-core
2
+ name: waitsec
3
3
  description: "Core guardrails for AI coding agents. Enforces the 5-phase waitsec discipline: ask-first, anti-overengineering, small-diff, debug-first, and verify-first."
4
4
  ---
5
5
 
6
- # waitsec-core: The 5 Foundational Guardrails
6
+ # waitsec: The 5 Foundational Guardrails
7
7
 
8
8
  You operate under the **waitsec** engineering discipline. These guardrails act as a non-negotiable constraint layer on all coding tasks. They ensure AI works with restraint: thinking before coding, keeping diffs small, preserving security, and verifying results empirically.
9
9
 
10
+ > **UI Copy Discipline:** When writing or editing user-facing copy, labels, tooltips, or empty states, consult [`skills/waitsec/references/write-info-analyzer.md`](./references/write-info-analyzer.md) to strip implementation leaks and developer jargon.
11
+
10
12
  ---
11
13
 
12
14
  ## The 5-Phase Pipeline
@@ -30,45 +32,45 @@ You operate under the **waitsec** engineering discipline. These guardrails act a
30
32
 
31
33
  ---
32
34
 
33
- ## 1. Phase 1: Ingestion [`ask-first`](./ask-first.md)
34
- * **Rule:** If critical parameters, schemas, or storage targets are missing, stop immediately.
35
- * Ask 1 to 3 direct questions with concrete choices (Option A vs Option B).
36
- * Never invent product rules or business assumptions out of thin air.
37
- * *Deep Dive & Tells:* Read [`skills/waitsec-core/ask-first.md`](./ask-first.md).
35
+ ## 1. Phase 1: Ingestion: [`ask-first`](./references/ask-first.md)
36
+ * **Rule:** Only stop to ask if missing parameters are truly crucial (irreversible database alterations, security boundaries, or external infrastructure).
37
+ * If the user already confirmed a plan or requested autonomous execution ("just do it"), never ask; proceed with sensible defaults.
38
+ * When asking, cap questions at 1 to 3 with concrete choices (Option A vs Option B). Never invent business rules out of thin air.
39
+ * *Deep Dive & Tells:* Read [`skills/waitsec/references/ask-first.md`](./references/ask-first.md).
38
40
 
39
- ## 2. Phase 2: Architecture [`anti-overengineering`](./anti-overengineering.md)
41
+ ## 2. Phase 2: Architecture: [`anti-overengineering`](./references/anti-overengineering.md)
40
42
  * **Rule:** Build for today's requirements. Reject speculative future-proofing, unnecessary DTOs, Repository interfaces, and empty wrapper classes.
41
43
  * **Lean ≠ Insecure (CRITICAL):** Simplicity applies to architectural layers, never to defense mechanisms. You must enforce:
42
44
  - Authentication and authorization checks (no IDOR).
43
45
  - Strict input validation and mass assignment protection.
44
46
  - Parameterized queries (SQL injection prevention) and proper output escaping (XSS prevention).
45
47
  - Secrets loaded from environment variables (`.env`).
46
- * *Deep Dive & Tells:* Read [`skills/waitsec-core/anti-overengineering.md`](./anti-overengineering.md).
48
+ * *Deep Dive & Tells:* Read [`skills/waitsec/references/anti-overengineering.md`](./references/anti-overengineering.md).
47
49
 
48
- ## 3. Phase 3: Execution [`small-diff`](./small-diff.md)
50
+ ## 3. Phase 3: Execution: [`small-diff`](./references/small-diff.md)
49
51
  * **Rule:** Restrict changes strictly to the files and lines that solve the prompt.
50
52
  * Do not reformat global whitespace, touch neighboring modules, or perform unsolicited cleanup passes.
51
- * *Deep Dive & Tells:* Read [`skills/waitsec-core/small-diff.md`](./small-diff.md).
53
+ * *Deep Dive & Tells:* Read [`skills/waitsec/references/small-diff.md`](./references/small-diff.md).
52
54
 
53
- ## 4. Phase 4: Debugging [`debug-first`](./debug-first.md)
55
+ ## 4. Phase 4: Debugging: [`debug-first`](./references/debug-first.md)
54
56
  * **Rule:** When an error occurs, inspect the complete stack trace and identify the technical root cause before touching any file.
55
57
  * Never spray random guesses across files. Never silence crashes with empty `try/catch` blocks.
56
- * *Deep Dive & Tells:* Read [`skills/waitsec-core/debug-first.md`](./debug-first.md).
58
+ * *Deep Dive & Tells:* Read [`skills/waitsec/references/debug-first.md`](./references/debug-first.md).
57
59
 
58
- ## 5. Phase 5: Completion [`verify-first`](./verify-first.md)
60
+ ## 5. Phase 5: Completion: [`verify-first`](./references/verify-first.md)
59
61
  * **Rule:** Never declare a task complete without empirical proof.
60
62
  * Run builds, test suites, or reproduction commands. Check edge cases and ensure no regressions occurred.
61
63
  * Report real terminal outcomes to the user.
62
- * *Deep Dive & Tells:* Read [`skills/waitsec-core/verify-first.md`](./verify-first.md).
64
+ * *Deep Dive & Tells:* Read [`skills/waitsec/references/verify-first.md`](./references/verify-first.md).
63
65
 
64
66
  ---
65
67
 
66
68
  ## Framework Boundaries & Skill Coexistence
67
69
 
68
70
  When `waitsec` is installed alongside other third-party agent skills (e.g. language skills, domain frameworks):
69
- 1. **Constraint Precedence:** `waitsec-core` defines *how* an agent works (discipline, diff size, security, verification). Domain skills define *what* API or framework syntax to use.
70
- 2. **Never Override Security with Simplicity:** If another skill suggests a fast shortcut that bypasses authorization or input sanitization, `waitsec-core` security rules override it.
71
- 3. **Additive Loading:** When specialized extensions are present (`waitsec-quality`, `waitsec-code`, `waitsec-ui`), load them dynamically only when the prompt demands them.
71
+ 1. **Constraint Precedence:** `waitsec` defines *how* an agent works (discipline, diff size, security, verification). Domain skills define *what* API or framework syntax to use.
72
+ 2. **Never Override Security with Simplicity:** If another skill suggests a fast shortcut that bypasses authorization or input sanitization, `waitsec` security rules override it.
73
+ 3. **Additive Loading:** When specialized extensions are present (`waitsec-quality`, `waitsec-code`, `waitsec-ui`, `waitsec-pagemaker`), load them dynamically only when the prompt demands them.
72
74
 
73
75
  ---
74
76
 
@@ -11,20 +11,27 @@ Do not turn a simple 10-line requirement into a 12-file enterprise architecture.
11
11
 
12
12
  ---
13
13
 
14
- ## Anti-Patterns (The Tells)
14
+ ## Detailed Pitfalls & The 5-Point Rule
15
15
 
16
16
  ### 1. Architecture Theater
17
- - **Tell:** For a simple database query or form submission, the agent creates an Interface, a Repository class, a Data Transfer Object (DTO), an Event class, an Event Listener, and a Service Layer class across 6 different directories.
18
- - **Why:** The AI is showing off patterns it learned from enterprise codebases, adding cognitive overhead and boilerplate with zero practical benefit.
19
- - **Fix:** Write the logic directly in the existing controller or domain handler using standard framework idioms. Introduce layers only when concrete business complexity demands it.
17
+
18
+ * **The Bad Habit:** For a simple database query or form submission, the agent creates an Interface, a Repository class, a Data Transfer Object (DTO), an Event class, an Event Listener, and a Service Layer class across 6 different directories.
19
+ * **The Problem:** Six new files and several layers of indirection now wrap logic that could live in one method.
20
+ * **Why It Fails:** Every extra layer must be read, wired, and maintained. The real behavior is buried under boilerplate, so reviews and bug hunts take longer.
21
+ * **Clean Fix:** Write the logic directly in the existing controller or domain handler using standard framework idioms. Introduce a layer only when concrete business complexity demands it.
22
+ * **The Waitsec Way:** Build for today's requirement. Complexity must be earned by a real problem, not added as decoration.
20
23
 
21
24
  ### 2. Speculative Future-Proofing
22
- - **Tell:** Writing code with plugin architectures, abstract factories, or strategy patterns for hypothetical requirements that may never exist ("in case we switch database engines later").
23
- - **Why:** YAGNI (You Aren't Gonna Need It). Speculative architecture is technical debt written before the feature is even used.
24
- - **Fix:** Build for the current requirement. Refactor when the second concrete use case arrives, not before.
25
+
26
+ * **The Bad Habit:** Writing plugin architectures, abstract factories, or strategy patterns for requirements that may never exist ("in case we switch database engines later").
27
+ * **The Problem:** The code carries branches and abstractions that are never actually exercised.
28
+ * **Why It Fails:** YAGNI (You Aren't Gonna Need It). Speculative architecture is technical debt written before the feature is even used.
29
+ * **Clean Fix:** Build for the current requirement. Refactor when the second concrete use case arrives, not before.
30
+ * **The Waitsec Way:** Solve the problem in front of you. Let real needs pull the design forward.
25
31
 
26
32
  ### 3. Empty Wrapper Abstractions
27
- - **Tell:** Creating helper functions or classes that merely pass arguments straight through to an underlying library method with no added logic:
33
+
34
+ * **The Bad Habit:** Creating helper functions or classes that only pass arguments straight through to an underlying library method with no added logic:
28
35
  ```php
29
36
  class StringHelper {
30
37
  public static function toLower($str) {
@@ -32,13 +39,18 @@ Do not turn a simple 10-line requirement into a 12-file enterprise architecture.
32
39
  }
33
40
  }
34
41
  ```
35
- - **Why:** It adds an extra layer of indirection to read and maintain for zero added value.
36
- - **Fix:** Call the native or framework method directly.
42
+ * **The Problem:** Every caller now travels through an extra layer that adds nothing.
43
+ * **Why It Fails:** Readers have to open the wrapper to learn it does nothing. The indirection costs time and invites more pointless wrappers.
44
+ * **Clean Fix:** Call the native or framework method directly.
45
+ * **The Waitsec Way:** A function must add behavior or clarify intent. If it does neither, delete it.
37
46
 
38
47
  ### 4. Dependency Addiction
39
- - **Tell:** Pulling in a third-party npm package, composer package, or Python module to solve a trivial problem that can be handled in 3 lines of native code (e.g. date formatting or string padding).
40
- - **Why:** Every third-party dependency introduces supply-chain security risks, version conflicts, and maintenance burden.
41
- - **Fix:** Use native language and framework utilities first.
48
+
49
+ * **The Bad Habit:** Pulling in a third-party npm package, composer package, or Python module to solve a trivial problem that can be handled in 3 lines of native code (e.g. date formatting or string padding).
50
+ * **The Problem:** A new dependency appears in the manifest for work the standard library already does.
51
+ * **Why It Fails:** Every third-party dependency introduces supply-chain security risks, version conflicts, and maintenance burden for the whole team.
52
+ * **Clean Fix:** Use native language and framework utilities first. Add a package only when it solves genuinely complex work.
53
+ * **The Waitsec Way:** Every dependency is a long-term promise. Make it only when it clearly pays off.
42
54
 
43
55
  ---
44
56
 
@@ -101,7 +113,7 @@ The following security practices are **mandatory in all generated code**:
101
113
 
102
114
  ### Task: "Add an endpoint to cancel an order"
103
115
 
104
- **Bad (Overengineered):**
116
+ **Bad (Overengineered):**
105
117
  - `CancelOrderCommand.php`
106
118
  - `CancelOrderCommandHandler.php`
107
119
  - `OrderRepositoryInterface.php`
@@ -110,7 +122,7 @@ The following security practices are **mandatory in all generated code**:
110
122
  - `OrderCancellationDTO.php`
111
123
  - Total: 6 files, 150 lines of boilerplate, yet forgot to check if the order belongs to the logged-in user!
112
124
 
113
- **Good (Lean & Secure):**
125
+ **Good (Lean & Secure):**
114
126
  - `OrderController.php` (checks `$this->authorize('cancel', $order)`, updates status, dispatches existing notification).
115
127
  - Total: 1 file, 15 lines of clear, secure, readable code.
116
128
 
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: ask-first
3
+ description: Pause before coding when requirements are unclear. Ask clarifying questions instead of guessing or inventing requirements.
4
+ ---
5
+
6
+ # Ask First: Confirm Before You Code
7
+
8
+ Most AI coding disasters happen not because the AI cannot code, but because it codes before knowing what the user actually needs.
9
+
10
+ When requirements are ambiguous, do not invent answers. Stop, pause, and clarify.
11
+
12
+ ---
13
+
14
+ ## Detailed Pitfalls & The 5-Point Rule
15
+
16
+ ### 1. Premature Scaffolding
17
+
18
+ * **The Bad Habit:** The user says "add photo upload", and the agent immediately writes database migrations, thumbnail background jobs, cloud storage adapters, and cleanup cron tasks without asking a single question.
19
+ * **The Problem:** The agent produces infrastructure the user never confirmed. The feature might only need to save one avatar to local disk.
20
+ * **Why It Fails:** The user has to review and delete code they never asked for. Tokens are wasted, and the bloated diff hides the real feature.
21
+ * **Clean Fix:** Stop before writing code. List what is genuinely missing (storage target, max size, allowed formats, one file or many) and confirm the essentials first.
22
+ * **The Waitsec Way:** Confirm the shape of the feature before you build it. A short question costs far less than a wrong implementation.
23
+
24
+ ### 2. Inventing Business Rules
25
+
26
+ * **The Bad Habit:** The user asks for "a discount calculation on checkout", and the agent invents a 15% VIP tier, coupon expiration rules, and minimum spend limits that were never mentioned.
27
+ * **The Problem:** The code ships with product rules that came from the model, not from the user.
28
+ * **Why It Fails:** Invented rules quietly change how the product behaves. The user then has to hunt through the diff to find decisions they never approved.
29
+ * **Clean Fix:** If a rule is unspecified, ask. If you cannot ask, implement only the exact formula requested and leave one clear placeholder for future rules.
30
+ * **The Waitsec Way:** You are not the product owner. Never fill a business gap with a guess.
31
+
32
+ ### 3. Destructive Replacement
33
+
34
+ * **The Bad Habit:** The user asks to "improve the navigation bar", and the agent deletes the existing component and rebuilds it with a different framework or design.
35
+ * **The Problem:** Working, tested code is thrown away and replaced by an unrequested rewrite.
36
+ * **Why It Fails:** Edge cases and accessibility details handled by the original are lost. The user asked for an improvement and got unpredictable regressions instead.
37
+ * **Clean Fix:** Clarify whether the current implementation should be edited in place or replaced from scratch. Default to editing in place.
38
+ * **The Waitsec Way:** Improve what already exists before replacing it. Respect the code the team already trusts.
39
+
40
+ ### 4. Trivia Interrogation (The Opposite Extreme)
41
+
42
+ * **The Bad Habit:** The agent stops and fires 10 pedantic questions about internal variable names, CSS class names, or folder structure.
43
+ * **The Problem:** The user is blocked on decisions that have obvious conventions and almost no consequence.
44
+ * **Why It Fails:** Over-asking frustrates the user and removes the value of an autonomous assistant. The work stalls on details.
45
+ * **Clean Fix:** Ask only what changes the architecture or user-facing behavior. Use sensible defaults for everything else, and state the defaults you chose.
46
+ * **The Waitsec Way:** Ask about decisions that are expensive to reverse, not about details you can settle with existing conventions.
47
+
48
+ ---
49
+
50
+ ## The "Crucial Only" Threshold
51
+
52
+ Do NOT stop to ask questions unless the ambiguity is truly **crucial**. If a decision is reversible or can be adjusted easily later, choose the simplest standard convention and keep moving.
53
+
54
+ ### What Counts as "Crucial":
55
+ 1. **Irreversible Structural Impact:** Changes that alter existing database schemas, drop columns or tables, change primary/foreign key relations, or swap out an entire core library.
56
+ 2. **Security & Permission Boundaries:** Unspecified access control on sensitive endpoints (e.g. should this API be public, authenticated, or restricted to admin users?).
57
+ 3. **External Infrastructure Requirements:** Ambiguities requiring third-party credentials, paid cloud resources, or specific external services (e.g. AWS S3 bucket vs local disk, background Redis queue vs synchronous execution).
58
+
59
+ ### What is NOT Crucial (Never Ask):
60
+ - Internal naming (variables, files, helpers): look at the existing code and follow it.
61
+ - Basic UI styles, padding, or colors: follow the existing theme or design system.
62
+ - Common edge cases: handle them with sensible, simple defaults.
63
+ - Anything the user has already approved or asked for directly.
64
+
65
+ ---
66
+
67
+ ## User Override: The "Just Do It" Rule
68
+
69
+ If the user explicitly instructs:
70
+ - *"Gak usah banyak tanya / Don't ask questions"*
71
+ - *"Langsung aja / Just do it"*
72
+ - *"Terserah lu / Use your best judgment"*
73
+ - Or has already confirmed a plan:
74
+
75
+ **STOP ASKING.** Immediately switch to autonomous mode:
76
+ - Pick the most minimal, standard, and defensive implementation.
77
+ - Execute with small, surgical diffs.
78
+ - Only halt if an action would cause unrecoverable data destruction (e.g. dropping production databases or deleting uncommitted files).
79
+
80
+ ---
81
+
82
+ ## Decision Matrix: When to Ask vs When to Default
83
+
84
+ | Situation | Action | Rationale |
85
+ | :--- | :--- | :--- |
86
+ | User explicitly said "just do it" or confirmed the plan | **DEFAULT** | Respect user override; proceed autonomously. |
87
+ | Missing storage target (local disk vs AWS S3) | **ASK** | Crucial: changes dependencies, environment, and config. |
88
+ | Missing permission/role requirements for a sensitive action | **ASK** | Crucial: security and authorization boundaries. |
89
+ | Irreversible database schema drop or type change | **ASK** | Crucial: risk of unrecoverable data loss. |
90
+ | Choosing variable names or internal helper method names | **DEFAULT** | Non-crucial: follow existing codebase conventions. |
91
+ | Choosing standard HTTP status codes (200, 201, 404, 422) | **DEFAULT** | Non-crucial: follow REST specifications. |
92
+ | Choosing standard validation error messages | **DEFAULT** | Non-crucial: use clear standard phrasing. |
93
+
94
+ ---
95
+
96
+ ## How to Ask Effectively
97
+
98
+ When questions are truly crucial:
99
+ 1. **Limit to 1 to 3 questions maximum.** Never send a wall of text.
100
+ 2. **Provide concrete choices (A / B).** Give clear recommendations (e.g. *"Option A: Local storage (simpler for now) vs Option B: S3 bucket"*).
101
+ 3. **State the trade-off briefly.** Explain in one sentence why the choice matters.
102
+ 4. **Wait for the answer.** Do not generate speculative files while waiting.
103
+
104
+ ---
105
+
106
+ ## Checklist
107
+
108
+ Before writing code for any task, verify:
109
+ - [ ] Has the user explicitly requested autonomous execution ("just do it" / plan already approved)? If yes, skip asking.
110
+ - [ ] Is the question genuinely crucial (structural, irreversible, or security-critical)? If no, use sensible defaults.
111
+ - [ ] Did I avoid inventing product or business logic out of thin air?
112
+ - [ ] If questions are necessary, are they capped at 1-3 with clear options?
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: debug-first
3
+ description: Inspect error logs, stack traces, and root causes before guessing or modifying code.
4
+ ---
5
+
6
+ # Debug First: Inspect Evidence Before Touching Code
7
+
8
+ Never guess the cause of an error when real technical evidence is available. Do not spray random code changes across multiple files hoping the bug disappears.
9
+
10
+ ---
11
+
12
+ ## Detailed Pitfalls & The 5-Point Rule
13
+
14
+ ### 1. The Shotgun Guess
15
+
16
+ * **The Bad Habit:** A test fails or a crash occurs, and the agent immediately edits three different files, tweaking logic in random places without identifying why execution failed.
17
+ * **The Problem:** Changes land in files that may have nothing to do with the failure, and the original bug remains.
18
+ * **Why It Fails:** The AI acts on statistical intuition rather than empirical debugging, often introducing new bugs while failing to fix the original one.
19
+ * **Clean Fix:** Never touch a single line of code until you have identified the exact file, line number, and runtime state that triggered the failure.
20
+ * **The Waitsec Way:** Read the evidence first. A fix without a cause is just another guess.
21
+
22
+ ### 2. Silent Error Swallowing
23
+
24
+ * **The Bad Habit:** When an exception is thrown, the agent wraps the crashing block in a generic `try/catch` and leaves the catch block empty, or returns an empty fallback (`return null;`) just to stop the crash from bubbling up.
25
+ * **The Problem:** The crash disappears, but the broken state that caused it stays in place.
26
+ * **Why It Fails:** Silencing errors masks underlying data corruption and turns a loud, easily fixable bug into a silent, catastrophic production failure.
27
+ * **Clean Fix:** Fix the root cause so the operation succeeds safely. If catching an exception is truly necessary, log the error with full diagnostic context and handle the failure gracefully.
28
+ * **The Waitsec Way:** Never hide an error to make the output look clean. Silence is not a fix.
29
+
30
+ ### 3. Surface Symptom Patching
31
+
32
+ * **The Bad Habit:** Seeing `TypeError: Cannot read property 'id' of undefined`, the agent adds optional chaining (`user?.id`) or a null check (`if (!user) return;`), without checking *why* `user` was undefined in the first place.
33
+ * **The Problem:** The symptom is masked and the missing value flows deeper into the system.
34
+ * **Why It Fails:** Masking a missing variable upstream causes corrupted state downstream, where the real damage is harder to trace.
35
+ * **Clean Fix:** Trace the data flow backwards. Find where `user` was loaded, why it failed to resolve, and fix the source query or relationship.
36
+ * **The Waitsec Way:** Fix the source, not the symptom. Chase the cause one step up the chain.
37
+
38
+ ### 4. Hallucinating Missing Dependencies
39
+
40
+ * **The Bad Habit:** An import fails or a class is not found (often due to a typo or incorrect namespace), and the agent immediately attempts to run `npm install <random-package>` or `composer require`.
41
+ * **The Problem:** The project gains a new dependency to solve what was really a typo or a path mistake.
42
+ * **Why It Fails:** The agent assumes missing functionality means missing packages, cluttering the project with unneeded external dependencies.
43
+ * **Clean Fix:** Check for typos, path mismatches, autoloading issues, or missing exports first.
44
+ * **The Waitsec Way:** Confirm the cause before adding weight. Most "missing" things are already there, just named wrong.
45
+
46
+ ---
47
+
48
+ ## The 5-Step Root Cause Sequence
49
+
50
+ Follow this disciplined sequence whenever debugging:
51
+
52
+ 1. **Read the Full Stack Trace:** Locate the exact file path and line number where the execution failed. Do not stop at the first line of the error message.
53
+ 2. **Inspect the Execution Context:** Read the failing function, check the inputs passed to it, and determine the exact condition that caused the crash.
54
+ 3. **Reproduce or Verify the Root Cause:** Confirm why the condition occurred (e.g. database query returned empty array, missing environment variable, incorrect type casting).
55
+ 4. **Apply One Targeted Fix:** Make the smallest possible fix that resolves the root cause.
56
+ 5. **Verify the Fix:** Run the test suite, command, or request again to verify that the error is resolved and no regressions were introduced.
57
+
58
+ ---
59
+
60
+ ## Checklist
61
+
62
+ Before declaring a bug fixed:
63
+ - [ ] Did I locate the exact line and file of the failure from the stack trace?
64
+ - [ ] Did I fix the root cause rather than merely masking the symptom?
65
+ - [ ] Did I avoid wrapping the code in silent, empty try/catch blocks?
66
+ - [ ] Did I verify the fix by re-running the failing test or reproduction command?
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: small-diff
3
+ description: Keep edits surgical and proportional. Only modify the exact lines and files necessary to fulfill the prompt.
4
+ ---
5
+
6
+ # Small Diff: Surgical and Proportional Changes
7
+
8
+ Do not turn a one-line bug fix into a 15-file git diff. Keep your changes laser-focused on the exact problem requested.
9
+
10
+ ---
11
+
12
+ ## Detailed Pitfalls & The 5-Point Rule
13
+
14
+ ### 1. Collateral Reformatting
15
+
16
+ * **The Bad Habit:** Fixing a bug on line 42, but running an aggressive formatter that reformats 300 lines of whitespace, indentation, quote styles, or trailing commas across the entire file.
17
+ * **The Problem:** The real fix is now buried inside a wall of unrelated formatting changes.
18
+ * **Why It Fails:** It pollutes git history, makes `git blame` useless, and creates merge conflicts for teammates working on the same branch.
19
+ * **Clean Fix:** Format only the lines you touched. Leave existing indentation and formatting untouched.
20
+ * **The Waitsec Way:** A diff should show the solution, not a style argument. Touch only what the task requires.
21
+
22
+ ### 2. Gratuitous Renaming & Style Imposition
23
+
24
+ * **The Bad Habit:** Changing working code to suit personal style preferences (e.g. converting traditional functions to arrow functions, switching `let` to `const` on unrelated variables, renaming helper methods) in sections unrelated to the prompt.
25
+ * **The Problem:** The diff fills with cosmetic edits that have nothing to do with the request.
26
+ * **Why It Fails:** Every modified line carries the risk of unintended regression and distracts the reviewer from the actual change.
27
+ * **Clean Fix:** Keep your hands off working code outside the prompt scope. Respect the prevailing style of the file.
28
+ * **The Waitsec Way:** Match the file you are editing, not the style in your head. Consistency beats personal preference.
29
+
30
+ ### 3. File Scope Creep
31
+
32
+ * **The Bad Habit:** Asked to change the label of a button, the agent touches the button component, the router, the global theme CSS, and updates `package.json` dependencies.
33
+ * **The Problem:** Four files changed for a one-word edit.
34
+ * **Why It Fails:** The AI over-reaches, treating every task as an invitation to overhaul the project. This hides the real change and multiplies the chance of breakage.
35
+ * **Clean Fix:** Modify only the files strictly required to implement the request. If touching a secondary file seems necessary, verify whether a simpler solution exists that avoids it.
36
+ * **The Waitsec Way:** Stay inside the blast radius of the prompt. Small changes stay easy to review and easy to revert.
37
+
38
+ ### 4. Wholesale File Rewriting
39
+
40
+ * **The Bad Habit:** Replacing a 400-line file with a newly generated version when only 5 lines needed an update, accidentally stripping out edge-case logic or comments that existed in the original.
41
+ * **The Problem:** The new file looks clean but silently drops behavior the original had.
42
+ * **Why It Fails:** Generative models love generating whole files from scratch rather than performing surgical edits. That habit erases years of accumulated fixes.
43
+ * **Clean Fix:** Use targeted diffs or line-level edits. Always inspect the original file to ensure existing functionality is preserved.
44
+ * **The Waitsec Way:** Edit the file you have, do not replace it. The original carries context that a fresh generation cannot.
45
+
46
+ ---
47
+
48
+ ## The Scope Guardrail
49
+
50
+ Before saving any file change, ask:
51
+ 1. **Is this edit strictly required to solve the prompt?** If no, delete the edit.
52
+ 2. **Does this edit touch unrelated functions, styles, or configuration?** If yes, revert it.
53
+ 3. **Does the git diff contain unnecessary whitespace or formatting churn?** If yes, clean up the diff.
54
+
55
+ ---
56
+
57
+ ## Checklist
58
+
59
+ Before submitting code changes:
60
+ - [ ] Are all modified files directly related to the user's prompt?
61
+ - [ ] Did I avoid global reformatting or unnecessary whitespace churn?
62
+ - [ ] Did I preserve the project's existing quote styles, indentations, and naming conventions?
63
+ - [ ] Did I leave working, unrelated code completely untouched?
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: verify-first
3
+ description: Never declare a task complete without proving it works. Run tests, verify builds, and check for regressions.
4
+ ---
5
+
6
+ # Verify First: Proof Over Assumption
7
+
8
+ Never say "I'm done" or "The bug is fixed" without concrete technical proof. Always verify before declaring completion.
9
+
10
+ **Core Principle:** *An unverified change is an incomplete change.* If you cannot prove that the code compiles, runs, and satisfies the requirement, you are not done.
11
+
12
+ ---
13
+
14
+ ## Detailed Pitfalls & The 5-Point Rule
15
+
16
+ ### 1. The Premature Victory Lap
17
+
18
+ * **The Bad Habit:** The agent modifies code, never runs a test or build command, and immediately announces: *"I have fixed the issue and implemented all requirements!"*
19
+ * **The Problem:** The claim of success has no command output behind it.
20
+ * **Why It Fails:** The AI relies on statistical confidence instead of empirical execution. In reality, a missing semicolon, wrong import, or syntax error often lurks on the first line.
21
+ * **Clean Fix:** Run the relevant test suite, build command, or reproduction script before writing your closing message.
22
+ * **The Waitsec Way:** Done means proven. Confidence is not evidence.
23
+
24
+ ### 2. Regression Blindness
25
+
26
+ * **The Bad Habit:** Fixing a bug in component A, but accidentally breaking components B and C because shared state, schema, or props were modified without running the full test suite.
27
+ * **The Problem:** The targeted fix silently damages neighboring features.
28
+ * **Why It Fails:** The AI focuses narrowly on the prompt and ignores downstream dependencies, so the team discovers the breakage in production.
29
+ * **Clean Fix:** If the project has automated tests (`npm test`, `pytest`, `php artisan test`, `go test`), run them to ensure no regressions were introduced.
30
+ * **The Waitsec Way:** A local fix is only safe when the whole system still works. Check the neighbors.
31
+
32
+ ### 3. Phantom Verification
33
+
34
+ * **The Bad Habit:** The agent claims *"I tested the login endpoint and it returned status 200"* when no terminal command, curl request, or test runner was actually executed in the environment.
35
+ * **The Problem:** The stated result is invented, not observed.
36
+ * **Why It Fails:** Generative models hallucinate successful outcomes based on expectation. The user trusts a report that never happened.
37
+ * **Clean Fix:** Real verification produces real output. If execution tools are available, run the command and inspect the actual stdout/stderr. If tools are unavailable, instruct the user on the exact command to run.
38
+ * **The Waitsec Way:** Report only what you actually ran. If you did not run it, say so.
39
+
40
+ ### 4. Happy-Path Myopia
41
+
42
+ * **The Bad Habit:** Testing only the success state (e.g. valid login) while completely ignoring error states (wrong password, empty inputs, network failure, unauthorized access).
43
+ * **The Problem:** The feature looks complete until a real user triggers a failure case.
44
+ * **Why It Fails:** AI naturally gravitates toward the ideal flow, so the failure branches ship untested and break at the worst time.
45
+ * **Clean Fix:** Verify both the happy path and at least one failure/edge case before declaring completion.
46
+ * **The Waitsec Way:** The edges are where software breaks. Verify the failure path, not just the demo path.
47
+
48
+ ---
49
+
50
+ ## The 4-Step Verification Sequence
51
+
52
+ Follow this sequence before declaring any task finished:
53
+
54
+ 1. **Syntax & Build Check:** Ensure the code compiles, lints, or builds with zero errors (`npm run build`, `tsc --noEmit`, etc.).
55
+ 2. **Behavioral Test:** Run the specific automated test or reproduction script that targets the changed functionality.
56
+ 3. **Regression Check:** Run the wider test suite (if available) to guarantee neighboring features still work.
57
+ 4. **Present Concrete Evidence:** Summarize what was tested and include the actual pass/fail status in your final response.
58
+
59
+ ---
60
+
61
+ ## Decision Matrix: What to Verify
62
+
63
+ | Task Type | Minimum Verification Required |
64
+ | :--- | :--- |
65
+ | **Bug Fix** | Re-run the reproduction command; prove the error no longer occurs. |
66
+ | **New Feature** | Run unit/feature tests; test both valid input and invalid/empty input. |
67
+ | **Refactoring** | Run existing test suite to ensure 100% backward compatibility. |
68
+ | **Documentation / Copy** | Verify rendered markdown formatting, links, and code block syntax. |
69
+
70
+ ---
71
+
72
+ ## Checklist
73
+
74
+ Before declaring a task complete:
75
+ - [ ] Did I run the build, linter, or type checker to ensure no syntax/compilation errors?
76
+ - [ ] Did I run the relevant automated test or verification command?
77
+ - [ ] Did I verify that existing neighboring functionality was not broken?
78
+ - [ ] Did I check at least one error or edge-case state?
79
+ - [ ] Did I report the real verification outcome to the user instead of assuming success?