@ryuenn3123/agentic-senior-core 3.0.45 → 3.0.47

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.
@@ -5,7 +5,6 @@ Use this prompt for UI, UX, frontend layout, screen, Tailwind, animation, 3D, ca
5
5
  Create or refine `docs/DESIGN.md` for human reasoning and `docs/design-intent.json` for machine-readable design intent, guardrails, and review signals.
6
6
 
7
7
  This contract is a decision scaffold, not a style preset. We guide the agent; we do not pick the final style, stack, framework, palette, typography, layout paradigm, or animation library offline.
8
-
9
8
  ## Authority
10
9
  - Treat `.agent-context/` and current project docs as technical authority.
11
10
  - Treat `README.md` as public and developer overview, setup, usage, and user-facing context only. Do not use it as coding, architecture, or design authority when `.agent-context/` gives a stricter rule.
@@ -13,7 +12,6 @@ This contract is a decision scaffold, not a style preset. We guide the agent; we
13
12
  - Treat prior-chat visuals, unrelated project memory, benchmark screenshots, and famous-product aesthetics as tainted context unless the user explicitly approves continuity.
14
13
  - Keep external references non-copying; extract constraints only.
15
14
  - Before choosing a new UI, animation, scroll, 3D, canvas, chart, icon, styling, or component library, research current official docs.
16
-
17
15
  ## Required Order
18
16
  1. Read `AGENTS.md`, this prompt, `../rules/frontend-architecture.md`, current UI code, current project docs, and existing design docs.
19
17
  2. Refine existing `docs/DESIGN.md` and `docs/design-intent.json`; do not replace them blindly.
@@ -21,7 +19,6 @@ This contract is a decision scaffold, not a style preset. We guide the agent; we
21
19
  4. Record `motionPaletteDecision` before UI code; product categories are heuristics, not style presets.
22
20
  5. Encode `repoEvidence.designEvidenceSummary` when onboarding or detector evidence exists.
23
21
  6. Keep both design docs synchronized after implementation.
24
-
25
22
  ## Creative Commitment Gate
26
23
  Before broad compliance review or UI implementation, record an agent-chosen visual direction in both design docs:
27
24
  - one concrete real-world anchor reference
@@ -30,7 +27,6 @@ Before broad compliance review or UI implementation, record an agent-chosen visu
30
27
  - one authored visual bet visible in the first viewport
31
28
 
32
29
  Reject generic anchors. Do not accept "modern", "clean", "premium", "expressive", "minimal", or "bold" as the anchor. Name a material, instrument, artifact class, architectural system, editorial genre, cinematic behavior, exhibition system, scientific apparatus, or industrial mechanism.
33
-
34
30
  ## Dynamic Avant-Garde Anchor Engine
35
31
  If no current-task research or visual reference exists, activate the Dynamic Avant-Garde Anchor Engine before coding.
36
32
 
@@ -40,10 +36,11 @@ Rules:
40
36
  - Discard the two safest or most predictable options.
41
37
  - Output only the chosen anchor, specific reference point, and rationale.
42
38
  - Forbid final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.
39
+ - Do not default to spatial place metaphors such as room, darkroom, control room, counting room, war room, studio, lab, cockpit, or command center. Use them only when the product truly depends on a physical place model.
40
+ - Prefer artifacts, custody flows, instruments, data behaviors, materials, editorial systems, service rituals, or interaction mechanisms over "where the interface lives" as the anchor.
43
41
  - Derive typography, spacing, density, color behavior, morphology, motion, and responsive composition from the chosen anchor.
44
42
  - Translate the anchor non-literally first. Anchor artifacts are evidence for behavior, hierarchy, density, typography, state language, and motion, not automatic UI chrome.
45
43
  - Use reduced-motion fallbacks instead of suppressing motion.
46
-
47
44
  ## Creative Ambition Floor
48
45
  Before UI code, record:
49
46
  - one product-derived palette move
@@ -52,19 +49,18 @@ Before UI code, record:
52
49
  - at least three at-a-glance product-specific signals for new screens or broad redesigns
53
50
 
54
51
  Do not ship AI-safe UI. Record exact drift signals in `reviewRubric`; at minimum reject decorative grid wallpaper, default line backgrounds, calibration-mark wallpaper, soft glow backgrounds, generic abstract marks, testing/demo/placeholder UI copy, terminal-only user flows, and first-output composition with only local copy swapped in when they have no product function. Treat measurement, calibration, crop, route, timeline, and inspection marks as task overlays or control affordances only; never promote them to the page background, hero backdrop, or first-output visual texture. If a conceptual anchor suggests a forbidden motif, the forbidden motif wins; express the anchor through workflow, hierarchy, density, typography, material behavior, state design, and interaction grammar instead of literal wallpaper.
55
-
56
52
  ## Brave Redesign Default
57
53
  For UI design work, the agent owns the ambition decision. For broad screens, redesigns, or new visual systems, treat expressive motion, spatial hierarchy, distinctive composition, and product-specific interaction as the baseline even when the user did not say "rich". Do not reduce the request to a safer version of the existing UI, a static implementation, or a component-kit rearrangement because research or dependency selection feels inconvenient.
58
54
 
59
55
  If the expressive path needs a new motion, 3D, canvas, scroll, or interaction library and web search is available, perform the official-doc research and record the decision. If web search is unavailable, use already-present dependencies or native browser capabilities while preserving the intended ambition, then mark library verification as pending.
60
56
 
61
57
  Only downshift ambition after naming the concrete blocker: product fit, content density, measured performance budget, accessibility, device support, package conflict, security risk, or missing runtime capability. A new dependency, package count, or vague performance concern is not a blocker by itself. Pair every downshift with a replacement interaction quality that still changes composition, hierarchy, feedback, or memorability.
62
-
63
58
  ## Design Flexibility Layer
64
-
65
59
  `docs/design-intent.json` must separate locked outcomes from flexible expression. The machine contract keeps review invariants stable; it must not freeze exact aesthetic implementation unless repo evidence, accessibility validation, implementation constraints, or explicit user approval locks it.
66
60
 
67
- Record `designFlexibilityPolicy`: lock user goals, runtime constraints, accessibility, production readiness, forbidden patterns, and approved continuity; keep exact palette primitives, font families, radius/shadow values, component-kit theme mapping, signature move implementation, and literal anchor artifacts flexible until validated or approved. Semantic roles are required; exact primitives are not automatically locked. Required experience outcomes are separate from candidate implementation moves. Libraries supply behavior, accessibility, primitives, and delivery speed; the project supplies final composition, theme, morphology, and visual language.
61
+ Record `designFlexibilityPolicy`: lock user goals, runtime constraints, accessibility, production readiness, forbidden patterns, and approved continuity; keep exact palette primitives, font families, radius/shadow values, component-kit theme mapping, signature move implementation, literal anchor artifacts, and spatial metaphors flexible until validated or approved. Semantic roles are required; exact primitives are not automatically locked. Required experience outcomes are separate from candidate implementation moves. Libraries supply behavior, accessibility, primitives, and delivery speed; the project supplies final composition, theme, morphology, and visual language.
62
+ ## External Inspiration Boundary
63
+ Using outside websites, benchmark apps, galleries, or component examples is useful for constraint discovery, interaction mechanics, and implementation options, but never as a style source to imitate. Extract why a pattern works, then translate it into a current-project rule. Do not copy layout rhythm, palette, component skin, visual metaphor, or brand posture from a reference unless the user explicitly approves that continuity and it passes product fit.
68
64
 
69
65
  ## AI Color and Template Residue Audit
70
66
  AI color drift happens when a palette uses safe defaults before product meaning.
@@ -108,8 +104,12 @@ If web search is unavailable:
108
104
  - Use native CSS, browser APIs, or already-present dependencies.
109
105
  - Set `libraryResearchStatus` to `pending-verification`.
110
106
 
111
- Treat unresearched dependency choices as review findings. Dynamic UI Foundation Selection: do not default to shadcn/ui, Tailwind-only, native-only, or any component kit because it is familiar. Choose the foundation from product type, interaction complexity, accessibility needs, design ambition, team/runtime constraints, bundle/runtime cost, and current official docs.
107
+ Treat unresearched dependency choices as review findings. Dynamic UI Foundation Selection: do not default to shadcn/ui, Tailwind-only, native-only, or any component kit because it is familiar, and do not avoid them because a guardrail exists. Choose the foundation from product type, interaction complexity, accessibility needs, design ambition, team/runtime constraints, bundle/runtime cost, and current official docs.
112
108
  Ready-made primitives are allowed when they improve behavior, accessibility, speed, or maintainability. The library supplies mechanics; the project supplies visual language. Reject default component-kit styling without product rationale, but do not reject a modern lightweight library solely because a dependency was needed.
109
+
110
+ Tailwind-first is valid only as an implementation fit, not as ideology or anti-ideology. Use Tailwind utilities and CSS-first tokens when they fit the chosen stack and team, but do not make pure Tailwind, vanilla CSS, shadcn/ui, or any component kit the default answer when product evidence points to stronger primitives, charts, motion, gestures, canvas, or framework tooling.
111
+
112
+ For fresh projects, prefer official framework scaffolders or setup commands when current official docs show they create the supported project shape. Manual from-scratch file assembly is acceptable for tiny prototypes, educational exercises, repo-specific constraints, or when official scaffolders cannot satisfy the approved architecture; document that reason.
113
113
  ## Zero-Based Redesign Protocol
114
114
 
115
115
  When the user says "redesign from zero", "redesain dari 0", "ulang dari 0", or "research ulang":
@@ -10,12 +10,13 @@ When a new project is created or initialized, the agent must automatically:
10
10
  3. Review dynamic runtime signals from [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), repository evidence, task constraints, and live official documentation when runtime or ecosystem facts matter.
11
11
  4. If Docker or Compose is in scope, load [docker-runtime.md](../rules/docker-runtime.md) and verify the latest official Docker guidance before authoring container assets. Materialize the selected development/production assets rather than stopping at prose.
12
12
  5. For unresolved framework or package setup, recommend the latest stable compatible dependency set and official framework setup flow from live official documentation before coding unless a documented compatibility constraint blocks it.
13
+ 6. Do not default fresh web projects to Next.js, Tailwind-only styling, shadcn/ui, Vite, or any framework by habit, and do not avoid them because of this guard when they are the strongest fit. Treat explicit user constraints as constraints; otherwise compare project needs, runtime boundaries, hosting, data flow, team workflow, and official setup guidance before recommending.
13
14
 
14
15
  ## Required Planning Mode
15
16
 
16
17
  If the user describes a project or feature, the agent must:
17
18
  1. Clarify the delivery goals, runtime assumptions, constraints, and must-have capabilities before choosing implementation shape.
18
- 2. If the user already named a stack or framework, treat it as an explicit constraint. If not, produce a short evidence-backed recommendation from the brief, repo evidence, and live official documentation before coding.
19
+ 2. If the user already named a stack or framework, treat it as an explicit constraint. If not, produce a short evidence-backed recommendation from the brief, repo evidence, and live official documentation before coding. Include at least one plausible alternative when the default-looking option is Next.js, Tailwind-only styling, shadcn/ui, or another familiar web stack.
19
20
  3. For existing projects, inspect real files first. Do not derive product name, description, runtime, architecture, or design direction from the folder name alone.
20
21
  4. Draft a high-level structure plan plus the docs/bootstrap artifacts that must exist before coding.
21
22
  5. Wait for user approval before scaffolding the project.
@@ -25,12 +26,14 @@ If the user describes a project or feature, the agent must:
25
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.
26
27
 
27
28
  The agent must:
28
- 1. Materialize or refine required project docs before implementation: root `README.md` for every fresh or existing project; `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` plus `docs/design-intent.json` for UI scope.
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` plus `docs/design-intent.json` for UI scope.
29
30
  2. Write formal project docs in English by default unless the user explicitly asks for another documentation language.
30
- 3. 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.
31
- 4. Keep documentation alive. When project behavior, setup, architecture, public contracts, data shape, deployment, or UI scope changes, update the matching docs in the same change.
32
- 5. Avoid documentation sprawl. Add a new docs file only when the topic is stable, long enough to outgrow the README or core docs, or owned by a separate workflow such as hardware setup, deployment, troubleshooting, or testing validation.
33
- 6. Stop after docs when the user only asked for docs. Do not write application, firmware, or UI code until the user explicitly asks for implementation or approves the implementation plan.
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
+ 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.
33
+ 5. Keep documentation alive. When project behavior, setup, architecture, public contracts, data shape, deployment, or UI scope changes, update the matching docs in the same change.
34
+ 6. Avoid documentation sprawl. Add a new docs file only when the topic is stable, long enough to outgrow the README or core docs, or owned by a separate workflow such as hardware setup, deployment, troubleshooting, or testing validation.
35
+ 7. Add PRD, SRS, technical-design, or separate ERD only when evidence triggers them. Use PRD for product roadmap/user-story ownership, SRS for contractual or multi-stakeholder acceptance criteria, technical-design for non-trivial architecture decisions, and a separate ERD only when `docs/database-schema.md` cannot stay readable with an embedded diagram.
36
+ 8. Stop after docs when the user only asked for docs. Do not write application, firmware, or UI code until the user explicitly asks for implementation or approves the implementation plan.
34
37
 
35
38
  ## Direct Constraint Mode
36
39
 
@@ -45,6 +48,7 @@ If the user specifies a framework, runtime, or architecture constraint, the agen
45
48
  - Every module must follow [architecture.md](../rules/architecture.md).
46
49
  - Every dependency must be justified per [efficiency-vs-hype.md](../rules/efficiency-vs-hype.md).
47
50
  - Use official framework setup commands or canonical starter flows when they produce newer, better-supported dependency defaults than manual package assembly.
51
+ - 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.
48
52
  - 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.
49
53
 
50
54
  ## Runtime and Architecture Reference
@@ -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/architecture-decision-record.md` is missing, or for UI scope if `docs/DESIGN.md` or `docs/design-intent.json` is missing.
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/architecture-decision-record.md` is missing, or for UI scope if `docs/DESIGN.md` or `docs/design-intent.json` 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.
@@ -11,7 +11,7 @@ Before reviewing:
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
13
  5. For UI changes, load .agent-context/prompts/bootstrap-design.md, .agent-context/rules/frontend-architecture.md, docs/DESIGN.md, and docs/design-intent.json when present.
14
- 6. Enforce Universal SOP hard gate: block coding flow when required project docs are missing (root `README.md`; `docs/architecture-decision-record.md`; and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).
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/architecture-decision-record.md`; and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).
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:
@@ -61,6 +61,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
61
61
  - [ ] Scope applied: This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations
62
62
  - [ ] Style scope review is advisory and does not block merge when API docs are synced in the same commit and contract details are correct
63
63
  - [ ] Required docs exist before implementation: public and developer root README; project brief; architecture decision; flow overview; API/public contract when relevant; data model when relevant; and UI design contract when relevant.
64
+ - [ ] `docs/doc-index.md` exists whenever `docs/` exists and acts as a compact read-routing map instead of duplicating requirements or architecture.
64
65
  - [ ] For docs-only or docs-first requests, implementation code was not changed unless the user explicitly asked for it or approved an implementation plan.
65
66
  - [ ] Formal project docs use English by default unless the user requested another language or existing docs established one.
66
67
  - [ ] Docs cover feature plan, architecture rationale, public contracts, data model, UI/design, security assumptions, testing strategy, delivery flow, and next validation actions where relevant.
@@ -73,6 +74,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
73
74
  - [ ] Root README is public and developer friendly, even for private projects, and does not contain secrets, internal agent notes, private reasoning, or governance policy dumps.
74
75
  - [ ] Documentation grows with the project: README and matching docs were updated when setup, runtime, architecture, public contracts, data shape, deployment, validation, or UI scope changed.
75
76
  - [ ] Documentation file count stayed intentional: new docs files were added only for stable, distinct, or long workflows.
77
+ - [ ] PRD, SRS, technical-design, or separate ERD files were added only when project evidence justified a distinct document.
76
78
 
77
79
  ## 7. UI And Accessibility
78
80
 
@@ -120,6 +122,7 @@ Run this before declaring a task done. Apply only the sections relevant to the c
120
122
  - [ ] Security and testing requirements remain mandatory after static template purge.
121
123
  - [ ] Coding flow is blocked if `docs/architecture-decision-record.md` (or `docs/Architecture-Decision-Record.md`) is missing
122
124
  - [ ] Coding flow is blocked if root `README.md` is missing
125
+ - [ ] Coding flow is blocked if `docs/doc-index.md` is missing while `docs/` exists
123
126
  - [ ] UI implementation flow is blocked if `docs/DESIGN.md` or `docs/design-intent.json` is missing
124
127
 
125
128
  ## Verdict
@@ -18,8 +18,12 @@ Choose README sections from project evidence. Do not force a fixed template when
18
18
 
19
19
  Documentation must evolve with the project. When behavior, setup, architecture, public contracts, data shape, deployment, or validation changes, update README and the matching docs in the same change.
20
20
 
21
+ When `docs/` exists, keep `docs/doc-index.md` as the compact routing map for humans and agents. It should list active docs, their purpose, read triggers, status, and last update. It must not duplicate requirements, architecture, or API contracts.
22
+
21
23
  Start compact, then split only when a topic earns its own file. Good split signals are: the section is long, the workflow is owned separately, the content is referenced often, or the topic needs step-by-step care such as hardware setup, deployment, testing validation, operations, or troubleshooting.
22
24
 
25
+ Use PRD, SRS, technical design, and ERD as conditional docs, not default boilerplate. PRD covers product intent and roadmap ownership. SRS covers contractual or complex acceptance criteria. Technical design covers architecture under pressure. ERD stays inside `docs/database-schema.md` unless the data model is large or relationship-heavy.
26
+
23
27
  ## Contract Rules
24
28
 
25
29
  - Document the public surface before or alongside implementation.
@@ -33,6 +33,7 @@ The `.agent-context/rules/` directory is the default guidance source for impleme
33
33
  - Security and testing are non-negotiable baseline requirements.
34
34
  - Hard block before coding:
35
35
  - Root `README.md` must exist for every fresh or existing project and read as a public and developer entrypoint, not an internal agent note.
36
+ - `docs/doc-index.md` must exist whenever `docs/` exists. It is a compact read-routing map, not a replacement for project docs.
36
37
  - `docs/project-brief.md` must exist.
37
38
  - `docs/architecture-decision-record.md` (alias: `docs/Architecture-Decision-Record.md`) must exist.
38
39
  - `docs/flow-overview.md` must exist.
@@ -47,6 +48,19 @@ The `.agent-context/rules/` directory is the default guidance source for impleme
47
48
  - Keep docs current with project changes. Update README and the matching docs whenever setup, runtime, architecture, public contracts, data shape, UI scope, deployment, or validation flow changes.
48
49
  - Control docs file count. Keep the baseline compact, then add topic files only when a subject is stable, too long for README/core docs, or belongs to a distinct workflow such as hardware setup, deployment, testing validation, operations, or troubleshooting.
49
50
 
51
+ ## Documentation Read Routing and Conditional Specs
52
+
53
+ Use `README.md` for human orientation, then use `docs/doc-index.md` to choose the smallest relevant read set. Do not broad-read every Markdown file in `docs/` by default.
54
+
55
+ - Read `docs/project-brief.md`, `docs/architecture-decision-record.md`, and `docs/flow-overview.md` for broad planning, new features, or architecture changes.
56
+ - Read `docs/api-contract.md` only when API, CLI, firmware endpoint, web flow, event, or library contract behavior is in scope.
57
+ - Read `docs/database-schema.md` only when persistence, migrations, data shape, or query behavior is in scope.
58
+ - Read `docs/DESIGN.md` and `docs/design-intent.json` only for UI, UX, frontend, layout, component, or visual work.
59
+ - Add `docs/prd.md` only when there is product-roadmap, user-story, metrics, product-owner, or feature-flag ownership that would otherwise bloat the project brief.
60
+ - Add `docs/srs.md` only for contractual, regulated, multi-stakeholder, or acceptance-criteria-heavy projects. Do not create both PRD and SRS unless those owners and purposes are distinct.
61
+ - Add `docs/technical-design.md` only for non-trivial architecture decisions, major refactors, cross-cutting behavior, or system interactions that outgrow the ADR and flow overview.
62
+ - Keep ERD inside `docs/database-schema.md` for small and medium schemas. Add a separate ERD file only when relationship complexity makes the schema doc hard to scan.
63
+
50
64
  ## Rules as Guardian (Cross-Session Consistency)
51
65
 
52
66
  - Session handoff must include active architecture contract summary.
@@ -12,6 +12,7 @@ Before adding or recommending a dependency:
12
12
  - check current official docs, release notes, and setup guidance when the ecosystem decision matters
13
13
  - choose the latest stable compatible dependency version unless a project constraint blocks it
14
14
  - use the official scaffolder or setup command when it creates the current supported project shape
15
+ - do not hand-assemble fresh framework projects by habit when the official setup flow gives safer current defaults; document the reason when manual assembly is better
15
16
  - Only step down to an older dependency version after documenting the exact compatibility, runtime, platform, or ecosystem reason.
16
17
  - explain why the dependency is a better tradeoff than local implementation for the current task
17
18
  - avoid packages that are stale, thinly maintained, too heavy for the job, or added only because they are popular
@@ -19,3 +20,5 @@ Before adding or recommending a dependency:
19
20
  - do not reject a dependency only because it adds a package; reject it only when the project-fit, security, maintenance, compatibility, bundle/runtime, or ownership tradeoff is worse than the alternative
20
21
 
21
22
  Reject offline dependency decisions, outdated tutorial versions, trend choices, dependency avoidance choices, and performance-fear choices that are not grounded in the current repo, brief, and delivery tradeoffs.
23
+
24
+ Reject framework autopilot, not frameworks. Next.js, Vite, Astro, React Router, SvelteKit, Laravel, plain HTML, and other runtimes are candidates, not defaults or forbidden choices. If the user did not constrain the stack, compare at least the strongest fit and one plausible alternative before implementation, then choose the technology that removes bottlenecks for this project.
@@ -13,7 +13,8 @@ Use this rule for UI, UX, page, screen, component, layout, landing, dashboard, f
13
13
  - Treat `README.md` as public and developer overview, setup, usage, and user-facing context only when design or architecture rules conflict.
14
14
  - Do not choose final style, framework, palette, typography, layout paradigm, or animation library offline.
15
15
  - Research current official docs before adding a new UI, animation, scroll, 3D, canvas, charting, icon, styling, or primitive library.
16
- - Dynamic UI Foundation: do not hardcode shadcn/ui, Tailwind-only, native-only, or any component library as the universal answer. Modern lightweight primitives, motion libraries, canvas/WebGL helpers, charting libraries, and styling tools are valid when product evidence, accessibility, interaction quality, maintainability, delivery speed, runtime constraints, and official docs support them.
16
+ - Dynamic UI Foundation: do not hardcode shadcn/ui, Tailwind-only, native-only, or any component library as the universal answer, and do not avoid them out of guardrail fear when they fit. Tailwind-first is valid when the stack, token model, and team workflow support it; pure Tailwind, vanilla CSS, shadcn/ui, or any kit is not neutral by itself. Modern primitives, motion/canvas/WebGL helpers, charting libraries, and styling tools are valid when product evidence, accessibility, runtime constraints, and official docs support them.
17
+ - For fresh projects, prefer official framework scaffolders or setup commands when official docs show they produce the current supported shape. Build files manually only when approved architecture, repo constraints, or learning/prototype scope makes that better.
17
18
  - Keep design continuity opt-in. Repo evidence outranks memory residue.
18
19
 
19
20
  ## Required Design Contract
@@ -54,6 +55,7 @@ If the user gives no current-task visual research or reference:
54
55
  - Do not count old UI, existing design docs, or scaffold seeds as research.
55
56
  - Choose one high-variance non-software conceptual anchor before UI code.
56
57
  - Internally reject the safest dashboard, portal, card-grid, admin-shell, or minimalist-web-app mental model.
58
+ - Do not let the fallback anchor become a generic place metaphor. Avoid room, darkroom, counting room, control room, war room, studio, lab, cockpit, and command center unless the product actually depends on that place model; prefer product-specific artifacts, workflows, custody chains, instruments, data behaviors, material systems, editorial systems, service rituals, or interaction mechanisms over "where the UI lives".
57
59
  - Record one real-world anchor reference, one signature motion behavior, and one typographic decision with role contrast.
58
60
  - Derive typography, spacing, morphology, motion, and responsive recomposition from that anchor.
59
61
  - Translate the anchor into workflow, hierarchy, density, typography, state behavior, and interaction before using literal artifacts. Do not turn anchor artifacts into required chrome, wallpaper, decorative props, or component-kit theme objects without a named product function.
@@ -71,7 +73,7 @@ If the user gives no current-task visual research or reference:
71
73
  - For new screens or broad redesigns, research the expressive implementation path instead of defaulting to static native CSS. Use native or already-installed tools only when they can still deliver the chosen ambition, or when a concrete blocker is documented. Do not downshift because adding a package feels inconvenient; downshift only for a concrete product-fit, accessibility, security, compatibility, device, maintenance, or measured performance reason.
72
74
  - Keep reduced-motion, keyboard, loading, performance, mobile, and non-3D fallbacks explicit.
73
75
  - Use component kits or headless primitives for behavior and accessibility when they fit. Replace library-default visual language with project-specific composition, tokens, motion, state treatment, and morphology.
74
- - Keep design-intent flexible: lock user goals, accessibility, production readiness, forbidden patterns, and approved continuity; keep exact palette primitives, font families, radius/shadow values, component skins, and candidate signature moves flexible until evidence or approval locks them.
76
+ - Keep design-intent flexible: lock user goals, accessibility, production readiness, forbidden patterns, and approved continuity; keep exact palette primitives, font families, radius/shadow values, component skins, candidate signature moves, and external website inspiration flexible until evidence or approval locks them. Convert references into product-fit rules; do not copy layout, palette, component skin, brand posture, or visual metaphor.
75
77
  ## Zero-Based Redesign
76
78
 
77
79
  If the user asks for a redesign from zero:
@@ -7,7 +7,7 @@ alwaysApply: true
7
7
 
8
8
  Adapter Mode: thin
9
9
  Adapter Source: .instructions.md
10
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
10
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
11
11
 
12
12
  This repository is governed by a strict instruction contract.
13
13
  Use [.instructions.md](../../.instructions.md) as the canonical policy source.
package/.cursorrules CHANGED
@@ -1,6 +1,6 @@
1
1
  # .cursorrules - Legacy Thin Adapter
2
2
 
3
- Generated by Agentic-Senior-Core CLI v3.0.45
3
+ Generated by Agentic-Senior-Core CLI v3.0.47
4
4
  Adapter Mode: legacy-thin
5
5
  Adapter Source: .agent-instructions.md when present; fallback .instructions.md
6
6
  Canonical baseline: .instructions.md
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
5
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
6
6
 
7
7
  This repository is governed by a strict instruction contract.
8
8
  Use [.instructions.md](../.instructions.md) as the canonical policy source.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
5
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
6
6
 
7
7
  This repository is governed by a strict instruction contract.
8
8
  Use [.instructions.md](../.instructions.md) as the canonical policy source.
@@ -6,7 +6,7 @@ applyTo: "**"
6
6
 
7
7
  Adapter Mode: thin
8
8
  Adapter Source: .instructions.md
9
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
9
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
10
10
 
11
11
  This repository is governed by a strict instruction contract.
12
12
  Use [.instructions.md](../../.instructions.md) as the canonical policy source.
package/.instructions.md CHANGED
@@ -44,7 +44,7 @@ Load only relevant rule files. Do not read the entire rule directory by default.
44
44
 
45
45
  Available rules: `naming-conv.md`, `architecture.md`, `security.md`, `performance.md`, `error-handling.md`, `testing.md`, `git-workflow.md`, `efficiency-vs-hype.md`, `api-docs.md`, `microservices.md`, `event-driven.md`, `database-design.md`, `realtime.md`, `frontend-architecture.md`, `docker-runtime.md`.
46
46
 
47
- For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. For framework or package setup work, use the latest stable compatible dependency set and official setup flow unless a documented compatibility constraint blocks it. 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.
47
+ For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets. 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; manual file assembly needs a repo, prototype, learning, or architecture reason. 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.
48
48
 
49
49
  Backend/API routing:
50
50
  - Data/schema/persistence: `architecture.md`, `database-design.md`, `performance.md`, `testing.md`.
@@ -59,13 +59,13 @@ Use the union once when scopes overlap. Do not create framework-specific governa
59
59
 
60
60
  Runtime Decision Signals come from project context, repo evidence, and live research. Runtime signals are evidence gates, not style cues or popularity rankings.
61
61
 
62
- For fresh projects, recommend runtime/framework from the brief, constraints, and live official docs before coding. For existing projects, treat detected markers as evidence only. Ignore pattern frequency, external rankings, and remembered defaults.
62
+ For fresh projects, recommend runtime/framework from the brief, constraints, and live official docs before coding. For existing projects, treat detected markers as evidence only. Ignore pattern frequency, external rankings, and remembered defaults. Do not default web projects to Next.js, Tailwind-only styling, shadcn/ui, Vite, or any familiar web stack by habit, and do not avoid them because of this guard when they are the strongest project fit.
63
63
 
64
64
  ### Layer 3: Structural Planning Signals
65
65
 
66
66
  Structural Planning Signals use dynamic structural planning from repo context, docs, runtime constraints, and live research. Structural planning signals are not a hard whitelist.
67
67
 
68
- For new projects or modules, extract constraints, boundaries, and required docs first. Do not silently choose frameworks or architecture from offline heuristics. If runtime or architecture is unresolved, produce a short recommendation from evidence and live official documentation before coding.
68
+ For new projects or modules, extract constraints, boundaries, and required docs first. Do not silently choose frameworks or architecture from offline heuristics. If runtime or architecture is unresolved, produce a short recommendation from evidence and live official documentation before coding. Compare at least one plausible alternative when the strongest-looking option is a familiar web default and the user did not explicitly choose it.
69
69
 
70
70
  ### Layer 4: Execution Contracts
71
71
 
@@ -97,7 +97,7 @@ Use `.agent-context/policies/` for quality gates, release thresholds, and audit
97
97
 
98
98
  ### Layer 9: Project Context
99
99
 
100
- Use root `README.md` as the public and developer entrypoint for every fresh or existing project. Use `docs/` when present: `project-brief.md`, `architecture-decision-record.md`, `database-schema.md`, `api-contract.md`, `flow-overview.md`, `DESIGN.md`, `design-intent.json`.
100
+ Use root `README.md` as the public and developer entrypoint for every fresh or existing project. Use `docs/doc-index.md` as the compact routing map when `docs/` exists. Use `docs/` when present: `project-brief.md`, `architecture-decision-record.md`, `database-schema.md`, `api-contract.md`, `flow-overview.md`, `DESIGN.md`, `design-intent.json`.
101
101
 
102
102
  ## Mandatory Triggers
103
103
 
@@ -106,9 +106,10 @@ Use root `README.md` as the public and developer entrypoint for every fresh or e
106
106
  Trigger: docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, API docs, or "lengkapkan docs".
107
107
 
108
108
  1. Load `architecture.md`, `api-docs.md`, and only additional rules required by scope.
109
- 2. Create or refine required docs first: root `README.md` for every fresh or existing project; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/api-contract.md` for APIs, firmware endpoints, CLI commands, or web application flows; `docs/database-schema.md` for persistent data; and `docs/DESIGN.md` plus `docs/design-intent.json` for UI scope.
110
- 3. Write formal project docs in English by default unless the user asks otherwise.
111
- 4. Stop after documentation when the user only asked for docs. Do not write application, firmware, or UI code until the user asks or approves implementation.
109
+ 2. Create or refine required docs first: 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` for APIs, firmware endpoints, CLI commands, or web application flows; `docs/database-schema.md` for persistent data; and `docs/DESIGN.md` plus `docs/design-intent.json` for UI scope.
110
+ 3. Use `docs/doc-index.md` as the compact read-routing map. Add PRD, SRS, technical-design, or separate ERD only when project evidence justifies them.
111
+ 4. Write formal project docs in English by default unless the user asks otherwise.
112
+ 5. Stop after documentation when the user only asked for docs. Do not write application, firmware, or UI code until the user asks or approves implementation.
112
113
 
113
114
  ### 2. New Project Planning
114
115
 
@@ -148,6 +149,8 @@ Trigger: ui, ux, layout, screen, tailwind, frontend, redesign.
148
149
  6. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation.
149
150
  7. Keep context isolated; do not eagerly load unrelated backend-only rules.
150
151
  8. In UI Design Mode, choose the ambition level proactively. For broad screens or redesigns, treat expressive motion, spatial hierarchy, distinctive composition, and product-specific interaction as the baseline even when the user did not say "rich"; quiet or static surfaces require a concrete product, performance, accessibility, device, or dependency reason.
152
+ 9. Do not let conceptual anchors collapse into room, darkroom, counting room, control room, war room, studio, lab, cockpit, or command center by habit. Prefer artifacts, workflows, custody chains, instruments, data behaviors, material systems, editorial systems, service rituals, or interaction mechanisms unless a physical place model is core to the product.
153
+ 10. External websites and benchmark examples are candidate evidence for constraints, mechanics, and quality bars only. Do not copy their layout rhythm, palette, component skin, visual metaphor, or brand posture without explicit user approval and product-fit rationale.
151
154
 
152
155
  ## Reasoning Chain
153
156
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
5
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
6
6
 
7
7
  This repository is governed by a strict instruction contract.
8
8
  Use [.instructions.md](../../.instructions.md) as the canonical policy source.
package/.windsurfrules CHANGED
@@ -1,6 +1,6 @@
1
1
  # .windsurfrules - Legacy Thin Adapter
2
2
 
3
- Generated by Agentic-Senior-Core CLI v3.0.45
3
+ Generated by Agentic-Senior-Core CLI v3.0.47
4
4
  Adapter Mode: legacy-thin
5
5
  Adapter Source: .agent-instructions.md when present; fallback .instructions.md
6
6
  Canonical baseline: .instructions.md
package/AGENTS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
5
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
6
6
 
7
7
  This repository is governed by a strict instruction contract.
8
8
  Use [.instructions.md](.instructions.md) as the canonical policy source.
package/CLAUDE.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
5
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
6
6
 
7
7
  This repository is governed by a strict instruction contract.
8
8
  Use [.instructions.md](.instructions.md) as the canonical policy source.
package/GEMINI.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: a64819c73c12f55405e4e6249b352fbdb8b94847bc43279e8bf43e07ef5357f3
5
+ Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
6
6
 
7
7
  This repository is governed by a strict instruction contract.
8
8
  Use [.instructions.md](.instructions.md) as the canonical policy source.
package/README.md CHANGED
@@ -34,6 +34,8 @@ One command to initialize rules, checklists, thin discovery adapters, and a comp
34
34
  > **See [docs/deep-dive.md](docs/deep-dive.md) and [docs/roadmap.md](docs/roadmap.md) for advanced configuration, planning mode, snapshot, and realtime options.**
35
35
 
36
36
  - This command writes `.agent-context/state/v3-purge-audit.json` and reports whether static directory deletion is safe.
37
+ - When project docs are scaffolded, `docs/doc-index.md` is used as the compact map for deeper docs so agents can read the right files without scanning every Markdown file.
38
+ - Local backup snapshots are written under `.agentic-backup/`; init and upgrade ensure that folder is ignored by the target repository.
37
39
  - Package scope is `@ryuenn3123`; the GitHub repository owner is `fatidaprilian`.
38
40
 
39
41
  ---
@@ -95,6 +97,8 @@ Use `--dry-run` first to preview changes safely, then apply with `--yes`.
95
97
  Upgrade now performs managed-surface synchronization by default: obsolete governance files under managed paths are pruned so the pack stays aligned with the latest release.
96
98
  Use `--no-prune` if you want to keep legacy managed files.
97
99
 
100
+ When upgrade creates `.agentic-backup/`, it also keeps the target root `.gitignore` aligned with that local-only backup folder. The backup is for rollback safety, not a source of truth and not a file to commit.
101
+
98
102
  ## Instruction Entrypoints
99
103
 
100
104
  The canonical source is `.instructions.md`.
@@ -4,6 +4,9 @@ import crypto from 'node:crypto';
4
4
  import { pathExists, ensureDirectory } from './utils.mjs';
5
5
  import { entryPointFiles, BACKUP_DIR_NAME } from './constants.mjs';
6
6
 
7
+ const BACKUP_GITIGNORE_ENTRY = `${BACKUP_DIR_NAME}/`;
8
+ const BACKUP_GITIGNORE_COMMENT = '# agentic-senior-core: local backup artifacts';
9
+
7
10
  /**
8
11
  * Calculates a SHA-256 hash of a file's contents.
9
12
  */
@@ -54,6 +57,7 @@ export async function createBackup(targetDirectoryPath) {
54
57
  await ensureDirectory(objectsDir);
55
58
 
56
59
  const pathsToTrack = [
60
+ path.join(targetDirectoryPath, '.gitignore'),
57
61
  ...entryPointFiles.map((entryPointFileName) => path.join(targetDirectoryPath, entryPointFileName)),
58
62
  path.join(targetDirectoryPath, '.agent-context'),
59
63
  ];
@@ -122,3 +126,36 @@ export async function createBackup(targetDirectoryPath) {
122
126
  durationMs: Date.now() - startTime
123
127
  };
124
128
  }
129
+
130
+ export async function ensureBackupGitignoreEntry(targetDirectoryPath) {
131
+ const gitignorePath = path.join(targetDirectoryPath, '.gitignore');
132
+ const existingContent = await pathExists(gitignorePath)
133
+ ? await fs.readFile(gitignorePath, 'utf8')
134
+ : '';
135
+ const existingLines = existingContent.split(/\r?\n/).map((line) => line.trim());
136
+
137
+ if (existingLines.includes(BACKUP_GITIGNORE_ENTRY) || existingLines.includes(BACKUP_DIR_NAME)) {
138
+ return {
139
+ status: 'unchanged',
140
+ gitignorePath,
141
+ entry: BACKUP_GITIGNORE_ENTRY,
142
+ };
143
+ }
144
+
145
+ let nextContent = existingContent;
146
+ if (nextContent.length > 0 && !nextContent.endsWith('\n')) {
147
+ nextContent += '\n';
148
+ }
149
+ if (nextContent.length > 0 && !nextContent.endsWith('\n\n')) {
150
+ nextContent += '\n';
151
+ }
152
+ nextContent += `${BACKUP_GITIGNORE_COMMENT}\n${BACKUP_GITIGNORE_ENTRY}\n`;
153
+
154
+ await fs.writeFile(gitignorePath, nextContent, 'utf8');
155
+
156
+ return {
157
+ status: existingContent ? 'updated' : 'created',
158
+ gitignorePath,
159
+ entry: BACKUP_GITIGNORE_ENTRY,
160
+ };
161
+ }
@@ -44,7 +44,7 @@ import {
44
44
  resolveDetectedSetupDecision,
45
45
  } from '../init-detection-flow.mjs';
46
46
  import { runPreflightChecks } from '../preflight.mjs';
47
- import { createBackup } from '../backup.mjs';
47
+ import { createBackup, ensureBackupGitignoreEntry } from '../backup.mjs';
48
48
  import {
49
49
  runProjectDiscovery,
50
50
  generateProjectDocumentation,
@@ -376,6 +376,10 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
376
376
  detectionTransparency.decision.selectedProjectScopeLabel = selectedProjectScopeLabel;
377
377
 
378
378
  await createBackup(resolvedTargetDirectoryPath);
379
+ const backupGitignoreResult = await ensureBackupGitignoreEntry(resolvedTargetDirectoryPath);
380
+ if (backupGitignoreResult.status !== 'unchanged') {
381
+ console.log(`Local backup artifacts ignored in .gitignore (${backupGitignoreResult.entry}).`);
382
+ }
379
383
 
380
384
  await copyGovernanceAssetsToTarget(resolvedTargetDirectoryPath, {
381
385
  includeMcpTemplate: shouldIncludeMcpTemplate,
@@ -41,7 +41,7 @@ import {
41
41
  } from '../compiler.mjs';
42
42
 
43
43
  import { runPreflightChecks } from '../preflight.mjs';
44
- import { createBackup } from '../backup.mjs';
44
+ import { createBackup, ensureBackupGitignoreEntry } from '../backup.mjs';
45
45
  import { performRollback } from '../rollback.mjs';
46
46
  import {
47
47
  detectProjectDocTemplateStaleness,
@@ -399,6 +399,10 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
399
399
  }
400
400
 
401
401
  await createBackup(resolvedTargetDirectoryPath);
402
+ const backupGitignoreResult = await ensureBackupGitignoreEntry(resolvedTargetDirectoryPath);
403
+ if (backupGitignoreResult.status !== 'unchanged') {
404
+ console.log(`Local backup artifacts ignored in .gitignore (${backupGitignoreResult.entry}).`);
405
+ }
402
406
 
403
407
  try {
404
408
  const governanceSyncResult = await copyGovernanceAssetsToTarget(resolvedTargetDirectoryPath, {
@@ -422,8 +422,10 @@ export async function buildCompiledRulesContent({
422
422
  '3. .agent-context/prompts/review-code.md -> review, audit, check, analyze',
423
423
  '4. .agent-context/prompts/bootstrap-design.md -> ui, ux, layout, screen, tailwind, frontend, redesign',
424
424
  'Documentation-first policy:',
425
- '- Create or refine required project docs before implementation: README.md for every fresh or existing project; 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 plus docs/design-intent.json for UI scope.',
425
+ '- Create or refine required project docs before implementation: 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 plus docs/design-intent.json for UI scope.',
426
426
  '- Keep README.md public and developer friendly, including for private projects: explain what the project is, who it is for, setup, usage, configuration, and links to deeper docs. Do not put secrets, internal agent notes, private reasoning, or governance policy dumps in it.',
427
+ '- Use docs/doc-index.md as the compact read-routing map before selecting deeper docs. Do not broad-read docs/*.md by default.',
428
+ '- Add PRD, SRS, technical-design, or separate ERD only when project evidence justifies them.',
427
429
  '- Keep docs complete but compact. Add extra docs files only for stable, distinct, or long workflows such as hardware setup, deployment, operations, testing validation, or troubleshooting.',
428
430
  '- Write formal project docs in English by default unless the user explicitly asks for another documentation language.',
429
431
  '- For docs-only/docs-first requests, do not write application, firmware, or UI code until the user asks or approves an implementation plan.',
@@ -546,14 +548,22 @@ export async function buildCompiledRulesContent({
546
548
 
547
549
  if (await pathExists(projectBriefPath)) {
548
550
  const hasRootReadme = await pathExists(path.join(resolvedTargetDirectoryPath, 'README.md'));
549
- const projectDocsEntries = ['project-brief.md'];
551
+ const projectDocsEntries = [];
550
552
  const candidateDocFileNames = [
553
+ 'doc-index.md',
554
+ 'project-brief.md',
551
555
  'architecture-decision-record.md',
556
+ 'technical-design.md',
557
+ 'prd.md',
558
+ 'srs.md',
552
559
  'database-schema.md',
560
+ 'erd.md',
553
561
  'api-contract.md',
554
562
  'flow-overview.md',
555
563
  'DESIGN.md',
556
564
  'design-intent.json',
565
+ 'runbook.md',
566
+ 'troubleshooting.md',
557
567
  ];
558
568
 
559
569
  for (const candidateFileName of candidateDocFileNames) {
@@ -573,6 +583,7 @@ export async function buildCompiledRulesContent({
573
583
  '',
574
584
  'Universal SOP hard block policy:',
575
585
  '- README.md must exist and read as a public and developer entrypoint.',
586
+ '- docs/doc-index.md must exist whenever docs/ exists and act as the compact read-routing map.',
576
587
  '- Stop implementation if docs/project-brief.md is missing.',
577
588
  '- Stop implementation if docs/architecture-decision-record.md (alias: docs/Architecture-Decision-Record.md) is missing.',
578
589
  '- Stop implementation if docs/flow-overview.md is missing.',
@@ -580,6 +591,8 @@ export async function buildCompiledRulesContent({
580
591
  '- If the product exposes API or web application flows, docs/api-contract.md must exist before coding continues.',
581
592
  '- For UI scope, stop implementation if docs/DESIGN.md or docs/design-intent.json is missing.',
582
593
  '- Keep README.md overview-level, public, and developer friendly; do not put secrets, internal agent notes, private reasoning, or governance policy dumps in it.',
594
+ '- Use README.md plus docs/doc-index.md to choose the smallest relevant read set before loading deeper docs.',
595
+ '- Add PRD, SRS, technical-design, or separate ERD only when project evidence justifies them.',
583
596
  '- Materialize missing docs first, then continue coding.',
584
597
  '- Bootstrap missing docs from real repo evidence and the latest user request. Do not write generic placeholder templates.',
585
598
  '- Separate confirmed facts from assumptions and end each major explanation with the next validation action.',
@@ -612,10 +625,12 @@ export async function buildCompiledRulesContent({
612
625
  '',
613
626
  'Bootstrap policy:',
614
627
  '- Create README.md as a public and developer entrypoint before coding continues.',
628
+ '- Create docs/doc-index.md as the compact read-routing map whenever docs/ exists.',
615
629
  '- Hard block: do not write application code until docs/project-brief.md and docs/architecture-decision-record.md exist.',
616
630
  '- docs/flow-overview.md must also exist before coding continues.',
617
631
  '- Add docs/database-schema.md when persistent data is involved.',
618
632
  '- Add docs/api-contract.md when API or web application flows are involved.',
633
+ '- Add PRD, SRS, technical-design, or separate ERD only when project evidence justifies them.',
619
634
  '- For docs-only/docs-first requests, stop after docs unless the user asks for implementation or approves an implementation plan.',
620
635
  '- If docs/project-brief.md is missing, execute bootstrap-project-context prompt immediately.',
621
636
  hasBootstrapDesignPrompt
@@ -6,6 +6,7 @@ export const PROJECT_DOC_FILE_NAMES = [
6
6
  'api-contract.md',
7
7
  'flow-overview.md',
8
8
  ];
9
+ export const DOC_INDEX_FILE_NAME = 'doc-index.md';
9
10
  export const UI_DESIGN_CONTRACT_FILE_NAMES = ['DESIGN.md', 'design-intent.json'];
10
11
 
11
12
  // Legacy project docs may still carry this version header; keep for upgrade staleness checks.
@@ -236,7 +236,8 @@ export function validateDesignIntentContract(designIntentContract) {
236
236
  !Array.isArray(conceptualAnchor.sourceDomains)
237
237
  || conceptualAnchor.sourceDomains.length < 4
238
238
  || !conceptualAnchor.sourceDomains.includes('complex-physical-engineering')
239
- || !conceptualAnchor.sourceDomains.includes('cinematic-spatial-interface')
239
+ || !conceptualAnchor.sourceDomains.includes('cinematic-behavior-and-transition-systems')
240
+ || !conceptualAnchor.sourceDomains.includes('workflow-and-custody-systems')
240
241
  || !conceptualAnchor.sourceDomains.includes('premium-interactive-web-experiences')
241
242
  ) {
242
243
  validationErrors.push('designIntent.conceptualAnchor.sourceDomains must list broad non-template anchor domains.');
@@ -29,6 +29,12 @@ const GENERICITY_DRIFT_SIGNALS = [
29
29
  'literal-anchor-artifacts-used-as-required-ui-chrome',
30
30
  'candidate-signature-move-treated-as-locked-implementation',
31
31
  'library-theme-tokens-drive-visual-language',
32
+ 'spatial-room-anchor-used-by-habit',
33
+ 'place-metaphor-used-as-layout-model-without-product-function',
34
+ 'external-website-reference-copied-as-style',
35
+ 'tailwind-only-or-component-kit-used-as-neutrality-claim',
36
+ 'framework-selected-by-familiarity-instead-of-evidence',
37
+ 'manual-framework-scaffold-used-when-official-setup-fits',
32
38
  ];
33
39
 
34
40
  const FORBIDDEN_PATTERN_SIGNALS = [
@@ -50,6 +56,9 @@ const VALID_BOLD_SIGNALS = [
50
56
  'headless-or-component-primitive-restyled-to-product-language',
51
57
  'responsive-recomposition-by-task-priority',
52
58
  'purposeful-motion-with-reduced-motion-path',
59
+ 'non-spatial-product-anchor-or-workflow-mechanism',
60
+ 'official-scaffolder-used-for-supported-project-shape',
61
+ 'framework-choice-compared-against-plausible-alternative',
53
62
  ];
54
63
 
55
64
  export function shouldBootstrapDesignDocument(discoveryAnswers, initContext) {
@@ -202,11 +211,14 @@ function buildDesignIntentContractObject({
202
211
  'component-kit-theme-mapping',
203
212
  'signature-move-implementation',
204
213
  'literal-anchor-artifacts',
214
+ 'spatial-metaphor-and-place-language',
205
215
  ],
206
216
  tokenLockingRule: 'Semantic roles are required, but exact primitive values stay flexible until repo evidence, accessibility validation, implementation constraints, or explicit user approval locks them.',
207
217
  signatureMovePolicy: 'Record the required experience outcome separately from candidate implementation moves; replace a candidate move when another move better fits the product.',
208
218
  libraryVisualLanguagePolicy: 'Libraries supply behavior, accessibility, primitives, and delivery speed; they must not dictate final composition, theme, morphology, or visual language.',
209
219
  literalAnchorPolicy: 'Translate anchors into workflow, hierarchy, density, typography, material behavior, state language, and interaction grammar before requiring literal props, marks, or chrome.',
220
+ spatialMetaphorPolicy: 'Do not default anchors to room, darkroom, counting room, control room, war room, studio, lab, cockpit, or command center. Use place metaphors only when the product truly depends on a physical place model.',
221
+ externalInspirationPolicy: 'External websites and examples are candidate evidence for constraints, mechanics, and quality bars; do not copy their layout rhythm, palette, component skin, brand posture, or visual metaphor.',
210
222
  },
211
223
  conceptualAnchor: {
212
224
  mode: 'required-when-no-external-research',
@@ -227,6 +239,8 @@ function buildDesignIntentContractObject({
227
239
  preferDistinctiveOverSafe: true,
228
240
  doNotRevealHiddenCandidateList: true,
229
241
  outputOnlyChosenAnchor: true,
242
+ avoidSpatialPlaceMetaphorByDefault: true,
243
+ preferMechanismOverPlace: true,
230
244
  },
231
245
  creativeCommitmentPolicy: {
232
246
  requiredBeforeComplianceReview: true,
@@ -246,12 +260,23 @@ function buildDesignIntentContractObject({
246
260
  'saas-shell',
247
261
  'minimalist-interface',
248
262
  'safe-admin-layout',
263
+ 'room',
264
+ 'darkroom',
265
+ 'counting-room',
266
+ 'control-room',
267
+ 'war-room',
268
+ 'studio',
269
+ 'lab',
270
+ 'cockpit',
271
+ 'command-center',
249
272
  ],
250
273
  sourceDomains: [
251
274
  'complex-physical-engineering',
252
- 'cinematic-spatial-interface',
275
+ 'cinematic-behavior-and-transition-systems',
253
276
  'experimental-editorial-structure',
254
277
  'scientific-instrumentation',
278
+ 'workflow-and-custody-systems',
279
+ 'material-artifacts-and-instruments',
255
280
  'premium-interactive-web-experiences',
256
281
  ],
257
282
  visualRiskBudget: {
@@ -266,6 +291,12 @@ function buildDesignIntentContractObject({
266
291
  allowedLiteralUse: 'Only use literal anchor artifacts when they serve a named product function, control, state, or task overlay.',
267
292
  forbiddenLiteralUse: 'Do not turn anchor artifacts into decorative wallpaper, required chrome, default texture, or unavoidable theme props.',
268
293
  },
294
+ spatialAutopilotPolicy: {
295
+ forbiddenHabitTerms: ['room', 'darkroom', 'counting-room', 'control-room', 'war-room', 'studio', 'lab', 'cockpit', 'command-center'],
296
+ allowedOnlyWhen: 'The product has a real physical place model, operational environment, or user workflow that depends on that place metaphor.',
297
+ replacementPreference: 'Use artifacts, custody flows, instruments, data behaviors, material systems, editorial systems, service rituals, or interaction mechanisms.',
298
+ reviewQuestion: 'Could this anchor still work if the word "room" was removed? If not, revise before UI code.',
299
+ },
269
300
  requiredDerivedAxes: [
270
301
  'typography',
271
302
  'morphology',
@@ -370,7 +401,9 @@ function buildDesignIntentContractObject({
370
401
  sourceUrl: null,
371
402
  stableVersion: null,
372
403
  fallbackIfUnavailable: 'Use native CSS, browser APIs, or existing dependencies.',
373
- selectionPolicy: 'Do not default to shadcn, native-only, Tailwind-only, or dependency avoidance by habit.',
404
+ selectionPolicy: 'Do not default to shadcn, native-only, Tailwind-only, or dependency avoidance by habit; do not avoid them out of guardrail fear when they fit.',
405
+ officialScaffolderPolicy: 'For fresh projects, prefer official setup commands when they create the supported project shape; manual assembly requires a documented repo, learning, prototype, or architecture reason.',
406
+ frameworkNeutralityPolicy: 'Next.js, Vite, Astro, React Router, SvelteKit, Laravel, and plain HTML are candidates, not defaults or forbidden choices. Compare at least one plausible alternative when no framework is user-constrained, then choose the technology that removes bottlenecks for this project.',
374
407
  },
375
408
  ],
376
409
  mathSystems: {
@@ -687,9 +720,12 @@ function buildDesignIntentContractObject({
687
720
  requireExplicitContinuityApproval: true,
688
721
  forbidCarryoverWhenUnapproved: true,
689
722
  approvedExternalConstraintUsage: 'Convert approved external constraints into current-project rules; do not imitate source surfaces.',
723
+ externalWebsiteReferencePolicy: 'Use outside websites for mechanics, constraints, and quality bar analysis only. Do not copy layout rhythm, palette, component skin, visual metaphor, or brand posture.',
690
724
  driftSignals: [
691
725
  'palette-reused-without-brief-support',
692
726
  'prior-ui-visual-dna-carried-into-reset-request',
727
+ 'room-or-control-room-anchor-repeated-without-product-need',
728
+ 'external-reference-copied-instead-of-translated',
693
729
  ],
694
730
  },
695
731
  forbiddenPatterns: [...FORBIDDEN_PATTERN_SIGNALS],
@@ -3,6 +3,7 @@ import fs from 'node:fs/promises';
3
3
  import { askChoice, askYesNo } from '../utils.mjs';
4
4
  import {
5
5
  ARCHITECTURE_STYLE_CHOICES,
6
+ DOC_INDEX_FILE_NAME,
6
7
  DOCKER_STRATEGY_CHOICES,
7
8
  SUPPORTED_DOC_LANGUAGES,
8
9
  } from './constants.mjs';
@@ -169,6 +170,7 @@ export function resolveProjectDocTargets(discoveryAnswers) {
169
170
  || discoveryAnswers.primaryDomain.toLowerCase().includes('fullstack');
170
171
 
171
172
  const requiredDocFileNames = [
173
+ DOC_INDEX_FILE_NAME,
172
174
  'project-brief.md',
173
175
  'architecture-decision-record.md',
174
176
  'flow-overview.md',
@@ -78,7 +78,9 @@ export function buildProjectContextBootstrapPrompt({
78
78
  '12. Treat topology as an agent decision unless the user explicitly constrained it. If monolith fits, explain why. If a service split fits, document the evidence and service boundary logic.',
79
79
  '13. Required docs coverage must include a public and developer README entrypoint, feature plan, architecture rationale, flow, public API or integration contracts when relevant, data model when relevant, UI/design when relevant, security assumptions, testing strategy, runtime/deployment notes, and next validation actions.',
80
80
  '14. README.md must be public and developer friendly, including for private projects: what it is, who it is for, setup, core workflow, configuration, and links to deeper docs. Do not include secrets, internal agent notes, private reasoning, or governance policy dumps.',
81
- '15. Keep docs complete but compact. Add extra docs files only for stable, distinct, or long workflows such as hardware setup, deployment, operations, testing validation, or troubleshooting.',
81
+ '15. docs/doc-index.md is the low-token routing map for docs/*. Keep it short, list each active doc, and explain when an agent should read it. Do not make it the source of truth for requirements or architecture.',
82
+ '16. Keep docs complete but compact. Add extra docs files only for stable, distinct, or long workflows such as hardware setup, deployment, operations, testing validation, or troubleshooting.',
83
+ '17. Add SRS, PRD, technical-design, or ERD docs only when project evidence triggers them. Use PRD for product-roadmap/user-story ownership, SRS for contractual or multi-stakeholder acceptance criteria, technical-design for non-trivial architecture decisions, and ERD only as a separate file when the schema is too complex for docs/database-schema.md.',
82
84
  '',
83
85
  '## Project Inputs',
84
86
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -105,10 +107,12 @@ export function buildProjectContextBootstrapPrompt({
105
107
  '## Required Execution',
106
108
  '1. Create all required docs files listed above with complete Markdown content.',
107
109
  '2. Make the docs adaptive to the real repo and prompt context. These are living references, not frozen templates.',
108
- '3. In docs/project-brief.md and docs/architecture-decision-record.md, include explicit sections for confirmed facts, assumptions to validate, and next validation actions whenever context is incomplete.',
109
- '4. Before implementation, use the docs to confirm stack, runtime, architecture, public contracts, data, validation, and delivery assumptions.',
110
- '5. Keep content original, specific to this project, and actionable for implementation.',
111
- '6. After writing docs, continue coding tasks using these docs as living project context.',
110
+ '3. In docs/doc-index.md, include a compact table with document path, purpose, reads-when triggers, status, and last-updated date.',
111
+ '4. In docs/project-brief.md and docs/architecture-decision-record.md, include explicit sections for confirmed facts, assumptions to validate, and next validation actions whenever context is incomplete.',
112
+ '5. Before implementation, use README.md plus docs/doc-index.md to select only the relevant docs for the current task instead of broad-reading docs/*.md.',
113
+ '6. Before implementation, use the docs to confirm stack, runtime, architecture, public contracts, data, validation, and delivery assumptions.',
114
+ '7. Keep content original, specific to this project, and actionable for implementation.',
115
+ '8. After writing docs, continue coding tasks using these docs as living project context.',
112
116
  '',
113
117
  ].join('\n');
114
118
  }
@@ -214,13 +218,17 @@ export function buildDesignBootstrapPrompt({
214
218
  '25. In Dynamic Avant-Garde mode, consider three high-variance anchors, discard the two safest or most predictable options, and output only the chosen anchor.',
215
219
  '26. Reject final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.',
216
220
  '27. Reject anchors described only as modern, clean, premium, expressive, minimal, or bold.',
221
+ '27a. Do not default anchors to room, darkroom, counting room, control room, war room, studio, lab, cockpit, or command center unless the product genuinely depends on that physical place model.',
222
+ '27b. Prefer artifacts, custody flows, instruments, data behaviors, material systems, editorial systems, service rituals, or interaction mechanisms over "where the interface lives".',
217
223
  '28. Set conceptualAnchor.anchorReference and make derivedTokenLogic.anchorReference match exactly.',
218
224
  '29. Fill derivedTokenLogic before code. If a token cannot trace to anchorReference, revise it.',
219
225
  '29a. Lock semantic roles before exact values. Do not freeze fonts, color primitives, radius, shadows, or component-kit theme treatment unless repo evidence, accessibility validation, implementation constraints, or explicit user approval requires it.',
220
226
  '30. Research current official docs before importing any new UI-related library.',
221
- '31. Do not default to shadcn/ui, Tailwind-only, native-only, or any component kit by habit; choose the UI foundation from product fit, accessibility, interaction quality, runtime constraints, and official docs.',
227
+ '31. Do not default to shadcn/ui, Tailwind-only, native-only, or any component kit by habit, and do not avoid them out of guardrail fear; choose the UI foundation from product fit, accessibility, interaction quality, runtime constraints, and official docs.',
222
228
  '32. If research is unavailable, set libraryResearchStatus to pending-verification and use native CSS, browser APIs, or existing dependencies only when they can preserve the intended ambition.',
223
229
  '33. Do not reject modern lightweight libraries solely because they add a dependency; package count or vague performance fear is not a blocker by itself.',
230
+ '33a. Tailwind-first is valid only when the stack, token model, and team workflow support it; pure Tailwind, vanilla CSS, shadcn/ui, or any component kit is not neutral by default and not forbidden by default.',
231
+ '33b. For fresh framework projects, prefer official setup commands when official docs show they create the supported project shape; manual file assembly requires a repo, prototype, learning, or architecture reason.',
224
232
  '34. Define reviewRubric and require genericity findings to name the actual drift signal.',
225
233
  '35. Separate taste from failure. Bold accessible work is valid.',
226
234
  '36. For zero-based redesign, create visualResetStrategy and reset composition, hierarchy, palette/typography, motion or interaction, and responsive information architecture.',
@@ -228,6 +236,7 @@ export function buildDesignBootstrapPrompt({
228
236
  '38. Do not make core user workflows terminal-only unless the product is explicitly a CLI, developer tool, or operational runbook.',
229
237
  '39. Separate required experience outcomes from candidate implementation moves. Candidate signature moves are proposals until product evidence, accessibility, or user approval makes them required.',
230
238
  '40. Translate conceptual anchors non-literally first. Do not turn anchor artifacts into required chrome, decorative props, wallpaper, or theme objects unless they serve a named product function.',
239
+ '41. Use external websites and benchmark examples as candidate evidence for constraints, mechanics, and quality bars only; do not copy layout rhythm, palette, component skin, visual metaphor, or brand posture.',
231
240
  '',
232
241
  '## Creative Ambition Floor',
233
242
  'Before implementation, the design contract must name one authored visual bet, one product-derived palette move, one signature motion/spatial/interaction behavior, and one morphology or composition choice that would not appear in a generic AI template.',
@@ -244,6 +253,7 @@ export function buildDesignBootstrapPrompt({
244
253
  'If web search is available, verify every new UI, animation, scroll, 3D, canvas, chart, icon, styling, or primitive library against current official docs and record source URL, fetched date, stable compatible version, purpose, risk, and fallback.',
245
254
  'If web search is unavailable or fails, set libraryResearchStatus to pending-verification, record LIBRARY_TO_VERIFY notes, and use native CSS, browser APIs, or already-present project dependencies only when they can preserve the intended ambition until verification is possible.',
246
255
  'Select UI foundations dynamically. Use ready-made primitives or component kits for mechanics when they fit, but replace library-default visual language with project-specific composition, tokens, motion, state treatment, and morphology.',
256
+ 'For fresh projects, compare the user-constrained or strongest-fit framework against at least one plausible alternative when no framework is explicitly selected. Do not let Next.js or any familiar web stack win by pattern frequency.',
247
257
  '',
248
258
  '## Project Inputs',
249
259
  `- Project name: ${discoveryAnswers.projectName}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.45",
3
+ "version": "3.0.47",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -196,6 +196,7 @@ export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
196
196
  snippets: [
197
197
  '### 1. Documentation-First Mode',
198
198
  'root `README.md` for every fresh or existing project',
199
+ 'docs/doc-index.md',
199
200
  'Stop after documentation when the user only asked for docs.',
200
201
  'Do not write application, firmware, or UI code',
201
202
  ],
@@ -205,6 +206,7 @@ export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
205
206
  snippets: [
206
207
  '## Universal SOP Baseline (Mandatory)',
207
208
  'Root `README.md` must exist for every fresh or existing project',
209
+ '`docs/doc-index.md` must exist whenever `docs/` exists',
208
210
  'Security and testing are non-negotiable baseline requirements.',
209
211
  'If required project context docs are missing, stop implementation and bootstrap docs before writing application code.',
210
212
  ],
@@ -214,6 +216,7 @@ export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
214
216
  snippets: [
215
217
  '## Documentation-First Requests',
216
218
  'root `README.md` for every fresh or existing project',
219
+ '`docs/doc-index.md` whenever `docs/` exists',
217
220
  'Stop after docs when the user only asked for docs.',
218
221
  'Write formal project docs in English by default',
219
222
  ],
@@ -230,19 +233,20 @@ export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
230
233
  {
231
234
  path: '.agent-context/prompts/review-code.md',
232
235
  snippets: [
233
- 'Enforce Universal SOP hard gate: block coding flow when required project docs are missing (root `README.md`; `docs/architecture-decision-record.md`; and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).',
236
+ '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/architecture-decision-record.md`; and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).',
234
237
  ],
235
238
  },
236
239
  {
237
240
  path: '.agent-context/prompts/refactor.md',
238
241
  snippets: [
239
- '6. Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing, if `docs/architecture-decision-record.md` is missing, or for UI scope if `docs/DESIGN.md` or `docs/design-intent.json` is missing.',
242
+ '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/architecture-decision-record.md` is missing, or for UI scope if `docs/DESIGN.md` or `docs/design-intent.json` is missing.',
240
243
  ],
241
244
  },
242
245
  {
243
246
  path: 'lib/cli/compiler.mjs',
244
247
  snippets: [
245
248
  'Universal SOP hard block policy:',
249
+ 'docs/doc-index.md whenever docs/ exists',
246
250
  'README.md must exist and read as a public and developer entrypoint',
247
251
  'Hard block: do not write application code until docs/project-brief.md and docs/architecture-decision-record.md exist.',
248
252
  'Documentation-first policy:',