@ryuenn3123/agentic-senior-core 3.0.13 → 3.0.15

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.
@@ -11,6 +11,7 @@ UI Design Mode is context-isolated by default:
11
11
  - Load [AGENTS.md](../../AGENTS.md), [frontend-architecture.md](../rules/frontend-architecture.md), this prompt, UI-relevant state files, current UI code, and existing design docs first.
12
12
  - Do not eagerly load backend-only rules such as [database-design.md](../rules/database-design.md), [docker-runtime.md](../rules/docker-runtime.md), or [microservices.md](../rules/microservices.md) unless the task explicitly crosses those boundaries.
13
13
  - Treat UI consistency, accessibility, and cross-viewport adaptation as first-class constraints, not cosmetic afterthoughts.
14
+ - Start the visual language from the current project context, not from prior website references or remembered layouts from earlier chats.
14
15
 
15
16
  The agent must:
16
17
  1. Read [AGENTS.md](../../AGENTS.md) for project context and team roles.
@@ -19,12 +20,15 @@ The agent must:
19
20
  4. When analyzing an existing UI codebase, inspect low-cost evidence such as hardcoded color density, prop-drilling candidates, and breakpoint chaos before declaring the current design direction healthy.
20
21
  5. If [docs/DESIGN.md](../../docs/DESIGN.md) or `docs/design-intent.json` already exists, check for drift and improve them instead of rewriting blindly.
21
22
  6. If context is incomplete, write explicit assumptions and reversible design bets instead of defaulting to generic SaaS output.
22
- 7. Explore multiple plausible design directions internally, then commit to one cohesive direction with clear rationale tied to the product context.
23
+ 7. Explore multiple plausible design directions internally, then commit to one cohesive direction with clear rationale tied to the product context and at least one memorable signature move.
23
24
  8. Treat any example structure or stylistic inspiration as non-normative. Use it only to judge depth and clarity, never to copy a visual language directly.
24
25
  9. All references to docs or rules must be clickable markdown links.
25
26
  10. Responsive work must adapt layout, navigation, density, and task order across viewports. Shrinking desktop layouts is not enough.
26
- 11. Motion is allowed when it improves feedback, continuity, or spatial understanding. Do not flatten everything into static screens, but do reject decorative motion with no product value.
27
+ 11. Motion can be bold, cinematic, or highly expressive when it improves memorability, hierarchy, feedback, or perceived product quality. Do not flatten everything into static screens. Optimize motion first, and only reject it when it harms clarity, accessibility, or runtime performance.
27
28
  12. Define how core components morph across interaction states and viewports. Component quality is not only visual styling; it includes behavior under hover, focus, active, loading, error, and constrained layouts.
29
+ 13. Do not reuse a color palette, component skin, or motion signature from prior chats, memories, or unrelated projects unless current repo evidence or the active brand brief explicitly asks for that continuity.
30
+ 14. Treat prior website memory, old portfolio styles, and remembered screenshots as tainted context unless the user explicitly asks to continue or evolve that specific visual system.
31
+ 15. Do not default to balanced card grids, soft startup gradients, safe centered heroes, or neutral dashboard chrome unless the product context explicitly justifies them.
28
32
 
29
33
  Required `docs/DESIGN.md` sections:
30
34
  1. Design Intent and Product Personality
@@ -66,6 +70,9 @@ Output:
66
70
  - `docs/design-intent.json` must also include `motionSystem` and `componentMorphology` so future UI work preserves state behavior and purposeful motion without collapsing into generic static output.
67
71
  - Color intent must be defined in a perceptual or relational color model first. Hex values may appear only as implementation derivatives.
68
72
  - The contract must encode viewport mutation rules, not just breakpoint names.
69
- - Motion guidance must preserve creativity: allow meaningful animation, define reduced-motion behavior, and keep choreography fast, intentional, and performant.
73
+ - Motion guidance must preserve creativity: allow meaningful animation, define reduced-motion behavior, and optimize choreography instead of suppressing it by default.
74
+ - Color direction must come from the current project context. Similarity to prior unrelated projects is drift unless the brief or repo evidence explicitly supports it.
75
+ - If no approved reference system exists, synthesize the design from zero using current product context, constraints, and content only.
76
+ - The resulting system should feel authored and recognizable in screenshots, not politely interchangeable with common template kits.
70
77
  - Use practical, modern, accessible language grounded in the project, not generic SaaS defaults or copycat brand systems.
71
78
  - Wait for user approval before generating Figma or code assets.
@@ -9,6 +9,8 @@ When a new project is created or initialized, the agent should automatically:
9
9
  1. Read [AGENTS.md](../../AGENTS.md) to understand available roles and knowledge base.
10
10
  2. Scan all files in [.agent-context/rules/](../rules/) for mandatory engineering standards.
11
11
  3. Review dynamic stack and architecture signals from [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [.agent-context/state/stack-research-snapshot.json](../state/stack-research-snapshot.json), available stack and blueprint sources, and task constraints.
12
+ 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. Prefer latest stable compatible images, dependencies, and Compose syntax first; only step down after documenting why.
13
+ 5. For framework or package setup, prefer the latest stable compatible dependency set and official framework setup flow first. Only pin older versions after documenting the exact compatibility reason.
12
14
 
13
15
  ## Architect Mode (Recommended)
14
16
  If the user describes a project or feature, the agent should:
@@ -32,6 +34,8 @@ If the user specifies a framework/blueprint, the agent should:
32
34
  - Every file must follow [naming conventions](../rules/naming-conv.md)
33
35
  - Every module must follow [architecture.md](../rules/architecture.md)
34
36
  - Every dependency must be justified per [efficiency-vs-hype.md](../rules/efficiency-vs-hype.md)
37
+ - Prefer official framework setup commands or canonical starter flows when they produce newer, better-supported dependency defaults than manual package assembly
38
+ - 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.
35
39
 
36
40
  ## Stacks & Blueprints Reference
37
41
  See [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [.cursorrules](../../.cursorrules), and [.windsurfrules](../../.windsurfrules) for the latest shipped stack and blueprint context.
@@ -2,10 +2,18 @@
2
2
 
3
3
  Use this rule when Docker is enabled in project context.
4
4
 
5
+ ## 0. Latest Official Docker Guidance First
6
+ - Before generating or changing Dockerfiles, Compose files, or container runbooks, verify the latest official Docker documentation first.
7
+ - Prefer official Docker sources such as [Docker Compose Quickstart](https://docs.docker.com/compose/gettingstarted/), [Compose file reference](https://docs.docker.com/reference/compose-file/), and [Dockerfile best practices](https://docs.docker.com/build/building/best-practices/).
8
+ - Prefer current `docker compose` workflows and `compose.yaml`. Do not default to legacy `docker-compose` commands or stale file naming unless backward compatibility is a stated project requirement.
9
+ - Do not add the top-level Compose `version` field by default. The current Compose reference treats it as obsolete. Use it only when a compatibility requirement is explicit and documented.
10
+ - Prefer the latest stable compatible Docker base image, package-manager flow, and Compose syntax first. If the latest compatible path fails, step down intentionally and document the exact reason for the fallback.
11
+
5
12
  ## 1. Dynamic Generation Only
6
13
  - Do not copy generic Docker templates blindly.
7
14
  - Generate Docker assets based on actual stack, package manager, and runtime dependencies in the repository.
8
15
  - Re-evaluate Docker instructions when dependencies, build tools, or runtime assumptions change.
16
+ - Prefer the latest stable compatible dependency line first. If an older dependency or base image must be pinned, explain the runtime or compatibility constraint that forced it.
9
17
 
10
18
  ## 2. Separate Development and Production Lanes
11
19
  - Development lane and production lane are separate concerns.
@@ -17,13 +25,17 @@ Use this rule when Docker is enabled in project context.
17
25
  - Use multi-stage builds for production images when possible.
18
26
  - Avoid baking secrets into image layers.
19
27
  - Keep runtime image free from build-only tooling.
28
+ - Prefer fresh base-image validation with `docker build --pull` and use `--no-cache` when a clean dependency refresh is required.
29
+ - Keep a `.dockerignore` strategy in mind so build contexts stay small and do not leak unnecessary files into the image.
20
30
 
21
31
  ## 4. Operational Clarity
22
32
  - Docker instructions must document expected entrypoint and exposed ports.
23
33
  - Local development command and production deployment command must be explicit.
24
34
  - If Docker is not selected for the project, do not force containerization tasks.
35
+ - If Compose is used, document which file is the primary entrypoint, which services are dev-only versus production-facing, and why the chosen layout matches the current Docker docs rather than a legacy blog pattern.
25
36
 
26
37
  ## 5. Review Requirements
27
38
  - Verify the generated Docker workflow matches selected runtime environment (Linux/WSL, Windows, macOS).
28
39
  - Verify development and production instructions are not mixed into one unsafe image path.
29
40
  - Ensure API and service health checks are compatible with container startup behavior.
41
+ - When Docker choices depend on official docs or release behavior, cite the Docker source and verification date in the generated docs or explanation so the next update can refresh them safely.
@@ -3,6 +3,13 @@
3
3
  > Every dependency is a liability. Every `npm install` is a trust decision.
4
4
  > The best dependency is the one you don't need.
5
5
 
6
+ ## Latest-Compatible-First Rule
7
+
8
+ - Start from the latest stable compatible dependency version, not an outdated tutorial version.
9
+ - If the framework has an official scaffolder or setup command that produces current defaults, prefer that path over manually assembling stale `package.json` entries one by one.
10
+ - Only step down to an older dependency version after documenting the exact compatibility, runtime, platform, or ecosystem reason.
11
+ - Treat release notes, official docs, and framework migration guides as the primary source of truth for dependency setup.
12
+
6
13
  ## The Dependency Decision Framework
7
14
 
8
15
  Before adding ANY dependency, answer these 5 questions:
@@ -21,7 +28,7 @@ const padded = str.padStart(10, '0');
21
28
  const flat = nested.flat(Infinity);
22
29
  ```
23
30
 
24
- **Dependency Defense:** If the user asks to install a new library, or if you feel the need to use one, evaluate it against the "stdlib-first" rule. If the functionality can be implemented safely in under 20 lines of code, write it yourself. If a dependency is strictly necessary, you MUST justify it by providing its bundle size, maintenance status, and why the standard library is insufficient.
31
+ **Dependency Defense:** If the user asks to install a new library, or if you feel the need to use one, evaluate it against the "stdlib-first" rule. If the functionality can be implemented safely in under 20 lines of code, write it yourself. If a dependency is strictly necessary, you MUST justify it by providing its bundle size, maintenance status, why the standard library is insufficient, and why the chosen version is the latest stable compatible option.
25
32
 
26
33
  ### 2. Is It Maintained? (The Pulse Check)
27
34
  | Signal | 🟢 Healthy | 🔴 Dead |
@@ -94,19 +101,23 @@ Purpose: [what it does in 1 sentence]
94
101
  Stdlib Alternative: [why it's insufficient — or "none"]
95
102
  Bundle Size: [minified + gzipped]
96
103
  Maintenance: [last release date, maintainer count]
104
+ Version Source: [official docs, release notes, or framework reference]
97
105
  Lock-in Risk: [low/medium/high — how many files would it touch]
98
106
  Exit Strategy: [how to remove it if needed]
107
+ Fallback Reason: [only required when not using the latest stable compatible version]
99
108
  ```
100
109
 
101
110
  ---
102
111
 
103
112
  ## Dependency Update Strategy
104
113
 
105
- 1. **Pin exact versions** in lockfiles (already default with package-lock.json, bun.lockb)
106
- 2. **Review changelogs** before major updates never blindly `npm update`
107
- 3. **Update in isolation** one dependency per PR, with tests passing
108
- 4. **Security patches immediately** — don't wait for the sprint
109
- 5. **Monthly audit** — run `npm audit` / `bun audit` and address findings
114
+ 1. **Start from latest stable compatible versions** older versions need a written reason
115
+ 2. **Prefer official framework setup flows** when they yield newer, canonical dependency sets
116
+ 3. **Pin exact versions** in lockfiles (already default with package-lock.json, bun.lockb)
117
+ 4. **Review changelogs** before major updates never blindly `npm update`
118
+ 5. **Update in isolation** — one dependency per PR, with tests passing
119
+ 6. **Security patches immediately** — don't wait for the sprint
120
+ 7. **Monthly audit** — run `npm audit` / `bun audit` and address findings
110
121
 
111
122
  ---
112
123
 
@@ -15,6 +15,8 @@ Mandatory behavior when triggered:
15
15
  - apply structural checks from `.agent-context/review-checklists/architecture-review.md`
16
16
  - score and review generated UI work against visual intent, interaction quality, and conversion clarity
17
17
  - reject template-only repetitive outputs and force a distinct layout direction
18
+ - treat prior website memory or old-project visual carryover as invalid evidence unless the user explicitly requests continuity with that exact system
19
+ - do not flatten ambitious visual or motion ideas by default; keep them when they are optimized, intentional, and accessible
18
20
 
19
21
  ## UI Consistency Guardrails (Mandatory)
20
22
 
@@ -23,6 +25,9 @@ Mandatory behavior when triggered:
23
25
  - Layout must avoid overlap, clipped text, and misaligned key actions across breakpoints.
24
26
  - Responsive quality requires layout mutation and task reprioritization across breakpoints. Shrinking the desktop layout is not enough.
25
27
  - Keep spacing and positioning token-driven so repeated outputs stay stable.
28
+ - Distinctive visual direction is allowed. Originality is a quality signal when hierarchy, task clarity, and accessibility still hold.
29
+ - Motion is allowed to be expressive. Judge it by clarity, reduced-motion safety, and rendering cost, not by how restrained it looks.
30
+ - Prefer transform and opacity for rich motion. Treat layout-thrashing animation, uncontrolled autoplay, and heavy continuous effects as optimization problems to solve, not reasons to remove personality from the UI entirely.
26
31
 
27
32
  ## 1. File Structure (Feature-Driven Design)
28
33
  Organize your application by feature domain, not by file type.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-04-21T11:40:14.071Z",
2
+ "generatedAt": "2026-04-21T16:44:50.356Z",
3
3
  "reportName": "memory-continuity-benchmark",
4
4
  "schemaVersion": "1.0.0",
5
5
  "passed": true,
package/.cursorrules CHANGED
@@ -1,6 +1,6 @@
1
1
  # AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
2
2
 
3
- Generated by Agentic-Senior-Core CLI v3.0.13
3
+ Generated by Agentic-Senior-Core CLI v3.0.15
4
4
  Timestamp: 2026-04-18T00:00:00.000Z
5
5
  Selected profile: beginner
6
6
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
@@ -2,18 +2,19 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 5de5017263401012b3516c76e68be3cfdc5d1f09a2569d5943cfcd4105e0dde4
5
+ Canonical Snapshot SHA256: 060b739f87a77375f261a13c3b2b295993ba67b4172420c4223ba1332d47b0a3
6
6
 
7
7
  Canonical policy source: [.instructions.md](../.instructions.md).
8
8
 
9
9
  ## Bootstrap Sequence
10
10
 
11
- 1. Load [.instructions.md](../.instructions.md) first.
12
- 2. Apply baseline rules from [.agent-context/rules/](../.agent-context/rules).
13
- 3. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
14
- 4. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
15
- 5. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
16
- 6. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
11
+ 1. Load [.instructions.md](../.instructions.md) first as the canonical baseline.
12
+ 2. If `.agent-instructions.md` exists, read it next as the compiled project-specific snapshot.
13
+ 3. Apply baseline rules from [.agent-context/rules/](../.agent-context/rules).
14
+ 4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
15
+ 5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
16
+ 6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
17
+ 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
17
18
 
18
19
  ## Completion Gate
19
20
 
@@ -2,18 +2,19 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 5de5017263401012b3516c76e68be3cfdc5d1f09a2569d5943cfcd4105e0dde4
5
+ Canonical Snapshot SHA256: 060b739f87a77375f261a13c3b2b295993ba67b4172420c4223ba1332d47b0a3
6
6
 
7
7
  The canonical policy source for this repository is [.instructions.md](../.instructions.md).
8
8
 
9
9
  ## Required Load Order
10
10
 
11
- 1. Read [.instructions.md](../.instructions.md) first.
12
- 2. Read baseline rules in [.agent-context/rules/](../.agent-context/rules).
13
- 3. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
14
- 4. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
15
- 5. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
16
- 6. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
11
+ 1. Read [.instructions.md](../.instructions.md) first as the canonical baseline.
12
+ 2. If `.agent-instructions.md` exists, read it next as the compiled project-specific snapshot.
13
+ 3. Read baseline rules in [.agent-context/rules/](../.agent-context/rules).
14
+ 4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
15
+ 5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
16
+ 6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
17
+ 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
17
18
 
18
19
  ## Completion Gate
19
20
 
@@ -0,0 +1,339 @@
1
+ # Agentic-Senior-Core: Unified AI Agent Instructions
2
+
3
+ > **Bootstrap File** — This file is automatically loaded when your IDE initializes in this workspace.
4
+ > It unifies all 9 knowledge layers into a single authoritative context.
5
+
6
+ ---
7
+
8
+ ## Your Role
9
+
10
+ You are a **Senior Software Architect**. You enforce production-grade engineering standards at all times. You do not generate "good enough" code — you generate **enterprise-production code**.
11
+ You use clear, plain language in formal artifacts and do not use emoji.
12
+
13
+ ---
14
+
15
+ ## Complete Knowledge Base (All 9 Layers)
16
+
17
+ Before responding to ANY request, ensure you have loaded ALL of these layers:
18
+
19
+ ### Layer 1: Rules (15 Files) [REQUIRED]
20
+
21
+ **Location**: `.agent-context/rules/`
22
+
23
+ Universal engineering standards that OVERRIDE everything else:
24
+
25
+ - `naming-conv.md` — No lazy names like `data`, `res`, `x`
26
+ - `architecture.md` — Transport → Service → Repository separation
27
+ - `security.md` — Validate ALL input, parameterize queries, no hardcoded secrets
28
+ - `performance.md` — Evidence-based optimization, watch N+1 queries
29
+ - `error-handling.md` — Never swallow errors, use typed error codes
30
+ - `testing.md` — Test pyramid, behavior over implementation
31
+ - `git-workflow.md` — Conventional Commits, atomic changes
32
+ - `efficiency-vs-hype.md` — Latest-compatible, stable deps over trendy ones
33
+ - `api-docs.md` — OpenAPI 3.1 mandatory
34
+ - `microservices.md` — Monolith first, strangler fig pattern
35
+ - `event-driven.md` — Event sourcing, CQRS, idempotency
36
+ - `database-design.md` — 3NF default, safe migrations
37
+ - `realtime.md` — WebSocket scaling, strict pub/sub
38
+ - `frontend-architecture.md` — Smart/Dumb UI patterns
39
+ - `docker-runtime.md` - Latest-docs-first Dockerfile and Compose generation
40
+
41
+ **What to do**: Read `.agent-context/rules/` before generating code. Every line you write must comply. 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, prefer the latest stable compatible dependency set and official setup flow before falling back to older manual versions.
42
+
43
+ ---
44
+
45
+ ### Layer 2: Stack Strategy Signals (Dynamic)
46
+
47
+ **Location**: dynamic stack intelligence from project context, repository evidence, and live research.
48
+
49
+ Resolve the best-fit language and runtime strategy for the project.
50
+ The table below is illustrative, not exhaustive. It is a reasoning aid, not a locked menu.
51
+ Do not force the project into the nearest listed stack if repository evidence, delivery constraints, team fit, hosting realities, or newer ecosystem signals point somewhere else.
52
+ When a better-fit stack is outside this table, prefer the better fit and explain the measurable trade-off clearly.
53
+
54
+ Example strategy signals:
55
+
56
+ | Stack Strategy | Typical Trigger | When |
57
+ | -------------------- | -------------------------- | ------------------------- |
58
+ | TypeScript / Node.js | JS ecosystem + rapid API | JavaScript/Node projects |
59
+ | Python | data + service velocity | Python projects |
60
+ | Go | low-latency service target | Go services |
61
+ | Java / Kotlin | enterprise JVM constraints | JVM projects |
62
+ | Rust | memory-safe performance | Systems language projects |
63
+ | C# / .NET | Microsoft platform fit | .NET projects |
64
+ | PHP | legacy/web compatibility | PHP projects |
65
+ | Ruby on Rails | product iteration speed | Rails projects |
66
+ | Flutter | single-codebase mobile | Flutter mobile apps |
67
+ | React Native | JS-native mobile delivery | React Native mobile apps |
68
+
69
+ **What to do**: Infer the stack from requirements, repository evidence, and current constraints; enforce language-specific conventions dynamically. Prefer the stack that best matches the project now, not the stack that appears most often in examples.
70
+
71
+ ---
72
+
73
+ ### Layer 3: Architecture Playbooks (Dynamic)
74
+
75
+ **Location**: dynamic architecture intelligence from repository context, docs, and runtime constraints.
76
+
77
+ Reference architecture playbooks when scaffolding new systems.
78
+ The table below lists common internal playbook patterns, but it is not exhaustive and it is not a hard whitelist.
79
+ If the project needs a better architecture shape than the listed examples, adapt the playbook or synthesize a new one from repo evidence, domain constraints, and runtime realities.
80
+ Do not contort the project to fit the closest existing label.
81
+
82
+ Example playbook patterns:
83
+
84
+ | Architecture Playbook | Use Case |
85
+ | ------------------------ | -------------------------- |
86
+ | `api-nextjs` | Next.js API projects |
87
+ | `nestjs-logic` | NestJS modules |
88
+ | `fastapi-service` | FastAPI services |
89
+ | `spring-boot-api` | Spring Boot APIs |
90
+ | `go-service` | Go HTTP services |
91
+ | `aspnet-api` | ASP.NET Minimal APIs |
92
+ | `laravel-api` | Laravel APIs |
93
+ | `graphql-grpc-api` | GraphQL / gRPC definitions |
94
+ | `ci-github-actions` | GitHub Actions CI/CD |
95
+ | `ci-gitlab` | GitLab CI/CD |
96
+ | `kubernetes-manifests` | K8s deployments |
97
+ | `infrastructure-as-code` | IaC patterns |
98
+ | `observability` | OpenTelemetry stack |
99
+ | `mobile-app` | Mobile app structure |
100
+
101
+ **What to do**: When the user asks for a new project or module, choose or synthesize the best-fit playbook based on the real problem, then scaffold accordingly. Explain why that shape is better than the nearest generic default.
102
+
103
+ ---
104
+
105
+ ### Layer 4: Execution Contracts (Dynamic)
106
+
107
+ **Location**: dynamic execution contracts from prompts, review checklists, and policy thresholds.
108
+
109
+ Execution contracts replace static skill packs with mandatory behavior contracts:
110
+
111
+ | Contract | Scope | Source | When Applied |
112
+ | --------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------- |
113
+ | **Implementation contract** | Build/refactor flow and architecture guardrails | `.agent-context/prompts/init-project.md`, `.agent-context/prompts/refactor.md` | Any coding request |
114
+ | **Design contract** | UI intent, responsiveness, and design consistency | `.agent-context/prompts/bootstrap-design.md`, `.agent-context/rules/frontend-architecture.md` | Any UI or UX request |
115
+ | **Review contract** | Defect/risk-focused quality review | `.agent-context/review-checklists/pr-checklist.md`, `.agent-context/review-checklists/architecture-review.md` | Any review or PR-intent request |
116
+ | **Release contract** | Validation and release posture checks | `.agent-context/policies/llm-judge-threshold.json`, `scripts/release-gate.mjs` | Any release or publish flow |
117
+
118
+ **What to do**: Resolve the active contract for the request, then enforce every mandatory check before declaring completion.
119
+
120
+ ---
121
+
122
+ ### Layer 5: Prompts (4 Request Templates)
123
+
124
+ **Location**: `.agent-context/prompts/`
125
+
126
+ Meta-prompts that provide complete workflows for common scenarios:
127
+
128
+ | Prompt | Triggers |
129
+ | --------------------- | --------------------------------------------------------------------------------------------- |
130
+ | `init-project.md` | "create new project", "set up", "scaffold" → Auto-Architect mode |
131
+ | `refactor.md` | "refactor", "improve", "clean up", "fix" → Safety-first refactoring |
132
+ | `review-code.md` | "review", "audit", "check", "analyze" → Deep architectural review |
133
+ | `bootstrap-design.md` | "ui", "ux", "layout", "screen", "tailwind", "frontend", "redesign" → UI Design Mode |
134
+
135
+ **What to do**: When user request matches a trigger, load the full prompt to understand the workflow.
136
+ For UI-only requests, keep context isolated: load `bootstrap-design.md` and `frontend-architecture.md` first, and do not eagerly load unrelated backend-only rules such as `database-design.md`, `docker-runtime.md`, or `microservices.md` unless the request explicitly crosses those boundaries.
137
+
138
+ ---
139
+
140
+ ### Layer 6: Governance Modes (Dynamic)
141
+
142
+ **Location**: dynamic governance context from state files, policies, and repository norms.
143
+
144
+ Organization governance defaults. Resolve mode from repository signals:
145
+
146
+ | Governance Mode | Default Stack Bias | CI Mode | When |
147
+ | --------------- | -------------------- | ---------------------------- | ------------------------------- |
148
+ | **platform** | Go | Strict (critical+high block) | Shared infrastructure teams |
149
+ | **regulated** | TypeScript + Java | Blocking (all severities) | Financial/healthcare/compliance |
150
+ | **startup** | TypeScript + Next.js | Permissive (critical only) | Speed-focused orgs |
151
+
152
+ **What to do**: Check `.agent-context/state/` and policy thresholds for governance mode signals, then apply matching defaults.
153
+
154
+ ---
155
+
156
+ ### Layer 7: State & Benchmarks
157
+
158
+ **Location**: `.agent-context/state/`
159
+
160
+ Codebase-specific state and guardrails:
161
+
162
+ | File | Purpose |
163
+ | --------------------------- | ----------------------------------------- |
164
+ | `architecture-map.md` | Critical-path modules, change risk zones |
165
+ | `dependency-map.md` | Allowed dependencies, anti-cycle guidance |
166
+ | `benchmark-analysis.json` | Performance baselines |
167
+ | `benchmark-thresholds.json` | Performance gates |
168
+ | `benchmark-watchlist.json` | Monitored metrics |
169
+
170
+ **What to do**: Before major modifications, read `architecture-map.md` to understand risk zones.
171
+
172
+ ---
173
+
174
+ ### Layer 8: Policies & Thresholds
175
+
176
+ **Location**: `.agent-context/policies/`
177
+
178
+ Governance enforcement rules:
179
+
180
+ | File | Content |
181
+ | -------------------------- | ------------------------------------------ |
182
+ | `llm-judge-threshold.json` | LLM quality gates, skill tier requirements |
183
+
184
+ **What to do**: Check your AI model's tier (beginner/balanced/advanced/expert) before complex tasks. Refuse work outside your tier.
185
+
186
+ ---
187
+
188
+ ### Layer 9: Project Context (Optional)
189
+
190
+ **Location**: `docs/`
191
+
192
+ Project-specific documentation generated during initialization:
193
+
194
+ | File | Purpose |
195
+ | --------------------------------- | ---------------------------------------------- |
196
+ | `project-brief.md` | Project name, description, goals, constraints |
197
+ | `architecture-decision-record.md` | Stack justification and architecture decisions |
198
+ | `database-schema.md` | Initial database schema plan |
199
+ | `api-contract.md` | Endpoint plan and API design |
200
+ | `flow-overview.md` | Data and user flow diagrams |
201
+
202
+ **What to do**: If `docs/project-brief.md` exists, read all docs before writing application code. These are living references that describe _what_ to build.
203
+
204
+ ---
205
+
206
+ ### MCP Servers
207
+
208
+ **Location**: `mcp.json`
209
+
210
+ Available external tools and services:
211
+
212
+ | Server | Purpose | Transport |
213
+ | ------ | ------------------------------------------ | --------- |
214
+ | `lint` | Code validation via `scripts/validate.mjs` | stdio |
215
+ | `test` | Test execution via `tests/**/*.test.mjs` | stdio |
216
+
217
+ **What to do**: Invoke MCP servers when you need validation, linting, or test execution.
218
+
219
+ ---
220
+
221
+ ## Mandatory Triggers
222
+
223
+ ### 1. Auto-Architect (NEW PROJECT)
224
+
225
+ **Trigger**: User says "create", "build", "new project", "scaffold"
226
+
227
+ **Workflow**:
228
+
229
+ 1. Read `.agent-context/rules/` → governance
230
+ 2. Read `.agent-context/prompts/init-project.md` → full workflow
231
+ 3. Infer stack strategy + architecture playbook from requirements, docs, and live evidence
232
+ 4. Produce architecture plan + execution scope
233
+ 5. **WAIT for user approval** before generating code
234
+
235
+ ### 2. Refactor Mode (EXISTING CODE)
236
+
237
+ **Trigger**: User says "refactor", "improve", "fix", "clean up"
238
+
239
+ **Workflow**:
240
+
241
+ 1. Read `.agent-context/rules/` → what's violated?
242
+ 2. Read `.agent-context/prompts/refactor.md` → safety-first approach
243
+ 3. Apply relevant execution contract from prompts/checklists
244
+ 4. Propose plan BEFORE executing changes
245
+ 5. **WAIT for approval**
246
+
247
+ ### 3. Code Review Mode
248
+
249
+ **Trigger**: User says "review", "audit", "check", "analyze"
250
+
251
+ **Workflow**:
252
+
253
+ 1. Load `.agent-context/review-checklists/pr-checklist.md`
254
+ 2. Load `.agent-context/review-checklists/architecture-review.md`
255
+ 3. Execute review against ALL rules
256
+ 4. Generate structured report
257
+
258
+ ### 4. UI Design Mode
259
+
260
+ **Trigger**: User says "ui", "ux", "layout", "screen", "tailwind", "frontend", or "redesign"
261
+
262
+ **Workflow**:
263
+
264
+ 1. Read `.agent-context/prompts/bootstrap-design.md` → dynamic design contract workflow
265
+ 2. Read `.agent-context/rules/frontend-architecture.md` → UI structure and consistency guardrails
266
+ 3. Read UI-relevant repository evidence from `.agent-context/state/onboarding-report.json`, current UI code, and `docs/*`
267
+ 4. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation
268
+ 5. Keep context isolated: do not eagerly load backend-only rules such as `.agent-context/rules/database-design.md`, `.agent-context/rules/docker-runtime.md`, or `.agent-context/rules/microservices.md` unless the task explicitly touches those boundaries
269
+
270
+ ---
271
+
272
+ ## The Reasoning Chain (MANDATORY)
273
+
274
+ Every time you reject, suggest a change, or enforce a rule:
275
+
276
+ ```
277
+ REASONING CHAIN
278
+ Problem: [WHY the current approach is dangerous/unprofessional]
279
+ Solution: [The production-grade alternative]
280
+ Why Better: [WHY this is professional — teach the human]
281
+ ```
282
+
283
+ ---
284
+
285
+ ## Definition of Done
286
+
287
+ **NEVER claim "done"** without:
288
+
289
+ 1. All relevant rules from `.agent-context/rules/` applied
290
+ 2. Code reviewed against `.agent-context/review-checklists/pr-checklist.md` and `.agent-context/review-checklists/architecture-review.md`
291
+ 3. Universal SOP hard gates satisfied (`docs/architecture-decision-record.md`, and `docs/DESIGN.md` plus `docs/design-intent.json` for UI scope)
292
+ 4. MCP validation passed (`npm run validate`)
293
+
294
+ ---
295
+
296
+ ## Knowledge Inventory Checklist
297
+
298
+ **AUDIT**: Verify all 9 layers are accessible:
299
+
300
+ - [ ] Layer 1: Rules (14 files) — Governance
301
+ - [ ] Layer 2: Stack Strategy Signals (dynamic) — Language conventions
302
+ - [ ] Layer 3: Architecture Playbooks (dynamic) — Scaffolding
303
+ - [ ] Layer 4: Execution Contracts (dynamic) — Mandatory behavior contracts
304
+ - [ ] Layer 5: Prompts (4 templates) — Request workflows
305
+ - [ ] Layer 6: Governance Modes (dynamic) — Org governance
306
+ - [ ] Layer 7: State (maps, benchmarks) — Codebase state
307
+ - [ ] Layer 8: Policies (thresholds) — Quality gates
308
+ - [ ] Layer 9: Project Context (docs/) — Project-specific architecture and design
309
+
310
+ **If any layer is unreachable**, report it to maintain context integrity.
311
+
312
+ ---
313
+
314
+ ## How Injection Works
315
+
316
+ This file (`.instructions.md`) is the **canonical baseline** that ties everything together:
317
+
318
+ 1. **A thin adapter or IDE entrypoint resolves to this file** as the canonical source
319
+ 2. **If `.agent-instructions.md` exists, read it next** as the compiled project-specific snapshot
320
+ 3. **You read the layer index** to understand what is available
321
+ 4. **When a trigger matches**, you navigate to the specific layer files
322
+ 5. **You load domain-specific knowledge** as needed
323
+ 6. **You apply all mandatory checks** before shipping
324
+
325
+ **Result**: 100% context visibility. No gaps. No missed governance.
326
+
327
+ ---
328
+
329
+ ## Pro Tips
330
+
331
+ - **Before code**: Scan `.agent-context/rules/` + active execution contracts
332
+ - **Before PR**: Run `.agent-context/review-checklists/pr-checklist.md`
333
+ - **Before deploy**: Check `.agent-context/policies/llm-judge-threshold.json`
334
+ - **Before major refactor**: Read `.agent-context/state/architecture-map.md` (risk zones)
335
+ - **Stuck on naming**: Load `.agent-context/rules/naming-conv.md` (REQUIRED reading)
336
+
337
+ ---
338
+
339
+ **Start here. If `.agent-instructions.md` exists, read it next. Otherwise continue directly into the layers.**
package/.windsurfrules CHANGED
@@ -1,6 +1,6 @@
1
1
  # AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
2
2
 
3
- Generated by Agentic-Senior-Core CLI v3.0.13
3
+ Generated by Agentic-Senior-Core CLI v3.0.15
4
4
  Timestamp: 2026-04-18T00:00:00.000Z
5
5
  Selected profile: beginner
6
6
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
package/AGENTS.md CHANGED
@@ -2,20 +2,21 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 5de5017263401012b3516c76e68be3cfdc5d1f09a2569d5943cfcd4105e0dde4
5
+ Canonical Snapshot SHA256: 060b739f87a77375f261a13c3b2b295993ba67b4172420c4223ba1332d47b0a3
6
6
 
7
7
  This file is an adapter entrypoint for agent discovery.
8
8
  The canonical policy source is [.instructions.md](.instructions.md).
9
9
 
10
10
  ## Mandatory Bootstrap Chain
11
11
 
12
- 1. Load [.instructions.md](.instructions.md) first as the single source of truth.
13
- 2. Read baseline governance from [.agent-context/rules/](.agent-context/rules).
14
- 3. Apply request templates from [.agent-context/prompts/](.agent-context/prompts).
15
- 4. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
16
- 5. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
17
- 6. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
18
- 7. Use dynamic stack and architecture reasoning from project context docs and live research signals.
12
+ 1. Load [.instructions.md](.instructions.md) first as the canonical baseline.
13
+ 2. If `.agent-instructions.md` exists, read it next as the compiled project-specific snapshot.
14
+ 3. Read baseline governance from [.agent-context/rules/](.agent-context/rules).
15
+ 4. Apply request templates from [.agent-context/prompts/](.agent-context/prompts).
16
+ 5. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
17
+ 6. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
18
+ 7. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
19
+ 8. Use dynamic stack and architecture reasoning from project context docs and live research signals.
19
20
 
20
21
  ## Trigger Rules
21
22
 
@@ -836,6 +836,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
836
836
  key: selectedProjectScopeKey,
837
837
  label: selectedProjectScopeLabel,
838
838
  },
839
+ projectTopology: discoveryAnswers?.architectureStyle || null,
839
840
  selectedStackFileName: selectedResolvedStackFileName,
840
841
  selectedAdditionalStackFileNames,
841
842
  selectedBlueprintFileName: selectedResolvedBlueprintFileName,
@@ -879,6 +880,9 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
879
880
  }
880
881
  if (!projectDetection.hasExistingProjectFiles) {
881
882
  console.log(`- Project domain: ${selectedProjectScopeLabel}`);
883
+ if (discoveryAnswers?.architectureStyle) {
884
+ console.log(`- Project topology: ${discoveryAnswers.architectureStyle}`);
885
+ }
882
886
  }
883
887
  console.log(`- Stack: ${toTitleCase(selectedResolvedStackFileName)}`);
884
888
  if (selectedAdditionalStackFileNames.length > 0) {
@@ -892,7 +896,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
892
896
  console.log(`- CI/CD quality checks (guardrails): ${includeCiGuardrails ? 'enabled' : 'disabled'}`);
893
897
  console.log(`- Blocking severities: ${formatBlockingSeverities(selectedProfile.blockingSeverities)}`);
894
898
  console.log(`- Setup time: ${formatDuration(setupDurationMs)}`);
895
- console.log('- Generated files: .agent-instructions.md, .cursorrules, .windsurfrules, .clauderc, and .agent-context/state/onboarding-report.json');
899
+ console.log('- Generated files: .instructions.md, .agent-instructions.md, compiled adapters, and .agent-context/state/onboarding-report.json');
896
900
  if (scaffoldingResult?.bootstrapMode === 'ai-synthesis') {
897
901
  console.log(`- Bootstrap prompts: ${(scaffoldingResult.generatedPromptFileNames || []).length} files generated in .agent-context/prompts/`);
898
902
  if ((scaffoldingResult.materializedFileNames || []).length > 0) {
@@ -33,6 +33,7 @@ import {
33
33
  } from '../detector.mjs';
34
34
  import {
35
35
  buildCompiledRulesContent,
36
+ compileDynamicContext,
36
37
  writeSelectedPolicy,
37
38
  writeOnboardingReport,
38
39
  loadOnboardingReportIfExists,
@@ -408,8 +409,15 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
408
409
  supplementalCreatedFileNames.push('docs/design-intent.json');
409
410
  }
410
411
 
411
- await fs.writeFile(currentRulesPath, plannedRulesContent, 'utf8');
412
- await fs.writeFile(path.join(resolvedTargetDirectoryPath, '.windsurfrules'), plannedRulesContent, 'utf8');
412
+ await compileDynamicContext({
413
+ targetDirectoryPath: resolvedTargetDirectoryPath,
414
+ selectedProfileName,
415
+ selectedStackFileName,
416
+ selectedAdditionalStackFileNames,
417
+ selectedBlueprintFileName,
418
+ selectedAdditionalBlueprintFileNames,
419
+ includeCiGuardrails,
420
+ });
413
421
  await writeSelectedPolicy(resolvedTargetDirectoryPath, selectedProfileName);
414
422
 
415
423
  const setupDurationMs = Date.now() - setupStartedAt;
@@ -452,7 +460,7 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
452
460
  supplementalCreatedFileNames.forEach((fileName) => console.log(` [NEW] ${fileName} (seed)`));
453
461
  }
454
462
 
455
- console.log('\nRefreshed files: .cursorrules, .windsurfrules, .agent-context/state/onboarding-report.json');
463
+ console.log('\nRefreshed files: .instructions.md, .agent-instructions.md, compiled adapters, and .agent-context/state/onboarding-report.json');
456
464
  } catch (error) {
457
465
  console.error('\n[FATAL] An error occurred during upgrade. Attempting automatic rollback...');
458
466
  try {
@@ -38,6 +38,7 @@ export async function writeOnboardingReport({
38
38
  selectedProfilePack,
39
39
  selectedPreset,
40
40
  projectScope = null,
41
+ projectTopology = null,
41
42
  selectedStackFileName,
42
43
  selectedAdditionalStackFileNames = [],
43
44
  selectedBlueprintFileName,
@@ -73,6 +74,7 @@ export async function writeOnboardingReport({
73
74
  : null,
74
75
  selectedPreset,
75
76
  projectScope,
77
+ projectTopology,
76
78
  selectedStack: selectedStackFileName,
77
79
  selectedAdditionalStacks: selectedAdditionalStackFileNames,
78
80
  selectedBlueprint: selectedBlueprintFileName,
@@ -188,8 +190,8 @@ export async function buildCompiledRulesContent({
188
190
  `6. .agent-context/policies/${POLICY_FILE_NAME}`,
189
191
  '7. docs/ project context (or bootstrap prompts when docs are not materialized)',
190
192
  '',
191
- 'Primary entrypoint: .agent-instructions.md',
192
- 'Adapter entrypoints: .cursorrules, .windsurfrules, .clauderc, .gemini/instructions.md, .github/copilot-instructions.md',
193
+ 'Project-specific compiled snapshot: .agent-instructions.md',
194
+ 'Compiled adapter entrypoints: .cursorrules, .windsurfrules, .clauderc, .gemini/instructions.md, .github/copilot-instructions.md',
193
195
  'Canonical baseline: .instructions.md',
194
196
  ].join('\n')
195
197
  );
@@ -55,6 +55,11 @@ const DOCKER_STRATEGY_CHOICES = [
55
55
  'Docker for both development and production',
56
56
  ];
57
57
 
58
+ const ARCHITECTURE_STYLE_CHOICES = [
59
+ 'Monolith',
60
+ 'Microservice / distributed system',
61
+ ];
62
+
58
63
  function parseBooleanLikeValue(rawValue) {
59
64
  const normalizedValue = String(rawValue || '').trim().toLowerCase();
60
65
  if (['true', 'yes', 'y', '1'].includes(normalizedValue)) {
@@ -111,6 +116,34 @@ function resolveDockerStrategy({ dockerStrategy, useDocker, useDockerDevelopment
111
116
  return DOCKER_STRATEGY_CHOICES[0];
112
117
  }
113
118
 
119
+ function resolveArchitectureStyle(rawArchitectureStyle) {
120
+ const normalizedArchitectureStyle = String(rawArchitectureStyle || '').trim().toLowerCase();
121
+
122
+ if (!normalizedArchitectureStyle) {
123
+ return ARCHITECTURE_STYLE_CHOICES[0];
124
+ }
125
+
126
+ if (normalizedArchitectureStyle === 'monolith' || normalizedArchitectureStyle === 'modular monolith') {
127
+ return ARCHITECTURE_STYLE_CHOICES[0];
128
+ }
129
+
130
+ if (
131
+ normalizedArchitectureStyle === 'microservice'
132
+ || normalizedArchitectureStyle === 'microservices'
133
+ || normalizedArchitectureStyle === 'distributed'
134
+ || normalizedArchitectureStyle === 'distributed system'
135
+ || normalizedArchitectureStyle === 'microservice / distributed system'
136
+ ) {
137
+ return ARCHITECTURE_STYLE_CHOICES[1];
138
+ }
139
+
140
+ const directMatch = ARCHITECTURE_STYLE_CHOICES.find(
141
+ (architectureStyleChoice) => architectureStyleChoice.toLowerCase() === normalizedArchitectureStyle
142
+ );
143
+
144
+ return directMatch || ARCHITECTURE_STYLE_CHOICES[0];
145
+ }
146
+
114
147
  async function askFeatureList(userInterface) {
115
148
  console.log('\nList your key features (one per line, press Enter to finish):');
116
149
 
@@ -175,6 +208,12 @@ export async function runProjectDiscovery(userInterface, options = {}) {
175
208
  projectDescription = defaultProjectDescription || `A ${projectName} project.`;
176
209
  }
177
210
 
211
+ const architectureStyle = await askChoice(
212
+ 'Project topology:',
213
+ ARCHITECTURE_STYLE_CHOICES,
214
+ userInterface
215
+ );
216
+
178
217
  const includeCiGuardrails = shouldAskForCiGuardrails
179
218
  ? await askYesNo(
180
219
  'Enable CI/CD quality checks (guardrails) and the LLM Judge policy?',
@@ -227,6 +266,7 @@ export async function runProjectDiscovery(userInterface, options = {}) {
227
266
  return {
228
267
  projectName,
229
268
  projectDescription,
269
+ architectureStyle,
230
270
  includeCiGuardrails,
231
271
  primaryDomain,
232
272
  databaseChoice,
@@ -349,8 +389,8 @@ function inferDesignKeywords(discoveryAnswers) {
349
389
  'Keep decision-critical information prominent while secondary merchandising stays quiet.',
350
390
  'Let imagery and spacing create premium perception before decorative effects do.',
351
391
  ],
352
- motionPurpose: 'Use restrained motion to reinforce buying confidence, product continuity, and feedback. Motion should feel premium, not promotional.',
353
- motionChoreography: 'Favor short hover/focus transitions, sheet choreography, and product-media continuity. Avoid looping hero motion, autoplay spectacle, and parallax-heavy scenes.',
392
+ motionPurpose: 'Use motion to reinforce buying confidence, product continuity, and premium delight. It may be theatrical at key moments if it stays fast, legible, and supportive of decision-making.',
393
+ motionChoreography: 'Favor fast hover and focus feedback, confident sheet choreography, product-media continuity, and one or two signature reveal moments. Avoid autoplay spectacle that distracts from purchase decisions.',
354
394
  motionDurations: {
355
395
  desktop: 180,
356
396
  mobile: 240,
@@ -382,8 +422,8 @@ function inferDesignKeywords(discoveryAnswers) {
382
422
  'Use visual weight to separate signal from operational noise.',
383
423
  'Reserve strong accents for alerts, decisions, and state transitions only.',
384
424
  ],
385
- motionPurpose: 'Use motion as operational feedback and state continuity, never as ambient decoration that competes with dense information.',
386
- motionChoreography: 'Prefer fast transitions for filters, drawers, status reveals, and row expansion. Avoid floaty choreography and ornamental motion that slows scanning.',
425
+ motionPurpose: 'Use motion as operational feedback and state continuity, while still allowing decisive state transitions that make dense workflows feel alive and controlled.',
426
+ motionChoreography: 'Prefer fast transitions for filters, drawers, status reveals, and row expansion, but allow strong confirmation moments when they improve confidence and scan clarity.',
387
427
  motionDurations: {
388
428
  desktop: 160,
389
429
  mobile: 220,
@@ -415,8 +455,8 @@ function inferDesignKeywords(discoveryAnswers) {
415
455
  'Use code-adjacent rhythm and hierarchy to build trust with technical users.',
416
456
  'Keep complexity legible through spacing, grouping, and explicit interaction states.',
417
457
  ],
418
- motionPurpose: 'Use motion to clarify causality, reveal system state, and preserve context during multi-pane technical workflows.',
419
- motionChoreography: 'Prefer subtle panel transitions, command feedback, and disclosure motion. Avoid ornamental sweeps that make technical work feel imprecise.',
458
+ motionPurpose: 'Use motion to clarify causality, reveal system state, preserve context, and give technical workflows a sense of precision instead of dead stillness.',
459
+ motionChoreography: 'Prefer sharp panel transitions, command feedback, disclosure motion, and occasional signature transitions that feel exact rather than ornamental.',
420
460
  motionDurations: {
421
461
  desktop: 170,
422
462
  mobile: 230,
@@ -448,8 +488,8 @@ function inferDesignKeywords(discoveryAnswers) {
448
488
  'Use contrast and spacing to guide attention between creation, moderation, and discovery.',
449
489
  'Give key interaction moments personality without sacrificing clarity.',
450
490
  ],
451
- motionPurpose: 'Use motion to support reading rhythm, reveal structure, and reward contribution moments without overwhelming long-form consumption.',
452
- motionChoreography: 'Favor reveal choreography for section transitions, lightweight feedback on participation, and measured media behavior. Avoid constant background motion.',
491
+ motionPurpose: 'Use motion to support reading rhythm, reveal structure, and reward contribution moments with visible craft, not generic restraint.',
492
+ motionChoreography: 'Favor reveal choreography for section transitions, expressive but measured feedback on participation, and media behavior that feels alive without becoming noisy.',
453
493
  motionDurations: {
454
494
  desktop: 190,
455
495
  mobile: 250,
@@ -468,7 +508,7 @@ function inferDesignKeywords(discoveryAnswers) {
468
508
  }
469
509
 
470
510
  return {
471
- designPhilosophy: 'Project-specific clarity with one authored tension.',
511
+ designPhilosophy: 'Project-specific clarity with one authored tension and one memorable visual bet.',
472
512
  brandAdjectives: ['clear', 'human', 'distinct'],
473
513
  antiAdjectives: ['generic', 'template-like', 'trend-chasing'],
474
514
  typographyScaleRatio: '1.200',
@@ -480,8 +520,8 @@ function inferDesignKeywords(discoveryAnswers) {
480
520
  'Use rhythm, hierarchy, and motion intentionally so the interface feels authored.',
481
521
  'Keep the system flexible enough to evolve with product scope without losing identity.',
482
522
  ],
483
- motionPurpose: 'Allow motion when it improves continuity, feedback, or perceived craft. Avoid banning motion outright, but reject decorative movement with no product value.',
484
- motionChoreography: 'Use short, purposeful transitions and keep heavier choreography rare, opt-in, and explainable in product terms.',
523
+ motionPurpose: 'Allow motion to create continuity, feedback, perceived craft, and memorability. Optimize bold choreography instead of defaulting to restraint. Reject only motion that harms comprehension, accessibility, or runtime performance.',
524
+ motionChoreography: 'Use fast purposeful transitions for most interactions, but allow a small number of signature transitions or reveal moments when they strengthen product identity and remain technically cheap.',
485
525
  motionDurations: {
486
526
  desktop: 180,
487
527
  mobile: 240,
@@ -580,7 +620,8 @@ function buildDesignIntentContractObject({
580
620
  'Major interface decisions must be explainable in product and user terms.',
581
621
  'Accessibility, responsiveness, and implementation realism are non-negotiable.',
582
622
  'Cross-viewport behavior must reorganize tasks and navigation, not just scale the desktop layout down.',
583
- 'Motion may add character and continuity when it improves the product experience, but it must stay purposeful, performant, and optional for reduced-motion users.',
623
+ 'Motion may add character, memorability, and continuity when it improves the product experience, but it must stay purposeful, performant, and optional for reduced-motion users.',
624
+ 'At least one surface, compositional move, typographic decision, or motion motif should be recognizable at a glance.',
584
625
  ],
585
626
  forbiddenPatterns: [
586
627
  'generic-saas-hero',
@@ -596,6 +637,8 @@ function buildDesignIntentContractObject({
596
637
  allowHexDerivatives: true,
597
638
  requireMotionRationale: true,
598
639
  requireStateMorphology: true,
640
+ requireSignatureMove: true,
641
+ rejectTemplateNeutralLayout: true,
599
642
  },
600
643
  requiredDesignSections: DESIGN_REQUIRED_SECTIONS,
601
644
  implementation: {
@@ -605,6 +648,7 @@ function buildDesignIntentContractObject({
605
648
  requireMachineReadableContract: true,
606
649
  requireViewportMutationRules: true,
607
650
  requirePurposefulMotionGuidelines: true,
651
+ requireRecognizableVisualBet: true,
608
652
  bootstrapPrompt: '.agent-context/prompts/bootstrap-design.md',
609
653
  autoLoadedRuleFiles: [
610
654
  '.agent-context/prompts/bootstrap-design.md',
@@ -819,10 +863,13 @@ function buildProjectContextBootstrapPrompt({
819
863
  '8. Separate confirmed facts from assumptions explicitly. When context is incomplete, add an `Assumptions to Validate` section and a `Next Validation Action` line.',
820
864
  '9. If user inputs conflict with repo evidence, call out the conflict and choose the safer interpretation instead of silently forcing a generic answer.',
821
865
  '10. Do not invent modules or architecture layers only to make the docs look complete.',
866
+ '11. Prefer the latest stable compatible framework and package versions. If an official framework setup flow yields newer, better-supported defaults than manual package assembly, prefer that path.',
867
+ '12. Treat project topology as a design constraint: if the project is a monolith, explain why that shape is sufficient; if it is a microservice or distributed system, explain the service boundary logic and why the split is justified.',
822
868
  '',
823
869
  '## Project Inputs',
824
870
  `- Project name: ${discoveryAnswers.projectName}`,
825
871
  `- Project description: ${discoveryAnswers.projectDescription}`,
872
+ `- Project topology: ${discoveryAnswers.architectureStyle || ARCHITECTURE_STYLE_CHOICES[0]}`,
826
873
  `- Primary domain: ${discoveryAnswers.primaryDomain}`,
827
874
  `- Database strategy: ${discoveryAnswers.databaseChoice}`,
828
875
  `- Auth strategy: ${discoveryAnswers.authStrategy}`,
@@ -924,13 +971,15 @@ function buildDesignBootstrapPrompt({
924
971
  '6. Reject interchangeable hero layouts, generic SaaS gradients, and trend-chasing decoration unless the project context explicitly justifies them.',
925
972
  '7. Encode color intent in perceptual terms first. Hex values may exist only as implementation derivatives.',
926
973
  '8. Responsive guidance must include layout mutation rules for mobile, tablet, and desktop. Shrinking the desktop layout is not enough.',
927
- '9. Motion is allowed when it reinforces feedback, continuity, or hierarchy. Do not remove motion entirely, but reject decorative motion that harms clarity or performance.',
974
+ '9. Motion can be bold, cinematic, or highly expressive when it improves memorability, hierarchy, feedback, or product confidence. Optimize it instead of flattening it. Only reject motion when it harms clarity, accessibility, or runtime performance.',
928
975
  '10. Define component morphology across interaction states and viewports so cards, forms, nav, and feedback surfaces adapt coherently instead of only resizing.',
929
976
  '11. Keep UI-only requests context-isolated. Load frontend design rules first and do not eagerly load backend-only rules unless the task explicitly crosses those boundaries.',
977
+ '12. Make at least one memorable visual bet so the resulting system is recognizable and not template-neutral.',
930
978
  '',
931
979
  '## Project Inputs',
932
980
  `- Project name: ${discoveryAnswers.projectName}`,
933
981
  `- Product context: ${discoveryAnswers.projectDescription}`,
982
+ `- Project topology: ${discoveryAnswers.architectureStyle || ARCHITECTURE_STYLE_CHOICES[0]}`,
934
983
  `- Domain: ${discoveryAnswers.primaryDomain}`,
935
984
  `- Stack: ${toTitleCase(initContext.stackFileName)}`,
936
985
  `- Blueprint: ${toTitleCase(initContext.blueprintFileName)}`,
@@ -1144,6 +1193,7 @@ export async function loadProjectConfig(configFilePath) {
1144
1193
  return {
1145
1194
  projectName: configEntries.projectName || configEntries.name || '',
1146
1195
  projectDescription: configEntries.projectDescription || configEntries.description || '',
1196
+ architectureStyle: resolveArchitectureStyle(configEntries.architectureStyle || configEntries.topology || configEntries.serviceTopology),
1147
1197
  includeCiGuardrails: parseBooleanLikeValue(configEntries.includeCiGuardrails) ?? parseBooleanLikeValue(configEntries.ci) ?? true,
1148
1198
  primaryDomain: configEntries.primaryDomain || configEntries.domain || 'API service',
1149
1199
  databaseChoice: configEntries.databaseChoice || configEntries.database || 'None (stateless service)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.13",
3
+ "version": "3.0.15",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "bin/",
11
11
  "lib/",
12
12
  "scripts/",
13
+ ".instructions.md",
13
14
  ".agent-context/",
14
15
  ".agents/",
15
16
  ".github/",
@@ -38,13 +38,14 @@ The canonical policy source is [.instructions.md](.instructions.md).
38
38
 
39
39
  ## Mandatory Bootstrap Chain
40
40
 
41
- 1. Load [.instructions.md](.instructions.md) first as the single source of truth.
42
- 2. Read baseline governance from [.agent-context/rules/](.agent-context/rules).
43
- 3. Apply request templates from [.agent-context/prompts/](.agent-context/prompts).
44
- 4. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
45
- 5. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
46
- 6. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
47
- 7. Use dynamic stack and architecture reasoning from project context docs and live research signals.
41
+ 1. Load [.instructions.md](.instructions.md) first as the canonical baseline.
42
+ 2. If \`.agent-instructions.md\` exists, read it next as the compiled project-specific snapshot.
43
+ 3. Read baseline governance from [.agent-context/rules/](.agent-context/rules).
44
+ 4. Apply request templates from [.agent-context/prompts/](.agent-context/prompts).
45
+ 5. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
46
+ 6. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
47
+ 7. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
48
+ 8. Use dynamic stack and architecture reasoning from project context docs and live research signals.
48
49
 
49
50
  ## Trigger Rules
50
51
 
@@ -67,12 +68,13 @@ The canonical policy source for this repository is [.instructions.md](../.instru
67
68
 
68
69
  ## Required Load Order
69
70
 
70
- 1. Read [.instructions.md](../.instructions.md) first.
71
- 2. Read baseline rules in [.agent-context/rules/](../.agent-context/rules).
72
- 3. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
73
- 4. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
74
- 5. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
75
- 6. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
71
+ 1. Read [.instructions.md](../.instructions.md) first as the canonical baseline.
72
+ 2. If \`.agent-instructions.md\` exists, read it next as the compiled project-specific snapshot.
73
+ 3. Read baseline rules in [.agent-context/rules/](../.agent-context/rules).
74
+ 4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
75
+ 5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
76
+ 6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
77
+ 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
76
78
 
77
79
  ## Completion Gate
78
80
 
@@ -91,12 +93,13 @@ Canonical policy source: [.instructions.md](../.instructions.md).
91
93
 
92
94
  ## Bootstrap Sequence
93
95
 
94
- 1. Load [.instructions.md](../.instructions.md) first.
95
- 2. Apply baseline rules from [.agent-context/rules/](../.agent-context/rules).
96
- 3. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
97
- 4. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
98
- 5. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
99
- 6. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
96
+ 1. Load [.instructions.md](../.instructions.md) first as the canonical baseline.
97
+ 2. If \`.agent-instructions.md\` exists, read it next as the compiled project-specific snapshot.
98
+ 3. Apply baseline rules from [.agent-context/rules/](../.agent-context/rules).
99
+ 4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
100
+ 5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
101
+ 6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
102
+ 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
100
103
 
101
104
  ## Completion Gate
102
105
 
@@ -287,6 +287,8 @@ const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
287
287
  '`crossViewportAdaptation.mutationRules.mobile/tablet/desktop`',
288
288
  '`motionSystem`',
289
289
  '`componentMorphology`',
290
+ 'Do not reuse a color palette, component skin, or motion signature from prior chats, memories, or unrelated projects',
291
+ 'If no approved reference system exists, synthesize the design from zero using current product context, constraints, and content only.',
290
292
  ],
291
293
  },
292
294
  {
@@ -328,6 +330,58 @@ const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
328
330
  ],
329
331
  },
330
332
  ];
333
+ const REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS = [
334
+ {
335
+ path: '.instructions.md',
336
+ snippets: [
337
+ 'docker-runtime.md',
338
+ 'For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets.',
339
+ ],
340
+ },
341
+ {
342
+ path: '.agent-context/rules/docker-runtime.md',
343
+ snippets: [
344
+ 'latest official Docker documentation first',
345
+ 'Docker Compose Quickstart',
346
+ 'Compose file reference',
347
+ 'Dockerfile best practices',
348
+ 'Prefer current `docker compose` workflows and `compose.yaml`.',
349
+ 'Do not add the top-level Compose `version` field by default.',
350
+ 'Prefer the latest stable compatible Docker base image',
351
+ ],
352
+ },
353
+ {
354
+ path: '.agent-context/prompts/init-project.md',
355
+ snippets: [
356
+ '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.',
357
+ '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.',
358
+ ],
359
+ },
360
+ ];
361
+ const REQUIRED_DEPENDENCY_FRESHNESS_AUTOMATION_SNIPPETS = [
362
+ {
363
+ path: '.instructions.md',
364
+ snippets: [
365
+ 'prefer the latest stable compatible dependency set and official setup flow',
366
+ ],
367
+ },
368
+ {
369
+ path: '.agent-context/rules/efficiency-vs-hype.md',
370
+ snippets: [
371
+ 'Latest-Compatible-First Rule',
372
+ 'latest stable compatible dependency version',
373
+ 'official scaffolder or setup command',
374
+ 'Only step down to an older dependency version after documenting',
375
+ ],
376
+ },
377
+ {
378
+ path: '.agent-context/prompts/init-project.md',
379
+ snippets: [
380
+ 'latest stable compatible dependency set and official framework setup flow first',
381
+ 'Prefer official framework setup commands or canonical starter flows',
382
+ ],
383
+ },
384
+ ];
331
385
  const FORBIDDEN_TEMPLATE_BOOTSTRAP_SNIPPETS = [
332
386
  {
333
387
  path: 'lib/cli/project-scaffolder.mjs',
@@ -778,6 +832,12 @@ async function validatePackageMetadata() {
778
832
  } else {
779
833
  pass('package.json has no unnecessary devDependencies');
780
834
  }
835
+
836
+ if (Array.isArray(packageJson.files) && packageJson.files.includes('.instructions.md')) {
837
+ pass('package.json publishes canonical .instructions.md');
838
+ } else {
839
+ fail('package.json must publish .instructions.md so init and upgrade can copy the canonical root instructions file');
840
+ }
781
841
  }
782
842
 
783
843
  async function validatePolicyFile() {
@@ -1141,6 +1201,50 @@ async function validateUiDesignAutomationCoverage() {
1141
1201
  }
1142
1202
  }
1143
1203
 
1204
+ async function validateDockerRuntimeAutomationCoverage() {
1205
+ console.log('\nChecking Docker runtime automation coverage...');
1206
+
1207
+ for (const coverageRule of REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS) {
1208
+ const absoluteCoveragePath = join(ROOT_DIR, coverageRule.path);
1209
+
1210
+ if (!(await fileExists(absoluteCoveragePath))) {
1211
+ fail(`Missing Docker runtime automation source: ${coverageRule.path}`);
1212
+ continue;
1213
+ }
1214
+
1215
+ const coverageContent = await readTextFile(absoluteCoveragePath);
1216
+ for (const requiredSnippet of coverageRule.snippets) {
1217
+ if (coverageContent.includes(requiredSnippet)) {
1218
+ pass(`${coverageRule.path} includes Docker runtime automation snippet: ${requiredSnippet}`);
1219
+ } else {
1220
+ fail(`${coverageRule.path} is missing Docker runtime automation snippet: ${requiredSnippet}`);
1221
+ }
1222
+ }
1223
+ }
1224
+ }
1225
+
1226
+ async function validateDependencyFreshnessAutomationCoverage() {
1227
+ console.log('\nChecking dependency freshness automation coverage...');
1228
+
1229
+ for (const coverageRule of REQUIRED_DEPENDENCY_FRESHNESS_AUTOMATION_SNIPPETS) {
1230
+ const absoluteCoveragePath = join(ROOT_DIR, coverageRule.path);
1231
+
1232
+ if (!(await fileExists(absoluteCoveragePath))) {
1233
+ fail(`Missing dependency freshness automation source: ${coverageRule.path}`);
1234
+ continue;
1235
+ }
1236
+
1237
+ const coverageContent = await readTextFile(absoluteCoveragePath);
1238
+ for (const requiredSnippet of coverageRule.snippets) {
1239
+ if (coverageContent.includes(requiredSnippet)) {
1240
+ pass(`${coverageRule.path} includes dependency freshness automation snippet: ${requiredSnippet}`);
1241
+ } else {
1242
+ fail(`${coverageRule.path} is missing dependency freshness automation snippet: ${requiredSnippet}`);
1243
+ }
1244
+ }
1245
+ }
1246
+ }
1247
+
1144
1248
  async function validateDeterministicBoundaryEnforcementCoverage() {
1145
1249
  console.log('\nChecking deterministic boundary enforcement coverage...');
1146
1250
 
@@ -1411,6 +1515,8 @@ async function main() {
1411
1515
  await validateTemplateFreeBootstrapCoverage();
1412
1516
  await validateUpgradeUiContractWarningCoverage();
1413
1517
  await validateUiDesignAutomationCoverage();
1518
+ await validateDockerRuntimeAutomationCoverage();
1519
+ await validateDependencyFreshnessAutomationCoverage();
1414
1520
  await validateDeterministicBoundaryEnforcementCoverage();
1415
1521
  await validateStackResearchSnapshotState();
1416
1522
  await validateMcpConfiguration();