@ryuenn3123/agentic-senior-core 3.0.26 → 3.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +14 -3
  2. package/.agent-context/prompts/refactor.md +2 -0
  3. package/.agent-context/prompts/review-code.md +2 -2
  4. package/.agent-context/review-checklists/architecture-review.md +12 -0
  5. package/.agent-context/review-checklists/pr-checklist.md +10 -1
  6. package/.agent-context/rules/api-docs.md +4 -0
  7. package/.agent-context/rules/architecture.md +3 -3
  8. package/.agent-context/rules/database-design.md +9 -0
  9. package/.agent-context/rules/error-handling.md +8 -0
  10. package/.agent-context/rules/event-driven.md +3 -0
  11. package/.agent-context/rules/frontend-architecture.md +2 -0
  12. package/.agent-context/rules/microservices.md +2 -0
  13. package/.agent-context/rules/security.md +11 -0
  14. package/.agent-context/rules/testing.md +8 -0
  15. package/.agent-context/state/memory-continuity-benchmark.json +1 -1
  16. package/.agent-context/state/weekly-governance-report.json +234 -31
  17. package/.cursorrules +1 -1
  18. package/.gemini/instructions.md +3 -2
  19. package/.github/copilot-instructions.md +3 -2
  20. package/.instructions.md +21 -4
  21. package/.windsurfrules +1 -1
  22. package/AGENTS.md +4 -3
  23. package/README.md +4 -3
  24. package/lib/cli/commands/init.mjs +1 -0
  25. package/lib/cli/commands/upgrade.mjs +1 -0
  26. package/lib/cli/compiler.mjs +9 -8
  27. package/lib/cli/memory-continuity.mjs +4 -1
  28. package/lib/cli/project-scaffolder/design-contract.mjs +24 -0
  29. package/lib/cli/project-scaffolder/prompt-builders.mjs +5 -3
  30. package/package.json +1 -1
  31. package/scripts/governance-weekly-report.mjs +138 -1
  32. package/scripts/release-gate/audit-checks.mjs +1 -1
  33. package/scripts/release-gate/constants.mjs +11 -0
  34. package/scripts/rules-guardian-audit.mjs +1 -1
  35. package/scripts/single-source-lazy-loading-audit.mjs +10 -8
  36. package/scripts/sync-thin-adapters.mjs +7 -4
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: e6984d32169e98e32c9e6b6d6209bb2613b63b22d1e66af63a70788be00c55d5
5
+ Canonical Snapshot SHA256: f11969bd96625ecf86c6d02630aa485cd54ead44544f15daf525b72bfc38653f
6
6
 
7
7
  Canonical policy source: [.instructions.md](../.instructions.md).
8
8
 
@@ -10,6 +10,7 @@ If your host stops at this file, follow this minimum floor:
10
10
  - Read `.agent-instructions.md` next when it exists.
11
11
  - For UI or redesign requests, load [.agent-context/prompts/bootstrap-design.md](../.agent-context/prompts/bootstrap-design.md) and [.agent-context/rules/frontend-architecture.md](../.agent-context/rules/frontend-architecture.md) before coding.
12
12
  - If UI scope and `docs/DESIGN.md` or `docs/design-intent.json` is missing, materialize them before UI implementation.
13
+ - For backend/API/data/auth/event requests, load relevant global rules from [.agent-context/rules/](../.agent-context/rules) and do not create stack-specific governance adapters.
13
14
  - Memory continuity is host-dependent project memory and does not replace bootstrap loading.
14
15
 
15
16
  ## Bootstrap Sequence
@@ -20,7 +21,7 @@ If your host stops at this file, follow this minimum floor:
20
21
  4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
21
22
  5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
22
23
  6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
23
- 7. Resolve stack, structure, and dependency choices from project context docs plus live evidence.
24
+ 7. Resolve runtime, structure, and dependency choices from project context docs plus live evidence.
24
25
 
25
26
  ## Completion Gate
26
27
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: e6984d32169e98e32c9e6b6d6209bb2613b63b22d1e66af63a70788be00c55d5
5
+ Canonical Snapshot SHA256: f11969bd96625ecf86c6d02630aa485cd54ead44544f15daf525b72bfc38653f
6
6
 
7
7
  The canonical policy source for this repository is [.instructions.md](../.instructions.md).
8
8
 
@@ -10,6 +10,7 @@ If your host stops at this file, follow this minimum floor:
10
10
  - Read `.agent-instructions.md` next when it exists.
11
11
  - For UI or redesign requests, load [.agent-context/prompts/bootstrap-design.md](../.agent-context/prompts/bootstrap-design.md) and [.agent-context/rules/frontend-architecture.md](../.agent-context/rules/frontend-architecture.md) before coding.
12
12
  - If UI scope and `docs/DESIGN.md` or `docs/design-intent.json` is missing, materialize them before UI implementation.
13
+ - For backend/API/data/auth/event requests, load relevant global rules from [.agent-context/rules/](../.agent-context/rules) and do not create stack-specific governance adapters.
13
14
  - Memory continuity is host-dependent project memory and does not replace bootstrap loading.
14
15
 
15
16
  ## Required Load Order
@@ -20,7 +21,7 @@ If your host stops at this file, follow this minimum floor:
20
21
  4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
21
22
  5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
22
23
  6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
23
- 7. Resolve stack, structure, and dependency choices from project context docs plus live evidence.
24
+ 7. Resolve runtime, structure, and dependency choices from project context docs plus live evidence.
24
25
 
25
26
  ## Completion Gate
26
27
 
package/.instructions.md CHANGED
@@ -40,12 +40,27 @@ Available engineering rule files:
40
40
 
41
41
  **What to do**: Resolve only the rule files relevant to the current task. Do not read the entire rule directory by default. For UI-only work, start with `bootstrap-design.md` and `frontend-architecture.md` and keep backend or DevOps rules unloaded unless the task explicitly crosses those boundaries. 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.
42
42
 
43
+ ### Global Backend/API Governance Routing
44
+
45
+ This is global governance, not a stack-specific adapter system. Do not create Nest, Laravel, FastAPI, Express, Go, Ruby, PHP, Java, or framework-specific baseline adapters from this repository. The LLM may use its general knowledge and current official docs when a concrete project already uses a tool, but the governance layer stays architecture- and runtime-agnostic.
46
+
47
+ When backend/API work is in scope, load only the relevant global rule files:
48
+
49
+ - Data, schema, repository, ORM, query, transaction, migration, pagination, or persistence scope: load `architecture.md`, `database-design.md`, `performance.md`, and `testing.md`.
50
+ - Endpoint, controller, route handler, public API, request/response contract, validation failure, or API error scope: load `architecture.md`, `api-docs.md`, `error-handling.md`, `security.md`, and `testing.md`.
51
+ - Authentication, authorization, secrets, user input, webhook, upload, session, token, or permission scope: load `security.md`, `error-handling.md`, and `testing.md`.
52
+ - Queue, worker, cron, event stream, message broker, async workflow, retry, or cross-system mutation scope: load `event-driven.md`, `database-design.md`, `error-handling.md`, `performance.md`, and `testing.md`.
53
+ - Multi-service, distributed consistency, service boundary, or cross-domain data ownership scope: load `microservices.md`, `event-driven.md`, `database-design.md`, `api-docs.md`, and `architecture.md`.
54
+
55
+ If multiple bullets match, load the union once, then implement against the project framework already present. Do not expand into unrelated stack guides just because a runtime name appears.
56
+
43
57
  ### Layer 2: Runtime Decision Signals (Dynamic)
44
58
 
45
59
  **Location**: dynamic runtime intelligence from project context, repository evidence, and live research.
46
60
 
47
61
  Runtime signals are evidence gates, not style cues or popularity rankings.
48
62
  Do not force the project into a listed stack when repository evidence, delivery constraints, or ecosystem reality require another shape.
63
+ Runtime evidence must not become per-stack governance. Use it to understand the project that already exists, not to choose or inject framework-specific rule adapters.
49
64
 
50
65
  **What to do**: For fresh projects, recommend the runtime/framework from the first brief, current constraints, and live official documentation before coding. For existing projects, inspect repo evidence directly and treat detected markers as evidence only, not migration or design direction. Ignore pattern frequency, external rankings, and remembered defaults.
51
66
 
@@ -169,8 +184,9 @@ Use available MCP tools when you need validation, linting, or test execution.
169
184
  1. Read `.agent-context/prompts/bootstrap-design.md`.
170
185
  2. Read `.agent-context/rules/frontend-architecture.md`.
171
186
  3. Read UI-relevant repository evidence from `.agent-context/state/onboarding-report.json`, current UI code, and `docs/*`.
172
- 4. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation.
173
- 5. Keep context isolated and do not eagerly load unrelated backend-only rules unless the task explicitly touches those boundaries.
187
+ 4. Before UI implementation, record a concrete creative commitment in the design contract: one specific real-world anchor reference, one signature motion behavior, and one typographic decision with meaningful role contrast.
188
+ 5. Generate or refine `docs/DESIGN.md` plus `docs/design-intent.json` before UI implementation.
189
+ 6. Keep context isolated and do not eagerly load unrelated backend-only rules unless the task explicitly touches those boundaries.
174
190
 
175
191
  ---
176
192
 
@@ -194,7 +210,8 @@ Why Required: [why the boundary protects the project]
194
210
  1. All relevant rules from `.agent-context/rules/` applied.
195
211
  2. Code reviewed against `.agent-context/review-checklists/pr-checklist.md` and `.agent-context/review-checklists/architecture-review.md`.
196
212
  3. Universal SOP hard gates satisfied (`docs/architecture-decision-record.md`, and `docs/DESIGN.md` plus `docs/design-intent.json` for UI scope).
197
- 4. MCP validation passed (`npm run validate`).
213
+ 4. If `.agent-context/state/active-memory.json` exists and material project progress happened, refresh it directly before the final response: update current focus, durable achievements/issues/next actions/validation state, and `lastUpdatedAt` while preserving privacy rules and existing user-owned entries.
214
+ 5. MCP validation passed (`npm run validate`).
198
215
 
199
216
  ---
200
217
 
@@ -203,7 +220,7 @@ Why Required: [why the boundary protects the project]
203
220
  Verify that all nine layers are reachable:
204
221
 
205
222
  - Layer 1: Rules
206
- - Layer 2: Stack Strategy Signals
223
+ - Layer 2: Runtime Decision Signals
207
224
  - Layer 3: Structural Planning Signals
208
225
  - Layer 4: Execution Contracts
209
226
  - Layer 5: Prompts
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.26
3
+ Generated by Agentic-Senior-Core CLI v3.0.28
4
4
  Timestamp: 2026-04-24T06:02:48.303Z
5
5
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
6
6
 
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: e6984d32169e98e32c9e6b6d6209bb2613b63b22d1e66af63a70788be00c55d5
5
+ Canonical Snapshot SHA256: f11969bd96625ecf86c6d02630aa485cd54ead44544f15daf525b72bfc38653f
6
6
 
7
7
  This file is an adapter entrypoint for agent discovery.
8
8
  The canonical policy source is [.instructions.md](.instructions.md).
@@ -15,8 +15,9 @@ If your host stops at this file instead of following the full chain, obey the Cr
15
15
  - Memory continuity does not replace bootstrap loading. It is host-dependent project memory, not a guarantee that instructions were reloaded for this session.
16
16
  - For UI, UX, layout, screen, tailwind, frontend, or redesign requests: load [.agent-context/prompts/bootstrap-design.md](.agent-context/prompts/bootstrap-design.md) and [.agent-context/rules/frontend-architecture.md](.agent-context/rules/frontend-architecture.md) before editing code.
17
17
  - For UI scope: if `docs/DESIGN.md` or `docs/design-intent.json` is missing, materialize or refine them before implementing UI changes.
18
+ - For backend, API, data, auth, error, event, queue, worker, or distributed-system requests: load the relevant global rules from [.agent-context/rules/](.agent-context/rules); do not create stack-specific governance adapters.
18
19
  - For refactor, improve, clean up, or fix requests: inspect the active rules and propose a plan before editing.
19
- - For new project or module requests: clarify constraints, stack decisions, and required docs before generating code.
20
+ - For new project or module requests: clarify constraints, runtime decisions, and required docs before generating code.
20
21
  - For ecosystem, framework, dependency, or Docker claims: perform live web research instead of relying on stale local heuristics.
21
22
 
22
23
  ## Mandatory Bootstrap Chain
@@ -28,7 +29,7 @@ If your host stops at this file instead of following the full chain, obey the Cr
28
29
  5. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
29
30
  6. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
30
31
  7. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
31
- 8. Use dynamic stack, structure, and live research signals from project context docs.
32
+ 8. Use runtime evidence, structure, and live research signals from project context docs.
32
33
 
33
34
  ## Trigger Rules
34
35
 
package/README.md CHANGED
@@ -10,10 +10,11 @@
10
10
  **Production-grade Rules Engine (Governance Engine) for AI coding agents.**
11
11
  Works with Cursor, Windsurf, GitHub Copilot, Claude Code, Gemini, and other LLM-powered IDE workflows.
12
12
 
13
- Latest release: 3.0.26 (2026-04-25).
13
+ Latest release: 3.0.28 (2026-04-25).
14
14
 
15
- Highlights in 3.0.26:
16
- - Memory continuity now seeds `.agent-context/state/active-memory.json` once, so new sessions have a compact project-focus snapshot without overwriting active work during upgrade.
15
+ Highlights in 3.0.28:
16
+ - Memory continuity now requires agents to refresh `.agent-context/state/active-memory.json` directly at completion boundaries when material project progress happened.
17
+ - UI design governance now forces an upfront creative commitment: a specific real-world anchor reference, signature motion, and typographic decision before compliance review or implementation.
17
18
  - Token optimization now exposes an output folding strategy that preserves failures, file/line details, and actionable warnings while folding repetitive shell noise.
18
19
  - UI design guidance now treats expressive motion as a first-class default for modern interfaces instead of letting safety wording become an excuse for static screens.
19
20
  - Agents must use live/current-year research for ecosystem, framework, dependency, Docker, and modern UI/library claims instead of offline repository guesses.
@@ -429,6 +429,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
429
429
  '.github/copilot-instructions.md',
430
430
  ],
431
431
  stackLoadingMode: 'lazy',
432
+ domainRuleLoadingMode: 'lazy',
432
433
  selectedProfile: selectedPolicyProfileName,
433
434
  selectedProfileDisplayName: selectedPolicyProfile.displayName,
434
435
  blockingSeverities: selectedPolicyProfile.blockingSeverities,
@@ -253,6 +253,7 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
253
253
  canonicalSource: '.instructions.md',
254
254
  compiledEntrypoints: ['.cursorrules', '.windsurfrules'],
255
255
  stackLoadingMode: 'lazy',
256
+ domainRuleLoadingMode: 'lazy',
256
257
  selectedProfile: selectedProfileName,
257
258
  selectedProfileDisplayName: toTitleCase(selectedProfileName),
258
259
  blockingSeverities: PROFILE_PRESETS[selectedProfileName]?.blockingSeverities || [],
@@ -88,6 +88,7 @@ export async function writeOnboardingReport({
88
88
  ruleLoadingPolicy: {
89
89
  canonicalSource: '.instructions.md',
90
90
  stackLoadingMode: 'lazy',
91
+ domainRuleLoadingMode: 'lazy',
91
92
  loadedOnDemand: true,
92
93
  primaryStack: hasExplicitRuntimeDecision ? selectedStackFileName : null,
93
94
  additionalStacks: hasExplicitRuntimeDecision ? selectedAdditionalStackFileNames : [],
@@ -241,14 +242,14 @@ export async function buildCompiledRulesContent({
241
242
  if (hasExplicitRuntimeDecision && normalizedAdditionalStackFileNames.length > 0) {
242
243
  contextBlocks.push(
243
244
  [
244
- '## LAYER 2B: ADDITIONAL STACK PROFILES',
245
- 'This project uses multiple stacks. Load all additional stack profiles below:',
245
+ '## LAYER 2B: ADDITIONAL RUNTIME EVIDENCE',
246
+ 'This project has multiple runtime constraints. Load additional runtime evidence below only when the task touches that runtime:',
246
247
  ...normalizedAdditionalStackFileNames.map((stackFileName, stackIndex) => {
247
248
  if (availableStackProfileFileNames.has(stackFileName)) {
248
249
  return `${stackIndex + 1}. stack-profile:${stackFileName}`;
249
250
  }
250
251
 
251
- return `${stackIndex + 1}. ${stackFileName} (dynamic stack signal)`;
252
+ return `${stackIndex + 1}. ${stackFileName} (runtime evidence signal)`;
252
253
  }),
253
254
  ].join('\n')
254
255
  );
@@ -261,16 +262,16 @@ export async function buildCompiledRulesContent({
261
262
  ? `Primary runtime constraint: ${selectedStackFileName}`
262
263
  : 'Primary runtime constraint: unresolved until agent recommendation is approved',
263
264
  normalizedAdditionalStackFileNames.length > 0
264
- ? `Additional stack profiles load on demand: ${normalizedAdditionalStackFileNames.map((stackFileName) => {
265
+ ? `Additional runtime evidence loads on demand: ${normalizedAdditionalStackFileNames.map((stackFileName) => {
265
266
  if (availableStackProfileFileNames.has(stackFileName)) {
266
267
  return `stack-profile:${stackFileName}`;
267
268
  }
268
269
 
269
- return `${stackFileName} (dynamic signal)`;
270
+ return `${stackFileName} (runtime evidence signal)`;
270
271
  }).join(', ')}`
271
- : 'Additional runtime guidance loads only when explicitly selected by the user or required by touched code.',
272
- 'Load runtime-specific guidance only when task scope touches that runtime.',
273
- 'Avoid eager loading unrelated runtime guidance to prevent instruction conflicts.',
272
+ : 'No stack-specific governance adapter is loaded by default.',
273
+ 'Load global domain rules only when task scope touches that domain.',
274
+ 'Avoid eager loading unrelated runtime or domain guidance to prevent instruction conflicts.',
274
275
  ].join('\n')
275
276
  );
276
277
 
@@ -522,7 +522,10 @@ export function buildMemoryContinuityGuidanceBlock(memoryContinuityState) {
522
522
  `- Load compact index first (limit: ${sessionStartIndexLimit} entries).`,
523
523
  `- Hydrate full detail only for highest-value entries (limit: ${fullHydrationLimit}).`,
524
524
  '- Always redact sensitive text before persistence (<private> blocks and inline secret-like fields).',
525
- '- Refresh `active-memory.json` at natural task boundaries, but never store secrets, raw chat logs, or stale visual taste.',
525
+ '- Refresh `.agent-context/state/active-memory.json` directly at natural task boundaries when material project progress happened.',
526
+ '- Before the final response, update `project.currentFocus`, compact `progress.lastAchievements`, `progress.pendingIssues`, `progress.nextBestActions`, `progress.validationState`, and `lastUpdatedAt` when they changed.',
527
+ '- Preserve existing user-owned entries, keep each array compact (12 entries or fewer), and append only durable facts proven by current repo evidence.',
528
+ '- If no durable project progress happened, leave the snapshot unchanged and state that no memory update was needed.',
526
529
  '- Current repo evidence, current user brief, and live research override active-memory when they conflict.',
527
530
  '',
528
531
  'Host compatibility scope:',
@@ -152,6 +152,17 @@ function buildDesignIntentContractObject({
152
152
  doNotRevealHiddenCandidateList: true,
153
153
  outputOnlyChosenAnchor: true,
154
154
  },
155
+ creativeCommitmentPolicy: {
156
+ requiredBeforeComplianceReview: true,
157
+ recordInDesignDocs: true,
158
+ requiredCommitmentFields: [
159
+ 'specificReferencePoint',
160
+ 'signatureMotion',
161
+ 'typographicDecision',
162
+ ],
163
+ rejectGenericQualityWordsOnly: true,
164
+ specificityFloor: 'name-a-real-material-instrument-artifact-architecture-editorial-genre-cinematic-behavior-exhibition-system-scientific-apparatus-or-industrial-mechanism',
165
+ },
155
166
  forbiddenFinalAnchorTerms: [
156
167
  'dashboard',
157
168
  'cards',
@@ -184,7 +195,10 @@ function buildDesignIntentContractObject({
184
195
  'name',
185
196
  'agentResearchMode',
186
197
  'sourceDomain',
198
+ 'specificReferencePoint',
187
199
  'rationale',
200
+ 'signatureMotion',
201
+ 'typographicDecision',
188
202
  'derivedTokenLogic',
189
203
  'visualRiskBudget',
190
204
  'motionRiskBudget',
@@ -288,6 +302,7 @@ function buildDesignIntentContractObject({
288
302
  requireContentPriorityMap: true,
289
303
  requireTaskFlowNarrative: true,
290
304
  requireSignatureMoveRationale: true,
305
+ requireCreativeCommitmentGate: true,
291
306
  requireStructuredHandoff: true,
292
307
  requireRepoEvidenceAlignment: true,
293
308
  forbidScreenshotDependency: true,
@@ -406,6 +421,15 @@ function buildDesignIntentContractObject({
406
421
  requiredResetAxes: ['composition', 'hierarchy', 'motion-or-interaction', 'responsive-information-architecture'],
407
422
  },
408
423
  signatureMoveRationale: 'Agent must choose one project-specific visual, motion, typographic, or interaction move and explain why generic fallback weakens it.',
424
+ creativeCommitment: {
425
+ status: 'agent-must-complete-before-ui-implementation',
426
+ requiredFields: [
427
+ 'specificReferencePoint',
428
+ 'signatureMotion',
429
+ 'typographicDecision',
430
+ ],
431
+ failureMode: 'generic quality words without a named real-world reference are not enough',
432
+ },
409
433
  implementationGuardrails: {
410
434
  requireBuildFromHandoff: true,
411
435
  requireGapNotesBeforeFallback: true,
@@ -177,8 +177,10 @@ export function buildDesignBootstrapPrompt({
177
177
  '31. If modern UI, animation, scroll, 3D, canvas, chart, or icon libraries are useful, choose them from current official docs and record source URL, fetched date, reason, risk, and accessibility fallback.',
178
178
  '32. If the user supplies research files, library lists, screenshots, articles, or benchmark notes, read them as candidate evidence, summarize the useful signals, filter by project fit, and verify technology claims against current official docs before implementation.',
179
179
  '33. If no user-supplied research or reference is supplied for UI work, activate the Dynamic Avant-Garde Anchor Engine before coding. User-supplied research means current-task evidence from the user; this scaffold, prior UI, and old design docs do not count as research.',
180
- '34. In Dynamic Avant-Garde mode, perform agent-led research when available, then internally consider at least three high-variance conceptual anchors, discard the two safest or most predictable options, output only the chosen anchor and rationale, and forbid final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.',
181
- '35. The chosen anchor must drive typography, spacing, density, color behavior, morphology, motion, and responsive composition. Treat expressive motion, spatial transitions, micro-interactions, and modern animation libraries as first-class options; include performance notes and reduced-motion fallbacks instead of suppressing motion to look safe.',
180
+ '34. Before broad compliance review, make a creative commitment and record it in the design contract: one specific real-world anchor reference, one signature motion behavior more specific than smooth transitions, and one typographic decision with meaningful role contrast.',
181
+ '35. In Dynamic Avant-Garde mode, perform agent-led research when available, then internally consider at least three high-variance conceptual anchors, discard the two safest or most predictable options, output only the chosen anchor, its specific reference point, and rationale, and forbid final anchors named dashboard, portal, cards, admin panel, SaaS shell, web app shell, or minimalist interface.',
182
+ '36. Reject anchors that can only be described with generic quality words such as modern, clean, premium, expressive, minimal, or bold. The anchor must name a material, instrument, artifact class, architecture, editorial genre, cinematic behavior, exhibition system, scientific apparatus, or industrial mechanism.',
183
+ '37. The chosen anchor must drive typography, spacing, density, color behavior, morphology, motion, and responsive composition. Treat expressive motion, spatial transitions, micro-interactions, and modern animation libraries as first-class options; include performance notes and reduced-motion fallbacks instead of suppressing motion to look safe.',
182
184
  '',
183
185
  '## Project Inputs',
184
186
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -209,7 +211,7 @@ export function buildDesignBootstrapPrompt({
209
211
  '12. Keep visualResetStrategy in the machine-readable handoff so reset-language tasks cannot quietly become restyles of the previous UI.',
210
212
  '13. Preserve externalResearchIntake so user-provided research becomes reviewed evidence without turning into an offline style or dependency preset.',
211
213
  '14. Preserve conceptualAnchor so prompt-only UI work has one cohesive non-template concept instead of a mixed collection of bold but unrelated visual decisions.',
212
- '15. Record conceptualAnchor.agentResearchMode, visualRiskBudget, motionRiskBudget, and cohesionChecks so the final UI cannot quietly fall back to a timid dashboard/admin mental model.',
214
+ '15. Record conceptualAnchor.agentResearchMode, specificReferencePoint, signatureMotion, typographicDecision, visualRiskBudget, motionRiskBudget, and cohesionChecks so the final UI cannot quietly fall back to a timid dashboard/admin mental model.',
213
215
  '16. After the contract exists, use it as a first-class source for future UI tasks.',
214
216
  '',
215
217
  ].join('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.26",
3
+ "version": "3.0.28",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -22,8 +22,22 @@ const ARGUMENT_FLAGS = new Set(process.argv.slice(2));
22
22
  const isStdoutOnlyMode = ARGUMENT_FLAGS.has('--stdout-only');
23
23
  const WEEKLY_WINDOW_DAYS = 7;
24
24
  const HISTORY_LIMIT = 26;
25
+ const BACKEND_REQUIRED_DOMAIN_NAMES = new Set([
26
+ 'backend-architecture',
27
+ 'backend-security',
28
+ 'backend-data-access',
29
+ 'backend-error-handling',
30
+ 'backend-api-contract',
31
+ 'backend-testing',
32
+ 'backend-performance',
33
+ 'backend-idempotency',
34
+ 'backend-risk-map',
35
+ ]);
25
36
  const REQUIRED_VERIFIED_DOMAINS = new Set([
26
37
  'canonical-instructions',
38
+ 'frontend-design-contract',
39
+ 'frontend-architecture',
40
+ ...Array.from(BACKEND_REQUIRED_DOMAIN_NAMES),
27
41
  'pr-checklist',
28
42
  'architecture-review',
29
43
  'mcp-server',
@@ -31,11 +45,100 @@ const REQUIRED_VERIFIED_DOMAINS = new Set([
31
45
  ]);
32
46
  const GOVERNANCE_SURFACE_PATHS = {
33
47
  'canonical-instructions': '.instructions.md',
48
+ 'frontend-design-contract': '.agent-context/prompts/bootstrap-design.md',
49
+ 'frontend-architecture': '.agent-context/rules/frontend-architecture.md',
50
+ 'backend-architecture': '.agent-context/rules/architecture.md',
51
+ 'backend-security': '.agent-context/rules/security.md',
52
+ 'backend-data-access': '.agent-context/rules/database-design.md',
53
+ 'backend-error-handling': '.agent-context/rules/error-handling.md',
54
+ 'backend-api-contract': '.agent-context/rules/api-docs.md',
55
+ 'backend-testing': '.agent-context/rules/testing.md',
56
+ 'backend-performance': '.agent-context/rules/performance.md',
57
+ 'backend-idempotency': '.agent-context/rules/event-driven.md',
58
+ 'backend-risk-map': '.agent-context/state/architecture-map.md',
34
59
  'pr-checklist': '.agent-context/review-checklists/pr-checklist.md',
35
60
  'architecture-review': '.agent-context/review-checklists/architecture-review.md',
36
61
  'mcp-server': 'scripts/mcp-server.mjs',
37
62
  'state-continuity': '.agent-context/state',
38
63
  };
64
+ const BACKEND_GOVERNANCE_COVERAGE = [
65
+ {
66
+ constraint: 'Layered architecture and separation of concerns',
67
+ status: 'covered',
68
+ sourcePaths: [
69
+ '.agent-context/rules/architecture.md',
70
+ '.agent-context/review-checklists/architecture-review.md',
71
+ ],
72
+ signal: 'Transport, application, domain, and infrastructure boundaries are explicit.',
73
+ },
74
+ {
75
+ constraint: 'Global backend/API rule routing',
76
+ status: 'strengthened',
77
+ sourcePaths: [
78
+ '.instructions.md',
79
+ '.agent-context/rules/architecture.md',
80
+ '.agent-context/prompts/refactor.md',
81
+ ],
82
+ signal: 'Backend/API governance routes by problem domain and stays stack-agnostic; no stack-specific governance adapters are created.',
83
+ },
84
+ {
85
+ constraint: 'Zero-trust input validation',
86
+ status: 'strengthened',
87
+ sourcePaths: [
88
+ '.agent-context/rules/security.md',
89
+ '.agent-context/review-checklists/pr-checklist.md',
90
+ ],
91
+ signal: 'User-controlled body, query, params, headers, cookies, files, webhooks, and job payloads must be validated before service logic.',
92
+ },
93
+ {
94
+ constraint: 'Data access performance and integrity',
95
+ status: 'strengthened',
96
+ sourcePaths: [
97
+ '.agent-context/rules/database-design.md',
98
+ '.agent-context/rules/performance.md',
99
+ '.agent-context/state/architecture-map.md',
100
+ ],
101
+ signal: 'Backend reads must avoid N+1 and unbounded list responses; multi-write mutations need transaction or recovery evidence.',
102
+ },
103
+ {
104
+ constraint: 'Distributed consistency and outbox safety',
105
+ status: 'strengthened',
106
+ sourcePaths: [
107
+ '.agent-context/rules/event-driven.md',
108
+ '.agent-context/rules/database-design.md',
109
+ '.agent-context/rules/microservices.md',
110
+ ],
111
+ signal: 'Dual-write flows need outbox or equivalent replay safety, and cross-service consistency must define saga, compensation, or recovery behavior instead of defaulting to two-phase commit.',
112
+ },
113
+ {
114
+ constraint: 'Safe centralized API errors',
115
+ status: 'strengthened',
116
+ sourcePaths: [
117
+ '.agent-context/rules/error-handling.md',
118
+ '.agent-context/rules/api-docs.md',
119
+ ],
120
+ signal: 'HTTP/API responses use safe machine-readable error shapes, may align with RFC 9457 Problem Details, and preserve safe trace/correlation identifiers without leaking internals.',
121
+ },
122
+ {
123
+ constraint: 'Sensitive mutation idempotency',
124
+ status: 'strengthened',
125
+ sourcePaths: [
126
+ '.agent-context/rules/api-docs.md',
127
+ '.agent-context/rules/testing.md',
128
+ '.agent-context/rules/event-driven.md',
129
+ ],
130
+ signal: 'Payments, orders, status changes, and other risky mutations must document and test duplicate-submit behavior.',
131
+ },
132
+ {
133
+ constraint: 'API contract and behavior testing',
134
+ status: 'strengthened',
135
+ sourcePaths: [
136
+ '.agent-context/rules/testing.md',
137
+ '.agent-context/review-checklists/pr-checklist.md',
138
+ ],
139
+ signal: 'API tests cover validation, auth, documented error shapes, pagination defaults, empty states, and mutation retry safety.',
140
+ },
141
+ ];
39
142
 
40
143
  function readJsonOrNull(filePath) {
41
144
  if (!existsSync(filePath)) {
@@ -194,6 +297,37 @@ async function collectSkillTrustSignals() {
194
297
  };
195
298
  }
196
299
 
300
+ function buildBackendGovernancePosture(skillTrustSignals) {
301
+ const backendSurfaceRows = skillTrustSignals.domains.filter((trustRow) => {
302
+ return BACKEND_REQUIRED_DOMAIN_NAMES.has(trustRow.domain);
303
+ });
304
+ const missingBackendSurfaceNames = backendSurfaceRows
305
+ .filter((trustRow) => trustRow.tier !== 'verified')
306
+ .map((trustRow) => trustRow.domain);
307
+ const verifiedSurfaceCount = backendSurfaceRows.length - missingBackendSurfaceNames.length;
308
+
309
+ return {
310
+ status: missingBackendSurfaceNames.length === 0 ? 'verified' : 'needs-attention',
311
+ summary: missingBackendSurfaceNames.length === 0
312
+ ? 'Backend governance is verified across architecture, security, data access, error handling, API contracts, testing, performance, idempotency, and risk-map surfaces.'
313
+ : 'Backend governance is missing one or more required surfaces.',
314
+ requiredSurfaceCount: backendSurfaceRows.length,
315
+ verifiedSurfaceCount,
316
+ missingSurfaceNames: missingBackendSurfaceNames,
317
+ coverage: BACKEND_GOVERNANCE_COVERAGE,
318
+ developmentFocus: [
319
+ {
320
+ focus: 'Keep backend guidance global and stack-agnostic.',
321
+ reason: 'The repo should enforce architecture, security, API, data, error, event, and testing thinking without building Nest, Laravel, FastAPI, Express, Go, or other stack-specific governance adapters.',
322
+ },
323
+ {
324
+ focus: 'Use framework facts only when implementing inside an existing project.',
325
+ reason: 'LLMs can apply current ecosystem knowledge directly; governance should route the relevant global constraints instead of acting as a stack detector.',
326
+ },
327
+ ],
328
+ };
329
+ }
330
+
197
331
  function buildBlockers(qualityTrendReport, skillTrustSignals, commitSignals) {
198
332
  const blockers = [];
199
333
 
@@ -222,6 +356,7 @@ function buildHistoryEntry(weeklyReport) {
222
356
  blockerCount: weeklyReport.releaseReadiness.blockers.length,
223
357
  gatePassRatePercent: weeklyReport.qualitySignals.governanceHealth.gatePassRatePercent,
224
358
  verifiedSkillDomainCount: weeklyReport.skillTrust.tierCounts.verified,
359
+ backendVerifiedSurfaceCount: weeklyReport.backendGovernance?.verifiedSurfaceCount ?? null,
225
360
  releaseFrequencyPercent: weeklyReport.commitSignals.releaseFrequencyPercent,
226
361
  rollbackFrequencyPercent: weeklyReport.commitSignals.rollbackFrequencyPercent,
227
362
  };
@@ -243,6 +378,7 @@ async function runWeeklyGovernanceReport() {
243
378
  const qualityTrendReport = qualityTrendState.report;
244
379
 
245
380
  const skillTrustSignals = await collectSkillTrustSignals();
381
+ const backendGovernance = buildBackendGovernancePosture(skillTrustSignals);
246
382
  const commitSignals = collectCommitSignals(WEEKLY_WINDOW_DAYS);
247
383
  const blockers = buildBlockers(qualityTrendReport, skillTrustSignals, commitSignals);
248
384
 
@@ -267,12 +403,13 @@ async function runWeeklyGovernanceReport() {
267
403
  tokenEfficiency: qualityTrendReport?.tokenEfficiency || null,
268
404
  },
269
405
  skillTrust: skillTrustSignals,
406
+ backendGovernance,
270
407
  commitSignals,
271
408
  releaseReadiness: {
272
409
  isReady: blockers.length === 0,
273
410
  blockers,
274
411
  summary: blockers.length === 0
275
- ? 'Weekly governance posture is ready for maintenance releases.'
412
+ ? 'Weekly governance posture is ready for maintenance releases with frontend and backend governance surfaces verified.'
276
413
  : 'Weekly governance posture is blocked by unresolved readiness signals.',
277
414
  },
278
415
  artifact: {
@@ -312,7 +312,7 @@ export function runAuditReleaseChecks(results, diagnostics) {
312
312
  singleSourceLazyLoadingAuditExecution.report?.lazyRuleLoading?.enforced === true,
313
313
  'lazy-rule-loading-hard-rule',
314
314
  singleSourceLazyLoadingAuditExecution.report?.lazyRuleLoading?.enforced === true
315
- ? 'Language-specific guidance is loaded lazily by detected scope'
315
+ ? 'Global domain governance is loaded lazily by touched scope'
316
316
  : 'Lazy rule loading enforcement failed in single-source lazy-loading audit'
317
317
  );
318
318
  pushResult(
@@ -32,17 +32,24 @@ export const REQUIRED_BACKEND_ARCHITECTURE_RULE_SNIPPETS = [
32
32
  'No premature abstraction.',
33
33
  'Readability over brevity.',
34
34
  'backend and shared core modules',
35
+ 'Do not create or load stack-specific governance adapters as the baseline.',
35
36
  ];
36
37
 
37
38
  export const REQUIRED_BACKEND_REVIEW_CHECKLIST_SNIPPETS = [
38
39
  'No clever hacks in backend and shared core modules',
39
40
  'No premature abstraction (base classes/util layers created only after repeated stable patterns)',
40
41
  'Readability over brevity for maintainability',
42
+ 'Controllers, route handlers, and transport adapters do not contain business policy',
43
+ 'Sensitive mutations include idempotency or duplicate-submit coverage',
44
+ 'Backend/API governance was applied through global domain rules',
41
45
  ];
42
46
 
43
47
  export const REQUIRED_REFACTOR_PROMPT_SNIPPETS = [
44
48
  'Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.',
45
49
  'Prioritize maintainability over compressed one-liners.',
50
+ 'zero-trust input validation',
51
+ 'idempotency for sensitive mutations',
52
+ 'Backend/API governance is global and stack-agnostic.',
46
53
  ];
47
54
 
48
55
  export const REQUIRED_ARCHITECTURE_REVIEW_CHECKLIST_SNIPPETS = [
@@ -50,4 +57,8 @@ export const REQUIRED_ARCHITECTURE_REVIEW_CHECKLIST_SNIPPETS = [
50
57
  'No clever hacks in backend and shared core modules',
51
58
  'No premature abstraction',
52
59
  'Readability over brevity',
60
+ 'Service or use-case code owns orchestration',
61
+ 'Relational reads avoid N+1 patterns',
62
+ 'Global backend/API governance is used directly',
63
+ 'Dual-write database plus message flows use an outbox',
53
64
  ];
@@ -67,7 +67,7 @@ const REQUIRED_PR_CHECKLIST_SNIPPETS = [
67
67
 
68
68
  const REQUIRED_REVIEW_PROMPT_SNIPPETS = [
69
69
  'Review the code with a production-risk mindset.',
70
- 'Do not invent stack-specific concerns unless the repo or changed files prove they apply.',
70
+ 'Do not create stack-specific governance concerns.',
71
71
  ];
72
72
 
73
73
  function pushResult(results, isPassed, checkName, details) {