@ryuenn3123/agentic-senior-core 3.0.17 → 3.0.19

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 (34) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +16 -7
  2. package/.agent-context/rules/frontend-architecture.md +5 -5
  3. package/.agent-context/state/memory-continuity-benchmark.json +1 -1
  4. package/.cursorrules +1 -1
  5. package/.gemini/instructions.md +1 -1
  6. package/.github/copilot-instructions.md +1 -1
  7. package/.instructions.md +1 -1
  8. package/.windsurfrules +1 -1
  9. package/AGENTS.md +1 -1
  10. package/lib/cli/project-scaffolder/design-contract.mjs +363 -314
  11. package/lib/cli/project-scaffolder/prompt-builders.mjs +28 -22
  12. package/lib/cli/project-scaffolder/storage.mjs +0 -2
  13. package/package.json +2 -2
  14. package/scripts/frontend-usability-audit.mjs +19 -8
  15. package/scripts/mcp-server/constants.mjs +60 -0
  16. package/scripts/mcp-server/tool-registry.mjs +149 -0
  17. package/scripts/mcp-server/tools.mjs +446 -0
  18. package/scripts/mcp-server.mjs +23 -661
  19. package/scripts/release-gate/audit-checks.mjs +426 -0
  20. package/scripts/release-gate/constants.mjs +53 -0
  21. package/scripts/release-gate/runtime.mjs +63 -0
  22. package/scripts/release-gate/static-checks.mjs +182 -0
  23. package/scripts/release-gate.mjs +12 -793
  24. package/scripts/ui-design-judge/constants.mjs +24 -0
  25. package/scripts/ui-design-judge/design-execution-summary.mjs +233 -0
  26. package/scripts/ui-design-judge/git-input.mjs +131 -0
  27. package/scripts/ui-design-judge/prompting.mjs +73 -0
  28. package/scripts/ui-design-judge/providers.mjs +102 -0
  29. package/scripts/ui-design-judge/reporting.mjs +181 -0
  30. package/scripts/ui-design-judge/rubric-calibration.mjs +211 -0
  31. package/scripts/ui-design-judge/rubric-goldset.json +188 -0
  32. package/scripts/ui-design-judge.mjs +105 -774
  33. package/scripts/ui-rubric-calibration.mjs +35 -0
  34. package/scripts/validate/config.mjs +69 -16
@@ -98,12 +98,10 @@ export function buildDesignBootstrapPrompt({
98
98
  discoveryAnswers,
99
99
  initContext,
100
100
  docsLanguage,
101
- architectureRecommendation,
102
101
  }) {
103
102
  const designIntentSeed = buildDesignIntentSeed({
104
103
  discoveryAnswers,
105
104
  initContext,
106
- architectureRecommendation,
107
105
  });
108
106
 
109
107
  return [
@@ -153,14 +151,16 @@ export function buildDesignBootstrapPrompt({
153
151
  '12. motionSystem',
154
152
  '13. componentMorphology',
155
153
  '14. accessibilityPolicy',
156
- '15. visualQaPolicy',
157
- '16. contextHygiene',
158
- '17. experiencePrinciples',
159
- '18. forbiddenPatterns',
160
- '19. validationHints',
161
- '20. requiredDesignSections',
162
- '21. implementation',
163
- '22. repoEvidence when onboarding or detector evidence exists',
154
+ '15. designExecutionPolicy',
155
+ '16. designExecutionHandoff',
156
+ '17. reviewRubric',
157
+ '18. contextHygiene',
158
+ '19. experiencePrinciples',
159
+ '20. forbiddenPatterns',
160
+ '21. validationHints',
161
+ '22. requiredDesignSections',
162
+ '23. implementation',
163
+ '24. repoEvidence when onboarding or detector evidence exists',
164
164
  '',
165
165
  '## Hard Rules',
166
166
  '1. No copy-paste from external style guides.',
@@ -177,12 +177,16 @@ export function buildDesignBootstrapPrompt({
177
177
  '12. 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.',
178
178
  '13. Treat WCAG 2.2 AA as the hard accessibility floor. Use APCA only as advisory perceptual tuning, never as a reason to waive a WCAG failure.',
179
179
  '14. Accessibility planning must explicitly cover focus visibility, focus appearance, target size, accessible authentication, keyboard access, and dynamic status/state access.',
180
- '15. Hybrid visual QA must stay deterministic-first. Define screenshot-baseline expectations, dynamic masking rules, noise thresholds, required mobile/tablet/desktop coverage, and long-page capture strategy before relying on semantic review.',
181
- '16. Do not treat one screenshot as enough for a long page. Require above-fold capture, full-page capture when stable, and anchor-based section or tiled-scroll captures for deep pages.',
182
- '17. Only escalate visual diffs to a semantic judge when deterministic evidence shows meaningful drift or missing required coverage.',
183
- '18. Treat prior website memory, unrelated project aesthetics, and remembered screenshots as tainted context unless the user explicitly approves continuity.',
184
- '19. Design continuity is opt-in. If no approved continuity exists, synthesize from the current repo evidence, current brief, and current project docs only.',
185
- '20. Make at least one memorable visual bet so the resulting system is recognizable and not template-neutral.',
180
+ '15. Structured design execution must stay representation-first. Define a surface plan, component graph, content-priority map, viewport mutation plan, and interaction-state matrix before relying on semantic review.',
181
+ '16. design-intent.json must carry an explicit structured handoff, not just policy flags. The handoff should make surface plans, component relationships, task flow, and signature moves executable before coding starts.',
182
+ '17. Do not depend on screenshot capture, browser automation, or image diff artifacts as the default path. The contract must be strong enough to guide precise UI from repo evidence, component logic, and user intent alone.',
183
+ '18. Semantic review should judge contract fidelity, distinctiveness, hierarchy, state behavior, and viewport mutation directly from the contract and changed UI code.',
184
+ '19. Treat prior website memory, unrelated project aesthetics, and remembered screenshots as tainted context unless the user explicitly approves continuity.',
185
+ '20. Design continuity is opt-in. If no approved continuity exists, synthesize from the current repo evidence, current brief, and current project docs only.',
186
+ '21. Make at least one memorable visual bet so the resulting system is recognizable and not template-neutral.',
187
+ '22. Define a stable review rubric for distinctiveness, contract fidelity, visual consistency, heuristic UX quality, and motion discipline.',
188
+ '23. Genericity findings must name the actual drift signal. Do not label something generic without explaining the anti-pattern or rubric dimension.',
189
+ '24. Separate taste from failure. Bold direction is allowed when it still follows the contract, serves the product, and stays accessible.',
186
190
  '',
187
191
  '## Project Inputs',
188
192
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -193,7 +197,7 @@ export function buildDesignBootstrapPrompt({
193
197
  `- Blueprint: ${toTitleCase(initContext.blueprintFileName)}`,
194
198
  '',
195
199
  '## Seed Machine Contract',
196
- 'Refine this seed instead of discarding it. Keep the final JSON aligned with the markdown design system.',
200
+ 'Refine this scaffold seed instead of discarding it. Keep the structural fields that are already valid, but replace placeholder expressive direction with project-specific reasoning grounded in repo evidence and the active brief.',
197
201
  '```json',
198
202
  designIntentSeed.trim(),
199
203
  '```',
@@ -203,11 +207,13 @@ export function buildDesignBootstrapPrompt({
203
207
  '2. Create or update docs/design-intent.json with machine-readable design intent.',
204
208
  '3. Keep both files synchronized: the markdown explains the rationale and the JSON captures the machine-readable contract.',
205
209
  '4. Encode accessibility as a split policy: WCAG 2.2 AA hard floor, APCA advisory readability tuning, and explicit hard-vs-advisory checks.',
206
- '5. Encode hybrid visual QA as policy: deterministic-first screenshot review, approved masking categories, stability thresholds, required mobile/tablet/desktop coverage, long-page capture strategy, and semantic escalation boundaries.',
207
- '6. Make long-page handling explicit: above-fold capture, full-page capture when stable, and anchor-based section or tiled-scroll captures when one image would miss deep content.',
208
- '7. Preserve repoEvidence.designEvidenceSummary when onboarding or detector evidence exists instead of discarding it.',
209
- '8. Ensure both files stay project-specific, dynamic, and practical for implementation and review.',
210
- '9. After the contract exists, use it as a first-class source for future UI tasks.',
210
+ '5. Encode structured design execution as policy: representation strategy, surface plan, component graph, content-priority map, viewport mutation plan, interaction-state matrix, semantic review focus, and structured handoff requirements.',
211
+ '6. Encode an explicit structured handoff inside docs/design-intent.json: surface plan, component graph, content-priority map, viewport mutation plan, interaction-state matrix, task-flow narrative, and signature move rationale.',
212
+ '7. Encode a stable review rubric: required dimensions, genericity signals, valid bold signals, and reporting rules that separate taste from real failure.',
213
+ '8. Make the handoff executable without screenshot dependency. The contract should still guide high-precision UI generation from repo evidence and changed code alone.',
214
+ '9. Preserve repoEvidence.designEvidenceSummary when onboarding or detector evidence exists instead of discarding it.',
215
+ '10. Ensure both files stay project-specific, dynamic, and practical for implementation and review.',
216
+ '11. After the contract exists, use it as a first-class source for future UI tasks.',
211
217
  '',
212
218
  ].join('\n');
213
219
  }
@@ -66,7 +66,6 @@ export async function generateProjectDocumentation(
66
66
  discoveryAnswers,
67
67
  initContext: synthesisContext,
68
68
  docsLanguage: normalizedDocsLanguage,
69
- architectureRecommendation,
70
69
  });
71
70
  await fs.writeFile(path.join(promptsDirectoryPath, designPromptFileName), designPromptContent, 'utf8');
72
71
  generatedPromptFileNames.push(designPromptFileName);
@@ -75,7 +74,6 @@ export async function generateProjectDocumentation(
75
74
  const designIntentSeedContent = buildDesignIntentSeed({
76
75
  discoveryAnswers,
77
76
  initContext: synthesisContext,
78
- architectureRecommendation,
79
77
  });
80
78
  await fs.writeFile(path.join(docsDirectoryPath, designIntentSeedFileName), designIntentSeedContent, 'utf8');
81
79
  materializedFileNames.push(designIntentSeedFileName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.17",
3
+ "version": "3.0.19",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -66,6 +66,6 @@
66
66
  "report:docs-quality-drift": "node ./scripts/docs-quality-drift-report.mjs",
67
67
  "report:governance-weekly": "node ./scripts/governance-weekly-report.mjs",
68
68
  "validate": "node ./scripts/validate.mjs",
69
- "test": "node --test ./tests/cli-smoke.test.mjs ./tests/mcp-server.test.mjs ./tests/llm-judge.test.mjs ./tests/enterprise-ops.test.mjs"
69
+ "test": "node --test ./tests/cli-smoke.test.mjs ./tests/mcp-server.test.mjs ./tests/llm-judge.test.mjs ./tests/ui-rubric-calibration.test.mjs ./tests/enterprise-ops.test.mjs"
70
70
  }
71
71
  }
@@ -23,6 +23,9 @@ const REQUIRED_FILES = [
23
23
  '.instructions.md',
24
24
  '.agent-context/prompts/bootstrap-design.md',
25
25
  'scripts/ui-design-judge.mjs',
26
+ 'scripts/ui-rubric-calibration.mjs',
27
+ 'scripts/ui-design-judge/rubric-calibration.mjs',
28
+ 'scripts/ui-design-judge/rubric-goldset.json',
26
29
  '.agent-context/rules/frontend-architecture.md',
27
30
  '.agent-context/review-checklists/pr-checklist.md',
28
31
  '.agent-context/review-checklists/architecture-review.md',
@@ -60,8 +63,8 @@ const REQUIRED_FRONTEND_RULE_SNIPPETS = [
60
63
  'repo evidence wins',
61
64
  'WCAG 2.2 AA as the hard compliance floor',
62
65
  'APCA as an advisory readability model',
63
- 'Hybrid Visual QA Boundaries (Mandatory)',
64
- 'Visual QA must be deterministic-first.',
66
+ 'Structured Design Execution Boundaries (Mandatory)',
67
+ 'UI review must stay representation-first.',
65
68
  'UI Consistency Guardrails (Mandatory)',
66
69
  'Content language must stay consistent per screen and flow unless user requests multilingual output.',
67
70
  'Text color must remain contrast-safe against its background; no color collisions.',
@@ -78,12 +81,15 @@ const REQUIRED_BOOTSTRAP_DESIGN_SNIPPETS = [
78
81
  'motionSystem',
79
82
  'componentMorphology',
80
83
  'accessibilityPolicy',
81
- 'visualQaPolicy',
84
+ 'designExecutionPolicy',
85
+ 'designExecutionHandoff',
86
+ 'reviewRubric',
82
87
  'contextHygiene',
83
88
  'Design continuity is opt-in.',
84
89
  'WCAG 2.2 AA as the blocking baseline',
85
90
  'APCA only as advisory perceptual tuning',
86
- 'Hybrid visual QA must stay deterministic-first',
91
+ 'Structured design execution must stay representation-first',
92
+ 'structured handoff',
87
93
  ];
88
94
 
89
95
  const REQUIRED_UI_DESIGN_JUDGE_SNIPPETS = [
@@ -92,9 +98,14 @@ const REQUIRED_UI_DESIGN_JUDGE_SNIPPETS = [
92
98
  'Runs only in advisory mode for this repository workflow.',
93
99
  'Do not reward generic SaaS defaults or popular template patterns.',
94
100
  'UI design judge only evaluates changed UI surfaces.',
95
- 'Deterministic visual diff reported no meaningful drift, so semantic review was skipped.',
96
- 'UI_VISUAL_DIFF_REPORT_JSON',
97
- 'meaningfulDiffViewportCount',
101
+ 'Structured design execution summary was supplied to semantic review.',
102
+ 'designExecutionSignalCount',
103
+ 'designExecutionPolicy',
104
+ 'designExecutionHandoff',
105
+ 'reviewRubric',
106
+ 'genericityStatus',
107
+ 'handoffReady',
108
+ 'calibratedStatus',
98
109
  ];
99
110
 
100
111
  const REQUIRED_INSTRUCTIONS_SNIPPETS = [
@@ -106,7 +117,7 @@ const REQUIRED_INSTRUCTIONS_SNIPPETS = [
106
117
  'explicitly approved reference systems',
107
118
  'WCAG 2.2 AA as the hard compliance floor',
108
119
  'APCA as advisory perceptual tuning only',
109
- 'deterministic screenshot or diff evidence as the first layer',
120
+ 'Do not require screenshot capture as a baseline dependency',
110
121
  ];
111
122
 
112
123
  const REQUIRED_DESIGN_EVIDENCE_SNIPPETS = [
@@ -0,0 +1,60 @@
1
+ // @ts-check
2
+
3
+ import { existsSync, readFileSync } from 'node:fs';
4
+ import { dirname, resolve } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const SCRIPT_FILE_PATH = fileURLToPath(import.meta.url);
8
+ export const REPOSITORY_ROOT = resolve(dirname(SCRIPT_FILE_PATH), '..', '..');
9
+ export const STATE_DIRECTORY = resolve(REPOSITORY_ROOT, '.agent-context', 'state');
10
+ export const DEFAULT_PROTOCOL_VERSION = '2024-11-05';
11
+ export const DEFAULT_FETCH_TIMEOUT_MS = 15000;
12
+ export const DEFAULT_FETCH_MAX_CHARS = 6000;
13
+ export const MAX_FETCH_MAX_CHARS = 20000;
14
+ export const DEFAULT_TREND_WINDOW_DAYS = 90;
15
+ export const MAX_TREND_PACKAGES = 10;
16
+ export const FALLBACK_PACKAGE_VERSION = '0.0.0-local';
17
+
18
+ function resolvePackageVersion() {
19
+ try {
20
+ const parsedPackageManifest = JSON.parse(
21
+ readFileSync(resolve(REPOSITORY_ROOT, 'package.json'), 'utf8')
22
+ );
23
+ const rawVersion = typeof parsedPackageManifest?.version === 'string'
24
+ ? parsedPackageManifest.version.trim()
25
+ : '';
26
+
27
+ return rawVersion || FALLBACK_PACKAGE_VERSION;
28
+ } catch {
29
+ return FALLBACK_PACKAGE_VERSION;
30
+ }
31
+ }
32
+
33
+ export const PACKAGE_VERSION = resolvePackageVersion();
34
+
35
+ export const TEST_SUITE_ARGS = {
36
+ full: ['--test', './tests/cli-smoke.test.mjs', './tests/mcp-server.test.mjs', './tests/llm-judge.test.mjs', './tests/enterprise-ops.test.mjs'],
37
+ cli: ['--test', './tests/cli-smoke.test.mjs'],
38
+ enterprise: ['--test', './tests/enterprise-ops.test.mjs'],
39
+ 'llm-judge': ['--test', './tests/llm-judge.test.mjs'],
40
+ };
41
+
42
+ export const INTERNAL_SCRIPT_PATHS = {
43
+ validate: resolve(REPOSITORY_ROOT, 'scripts', 'validate.mjs'),
44
+ release_gate: resolve(REPOSITORY_ROOT, 'scripts', 'release-gate.mjs'),
45
+ forbidden_content_check: resolve(REPOSITORY_ROOT, 'scripts', 'forbidden-content-check.mjs'),
46
+ };
47
+
48
+ function getAvailableTestSuites() {
49
+ return Object.entries(TEST_SUITE_ARGS)
50
+ .filter(([, commandArguments]) => (
51
+ Array.isArray(commandArguments)
52
+ && commandArguments.length > 1
53
+ && commandArguments
54
+ .slice(1)
55
+ .every((relativeTestPath) => existsSync(resolve(REPOSITORY_ROOT, relativeTestPath)))
56
+ ))
57
+ .map(([suiteName]) => suiteName);
58
+ }
59
+
60
+ export const AVAILABLE_TEST_SUITES = getAvailableTestSuites();
@@ -0,0 +1,149 @@
1
+ // @ts-check
2
+
3
+ import { existsSync } from 'node:fs';
4
+ import { AVAILABLE_TEST_SUITES, INTERNAL_SCRIPT_PATHS } from './constants.mjs';
5
+
6
+ export function buildToolDefinitions() {
7
+ const toolDefinitions = [];
8
+
9
+ if (existsSync(INTERNAL_SCRIPT_PATHS.validate)) {
10
+ toolDefinitions.push({
11
+ name: 'validate',
12
+ description: 'Run repository validation checks.',
13
+ inputSchema: {
14
+ type: 'object',
15
+ properties: {},
16
+ additionalProperties: false,
17
+ },
18
+ });
19
+ }
20
+
21
+ if (AVAILABLE_TEST_SUITES.length > 0) {
22
+ toolDefinitions.push({
23
+ name: 'test',
24
+ description: 'Run test suites (full or targeted).',
25
+ inputSchema: {
26
+ type: 'object',
27
+ properties: {
28
+ suite: {
29
+ type: 'string',
30
+ enum: AVAILABLE_TEST_SUITES,
31
+ description: 'Target test suite. Defaults to the first available suite.',
32
+ },
33
+ },
34
+ additionalProperties: false,
35
+ },
36
+ });
37
+ }
38
+
39
+ if (existsSync(INTERNAL_SCRIPT_PATHS.release_gate)) {
40
+ toolDefinitions.push({
41
+ name: 'release_gate',
42
+ description: 'Run release gate checks.',
43
+ inputSchema: {
44
+ type: 'object',
45
+ properties: {},
46
+ additionalProperties: false,
47
+ },
48
+ });
49
+ }
50
+
51
+ if (existsSync(INTERNAL_SCRIPT_PATHS.forbidden_content_check)) {
52
+ toolDefinitions.push({
53
+ name: 'forbidden_content_check',
54
+ description: 'Run forbidden content scan used by publish gate.',
55
+ inputSchema: {
56
+ type: 'object',
57
+ properties: {},
58
+ additionalProperties: false,
59
+ },
60
+ });
61
+ }
62
+
63
+ toolDefinitions.push(
64
+ {
65
+ name: 'research_fetch',
66
+ description: 'Fetch external documentation/news content and return query-focused excerpts with citation metadata.',
67
+ inputSchema: {
68
+ type: 'object',
69
+ properties: {
70
+ url: {
71
+ type: 'string',
72
+ description: 'Absolute HTTP/HTTPS URL to fetch.',
73
+ },
74
+ query: {
75
+ type: 'string',
76
+ description: 'Optional search query used to extract focused excerpts.',
77
+ },
78
+ maxChars: {
79
+ type: 'integer',
80
+ description: 'Maximum characters to return when query is not provided (default 6000, max 20000).',
81
+ },
82
+ },
83
+ required: ['url'],
84
+ additionalProperties: false,
85
+ },
86
+ },
87
+ {
88
+ name: 'trend_snapshot',
89
+ description: 'Generate ecosystem trend snapshot from npm registry metadata with source timestamps.',
90
+ inputSchema: {
91
+ type: 'object',
92
+ properties: {
93
+ packages: {
94
+ type: 'array',
95
+ items: { type: 'string' },
96
+ description: 'Package names to inspect (max 10).',
97
+ },
98
+ windowDays: {
99
+ type: 'integer',
100
+ description: 'Release activity window in days (default 90).',
101
+ },
102
+ },
103
+ required: ['packages'],
104
+ additionalProperties: false,
105
+ },
106
+ },
107
+ {
108
+ name: 'state_read',
109
+ description: 'Read a file from .agent-context/state for cross-session continuity.',
110
+ inputSchema: {
111
+ type: 'object',
112
+ properties: {
113
+ path: {
114
+ type: 'string',
115
+ description: 'Path relative to .agent-context/state (for example memory-continuity-benchmark.json).',
116
+ },
117
+ },
118
+ required: ['path'],
119
+ additionalProperties: false,
120
+ },
121
+ },
122
+ {
123
+ name: 'state_write',
124
+ description: 'Write a file under .agent-context/state for cross-session continuity updates.',
125
+ inputSchema: {
126
+ type: 'object',
127
+ properties: {
128
+ path: {
129
+ type: 'string',
130
+ description: 'Path relative to .agent-context/state.',
131
+ },
132
+ content: {
133
+ type: 'string',
134
+ description: 'UTF-8 content to write.',
135
+ },
136
+ mode: {
137
+ type: 'string',
138
+ enum: ['overwrite', 'append'],
139
+ description: 'Write mode. Defaults to overwrite.',
140
+ },
141
+ },
142
+ required: ['path', 'content'],
143
+ additionalProperties: false,
144
+ },
145
+ },
146
+ );
147
+
148
+ return toolDefinitions;
149
+ }