@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
@@ -0,0 +1,446 @@
1
+ export const ALLOWED_SEVERITIES = new Set(['critical', 'high', 'medium', 'low']);
2
+ export const OVERRIDE_WARNING_WINDOW_DAYS = 30;
3
+ export const THIN_ADAPTER_PATHS = [
4
+ 'AGENTS.md',
5
+ '.github/copilot-instructions.md',
6
+ '.gemini/instructions.md',
7
+ ];
8
+ export const FORMAL_ARTIFACT_PATHS = [
9
+ '.instructions.md',
10
+ 'README.md',
11
+ 'CHANGELOG.md',
12
+ 'docs/deep_analysis_and_roadmap_backlog.md',
13
+ '.agent-context/rules/api-docs.md',
14
+ '.agent-context/review-checklists/pr-checklist.md',
15
+ '.agent-context/prompts/review-code.md',
16
+ 'AGENTS.md',
17
+ '.github/copilot-instructions.md',
18
+ '.gemini/instructions.md',
19
+ ];
20
+ export const REQUIRED_HUMAN_WRITING_SNIPPETS = [
21
+ {
22
+ path: '.agent-context/rules/api-docs.md',
23
+ snippets: [
24
+ '## Human Writing Standard (Mandatory)',
25
+ 'This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations.',
26
+ 'Style baseline findings are advisory by default and must not block endpoint-change commits that already include accurate docs/spec updates.',
27
+ 'No emoji in formal artifacts.',
28
+ ],
29
+ },
30
+ {
31
+ path: '.agent-context/review-checklists/pr-checklist.md',
32
+ snippets: [
33
+ 'Scope applied: This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations',
34
+ 'Style scope review is advisory and does not block merge when API docs are synced in the same commit and contract details are correct',
35
+ 'No emoji in formal documentation or review summaries',
36
+ 'Documentation uses plain English and avoids AI cliches',
37
+ ],
38
+ },
39
+ {
40
+ path: 'docs/deep_analysis_and_roadmap_backlog.md',
41
+ snippets: [
42
+ '## Part 6: Documentation and Explanation Standards (Mandatory)',
43
+ 'This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations.',
44
+ 'No emoji in formal artifacts. This is mandatory.',
45
+ ],
46
+ },
47
+ ];
48
+ export const TERMINOLOGY_REFERENCE_PATHS = [
49
+ 'README.md',
50
+ 'docs/roadmap.md',
51
+ ];
52
+ export const REQUIRED_TERMINOLOGY_ROW_PATTERNS = [
53
+ {
54
+ label: 'Federated Governance -> Federated Rules Operations',
55
+ pattern: /\|\s*Federated Governance\s*\|\s*Federated Rules Operations\s*\|/u,
56
+ },
57
+ {
58
+ label: 'Governance Engine -> Rules Engine',
59
+ pattern: /\|\s*Governance Engine\s*\|\s*Rules Engine\s*\|/u,
60
+ },
61
+ {
62
+ label: 'Guardrails -> Quality Checks',
63
+ pattern: /\|\s*Guardrails\s*\|\s*Quality Checks\s*\|/u,
64
+ },
65
+ ];
66
+ export const REQUIRED_TERMINOLOGY_RULE_SNIPPET =
67
+ 'Rule: on first mention in developer-facing docs, include canonical term in parentheses.';
68
+ export const TERMINOLOGY_REFERENCE_DOCUMENT_PATH = 'docs/terminology-mapping.md';
69
+ export const REQUIRED_DEVELOPER_FIRST_MENTION_PATTERNS = [
70
+ {
71
+ path: 'README.md',
72
+ label: 'Rules Engine first mention includes Governance Engine',
73
+ pattern: /Rules Engine\s*\(Governance Engine\)/u,
74
+ },
75
+ {
76
+ path: 'docs/deep-dive.md',
77
+ label: 'Dynamic Rules Engine first mention includes Governance Engine',
78
+ pattern: /Dynamic Rules Engine\s*\(Governance Engine\)/u,
79
+ },
80
+ {
81
+ path: 'docs/faq.md',
82
+ label: 'Quality Checks first mention includes Guardrails',
83
+ pattern: /Quality Checks\s*\(Guardrails\)/u,
84
+ },
85
+ {
86
+ path: '.agent-context/prompts/init-project.md',
87
+ label: 'Init prompt first mention includes Federated Governance baseline',
88
+ pattern: /rules operations context\s*\(Federated Governance baseline\)/iu,
89
+ },
90
+ {
91
+ path: 'lib/cli/commands/init.mjs',
92
+ label: 'Init command wording includes Federated Governance baseline',
93
+ pattern: /rules operations\s+(assets|pack)[^\n]*\(Federated Governance baseline\)/iu,
94
+ },
95
+ {
96
+ path: 'lib/cli/commands/upgrade.mjs',
97
+ label: 'Upgrade command wording includes Federated Governance baseline',
98
+ pattern: /rules operations upgrade assistant\s*\(Federated Governance baseline\)/iu,
99
+ },
100
+ {
101
+ path: 'lib/cli/utils.mjs',
102
+ label: 'CLI help wording includes quality checks and guardrails',
103
+ pattern: /quality checks\s*\(guardrails\)/iu,
104
+ },
105
+ ];
106
+ export const COMPLIANCE_TERMINOLOGY_BOUNDARY_PATHS = [
107
+ '.agent-context/review-checklists/pr-checklist.md',
108
+ '.agent-context/review-checklists/architecture-review.md',
109
+ 'scripts/release-gate.mjs',
110
+ 'scripts/forbidden-content-check.mjs',
111
+ ];
112
+ export const COMPLIANCE_ALIAS_TERMS = [
113
+ 'Federated Rules Operations',
114
+ ];
115
+ export const REQUIRED_COMPLIANCE_CANONICAL_SNIPPETS = [
116
+ {
117
+ path: '.agent-context/review-checklists/pr-checklist.md',
118
+ snippet: '### 15. Universal SOP Consolidation',
119
+ label: 'PR checklist keeps consolidated Universal SOP section',
120
+ },
121
+ ];
122
+ export const REQUIRED_DETECTION_TRANSPARENCY_SNIPPETS = [
123
+ {
124
+ path: 'lib/cli/commands/init.mjs',
125
+ snippets: [
126
+ 'Existing project detection transparency:',
127
+ 'Use detected setup for this existing project?',
128
+ 'detectionTransparency',
129
+ ],
130
+ },
131
+ {
132
+ path: 'lib/cli/commands/upgrade.mjs',
133
+ snippets: [
134
+ 'Existing project detection transparency:',
135
+ 'formatDetectionCandidates(projectDetection.rankedCandidates)',
136
+ 'detectionTransparency',
137
+ ],
138
+ },
139
+ {
140
+ path: 'lib/cli/compiler.mjs',
141
+ snippets: [
142
+ 'detectionTransparency = null',
143
+ 'detectionTransparency: detectionTransparency || null',
144
+ ],
145
+ },
146
+ ];
147
+ export const REQUIRED_STACK_RESEARCH_ENGINE_SNIPPETS = [
148
+ {
149
+ path: 'lib/cli/architect.mjs',
150
+ snippets: [
151
+ 'STACK_SIGNAL_WEIGHTS',
152
+ 'briefType',
153
+ 'recommendArchitecture',
154
+ 'formatArchitectureRecommendation',
155
+ ],
156
+ },
157
+ {
158
+ path: 'lib/cli/commands/init.mjs',
159
+ snippets: [
160
+ 'recommendArchitecture',
161
+ ],
162
+ },
163
+ ];
164
+ export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
165
+ {
166
+ path: '.agent-context/rules/architecture.md',
167
+ snippets: [
168
+ '## Universal SOP Baseline (Mandatory)',
169
+ 'Security and testing are non-negotiable baseline requirements.',
170
+ 'If required project context docs are missing, stop implementation and bootstrap docs before writing application code.',
171
+ ],
172
+ },
173
+ {
174
+ path: '.agent-context/review-checklists/pr-checklist.md',
175
+ snippets: [
176
+ '### 15. Universal SOP Consolidation',
177
+ 'Coding flow is blocked if `docs/architecture-decision-record.md` (or `docs/Architecture-Decision-Record.md`) is missing',
178
+ 'UI implementation flow is blocked if `docs/DESIGN.md` or `docs/design-intent.json` is missing',
179
+ ],
180
+ },
181
+ {
182
+ path: '.agent-context/prompts/review-code.md',
183
+ snippets: [
184
+ 'Enforce Universal SOP hard gate: block coding flow when required project docs are missing (`docs/architecture-decision-record.md`, and for UI scope `docs/DESIGN.md` plus `docs/design-intent.json`).',
185
+ ],
186
+ },
187
+ {
188
+ path: '.agent-context/prompts/refactor.md',
189
+ snippets: [
190
+ '6. Enforce Universal SOP hard gate: stop implementation if `docs/architecture-decision-record.md` is missing, and for UI scope stop if `docs/DESIGN.md` or `docs/design-intent.json` is missing.',
191
+ ],
192
+ },
193
+ {
194
+ path: 'lib/cli/compiler.mjs',
195
+ snippets: [
196
+ 'Universal SOP hard block policy:',
197
+ 'Hard block: do not write application code until docs/project-brief.md and docs/architecture-decision-record.md exist.',
198
+ 'For UI scope: if docs/DESIGN.md or docs/design-intent.json is missing, execute bootstrap-design prompt before implementing UI surfaces.',
199
+ ],
200
+ },
201
+ ];
202
+ export const REQUIRED_TEMPLATE_FREE_BOOTSTRAP_SNIPPETS = [
203
+ {
204
+ path: 'lib/cli/project-scaffolder/storage.mjs',
205
+ snippets: [
206
+ 'generateProjectDocumentation',
207
+ "bootstrapMode: 'ai-synthesis'",
208
+ ],
209
+ },
210
+ {
211
+ path: 'lib/cli/project-scaffolder/prompt-builders.mjs',
212
+ snippets: [
213
+ 'Write project context docs from scratch (no template rendering, no placeholder boilerplate).',
214
+ 'For any ecosystem or technology claim, perform live web research and include citation metadata (source + fetchedAt timestamp) rather than relying on offline heuristics.',
215
+ ],
216
+ },
217
+ {
218
+ path: 'lib/cli/commands/init.mjs',
219
+ snippets: [
220
+ 'Project docs will be authored dynamically by your IDE assistant from these prompts.',
221
+ 'bootstrap-project-context.md',
222
+ 'Seed docs:',
223
+ 'I prepared dynamic synthesis bootstrap prompts',
224
+ ],
225
+ },
226
+ ];
227
+ export const REQUIRED_UPGRADE_UI_CONTRACT_WARNING_SNIPPETS = [
228
+ {
229
+ path: 'lib/cli/commands/upgrade.mjs',
230
+ snippets: [
231
+ 'UI/frontend scope was detected, but the dynamic design contract is incomplete:',
232
+ 'docs/design-intent.json',
233
+ 'Planned seed on apply: docs/design-intent.json',
234
+ 'Upgrade synchronizes governance assets and can seed docs/design-intent.json, but it does not author project-specific docs/DESIGN.md automatically.',
235
+ 'detectUiScopeSignals',
236
+ 'seed-generated-during-upgrade',
237
+ ],
238
+ },
239
+ ];
240
+ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
241
+ {
242
+ path: 'AGENTS.md',
243
+ snippets: [
244
+ 'Critical Bootstrap Floor',
245
+ 'If your host stops at this file',
246
+ 'bootstrap-design.md',
247
+ 'frontend-architecture.md',
248
+ 'docs/DESIGN.md',
249
+ 'docs/design-intent.json',
250
+ 'does not replace bootstrap loading',
251
+ 'perform live web research',
252
+ ],
253
+ },
254
+ {
255
+ path: '.instructions.md',
256
+ snippets: [
257
+ 'UI Design Mode',
258
+ 'bootstrap-design.md',
259
+ 'frontend-architecture.md',
260
+ 'do not eagerly load unrelated backend-only rules',
261
+ 'valid style context',
262
+ 'explicitly approved reference systems',
263
+ 'WCAG 2.2 AA as the hard compliance floor',
264
+ 'APCA as advisory perceptual tuning only',
265
+ ],
266
+ },
267
+ {
268
+ path: '.agent-context/prompts/bootstrap-design.md',
269
+ snippets: [
270
+ 'UI Design Mode is context-isolated by default:',
271
+ 'Token Architecture and Alias Strategy',
272
+ '`tokenSystem`',
273
+ '`repoEvidence.designEvidenceSummary`',
274
+ 'Responsive Strategy and Cross-Viewport Adaptation Matrix',
275
+ '`colorTruth.format`',
276
+ '`crossViewportAdaptation.mutationRules.mobile/tablet/desktop`',
277
+ '`motionSystem`',
278
+ '`componentMorphology`',
279
+ '`accessibilityPolicy`',
280
+ '`visualQaPolicy`',
281
+ '`contextHygiene`',
282
+ 'Do not reuse a color palette, component skin, or motion signature from prior chats, memories, or unrelated projects',
283
+ 'If no approved reference system exists, synthesize the design from zero using current product context, constraints, and content only.',
284
+ 'Design continuity is opt-in.',
285
+ 'WCAG 2.2 AA as the blocking baseline',
286
+ 'APCA only as advisory perceptual tuning',
287
+ 'Hybrid visual QA must stay deterministic-first',
288
+ 'long-page capture strategy',
289
+ 'anchor-based section or tiled-scroll captures',
290
+ ],
291
+ },
292
+ {
293
+ path: 'scripts/ui-design-judge.mjs',
294
+ snippets: [
295
+ 'Advisory-first UI design contract judge.',
296
+ 'Repo-internal workflow audit; no user-facing runtime modes.',
297
+ 'Runs only in advisory mode for this repository workflow.',
298
+ 'Do not reward generic SaaS defaults or popular template patterns.',
299
+ 'UI design judge only evaluates changed UI surfaces.',
300
+ 'Deterministic visual diff reported no meaningful drift, so semantic review was skipped.',
301
+ 'UI_VISUAL_DIFF_REPORT_JSON',
302
+ 'meaningfulDiffViewportCount',
303
+ ],
304
+ },
305
+ {
306
+ path: 'lib/cli/project-scaffolder/design-contract.mjs',
307
+ snippets: [
308
+ 'tokenSystem',
309
+ 'colorTruth',
310
+ 'crossViewportAdaptation',
311
+ 'motionSystem',
312
+ 'componentMorphology',
313
+ 'accessibilityPolicy',
314
+ 'visualQaPolicy',
315
+ 'deterministicFirst',
316
+ 'baselineStrategy',
317
+ 'requiredViewports',
318
+ 'capturePlan',
319
+ 'longPageStrategy',
320
+ 'tileOverlapRatio',
321
+ 'meaningfulDiffRatioThreshold',
322
+ 'hardComplianceFloor',
323
+ 'advisoryContrastModel',
324
+ 'contextHygiene',
325
+ 'repoEvidenceOverridesMemory',
326
+ 'requireExplicitContinuityApproval',
327
+ 'forbidCarryoverWhenUnapproved',
328
+ 'requireViewportMutationRules',
329
+ 'allowHexDerivatives',
330
+ ],
331
+ },
332
+ {
333
+ path: 'lib/cli/detector.mjs',
334
+ snippets: [
335
+ 'frontendEvidenceMetrics',
336
+ 'designEvidenceSummary',
337
+ ],
338
+ },
339
+ {
340
+ path: 'lib/cli/detector/design-evidence.mjs',
341
+ snippets: [
342
+ 'summaryVersion',
343
+ 'hardcodedColorCount',
344
+ 'propDrillingCandidateCount',
345
+ 'arbitraryBreakpointCount',
346
+ 'cssVariables',
347
+ 'componentInventory',
348
+ 'tokenBypassSignals',
349
+ ],
350
+ },
351
+ {
352
+ path: 'lib/cli/compiler.mjs',
353
+ snippets: [
354
+ 'LAYER 5: EXECUTION PROMPTS AND UI TRIGGERS',
355
+ 'bootstrap-design.md -> ui, ux, layout, screen, tailwind, frontend, redesign',
356
+ 'Keep UI-only requests context-isolated',
357
+ 'designEvidenceSummary',
358
+ ],
359
+ },
360
+ ];
361
+ export const REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS = [
362
+ {
363
+ path: '.instructions.md',
364
+ snippets: [
365
+ 'docker-runtime.md',
366
+ 'For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets.',
367
+ ],
368
+ },
369
+ {
370
+ path: '.agent-context/rules/docker-runtime.md',
371
+ snippets: [
372
+ 'latest official Docker documentation first',
373
+ 'Docker Compose Quickstart',
374
+ 'Compose file reference',
375
+ 'Dockerfile best practices',
376
+ 'Prefer current `docker compose` workflows and `compose.yaml`.',
377
+ 'Do not add the top-level Compose `version` field by default.',
378
+ 'Prefer the latest stable compatible Docker base image',
379
+ ],
380
+ },
381
+ {
382
+ path: '.agent-context/prompts/init-project.md',
383
+ snippets: [
384
+ 'If Docker or Compose is in scope, load [docker-runtime.md](../rules/docker-runtime.md) and verify the latest official Docker guidance before authoring container assets.',
385
+ 'If containerization is selected, Docker assets must follow [docker-runtime.md](../rules/docker-runtime.md) and the latest official Docker docs instead of stale blog-era patterns.',
386
+ ],
387
+ },
388
+ ];
389
+ export const REQUIRED_DEPENDENCY_FRESHNESS_AUTOMATION_SNIPPETS = [
390
+ {
391
+ path: '.instructions.md',
392
+ snippets: [
393
+ 'prefer the latest stable compatible dependency set and official setup flow',
394
+ ],
395
+ },
396
+ {
397
+ path: '.agent-context/rules/efficiency-vs-hype.md',
398
+ snippets: [
399
+ 'Latest-Compatible-First Rule',
400
+ 'latest stable compatible dependency version',
401
+ 'official scaffolder or setup command',
402
+ 'Only step down to an older dependency version after documenting',
403
+ ],
404
+ },
405
+ {
406
+ path: '.agent-context/prompts/init-project.md',
407
+ snippets: [
408
+ 'latest stable compatible dependency set and official framework setup flow first',
409
+ 'Prefer official framework setup commands or canonical starter flows',
410
+ ],
411
+ },
412
+ ];
413
+ export const FORBIDDEN_TEMPLATE_BOOTSTRAP_SNIPPETS = [
414
+ {
415
+ path: 'lib/cli/project-scaffolder/prompt-builders.mjs',
416
+ snippets: [
417
+ '.tmpl',
418
+ ],
419
+ },
420
+ ];
421
+ export const REQUIRED_DETERMINISTIC_BOUNDARY_ENFORCEMENT_SNIPPETS = [
422
+ {
423
+ path: 'scripts/documentation-boundary-audit.mjs',
424
+ snippets: [
425
+ 'reportVersion',
426
+ 'violations',
427
+ 'suggestedActions',
428
+ 'diagnosticCode',
429
+ 'autoDocsSyncScope',
430
+ 'rolloutMetrics',
431
+ 'precision',
432
+ 'recall',
433
+ ],
434
+ },
435
+ {
436
+ path: 'scripts/release-gate.mjs',
437
+ snippets: [
438
+ 'documentation-boundary-hard-rule',
439
+ 'documentation-boundary-diagnostics-machine-readable',
440
+ 'diagnostics.documentationBoundaryAudit',
441
+ 'auto-docs-sync-scope-phase1',
442
+ 'auto-docs-sync-rollout-metrics',
443
+ 'ui-design-judge-hybrid-diagnostics',
444
+ ],
445
+ },
446
+ ];