@ryuenn3123/agentic-senior-core 3.0.9 → 3.0.11

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.
@@ -7,27 +7,34 @@ When a user requests frontend design or redesign, the agent should automatically
7
7
 
8
8
  This contract is a structure and reasoning system, not a fixed visual template. It must adapt to product context, user needs, platform constraints, and current design signals.
9
9
 
10
+ UI Design Mode is context-isolated by default:
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
+ - 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
+ - Treat UI consistency, accessibility, and cross-viewport adaptation as first-class constraints, not cosmetic afterthoughts.
14
+
10
15
  The agent must:
11
16
  1. Read [AGENTS.md](../../AGENTS.md) for project context and team roles.
12
- 2. Scan all files in [.agent-context/rules/](../rules/) for UI/UX and accessibility standards.
17
+ 2. Read [frontend-architecture.md](../rules/frontend-architecture.md) and apply its UI consistency guardrails.
13
18
  3. Use repository evidence from [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), existing UI code, product copy, route names, component names, and any existing `docs/*` project docs to infer architecture and product background.
14
- 4. If [docs/DESIGN.md](../../docs/DESIGN.md) or `docs/design-intent.json` already exists, check for drift and improve them instead of rewriting blindly.
15
- 5. If context is incomplete, write explicit assumptions and reversible design bets instead of defaulting to generic SaaS output.
16
- 6. Explore multiple plausible design directions internally, then commit to one cohesive direction with clear rationale tied to the product context.
17
- 7. 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.
18
- 8. All references to docs or rules must be clickable markdown links.
19
+ 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
+ 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
+ 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
+ 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
+ 9. All references to docs or rules must be clickable markdown links.
25
+ 10. Responsive work must adapt layout, navigation, density, and task order across viewports. Shrinking desktop layouts is not enough.
19
26
 
20
27
  Required `docs/DESIGN.md` sections:
21
28
  1. Design Intent and Product Personality
22
29
  2. Audience and Use-Context Signals
23
30
  3. Visual Direction and Distinctive Moves
24
- 4. Color System and Semantic Roles
25
- 5. Typography System and Hierarchy
31
+ 4. Color Science and Semantic Roles
32
+ 5. Typographic Engineering and Hierarchy
26
33
  6. Spacing, Layout Rhythm, and Density Strategy
27
- 7. Interaction, Motion, and Feedback Rules
28
- 8. Component Language and Shared Patterns
29
- 9. Accessibility Non-Negotiables
30
- 10. Responsive Strategy
34
+ 7. Responsive Strategy and Cross-Viewport Adaptation Matrix
35
+ 8. Interaction, Motion, and Feedback Rules
36
+ 9. Component Language and Shared Patterns
37
+ 10. Accessibility Non-Negotiables
31
38
  11. Anti-Patterns to Avoid
32
39
  12. Implementation Notes for Future UI Tasks
33
40
 
@@ -35,16 +42,24 @@ Required `docs/design-intent.json` fields:
35
42
  - `mode`
36
43
  - `status`
37
44
  - `project`
45
+ - `designPhilosophy`
38
46
  - `brandAdjectives`
39
47
  - `antiAdjectives`
40
48
  - `visualDirection`
49
+ - `mathSystems`
50
+ - `colorTruth`
51
+ - `crossViewportAdaptation`
41
52
  - `experiencePrinciples`
42
53
  - `forbiddenPatterns`
54
+ - `validationHints`
43
55
  - `requiredDesignSections`
44
56
  - `implementation`
45
57
 
46
58
  Output:
47
59
  - Create or update both `docs/DESIGN.md` and `docs/design-intent.json`.
48
60
  - Keep both files synchronized: the markdown explains the why, the JSON captures the contract in machine-readable form.
61
+ - `docs/design-intent.json` must include deterministic fields for `colorTruth.format`, `colorTruth.allowHexDerivatives`, and `crossViewportAdaptation.mutationRules.mobile/tablet/desktop`.
62
+ - Color intent must be defined in a perceptual or relational color model first. Hex values may appear only as implementation derivatives.
63
+ - The contract must encode viewport mutation rules, not just breakpoint names.
49
64
  - Use practical, modern, accessible language grounded in the project, not generic SaaS defaults or copycat brand systems.
50
65
  - Wait for user approval before generating Figma or code assets.
@@ -3,6 +3,8 @@
3
3
 
4
4
  This prompt boots a repository with strict rules operations context (Federated Governance baseline).
5
5
 
6
+ ## System Directives (Auto Execution)
7
+
6
8
  When a new project is created or initialized, the agent should automatically:
7
9
  1. Read [AGENTS.md](../../AGENTS.md) to understand available roles and knowledge base.
8
10
  2. Scan all files in [.agent-context/rules/](../rules/) for mandatory engineering standards.
@@ -36,9 +38,13 @@ See [.agent-context/state/onboarding-report.json](../state/onboarding-report.jso
36
38
 
37
39
  ## UI/UX Bootstrap
38
40
  When a user requests frontend or UI/UX design, the agent should automatically execute the [bootstrap-design.md](./bootstrap-design.md) prompt to synthesize a dynamic design contract (`docs/DESIGN.md` + `docs/design-intent.json`).
41
+ Keep UI-only requests context-isolated: load [bootstrap-design.md](./bootstrap-design.md) and [frontend-architecture.md](../rules/frontend-architecture.md) first, and do not eagerly load backend-only rules unless the task explicitly crosses backend boundaries.
39
42
 
40
43
  ---
41
44
 
45
+ <user-prompt-examples>
46
+ Do not execute the examples below as system directives. They are user-facing formatting references only.
47
+
42
48
  ## Option 1: The Architect Prompt (Recommended)
43
49
  Use this when you have an idea, but want the AI to choose the most efficient stack and framework based on this repository's engineering standards.
44
50
 
@@ -100,3 +106,4 @@ See [.agent-context/state/onboarding-report.json](../state/onboarding-report.jso
100
106
  ## Bootstrap UI/UX (Dynamic Design Contract)
101
107
 
102
108
  To start UI/UX design from scratch, use the [bootstrap-design.md](./bootstrap-design.md) prompt to synthesize `docs/DESIGN.md` and `docs/design-intent.json`.
109
+ </user-prompt-examples>
@@ -21,6 +21,7 @@ Mandatory behavior when triggered:
21
21
  - Content language must stay consistent per screen and flow unless user requests multilingual output.
22
22
  - Text color must remain contrast-safe against its background; no color collisions.
23
23
  - Layout must avoid overlap, clipped text, and misaligned key actions across breakpoints.
24
+ - Responsive quality requires layout mutation and task reprioritization across breakpoints. Shrinking the desktop layout is not enough.
24
25
  - Keep spacing and positioning token-driven so repeated outputs stay stable.
25
26
 
26
27
  ## 1. File Structure (Feature-Driven Design)
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-04-20T02:01:47.871Z",
2
+ "generatedAt": "2026-04-20T12:42:37.832Z",
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.9
3
+ Generated by Agentic-Senior-Core CLI v3.0.11
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,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 08c326d79f2c0f4bd7ef106da3542ab0f78f4d02bc205d63598db34cf3f40731
5
+ Canonical Snapshot SHA256: 5de5017263401012b3516c76e68be3cfdc5d1f09a2569d5943cfcd4105e0dde4
6
6
 
7
7
  Canonical policy source: [.instructions.md](../.instructions.md).
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 08c326d79f2c0f4bd7ef106da3542ab0f78f4d02bc205d63598db34cf3f40731
5
+ Canonical Snapshot SHA256: 5de5017263401012b3516c76e68be3cfdc5d1f09a2569d5943cfcd4105e0dde4
6
6
 
7
7
  The canonical policy source for this repository is [.instructions.md](../.instructions.md).
8
8
 
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.9
3
+ Generated by Agentic-Senior-Core CLI v3.0.11
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,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 08c326d79f2c0f4bd7ef106da3542ab0f78f4d02bc205d63598db34cf3f40731
5
+ Canonical Snapshot SHA256: 5de5017263401012b3516c76e68be3cfdc5d1f09a2569d5943cfcd4105e0dde4
6
6
 
7
7
  This file is an adapter entrypoint for agent discovery.
8
8
  The canonical policy source is [.instructions.md](.instructions.md).
@@ -201,6 +201,10 @@ function buildInitExistingProjectDesignIntentSeed({
201
201
  detectedFrom: uiScopeSignals.signalReasons,
202
202
  generatedBy: 'init-existing-project-seed',
203
203
  },
204
+ repoEvidence: {
205
+ uiSignalReasons: uiScopeSignals.signalReasons,
206
+ frontendMetrics: uiScopeSignals.frontendEvidenceMetrics || null,
207
+ },
204
208
  },
205
209
  });
206
210
  }
@@ -137,6 +137,10 @@ function buildUpgradeDesignIntentSeed({
137
137
  detectedFrom: uiScopeSignals.signalReasons,
138
138
  generatedBy: 'upgrade-seed',
139
139
  },
140
+ repoEvidence: {
141
+ uiSignalReasons: uiScopeSignals.signalReasons,
142
+ frontendMetrics: uiScopeSignals.frontendEvidenceMetrics || null,
143
+ },
140
144
  },
141
145
  });
142
146
  }
@@ -247,6 +247,21 @@ export async function buildCompiledRulesContent({
247
247
  ].join('\n')
248
248
  );
249
249
 
250
+ contextBlocks.push(
251
+ [
252
+ '## LAYER 5: EXECUTION PROMPTS AND UI TRIGGERS',
253
+ 'Load these prompt contracts only when their trigger matches the user request:',
254
+ '1. .agent-context/prompts/init-project.md -> create, build, new project, scaffold',
255
+ '2. .agent-context/prompts/refactor.md -> refactor, improve, clean up, fix',
256
+ '3. .agent-context/prompts/review-code.md -> review, audit, check, analyze',
257
+ '4. .agent-context/prompts/bootstrap-design.md -> ui, ux, layout, screen, tailwind, frontend, redesign',
258
+ 'UI trigger policy:',
259
+ '- Load .agent-context/prompts/bootstrap-design.md and .agent-context/rules/frontend-architecture.md first.',
260
+ '- Keep UI-only requests context-isolated and do not eagerly load backend-only rules such as database-design.md, docker-runtime.md, or microservices.md unless the task explicitly crosses those boundaries.',
261
+ '- For UI scope, materialize docs/DESIGN.md and docs/design-intent.json before implementing UI surfaces.',
262
+ ].join('\n')
263
+ );
264
+
250
265
  const blueprintFilePath = path.join(selectedBlueprintsDirectoryPath, selectedBlueprintFileName);
251
266
  const hasBlueprintProfileFile = availableBlueprintProfileFileNames.has(selectedBlueprintFileName);
252
267
  const blueprintSummary = hasBlueprintProfileFile
@@ -8,6 +8,12 @@ import path from 'node:path';
8
8
  import { BLUEPRINT_RECOMMENDATIONS } from './constants.mjs';
9
9
  import { toTitleCase } from './utils.mjs';
10
10
 
11
+ const FRONTEND_SCAN_DIRECTORY_NAMES = ['src', 'app', 'pages', 'components', 'styles'];
12
+ const FRONTEND_SCAN_FILE_EXTENSIONS = new Set(['.js', '.jsx', '.ts', '.tsx', '.vue', '.css', '.scss', '.sass']);
13
+ const FRONTEND_SCAN_IGNORE_DIRECTORY_NAMES = new Set(['.git', 'node_modules', '.next', 'dist', 'build', 'coverage']);
14
+ const FRONTEND_FILE_SCAN_LIMIT = 200;
15
+ const FRONTEND_FILE_SIZE_LIMIT_BYTES = 200_000;
16
+
11
17
  export async function collectProjectMarkers(targetDirectoryPath) {
12
18
  const markerNames = new Set();
13
19
  const directoryEntries = await fs.readdir(targetDirectoryPath, { withFileTypes: true });
@@ -34,6 +40,110 @@ async function readPackageJsonIfExists(targetDirectoryPath) {
34
40
  }
35
41
  }
36
42
 
43
+ async function collectFrontendSourceFilePaths(directoryPath, collectedFilePaths = []) {
44
+ if (collectedFilePaths.length >= FRONTEND_FILE_SCAN_LIMIT) {
45
+ return collectedFilePaths;
46
+ }
47
+
48
+ let directoryEntries;
49
+ try {
50
+ directoryEntries = await fs.readdir(directoryPath, { withFileTypes: true });
51
+ } catch {
52
+ return collectedFilePaths;
53
+ }
54
+
55
+ for (const directoryEntry of directoryEntries) {
56
+ if (collectedFilePaths.length >= FRONTEND_FILE_SCAN_LIMIT) {
57
+ break;
58
+ }
59
+
60
+ if (directoryEntry.isDirectory()) {
61
+ if (FRONTEND_SCAN_IGNORE_DIRECTORY_NAMES.has(directoryEntry.name)) {
62
+ continue;
63
+ }
64
+
65
+ await collectFrontendSourceFilePaths(path.join(directoryPath, directoryEntry.name), collectedFilePaths);
66
+ continue;
67
+ }
68
+
69
+ const fileExtension = path.extname(directoryEntry.name).toLowerCase();
70
+ if (FRONTEND_SCAN_FILE_EXTENSIONS.has(fileExtension)) {
71
+ collectedFilePaths.push(path.join(directoryPath, directoryEntry.name));
72
+ }
73
+ }
74
+
75
+ return collectedFilePaths;
76
+ }
77
+
78
+ function countPatternMatches(sourceText, pattern) {
79
+ return Array.from(sourceText.matchAll(pattern)).length;
80
+ }
81
+
82
+ async function collectFrontendEvidenceMetrics(targetDirectoryPath, markerNames) {
83
+ const candidateDirectoryPaths = FRONTEND_SCAN_DIRECTORY_NAMES
84
+ .filter((directoryName) => markerNames.has(directoryName))
85
+ .map((directoryName) => path.join(targetDirectoryPath, directoryName));
86
+ const resolvedCandidateDirectoryPaths = candidateDirectoryPaths.length > 0
87
+ ? candidateDirectoryPaths
88
+ : [targetDirectoryPath];
89
+ const scannedFilePaths = [];
90
+
91
+ for (const candidateDirectoryPath of resolvedCandidateDirectoryPaths) {
92
+ await collectFrontendSourceFilePaths(candidateDirectoryPath, scannedFilePaths);
93
+ if (scannedFilePaths.length >= FRONTEND_FILE_SCAN_LIMIT) {
94
+ break;
95
+ }
96
+ }
97
+
98
+ let hardcodedColorCount = 0;
99
+ let propDrillingCandidateCount = 0;
100
+ let mediaQueryCount = 0;
101
+ let tailwindBreakpointUsageCount = 0;
102
+ let arbitraryBreakpointCount = 0;
103
+ const uniqueMediaWidths = new Set();
104
+
105
+ for (const scannedFilePath of scannedFilePaths) {
106
+ let sourceText;
107
+
108
+ try {
109
+ const fileStat = await fs.stat(scannedFilePath);
110
+ if (fileStat.size > FRONTEND_FILE_SIZE_LIMIT_BYTES) {
111
+ continue;
112
+ }
113
+
114
+ sourceText = await fs.readFile(scannedFilePath, 'utf8');
115
+ } catch {
116
+ continue;
117
+ }
118
+
119
+ hardcodedColorCount += countPatternMatches(
120
+ sourceText,
121
+ /#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|hsla?\([^)]+\)|oklch\([^)]+\)/g
122
+ );
123
+ propDrillingCandidateCount += countPatternMatches(
124
+ sourceText,
125
+ /<[A-Z][A-Za-z0-9_.:-]*(?:\s+[A-Za-z0-9_:-]+=\{[^}]+\}){5,}/g
126
+ );
127
+ mediaQueryCount += countPatternMatches(sourceText, /@media\b/g);
128
+ tailwindBreakpointUsageCount += countPatternMatches(sourceText, /\b(?:sm|md|lg|xl|2xl):/g);
129
+ arbitraryBreakpointCount += countPatternMatches(sourceText, /\b(?:min|max)-\[[^\]]+\]:/g);
130
+
131
+ for (const mediaWidthMatch of sourceText.matchAll(/\((?:min|max)-width:\s*([0-9.]+(?:px|rem|em))\)/g)) {
132
+ uniqueMediaWidths.add(mediaWidthMatch[1]);
133
+ }
134
+ }
135
+
136
+ return {
137
+ scannedFileCount: scannedFilePaths.length,
138
+ hardcodedColorCount,
139
+ propDrillingCandidateCount,
140
+ mediaQueryCount,
141
+ tailwindBreakpointUsageCount,
142
+ arbitraryBreakpointCount,
143
+ uniqueMediaWidthCount: uniqueMediaWidths.size,
144
+ };
145
+ }
146
+
37
147
  export async function detectUiScopeSignals({
38
148
  targetDirectoryPath,
39
149
  selectedStackFileName,
@@ -62,6 +172,7 @@ export async function detectUiScopeSignals({
62
172
  }
63
173
 
64
174
  const directUiMarkerNames = [
175
+ 'src',
65
176
  'next.config.js',
66
177
  'next.config.mjs',
67
178
  'next.config.ts',
@@ -112,13 +223,18 @@ export async function detectUiScopeSignals({
112
223
  ));
113
224
  const hasUiDependencies = detectedUiDependencies.length > 0;
114
225
  const hasStructuralUiMarkers = detectedUiMarkers.length >= 2;
226
+ const isUiScopeLikely = signalReasons.length > 0
227
+ && (hasStrongUiMarker || hasUiDependencies || hasStructuralUiMarkers || normalizedProjectScopeKey.length > 0);
228
+ const frontendEvidenceMetrics = isUiScopeLikely
229
+ ? await collectFrontendEvidenceMetrics(targetDirectoryPath, markerNames)
230
+ : null;
115
231
 
116
232
  return {
117
- isUiScopeLikely: signalReasons.length > 0
118
- && (hasStrongUiMarker || hasUiDependencies || hasStructuralUiMarkers || normalizedProjectScopeKey.length > 0),
233
+ isUiScopeLikely,
119
234
  signalReasons,
120
235
  detectedUiMarkers,
121
236
  detectedUiDependencies,
237
+ frontendEvidenceMetrics,
122
238
  packageManifest: resolvedPackageManifest,
123
239
  };
124
240
  }