@ryuenn3123/agentic-senior-core 6.16.1 → 6.16.3

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-senior-core",
3
- "version": "6.16.1",
3
+ "version": "6.16.3",
4
4
  "description": "Universal AI coding rules. Write code like a staff engineer.",
5
5
  "skills": "./skills/",
6
6
  "hooks": "./hooks/hooks.json",
@@ -139,6 +139,26 @@
139
139
  "id": "ui-agency-micro-meta",
140
140
  "regex": "(?:\\b\\d{1,2}\\.\\d+°\\s*[NSEW]\\b|©\\s*20\\d\\d\\s*—\\s*Scroll)",
141
141
  "message": "note: performative agency metadata (geographic coordinates, fake version/scroll stamps) detected. Remove ornamental meta."
142
+ },
143
+ {
144
+ "id": "copy-ai-buzzwords",
145
+ "regex": "\\b(seamlessly?|robust(?:ness)?|empowers?|supercharg(?:ed?|ing)|cutting-edge|next-generation|blazing-fast|effortlessly?)\\b",
146
+ "message": "note: generic AI buzzword detected ('seamless', 'robust', 'supercharge', 'cutting-edge'). Use plain operational verbs and concrete metrics."
147
+ },
148
+ {
149
+ "id": "copy-cadence-tricolon",
150
+ "regex": "\\b[A-Z][a-z]+\\.\\s+[A-Z][a-z]+\\.\\s+[A-Z][a-z]+\\.",
151
+ "message": "note: tricolon cadence detected ('Word. Word. Word.'). State the capability or outcome directly instead of using advertising triplets."
152
+ },
153
+ {
154
+ "id": "copy-cadence-rebuttal",
155
+ "regex": "\\b(Not (?:just )?a|More than a) \\w+[,.] (?:it's|a) \\w+\\b",
156
+ "message": "note: synthetic rebuttal cadence ('Not just a X, it\\'s a Y') detected. State what the system does directly without the false dichotomy."
157
+ },
158
+ {
159
+ "id": "copy-filler-preamble",
160
+ "regex": "\\b(In today's (?:fast-paced|digital)|Built for (?:the )?modern teams?|Welcome to the)\\b",
161
+ "message": "note: AI preamble/filler detected ('In today\\'s fast-paced...', 'Built for modern teams'). Delete the introductory throat-clearing and lead with action."
142
162
  }
143
163
  ]
144
164
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-senior-core",
3
- "version": "6.16.1",
3
+ "version": "6.16.3",
4
4
  "description": "Universal AI coding rules. Because your AI writes code like it gets paid by the line.",
5
5
  "contextFileName": "rules/agentic-senior-core.md",
6
6
  "rules": [
@@ -42,7 +42,11 @@ When picking step 5 or 6 (unless trivial):
42
42
  - Early returns over deep nesting (keep happy path flat).
43
43
  - Three similar lines is better than a premature abstraction (duplication over wrong abstraction).
44
44
  - Single design source of truth: UI styling must reuse defined design tokens, theme variables, or existing page patterns. No ad-hoc palette, radius, or font deviations between pages.
45
- - UI copy & microcopy hygiene: Functional UI is a tool, not a brochure. Zero conversational filler or marketing buzzwords ("seamless", "empower", "robust"). Never echo heading text in redundant subheadings. Enforce strict single-language consistency without unidiomatic foreign loanwords or hybrid transliterations.
45
+ - Human writing & prose hygiene: Functional communication is an operational tool, not marketing collateral. This applies to UI microcopy, READMEs, PR descriptions, and code comments alike:
46
+ - 50% reduction rule: Write the statement, then cut unnecessary words. Replace ornamental adjectives with measurable facts (not "a robust, blazing-fast parser", write "parses 50MB/s with zero heap allocations").
47
+ - Ban AI cadences: Never use the Tricolon ("Fast. Simple. Secure."), the Mad-Lib ("The AI-powered platform for modern teams"), the Rebuttal ("Not just a tool, it's a workflow"), or conversational throat-clearing ("In today's fast-paced landscape...").
48
+ - Buzzword blacklist: Never emit `seamless(ly)`, `robust`, `empower(ing)`, `supercharge`, `elevate`, `effortless(ly)`, `cutting-edge`, `delve`, `testament`, `pivotal`, `crucial`, `game-changing`, or `next-generation`.
49
+ - Strict single-language purity: Choose one language per document or surface. In Indonesian contexts, never prefix grammatical affixes to raw English stems (`di-submit`, `meng-generate`, `di-approve`, `me-restore`).
46
50
  - Code comment hygiene: Zero decorative character banners (// =====), zero line-by-line narration (// Step 1: validate), zero empty category tags (// Main logic), and zero signature echoes in docstrings. Keep only comments that document non-obvious operational constraints, security boundaries, concurrency hazards, or protocol contracts.
47
51
  - Delete code that carries no behavior, safety, or test value. Readability wins over brevity.
48
52
  - Detect and respect project linter/formatter configs. Do not restate style rules enforced by tooling.
@@ -27,7 +27,7 @@ Use when creating a new application, service, or repository from zero.
27
27
  - Can standard library or native platform handle it?
28
28
  - Can this be one straightforward function?
29
29
  2. Build the core domain entities, data models, and services first before protocol/transport controllers.
30
- 3. For frontend interfaces, follow the design standards in `/asc-ui`.
30
+ 3. For frontend interfaces, follow `/asc-ui`. For documentation and prose (READMEs, ADRs), enforce the Universal Prose Floor (zero AI throat-clearing, 50% word reduction, zero buzzwords).
31
31
  4. Generate a quality gate workflow (e.g., `.github/workflows/quality-gate.yml`) that runs linter, type-check, and tests.
32
32
 
33
33
  ### Step 3: Validation
@@ -51,7 +51,7 @@ Use when adding endpoints, components, pages, or capabilities to an existing cod
51
51
  - What happens on network/API failure or timeout?
52
52
  - What feedback does the user see? (Pending state, inline field error, toast/banner with retry).
53
53
  - How can the system recover? (Retry, cached fallback, degraded mode).
54
- 3. If building UI, ensure compliance with `/asc-ui` (zero marketing fluff, single-language consistency, mobile reflow, WCAG AA contrast).
54
+ 3. If building UI or writing documentation, ensure compliance with the Universal Prose Floor and `/asc-ui` (zero marketing fluff, single-language consistency, mobile reflow, WCAG AA contrast).
55
55
 
56
56
  ### Step 3: Implement & Validate (TDD Integration)
57
57
  1. Follow the TDD cycle via `/asc-test`: write the failing test first (RED), write minimal code to pass (GREEN), then refactor.
@@ -37,7 +37,7 @@ Use when reviewing PRs, diffs, commits, or newly written feature code.
37
37
  - **Severity 1 (Critical)**: Correctness, data corruption, auth/permission bypass, security sinks, PII leakage.
38
38
  - **Severity 2 (High)**: Action feedback failures (hanging spinners, unhandled mutations, missing error boundaries), unhandled async rejections, missing remote timeouts.
39
39
  - **Severity 3 (Medium)**: Public contract drift, missing failure-path tests, architectural boundary violations.
40
- - **Severity 4 (Low)**: Maintainability debt, performance micro-optimizations, code comment noise.
40
+ - **Severity 4 (Low)**: Maintainability debt, performance micro-optimizations, narrative code comment noise, AI prose cadence or buzzwords in user-facing copy or documentation.
41
41
 
42
42
  ---
43
43
 
@@ -76,8 +76,10 @@ Visual posture is governed by the surface type, not product branding. Every surf
76
76
 
77
77
  ## 4. Scope Classification: Refine vs. Redesign
78
78
 
79
- - **Refinement:** Preserves layout structure, component APIs, DOM hierarchy, and color tokens. Polishes padding rhythm, contrast, microcopy, and state completeness.
80
- - **Redesign:** Replaces the visual hierarchy, typographic pairing, and surface mode while strictly preserving data bindings, event handlers, and business logic.
79
+ Never split the difference into cosmetic polish on a discarded look:
80
+ - **Polish / Refinement:** Preserves layout structure, DOM hierarchy, and design tokens. Resolves contrast, missing state quad, microcopy, and lint issues.
81
+ - **Restyle:** Preserves layout geometry. Replaces color tokens, typographic scales, corner radiuses, and elevation shadows.
82
+ - **Full Redesign:** Replaces entire spatial geometry and posture. Mandatory decoupled protocol: extract data/contracts first, discard old DOM, author standalone preview (`asc preview <path>`), build fresh geometry, re-bind dynamic data.
81
83
 
82
84
  ---
83
85
 
@@ -29,11 +29,44 @@ Exception: Standard multi-step navigation controls in fixed wizards (`Back`, `Ne
29
29
 
30
30
  ---
31
31
 
32
- ## 3. Marketing Buzzword Blacklist
32
+ ## 3. Arithmetic Copy Budgets & The Argument-First Protocol
33
+
34
+ ### 3.1 Arithmetic Budgets
35
+ Constraint is arithmetic; enforce before falling in love with a sentence:
36
+ - **Hero Headline Budget:** Must fit in **two lines or fewer** across all viewports.
37
+ - Mobile (390px): $\le 32$ characters ($\sim 4$–$5$ words).
38
+ - Desktop (1280px): $\le 42$ characters ($\sim 5$–$6$ words).
39
+ - Use `text-wrap: balance` and intentional `<br>` tags to avoid single-word orphans.
40
+ - **Supporting Line Budget:** Exactly **1 sentence**, at most **22 words**.
41
+ - Directly states concrete function and audience.
42
+ - Never repeats or paraphrases headline words.
43
+ - **First-Viewport Word Budget:** Maximum **80 words** total across the first screen.
44
+
45
+ ### 3.2 The Argument-First Protocol
46
+ Before writing any HTML/JSX markup, outline the page as a sequence of claims with verifiable proofs:
47
+ ```text
48
+ 1. Claim: Three-legged oak stool, made to order. → Proof: High-res macro photography of stool.
49
+ 2. Claim: Each seat cut from single solid board. → Proof: 3 close-ups of continuous wood grain.
50
+ 3. Claim: Shipped in 6 weeks with tracking. → Proof: Verifiable production stages schedule.
51
+ 4. Claim: Costs $240, delivered by the maker. → Proof: Exact price figure + Order button.
52
+ ```
53
+ *Rule:* Any section that lacks a factual claim or verifiable proof is filler—delete it immediately.
33
54
 
34
- The following words are banned in operational interfaces:
55
+ ---
56
+
57
+ ## 4. AI Cadences & Marketing Buzzword Blacklist
58
+
59
+ ### 4.1 Banned AI Cadence Formulas
60
+ Language models fall into statistical average patterns; recognize and refuse them:
61
+ 1. **The Mad-Lib:** *"The [AI-powered/next-gen] platform for modern teams."*
62
+ 2. **The Tricolon:** *"Fast. Simple. Secure."* or *"Plan. Build. Ship."*
63
+ 3. **The Rebuttal:** *"It’s not just a tool, it’s a workflow."* / *"More than a framework."*
64
+ 4. **The Preamble Throat-Clearing:** *"In today’s fast-paced digital world..."* / *"Built for modern teams..."*
65
+ 5. **The Em-Dash Habit:** Using multiple em-dashes (`—`) in a single paragraph. Use a full stop.
35
66
 
36
- `seamless`, `seamlessly`, `empower`, `empowering`, `robust`, `effortless`, `effortlessly`, `cutting-edge`, `game-changing`, `elevate`, `unlock`, `dive in`, `delightful`, `next-generation`, `supercharge`, `blazing-fast`.
67
+ ### 4.2 Banned Marketing Buzzwords
68
+ The following adjectives and verbs are banned across all surfaces:
69
+ `seamless`, `seamlessly`, `empower`, `empowering`, `robust`, `effortless`, `effortlessly`, `cutting-edge`, `game-changing`, `elevate`, `unlock`, `unleash`, `dive in`, `delightful`, `next-generation`, `supercharge`, `blazing-fast`.
37
70
 
38
71
  When tempted to write an adjective, state the measurable property instead:
39
72
  - Instead of: *"A robust, blazing-fast pipeline."*
@@ -41,16 +74,31 @@ When tempted to write an adjective, state the measurable property instead:
41
74
 
42
75
  ---
43
76
 
44
- ## 4. Single-Language Purity & Anti-Gado-Gado
77
+ ## 5. Actionable Error Messages & Recovery
78
+
79
+ An operational error message must never produce a dead end or display raw internal stack traces. Every error must answer three questions:
80
+ 1. **What failed:** Direct statement of the blocked action.
81
+ 2. **Why:** Factual cause (if actionable and known).
82
+ 3. **How to recover:** Concrete button or path to unblock the user.
83
+
84
+ | Raw / Unhelpful Error | Actionable Engineering Copy | Recovery Path |
85
+ |---|---|---|
86
+ | "Error 413: Payload too large." | "File exceeds the 25MB limit." | "Choose a smaller file" CTA |
87
+ | "Failed to connect to server." | "Unable to reach database. Changes saved locally." | "Retry connection" button |
88
+ | "Invalid credentials." | "Incorrect password for user@example.com." | "Reset password →" link |
89
+
90
+ ---
91
+
92
+ ## 6. Single-Language Purity & Anti-Gado-Gado
45
93
 
46
94
  Interfaces must maintain strict language purity. Mixing two languages within the same surface causes cognitive friction and feels unpolished.
47
95
 
48
- ### 4.1 Strict Monolingual Surface
96
+ ### 6.1 Strict Monolingual Surface
49
97
  Choose one language for the entire surface and enforce it across headings, labels, errors, and tooltips:
50
98
  - **English UI:** All copy, actions, and timestamps in English.
51
99
  - **Indonesian UI:** All copy, actions, and timestamps in standard Indonesian (KBBI/PUEBI).
52
100
 
53
- ### 4.2 Ban Hybrid Neologisms (Indonesian Context)
101
+ ### 6.2 Ban Hybrid Neologisms (Indonesian Context)
54
102
  Never prefix Indonesian grammatical affixes (`di-`, `meng-`, `ter-`, `pe-`) onto raw English stems:
55
103
 
56
104
  | Hybrid Neologism (Banned) | Standard Indonesian | Pure English Alternative |
@@ -66,14 +114,14 @@ Never prefix Indonesian grammatical affixes (`di-`, `meng-`, `ter-`, `pe-`) onto
66
114
 
67
115
  ---
68
116
 
69
- ## 5. Dynamic Text Expansion & Internationalization Layout
117
+ ## 7. Dynamic Text Expansion & Internationalization Layout
70
118
 
71
119
  Text length varies drastically between languages:
72
120
  - German and Dutch expand +20% to +35% compared to English.
73
121
  - Indonesian expands +15% to +30% for verb-rich phrases.
74
122
  - Japanese and Chinese are visually dense and vertically taller.
75
123
 
76
- ### 5.1 Layout Rules for Expanding Strings
124
+ ### 7.1 Layout Rules for Expanding Strings
77
125
  1. **Never set fixed widths on action buttons:**
78
126
  ```html
79
127
  <!-- BANNED: clips or overflows in German/Indonesian -->
@@ -25,6 +25,9 @@ Grounded in: Apple HIG, Google Material Design 3, and Refactoring UI Color Strat
25
25
  - The dedicated brand accent hue.
26
26
  - **Accent Exclusivity:** Accent color is reserved strictly for interactive affordances: Primary CTA button, active navigation indicator, unread dot, selected checkbox.
27
27
  - **Forbidden:** Never use the accent color as background wallpaper, card borders, or decorative section dividers.
28
+ - **Full-Field Grounding (Anti-Sterile Surface):**
29
+ - To prevent the "sterile white void" trap, at least one major functional region (the Hero Stage, the Signature Canvas, or the Master Header) must own a deep, purposeful surface field (e.g. deep midnight grounding, rich brand tint, or dark canvas container).
30
+ - This establishes an optical center of gravity, preventing the page from looking like an unstyled wireframe.
28
31
 
29
32
  ---
30
33
 
@@ -13,6 +13,11 @@ Grounded in: Refactoring UI, Bringhurst's The Elements of Typographic Style, and
13
13
  - **Weight Contrast Before Size Inflation:**
14
14
  - Build strong typographic hierarchy by varying font weights (`font-bold` vs `font-normal`) and contrast tokens (`text-foreground` vs `text-muted-foreground`) before jumping to oversized font sizes.
15
15
  - A clean 24px `font-bold` title paired with a 14px `text-muted-foreground` subtitle establishes clearer hierarchy than inflating the title to 48px with identical gray values.
16
+ - **The Generative Scale Contrast Floor ($Display \ge 3.5\times Body$):**
17
+ - On landing, marketing, and hero surfaces (`Persuade`), the primary headline must establish an optical scale step over body text:
18
+ - Target: $Display \ge 3.5\times Body$ (e.g. `text-5xl` to `text-7xl` [48px–72px] display vs `text-base` [16px] or `text-sm` [14px] body).
19
+ - Heading leading must be tight: `leading-[1.05]` to `leading-tight`.
20
+ - An under-scaled heading ($< 2.5\times$ body, such as 24px H1) collapses optical gravity and makes marketing pages look like internal memo forms.
16
21
 
17
22
  ---
18
23
 
@@ -43,6 +43,33 @@ When building or redesigning a Persuade surface, never let the LLM default to th
43
43
  - If technical documentation, whitepaper, or architectural manifesto $\to$ **Posture 2 (The Monolith Ledger)**.
44
44
  - If performance benchmarks, protocol comparisons, or telemetry proof $\to$ **Posture 4 (Kinetic Proof Stream)**.
45
45
 
46
+ ### Structural Blueprints (Enforced DOM Geometries)
47
+
48
+ #### Posture 1: Asymmetric Stage (65/35 Split)
49
+ - **Container:** `grid grid-cols-1 lg:grid-cols-12 gap-12 items-center`
50
+ - **Left Lead (7 cols):** `lg:col-span-7 space-y-6 text-left`
51
+ - Display headline: `text-5xl lg:text-7xl font-bold tracking-tight leading-[1.05]`
52
+ - Subtitle: `text-lg text-muted-foreground max-w-xl`
53
+ - Actions: `flex flex-wrap items-center gap-4 pt-2`
54
+ - **Right Artifact (5 cols):** `lg:col-span-5`
55
+ - Authentic artifact, interactive widget, or live ROI card: `rounded-2xl border border-border/80 bg-card p-6 shadow-sm`
56
+ - Zero equal-weight card grids below.
57
+
58
+ #### Posture 2: The Monolith Ledger
59
+ - **Container:** `max-w-4xl mx-auto px-6 py-16 divide-y divide-border/60`
60
+ - **Tabular Rows:** Each entity or program is a horizontal row: `py-8 grid grid-cols-1 md:grid-cols-12 gap-6 items-baseline`
61
+ - Category / Date: `md:col-span-3 text-xs font-semibold tracking-wider uppercase text-muted-foreground`
62
+ - Heading & Data: `md:col-span-5 text-xl font-bold text-foreground`
63
+ - Detail & Action: `md:col-span-4 text-sm text-muted-foreground`
64
+
65
+ #### Posture 3: Product-Led Canvas
66
+ - **Container:** `flex flex-col items-center text-center max-w-6xl mx-auto px-6 pt-16 pb-20`
67
+ - **Compact Hero Frame:** `max-w-2xl space-y-4 mb-10`
68
+ - Headline: `text-4xl sm:text-6xl font-extrabold tracking-tight`
69
+ - 1-sentence value claim + 1 primary action.
70
+ - **Hero Canvas (70% Viewport Lead):** `w-full rounded-2xl border border-border/80 bg-slate-950 p-2 shadow-2xl`
71
+ - Real interface fragment or live demo canvas dominating the first viewport.
72
+
46
73
  ---
47
74
 
48
75
  ## 3. Anti-Cardocalypse & Visual Pacing
@@ -4,21 +4,44 @@ Modifying an existing interface requires clear intent. Audits must provide actio
4
4
 
5
5
  ---
6
6
 
7
- ## 1. Refinement vs. Redesign Semantics
7
+ ## 1. Scope Classification: The 3 Redesign Depths
8
8
 
9
- Before touching code, explicitly classify the scope of work:
9
+ Never split the difference into cosmetic polish on a discarded look. Before touching code, explicitly classify the depth of work:
10
10
 
11
- | Mode | Objective | What Stays Intact | What Changes |
11
+ | Depth | Scope & Intent | What Stays Intact | What Changes |
12
12
  |---|---|---|---|
13
- | **Refinement** | Polish craft, fix accessibility, eliminate slop, align spacing. | Layout structure, component APIs, color tokens, DOM tree, established brand identity. | Padding rhythm, contrast ratios, missing hover/focus rings, microcopy concision, state quad completeness. |
14
- | **Redesign** | Overhaul visual hierarchy, modernize surface mode, eliminate fundamental architectural flaws. | Functional data bindings, event handlers, business rules, routing. | Visual posture, typography system, component composition, spatial elevation, color distribution. |
13
+ | **`polish`** | Resolve bugs, contrast, microcopy, states. | Layout structure, DOM hierarchy, and design system tokens. | Padding rhythm, WCAG AA contrast, missing state quad (empty/error/loading), focus rings, microcopy brevity, lint fixes. |
14
+ | **`restyle`** | Upgrade design system without breaking layout. | Layout grid, component hierarchy, and DOM structure. | Color palette (60-30-10), typographic scale, corner radiuses, elevation shadows, button and input styles. |
15
+ | **`full`** | Total visual and structural overhaul. | Factual content, data bindings (`$variables`, loops), routes, form handlers. | **Spatial geometry, grid ratios, surface posture, and typography.** Treated as fresh build from subject truth. |
15
16
 
16
- > [!WARNING]
17
- > Never perform an unprompted redesign when asked to "fix", "clean up", or "refine" a component. Respect existing design tokens and architectural patterns unless the user explicitly mandates a redesign.
17
+ ---
18
+
19
+ ## 2. The Decoupled Redesign Protocol (For Full Redesigns)
20
+
21
+ When executing a **Full Redesign** on an existing template or page (`.blade.php`, `.tsx`, `.vue`, `.html`), editing in-place is forbidden because the AI's attention mechanism will anchor to the old DOM structure. Execute this 4-step decoupled sequence:
22
+
23
+ 1. **Step 1: Extract Data Contracts & Factual Inventory**
24
+ - Parse the incumbent file and extract all dynamic variables, loops, route helpers, form submission endpoints, and real text/assets into a clean data list.
25
+ - Separate product truth (names, prices, verified claims) from discarded markup.
26
+ 2. **Step 2: Isolate / Discard Old Markup**
27
+ - Treat the old layout as an anti-reference. Do not perform incremental class swapping on it.
28
+ 3. **Step 3: Author Standalone HTML Prototype & Preview**
29
+ - Create an ephemeral standalone prototype in the brain directory: `<appDataDir>/brain/<id>/preview.html`.
30
+ - Select 1 of the 4 Structural Postures (`references/modes/persuade.md` or `operate.md`).
31
+ - Use Tailwind via CDN and realistic sample data.
32
+ - Run zero-dependency visual capture:
33
+ ```bash
34
+ asc preview <path_to_preview.html>
35
+ ```
36
+ Inspect the captured image at `%TEMP%/asc-preview-active.png` (or pass `--open` to view in OS browser). Verify typographic scale ($Display \ge 3.5\times Body$) and full-field grounding.
37
+ 4. **Step 4: Re-inject Data Contracts into Production**
38
+ - Transfer the proven clean geometry into the project file (`welcome.blade.php`, `Page.tsx`).
39
+ - Re-bind the dynamic data loops, Blade/React variables, and event handlers.
40
+ - Confirm project test suite and linters pass cleanly.
18
41
 
19
42
  ---
20
43
 
21
- ## 2. Structured Audit Matrix
44
+ ## 3. Structured Audit Matrix
22
45
 
23
46
  When auditing an existing interface or PR, generate a structured findings table categorized by severity:
24
47
 
@@ -41,29 +64,29 @@ When auditing an existing interface or PR, generate a structured findings table
41
64
 
42
65
  ---
43
66
 
44
- ## 3. Systematic Audit Checklist
67
+ ## 4. Systematic Audit Checklist
45
68
 
46
69
  Audit screens systematically against four engineering vectors:
47
70
 
48
- ### 3.1 Ergonomics & Responsiveness
71
+ ### 4.1 Ergonomics & Responsiveness
49
72
  - [ ] Render at `375px` width (mobile viewport) and `1280px` (desktop viewport).
50
73
  - [ ] Verify zero horizontal scrollbars on mobile (`overflow-x: clip`).
51
74
  - [ ] Confirm all touch targets meet minimum $44 \times 44\text{px}$ bounding box.
52
75
  - [ ] Verify mobile layout uses `dvh` instead of `vh` to prevent browser chrome clipping.
53
76
 
54
- ### 3.2 Accessibility & Contrast (WCAG 2.2 AA)
77
+ ### 4.2 Accessibility & Contrast (WCAG 2.2 AA)
55
78
  - [ ] Check normal text against backgrounds ($\ge 4.5:1$).
56
79
  - [ ] Check input borders, active toggles, and large headings ($\ge 3:1$).
57
80
  - [ ] Cycle through entire screen using `Tab` and `Shift+Tab` with mouse disconnected.
58
81
  - [ ] Press `Escape` while dialog/modal is open; verify closure and focus restoration.
59
82
 
60
- ### 3.3 State Quad Coverage
83
+ ### 4.3 State Quad Coverage
61
84
  - [ ] Inspect loading state: does it use proportional skeletons matching final dimensions?
62
85
  - [ ] Inspect empty state: is it actionable with a 1-sentence explanation?
63
86
  - [ ] Inspect error state: does it diagnose the issue and provide an inline retry button?
64
87
  - [ ] Inspect mutation triggers: do buttons lock and display spinners during network latency?
65
88
 
66
- ### 3.4 Microcopy & Token Hygiene
89
+ ### 4.4 Microcopy & Token Hygiene
67
90
  - [ ] Run 50% word reduction sweep across headings and explanatory paragraphs.
68
91
  - [ ] Confirm all buttons follow `Verb + Noun` grammar.
69
92
  - [ ] Verify zero banned buzzwords (*seamless*, *empower*, *robust*).
@@ -36,6 +36,7 @@ function printUsage() {
36
36
  console.log(' uninstall Remove ASC adapter files and git hooks from this project');
37
37
  console.log(' clean Remove v4 per-project artifacts');
38
38
  console.log(' status Show detected IDEs and install hints');
39
+ console.log(' preview Render zero-dependency multi-browser snapshot or preview');
39
40
  console.log(' --version Show version');
40
41
  console.log(' --help Show this help');
41
42
  }
@@ -90,6 +91,12 @@ async function main() {
90
91
  return;
91
92
  }
92
93
 
94
+ if (commandArgument === 'preview') {
95
+ const { runPreviewCommand } = await import('../lib/cli/commands/preview.mjs');
96
+ await runPreviewCommand(commandArguments);
97
+ return;
98
+ }
99
+
93
100
  console.error(`Unknown command: ${commandArgument}`);
94
101
  printUsage();
95
102
  exit(1);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-senior-core",
3
- "version": "6.16.1",
3
+ "version": "6.16.3",
4
4
  "description": "Universal AI coding rules. Write code like a staff engineer.",
5
5
  "author": "fatidaprilian",
6
6
  "license": "MIT",
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Zero-dependency Multi-Browser Preview & Headless Snapshot Engine.
3
+ * Detects installed browsers (Brave, Edge, Chrome, Firefox, Vivaldi, Arc)
4
+ * and captures a headless snapshot or opens in the OS default browser.
5
+ */
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ import os from 'node:os';
9
+ import { execSync } from 'node:child_process';
10
+
11
+ export function getBrowserCandidates() {
12
+ const platform = process.platform;
13
+ const candidates = [];
14
+
15
+ if (platform === 'win32') {
16
+ const localAppData = process.env.LOCALAPPDATA || '';
17
+ const programFiles = process.env['ProgramFiles'] || 'C:\\Program Files';
18
+ const programFilesX86 = process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)';
19
+
20
+ candidates.push(
21
+ {
22
+ name: 'Brave Browser',
23
+ family: 'chromium',
24
+ paths: [
25
+ path.join(programFiles, 'BraveSoftware', 'Brave-Browser', 'Application', 'brave.exe'),
26
+ path.join(programFilesX86, 'BraveSoftware', 'Brave-Browser', 'Application', 'brave.exe'),
27
+ path.join(localAppData, 'BraveSoftware', 'Brave-Browser', 'Application', 'brave.exe'),
28
+ ]
29
+ },
30
+ {
31
+ name: 'Microsoft Edge',
32
+ family: 'chromium',
33
+ paths: [
34
+ path.join(programFilesX86, 'Microsoft', 'Edge', 'Application', 'msedge.exe'),
35
+ path.join(programFiles, 'Microsoft', 'Edge', 'Application', 'msedge.exe'),
36
+ path.join(localAppData, 'Microsoft', 'Edge', 'Application', 'msedge.exe'),
37
+ ]
38
+ },
39
+ {
40
+ name: 'Google Chrome',
41
+ family: 'chromium',
42
+ paths: [
43
+ path.join(programFiles, 'Google', 'Chrome', 'Application', 'chrome.exe'),
44
+ path.join(programFilesX86, 'Google', 'Chrome', 'Application', 'chrome.exe'),
45
+ path.join(localAppData, 'Google', 'Chrome', 'Application', 'chrome.exe'),
46
+ ]
47
+ },
48
+ {
49
+ name: 'Mozilla Firefox',
50
+ family: 'firefox',
51
+ paths: [
52
+ path.join(programFiles, 'Mozilla Firefox', 'firefox.exe'),
53
+ path.join(programFilesX86, 'Mozilla Firefox', 'firefox.exe'),
54
+ ]
55
+ },
56
+ {
57
+ name: 'Vivaldi',
58
+ family: 'chromium',
59
+ paths: [
60
+ path.join(localAppData, 'Vivaldi', 'Application', 'vivaldi.exe'),
61
+ path.join(programFiles, 'Vivaldi', 'Application', 'vivaldi.exe'),
62
+ ]
63
+ },
64
+ {
65
+ name: 'Arc',
66
+ family: 'chromium',
67
+ paths: [
68
+ path.join(localAppData, 'Arc', 'Arc.exe'),
69
+ ]
70
+ }
71
+ );
72
+ } else if (platform === 'darwin') {
73
+ candidates.push(
74
+ {
75
+ name: 'Google Chrome',
76
+ family: 'chromium',
77
+ paths: ['/Applications/Google Chrome.app/Contents/MacOS/Google Chrome']
78
+ },
79
+ {
80
+ name: 'Brave Browser',
81
+ family: 'chromium',
82
+ paths: ['/Applications/Brave Browser.app/Contents/MacOS/Brave Browser']
83
+ },
84
+ {
85
+ name: 'Microsoft Edge',
86
+ family: 'chromium',
87
+ paths: ['/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge']
88
+ },
89
+ {
90
+ name: 'Mozilla Firefox',
91
+ family: 'firefox',
92
+ paths: ['/Applications/Firefox.app/Contents/MacOS/firefox']
93
+ },
94
+ {
95
+ name: 'Arc',
96
+ family: 'chromium',
97
+ paths: ['/Applications/Arc.app/Contents/MacOS/Arc']
98
+ }
99
+ );
100
+ } else {
101
+ // Linux
102
+ candidates.push(
103
+ { name: 'google-chrome', family: 'chromium', commands: ['google-chrome', 'google-chrome-stable'] },
104
+ { name: 'chromium', family: 'chromium', commands: ['chromium', 'chromium-browser'] },
105
+ { name: 'brave', family: 'chromium', commands: ['brave-browser', 'brave'] },
106
+ { name: 'microsoft-edge', family: 'chromium', commands: ['microsoft-edge', 'microsoft-edge-stable', 'msedge'] },
107
+ { name: 'firefox', family: 'firefox', commands: ['firefox'] }
108
+ );
109
+ }
110
+
111
+ return candidates;
112
+ }
113
+
114
+ export function findBrowserExecutable() {
115
+ const candidates = getBrowserCandidates();
116
+
117
+ for (const candidate of candidates) {
118
+ if (candidate.paths) {
119
+ for (const p of candidate.paths) {
120
+ if (fs.existsSync(p)) {
121
+ return { name: candidate.name, family: candidate.family, path: p };
122
+ }
123
+ }
124
+ } else if (candidate.commands) {
125
+ for (const cmd of candidate.commands) {
126
+ try {
127
+ const resolved = execSync(`which ${cmd} 2>/dev/null`, { encoding: 'utf8' }).trim();
128
+ if (resolved) {
129
+ return { name: candidate.name, family: candidate.family, path: resolved };
130
+ }
131
+ } catch {
132
+ // ignore
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ return null;
139
+ }
140
+
141
+ export async function runPreviewCommand(args = []) {
142
+ const targetFile = args.find(a => !a.startsWith('-'));
143
+ const shouldOpen = args.includes('--open');
144
+ const width = 1280;
145
+ const height = 800;
146
+
147
+ if (!targetFile) {
148
+ console.error('Usage: asc preview <html-file> [--open]');
149
+ process.exit(1);
150
+ }
151
+
152
+ const resolvedHtmlPath = path.resolve(process.cwd(), targetFile);
153
+ if (!fs.existsSync(resolvedHtmlPath)) {
154
+ console.error(`File not found: ${resolvedHtmlPath}`);
155
+ process.exit(1);
156
+ }
157
+
158
+ // Single fixed reusable slot in OS temp directory
159
+ const tempDir = os.tmpdir();
160
+ const outputPng = path.join(tempDir, 'asc-preview-active.png');
161
+
162
+ // Open in default OS browser if requested
163
+ if (shouldOpen) {
164
+ const opener = process.platform === 'win32' ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open';
165
+ try {
166
+ execSync(`${opener} "" "${resolvedHtmlPath}"`, { stdio: 'ignore' });
167
+ console.log(`[asc preview] Opened in default browser: ${resolvedHtmlPath}`);
168
+ return;
169
+ } catch (err) {
170
+ console.error(`Failed to open default browser: ${err.message}`);
171
+ }
172
+ }
173
+
174
+ // Headless snapshot mode
175
+ const browser = findBrowserExecutable();
176
+ if (!browser) {
177
+ console.warn('[asc preview] No supported headless browser detected (Brave, Edge, Chrome, Firefox). Falling back to OS opener.');
178
+ const opener = process.platform === 'win32' ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open';
179
+ execSync(`${opener} "" "${resolvedHtmlPath}"`, { stdio: 'ignore' });
180
+ return;
181
+ }
182
+
183
+ try {
184
+ let command;
185
+ if (browser.family === 'chromium') {
186
+ command = `"${browser.path}" --headless --disable-gpu --screenshot="${outputPng}" --window-size=${width},${height} "${resolvedHtmlPath}"`;
187
+ } else if (browser.family === 'firefox') {
188
+ command = `"${browser.path}" -headless -screenshot "${outputPng}" -window-size ${width},${height} "${resolvedHtmlPath}"`;
189
+ }
190
+
191
+ execSync(command, { stdio: 'pipe' });
192
+
193
+ if (fs.existsSync(outputPng)) {
194
+ const stat = fs.statSync(outputPng);
195
+ console.log(`[asc preview] Captured via ${browser.name} (${width}x${height}, ${stat.size} bytes)`);
196
+ console.log(`Output: ${outputPng}`);
197
+ } else {
198
+ throw new Error('Screenshot file was not generated');
199
+ }
200
+ } catch (err) {
201
+ console.warn(`[asc preview] Headless snapshot failed: ${err.message}. Falling back to OS opener.`);
202
+ const opener = process.platform === 'win32' ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open';
203
+ execSync(`${opener} "" "${resolvedHtmlPath}"`, { stdio: 'ignore' });
204
+ }
205
+ }
206
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "6.16.1",
3
+ "version": "6.16.3",
4
4
  "type": "module",
5
5
  "description": "Agentic Senior Core: Universal AI coding rules and workflows. Write code like a staff engineer, not a junior.",
6
6
  "bin": {
package/plugin.yaml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: agentic-senior-core
2
- version: 6.16.1
2
+ version: 6.16.3
3
3
  description: Universal AI coding rules. Write code like a staff engineer.
4
4
  author: fatidaprilian
5
5
  provides_hooks: