@ryuenn3123/agentic-senior-core 3.0.15 → 3.0.17

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 (39) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +43 -18
  2. package/.agent-context/rules/architecture.md +13 -0
  3. package/.agent-context/rules/frontend-architecture.md +26 -0
  4. package/.agent-context/state/memory-continuity-benchmark.json +1 -1
  5. package/.agent-context/state/onboarding-report.json +0 -1
  6. package/.cursorrules +66 -29
  7. package/.gemini/instructions.md +7 -1
  8. package/.github/copilot-instructions.md +7 -1
  9. package/.instructions.md +3 -0
  10. package/.windsurfrules +66 -29
  11. package/AGENTS.md +13 -1
  12. package/lib/cli/architect.mjs +71 -784
  13. package/lib/cli/commands/init.mjs +30 -100
  14. package/lib/cli/commands/optimize.mjs +0 -4
  15. package/lib/cli/commands/upgrade.mjs +2 -5
  16. package/lib/cli/compiler.mjs +1 -11
  17. package/lib/cli/constants.mjs +3 -73
  18. package/lib/cli/detector/design-evidence.mjs +427 -0
  19. package/lib/cli/detector.mjs +13 -116
  20. package/lib/cli/init-options.mjs +0 -118
  21. package/lib/cli/memory-continuity.mjs +2 -1
  22. package/lib/cli/project-scaffolder/constants.mjs +68 -0
  23. package/lib/cli/project-scaffolder/design-contract.mjs +857 -0
  24. package/lib/cli/project-scaffolder/discovery.mjs +315 -0
  25. package/lib/cli/project-scaffolder/prompt-builders.mjs +213 -0
  26. package/lib/cli/project-scaffolder/storage.mjs +154 -0
  27. package/lib/cli/project-scaffolder.mjs +32 -1210
  28. package/lib/cli/utils.mjs +2 -11
  29. package/package.json +1 -1
  30. package/scripts/documentation-boundary-audit.mjs +5 -2
  31. package/scripts/frontend-usability-audit.mjs +76 -0
  32. package/scripts/release-gate.mjs +22 -0
  33. package/scripts/sync-thin-adapters.mjs +24 -0
  34. package/scripts/ui-design-judge.mjs +365 -7
  35. package/scripts/validate/config.mjs +446 -0
  36. package/scripts/validate/coverage-checks.mjs +429 -0
  37. package/scripts/validate.mjs +44 -854
  38. package/lib/cli/init-architecture-flow.mjs +0 -233
  39. package/lib/cli/profile-packs.mjs +0 -108
package/lib/cli/utils.mjs CHANGED
@@ -28,7 +28,7 @@ export function printUsage() {
28
28
  console.log('');
29
29
  console.log('Usage:');
30
30
  console.log(' agentic-senior-core launch');
31
- console.log(' agentic-senior-core init [target-directory] [--preset <name>] [--profile <beginner|balanced|strict>] [--profile-pack <name>] [--stack <name>] [--blueprint <name>] [--project-description <text>] [--architect-token-budget <number>] [--architect-timeout-ms <number>] [--architect-research-mode <snapshot|realtime>] [--enable-realtime-research] [--architect-realtime-signal-file <path>] [--ci <true|false>] [--newbie] [--token-optimize] [--no-token-optimize] [--token-agent <name>] [--memory-continuity] [--no-memory-continuity] [--scaffold-docs] [--no-scaffold-docs] [--docs-lang <en|id>] [--project-config <path>] [--runtime-env <auto|linux-wsl|linux|windows|macos>]');
31
+ console.log(' agentic-senior-core init [target-directory] [--preset <name>] [--stack <name>] [--blueprint <name>] [--project-description <text>] [--ci <true|false>] [--token-optimize] [--no-token-optimize] [--token-agent <name>] [--memory-continuity] [--no-memory-continuity] [--scaffold-docs] [--no-scaffold-docs] [--docs-lang <en|id>] [--project-config <path>] [--runtime-env <auto|linux-wsl|linux|windows|macos>]');
32
32
  console.log(' agentic-senior-core upgrade [target-directory] [--dry-run] [--yes] [--mcp-template] [--no-mcp-template] [--prune] [--no-prune]');
33
33
  console.log(' agentic-senior-core optimize [target-directory] [--agent <copilot|claude|cursor|windsurf|gemini|codex|cline>] [--enable|--disable] [--show]');
34
34
  console.log(' agentic-senior-core mcp');
@@ -38,19 +38,10 @@ export function printUsage() {
38
38
  console.log('Options:');
39
39
  console.log(' --help Show help');
40
40
  console.log(' --version Show CLI version');
41
- console.log(' --profile Legacy override for beginner, balanced, or strict (default init path is Golden Standard)');
42
41
  console.log(` --preset Use a plug-and-play starter preset (${presetNames})`);
43
- console.log(' --profile-pack Apply a team profile pack (startup, regulated, platform)');
44
- console.log(' --newbie Legacy alias for --profile beginner');
45
42
  console.log(' --stack Override stack selection');
46
43
  console.log(' --blueprint Override blueprint selection');
47
- console.log(' --project-description Architecture intent text used for stack/blueprint recommendation');
48
- console.log(' --architect-token-budget Max token estimate used by recommendation research (default: 900)');
49
- console.log(' --architect-timeout-ms Max recommendation research time in milliseconds (default: 1500)');
50
- console.log(' --architect-research-mode Recommendation evidence mode (snapshot or realtime; default: realtime in init)');
51
- console.log(' --enable-realtime-research Allow trusted realtime evidence ingestion (enabled by default in init)');
52
- console.log(' --disable-realtime-research Force deterministic snapshot-only baseline in init');
53
- console.log(' --architect-realtime-signal-file Optional JSON payload path for trusted realtime stack/design signals');
44
+ console.log(' --project-description Project intent text used to build an offline architecture brief before agent-led live research');
54
45
  console.log(' --ci Override CI/CD quality checks (guardrails) (true|false)');
55
46
  console.log(' --token-optimize Explicitly enable token optimization policy during init (default behavior)');
56
47
  console.log(' --token-agent Set token optimization agent target (copilot, claude, cursor, windsurf, gemini, codex, cline)');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.15",
3
+ "version": "3.0.17",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -53,7 +53,10 @@ const BOUNDARY_RULES = [
53
53
  ],
54
54
  trigger(filePath) {
55
55
  return !isDocumentationFilePath(filePath)
56
- && /(api|openapi|contract|controller|route|endpoint)/i.test(filePath);
56
+ && (
57
+ /(api|openapi|controller|route|endpoint)/i.test(filePath)
58
+ || /api[-_/]?contract/i.test(filePath)
59
+ );
57
60
  },
58
61
  docsMatcher(filePath) {
59
62
  return filePath === '.agent-context/rules/api-docs.md'
@@ -285,4 +288,4 @@ function runDocumentationBoundaryAudit() {
285
288
  process.exit(reportPayload.passed ? 0 : 1);
286
289
  }
287
290
 
288
- runDocumentationBoundaryAudit();
291
+ runDocumentationBoundaryAudit();
@@ -26,6 +26,7 @@ const REQUIRED_FILES = [
26
26
  '.agent-context/rules/frontend-architecture.md',
27
27
  '.agent-context/review-checklists/pr-checklist.md',
28
28
  '.agent-context/review-checklists/architecture-review.md',
29
+ 'lib/cli/detector/design-evidence.mjs',
29
30
  ];
30
31
 
31
32
  const REQUIRED_ROADMAP_SNIPPETS = [
@@ -53,6 +54,14 @@ const REQUIRED_FRONTEND_RULE_SNIPPETS = [
53
54
  'UI scope trigger signals',
54
55
  'visual intent, interaction quality, and conversion clarity',
55
56
  'template-only repetitive outputs',
57
+ 'Context Hygiene and Reference Boundaries (Mandatory)',
58
+ 'Accessibility Split (Mandatory)',
59
+ 'Design continuity is opt-in.',
60
+ 'repo evidence wins',
61
+ 'WCAG 2.2 AA as the hard compliance floor',
62
+ 'APCA as an advisory readability model',
63
+ 'Hybrid Visual QA Boundaries (Mandatory)',
64
+ 'Visual QA must be deterministic-first.',
56
65
  'UI Consistency Guardrails (Mandatory)',
57
66
  'Content language must stay consistent per screen and flow unless user requests multilingual output.',
58
67
  'Text color must remain contrast-safe against its background; no color collisions.',
@@ -62,10 +71,19 @@ const REQUIRED_FRONTEND_RULE_SNIPPETS = [
62
71
  const REQUIRED_BOOTSTRAP_DESIGN_SNIPPETS = [
63
72
  'UI Design Mode is context-isolated by default:',
64
73
  'Responsive Strategy and Cross-Viewport Adaptation Matrix',
74
+ 'Token Architecture and Alias Strategy',
75
+ 'tokenSystem',
65
76
  'colorTruth.format',
66
77
  'crossViewportAdaptation.mutationRules.mobile/tablet/desktop',
67
78
  'motionSystem',
68
79
  'componentMorphology',
80
+ 'accessibilityPolicy',
81
+ 'visualQaPolicy',
82
+ 'contextHygiene',
83
+ 'Design continuity is opt-in.',
84
+ 'WCAG 2.2 AA as the blocking baseline',
85
+ 'APCA only as advisory perceptual tuning',
86
+ 'Hybrid visual QA must stay deterministic-first',
69
87
  ];
70
88
 
71
89
  const REQUIRED_UI_DESIGN_JUDGE_SNIPPETS = [
@@ -74,6 +92,9 @@ const REQUIRED_UI_DESIGN_JUDGE_SNIPPETS = [
74
92
  'Runs only in advisory mode for this repository workflow.',
75
93
  'Do not reward generic SaaS defaults or popular template patterns.',
76
94
  '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',
77
98
  ];
78
99
 
79
100
  const REQUIRED_INSTRUCTIONS_SNIPPETS = [
@@ -81,6 +102,24 @@ const REQUIRED_INSTRUCTIONS_SNIPPETS = [
81
102
  'bootstrap-design.md',
82
103
  'frontend-architecture.md',
83
104
  'do not eagerly load unrelated backend-only rules',
105
+ 'valid style context',
106
+ 'explicitly approved reference systems',
107
+ 'WCAG 2.2 AA as the hard compliance floor',
108
+ 'APCA as advisory perceptual tuning only',
109
+ 'deterministic screenshot or diff evidence as the first layer',
110
+ ];
111
+
112
+ const REQUIRED_DESIGN_EVIDENCE_SNIPPETS = [
113
+ 'summaryVersion',
114
+ "source: 'lightweight-static-scan'",
115
+ 'cssVariables',
116
+ 'componentInventory',
117
+ 'tokenBypassSignals',
118
+ ];
119
+
120
+ const REQUIRED_COMPILER_UI_EVIDENCE_SNIPPETS = [
121
+ 'frontendEvidenceMetrics',
122
+ 'designEvidenceSummary',
84
123
  ];
85
124
 
86
125
  function assertFileExists(relativeFilePath, failures) {
@@ -111,6 +150,8 @@ function runAudit() {
111
150
  const instructionsPath = '.instructions.md';
112
151
  const prChecklistPath = '.agent-context/review-checklists/pr-checklist.md';
113
152
  const architectureChecklistPath = '.agent-context/review-checklists/architecture-review.md';
153
+ const designEvidenceExtractorPath = 'lib/cli/detector/design-evidence.mjs';
154
+ const compilerPath = 'lib/cli/compiler.mjs';
114
155
 
115
156
  if (existsSync(resolve(REPOSITORY_ROOT, roadmapPath))) {
116
157
  const roadmapContent = readFileSync(resolve(REPOSITORY_ROOT, roadmapPath), 'utf8');
@@ -165,12 +206,47 @@ function runAudit() {
165
206
  );
166
207
  }
167
208
 
209
+ let designEvidenceExtractorContent = '';
210
+ let compilerContent = '';
211
+
212
+ if (existsSync(resolve(REPOSITORY_ROOT, designEvidenceExtractorPath))) {
213
+ designEvidenceExtractorContent = readFileSync(resolve(REPOSITORY_ROOT, designEvidenceExtractorPath), 'utf8');
214
+ assertContains(
215
+ 'Design evidence extractor',
216
+ designEvidenceExtractorPath,
217
+ designEvidenceExtractorContent,
218
+ REQUIRED_DESIGN_EVIDENCE_SNIPPETS,
219
+ failures
220
+ );
221
+ }
222
+
223
+ if (existsSync(resolve(REPOSITORY_ROOT, compilerPath))) {
224
+ compilerContent = readFileSync(resolve(REPOSITORY_ROOT, compilerPath), 'utf8');
225
+ assertContains(
226
+ 'Compiler UI evidence projection',
227
+ compilerPath,
228
+ compilerContent,
229
+ REQUIRED_COMPILER_UI_EVIDENCE_SNIPPETS,
230
+ failures
231
+ );
232
+ }
233
+
168
234
  const reportPayload = {
169
235
  generatedAt: new Date().toISOString(),
170
236
  auditName: 'frontend-usability-audit',
171
237
  passed: failures.length === 0,
172
238
  failureCount: failures.length,
173
239
  failures,
240
+ phase2DesignEvidenceCoverage: {
241
+ extractorFilePath: designEvidenceExtractorPath,
242
+ compilerFilePath: compilerPath,
243
+ extractorIncludesSummaryVersion: designEvidenceExtractorContent.includes('summaryVersion'),
244
+ extractorIncludesCssVariables: designEvidenceExtractorContent.includes('cssVariables'),
245
+ extractorIncludesComponentInventory: designEvidenceExtractorContent.includes('componentInventory'),
246
+ extractorIncludesTokenBypassSignals: designEvidenceExtractorContent.includes('tokenBypassSignals'),
247
+ compilerProjectsFrontendEvidenceMetrics: compilerContent.includes('frontendEvidenceMetrics'),
248
+ compilerProjectsDesignEvidenceSummary: compilerContent.includes('designEvidenceSummary'),
249
+ },
174
250
  };
175
251
 
176
252
  console.log(JSON.stringify(reportPayload, null, 2));
@@ -747,6 +747,28 @@ function runReleaseGate() {
747
747
  'UI design judge unexpectedly ran in blocking mode during release gate'
748
748
  );
749
749
  }
750
+
751
+ const hasHybridVisualQaDiagnostics = typeof uiDesignJudgeExecution.report?.summary?.meaningfulDiffViewportCount === 'number'
752
+ && typeof uiDesignJudgeExecution.report?.deterministicVisual?.reportPresent === 'boolean'
753
+ && Array.isArray(uiDesignJudgeExecution.report?.deterministicVisual?.requiredViewports)
754
+ && typeof uiDesignJudgeExecution.report?.semanticJudge?.attempted === 'boolean'
755
+ && typeof uiDesignJudgeExecution.report?.semanticJudge?.skipped === 'boolean';
756
+
757
+ if (hasHybridVisualQaDiagnostics) {
758
+ pushResult(
759
+ results,
760
+ true,
761
+ 'ui-design-judge-hybrid-diagnostics',
762
+ 'UI design judge reports deterministic visual QA summary and semantic-review state together'
763
+ );
764
+ } else {
765
+ pushResult(
766
+ results,
767
+ false,
768
+ 'ui-design-judge-hybrid-diagnostics',
769
+ 'UI design judge is missing deterministic visual QA or semantic-review machine-readable fields'
770
+ );
771
+ }
750
772
  }
751
773
 
752
774
  const benchmarkGateExecution = runMachineReadableScript(BENCHMARK_GATE_SCRIPT_PATH);
@@ -36,6 +36,18 @@ Canonical Snapshot SHA256: ${canonicalHash}
36
36
  This file is an adapter entrypoint for agent discovery.
37
37
  The canonical policy source is [.instructions.md](.instructions.md).
38
38
 
39
+ If your host stops at this file instead of following the full chain, obey the Critical Bootstrap Floor below before coding.
40
+
41
+ ## Critical Bootstrap Floor
42
+
43
+ - If \`.agent-instructions.md\` exists, prefer it immediately after this file because it is the compiled project-specific snapshot.
44
+ - Memory continuity does not replace bootstrap loading. It is host-dependent project memory, not a guarantee that instructions were reloaded for this session.
45
+ - 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.
46
+ - For UI scope: if \`docs/DESIGN.md\` or \`docs/design-intent.json\` is missing, materialize or refine them before implementing UI changes.
47
+ - For refactor, improve, clean up, or fix requests: inspect the active rules and propose a plan before editing.
48
+ - For new project or module requests: propose architecture before generating code.
49
+ - For ecosystem, framework, dependency, or Docker claims: perform live web research instead of relying on stale local heuristics.
50
+
39
51
  ## Mandatory Bootstrap Chain
40
52
 
41
53
  1. Load [.instructions.md](.instructions.md) first as the canonical baseline.
@@ -66,6 +78,12 @@ Canonical Snapshot SHA256: ${canonicalHash}
66
78
 
67
79
  The canonical policy source for this repository is [.instructions.md](../.instructions.md).
68
80
 
81
+ If your host stops at this file, follow this minimum floor:
82
+ - Read \`.agent-instructions.md\` next when it exists.
83
+ - 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.
84
+ - If UI scope and \`docs/DESIGN.md\` or \`docs/design-intent.json\` is missing, materialize them before UI implementation.
85
+ - Memory continuity is host-dependent project memory and does not replace bootstrap loading.
86
+
69
87
  ## Required Load Order
70
88
 
71
89
  1. Read [.instructions.md](../.instructions.md) first as the canonical baseline.
@@ -91,6 +109,12 @@ Canonical Snapshot SHA256: ${canonicalHash}
91
109
 
92
110
  Canonical policy source: [.instructions.md](../.instructions.md).
93
111
 
112
+ If your host stops at this file, follow this minimum floor:
113
+ - Read \`.agent-instructions.md\` next when it exists.
114
+ - 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.
115
+ - If UI scope and \`docs/DESIGN.md\` or \`docs/design-intent.json\` is missing, materialize them before UI implementation.
116
+ - Memory continuity is host-dependent project memory and does not replace bootstrap loading.
117
+
94
118
  ## Bootstrap Sequence
95
119
 
96
120
  1. Load [.instructions.md](../.instructions.md) first as the canonical baseline.