@ryuenn3123/agentic-senior-core 6.15.1 → 6.16.1

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.
Files changed (44) hide show
  1. package/.agents/plugins/agentic-senior-core/.codex-plugin/plugin.json +1 -1
  2. package/.agents/plugins/agentic-senior-core/commands/asc-reference.md +1 -1
  3. package/.agents/plugins/agentic-senior-core/commands/asc-reference.toml +2 -3
  4. package/.agents/plugins/agentic-senior-core/commands/asc-test.md +2 -0
  5. package/.agents/plugins/agentic-senior-core/commands/asc-test.toml +3 -0
  6. package/.agents/plugins/agentic-senior-core/hooks/lib/known-ui-slop-patterns.json +81 -1
  7. package/.agents/plugins/agentic-senior-core/plugin.json +1 -1
  8. package/.agents/plugins/agentic-senior-core/rules/agentic-senior-core.md +3 -2
  9. package/.agents/plugins/agentic-senior-core/skills/asc/SKILL.md +23 -6
  10. package/.agents/plugins/agentic-senior-core/skills/asc/references/writing-skills.md +72 -0
  11. package/.agents/plugins/agentic-senior-core/skills/asc-develop/SKILL.md +3 -4
  12. package/.agents/plugins/agentic-senior-core/skills/asc-reference/SKILL.md +68 -67
  13. package/.agents/plugins/agentic-senior-core/skills/asc-reference/references/api.md +108 -0
  14. package/.agents/plugins/agentic-senior-core/skills/asc-reference/references/database.md +97 -0
  15. package/.agents/plugins/agentic-senior-core/skills/asc-reference/references/infrastructure.md +102 -0
  16. package/.agents/plugins/agentic-senior-core/skills/asc-reference/references/resilience.md +87 -0
  17. package/.agents/plugins/agentic-senior-core/skills/asc-review/SKILL.md +20 -7
  18. package/.agents/plugins/agentic-senior-core/skills/asc-test/SKILL.md +122 -0
  19. package/.agents/plugins/agentic-senior-core/skills/asc-test/references/e2e-playwright.md +89 -0
  20. package/.agents/plugins/agentic-senior-core/skills/asc-test/references/flaky-tests.md +96 -0
  21. package/.agents/plugins/agentic-senior-core/skills/asc-test/references/regression-proof.md +58 -0
  22. package/.agents/plugins/agentic-senior-core/skills/asc-test/references/tdd-cycle.md +62 -0
  23. package/.agents/plugins/agentic-senior-core/skills/asc-test/references/test-design.md +75 -0
  24. package/.agents/plugins/agentic-senior-core/skills/asc-test/references/uat.md +62 -0
  25. package/.agents/plugins/agentic-senior-core/skills/asc-ui/SKILL.md +80 -172
  26. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/accessibility.md +102 -0
  27. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/copy-i18n.md +103 -0
  28. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/craft/browser-surfaces.md +69 -0
  29. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/craft/color-surfaces.md +46 -0
  30. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/craft/motion.md +55 -0
  31. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/craft/typography.md +49 -0
  32. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/divergence.md +127 -0
  33. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/mobile-responsive.md +115 -0
  34. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/modes/experience.md +27 -0
  35. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/modes/operate.md +53 -0
  36. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/modes/persuade.md +72 -0
  37. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/modes/read.md +43 -0
  38. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/redesign-audit.md +71 -0
  39. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/reflexes.md +59 -0
  40. package/.agents/plugins/agentic-senior-core/skills/asc-ui/references/states-feedback.md +148 -0
  41. package/README.md +1 -1
  42. package/gemini-extension.json +1 -1
  43. package/package.json +1 -1
  44. package/plugin.yaml +3 -1
@@ -0,0 +1,58 @@
1
+ # Regression Proof & Bugfix Verification
2
+
3
+ A bugfix is unproven until an automated test fails without the fix and passes with it.
4
+
5
+ ---
6
+
7
+ ## 1. The Three-Step Bugfix Verification Protocol
8
+
9
+ Never fix a bug by immediately editing production code. Follow this deterministic sequence:
10
+
11
+ ```
12
+ ┌─────────────────────────┐
13
+ │ 1. REPRODUCTION TEST │ ──► Run fresh: MUST FAIL (RED)
14
+ └───────────┬─────────────┘
15
+ │
16
+ ▼
17
+ ┌─────────────────────────┐
18
+ │ 2. IMPLEMENT FIX │ ──► Run fresh: MUST PASS (GREEN)
19
+ └───────────┬─────────────┘
20
+ │
21
+ ▼
22
+ ┌─────────────────────────┐
23
+ │ 3. REGRESSION PROOF │ ──► Revert fix: MUST FAIL
24
+ └─────────────────────────┘ Re-apply fix: MUST PASS
25
+ ```
26
+
27
+ ### Step 1: Write the Reproduction Test
28
+ - Author a test that isolates the reported failure condition.
29
+ - Run the test runner:
30
+ ```bash
31
+ ascx npm test -- -t "reproduces issue #42"
32
+ ```
33
+ - **Verification:** The test MUST fail. If the test passes before you touch production code, you have either failed to reproduce the bug or written an assertion that tests the wrong condition.
34
+
35
+ ### Step 2: Implement the Minimal Fix
36
+ - Edit production code to eliminate the bug.
37
+ - Run the reproduction test fresh: it must pass with exit code 0.
38
+
39
+ ### Step 3: The Regression Proof Gate (Revert & Confirm)
40
+ To prove that the test actually guards against the bug:
41
+ 1. Temporarily comment out or revert the fix in production code.
42
+ 2. Run the test fresh: **The test must fail.**
43
+ 3. Re-apply the fix.
44
+ 4. Run the full test suite fresh: **All tests must pass.**
45
+
46
+ ---
47
+
48
+ ## 2. Claim Verification Gate
49
+
50
+ Every claim regarding test results or bug fixes requires concrete execution evidence:
51
+
52
+ | Claim | Requires (Sufficient Evidence) | NOT Sufficient (Invalid Evidence) |
53
+ |---|---|---|
54
+ | *"Bug is fixed."* | A reproduction test failed before the fix, passes with the fix, fails when fix is temporarily reverted, and full suite passes. | *"The code logic looks sound."*<br>*"The compiler reports 0 syntax errors."*<br>*"I refreshed the browser page once."* |
55
+ | *"All tests pass."* | Fresh execution of the entire test suite showing 0 failures and exit code 0 in the current session. | *"Tests passed in an earlier turn."*<br>*"I only modified a small utility function."*<br>*"The linter reported no warnings."* |
56
+ | *"Refactoring didn't break anything."* | Full test suite passed before refactoring and passes after refactoring with zero modified assertions. | *"No imports were changed."*<br>*"The types align in the IDE."* |
57
+ | *"Test is hermetic."* | Test passes when run in isolation and when run alongside other tests in randomized order. | *"Test passes when run as the first test in the suite."* |
58
+
@@ -0,0 +1,62 @@
1
+ # Test-Driven Development (TDD) Cycle
2
+
3
+ TDD is an architectural discipline for writing deterministic, verifiable software. The Iron Law of TDD governs all development:
4
+
5
+ > **THE IRON LAW:** No production code shall be written without a failing test first.
6
+
7
+ ---
8
+
9
+ ## 1. The Three Phases of TDD
10
+
11
+ ```
12
+ ┌────────────────────────────────────────────────────────┐
13
+ ▼ │
14
+ ┌───────────┐ ┌───────────┐ ┌────────────┐ │
15
+ │ 1. RED │ ───────► │ 2. GREEN │ ───────► │ 3. REFACTOR│ ─┘
16
+ └───────────┘ └───────────┘ └────────────┘
17
+ Write failing test Write minimum Clean up design
18
+ Verify failure mode code to pass Keep suite green
19
+ ```
20
+
21
+ ### Phase 1: RED (Observe the Failure)
22
+ 1. Write a focused, minimal test specifying the single desired behavior.
23
+ 2. Run the test command fresh.
24
+ 3. **Inspect the failure reason:** The test must fail because the feature does not exist or the assertion fails.
25
+ - *Failure check:* If the test fails due to a syntax error, unhandled import crash, or missing fixture before the assertion runs, fix the test setup first.
26
+ - *Pass check:* If the test passes immediately without new code, either the behavior already exists, or the test assertion is meaningless.
27
+
28
+ ### Phase 2: GREEN (Minimum Code to Pass)
29
+ 1. Write the minimum production code required to satisfy the assertion.
30
+ 2. Do not implement future requirements, speculative edge cases, or premature abstractions.
31
+ 3. Run the test command fresh and confirm it passes with exit code 0.
32
+
33
+ ### Phase 3: REFACTOR (Improve Structure)
34
+ 1. Remove duplication, extract helpers, or simplify naming.
35
+ 2. Maintain identical external behavior.
36
+ 3. Rerun the test suite after every structural change.
37
+
38
+ ---
39
+
40
+ ## 2. Whole-Suite Verification Gate
41
+
42
+ Passing an isolated test is insufficient. Local changes frequently break adjacent modules.
43
+
44
+ Before claiming any task or feature complete:
45
+ 1. Run the entire test suite (`ascx npm test`, `ascx pytest`, `ascx go test ./...`, or `ascx cargo test`).
46
+ 2. Read the exit code directly from the runner.
47
+ 3. If any existing test fails, diagnose whether the failure is a genuine regression or a broken outdated contract. Never weaken assertions to force a green run.
48
+
49
+ ---
50
+
51
+ ## 3. Rationalization Prevention Table
52
+
53
+ Developers and AI models frequently invent excuses to skip tests. Every excuse has a known failure mode:
54
+
55
+ | Rationalization | Fallacy | Operational Reality |
56
+ |---|---|---|
57
+ | *"The change is too simple to test."* | Small changes cause silent regressions. | One-line fixes produce 30% of production breakages. Write the 3-line test. |
58
+ | *"I'll write tests after the code works."* | Confirmation bias tests. | Tests written after implementation mirror the existing code bugs and test implementation details rather than contracts. |
59
+ | *"It's just UI / frontend wiring."* | Visual wiring has state logic. | Form validation, button states, and error handling are pure logic and fully testable. |
60
+ | *"Mocking this dependency is too hard."* | Architecture smells. | Difficulty in testing indicates tight coupling. Extract the business logic into a pure function and test that. |
61
+ | *"I verified it manually in the console."* | Ephemeral validation. | Manual checks disappear the moment you close the session. Automated tests protect future refactors permanently. |
62
+
@@ -0,0 +1,75 @@
1
+ # Test Design & Architecture
2
+
3
+ Tests are executable specifications. Poorly designed tests produce false confidence, brittle maintenance overhead, and resistance to refactoring.
4
+
5
+ ---
6
+
7
+ ## 1. Test Behavior, Not Implementation
8
+
9
+ Tests must verify external contracts and observable behavior, never internal implementation mechanics.
10
+
11
+ ### 1.1 The Black-Box Principle
12
+ - **Test against public boundaries:** Input arguments, returned values, emitted events, persisted database state, or HTTP responses.
13
+ - **Never assert on internal plumbing:** Do not inspect private class variables, call counts on internal private methods, or local temporary variables.
14
+ - **The Refactoring Test:** If you rewrite an internal algorithm without changing inputs or outputs, your tests should remain completely green. If internal refactoring breaks tests, the tests are coupled to implementation details.
15
+
16
+ ---
17
+
18
+ ## 2. Mocking Discipline & External Boundaries
19
+
20
+ Mocking is a technique for isolating external unmanaged systems, not an excuse to avoid running real code.
21
+
22
+ ### 2.1 The Iron Rule of Mocking
23
+ > **Never mock the unit under test.**
24
+ > Mock *only* external boundaries: third-party HTTP services, payment gateways, message brokers, system clock, or operating system hardware calls.
25
+
26
+ ### 2.2 Mocking Hierarchy
27
+ Prefer real code or robust test doubles over fragile call-count mocks:
28
+
29
+ 1. **Real Implementation (Preferred):** Use the actual domain code, real validation functions, and real in-memory data structures.
30
+ 2. **In-Memory Fakes:** A working in-memory repository or fake mailer that stores sent emails in an array. Fakes preserve semantic behavior without network overhead.
31
+ 3. **Boundary Stubs:** Fixed responses for external third-party HTTP endpoints (e.g., Stripe API, GitHub OAuth).
32
+ 4. **Spy/Call Mocks (Use with caution):** Asserting `expect(spy).toHaveBeenCalledWith(...)` couples tests to internal call order. Use only when the side-effect *is* the contract (e.g., verifying an audit log event was dispatched).
33
+
34
+ ---
35
+
36
+ ## 3. Test Isolation & Hermetic State
37
+
38
+ Every test must run in complete isolation.
39
+
40
+ - **Zero Test Order Dependency:** Tests must succeed when run in isolation, sequentially, or shuffled in random order (`--randomize`).
41
+ - **Teardown Shared Resources:** If a test modifies an environment variable (`process.env.NODE_ENV`), writes to a database, or creates a temporary file on disk, it must restore or delete the resource in an explicit `afterEach` or `finally` block.
42
+ - **No Shared Mutable Fixtures:** Never mutate a shared global object across multiple tests. Use factory functions (`createUser()`) that return fresh independent instances for every test.
43
+
44
+ ---
45
+
46
+ ## 4. Test Structure: The AAA Pattern
47
+
48
+ Structure every test into three distinct, visually separated phases:
49
+
50
+ ```typescript
51
+ describe('TransferService', () => {
52
+ it('deducts balance from sender and credits receiver on successful transfer', async () => {
53
+ // 1. Arrange: Setup fresh state and dependencies
54
+ const sender = await createTestAccount({ balance: 1000 });
55
+ const receiver = await createTestAccount({ balance: 200 });
56
+ const service = new TransferService();
57
+
58
+ // 2. Act: Execute the single behavior under test
59
+ const result = await service.transfer({
60
+ fromId: sender.id,
61
+ toId: receiver.id,
62
+ amount: 300,
63
+ });
64
+
65
+ // 3. Assert: Verify the observable outcome
66
+ expect(result.status).toBe('COMPLETED');
67
+ expect(await getBalance(sender.id)).toBe(700);
68
+ expect(await getBalance(receiver.id)).toBe(500);
69
+ });
70
+ });
71
+ ```
72
+
73
+ - **One primary action per test:** Keep the `Act` step to a single method invocation.
74
+ - **Specific assertions:** Avoid vague assertions like `expect(result).toBeDefined()`. Assert concrete values.
75
+
@@ -0,0 +1,62 @@
1
+ # User Acceptance Testing (UAT) & Requirements Verification
2
+
3
+ User Acceptance Testing verifies that software fulfills real operational requirements from the perspective of the end user, rather than merely passing isolated unit tests.
4
+
5
+ ---
6
+
7
+ ## 1. Requirements to Acceptance Criteria (Given/When/Then)
8
+
9
+ Every user requirement or feature ticket must be broken down into concrete, testable acceptance criteria using Given/When/Then structure:
10
+
11
+ ```gherkin
12
+ Scenario: Developer revokes an active API key
13
+ Given an authenticated developer with 2 active API keys
14
+ When the developer clicks "Revoke" on key "prod-analytics-key"
15
+ And confirms the revocation in the confirmation dialog
16
+ Then key "prod-analytics-key" is marked as inactive immediately
17
+ And requests using that key return HTTP 401 Unauthorized
18
+ And the remaining key continues to function normally
19
+ ```
20
+
21
+ ---
22
+
23
+ ## 2. Structured Acceptance Verification Matrix
24
+
25
+ When preparing for release or completing a feature milestone, verify all user journeys against an Acceptance Matrix:
26
+
27
+ | Requirement ID | Scenario / User Journey | Input / Action | Expected Result | Verification Method | Status |
28
+ |---|---|---|---|---|---|
29
+ | UAT-AUTH-01 | Login with valid credentials | Post valid email + password | Redirects to `/dashboard`, session cookie set | E2E Playwright test | PASS |
30
+ | UAT-AUTH-02 | Login with rate-limited account | 6 failed attempts within 60s | HTTP 429, displays lockout banner with timer | Integration test | PASS |
31
+ | UAT-BILL-01 | Upgrade from Free to Pro tier | Submit Stripe checkout session | Workspace tier reflects Pro, features unlock | Webhook integration test | PASS |
32
+ | UAT-DATA-01 | Export audit log with 10k rows | Click "Export CSV" | Streams CSV file within 2s, memory < 50MB | Benchmark test | PASS |
33
+
34
+ ---
35
+
36
+ ## 3. Ephemeral Verification Artifacts (Zero Project Disk Clutter)
37
+
38
+ Verification records, testing matrices, and UAT notes belong in the agent conversation artifacts directory (`brain/<id>/`), never in the user's project workspace.
39
+
40
+ - **Strict Invariant:** Never write `UAT.md`, `test-checklist.json`, `PRD.md`, or temporary gate files to the user repository root unless explicitly instructed by the user.
41
+ - **Reporting:** Present UAT findings clearly in direct chat messages or structured session artifacts.
42
+
43
+ ---
44
+
45
+ ## 4. The Edge Case Quad
46
+
47
+ Never sign off on acceptance testing by verifying only the primary happy path. Every scenario must be verified against four operational vectors:
48
+
49
+ 1. **Happy Path:** Standard, valid user input under normal network conditions.
50
+ 2. **Boundary Values:**
51
+ - 0 records (empty list / table).
52
+ - 1 record (single item formatting, no awkward pluralization).
53
+ - Maximum capacity (pagination boundary, payload size limits).
54
+ 3. **Invalid & Malicious Input:**
55
+ - Empty strings, whitespace-only fields, oversized payloads.
56
+ - SQL / script injection vectors (`<script>`, `' OR 1=1`).
57
+ - Unicode, emojis, and non-ASCII characters.
58
+ 4. **Failure & Degraded Mode:**
59
+ - Database connection timeout.
60
+ - Third-party webhook failure.
61
+ - Client network disconnection mid-mutation.
62
+
@@ -1,204 +1,112 @@
1
1
  ---
2
2
  name: asc-ui
3
3
  description: >
4
- Trigger this skill when the user is working on: user interfaces, UI components, UX design, frontend layouts, microcopy, typography, design systems, modals, forms, tables, dashboards, empty states, or error UI. Also trigger when the user says: "design this page", "clean up this UI", "write UI copy", "fix UI slop", "make it look professional", "too verbose", "improve the design", "bikin UI", "rapikan tampilan", "tulisan UI berlebihan", "terlalu kaku", "jangan kayak AI", "bahasanya aneh". Also trigger when creating or editing files matching: `*.tsx`, `*.jsx`, `*.vue`, `*.svelte`, `*.html`, `*.blade.php`, `*.css`, or UI component files.
4
+ Trigger this skill when working on: UI components, UX design, layouts, microcopy, typography, design systems, modals, forms, tables, dashboards, empty states, or error UI. Also trigger when the user says: "design this page", "clean up UI", "write UI copy", "fix UI slop", "make it look professional", "too verbose", "improve the design", "broken on mobile", "bikin UI", "rapikan tampilan", "tulisan UI berlebihan", "tampilan di hp rusak", "terlalu kaku", "jangan kayak AI". Also trigger when creating or editing files matching: `*.tsx`, `*.jsx`, `*.vue`, `*.svelte`, `*.html`, `*.blade.php`, `*.css`, or UI component files.
5
5
  ---
6
6
 
7
- # Universal UI/UX Engineering & Anti-Slop Guidelines
7
+ # Universal UI/UX Engineering & Anti-Slop Router
8
8
 
9
- Universal engineering and microcopy standards for human-grade, scannable, and robust digital interfaces. Eliminates generic "AI Slop" — verbose text, redundant headings, corporate filler, awkward foreign loanwords, and cookie-cutter layouts.
10
-
11
- Grounded in: Nielsen Norman Group (Microcopy & Scannability), Refactoring UI (Hierarchy & Spacing), Apple HIG & Google Material Design 3 (Action Semantics & Tone), and W3C Internationalization / Localization Best Practices.
9
+ Staff-grade design engineering for resilient, scannable, human-grade interfaces. Enforces the visual floor and routes deep craft guidance on demand.
12
10
 
13
11
  ---
14
12
 
15
- ## 1. UX Microcopy & Text De-sloppification
16
-
17
- LLMs naturally gravitate toward corporate marketing fluff and redundant explanations. In functional UI (dashboards, forms, settings, tables, dialogs), text is a tool for orientation and action, not a brochure.
18
-
19
- ### The Redundancy Elimination Rule (Kill Useless Subtitles)
20
- - **Zero Echo Subtitles:** If a heading or label is self-explanatory (e.g., *"Payment Methods"*, *"Invoice History"*, *"Team Members"*), **NEVER** add an explanatory subtitle repeating the heading's words (e.g., *"Manage, view, and organize all your payment methods here"*).
21
- - **Subtitle Criterion:** A subtitle is permitted **ONLY** if it contains an essential technical constraint or irreversible risk:
22
- - *Allowed:* *"API keys are shown once upon creation and cannot be retrieved later."*
23
- - *Forbidden:* *"View and manage your API keys to authenticate requests."*
24
- - **Field Helper Text:** Only describe formatting constraints or privacy rules (e.g., `Max 10MB (PDF, PNG)`). Do not re-explain the field name (`Enter your email address here`).
25
-
26
- ### The 50% Word Reduction Rule
27
- - Cut default AI-generated copy by at least 50%. Strip preamble, conversational filler, and passive voice.
28
- - **Before (AI Slop):** *"In order to successfully proceed with saving your profile changes, please make sure all required fields are accurately filled out."*
29
- - **After (Clean UI):** *"Fill out all required fields to save."*
30
-
31
- ### Active, Imperative Action Labels (Buttons & Controls)
32
- - **Direct Verb + Noun:** Use concise, concrete verbs indicating the immediate outcome: `Save`, `Delete Project`, `Export CSV`, `Send Invite`, `Upgrade Plan`.
33
- - **Banned Action Phrases:** Never use `Click here to...`, `Press to...`, `Proceed`, or vague single words like `Submit` or `OK` when a descriptive verb exists.
34
-
35
- ### Banned Marketing Buzzwords in Functional UI
36
- Never use hyperbolic adjectives in application interfaces:
37
- - **Forbidden:** `seamless`, `seamlessly`, `effortless`, `effortlessly`, `empower`, `robust`, `revolutionize`, `dynamic`, `all-in-one`, `supercharge`, `elevate`, `unlock the power of`, `at your fingertips`, `cutting-edge`.
38
- - Treat an admin dashboard or business tool with utilitarian dignity. Describe the system state neutrally.
13
+ ## 1. The Quality Floor (Non-Negotiable Bans)
14
+
15
+ Every UI edit must satisfy these 15 rules without exception:
16
+
17
+ 1. **Token discipline:** All colors, spacing, and typography must resolve through declared design tokens or CSS variables. Zero raw hex codes (`#6366f1`) or arbitrary inline pixel values.
18
+ 2. **Animation safety:** Never use `transition: all`. Never animate layout dimensions (`width`, `height`, `top`, `left`). Animate only GPU properties (`transform`, `opacity`).
19
+ 3. **Reduced motion:** Every CSS animation or transition must respect `@media (prefers-reduced-motion: reduce)`.
20
+ 4. **Focus visibility:** Never strip focus indicators (`outline-none`) without an immediate high-contrast `:focus-visible` replacement.
21
+ 5. **No hallucinated material:** Never invent metrics, testimonials, customer quotes, or fake partner logos.
22
+ 6. **No eyebrows or kicker tags:** Headings carry their own weight. Never place `text-[11px] uppercase tracking-wider` micro-labels above titles.
23
+ 7. **No AI cliché gradients:** Never use purple-to-blue/indigo gradients or text clipping (`bg-clip-text text-transparent`).
24
+ 8. **No card-in-card nesting:** Never nest rounded bordered cards inside other rounded cards.
25
+ 9. **Single elevation declaration:** Choose either a 1px border OR an elevation shadow, never both (ban the ghost card).
26
+ 10. **Mobile viewport unit:** Use `min-h-dvh` or `100dvh` for full-height containers, never `100vh` or `h-screen`.
27
+ 11. **Mobile containment:** Set `overflow-x: clip` on root shells. Never leak horizontal scrolling.
28
+ 12. **Touch targets:** Minimum 44×44px hit target with $\ge$ 8px clearance for all interactive touch controls.
29
+ 13. **Contrast floor:** Meet WCAG 2.2 AA (4.5:1 normal text, 3:1 large text and UI component boundaries).
30
+ 14. **Single-language purity:** Never mix languages on one surface; ban hybrid neologisms (`di-submit`, `meng-generate`).
31
+ 15. **Icon semantics:** Never use raw unicode or emojis as icons. Use dedicated SVG icons; mark decorative icons `aria-hidden="true"`.
32
+ 16. **Substance over restraint:** Stripping slop is only half the job. Replace removed ornaments with real substance: strong typographic scale contrast, full-field color anchors, and authentic interface fragments. Never leave an empty, sterile wireframe void.
39
33
 
40
34
  ---
41
35
 
42
- ## 2. Language Purity & Localization Discipline
36
+ ## 2. Pre-Flight & Material Inventory (BLOCKING GATE)
43
37
 
44
- AI frequently creates "localization slop" by mixing languages, fabricating awkward hybrid loanwords, or inserting literal dictionary translations that sound unnatural to native speakers.
38
+ Before declaring markup, drafting redesign plans, or inspecting user code:
45
39
 
46
- ### Strict Single-Language Consistency
47
- - **Zero Hybrid Code-Switching:** The UI must maintain 100% language purity for its target locale. Never mix English tech slang into non-English interfaces unless it is an established international symbol (e.g., `ID`, `URL`, `API`).
48
- - *Forbidden (Gado-gado/Jaksel):* *"Submit formulir Anda untuk meng-empower efisiensi dashboard."*
49
- - *Correct (Indonesian):* *"Kirim formulir untuk memperbarui data ringkasan."*
50
- - *Correct (English):* *"Submit the form to update dashboard data."*
40
+ 1. **Locate Skill Directory & References (MANDATORY):**
41
+ Reference files do NOT reside in the user workspace root. They are located adjacent to this `SKILL.md` file:
42
+ `<skill_directory>/references/<category>/<file>.md`
43
+ Identify the path of this `SKILL.md` file (provided by host/tooling) and resolve all reference paths relative to it.
51
44
 
52
- ### No Artificial Hybrid Neologisms
53
- - Never create unidiomatic grammatical Frankenstein words by attaching native affixes to English stems:
54
- - *Forbidden:* `meng-generate`, `di-submit`, `meng-approve`, `di-cancel`, `men-delete`.
55
- - *Use established native terms:* `membuat / menghasilkan`, `kirim`, `setujui`, `dibatalkan`, `hapus`.
45
+ 2. **Step 1 — Surface Mode Ingestion (MANDATORY GATE):**
46
+ Classify the surface and execute `read_file` on the corresponding mode reference BEFORE inspecting files or writing code:
47
+ - Dashboards, settings, data tables, developer tools ➔ `references/modes/operate.md`
48
+ - Landing pages, pricing tiers, conversion flows ➔ `references/modes/persuade.md`
49
+ - Documentation, changelogs, knowledge bases ➔ `references/modes/read.md`
50
+ - Showcases, portfolios, interactive galleries ➔ `references/modes/experience.md`
51
+ *Do NOT proceed until you have read the mode reference into context.*
56
52
 
57
- ### Deterministic Microcopy Glossary
58
- - Never exhibit "Thesaurus Syndrome" (swapping words across dialogs to avoid repetition). Control labels must remain mechanically deterministic across every screen:
59
- - Cancellation must always be `Batal` (ID) or `Cancel` (EN) — never alternate with `Urungkan`, `Tutup`, or `Kembali` for identical actions.
60
- - Deletion must always be `Hapus` (ID) or `Delete` (EN).
61
- - Saving must always be `Simpan` (ID) or `Save` (EN).
53
+ 3. **Step 2 — Secondary Craft Ingestion:**
54
+ Execute `read_file` on at least one relevant craft reference for your task from Section 5 (e.g. `references/craft/typography.md`, `references/craft/color-surfaces.md`, or `references/divergence.md`).
62
55
 
63
- ### Dynamic Text Expansion Budget
64
- - Non-English translations (Indonesian, German, French, Spanish) are typically 20% to 40% longer than English equivalents.
65
- - Containers, button labels, table headers, and badges must never have rigid fixed pixel widths (`w-[120px]`) that cause text clipping or awkward multi-line wrapping. Use flexible flex/grid layouts with sensible min-widths and text truncation (`truncate` with title tooltips) where appropriate.
56
+ 4. **Step 3 — Workspace Material Inventory:**
57
+ Only AFTER loading the mode reference, inspect the workspace:
58
+ - **Design Tokens:** Read project CSS variables, Tailwind configuration, or existing components in `components/` or `ui/`. If `DESIGN.md` exists, read it (read-only). Never create or edit persistent checkpoint files.
59
+ - **Take Material Inventory:**
60
+ - **Real:** Concrete numbers, existing endpoints, actual data attributes.
61
+ - **Pictures:** Actual screenshots and product visual assets.
62
+ - **Absent:** Missing quotes, missing logos, or unverified metrics—these are omitted entirely.
66
63
 
67
64
  ---
68
65
 
69
- ## 3. Visual Craft & Generative Layout Engineering
70
-
71
- AI default interfaces suffer from **Distributional Convergence** (regression to the statistical average of training data). Without disciplined direction, models default to either the *AI Starter Pack* (purple gradients, 3 identical cards, floating drop shadows) or the *Sterile Default* (flat, depressing white wireframes with zero character).
72
-
73
- Follow these design engineering heuristics to construct purposeful, high-craft digital interfaces:
74
-
75
- ### The Anti-Sterile & Anti-Template Rule
76
- - **Never Replace Slop with Sterile Voids:** Stripping all decoration does not equal good design. An interface must possess tactile depth, distinct typographic rhythm, and clear surface relationships.
77
- - **No Second-Order Template Clones:** Never force every screen into a trendy Bento Grid or dark-mode clone. Choose layout geometry derived strictly from the **data shape** and **user task**.
78
-
79
- ### 1. Form Follows Data Shape (Layout Inference)
80
- Analyze the primary data model and user goal before declaring any container markup:
81
- - **Quantitative / Comparative Data (Metrics, ledgers, logs, transactions):**
82
- - *Archetype:* **Dense Data Matrix**.
83
- - *Pattern:* High-density tables or compact list rows with sticky headers, hairline borders (`border-b border-border/40`), zebra striping or hover highlights, and right-aligned metrics using `tabular-nums font-mono`.
84
- - *Forbidden:* Packaging individual transaction records into giant cards with fluffy padding.
85
- - **Relational / Hierarchical Entities (Settings, file explorers, entity management):**
86
- - *Archetype:* **Master-Detail Two-Pane Canvas**.
87
- - *Pattern:* Contextual fixed-width left rail (navigation/entity list) paired with a fluid, high-density right canvas for inspection and action.
88
- - **Procedural / Single-Task Flows (Onboarding, checkouts, complex multi-step forms):**
89
- - *Archetype:* **Focused Single-Task Stream**.
90
- - *Pattern:* Centered single-column container (`max-w-xl` / `max-w-2xl`) with progressive disclosure, clear step indicators, and zero peripheral sidebar noise to prevent distraction.
91
- - **Temporal / Event-Driven Records (Audit logs, status updates, activity history):**
92
- - *Archetype:* **Linear Timeline Ledger**.
93
- - *Pattern:* Vertical line rail with timestamp anchors, compact status chips, and contextual user badges.
94
- - **High-Impact Narrative / Showcase (Landing pages, project overviews):**
95
- - *Archetype:* **Asymmetric Visual Anchor**.
96
- - *Pattern:* 7-column editorial narrative anchor (heavy typography + primary action) offset against a 5-column interactive preview or live metric widget.
97
-
98
- ### 2. The Single Focal Anchor Principle (Anti-Cardocalypse)
99
- - **Eliminate Equal-Weight Monotony:** Never place 3 or 4 cards with identical dimensions, identical icons, and identical visual weight side by side.
100
- - **Establish One Primary Focal Point:** Every screen or section must possess exactly ONE visual hero that pulls the eye first (e.g., the primary telemetry chart, the key operational metric, or the main action trigger).
101
- - **Subordinate Supporting Elements:** All surrounding widgets must intentionally recede: use lower contrast text (`text-muted-foreground`), lighter borders, or muted background surfaces (`bg-muted/40`).
102
-
103
- ### 3. Tactile Surface Craft & Stepped Tones (Beyond Drop Shadows)
104
- Avoid excessive fuzzy drop shadows (`shadow-lg`, `shadow-xl`) that make UI float disconnected from reality. Build physical depth via border-driven architecture and stepped surfaces:
105
- - **Stepped Surface Tones (3-Tier Depth):**
106
- - *Base Canvas:* Neutral floor (`bg-slate-50` in light; `bg-zinc-950` / `bg-neutral-950` in dark).
107
- - *Structural Containers / Cards:* Elevated surface (`bg-white` in light; `bg-zinc-900` / `bg-neutral-900` in dark).
108
- - *Inset / Subdued Wells:* Recessed areas for search bars, code blocks, or secondary filters (`bg-slate-100/70` in light; `bg-zinc-800/40` in dark).
109
- - **Hairline Alpha Borders:** Separate structural surfaces with crisp 1px borders using opacity: `border-slate-200/80` (light) or `border-zinc-800` / `border-white/[0.08]` (dark).
110
- - **Physical Top-Edge Inset:** For dark surfaces, provide a crisp physical sheen using an inset highlight: `shadow-[inset_0_1px_0_rgba(255,255,255,0.06)]` instead of exterior glows.
111
-
112
- ### 4. Color Discipline & The 60-30-10 Rule
113
- - **Lock the Palette to 3-5 Tokens:** Never scatter disparate colors across cards.
114
- - **60% Dominant Neutral:** Canvas background and large negative space (tinted neutral like slate, zinc, or warm stone; never stark dead `#000000` or `#FFFFFF`).
115
- - **30% Structural Neutral:** Card surfaces, borders, navigation bars, and dividers.
116
- - **10% Purposeful Accent:** Dedicated brand accent color.
117
- - **Accent Exclusivity:** The accent hue is reserved strictly for interactive triggers (Primary CTA, active tab indicator, unread dot, selected checkbox). **NEVER** use the accent color as card wallpaper, gradient fills, or decorative borders.
118
-
119
- ### 5. Micro-Typography & Scannability
120
- - **Weight Contrast Before Size Jumps:** Build visual hierarchy by combining font weight (`font-bold` vs `font-normal`) and tracking (`tracking-tight` on large headings; `tracking-normal` on body) before inflating font size to absurd dimensions.
121
- - **Tabular Numerals Everywhere:** Every metric, balance, percentage, timestamp, and count **MUST** use `tabular-nums` (and preferably `font-mono` where appropriate) to prevent optical horizontal jitter when values update.
122
- - **Eyebrow Micro-Labels:** Anchor section headers and data clusters with compact category tags: `text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`.
123
-
124
- ### 6. The Banned AI Visual Starter Pack
125
- Explicitly forbid these generic AI clichés:
126
- - **No Purple-to-Cyan/Indigo Gradients:** Ban unprompted glowing violet/teal hero washes.
127
- - **No Gratuitous Glassmorphism:** Never slap `backdrop-blur-md bg-white/10` across functional tables and forms where it ruins text contrast.
128
- - **No Bouncy/Distracting Hover Scales:** Avoid `hover:scale-105` or springy transforms on utilitarian buttons. Use snappy, mechanical micro-feedback (`transition-colors duration-150` or `active:scale-[0.98]`).
129
- - **No Meaningless Generic Badges:** Eliminate fake floating pills like "AI Powered" or generic "Beta" chips scattered for decoration.
66
+ ## 3. Surface Modes & Ambition Scaling
130
67
 
131
- ---
68
+ Visual posture is governed by the surface type, not product branding. Every surface maps to an enforced mode reference file:
132
69
 
133
- ## 4. State Quad & Feedback Architecture
134
-
135
- Every asynchronous view or mutation must deterministically handle all states:
136
-
137
- ### The Data State Quad
138
- 1. **Loading State:** Render proportional skeleton screens matching the actual layout shape (never a single generic spinner in the middle of a blank canvas).
139
- 2. **Empty State:**
140
- - Maximum 1 direct sentence stating reality + 1 primary action button.
141
- - *Good:* *"No active projects. [Create Project]"*
142
- - *Forbidden:* Flowery essays (*"Your workspace is a blank canvas awaiting your creative brilliance..."*).
143
- 3. **Error State:**
144
- - Factual description of what failed + 1 clear recovery button (`[Retry]`).
145
- - *Good:* *"Unable to load invoices. [Retry]"*
146
- - *Forbidden:* Apologetic colloquialisms (*"Oopsie! Something went wrong on our end..."*).
147
- 4. **Populated State:** High-density, cleanly structured data presentation.
148
-
149
- ### Action Mutation Feedback
150
- - Every mutation button (submit, delete, update) **MUST** immediately reflect a pending state:
151
- - Disable the button (`disabled`).
152
- - Show an inline spinner or change text to ongoing action (`Saving...`).
153
- - Display clear, localized toast or banner confirmation upon completion with actionable retry on failure.
154
- - Never silently swallow mutation errors. Wrap critical route widgets in localized React/Vue Error Boundaries.
70
+ - **Operate (`references/modes/operate.md`):** Dense scannability, master-detail rails, `tabular-nums`, inline progressive disclosure.
71
+ - **Persuade (`references/modes/persuade.md`):** 80-word viewport budget, asymmetric posture, single signature element, zero equal-weight 3-card grids.
72
+ - **Read (`references/modes/read.md`):** 65–75ch measure (`max-w-prose`), dual-rail navigation, syntax-highlighted code blocks.
73
+ - **Experience (`references/modes/experience.md`):** Receding interface chrome, full-bleed visual canvas, tactile exploration.
155
74
 
156
75
  ---
157
76
 
158
- ## 5. Mobile-First Responsive Reflow & Touch Ergonomics
159
-
160
- Mobile layout is a distinct, intentional reflow — not the desktop layout squeezed into a narrow viewport.
77
+ ## 4. Scope Classification: Refine vs. Redesign
161
78
 
162
- ### Intentional Reflow Over Shrunken Desktops
163
- - **Re-stack and Re-order:** When the viewport narrows, multi-column grids must collapse into a clean, single-column stack. Side-by-side card grids must never squeeze horizontally until text wraps into 2-letter lines.
164
- - **Content-Driven Breakpoints:** Place breakpoints where content begins to stress or break readability, never based on a rigid list of marketing device specs (e.g., iPhone 14 width). Test by dragging viewports smoothly across the full 320px–1024px range.
165
- - **Mobile Section Padding:** Desktop padding scales (96px, 128px) create absurd vertical wastelands on phones. Reduce section vertical padding to a mobile register (typically 32px–48px / `py-8` to `py-12`).
166
-
167
- ### Responsive Units & Viewport Traps
168
- - **Dynamic Viewport Height (`dvh`):** Never use `100vh` for full-screen hero or drawer elements on mobile. Mobile browser chrome (address and navigation bars) dynamically expands and collapses, causing `100vh` to trigger involuntary page scrolling and button clipping. Use `min-h-dvh` or `h-dvh`.
169
- - **Fluid Typography:** Avoid rigid fixed-pixel headings (`font-size: 48px`). Use fluid typography (`clamp(1.5rem, 4vw + 1rem, 2.75rem)`) or explicit responsive font classes (`text-2xl sm:text-4xl lg:text-5xl`).
170
-
171
- ### Touch Targets & Thumb-Zone Ergonomics
172
- - **44x44px Minimum Touch Target:** Every interactive element (buttons, icon links, checkbox toggles, chips) must have a touch target of at least 44x44px (`min-h-[44px] min-w-[44px]`). If an icon is small (16px), pad its container (`p-3`).
173
- - **Touch Clearance:** Maintain at least 8px spacing between adjacent touch targets to eliminate accidental mis-taps.
174
- - **Reachability:** Place primary mobile actions (submit, filters, navigation) within comfortable thumb reach (bottom sheets, sticky action bars) rather than marooning them at the extreme top corners.
175
-
176
- ### Zero Horizontal Scroll Leaks
177
- - The entire mobile page must maintain zero horizontal overflow.
178
- - **Tables & Code Blocks:** Wrap wide tables and code blocks in dedicated horizontal scroll containers (`overflow-x-auto max-w-full`) with visible scroll indications, preventing them from blowing out the body width.
179
- - **Long Unbroken Strings:** Protect against email addresses, hashes, or URLs overflowing cards using `break-words` or `truncate`.
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.
180
81
 
181
82
  ---
182
83
 
183
- ## 6. Human Accessibility & Contrast Engine (WCAG 2.2 AA)
184
-
185
- An interface that excludes users with diverse vision, motor, or device constraints is structurally broken.
84
+ ## 5. On-Demand Reference Library
85
+
86
+ > [!IMPORTANT]
87
+ > **Resolution Note:** All paths below are relative to this `SKILL.md` file's parent folder (`.../skills/asc-ui/`). When calling `read_file`, prepend this skill's directory path.
88
+
89
+ | Target Domain / Task Requirement | Mandatory Reference Path |
90
+ |---|---|
91
+ | Waivable defaults & waiver syntax | `references/reflexes.md` |
92
+ | Typography, line-height & tabular numbers | `references/craft/typography.md` |
93
+ | Color tokens, 60-30-10 & elevation | `references/craft/color-surfaces.md` |
94
+ | Micro-interactions & GPU motion | `references/craft/motion.md` |
95
+ | Native surfaces (selection, caret, scrollbars) | `references/craft/browser-surfaces.md` |
96
+ | 50% reduction, active verbs & i18n | `references/copy-i18n.md` |
97
+ | Responsive reflow, dvh & touch targets | `references/mobile-responsive.md` |
98
+ | WCAG 2.2 AA contrast & keyboard operability | `references/accessibility.md` |
99
+ | The Data State Quad & mutation feedback | `references/states-feedback.md` |
100
+ | Anti-convergence, 3 Waves of Tells & Mirror Test | `references/divergence.md` |
101
+ | Structured UI audit matrix | `references/redesign-audit.md` |
186
102
 
187
- ### Mathematical Contrast Minimums
188
- Always meet WCAG 2.2 AA contrast ratios:
189
- - **Normal Body Text (< 18px or regular < 14px bold):** Minimum **4.5:1** contrast against adjacent background.
190
- - **Large Text (>= 18px or bold >= 14px):** Minimum **3.0:1** contrast.
191
- - **Non-Text Components & States:** Minimum **3.0:1** for input borders, focus indicators, status badges, and active icons against their background (WCAG 1.4.11).
192
-
193
- ### The Grey-on-Grey Hallucination Trap
194
- Human eyes consistently overestimate contrast on subtle grey pairs:
195
- - `#777777` on pure white (`#FFFFFF`) produces **4.48:1** (FAILS normal text AA; minimum safe pure gray is `#767676` which achieves 4.54:1).
196
- - `#555555` on pure black (`#000000`) produces **2.82:1** (FAILS all text AA).
197
- - When placing text over gradient backgrounds or images, add a solid scrim or compute contrast at the lightest/darkest coordinate point, not just the center.
198
-
199
- ### Keyboard Operability & Focus Rings
200
- - **Zero Stripped Focus Rings:** Never write `outline: none` or `focus:outline-none` without an immediate high-contrast `:focus-visible` replacement (`focus-visible:ring-2 focus-visible:ring-offset-2`). Stripping focus breaks keyboard navigation completely.
201
- - **No Mouse-Only Patterns:** Never gate critical functionality behind hover (`:hover`) without an equivalent keyboard or touch focus trigger.
202
- - **Dialog Escape Hatch:** Every modal, drawer, or dropdown must close immediately upon pressing the `Escape` key and restore keyboard focus to the triggering element.
103
+ ---
203
104
 
105
+ ## 6. Verification & Handoff Sweep
204
106
 
107
+ Before completing any UI task, run this mechanical check:
108
+ 1. **Reference Compliance:** Confirm constraints from the loaded `references/modes/<mode>.md` and craft references were strictly applied.
109
+ 2. **State Quad:** Loading skeleton, empty state, error with retry, and populated data are all handled.
110
+ 3. **Pending Feedback:** Buttons disable and display feedback during ongoing mutations.
111
+ 4. **Contrast & Focus:** Verify keyboard tab flow and high-contrast `:focus-visible` styling.
112
+ 5. **Lint Check:** Verify changes against `hooks/lib/known-ui-slop-patterns.json`.