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.
@@ -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.
@@ -21,21 +21,96 @@ Activate this skill whenever:
21
21
 
22
22
  ---
23
23
 
24
- ## Core Guardrails
24
+ ## Part 1: Comments and Noise
25
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.
26
+ ### 1. Narration Comments
30
27
 
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.
28
+ * **The Bad Habit:** Adding comments that narrate the next line of code (`// Loop through users`, `// Return response`).
29
+ * **The Problem:** The code says the same thing twice: once in the comment, once in the line below.
30
+ * **Why It Fails:** Comments rot. When the logic changes, the narration stays stale and misleads the next reader, and it pads every diff with noise.
31
+ * **Clean Fix:** Delete the narration. If a block genuinely needs explaining, extract it into a well-named function or variable:
32
+ ```js
33
+ // Bad: the comment repeats the code
34
+ // Calculate total with tax
35
+ const t = price + price * 0.1;
35
36
 
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.
37
+ // Good: the name explains it
38
+ const totalWithTax = price + price * taxRate;
39
+ ```
40
+ * **The Waitsec Way:** Code should read like plain English. Explain why when it is not obvious, never what the line already says.
41
+
42
+ ### 2. Dead Commented-Out Code
43
+
44
+ * **The Bad Habit:** Leaving old code commented out "just in case", or commenting a block out instead of deleting it.
45
+ * **The Problem:** The file carries ghost code that no compiler or test touches.
46
+ * **Why It Fails:** Readers cannot tell whether the block is a plan, a workaround, or garbage. It hides the real change and grows the diff.
47
+ * **Clean Fix:** Delete it. Version control keeps the history, and the file stays honest.
48
+ * **The Waitsec Way:** The current file should describe the current system only. The past belongs to git.
49
+
50
+ ---
51
+
52
+ ## Part 2: Structure and Size
53
+
54
+ ### 3. Functions That Do Too Much
55
+
56
+ * **The Bad Habit:** Writing one long function that validates input, queries the database, maps a response, and sends an email.
57
+ * **The Problem:** The function grows past 30 to 40 lines and now has several reasons to change.
58
+ * **Why It Fails:** Tests need to set up all of those jobs at once, and a fix for one job risks breaking the others.
59
+ * **Clean Fix:** Split by responsibility: validate in one place, query in another, respond in another. Keep each function focused on one thing.
60
+ * **The Waitsec Way:** One function, one job. Small pieces are easier to test, reuse, and trust.
61
+
62
+ ### 4. Deeply Nested Conditionals
63
+
64
+ * **The Bad Habit:** Nesting `if/else` blocks five levels deep until the happy path sits in the middle.
65
+ * **The Problem:** The reader must hold every condition in their head at the same time.
66
+ * **Why It Fails:** Deep nesting hides edge cases and makes the exit conditions hard to see. Bugs love that.
67
+ * **Clean Fix:** Use guard clauses and early returns to handle invalid cases first, then leave the main path flat:
68
+ ```js
69
+ // Bad: nested
70
+ if (user) {
71
+ if (user.active) {
72
+ if (user.role === 'admin') {
73
+ return doWork(user);
74
+ }
75
+ }
76
+ }
77
+ return null;
78
+
79
+ // Good: flat
80
+ if (!user) return null;
81
+ if (!user.active) return null;
82
+ if (user.role !== 'admin') return null;
83
+ return doWork(user);
84
+ ```
85
+ * **The Waitsec Way:** Handle what is wrong up front. Keep the main path at the top level.
86
+
87
+ ---
88
+
89
+ ## Part 3: Naming
90
+
91
+ ### 5. Vague Names
92
+
93
+ * **The Bad Habit:** Naming things `data`, `info`, `temp`, `handleStuff`, or `process2`.
94
+ * **The Problem:** The name tells the reader nothing about what the value holds or does.
95
+ * **Why It Fails:** Every reader has to trace the value back to its source to understand it, which slows the whole team.
96
+ * **Clean Fix:** Use domain names that reveal intent (`activeOrders`, `invoiceTotal`, `retryCount`). Rename when the purpose becomes clear.
97
+ * **The Waitsec Way:** Names are documentation. A precise name removes the need for a comment.
98
+
99
+ ---
100
+
101
+ ## Part 4: Dependencies
102
+
103
+ ### 6. A Dependency for a Three-Line Problem
104
+
105
+ * **The Bad Habit:** Installing a package to format a date, pad a string, or check an email.
106
+ * **The Problem:** The manifest grows for work the standard library already does.
107
+ * **Why It Fails:** Each dependency adds supply-chain risk, version conflicts, and updates you must track for the life of the project.
108
+ * **Clean Fix:** Use built-in utilities first. Add a package only when it solves something genuinely complex:
109
+ ```js
110
+ // Instead of a date library
111
+ const formatted = new Intl.DateTimeFormat('en-US', { dateStyle: 'medium' }).format(new Date());
112
+ ```
113
+ * **The Waitsec Way:** Native first. A dependency is a long-term commitment, not a shortcut.
39
114
 
40
115
  ---
41
116