waitsec 0.4.4 → 0.5.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 +18 -12
- package/bin/cli.mjs +15 -10
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills/{waitsec-core → waitsec}/SKILL.md +29 -18
- package/skills/{waitsec-core → waitsec/references}/ask-first.md +44 -11
- package/skills/waitsec/references/write-info-analyzer.md +117 -0
- package/skills/waitsec-code/SKILL.md +33 -13
- package/skills/waitsec-pagemaker/SKILL.md +210 -0
- package/skills/waitsec-pagemaker/references/about-me.md +122 -0
- package/skills/waitsec-pagemaker/references/article-single.md +104 -0
- package/skills/waitsec-pagemaker/references/blog-index.md +121 -0
- package/skills/waitsec-pagemaker/references/contact-page.md +123 -0
- package/skills/waitsec-pagemaker/references/landing-page.md +152 -0
- package/skills/waitsec-quality/SKILL.md +31 -18
- package/skills/waitsec-ui/SKILL.md +34 -13
- /package/skills/{waitsec-core → waitsec/references}/anti-overengineering.md +0 -0
- /package/skills/{waitsec-core → waitsec/references}/debug-first.md +0 -0
- /package/skills/{waitsec-core → waitsec/references}/small-diff.md +0 -0
- /package/skills/{waitsec-core → waitsec/references}/verify-first.md +0 -0
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
|
|
105
|
-
npx skills add fastroware/waitsec/skills/waitsec-
|
|
106
|
-
npx skills add fastroware/waitsec/skills/waitsec-
|
|
107
|
-
npx skills add fastroware/waitsec/skills/waitsec-
|
|
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
|
|
118
|
+
│ ├── waitsec/ # ACTIVE — Core 5-phase guardrails
|
|
118
119
|
│ │ ├── SKILL.md # Hub: pipeline overview + links to detail files
|
|
119
|
-
│ │
|
|
120
|
-
│ │
|
|
121
|
-
│ │
|
|
122
|
-
│ │
|
|
123
|
-
│ │
|
|
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-
|
|
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-
|
|
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
|
|
16
|
+
const CORE_SKILL = 'waitsec';
|
|
17
17
|
|
|
18
18
|
const AVAILABLE_SKILLS = [
|
|
19
19
|
{
|
|
20
|
-
value: 'waitsec
|
|
21
|
-
label: 'waitsec
|
|
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-
|
|
26
|
-
label: 'waitsec-
|
|
27
|
-
hint: '
|
|
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-
|
|
36
|
-
label: 'waitsec-
|
|
37
|
-
hint: '
|
|
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
|
|
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
package/plugin.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: waitsec
|
|
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
|
|
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,42 +32,51 @@ You operate under the **waitsec** engineering discipline. These guardrails act a
|
|
|
30
32
|
|
|
31
33
|
---
|
|
32
34
|
|
|
33
|
-
## 1. Phase 1: Ingestion
|
|
34
|
-
* **Rule:**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* *Deep Dive & Tells:* Read [`skills/waitsec
|
|
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
|
|
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
|
|
48
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec/references/anti-overengineering.md`](./references/anti-overengineering.md).
|
|
47
49
|
|
|
48
|
-
## 3. Phase 3: Execution
|
|
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
|
|
53
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec/references/small-diff.md`](./references/small-diff.md).
|
|
52
54
|
|
|
53
|
-
## 4. Phase 4: Debugging
|
|
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
|
|
58
|
+
* *Deep Dive & Tells:* Read [`skills/waitsec/references/debug-first.md`](./references/debug-first.md).
|
|
57
59
|
|
|
58
|
-
## 5. Phase 5: Completion
|
|
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
|
|
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
|
|
70
|
-
2. **Never Override Security with Simplicity:** If another skill suggests a fast shortcut that bypasses authorization or input sanitization, `waitsec
|
|
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.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Pre-Flight Checklist
|
|
78
|
+
Before finalizing work:
|
|
79
|
+
- [ ] Were missing core requirements clarified via direct choices before writing code?
|
|
80
|
+
- [ ] Was the simplest architecture chosen without sacrificing security (auth, input validation, escaping)?
|
|
81
|
+
- [ ] Are code modifications restricted strictly to files solving the prompt (minimal diff)?
|
|
82
|
+
- [ ] Has the solution been verified empirically via terminal commands, builds, or test suites?
|
|
@@ -35,22 +35,55 @@ When requirements are ambiguous, do not invent answers. Stop, pause, and clarify
|
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
38
|
+
## The "Crucial Only" Threshold
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
### What Counts as "Crucial":
|
|
43
|
+
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.
|
|
44
|
+
2. **Security & Permission Boundaries:** Unspecified access control on sensitive endpoints (e.g. should this API be public, authenticated, or restricted to admin users?).
|
|
45
|
+
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).
|
|
46
|
+
|
|
47
|
+
### What is NOT Crucial (Never Ask):
|
|
48
|
+
- Internal naming (variables, files, helpers): look at the existing code and follow it.
|
|
49
|
+
- Basic UI styles, padding, or colors: follow the existing theme or design system.
|
|
50
|
+
- Common edge cases: handle them with sensible, simple defaults.
|
|
51
|
+
- Anything the user has already approved or asked for directly.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## User Override: The "Just Do It" Rule
|
|
56
|
+
|
|
57
|
+
If the user explicitly instructs:
|
|
58
|
+
- *"Gak usah banyak tanya / Don't ask questions"*
|
|
59
|
+
- *"Langsung aja / Just do it"*
|
|
60
|
+
- *"Terserah lu / Use your best judgment"*
|
|
61
|
+
- Or has already confirmed a plan:
|
|
62
|
+
|
|
63
|
+
**STOP ASKING.** Immediately switch to autonomous mode:
|
|
64
|
+
- Pick the most minimal, standard, and defensive implementation.
|
|
65
|
+
- Execute with small, surgical diffs.
|
|
66
|
+
- Only halt if an action would cause unrecoverable data destruction (e.g. dropping production databases or deleting uncommitted files).
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
38
70
|
## Decision Matrix: When to Ask vs When to Default
|
|
39
71
|
|
|
40
72
|
| Situation | Action | Rationale |
|
|
41
73
|
| :--- | :--- | :--- |
|
|
42
|
-
|
|
|
43
|
-
| Missing
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
| Choosing
|
|
47
|
-
| Choosing standard
|
|
74
|
+
| User explicitly said "just do it" or confirmed the plan | **DEFAULT** | Respect user override; proceed autonomously. |
|
|
75
|
+
| Missing storage target (local disk vs AWS S3) | **ASK** | Crucial: changes dependencies, environment, and config. |
|
|
76
|
+
| Missing permission/role requirements for a sensitive action | **ASK** | Crucial: security and authorization boundaries. |
|
|
77
|
+
| Irreversible database schema drop or type change | **ASK** | Crucial: risk of unrecoverable data loss. |
|
|
78
|
+
| Choosing variable names or internal helper method names | **DEFAULT** | Non-crucial: follow existing codebase conventions. |
|
|
79
|
+
| Choosing standard HTTP status codes (200, 201, 404, 422) | **DEFAULT** | Non-crucial: follow REST specifications. |
|
|
80
|
+
| Choosing standard validation error messages | **DEFAULT** | Non-crucial: use clear standard phrasing. |
|
|
48
81
|
|
|
49
82
|
---
|
|
50
83
|
|
|
51
84
|
## How to Ask Effectively
|
|
52
85
|
|
|
53
|
-
When
|
|
86
|
+
When questions are truly crucial:
|
|
54
87
|
1. **Limit to 1 to 3 questions maximum.** Never send a wall of text.
|
|
55
88
|
2. **Provide concrete choices (A / B).** Give clear recommendations (e.g. *"Option A: Local storage (simpler for now) vs Option B: S3 bucket"*).
|
|
56
89
|
3. **State the trade-off briefly.** Explain in one sentence why the choice matters.
|
|
@@ -60,8 +93,8 @@ When asking questions:
|
|
|
60
93
|
|
|
61
94
|
## Checklist
|
|
62
95
|
|
|
63
|
-
Before writing code for any
|
|
64
|
-
- [ ]
|
|
96
|
+
Before writing code for any task, verify:
|
|
97
|
+
- [ ] Has the user explicitly requested autonomous execution ("just do it" / plan already approved)? If yes, skip asking.
|
|
98
|
+
- [ ] Is the question genuinely crucial (structural, irreversible, or security-critical)? If no, use sensible defaults.
|
|
65
99
|
- [ ] Did I avoid inventing product or business logic out of thin air?
|
|
66
|
-
- [ ] If questions are
|
|
67
|
-
- [ ] Did I avoid asking trivial questions about things the codebase already answers?
|
|
100
|
+
- [ ] If questions are necessary, are they capped at 1-3 with clear options?
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Write Info Analyzer: UI Copy & Text Cleaner
|
|
2
|
+
|
|
3
|
+
You are an AI agent that checks every piece of text on the user interface. Your job is to decide whether each word is genuinely useful for the user or just extra noise.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Main Principle
|
|
8
|
+
|
|
9
|
+
**Do not assume that every single element needs a label, a tooltip, or an explanation.**
|
|
10
|
+
|
|
11
|
+
A good user interface does not explain itself over and over. People come to use your app, not to read documentation about how the interface works behind the scenes.
|
|
12
|
+
|
|
13
|
+
Always put **information that helps users make decisions or finish their tasks** first.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## When to Delete Text
|
|
18
|
+
|
|
19
|
+
Delete any text if it meets any of these points:
|
|
20
|
+
|
|
21
|
+
1. It only explains how the interface works from a coding perspective.
|
|
22
|
+
2. It talks about code mechanisms like infinite scroll, pagination, lazy loading, rendering, caching, or background fetching.
|
|
23
|
+
3. It repeats info that is already 100% obvious from the visual design.
|
|
24
|
+
4. It does not help the user make a choice or take action.
|
|
25
|
+
5. It does not provide context that the user actually needs.
|
|
26
|
+
6. It sounds like a programmer talking to another programmer through the UI.
|
|
27
|
+
7. It feels like helper text added just because an empty spot on the screen looked lonely.
|
|
28
|
+
8. It uses technical words that normal users never need to hear.
|
|
29
|
+
9. It displays internal stats or database numbers that give zero real value to the user.
|
|
30
|
+
10. It clutters the screen and makes the app harder to look at without improving usability.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Detailed Examples
|
|
35
|
+
|
|
36
|
+
### Bad Example: Infinite Scroll Narration
|
|
37
|
+
Text:
|
|
38
|
+
> "Scroll for infinite • 53 total"
|
|
39
|
+
> "Infinite scroll: 4,000 newest items, adds 40 items every time you scroll down."
|
|
40
|
+
|
|
41
|
+
**Decision: REMOVE.**
|
|
42
|
+
|
|
43
|
+
*Reason:*
|
|
44
|
+
The user does not need to know that the app uses infinite scroll. The user can simply look at the list and scroll down. Explaining details like "adds 40 items every scroll" is developer documentation, not useful product information for regular people.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### Other Common Examples
|
|
49
|
+
|
|
50
|
+
* Text: *"Data is loaded asynchronously"*
|
|
51
|
+
* **Decision: REMOVE.**
|
|
52
|
+
* *Reason:* Users do not need to know how the server talks to the browser.
|
|
53
|
+
|
|
54
|
+
* Text: *"Showing 40 items per request"*
|
|
55
|
+
* **Decision: REMOVE.**
|
|
56
|
+
* *Reason:* Technical implementation detail.
|
|
57
|
+
|
|
58
|
+
* Text: *"Total 53 active members"*
|
|
59
|
+
* **Decision: KEEP.**
|
|
60
|
+
* *Reason:* This number helps the user understand how big the group is.
|
|
61
|
+
|
|
62
|
+
* Text: *"No results found"*
|
|
63
|
+
* **Decision: KEEP.**
|
|
64
|
+
* *Reason:* Crucial feedback so the user knows their search had zero matches.
|
|
65
|
+
|
|
66
|
+
* Text: *"Last updated 5 minutes ago"*
|
|
67
|
+
* **Decision: KEEP.**
|
|
68
|
+
* *Reason:* Useful if data freshness matters for this specific task.
|
|
69
|
+
|
|
70
|
+
* Text: *"Click the button below to continue"*
|
|
71
|
+
* **Decision: REMOVE.**
|
|
72
|
+
* *Reason:* The button label already tells the user what to do.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 4 Decision Rules to Ask Every Time
|
|
77
|
+
|
|
78
|
+
For each piece of text you review, ask yourself these 4 questions:
|
|
79
|
+
|
|
80
|
+
1. Does the user actually need to know this information?
|
|
81
|
+
2. Does this text help the user understand the data, make a decision, or finish a task?
|
|
82
|
+
3. Is this text still useful if the user knows nothing about how the software was coded?
|
|
83
|
+
4. Is the action or meaning already clear visually without any extra text?
|
|
84
|
+
|
|
85
|
+
If the answer is **NO**, remove the text.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Important Mindset
|
|
90
|
+
|
|
91
|
+
**Clear does not mean more text.**
|
|
92
|
+
|
|
93
|
+
Never add words just to make the interface feel "explained".
|
|
94
|
+
|
|
95
|
+
If the visual design is already clear on its own, **staying quiet is much better than adding copy**.
|
|
96
|
+
|
|
97
|
+
* Do not put a label on every single icon or card.
|
|
98
|
+
* Do not describe every button click or screen change.
|
|
99
|
+
* Do not explain how the code works under the hood.
|
|
100
|
+
* Do not treat every number like it needs a paragraph of explanation.
|
|
101
|
+
* Do not add "helpful text" by default.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Output Format
|
|
106
|
+
|
|
107
|
+
When analyzing any UI text, give your verdict using these three tags:
|
|
108
|
+
|
|
109
|
+
* `KEEP` : When the text is truly useful and gives real value to the user.
|
|
110
|
+
* `REMOVE` : When the text is UI slop, redundant words, or technical implementation talk.
|
|
111
|
+
* `REWRITE` : When the information is genuinely useful, but the phrasing is too long, awkward, or too technical.
|
|
112
|
+
|
|
113
|
+
Give a **short and concrete reason** for each decision.
|
|
114
|
+
|
|
115
|
+
Focus on **user value**, not on explaining every single detail.
|
|
116
|
+
|
|
117
|
+
If you are torn between keeping or deleting, **choose REMOVE**, unless the text is something the user truly cannot live without.
|
|
@@ -1,26 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: waitsec-code
|
|
3
|
-
description: "
|
|
3
|
+
description: "Clean code and structural simplicity guardrails. Eliminates comment pollution, enforces single responsibility, and stops unnecessary dependencies."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# waitsec-code: Clean Code
|
|
6
|
+
# waitsec-code: Clean Code & Dependency Hygiene
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
You operate under the **waitsec-code** engineering discipline. This skill ensures source code remains readable, maintainable, and free from AI-generated boilerplate and comment pollution.
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Operating Mode & Role
|
|
13
|
+
When generating, refactoring, or reviewing source code, maintain minimal cognitive load. Write self-documenting logic, respect idiomatic language conventions, and resist adding third-party packages for routine tasks.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
15
|
+
## Activation Triggers
|
|
16
|
+
Activate this skill whenever:
|
|
17
|
+
- Creating new functions, methods, classes, or modules
|
|
18
|
+
- Adding or refactoring comments, docblocks, and annotations
|
|
19
|
+
- Installing or updating packages via `npm`, `composer`, `pip`, `cargo`, or similar tools
|
|
20
|
+
- Refactoring complex conditional branches or nested logic
|
|
19
21
|
|
|
20
22
|
---
|
|
21
23
|
|
|
22
|
-
##
|
|
24
|
+
## Core Guardrails
|
|
25
|
+
|
|
26
|
+
### 1. Anti-Comment Pollution
|
|
27
|
+
- **Explain Why, Never What:** Do not write comments that narrate what the next line of code does (`// Loop through users`, `// Return response`). Code should read like plain English.
|
|
28
|
+
- **Self-Documenting Code:** If a code block needs explanation, extract it into a descriptively named helper function or variable instead of writing explanatory comments.
|
|
29
|
+
- **Zero Dead Code:** Remove commented-out code blocks immediately. Version control handles history.
|
|
30
|
+
|
|
31
|
+
### 2. Clean Code & Simplicity
|
|
32
|
+
- **Single Responsibility:** Functions must do one thing well. Break functions exceeding 30-40 lines into focused, composable helpers.
|
|
33
|
+
- **Flatten Nesting:** Use early returns (guard clauses) to avoid deeply nested `if/else` statements. Keep cyclomatic complexity low.
|
|
34
|
+
- **Intent-Revealing Naming:** Use domain-accurate, pronounceable names. Avoid vague acronyms, generic names (`data`, `info`, `temp`), or type suffixes in identifiers.
|
|
35
|
+
|
|
36
|
+
### 3. Dependency Hygiene
|
|
37
|
+
- **Native-First:** Use built-in standard library utilities (native `fetch`, standard date methods, built-in string functions) before reaching for external packages.
|
|
38
|
+
- **Audit Footprint:** Before suggesting a new dependency, verify that the package is actively maintained, light, and solves a genuinely complex problem.
|
|
39
|
+
|
|
40
|
+
---
|
|
23
41
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
## Pre-Flight Checklist
|
|
43
|
+
Before finalizing work:
|
|
44
|
+
- [ ] Have all redundant narration comments been stripped?
|
|
45
|
+
- [ ] Are functions short, readable, and flattened with guard clauses?
|
|
46
|
+
- [ ] Can the solution work with standard library utilities without adding third-party dependencies?
|