waitsec 0.1.2 → 0.3.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/.cursor-plugin/plugin.json +1 -1
- package/README.md +45 -25
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/rules/AGENTS.md +6 -4
- package/rules/waitsec.md +32 -16
- package/skills/waitsec-code/SKILL.md +26 -0
- package/skills/waitsec-core/SKILL.md +70 -0
- package/skills/waitsec-core/anti-overengineering.md +127 -0
- package/skills/waitsec-core/ask-first.md +67 -0
- package/skills/waitsec-core/debug-first.md +54 -0
- package/skills/waitsec-core/small-diff.md +51 -0
- package/skills/waitsec-core/verify-first.md +67 -0
- package/skills/waitsec-quality/SKILL.md +34 -0
- package/skills/waitsec-ui/SKILL.md +26 -0
- package/skills/anti-overengineering/SKILL.md +0 -37
- package/skills/ask-first/SKILL.md +0 -31
- package/skills/debug-first/SKILL.md +0 -24
- package/skills/small-diff/SKILL.md +0 -19
package/README.md
CHANGED
|
@@ -19,19 +19,13 @@ Most AI coding assistants do not fail because they lack knowledge. They fail bec
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
## The
|
|
22
|
+
## The 5 Core Guardrails
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### 3. `small-diff`
|
|
31
|
-
Modifications stay strictly scoped to what solves the prompt. No cleaning up surrounding files, no global formatting passes, and no unnecessary dependency changes.
|
|
32
|
-
|
|
33
|
-
### 4. `debug-first`
|
|
34
|
-
When something breaks, the AI must read the complete error message and stack trace. Never guess fixes or hide errors behind empty try/catch blocks.
|
|
24
|
+
1. **`ask-first`** — If the prompt is missing essential decisions (schemas, storage locations, permissions), the AI must pause and ask 1 to 3 direct questions instead of guessing.
|
|
25
|
+
2. **`anti-overengineering`** — Rejects unneeded design patterns, DTOs, and speculative abstractions. Keeps code lean while strictly enforcing authentication, authorization, and input validation.
|
|
26
|
+
3. **`small-diff`** — Modifications stay strictly scoped to what solves the prompt. No cleaning up surrounding files, no global formatting passes, and no unnecessary dependency changes.
|
|
27
|
+
4. **`debug-first`** — When something breaks, the AI must read the complete error message and stack trace. Never guess fixes or hide errors behind empty try/catch blocks.
|
|
28
|
+
5. **`verify-first`** — Never declare a task complete without proof. Run tests, verify builds, test edge cases, and ensure no regressions occurred before reporting done.
|
|
35
29
|
|
|
36
30
|
---
|
|
37
31
|
|
|
@@ -83,10 +77,20 @@ composer require --dev waitsec/waitsec
|
|
|
83
77
|
The post-install script automatically adds `.kilorules` to your root directory.
|
|
84
78
|
|
|
85
79
|
### 7. Agent Skills Directory (skills.sh)
|
|
86
|
-
Install
|
|
80
|
+
Install the full core bundle (recommended):
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npx skills add fastroware/waitsec/skills/waitsec-core
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or install only the module you need:
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
|
|
89
|
+
# Individual guardrails
|
|
90
|
+
npx skills add fastroware/waitsec/skills/waitsec-core # All 5 guardrails
|
|
91
|
+
npx skills add fastroware/waitsec/skills/waitsec-quality # Upcoming
|
|
92
|
+
npx skills add fastroware/waitsec/skills/waitsec-code # Upcoming
|
|
93
|
+
npx skills add fastroware/waitsec/skills/waitsec-ui # Upcoming
|
|
90
94
|
```
|
|
91
95
|
|
|
92
96
|
---
|
|
@@ -96,26 +100,42 @@ npx skills add fastroware/waitsec
|
|
|
96
100
|
```text
|
|
97
101
|
waitsec/
|
|
98
102
|
├── skills/
|
|
99
|
-
│ ├──
|
|
100
|
-
│ │
|
|
101
|
-
│ ├──
|
|
103
|
+
│ ├── waitsec-core/ # ACTIVE — Core 5-phase guardrails
|
|
104
|
+
│ │ ├── SKILL.md # Hub: pipeline overview + links to detail files
|
|
105
|
+
│ │ ├── ask-first.md # Phase 1: Clarify requirements before coding
|
|
106
|
+
│ │ ├── anti-overengineering.md # Phase 2: Lean code + non-negotiable security
|
|
107
|
+
│ │ ├── small-diff.md # Phase 3: Surgical, proportional edits only
|
|
108
|
+
│ │ ├── debug-first.md # Phase 4: Root cause analysis before guessing
|
|
109
|
+
│ │ └── verify-first.md # Phase 5: Proof before declaring done
|
|
110
|
+
│ │
|
|
111
|
+
│ ├── waitsec-quality/ # UPCOMING — Security auditing, testing discipline
|
|
102
112
|
│ │ └── SKILL.md
|
|
103
|
-
│ ├──
|
|
113
|
+
│ ├── waitsec-code/ # UPCOMING — Clean code, anti-comment pollution
|
|
104
114
|
│ │ └── SKILL.md
|
|
105
|
-
│ └──
|
|
115
|
+
│ └── waitsec-ui/ # UPCOMING — Anti-slop CSS, responsive guardrails
|
|
106
116
|
│ └── SKILL.md
|
|
117
|
+
│
|
|
107
118
|
├── rules/
|
|
108
|
-
│ ├── AGENTS.md
|
|
109
|
-
│ └── waitsec.md
|
|
119
|
+
│ ├── AGENTS.md # Universal rule pointer (Antigravity / Claude Code)
|
|
120
|
+
│ └── waitsec.md # All-in-one bundled rules (Kilo Code / Cline / Cursor)
|
|
110
121
|
├── bin/
|
|
111
|
-
│ └── cli.js
|
|
112
|
-
├── plugin.json
|
|
113
|
-
├── package.json
|
|
114
|
-
└── composer.json
|
|
122
|
+
│ └── cli.js # Interactive terminal installer
|
|
123
|
+
├── plugin.json # Antigravity plugin manifest
|
|
124
|
+
├── package.json # npm / npx manifest
|
|
125
|
+
└── composer.json # Composer / Laravel manifest
|
|
115
126
|
```
|
|
116
127
|
|
|
117
128
|
---
|
|
118
129
|
|
|
130
|
+
## Roadmap: Core & Extensions
|
|
131
|
+
|
|
132
|
+
- **Core (Active)**: The 5 foundational guardrails (`ask-first`, `anti-overengineering`, `small-diff`, `debug-first`, `verify-first`).
|
|
133
|
+
- **Quality (Upcoming)**: Specialized deep-dives for `security`, `testing`, `performance`, and `accessibility`.
|
|
134
|
+
- **Code (Upcoming)**: Anti-slop comments, naming conventions, and dependency discipline.
|
|
135
|
+
- **UI (Upcoming)**: Anti-slop interface rules, responsive standards, and clean typography.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
119
139
|
## License
|
|
120
140
|
|
|
121
141
|
MIT
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/rules/AGENTS.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# waitsec
|
|
2
2
|
|
|
3
|
-
Wait a second before coding. Follow these
|
|
3
|
+
Wait a second before coding. Follow these five core guardrails:
|
|
4
4
|
|
|
5
5
|
1. **Ask First**: If requirements or key parameters are missing, ask the user before writing code. Do not invent requirements.
|
|
6
|
-
2. **Anti-Overengineering**: Prefer simple solutions over complex abstractions.
|
|
7
|
-
3. **Small Diff**: Modify only the lines and files strictly required to solve the task. Do not touch unrelated code.
|
|
8
|
-
4. **Debug First**: Inspect error logs and
|
|
6
|
+
2. **Anti-Overengineering**: Prefer simple solutions over complex abstractions. Build for today's needs, not hypothetical futures. **Crucial:** Never sacrifice security for simplicity (always enforce authorization, input validation, mass assignment guards, and SQL/XSS prevention).
|
|
7
|
+
3. **Small Diff**: Modify only the lines and files strictly required to solve the task. Do not touch unrelated code or reformat global files.
|
|
8
|
+
4. **Debug First**: Inspect error logs and stack traces to identify the root cause before editing code. Never guess.
|
|
9
|
+
5. **Verify First**: Never declare completion without proof. Run tests, build commands, and verify edge cases before closing.
|
|
10
|
+
|
package/rules/waitsec.md
CHANGED
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
# waitsec: AI Coding Guardrails
|
|
2
2
|
|
|
3
|
-
You follow the waitsec discipline: hold on, think first, and keep
|
|
3
|
+
You follow the waitsec discipline: hold on, think first, code less, and keep security airtight.
|
|
4
4
|
|
|
5
5
|
## 1. Ask First (Clarify Ambiguity)
|
|
6
6
|
- Before writing code, check whether the request is clear.
|
|
7
|
-
- If essential choices are missing (data schemas,
|
|
8
|
-
- If details are minor, pick the simplest reasonable default and proceed without
|
|
9
|
-
- Never invent product requirements out of nowhere.
|
|
7
|
+
- If essential choices are missing (data schemas, storage targets, permissions, limits), pause and ask the user 1 to 3 direct questions with concrete choices (A/B).
|
|
8
|
+
- If details are minor or standard, pick the simplest reasonable default and proceed without interrogating the user.
|
|
9
|
+
- Never invent business rules or product requirements out of nowhere.
|
|
10
10
|
|
|
11
|
-
## 2. Anti-Overengineering (
|
|
12
|
-
- Solve the problem
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
11
|
+
## 2. Anti-Overengineering (Lean Code, Non-Negotiable Security)
|
|
12
|
+
- **Cut Architectural Bloat:** Solve the problem with the fewest files and abstractions. Do not introduce DTOs, Repository layers, Event systems, or Factory patterns for simple tasks. Build for today's requirements, not speculative future needs.
|
|
13
|
+
- **Lean ≠ Insecure (CRITICAL):** Simplicity applies to architectural layers, never to defense mechanisms. You must never cut security corners:
|
|
14
|
+
- **Authorization & Authentication:** Always check permissions and resource ownership. Never expose IDOR vulnerabilities.
|
|
15
|
+
- **Strict Input Validation:** Always validate incoming payloads (types, lengths, allowed values). Input validation is mandatory, not overengineering.
|
|
16
|
+
- **Mass Assignment Protection:** Never pass raw request payloads directly to database create/update methods.
|
|
17
|
+
- **SQL Injection Prevention:** Always use parameterized queries or ORM bindings. Never interpolate raw strings into queries.
|
|
18
|
+
- **XSS Prevention:** Never bypass output escaping unless explicitly sanitizing rich text.
|
|
19
|
+
- **Secrets:** Never hardcode credentials; always read from environment variables (`.env`).
|
|
16
20
|
|
|
17
|
-
## 3. Small Diff (Proportional Edits)
|
|
18
|
-
- Only modify files
|
|
21
|
+
## 3. Small Diff (Surgical & Proportional Edits)
|
|
22
|
+
- Only modify files directly related to the user's prompt.
|
|
19
23
|
- Never refactor neighboring functions, reformat whitespace globally, or alter working code outside the task scope.
|
|
20
|
-
- Respect the
|
|
24
|
+
- Respect the prevailing code style, quote conventions, and indentation of the file.
|
|
25
|
+
- Avoid wholesale file replacements when a targeted edit solves the problem.
|
|
21
26
|
|
|
22
27
|
## 4. Debug First (Root Cause Analysis)
|
|
23
|
-
- When an error occurs, read the complete stack trace and inspect the failing line before editing
|
|
24
|
-
- Never guess
|
|
25
|
-
-
|
|
26
|
-
-
|
|
28
|
+
- When an error occurs, read the complete stack trace and inspect the failing line before editing any code.
|
|
29
|
+
- Never guess fixes or tweak random lines hoping the error disappears.
|
|
30
|
+
- Never silence errors with empty try/catch blocks or artificial fallback defaults.
|
|
31
|
+
- Fix the root cause at the source, then verify the fix by re-running the failing test or command.
|
|
32
|
+
|
|
33
|
+
## 5. Verify First (Proof Over Assumption)
|
|
34
|
+
- Never declare a task complete without empirical proof.
|
|
35
|
+
- Run tests, build commands, or reproduction scripts before writing your closing response.
|
|
36
|
+
- Verify both the success flow and edge-case failure handling.
|
|
37
|
+
- Ensure changes did not break neighboring functionality (regression check).
|
|
38
|
+
- Present real command outputs and test results to the user.
|
|
39
|
+
|
|
40
|
+
## Coexistence with Other Skills
|
|
41
|
+
- When `waitsec` is installed alongside third-party skills or framework guides, `waitsec` governs the operational discipline (clean diffs, restrained architecture, non-negotiable security, and verification).
|
|
42
|
+
- `waitsec` rules take precedence over suggestions that encourage unnecessary abstractions, speculative files, or bypassed security.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: waitsec-code
|
|
3
|
+
description: "[Coming Soon] Code quality extension for waitsec. Covers clean code patterns, anti-comment pollution, and dependency hygiene."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# waitsec-code: Clean Code Guardrails
|
|
7
|
+
|
|
8
|
+
> **Status: Work in Progress.** This module is not yet active. Check [github.com/fastroware/waitsec](https://github.com/fastroware/waitsec) for release updates.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Planned Guardrails
|
|
13
|
+
|
|
14
|
+
This extension targets the internal quality of the code itself:
|
|
15
|
+
|
|
16
|
+
- **Anti-Comment Pollution** — No redundant inline comments that restate what the code already says. Comments explain *why*, not *what*.
|
|
17
|
+
- **Clean Code Patterns** — Naming clarity, function length limits, single responsibility.
|
|
18
|
+
- **Dependency Hygiene** — Avoid pulling in packages for trivial problems. Audit transitive dependencies before adding them.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## How to Use When Released
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx waitsec --skill waitsec-core --skill waitsec-code
|
|
26
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: waitsec-core
|
|
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
|
+
---
|
|
5
|
+
|
|
6
|
+
# waitsec-core: The 5 Foundational Guardrails
|
|
7
|
+
|
|
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
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The 5-Phase Pipeline
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
[Prompt Received]
|
|
16
|
+
↓
|
|
17
|
+
[Phase 1: Ingestion] ➔ waitsec: ask-first
|
|
18
|
+
↓ (requirements clear)
|
|
19
|
+
[Phase 2: Architecture] ➔ waitsec: anti-overengineering (security non-negotiable)
|
|
20
|
+
↓ (minimal pattern chosen)
|
|
21
|
+
[Phase 3: Execution] ➔ waitsec: small-diff
|
|
22
|
+
↓ (errors encountered?)
|
|
23
|
+
[Phase 4: Debugging] ➔ waitsec: debug-first
|
|
24
|
+
↓ (ready to close?)
|
|
25
|
+
[Phase 5: Completion] ➔ waitsec: verify-first
|
|
26
|
+
↓
|
|
27
|
+
[Task Delivered]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 1. Phase 1: Ingestion — [`ask-first`](./ask-first.md)
|
|
33
|
+
* **Rule:** If critical parameters, schemas, or storage targets are missing, stop immediately.
|
|
34
|
+
* Ask 1 to 3 direct questions with concrete choices (Option A vs Option B).
|
|
35
|
+
* Never invent product rules or business assumptions out of thin air.
|
|
36
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec-core/ask-first.md`](./ask-first.md).
|
|
37
|
+
|
|
38
|
+
## 2. Phase 2: Architecture — [`anti-overengineering`](./anti-overengineering.md)
|
|
39
|
+
* **Rule:** Build for today's requirements. Reject speculative future-proofing, unnecessary DTOs, Repository interfaces, and empty wrapper classes.
|
|
40
|
+
* **Lean ≠ Insecure (CRITICAL):** Simplicity applies to architectural layers, never to defense mechanisms. You must enforce:
|
|
41
|
+
- Authentication and authorization checks (no IDOR).
|
|
42
|
+
- Strict input validation and mass assignment protection.
|
|
43
|
+
- Parameterized queries (SQL injection prevention) and proper output escaping (XSS prevention).
|
|
44
|
+
- Secrets loaded from environment variables (`.env`).
|
|
45
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec-core/anti-overengineering.md`](./anti-overengineering.md).
|
|
46
|
+
|
|
47
|
+
## 3. Phase 3: Execution — [`small-diff`](./small-diff.md)
|
|
48
|
+
* **Rule:** Restrict changes strictly to the files and lines that solve the prompt.
|
|
49
|
+
* Do not reformat global whitespace, touch neighboring modules, or perform unsolicited cleanup passes.
|
|
50
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec-core/small-diff.md`](./small-diff.md).
|
|
51
|
+
|
|
52
|
+
## 4. Phase 4: Debugging — [`debug-first`](./debug-first.md)
|
|
53
|
+
* **Rule:** When an error occurs, inspect the complete stack trace and identify the technical root cause before touching any file.
|
|
54
|
+
* Never spray random guesses across files. Never silence crashes with empty `try/catch` blocks.
|
|
55
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec-core/debug-first.md`](./debug-first.md).
|
|
56
|
+
|
|
57
|
+
## 5. Phase 5: Completion — [`verify-first`](./verify-first.md)
|
|
58
|
+
* **Rule:** Never declare a task complete without empirical proof.
|
|
59
|
+
* Run builds, test suites, or reproduction commands. Check edge cases and ensure no regressions occurred.
|
|
60
|
+
* Report real terminal outcomes to the user.
|
|
61
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec-core/verify-first.md`](./verify-first.md).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Framework Boundaries & Skill Coexistence
|
|
66
|
+
|
|
67
|
+
When `waitsec` is installed alongside other third-party agent skills (e.g. language skills, domain frameworks):
|
|
68
|
+
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.
|
|
69
|
+
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.
|
|
70
|
+
3. **Additive Loading:** When specialized extensions are present (`waitsec-quality`, `waitsec-code`, `waitsec-ui`), load them dynamically only when the prompt demands them.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: anti-overengineering
|
|
3
|
+
description: Prevent bloated abstractions, unnecessary design patterns, and excessive files while keeping security airtight.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Anti-Overengineering: Lean Code, Airtight Security
|
|
7
|
+
|
|
8
|
+
Do not turn a simple 10-line requirement into a 12-file enterprise architecture. Solve today's problem with the simplest working implementation.
|
|
9
|
+
|
|
10
|
+
**Core Principle:** *Lean code does not mean insecure code.* Cut out useless architectural theater, but never compromise on security, data integrity, or authorization.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Anti-Patterns (The Tells)
|
|
15
|
+
|
|
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.
|
|
20
|
+
|
|
21
|
+
### 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
|
+
### 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:
|
|
28
|
+
```php
|
|
29
|
+
class StringHelper {
|
|
30
|
+
public static function toLower($str) {
|
|
31
|
+
return strtolower($str); // Pointless wrapper
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
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.
|
|
37
|
+
|
|
38
|
+
### 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.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## CRITICAL: Security is Non-Negotiable (Lean ≠ Insecure)
|
|
46
|
+
|
|
47
|
+
Never cut security corners under the false excuse of "keeping it simple". Simplicity applies to architectural layers, never to defense mechanisms.
|
|
48
|
+
|
|
49
|
+
The following security practices are **mandatory in all generated code**:
|
|
50
|
+
|
|
51
|
+
### 1. Authorization & Authentication
|
|
52
|
+
- **Never bypass access checks.** Always verify that the current user has permission to view, edit, or delete the target resource (e.g. Laravel Policies/Gates, role checks, session validations).
|
|
53
|
+
- **Insecure direct object references (IDOR) are strictly forbidden.** Never fetch a record solely by ID from a request without verifying ownership or tenant isolation:
|
|
54
|
+
```php
|
|
55
|
+
// BAD: Anyone can change user ID in URL to steal data
|
|
56
|
+
$order = Order::find($id);
|
|
57
|
+
|
|
58
|
+
// GOOD: Scoped to authenticated user
|
|
59
|
+
$order = auth()->user()->orders()->findOrFail($id);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 2. Strict Input Validation
|
|
63
|
+
- Validating user input is **not** overengineering; it is mandatory security.
|
|
64
|
+
- Always validate types, string lengths, formats, and allowed enum values before processing.
|
|
65
|
+
- In Laravel, use Form Request classes or `$request->validate()`. In Node, use Zod or schema validators.
|
|
66
|
+
|
|
67
|
+
### 3. Mass Assignment Protection
|
|
68
|
+
- Never pass raw, unfiltered request payloads directly to database creation or update methods:
|
|
69
|
+
```php
|
|
70
|
+
// FORBIDDEN: Allows attackers to inject isAdmin=1 or change prices
|
|
71
|
+
User::create($request->all());
|
|
72
|
+
|
|
73
|
+
// REQUIRED: Only validated, safe fields
|
|
74
|
+
User::create($request->validated());
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 4. SQL Injection Prevention
|
|
78
|
+
- Always use parameterized queries or ORM query builders.
|
|
79
|
+
- Never concatenate raw user input into SQL queries or raw where clauses:
|
|
80
|
+
```php
|
|
81
|
+
// FORBIDDEN:
|
|
82
|
+
DB::statement("SELECT * FROM users WHERE email = '" . $email . "'");
|
|
83
|
+
|
|
84
|
+
// REQUIRED:
|
|
85
|
+
DB::select("SELECT * FROM users WHERE email = ?", [$email]);
|
|
86
|
+
// or ORM:
|
|
87
|
+
User::where('email', $email)->first();
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 5. XSS & Output Sanitization
|
|
91
|
+
- Never bypass output escaping unless explicitly rendering sanitized rich text.
|
|
92
|
+
- Avoid raw unescaped directives (`{!! $var !!}` in Blade, `dangerouslySetInnerHTML` in React, `v-html` in Vue) unless the input has been sanitized through a dedicated HTML purifier.
|
|
93
|
+
|
|
94
|
+
### 6. Secret & Credential Safety
|
|
95
|
+
- Never hardcode API keys, passwords, database credentials, or tokens in source code.
|
|
96
|
+
- Always load sensitive values from environment variables (`.env`).
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Comparison: Bad vs Good
|
|
101
|
+
|
|
102
|
+
### Task: "Add an endpoint to cancel an order"
|
|
103
|
+
|
|
104
|
+
❌ **Bad (Overengineered):**
|
|
105
|
+
- `CancelOrderCommand.php`
|
|
106
|
+
- `CancelOrderCommandHandler.php`
|
|
107
|
+
- `OrderRepositoryInterface.php`
|
|
108
|
+
- `EloquentOrderRepository.php`
|
|
109
|
+
- `OrderCancelledEvent.php`
|
|
110
|
+
- `OrderCancellationDTO.php`
|
|
111
|
+
- Total: 6 files, 150 lines of boilerplate, yet forgot to check if the order belongs to the logged-in user!
|
|
112
|
+
|
|
113
|
+
✅ **Good (Lean & Secure):**
|
|
114
|
+
- `OrderController.php` (checks `$this->authorize('cancel', $order)`, updates status, dispatches existing notification).
|
|
115
|
+
- Total: 1 file, 15 lines of clear, secure, readable code.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Checklist
|
|
120
|
+
|
|
121
|
+
Before declaring any feature complete:
|
|
122
|
+
- [ ] Did I avoid adding unnecessary interfaces, repositories, or DTOs?
|
|
123
|
+
- [ ] Did I avoid creating new files when an existing file could house the logic naturally?
|
|
124
|
+
- [ ] Is authentication and authorization strictly enforced on every protected action?
|
|
125
|
+
- [ ] Is all incoming input validated and guarded against mass assignment?
|
|
126
|
+
- [ ] Are all database queries protected against SQL injection?
|
|
127
|
+
- [ ] Are secrets kept in `.env` and out of source code?
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
## Anti-Patterns (The Tells)
|
|
15
|
+
|
|
16
|
+
### 1. Premature Scaffolding
|
|
17
|
+
- **Tell:** User says "add photo upload", and the agent immediately writes database migrations, thumbnail background jobs, AWS S3 storage adapters, and cleanup cron tasks without asking a single question.
|
|
18
|
+
- **Why:** The user might only have wanted a temporary avatar upload saved to local disk. Generating infrastructure based on unconfirmed assumptions wastes tokens and creates code the user has to delete.
|
|
19
|
+
- **Fix:** Stop before writing code. Identify what is missing (storage target, max size, accepted formats, single vs multiple) and confirm the essentials.
|
|
20
|
+
|
|
21
|
+
### 2. Inventing Business Rules
|
|
22
|
+
- **Tell:** User asks for "a discount calculation on checkout", and the agent invents a 15% VIP tier, coupon expiration policies, and minimum spend rules that were never mentioned.
|
|
23
|
+
- **Why:** AI hallucinates business logic out of habit to make the code look "complete". Invented rules confuse the product requirements.
|
|
24
|
+
- **Fix:** If rules are unspecified, ask the user, or implement only the direct formula requested with a clean placeholder for future rules.
|
|
25
|
+
|
|
26
|
+
### 3. Destructive Replacement
|
|
27
|
+
- **Tell:** User asks to "improve the navigation bar", and the agent completely deletes the existing navbar component and replaces it with a completely different framework or design.
|
|
28
|
+
- **Why:** The agent assumes replacement is always preferred over enhancement.
|
|
29
|
+
- **Fix:** Clarify whether the existing implementation should be modified in place or replaced from scratch.
|
|
30
|
+
|
|
31
|
+
### 4. Trivia Interrogation (The Opposite Extreme)
|
|
32
|
+
- **Tell:** The agent stops and bombards the user with 10 pedantic questions about internal variable names, CSS class naming conventions, or folder structures that have obvious conventions.
|
|
33
|
+
- **Why:** Over-asking frustrates the user and defeats the purpose of an autonomous coding assistant.
|
|
34
|
+
- **Fix:** Ask only questions that materially change the architecture or user-facing behavior. Use sensible defaults for everything else.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Decision Matrix: When to Ask vs When to Default
|
|
39
|
+
|
|
40
|
+
| Situation | Action | Rationale |
|
|
41
|
+
| :--- | :--- | :--- |
|
|
42
|
+
| Missing storage location, file size limit, or format | **ASK** | Materially changes packages, disk, and schema. |
|
|
43
|
+
| Missing permission/role requirements for a sensitive action | **ASK** | Critical security and authorization impact. |
|
|
44
|
+
| Multiple valid architectures (e.g. queue worker vs synchronous) | **ASK** | Affects hosting environment and dependencies. |
|
|
45
|
+
| Choosing variable names or internal helper method names | **DEFAULT** | Follow existing codebase conventions silently. |
|
|
46
|
+
| Choosing standard HTTP status codes (200, 201, 404, 422) | **DEFAULT** | Follow standard REST / web specifications. |
|
|
47
|
+
| Choosing standard validation error messages | **DEFAULT** | Use clear, standard phrasing. |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## How to Ask Effectively
|
|
52
|
+
|
|
53
|
+
When asking questions:
|
|
54
|
+
1. **Limit to 1 to 3 questions maximum.** Never send a wall of text.
|
|
55
|
+
2. **Provide concrete choices (A / B).** Give clear recommendations (e.g. *"Option A: Local storage (simpler for now) vs Option B: S3 bucket"*).
|
|
56
|
+
3. **State the trade-off briefly.** Explain in one sentence why the choice matters.
|
|
57
|
+
4. **Wait for the answer.** Do not generate speculative files while waiting.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Checklist
|
|
62
|
+
|
|
63
|
+
Before writing code for any new feature, verify:
|
|
64
|
+
- [ ] Are all critical requirements and constraints known?
|
|
65
|
+
- [ ] Did I avoid inventing product or business logic out of thin air?
|
|
66
|
+
- [ ] If questions are needed, are they capped at 1-3 with clear options?
|
|
67
|
+
- [ ] Did I avoid asking trivial questions about things the codebase already answers?
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
## Anti-Patterns (The Tells)
|
|
13
|
+
|
|
14
|
+
### 1. The Shotgun Guess
|
|
15
|
+
- **Tell:** 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.
|
|
16
|
+
- **Why:** The AI acts on statistical intuition rather than empirical debugging, often introducing new bugs while failing to fix the original one.
|
|
17
|
+
- **Fix:** Never touch a single line of code until you have identified the exact file, line number, and runtime state that triggered the failure.
|
|
18
|
+
|
|
19
|
+
### 2. Silent Error Swallowing
|
|
20
|
+
- **Tell:** 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.
|
|
21
|
+
- **Why:** Silencing errors masks underlying data corruption and turns a loud, easily fixable bug into a silent, catastrophic production failure.
|
|
22
|
+
- **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.
|
|
23
|
+
|
|
24
|
+
### 3. Surface Symptom Patching
|
|
25
|
+
- **Tell:** 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.
|
|
26
|
+
- **Why:** Masking a missing variable upstream causes corrupted state downstream.
|
|
27
|
+
- **Fix:** Trace the data flow backwards. Find where `user` was loaded, why it failed to resolve, and fix the source query or relationship.
|
|
28
|
+
|
|
29
|
+
### 4. Hallucinating Missing Dependencies
|
|
30
|
+
- **Tell:** 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`.
|
|
31
|
+
- **Why:** The agent assumes missing functionality means missing packages, cluttering the project with unneeded external dependencies.
|
|
32
|
+
- **Fix:** Check for typos, path mismatches, autoloading issues, or missing exports first.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## The 5-Step Root Cause Sequence
|
|
37
|
+
|
|
38
|
+
Follow this disciplined sequence whenever debugging:
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
2. **Inspect the Execution Context:** Read the failing function, check the inputs passed to it, and determine the exact condition that caused the crash.
|
|
42
|
+
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).
|
|
43
|
+
4. **Apply One Targeted Fix:** Make the smallest possible fix that resolves the root cause.
|
|
44
|
+
5. **Verify the Fix:** Run the test suite, command, or request again to verify that the error is resolved and no regressions were introduced.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Checklist
|
|
49
|
+
|
|
50
|
+
Before declaring a bug fixed:
|
|
51
|
+
- [ ] Did I locate the exact line and file of the failure from the stack trace?
|
|
52
|
+
- [ ] Did I fix the root cause rather than merely masking the symptom?
|
|
53
|
+
- [ ] Did I avoid wrapping the code in silent, empty try/catch blocks?
|
|
54
|
+
- [ ] Did I verify the fix by re-running the failing test or reproduction command?
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
## Anti-Patterns (The Tells)
|
|
13
|
+
|
|
14
|
+
### 1. Collateral Reformatting
|
|
15
|
+
- **Tell:** 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.
|
|
16
|
+
- **Why:** Pollutes git history, makes `git blame` useless, and introduces merge conflicts for teammates working on the same branch.
|
|
17
|
+
- **Fix:** Format only the lines you touched. Leave existing indentation and formatting untouched.
|
|
18
|
+
|
|
19
|
+
### 2. Gratuitous Renaming & Style Imposition
|
|
20
|
+
- **Tell:** 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.
|
|
21
|
+
- **Why:** Every modified line carries the risk of unintended regression and distraction during code review.
|
|
22
|
+
- **Fix:** Keep your hands off working code outside the prompt scope. Respect the prevailing style of the file.
|
|
23
|
+
|
|
24
|
+
### 3. File Scope Creep
|
|
25
|
+
- **Tell:** 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.
|
|
26
|
+
- **Why:** The AI over-reaches, treating every task as an invitation to overhaul the project.
|
|
27
|
+
- **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.
|
|
28
|
+
|
|
29
|
+
### 4. Wholesale File Rewriting
|
|
30
|
+
- **Tell:** 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.
|
|
31
|
+
- **Why:** Generative models love generating whole files from scratch rather than performing surgical edits.
|
|
32
|
+
- **Fix:** Use targeted diffs or line-level edits. Always inspect the original file to ensure existing functionality is preserved.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## The Scope Guardrail
|
|
37
|
+
|
|
38
|
+
Before saving any file change, ask:
|
|
39
|
+
1. **Is this edit strictly required to solve the prompt?** If no, delete the edit.
|
|
40
|
+
2. **Does this edit touch unrelated functions, styles, or configuration?** If yes, revert it.
|
|
41
|
+
3. **Does the git diff contain unnecessary whitespace or formatting churn?** If yes, clean up the diff.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Checklist
|
|
46
|
+
|
|
47
|
+
Before submitting code changes:
|
|
48
|
+
- [ ] Are all modified files directly related to the user's prompt?
|
|
49
|
+
- [ ] Did I avoid global reformatting or unnecessary whitespace churn?
|
|
50
|
+
- [ ] Did I preserve the project's existing quote styles, indentations, and naming conventions?
|
|
51
|
+
- [ ] Did I leave working, unrelated code completely untouched?
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
## Anti-Patterns (The Tells)
|
|
15
|
+
|
|
16
|
+
### 1. The Premature Victory Lap
|
|
17
|
+
- **Tell:** The agent modifies code, never runs a test or build command, and immediately announces: *"I have fixed the issue and implemented all requirements!"*
|
|
18
|
+
- **Why:** 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.
|
|
19
|
+
- **Fix:** Run the relevant test suite, build command, or reproduction script before writing your closing message.
|
|
20
|
+
|
|
21
|
+
### 2. Regression Blindness
|
|
22
|
+
- **Tell:** 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.
|
|
23
|
+
- **Why:** The AI focuses narrowly on the prompt and ignores downstream dependencies.
|
|
24
|
+
- **Fix:** If the project has automated tests (`npm test`, `pytest`, `php artisan test`, `go test`), run them to ensure no regressions were introduced.
|
|
25
|
+
|
|
26
|
+
### 3. Phantom Verification
|
|
27
|
+
- **Tell:** 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.
|
|
28
|
+
- **Why:** Generative models hallucinate successful outcomes based on expectation.
|
|
29
|
+
- **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.
|
|
30
|
+
|
|
31
|
+
### 4. Happy-Path Myopia
|
|
32
|
+
- **Tell:** Testing only the success state (e.g. valid login) while completely ignoring error states (wrong password, empty inputs, network failure, unauthorized access).
|
|
33
|
+
- **Why:** AI naturally gravitates toward the ideal flow.
|
|
34
|
+
- **Fix:** Verify both the happy path and at least one failure/edge case before declaring completion.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## The 4-Step Verification Sequence
|
|
39
|
+
|
|
40
|
+
Follow this sequence before declaring any task finished:
|
|
41
|
+
|
|
42
|
+
1. **Syntax & Build Check:** Ensure the code compiles, lints, or builds with zero errors (`npm run build`, `tsc --noEmit`, etc.).
|
|
43
|
+
2. **Behavioral Test:** Run the specific automated test or reproduction script that targets the changed functionality.
|
|
44
|
+
3. **Regression Check:** Run the wider test suite (if available) to guarantee neighboring features still work.
|
|
45
|
+
4. **Present Concrete Evidence:** Summarize what was tested and include the actual pass/fail status in your final response.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Decision Matrix: What to Verify
|
|
50
|
+
|
|
51
|
+
| Task Type | Minimum Verification Required |
|
|
52
|
+
| :--- | :--- |
|
|
53
|
+
| **Bug Fix** | Re-run the reproduction command; prove the error no longer occurs. |
|
|
54
|
+
| **New Feature** | Run unit/feature tests; test both valid input and invalid/empty input. |
|
|
55
|
+
| **Refactoring** | Run existing test suite to ensure 100% backward compatibility. |
|
|
56
|
+
| **Documentation / Copy** | Verify rendered markdown formatting, links, and code block syntax. |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Checklist
|
|
61
|
+
|
|
62
|
+
Before declaring a task complete:
|
|
63
|
+
- [ ] Did I run the build, linter, or type checker to ensure no syntax/compilation errors?
|
|
64
|
+
- [ ] Did I run the relevant automated test or verification command?
|
|
65
|
+
- [ ] Did I verify that existing neighboring functionality was not broken?
|
|
66
|
+
- [ ] Did I check at least one error or edge-case state?
|
|
67
|
+
- [ ] Did I report the real verification outcome to the user instead of assuming success?
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: waitsec-quality
|
|
3
|
+
description: "[Coming Soon] Quality extension for waitsec. Covers security auditing, automated testing discipline, and data integrity guardrails."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# waitsec-quality: Quality & Safety Guardrails
|
|
7
|
+
|
|
8
|
+
> **Status: Work in Progress.** This module is not yet active. Check [github.com/fastroware/waitsec](https://github.com/fastroware/waitsec) for release updates.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Planned Guardrails
|
|
13
|
+
|
|
14
|
+
This extension adds a second layer on top of `waitsec-core`, focused on code quality and systemic safety:
|
|
15
|
+
|
|
16
|
+
- **Security Audit** — Active scanning for common vulnerabilities beyond the baseline enforced in `anti-overengineering`. Includes dependency audits, permission boundaries, and sensitive data exposure checks.
|
|
17
|
+
- **Testing Discipline** — Rules for meaningful tests: no trivial assertions, no mocked-everything suites, no skipping edge cases.
|
|
18
|
+
- **Data Integrity** — Database constraint checks, migration safety, and soft-delete handling patterns.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## How to Use When Released
|
|
23
|
+
|
|
24
|
+
Install alongside `waitsec-core`:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx waitsec --skill waitsec-core --skill waitsec-quality
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or via `skills.sh`:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
skills install fastroware/waitsec/skills/waitsec-quality
|
|
34
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: waitsec-ui
|
|
3
|
+
description: "[Coming Soon] UI/frontend extension for waitsec. Covers anti-slop CSS, responsive discipline, and no-decoration-for-decoration's-sake rules."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# waitsec-ui: Frontend Guardrails
|
|
7
|
+
|
|
8
|
+
> **Status: Work in Progress.** This module is not yet active. Check [github.com/fastroware/waitsec](https://github.com/fastroware/waitsec) for release updates.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Planned Guardrails
|
|
13
|
+
|
|
14
|
+
This extension targets frontend and CSS quality:
|
|
15
|
+
|
|
16
|
+
- **Anti-Slop CSS** — No gradient purple for no reason, no box-shadow stacks that add nothing, no animation on elements that don't need it.
|
|
17
|
+
- **Responsive Discipline** — Mobile-first layout rules. No pixel-locked widths on main containers. No horizontal scroll on mobile.
|
|
18
|
+
- **Decoration Restraint** — Every visual element must have a functional purpose. Decorative elements that increase cognitive load without guiding the user get cut.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## How to Use When Released
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx waitsec --skill waitsec-core --skill waitsec-ui
|
|
26
|
+
```
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: anti-overengineering
|
|
3
|
-
description: Stop creating unnecessary files, design patterns, abstractions, or libraries for simple tasks.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Anti-Overengineering: Build What Is Needed Today
|
|
7
|
-
|
|
8
|
-
Do not turn a 10-line fix into a 10-file enterprise architecture. Solve today's problem with the simplest working solution.
|
|
9
|
-
|
|
10
|
-
## The Rules
|
|
11
|
-
|
|
12
|
-
1. **Follow existing project patterns.** If the project puts logic in controllers, do not suddenly introduce CQRS or repositories unless asked.
|
|
13
|
-
2. **Never build for imaginary future needs.** Do not add interfaces, adapters, or factories "just in case" someone might need them next year.
|
|
14
|
-
3. **No empty abstractions.** If a class or function only wraps a single line of standard code, delete the wrapper and write the line directly.
|
|
15
|
-
4. **Use built-in tools first.** Avoid installing new npm packages, pip packages, or composer packages for problems that existing project dependencies or standard libraries already solve.
|
|
16
|
-
5. **Keep file count down.** Prefer modifying or extending an existing file over creating a dozen micro-files.
|
|
17
|
-
|
|
18
|
-
## Bad vs Good
|
|
19
|
-
|
|
20
|
-
Bad:
|
|
21
|
-
```text
|
|
22
|
-
User: "Add a basic contact form."
|
|
23
|
-
Agent creates:
|
|
24
|
-
- ContactController.php
|
|
25
|
-
- ContactRepositoryInterface.php
|
|
26
|
-
- EloquentContactRepository.php
|
|
27
|
-
- SendContactNotificationEvent.php
|
|
28
|
-
- SendContactNotificationListener.php
|
|
29
|
-
- ContactDTO.php
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Good:
|
|
33
|
-
```text
|
|
34
|
-
Agent creates:
|
|
35
|
-
- ContactController.php (stores message and sends email directly or queues existing mailer)
|
|
36
|
-
- ContactRequest.php (input validation)
|
|
37
|
-
```
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ask-first
|
|
3
|
-
description: Pause before coding when requirements are unclear. Ask clarifying questions instead of guessing.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Ask First: Confirm Before You Code
|
|
7
|
-
|
|
8
|
-
Most AI coding mistakes happen because the agent starts coding before knowing what the user actually wants.
|
|
9
|
-
|
|
10
|
-
When requirements are vague, do not invent answers. Stop and ask.
|
|
11
|
-
|
|
12
|
-
## When to Pause and Ask
|
|
13
|
-
|
|
14
|
-
Ask before writing code if:
|
|
15
|
-
- Key decisions are missing (e.g. file formats, storage location, size limits, user permissions).
|
|
16
|
-
- You are unsure whether to overwrite an existing feature or build alongside it.
|
|
17
|
-
- There are multiple valid approaches with significantly different trade-offs.
|
|
18
|
-
|
|
19
|
-
## When NOT to Ask (Pick Sensible Defaults)
|
|
20
|
-
|
|
21
|
-
Do not bug the user with tiny technical trivia. Pick the simplest default and proceed if:
|
|
22
|
-
- The question is about basic implementation details (variable names, internal helper functions).
|
|
23
|
-
- The existing codebase already has a clear pattern for this.
|
|
24
|
-
- The choice has no impact on user experience or architecture.
|
|
25
|
-
|
|
26
|
-
## How to Ask
|
|
27
|
-
|
|
28
|
-
- Ask 1 to 3 short, direct questions.
|
|
29
|
-
- Present concrete options (A or B) whenever possible.
|
|
30
|
-
- Briefly explain why the choice matters so the user can answer easily.
|
|
31
|
-
- Wait for the user's answer before creating files or running heavy generation.
|
|
@@ -1,24 +0,0 @@
|
|
|
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 evidence is available. Do not spray random code changes hoping the error goes away.
|
|
9
|
-
|
|
10
|
-
## The Debug Sequence
|
|
11
|
-
|
|
12
|
-
When an error happens:
|
|
13
|
-
|
|
14
|
-
1. **Read the full error message and stack trace.** Do not just skim the first sentence. Look for the exact file path and line number where execution failed.
|
|
15
|
-
2. **Inspect the failing line and surrounding context.** Check what variables were passed and why that specific line crashed.
|
|
16
|
-
3. **Verify the root cause.** Understand whether this is a null value, missing dependency, syntax error, or permission issue before editing.
|
|
17
|
-
4. **Make one surgical fix.** Change only what is broken.
|
|
18
|
-
5. **Verify the outcome.** Run the test or reproduction command again to confirm the fix works without creating side effects.
|
|
19
|
-
|
|
20
|
-
## Anti-Patterns to Avoid
|
|
21
|
-
|
|
22
|
-
- Do not wrap the failing code in a generic try/catch block just to silence the error without fixing the underlying problem.
|
|
23
|
-
- Do not edit 5 different files simultaneously when an error is reported on one line.
|
|
24
|
-
- Do not add random fallback defaults that hide broken states.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: small-diff
|
|
3
|
-
description: Keep edits small and focused. Only change the files and lines necessary to solve the prompt.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Small Diff: Keep Code Changes Proportional
|
|
7
|
-
|
|
8
|
-
Do not rewrite an entire file or touch neighboring modules when fixing a specific bug or adding a small tweak.
|
|
9
|
-
|
|
10
|
-
## The Rules
|
|
11
|
-
|
|
12
|
-
1. **Only touch relevant files.** If the task is fixing a button margin, do not touch routing, config files, package dependencies, or unrelated styles.
|
|
13
|
-
2. **No unsolicited refactoring.** Do not reformat indentation, rename variables, or rearrange code outside the area you were asked to change.
|
|
14
|
-
3. **No vanity cleanups.** Do not remove existing comments or replace working code with your preferred coding style unless the prompt asked for a refactor.
|
|
15
|
-
4. **Preserve existing style.** Match the quoting style, indentations, and naming conventions of the surrounding file.
|
|
16
|
-
|
|
17
|
-
## Why This Matters
|
|
18
|
-
|
|
19
|
-
Unnecessary edits create noisy git diffs, increase merge conflicts, and accidentally break working features. Make the smallest surgical change that gets the job done.
|