@ryuenn3123/agentic-senior-core 4.3.6 → 4.3.8
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/.agent-context/prompts/bootstrap-design.md +30 -40
- package/.agent-context/prompts/init-project.md +2 -4
- package/.agent-context/prompts/refactor.md +1 -1
- package/.agent-context/prompts/review-code.md +2 -2
- package/.agent-context/review-checklists/pr-checklist.md +2 -2
- package/.agent-context/rules/architecture.md +1 -5
- package/.agent-context/rules/frontend-architecture.md +1 -1
- package/AGENTS.md +3 -2
- package/README.md +1 -1
- package/lib/cli/adaptive-context/catalog.mjs +1 -36
- package/lib/cli/audits/typography-palette-anti-repeat-audit.mjs +7 -23
- package/lib/cli/compiler.mjs +0 -1
- package/lib/cli/project-scaffolder/prompt-builders.mjs +13 -14
- package/lib/cli/project-scaffolder/storage.mjs +1 -1
- package/lib/cli/project-scaffolder/ui-scope-detection.mjs +36 -0
- package/lib/cli/project-scaffolder.mjs +1 -3
- package/package.json +1 -1
- package/scripts/adaptive-context/fixtures.mjs +7 -12
- package/scripts/context-triggered-audit.mjs +1 -6
- package/scripts/frontend-usability-audit.mjs +2 -7
- package/scripts/release-gate/constants.mjs +0 -12
- package/scripts/ui-design-judge/constants.mjs +1 -12
- package/scripts/ui-design-judge/design-execution-summary.mjs +50 -228
- package/scripts/ui-design-judge/prompting.mjs +4 -25
- package/scripts/ui-design-judge.mjs +6 -5
- package/scripts/validate/config.mjs +5 -89
- package/scripts/validate/file-structure.mjs +0 -3
- package/.agent-context/rules/efficiency-vs-hype.md +0 -15
- package/.agent-context/rules/git-workflow.md +0 -15
- package/.agent-context/rules/naming-conv.md +0 -35
- package/lib/cli/project-scaffolder/design-contract/sections/audits.mjs +0 -96
- package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +0 -167
- package/lib/cli/project-scaffolder/design-contract/sections/execution-handoff.mjs +0 -211
- package/lib/cli/project-scaffolder/design-contract/seed-signals.mjs +0 -79
- package/lib/cli/project-scaffolder/design-contract/signal-vocab.mjs +0 -64
- package/lib/cli/project-scaffolder/design-contract/validation/anchor-validators.mjs +0 -294
- package/lib/cli/project-scaffolder/design-contract/validation/audit-validators.mjs +0 -117
- package/lib/cli/project-scaffolder/design-contract/validation/completeness.mjs +0 -121
- package/lib/cli/project-scaffolder/design-contract/validation/execution-validators.mjs +0 -328
- package/lib/cli/project-scaffolder/design-contract/validation/helpers.mjs +0 -8
- package/lib/cli/project-scaffolder/design-contract/validation/research-dossier-validators.mjs +0 -104
- package/lib/cli/project-scaffolder/design-contract/validation/structural-validators.mjs +0 -79
- package/lib/cli/project-scaffolder/design-contract/validation/system-validators.mjs +0 -256
- package/lib/cli/project-scaffolder/design-contract/validation.mjs +0 -74
- package/lib/cli/project-scaffolder/design-contract.mjs +0 -470
|
@@ -7,56 +7,46 @@ Use this prompt for UI, UX, frontend layout, screen, or redesign work. Create or
|
|
|
7
7
|
- Use current repo evidence, project docs, and `.agent-context/` as style context.
|
|
8
8
|
- Do not copy layout rhythm, palette, component skin, or brand posture from external references without explicit user approval.
|
|
9
9
|
- WCAG 2.2 AA is the hard compliance floor.
|
|
10
|
-
- Before choosing a new UI library, research current official docs.
|
|
10
|
+
- Before choosing a new UI library, research current official docs.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Design Direction Process
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
1. **Name Your Defaults**: Name three temptations (e.g. SaaS admin default, AI-startup landing) and why they flatten this product. Derive your search direction by rejecting them.
|
|
15
|
+
2. **Choose an Anchor**: Pick a specific real-world reference whose mechanics translate here. Do not use generic quality words ("clean", "modern").
|
|
16
|
+
3. **Creative Commitments**: Choose distinctive typography, dominant colors with sharp accents, and one signature motion behavior. Create depth rather than flat card stacks.
|
|
17
|
+
4. **Previous Directions**: If `docs/DESIGN.md` contains previous directions, treat them as a blocklist. The new anchor must differ in conceptual family, hierarchy, and motion.
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
Pick one concrete, googleable real-world reference whose interaction mechanics (not surface styling) translate to this UI. The anchor must be specific enough that renaming the product to a different category breaks coherence.
|
|
22
|
-
|
|
23
|
-
Hard constraints:
|
|
24
|
-
- Reject generic quality words as anchors: "modern", "clean", "premium", "minimal", "bold" are not anchors.
|
|
25
|
-
- Do not default to spatial place metaphors (room, studio, lab, cockpit, command center). Prefer artifacts, workflows, instruments, data behaviors, or interaction mechanisms.
|
|
26
|
-
- Record what mechanic is borrowed and what is explicitly NOT borrowed (palette, component skin, layout rhythm).
|
|
27
|
-
|
|
28
|
-
## Step 3: Creative Commitments
|
|
29
|
-
|
|
30
|
-
Record before coding:
|
|
31
|
-
1. **Typography**: Choose distinctive fonts with meaningful role contrast. Avoid Inter, Roboto, Arial, Space Grotesk, system fonts.
|
|
32
|
-
2. **Color and palette**: Dominant colors with sharp accents. Name what product evidence makes the palette fit. Name one color behavior that would not transfer to another category.
|
|
33
|
-
3. **Motion and interaction**: Define one signature motion behavior more specific than "smooth." One well-orchestrated page load with staggered reveals creates more delight than scattered micro-interactions.
|
|
34
|
-
4. **Composition**: One composition choice that avoids interchangeable card stacks. Create atmosphere and depth rather than solid backgrounds.
|
|
35
|
-
|
|
36
|
-
## Previous Directions (do not repeat)
|
|
19
|
+
## Redesign Protocol
|
|
37
20
|
|
|
38
|
-
|
|
21
|
+
When the user says "redesign from zero": treat existing UI as behavioral evidence only. Rewrite design docs. Change primary composition, hierarchy, interaction model, and responsive architecture. Do not ship a palette swap.
|
|
39
22
|
|
|
40
|
-
##
|
|
23
|
+
## Output Format
|
|
41
24
|
|
|
42
|
-
|
|
43
|
-
- `AI-startup landing default`: purple-to-pink gradient hero, floating glass cards, three-up feature grid, vague hero copy
|
|
44
|
-
- `SaaS admin default`: left-side icon-only nav, top utility bar, three-card KPI row above data table, neutral grey
|
|
45
|
-
- `marketing site default`: hero image with headline, three feature tiles, pricing tiers, testimonial carousel
|
|
25
|
+
`docs/DESIGN.md` must be a compact token file under 400 tokens. Rationale stays in working memory.
|
|
46
26
|
|
|
47
|
-
|
|
27
|
+
Required sections (in this order, no additions):
|
|
48
28
|
|
|
49
|
-
|
|
29
|
+
### Anchor
|
|
30
|
+
One sentence: the interaction anchor and what mechanic is borrowed.
|
|
50
31
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
### Tokens
|
|
33
|
+
- **Typography**: font families (display, body, mono), scale base and ratio, scale method
|
|
34
|
+
- **Colors**: OKLCH primitives with semantic role mapping (primary, secondary, surface, error, success)
|
|
35
|
+
- **Spacing**: base unit, scale
|
|
36
|
+
- **Radius**: small, medium, large values
|
|
37
|
+
- **Shadow**: elevation levels
|
|
38
|
+
- **Motion**: duration, easing, reduced-motion fallback
|
|
55
39
|
|
|
56
|
-
|
|
40
|
+
### Constraints
|
|
41
|
+
- WCAG 2.2 AA floor
|
|
42
|
+
- Up to 3 product-specific anti-patterns
|
|
57
43
|
|
|
58
|
-
|
|
44
|
+
### Previous Directions
|
|
45
|
+
Anchors used in prior iterations (blocklist for redesign). Start empty for fresh projects.
|
|
59
46
|
|
|
60
|
-
## Required
|
|
47
|
+
## Required Validation Gates
|
|
61
48
|
|
|
62
|
-
|
|
49
|
+
Only three gates. Do not add more:
|
|
50
|
+
1. Anchor exists and is specific.
|
|
51
|
+
2. Token values are derived from the anchor.
|
|
52
|
+
3. WCAG 2.2 AA compliance floor is met.
|
|
@@ -26,7 +26,7 @@ If the user describes a project or feature, the agent must:
|
|
|
26
26
|
If the user asks to create, complete, fix, or review project docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, API docs, or "lengkapkan docs", treat the request as documentation-first.
|
|
27
27
|
|
|
28
28
|
The agent must:
|
|
29
|
-
1. Materialize or refine required project docs before implementation: root `README.md` for every fresh or existing project; `docs/doc-index.md` whenever `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/api-contract.md` when APIs, firmware endpoints, CLI commands, or web application flows exist; `docs/database-schema.md` when persistent data exists; and `docs/DESIGN.md`
|
|
29
|
+
1. Materialize or refine required project docs before implementation: root `README.md` for every fresh or existing project; `docs/doc-index.md` whenever `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/api-contract.md` when APIs, firmware endpoints, CLI commands, or web application flows exist; `docs/database-schema.md` when persistent data exists; and `docs/DESIGN.md` for UI scope.
|
|
30
30
|
2. Write formal project docs in English by default unless the user explicitly asks for another documentation language.
|
|
31
31
|
3. Keep `docs/doc-index.md` short. Use it as the read-routing map with document path, purpose, reads-when triggers, status, and last-updated date. Do not duplicate the docs it points to.
|
|
32
32
|
4. Keep `README.md` public and developer friendly even for private projects: explain what the project is, who it is for, how to set it up, how to run the core workflow, how to configure it, and where deeper docs live. Do not put internal agent notes, private reasoning, secrets, or governance policy in the README.
|
|
@@ -44,10 +44,8 @@ If the user specifies a framework, runtime, or architecture constraint, the agen
|
|
|
44
44
|
4. Scaffold the initial project structure only after runtime and architecture decisions are explicit:
|
|
45
45
|
- Create only the directories and files justified by the approved structure.
|
|
46
46
|
- Set up configuration, validation, error handling, observability, health checks, and persistence only when they fit the approved runtime and project scope.
|
|
47
|
-
- Every file must follow [naming conventions](../rules/naming-conv.md).
|
|
48
47
|
- Every module must follow [architecture.md](../rules/architecture.md).
|
|
49
48
|
- New code must pass the natural implementation pass in [architecture.md](../rules/architecture.md): start with the simplest correct flow, add complexity only when the requirement or repo evidence needs it, and do not add files or layers for small tasks.
|
|
50
|
-
- Every dependency must be justified per [efficiency-vs-hype.md](../rules/efficiency-vs-hype.md).
|
|
51
49
|
- Use official framework setup commands or canonical starter flows when they produce newer, better-supported dependency defaults than manual package assembly.
|
|
52
50
|
- Do not assemble a framework project from scratch by habit when official setup commands create the supported structure. Manual assembly is allowed only for tiny prototypes, educational demos, unusual repo constraints, or a documented architecture reason.
|
|
53
51
|
- If containerization is selected, Docker assets must follow [docker-runtime.md](../rules/docker-runtime.md) and the latest official Docker docs instead of stale blog-era patterns. Selected Docker lanes require files and runbooks, not docs-only acknowledgment.
|
|
@@ -58,5 +56,5 @@ See [.agent-context/state/onboarding-report.json](../state/onboarding-report.jso
|
|
|
58
56
|
|
|
59
57
|
## UI/UX Bootstrap
|
|
60
58
|
|
|
61
|
-
When a user requests frontend or UI/UX design, the agent must automatically execute the [bootstrap-design.md](./bootstrap-design.md) prompt to synthesize a dynamic design contract (`docs/DESIGN.md`
|
|
59
|
+
When a user requests frontend or UI/UX design, the agent must automatically execute the [bootstrap-design.md](./bootstrap-design.md) prompt to synthesize a dynamic markdown design contract (`docs/DESIGN.md`).
|
|
62
60
|
Keep UI-only requests context-isolated: load [bootstrap-design.md](./bootstrap-design.md) and [frontend-architecture.md](../rules/frontend-architecture.md) first, and do not eagerly load backend-only rules unless the task explicitly crosses backend boundaries.
|
|
@@ -11,7 +11,7 @@ Before editing:
|
|
|
11
11
|
3. If required project docs are missing, stop and bootstrap or update docs first.
|
|
12
12
|
4. If the change touches UI, load .agent-context/prompts/bootstrap-design.md and .agent-context/rules/frontend-architecture.md before editing.
|
|
13
13
|
5. If the change touches a dependency, framework, Docker, runtime, or ecosystem claim, verify current official docs before choosing.
|
|
14
|
-
6. Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing, if `docs/doc-index.md` is missing while `docs/` exists, if `docs/project-brief.md` is missing, if `docs/architecture-decision-record.md` is missing, if `docs/flow-overview.md` is missing, if `docs/database-schema.md` is missing while the project uses persistent data, if `docs/api-contract.md` is missing while the project exposes API or web application flows, or for UI scope if `docs/DESIGN.md`
|
|
14
|
+
6. Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing, if `docs/doc-index.md` is missing while `docs/` exists, if `docs/project-brief.md` is missing, if `docs/architecture-decision-record.md` is missing, if `docs/flow-overview.md` is missing, if `docs/database-schema.md` is missing while the project uses persistent data, if `docs/api-contract.md` is missing while the project exposes API or web application flows, or for UI scope if `docs/DESIGN.md` is missing.
|
|
15
15
|
7. Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.
|
|
16
16
|
8. For backend/API scope, enforce layered boundaries, zero-trust input validation, safe centralized error responses, bounded list reads, transaction safety for multi-write mutations, idempotency for sensitive mutations, and behavior-focused API tests.
|
|
17
17
|
9. Backend/API governance is global and stack-agnostic. Do not create stack-specific adapters or framework-specific rule branches; apply the global rules through the framework already present in the target project.
|
|
@@ -10,8 +10,8 @@ Before reviewing:
|
|
|
10
10
|
2. Read .agent-context/review-checklists/pr-checklist.md.
|
|
11
11
|
3. Read .agent-context/review-checklists/architecture-review.md only when architecture or boundaries changed.
|
|
12
12
|
4. Load only the rules relevant to the changed scope.
|
|
13
|
-
5. For UI changes, load .agent-context/prompts/bootstrap-design.md, .agent-context/rules/frontend-architecture.md, docs/DESIGN.md
|
|
14
|
-
6. Enforce Universal SOP hard gate: block coding flow when required project docs are missing (root `README.md`; `docs/doc-index.md` when `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/database-schema.md` when persistent data exists; `docs/api-contract.md` when API or web application flows exist; and for UI scope `docs/DESIGN.md`
|
|
13
|
+
5. For UI changes, load .agent-context/prompts/bootstrap-design.md, .agent-context/rules/frontend-architecture.md, and docs/DESIGN.md when present.
|
|
14
|
+
6. Enforce Universal SOP hard gate: block coding flow when required project docs are missing (root `README.md`; `docs/doc-index.md` when `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/database-schema.md` when persistent data exists; `docs/api-contract.md` when API or web application flows exist; and for UI scope `docs/DESIGN.md`).
|
|
15
15
|
7. Enforce single-source and lazy-loading policy: canonical rule source must be explicitly enforced, global domain governance must load lazily based on touched scope, and conflicting duplicate rule instructions must not appear during normal flow.
|
|
16
16
|
|
|
17
17
|
Prioritize findings in this order:
|
|
@@ -80,7 +80,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
80
80
|
|
|
81
81
|
## 7. UI And Accessibility
|
|
82
82
|
|
|
83
|
-
- [ ] UI work follows `docs/DESIGN.md
|
|
83
|
+
- [ ] UI work follows `docs/DESIGN.md`.
|
|
84
84
|
- [ ] Visual direction is project-specific and not a template/default component-kit habit.
|
|
85
85
|
- [ ] UI work includes a Motion/Palette Decision, and product categories were treated as heuristics rather than style presets.
|
|
86
86
|
- [ ] Responsive behavior recomposes content and priority, not only shrinking desktop layout.
|
|
@@ -129,7 +129,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
|
|
|
129
129
|
- [ ] Coding flow is blocked if `docs/flow-overview.md` is missing
|
|
130
130
|
- [ ] Coding flow is blocked if `docs/database-schema.md` is missing while the project uses persistent data
|
|
131
131
|
- [ ] Coding flow is blocked if `docs/api-contract.md` is missing while the project exposes API or web application flows
|
|
132
|
-
- [ ] UI implementation flow is blocked if `docs/DESIGN.md`
|
|
132
|
+
- [ ] UI implementation flow is blocked if `docs/DESIGN.md` is missing
|
|
133
133
|
|
|
134
134
|
## Verdict
|
|
135
135
|
|
|
@@ -30,8 +30,4 @@ keywords: [architecture, arch, boundary, system]
|
|
|
30
30
|
2. Load global domain rules lazily based on touched scope.
|
|
31
31
|
3. Do not create or load stack-specific governance adapters as the baseline.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
1. No clever hacks.
|
|
35
|
-
2. No premature abstraction.
|
|
36
|
-
3. Readability over brevity.
|
|
37
|
-
4. Keep backend and shared core modules clean.
|
|
33
|
+
|
|
@@ -22,7 +22,7 @@ Load this rule for UI-facing engineering work. This file contains strict enginee
|
|
|
22
22
|
|
|
23
23
|
## FE-011: Implementation Boundaries
|
|
24
24
|
1. Follow the shipped project stack and current repo patterns.
|
|
25
|
-
2. Do not hardcode
|
|
25
|
+
2. Do not hardcode framework-specific state management or data fetching libraries, or rigid component doctrines.
|
|
26
26
|
|
|
27
27
|
## FE-012: Data State Surface
|
|
28
28
|
1. Explicitly handle empty, loading, error, and offline states.
|
package/AGENTS.md
CHANGED
|
@@ -33,12 +33,13 @@ Always prefix noisy shell commands: `ascx git status`, `ascx git diff`, `ascx np
|
|
|
33
33
|
Always read and apply `.agent-context/prompts/compact-natural-mode.md` for every final user-facing reply. Never repeat full command output; reference tee file paths when truncated.
|
|
34
34
|
|
|
35
35
|
## Layer Index
|
|
36
|
-
### Layer 1: Rules (
|
|
36
|
+
### Layer 1: Rules (18 Files) [SCOPE-RESOLVED]
|
|
37
37
|
Location: `.agent-context/rules/`.
|
|
38
38
|
|
|
39
39
|
Load only relevant rule files. Do not read the entire rule directory by default.
|
|
40
40
|
|
|
41
|
-
Available rules: `
|
|
41
|
+
Available rules: `architecture.md` (`ARCH-*`, v4), `security.md` (`SEC-*`, v4), `performance.md` (`PERF-*`, v4), `error-handling.md` (`ERR-*`, v4), `testing.md` (`TEST-*`, v4), `api-docs.md` (`API-*`, v4), `microservices.md` (`SVC-*`, v4), `event-driven.md` (`EVT-*`, v4), `database-design.md` (`DATA-*`, v4), `realtime.md` (`RT-*`, v4), `frontend-architecture.md` (`FE-*`, v4), `docker-runtime.md` (`DOCK-*`, v4), `observability.md` (`OBS-*`, v4), `resilience.md` (`RES-*`, v4), `migrations.md` (`MIG-*`, v4), `background-jobs.md` (`JOB-*`, v4), `config-and-flags.md` (`CFG-*`, v4), `api-versioning.md` (`VER-*`, v4).
|
|
42
|
+
|
|
42
43
|
|
|
43
44
|
For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. Also perform live web research for Docker and framework/package setup claims. For framework or package setup work, use the latest stable compatible dependency set and official setup flow unless a documented compatibility constraint blocks it; prefer official framework scaffolders when they create the supported project shape. New dependencies are allowed when they improve efficiency, delivery time, correctness, accessibility, UX, or maintainability. Do not treat dependency avoidance or vague performance fear as a default reason to skip a modern maintained library.
|
|
44
45
|
|
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ If you see `Property $schema is not allowed`, keep `.vscode/mcp.json` without `$
|
|
|
115
115
|
|
|
116
116
|
## Design Direction
|
|
117
117
|
|
|
118
|
-
For UI, UX, layout, screen, Tailwind, frontend, or redesign work, the pack routes agents through a
|
|
118
|
+
For UI, UX, layout, screen, Tailwind, frontend, or redesign work, the pack routes agents through a compact design bootstrap before code changes. The flow asks the agent to reject generic defaults, choose a concrete interaction anchor, record creative commitments, and write the result into `docs/DESIGN.md`. Existing projects read the real repository and docs first; fresh projects ask the agent to recommend the stack from current evidence instead of hardcoding a framework.
|
|
119
119
|
|
|
120
120
|
See [docs/doc-index.md](docs/doc-index.md) for the full doc routing map.
|
|
121
121
|
|
|
@@ -143,26 +143,6 @@ export const RULE_FAMILY_CATALOG = [
|
|
|
143
143
|
'rapikan',
|
|
144
144
|
],
|
|
145
145
|
},
|
|
146
|
-
{
|
|
147
|
-
label: 'NAME',
|
|
148
|
-
rulePath: '.agent-context/rules/naming-conv.md',
|
|
149
|
-
priority: 60,
|
|
150
|
-
triggers: [
|
|
151
|
-
'naming',
|
|
152
|
-
'name',
|
|
153
|
-
'variable',
|
|
154
|
-
'function name',
|
|
155
|
-
'comment',
|
|
156
|
-
'comments',
|
|
157
|
-
'readable',
|
|
158
|
-
'humanizer',
|
|
159
|
-
'natural code',
|
|
160
|
-
'generic name',
|
|
161
|
-
'namingnya',
|
|
162
|
-
'dibaca',
|
|
163
|
-
'variabel',
|
|
164
|
-
],
|
|
165
|
-
},
|
|
166
146
|
{
|
|
167
147
|
label: 'FE',
|
|
168
148
|
rulePath: '.agent-context/rules/frontend-architecture.md',
|
|
@@ -375,20 +355,6 @@ export const RULE_FAMILY_CATALOG = [
|
|
|
375
355
|
'breaking change',
|
|
376
356
|
],
|
|
377
357
|
},
|
|
378
|
-
{
|
|
379
|
-
label: 'DEP',
|
|
380
|
-
rulePath: '.agent-context/rules/efficiency-vs-hype.md',
|
|
381
|
-
priority: 200,
|
|
382
|
-
triggers: [
|
|
383
|
-
'dependency',
|
|
384
|
-
'dependencies',
|
|
385
|
-
'package',
|
|
386
|
-
'library',
|
|
387
|
-
'install',
|
|
388
|
-
'npm',
|
|
389
|
-
'framework',
|
|
390
|
-
],
|
|
391
|
-
},
|
|
392
358
|
];
|
|
393
359
|
|
|
394
360
|
export const PROMPT_CATALOG = [
|
|
@@ -415,11 +381,10 @@ export const DOCS_BY_LABEL = {
|
|
|
415
381
|
ARCH: ['docs/architecture-decision-record.md', 'docs/flow-overview.md'],
|
|
416
382
|
API: ['docs/api-contract.md'],
|
|
417
383
|
DATA: ['docs/database-schema.md'],
|
|
418
|
-
FE: ['docs/DESIGN.md'
|
|
384
|
+
FE: ['docs/DESIGN.md'],
|
|
419
385
|
TEST: ['docs/flow-overview.md'],
|
|
420
386
|
};
|
|
421
387
|
|
|
422
388
|
export const STATE_BY_LABEL = {
|
|
423
389
|
ARCH: ['.agent-context/state/architecture-map.md'],
|
|
424
|
-
DEP: ['.agent-context/state/dependency-map.md'],
|
|
425
390
|
};
|
|
@@ -4,14 +4,11 @@
|
|
|
4
4
|
* Typography and palette anti-repeat audit.
|
|
5
5
|
*
|
|
6
6
|
* Scans CSS-like files for font-family declarations and color values, then
|
|
7
|
-
* cross-checks them against
|
|
8
|
-
* `docs/design-intent.json`'s
|
|
9
|
-
* `researchDossier.metadata.antiRepeatLedger.previousTypographyChoices` and
|
|
10
|
-
* `previousPalettes` so a redesign cannot leak the previous direction's
|
|
11
|
-
* exact font trio or perceptually-identical palette colors through CSS
|
|
12
|
-
* implementation files alone.
|
|
13
7
|
*
|
|
14
|
-
*
|
|
8
|
+
* DEPRECATED: This audit was built for the legacy design-intent.json system
|
|
9
|
+
* and its machine-readable antiRepeatLedger. In the 2026 Context Ops Paradigm,
|
|
10
|
+
* anti-repeat checks are handled by the LLM reading docs/DESIGN.md's
|
|
11
|
+
* "Previous Directions" blocklist. This audit now unconditionally skips.
|
|
15
12
|
* - Typography matches are EXACT family-name matches and are always
|
|
16
13
|
* blocking (kind: typography.previously-shipped-family,
|
|
17
14
|
* diagnosticCode: BOUNDARY_TYPOGRAPHY_LEDGER_VIOLATION).
|
|
@@ -129,19 +126,8 @@ function findPaletteFindingsForFile({ relativeFilePath, sourceText, ledgerColors
|
|
|
129
126
|
return findings;
|
|
130
127
|
}
|
|
131
128
|
|
|
132
|
-
function loadDesignIntentContract(
|
|
133
|
-
|
|
134
|
-
if (!existsSync(designIntentAbsolutePath)) {
|
|
135
|
-
return { contract: null, reason: 'design-intent-file-absent' };
|
|
136
|
-
}
|
|
137
|
-
let contract;
|
|
138
|
-
try {
|
|
139
|
-
contract = JSON.parse(readFileSync(designIntentAbsolutePath, 'utf8'));
|
|
140
|
-
} catch (parseError) {
|
|
141
|
-
const errorMessage = parseError instanceof Error ? parseError.message : String(parseError);
|
|
142
|
-
return { contract: null, reason: `design-intent-file-not-valid-json: ${errorMessage}` };
|
|
143
|
-
}
|
|
144
|
-
return { contract, reason: 'ok' };
|
|
129
|
+
function loadDesignIntentContract() {
|
|
130
|
+
return { contract: null, reason: 'design-intent-deprecated-use-design-md-blocklist' };
|
|
145
131
|
}
|
|
146
132
|
|
|
147
133
|
function buildSkippedReport(reportShell, reason) {
|
|
@@ -200,12 +186,10 @@ export function runTypographyPaletteAntiRepeatAudit(auditOptions = {}) {
|
|
|
200
186
|
},
|
|
201
187
|
};
|
|
202
188
|
|
|
203
|
-
const designIntentLoad = loadDesignIntentContract(
|
|
189
|
+
const designIntentLoad = loadDesignIntentContract();
|
|
204
190
|
if (!designIntentLoad.contract) {
|
|
205
191
|
return buildSkippedReport(reportShell, designIntentLoad.reason);
|
|
206
192
|
}
|
|
207
|
-
|
|
208
|
-
const antiRepeatLedger = designIntentLoad.contract?.researchDossier?.metadata?.antiRepeatLedger;
|
|
209
193
|
if (!antiRepeatLedger || typeof antiRepeatLedger !== 'object') {
|
|
210
194
|
return buildSkippedReport(reportShell, 'anti-repeat-ledger-absent');
|
|
211
195
|
}
|
package/lib/cli/compiler.mjs
CHANGED
|
@@ -130,13 +130,13 @@ export function buildDesignBootstrapPrompt({
|
|
|
130
130
|
`Protocol version: ${PROJECT_DOC_SYNTHESIS_PROMPT_VERSION}`,
|
|
131
131
|
'',
|
|
132
132
|
'You are the Lead UI/UX Art Director for this project.',
|
|
133
|
-
'Create a
|
|
133
|
+
'Create a compact design token file, not a fixed stylistic template or prose document.',
|
|
134
134
|
'',
|
|
135
135
|
'## Mission',
|
|
136
|
-
`Author docs/DESIGN.md in ${docsLanguage.toUpperCase()} language
|
|
136
|
+
`Author docs/DESIGN.md in ${docsLanguage.toUpperCase()} language as a compact token file under 400 tokens.`,
|
|
137
137
|
'',
|
|
138
138
|
'## Deliverables',
|
|
139
|
-
'1. docs/DESIGN.md',
|
|
139
|
+
'1. docs/DESIGN.md (compact token file)',
|
|
140
140
|
'',
|
|
141
141
|
'## Design Direction Process',
|
|
142
142
|
'Follow `.agent-context/prompts/bootstrap-design.md` for the three-step design direction:',
|
|
@@ -146,13 +146,12 @@ export function buildDesignBootstrapPrompt({
|
|
|
146
146
|
'',
|
|
147
147
|
'## Hard Rules',
|
|
148
148
|
'1. Do not copy external style guides or anchor to famous product surfaces.',
|
|
149
|
-
'2.
|
|
150
|
-
'3.
|
|
151
|
-
'4.
|
|
152
|
-
'5.
|
|
153
|
-
'6.
|
|
154
|
-
'7.
|
|
155
|
-
'8. Treat production content as blocking: remove demo, placeholder, lorem, TODO, and scaffold copy.',
|
|
149
|
+
'2. Use repo evidence, active brief, current docs, and current official docs for technology choices.',
|
|
150
|
+
'3. WCAG 2.2 AA is the hard floor. APCA is advisory perceptual tuning only.',
|
|
151
|
+
'4. Research current official docs before importing any new UI-related library.',
|
|
152
|
+
'5. Do not default to any component kit by habit, and do not avoid them when they fit.',
|
|
153
|
+
'6. Keep research vocabulary internal; evidence, anchor, and category-code labels must not appear in public-facing docs.',
|
|
154
|
+
'7. Treat production content as blocking: remove demo, placeholder, lorem, TODO, and scaffold copy.',
|
|
156
155
|
'',
|
|
157
156
|
'## Project Inputs',
|
|
158
157
|
`- Project name: ${discoveryAnswers.projectName}`,
|
|
@@ -163,10 +162,10 @@ export function buildDesignBootstrapPrompt({
|
|
|
163
162
|
`- Architecture constraint: ${initContext.blueprintFileName === 'agent-decision-architecture.md' ? 'agent recommendation required before coding' : toTitleCase(initContext.blueprintFileName)}`,
|
|
164
163
|
'',
|
|
165
164
|
'## Required Execution',
|
|
166
|
-
'1.
|
|
167
|
-
'2.
|
|
168
|
-
'3.
|
|
169
|
-
'4. After the
|
|
165
|
+
'1. Follow the output format defined in `.agent-context/prompts/bootstrap-design.md`: Anchor, Tokens, Constraints, Previous Directions.',
|
|
166
|
+
'2. Keep docs/DESIGN.md under 400 tokens. Rationale and derivation stay in working memory.',
|
|
167
|
+
'3. Make the token file executable without screenshot dependency.',
|
|
168
|
+
'4. After the token file exists, use it as a first-class source for future UI tasks.',
|
|
170
169
|
'',
|
|
171
170
|
].join('\n');
|
|
172
171
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI scope detection utility. Determines whether a project needs
|
|
3
|
+
* design bootstrap based on domain and blueprint signals.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from design-contract/seed-signals.mjs so the design
|
|
6
|
+
* contract module can be removed without breaking this dependency.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export function shouldBootstrapDesignDocument(discoveryAnswers, initContext) {
|
|
10
|
+
const normalizedDomain = String(discoveryAnswers.primaryDomain || '').trim().toLowerCase();
|
|
11
|
+
const normalizedBlueprint = String(initContext.blueprintFileName || '').trim().toLowerCase();
|
|
12
|
+
|
|
13
|
+
const isUiDomain = normalizedDomain.includes('web')
|
|
14
|
+
|| normalizedDomain.includes('mobile')
|
|
15
|
+
|| normalizedDomain.includes('frontend')
|
|
16
|
+
|| normalizedDomain.includes('fullstack')
|
|
17
|
+
|| normalizedDomain.includes('ui');
|
|
18
|
+
|
|
19
|
+
const isBackendOnlyDomain = normalizedDomain.includes('api service')
|
|
20
|
+
|| normalizedDomain.includes('cli tool')
|
|
21
|
+
|| normalizedDomain.includes('library');
|
|
22
|
+
|
|
23
|
+
const blueprintLooksUi = normalizedBlueprint.includes('frontend')
|
|
24
|
+
|| normalizedBlueprint.includes('landing')
|
|
25
|
+
|| normalizedBlueprint.includes('ui');
|
|
26
|
+
|
|
27
|
+
if (isUiDomain) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!isBackendOnlyDomain && blueprintLooksUi) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
@@ -19,9 +19,7 @@ export {
|
|
|
19
19
|
|
|
20
20
|
export {
|
|
21
21
|
shouldBootstrapDesignDocument,
|
|
22
|
-
|
|
23
|
-
validateDesignContractCompleteness,
|
|
24
|
-
} from './project-scaffolder/design-contract.mjs';
|
|
22
|
+
} from './project-scaffolder/ui-scope-detection.mjs';
|
|
25
23
|
|
|
26
24
|
export {
|
|
27
25
|
generateProjectDocumentation,
|
package/package.json
CHANGED
|
@@ -38,8 +38,8 @@ export const ADAPTIVE_CONTEXT_FIXTURES = [
|
|
|
38
38
|
{
|
|
39
39
|
id: 'indonesian-readable-service',
|
|
40
40
|
requestText: 'Rapihin service ini biar namingnya enak dibaca.',
|
|
41
|
-
requiredLabels: ['ARCH'
|
|
42
|
-
allowedLabels: ['ARCH'
|
|
41
|
+
requiredLabels: ['ARCH'],
|
|
42
|
+
allowedLabels: ['ARCH'],
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
id: 'natural-cron-silent',
|
|
@@ -86,8 +86,8 @@ export const ADAPTIVE_CONTEXT_FIXTURES = [
|
|
|
86
86
|
{
|
|
87
87
|
id: 'checkout-helper-naming',
|
|
88
88
|
requestText: 'Rapihin nama variabel di checkout helper, jangan bikin abstraction baru.',
|
|
89
|
-
requiredLabels: ['ARCH'
|
|
90
|
-
allowedLabels: ['ARCH'
|
|
89
|
+
requiredLabels: ['ARCH'],
|
|
90
|
+
allowedLabels: ['ARCH'],
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
id: 'mobile-button-cut-off',
|
|
@@ -125,12 +125,7 @@ export const ADAPTIVE_CONTEXT_FIXTURES = [
|
|
|
125
125
|
requiredLabels: ['DATA', 'PERF', 'RES'],
|
|
126
126
|
allowedLabels: ['DATA', 'PERF', 'RES'],
|
|
127
127
|
},
|
|
128
|
-
|
|
129
|
-
id: 'dependency-update-check',
|
|
130
|
-
requestText: 'Cek dependency package ini outdated atau perlu update.',
|
|
131
|
-
requiredLabels: ['DEP'],
|
|
132
|
-
allowedLabels: ['DEP'],
|
|
133
|
-
},
|
|
128
|
+
|
|
134
129
|
{
|
|
135
130
|
id: 'frontend-redesign',
|
|
136
131
|
requestText: 'Redesign this frontend screen from zero with responsive layout, motion, and UI design docs.',
|
|
@@ -158,8 +153,8 @@ export const ADAPTIVE_CONTEXT_FIXTURES = [
|
|
|
158
153
|
{
|
|
159
154
|
id: 'service-refactor-clean-code',
|
|
160
155
|
requestText: 'Refactor this service module. Clean up helper names, avoid over-engineering, and keep tests readable.',
|
|
161
|
-
requiredLabels: ['ARCH', '
|
|
162
|
-
allowedLabels: ['ARCH', '
|
|
156
|
+
requiredLabels: ['ARCH', 'TEST'],
|
|
157
|
+
allowedLabels: ['ARCH', 'TEST'],
|
|
163
158
|
},
|
|
164
159
|
{
|
|
165
160
|
id: 'versioned-api-endpoint',
|
|
@@ -43,12 +43,7 @@ const REQUIRED_PR_CHECKLIST_SNIPPETS = [
|
|
|
43
43
|
'User can always force strict audit mode manually',
|
|
44
44
|
];
|
|
45
45
|
|
|
46
|
-
const REQUIRED_ARCHITECTURE_CHECKLIST_SNIPPETS = [
|
|
47
|
-
'## Backend Universal Principles',
|
|
48
|
-
'No clever hacks in backend and shared core modules',
|
|
49
|
-
'No premature abstraction',
|
|
50
|
-
'Readability over brevity',
|
|
51
|
-
];
|
|
46
|
+
const REQUIRED_ARCHITECTURE_CHECKLIST_SNIPPETS = [];
|
|
52
47
|
|
|
53
48
|
function pushResult(results, isPassed, checkName, details) {
|
|
54
49
|
results.push({
|
|
@@ -42,12 +42,7 @@ const REQUIRED_PR_CHECKLIST_SNIPPETS = [
|
|
|
42
42
|
'### 15. Universal SOP Consolidation',
|
|
43
43
|
];
|
|
44
44
|
|
|
45
|
-
const REQUIRED_ARCHITECTURE_CHECKLIST_SNIPPETS = [
|
|
46
|
-
'## Backend Universal Principles',
|
|
47
|
-
'No clever hacks in backend and shared core modules',
|
|
48
|
-
'No premature abstraction',
|
|
49
|
-
'Readability over brevity',
|
|
50
|
-
];
|
|
45
|
+
const REQUIRED_ARCHITECTURE_CHECKLIST_SNIPPETS = [];
|
|
51
46
|
|
|
52
47
|
const REQUIRED_FRONTEND_RULE_SNIPPETS = [
|
|
53
48
|
'## FE-009: Accessibility',
|
|
@@ -56,7 +51,7 @@ const REQUIRED_FRONTEND_RULE_SNIPPETS = [
|
|
|
56
51
|
'## FE-010: CSS Production Hardening',
|
|
57
52
|
'overflow, wrapping, truncation',
|
|
58
53
|
'## FE-011: Implementation Boundaries',
|
|
59
|
-
'Do not hardcode
|
|
54
|
+
'Do not hardcode framework-specific state management or data fetching libraries, or rigid component doctrines',
|
|
60
55
|
];
|
|
61
56
|
|
|
62
57
|
const REQUIRED_BOOTSTRAP_DESIGN_SNIPPETS = [
|
|
@@ -28,17 +28,10 @@ export const AUTO_DOCS_SYNC_SCOPE_BOUNDARIES = [
|
|
|
28
28
|
];
|
|
29
29
|
|
|
30
30
|
export const REQUIRED_BACKEND_ARCHITECTURE_RULE_SNIPPETS = [
|
|
31
|
-
'No clever hacks.',
|
|
32
|
-
'No premature abstraction.',
|
|
33
|
-
'Readability over brevity.',
|
|
34
|
-
'backend and shared core modules',
|
|
35
31
|
'Do not create or load stack-specific governance adapters as the baseline.',
|
|
36
32
|
];
|
|
37
33
|
|
|
38
34
|
export const REQUIRED_BACKEND_REVIEW_CHECKLIST_SNIPPETS = [
|
|
39
|
-
'No clever hacks in backend and shared core modules',
|
|
40
|
-
'No premature abstraction (base classes/util layers created only after repeated stable patterns)',
|
|
41
|
-
'Readability over brevity for maintainability',
|
|
42
35
|
'Controllers, route handlers, and transport adapters do not contain business policy',
|
|
43
36
|
'Sensitive mutations include idempotency or duplicate-submit coverage',
|
|
44
37
|
'Backend/API governance was applied through global domain rules',
|
|
@@ -46,7 +39,6 @@ export const REQUIRED_BACKEND_REVIEW_CHECKLIST_SNIPPETS = [
|
|
|
46
39
|
|
|
47
40
|
export const REQUIRED_RELEASE_VERSION = '4.3.4';
|
|
48
41
|
export const REQUIRED_REFACTOR_PROMPT_SNIPPETS = [
|
|
49
|
-
'Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.',
|
|
50
42
|
'Prioritize maintainability over compressed one-liners.',
|
|
51
43
|
'zero-trust input validation',
|
|
52
44
|
'idempotency for sensitive mutations',
|
|
@@ -54,10 +46,6 @@ export const REQUIRED_REFACTOR_PROMPT_SNIPPETS = [
|
|
|
54
46
|
];
|
|
55
47
|
|
|
56
48
|
export const REQUIRED_ARCHITECTURE_REVIEW_CHECKLIST_SNIPPETS = [
|
|
57
|
-
'## Backend Universal Principles',
|
|
58
|
-
'No clever hacks in backend and shared core modules',
|
|
59
|
-
'No premature abstraction',
|
|
60
|
-
'Readability over brevity',
|
|
61
49
|
'Service or use-case code owns orchestration',
|
|
62
50
|
'Relational reads avoid N+1 patterns',
|
|
63
51
|
'Global backend/API governance is used directly',
|
|
@@ -7,18 +7,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
7
7
|
const __dirname = dirname(__filename);
|
|
8
8
|
|
|
9
9
|
export const REPOSITORY_ROOT = resolve(__dirname, '..', '..');
|
|
10
|
-
export const DESIGN_INTENT_PATH = resolve(REPOSITORY_ROOT, 'docs', 'design-intent.json');
|
|
11
10
|
export const DESIGN_GUIDE_PATH = resolve(REPOSITORY_ROOT, 'docs', 'DESIGN.md');
|
|
12
11
|
export const MAX_DIFF_CHARS = 12000;
|
|
13
12
|
export const UI_FILE_EXTENSIONS = new Set(['.js', '.jsx', '.ts', '.tsx', '.vue', '.css', '.scss', '.sass']);
|
|
14
|
-
|
|
15
|
-
'requireSurfacePlan',
|
|
16
|
-
'requireComponentGraph',
|
|
17
|
-
'requireViewportMutationPlan',
|
|
18
|
-
'requireInteractionStateMatrix',
|
|
19
|
-
'requireContentPriorityMap',
|
|
20
|
-
'requireTaskFlowNarrative',
|
|
21
|
-
'requireSignatureMoveRationale',
|
|
22
|
-
'requireStructuredHandoff',
|
|
23
|
-
'requireRepoEvidenceAlignment',
|
|
24
|
-
];
|
|
13
|
+
|