@ryuenn3123/agentic-senior-core 3.0.47 → 3.0.49
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.
- package/.agent-context/prompts/bootstrap-design.md +8 -10
- package/.agent-context/prompts/init-project.md +2 -2
- package/.agent-context/rules/architecture.md +2 -2
- package/.agent-context/rules/frontend-architecture.md +9 -13
- package/.agent-context/state/architecture-map.md +3 -3
- package/.agent-context/state/dependency-map.md +2 -2
- package/AGENTS.md +170 -35
- package/CLAUDE.md +1 -44
- package/CONTRIBUTING.md +2 -3
- package/GEMINI.md +1 -44
- package/README.md +24 -22
- package/lib/cli/commands/init.mjs +10 -28
- package/lib/cli/commands/optimize.mjs +2 -48
- package/lib/cli/commands/upgrade.mjs +9 -51
- package/lib/cli/compiler.mjs +8 -93
- package/lib/cli/constants.mjs +1 -9
- package/lib/cli/detector.mjs +0 -1
- package/lib/cli/init-options.mjs +1 -1
- package/lib/cli/project-scaffolder/design-contract/validation.mjs +4 -0
- package/lib/cli/project-scaffolder/design-contract.mjs +4 -0
- package/lib/cli/project-scaffolder/prompt-builders.mjs +5 -1
- package/lib/cli/utils/filesystem.mjs +2 -0
- package/lib/cli/utils/managed-surface.mjs +45 -2
- package/lib/cli/utils.mjs +19 -4
- package/package.json +1 -10
- package/scripts/bump-version.mjs +1 -16
- package/scripts/docs-quality-drift-report.mjs +0 -6
- package/scripts/frontend-usability-audit.mjs +6 -2
- package/scripts/governance-weekly-report.mjs +2 -2
- package/scripts/single-source-lazy-loading-audit.mjs +13 -126
- package/scripts/sync-thin-adapters.mjs +13 -121
- package/scripts/validate/config.mjs +14 -25
- package/scripts/validate/coverage-checks.mjs +9 -76
- package/scripts/validate.mjs +12 -97
- package/.agent-override.md +0 -36
- package/.agents/workflows/init-project.md +0 -12
- package/.agents/workflows/refactor.md +0 -12
- package/.agents/workflows/review-code.md +0 -11
- package/.cursor/mcp.json +0 -10
- package/.cursor/rules/agentic-senior-core.mdc +0 -49
- package/.cursorrules +0 -26
- package/.gemini/instructions.md +0 -44
- package/.github/copilot-instructions.md +0 -44
- package/.github/instructions/agentic-senior-core.instructions.md +0 -48
- package/.github/workflows/benchmark-detection.yml +0 -45
- package/.github/workflows/benchmark-intelligence.yml +0 -50
- package/.github/workflows/docs-quality-drift-report.yml +0 -37
- package/.github/workflows/frontend-usability-gate.yml +0 -36
- package/.github/workflows/governance-weekly-report.yml +0 -43
- package/.github/workflows/publish.yml +0 -32
- package/.github/workflows/release-gate.yml +0 -32
- package/.github/workflows/sbom-compliance.yml +0 -32
- package/.instructions.md +0 -187
- package/.windsurf/rules/agentic-senior-core.md +0 -44
- package/.windsurfrules +0 -26
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
export const ALLOWED_SEVERITIES = new Set(['critical', 'high', 'medium', 'low']);
|
|
2
|
-
export const OVERRIDE_WARNING_WINDOW_DAYS = 30;
|
|
3
2
|
export const THIN_ADAPTER_PATHS = [
|
|
4
|
-
'AGENTS.md',
|
|
5
3
|
'CLAUDE.md',
|
|
6
4
|
'GEMINI.md',
|
|
7
|
-
'.github/copilot-instructions.md',
|
|
8
|
-
'.github/instructions/agentic-senior-core.instructions.md',
|
|
9
|
-
'.gemini/instructions.md',
|
|
10
|
-
'.cursor/rules/agentic-senior-core.mdc',
|
|
11
|
-
'.windsurf/rules/agentic-senior-core.md',
|
|
12
5
|
];
|
|
13
6
|
export const FORMAL_ARTIFACT_PATHS = [
|
|
14
|
-
'.
|
|
7
|
+
'AGENTS.md',
|
|
15
8
|
'README.md',
|
|
16
9
|
'CHANGELOG.md',
|
|
10
|
+
'docs/doc-index.md',
|
|
11
|
+
'docs/project-brief.md',
|
|
12
|
+
'docs/flow-overview.md',
|
|
13
|
+
'docs/api-contract.md',
|
|
17
14
|
'docs/deep-analysis-and-roadmap-backlog.md',
|
|
18
15
|
'.agent-context/rules/api-docs.md',
|
|
19
16
|
'.agent-context/review-checklists/pr-checklist.md',
|
|
20
17
|
'.agent-context/prompts/review-code.md',
|
|
21
|
-
'AGENTS.md',
|
|
22
18
|
'CLAUDE.md',
|
|
23
19
|
'GEMINI.md',
|
|
24
|
-
'.github/copilot-instructions.md',
|
|
25
|
-
'.github/instructions/agentic-senior-core.instructions.md',
|
|
26
|
-
'.gemini/instructions.md',
|
|
27
|
-
'.cursor/rules/agentic-senior-core.mdc',
|
|
28
|
-
'.windsurf/rules/agentic-senior-core.md',
|
|
29
20
|
];
|
|
30
21
|
export const REQUIRED_HUMAN_WRITING_SNIPPETS = [
|
|
31
22
|
{
|
|
@@ -102,7 +93,7 @@ export const REQUIRED_DEVELOPER_FIRST_MENTION_PATTERNS = [
|
|
|
102
93
|
{
|
|
103
94
|
path: 'lib/cli/commands/init.mjs',
|
|
104
95
|
label: 'Init command wording includes project guidance pack',
|
|
105
|
-
pattern: /copy the project guidance pack[^\n]*
|
|
96
|
+
pattern: /copy the project guidance pack[^\n]*AGENTS\.md and native import bridges/iu,
|
|
106
97
|
},
|
|
107
98
|
{
|
|
108
99
|
path: 'lib/cli/commands/upgrade.mjs',
|
|
@@ -157,7 +148,7 @@ export const REQUIRED_DETECTION_TRANSPARENCY_SNIPPETS = [
|
|
|
157
148
|
];
|
|
158
149
|
export const REQUIRED_STACK_DECISION_BOUNDARY_SNIPPETS = [
|
|
159
150
|
{
|
|
160
|
-
path: '.
|
|
151
|
+
path: 'AGENTS.md',
|
|
161
152
|
snippets: [
|
|
162
153
|
'Do not silently choose frameworks or architecture from offline heuristics.',
|
|
163
154
|
'produce a short recommendation from evidence and live official documentation before coding',
|
|
@@ -192,7 +183,7 @@ export const REQUIRED_STACK_DECISION_BOUNDARY_SNIPPETS = [
|
|
|
192
183
|
];
|
|
193
184
|
export const REQUIRED_UNIVERSAL_SOP_SNIPPETS = [
|
|
194
185
|
{
|
|
195
|
-
path: '.
|
|
186
|
+
path: 'AGENTS.md',
|
|
196
187
|
snippets: [
|
|
197
188
|
'### 1. Documentation-First Mode',
|
|
198
189
|
'root `README.md` for every fresh or existing project',
|
|
@@ -298,14 +289,12 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
298
289
|
{
|
|
299
290
|
path: 'AGENTS.md',
|
|
300
291
|
snippets: [
|
|
301
|
-
'
|
|
302
|
-
'If your host stops at this file',
|
|
292
|
+
'UI Design Mode',
|
|
303
293
|
'bootstrap-design.md',
|
|
304
294
|
'frontend-architecture.md',
|
|
305
295
|
'docs/DESIGN.md',
|
|
306
296
|
'docs/design-intent.json',
|
|
307
|
-
'
|
|
308
|
-
'documentation-first requests',
|
|
297
|
+
'Documentation-First Mode',
|
|
309
298
|
'English by default',
|
|
310
299
|
'do not write application, firmware, or UI code',
|
|
311
300
|
'Motion/Palette Decision',
|
|
@@ -314,7 +303,7 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
314
303
|
],
|
|
315
304
|
},
|
|
316
305
|
{
|
|
317
|
-
path: '.
|
|
306
|
+
path: 'AGENTS.md',
|
|
318
307
|
snippets: [
|
|
319
308
|
'Resolve the smallest relevant layer set for the current request.',
|
|
320
309
|
'UI Design Mode',
|
|
@@ -521,7 +510,7 @@ export const REQUIRED_UI_DESIGN_AUTOMATION_SNIPPETS = [
|
|
|
521
510
|
];
|
|
522
511
|
export const REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS = [
|
|
523
512
|
{
|
|
524
|
-
path: '.
|
|
513
|
+
path: 'AGENTS.md',
|
|
525
514
|
snippets: [
|
|
526
515
|
'docker-runtime.md',
|
|
527
516
|
'For Docker or Compose work, load `docker-runtime.md` and verify the latest official Docker docs before authoring container assets.',
|
|
@@ -549,7 +538,7 @@ export const REQUIRED_DOCKER_RUNTIME_AUTOMATION_SNIPPETS = [
|
|
|
549
538
|
];
|
|
550
539
|
export const REQUIRED_DEPENDENCY_FRESHNESS_AUTOMATION_SNIPPETS = [
|
|
551
540
|
{
|
|
552
|
-
path: '.
|
|
541
|
+
path: 'AGENTS.md',
|
|
553
542
|
snippets: [
|
|
554
543
|
'use the latest stable compatible dependency set and official setup flow',
|
|
555
544
|
],
|
|
@@ -583,7 +572,7 @@ export const FORBIDDEN_TEMPLATE_BOOTSTRAP_SNIPPETS = [
|
|
|
583
572
|
];
|
|
584
573
|
export const FORBIDDEN_ACTIVE_BIAS_ANCHOR_SNIPPETS = [
|
|
585
574
|
{
|
|
586
|
-
path: '.
|
|
575
|
+
path: 'AGENTS.md',
|
|
587
576
|
snippets: [
|
|
588
577
|
'illustrative, not exhaustive',
|
|
589
578
|
'explicitly approved reference systems',
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
1
|
import { join, relative } from 'node:path';
|
|
3
2
|
import {
|
|
4
3
|
COMPLIANCE_ALIAS_TERMS,
|
|
@@ -383,7 +382,6 @@ export async function validateInstructionAdapters(context) {
|
|
|
383
382
|
console.log('\nChecking instruction adapter consolidation...');
|
|
384
383
|
|
|
385
384
|
const canonicalInstructionContent = normalizeLineEndings(await readTextFile(CANONICAL_INSTRUCTION_PATH));
|
|
386
|
-
const canonicalSnapshotHash = createHash('sha256').update(canonicalInstructionContent).digest('hex');
|
|
387
385
|
const requiredBootstrapReceiptSnippets = [
|
|
388
386
|
'Bootstrap Receipt',
|
|
389
387
|
'loaded_files',
|
|
@@ -397,25 +395,24 @@ export async function validateInstructionAdapters(context) {
|
|
|
397
395
|
'product categories are heuristics',
|
|
398
396
|
];
|
|
399
397
|
const instructionFootprintLimits = [
|
|
400
|
-
{ path: '.
|
|
398
|
+
{ path: 'AGENTS.md', maxLines: 180 },
|
|
401
399
|
{ path: '.agent-context/prompts/bootstrap-design.md', maxLines: 180 },
|
|
402
400
|
{ path: '.agent-context/rules/frontend-architecture.md', maxLines: 110 },
|
|
403
401
|
];
|
|
404
|
-
const legacyRootAdapterPaths = ['.cursorrules', '.windsurfrules'];
|
|
405
402
|
|
|
406
403
|
for (const requiredBootstrapReceiptSnippet of requiredBootstrapReceiptSnippets) {
|
|
407
404
|
if (canonicalInstructionContent.includes(requiredBootstrapReceiptSnippet)) {
|
|
408
|
-
pass(
|
|
405
|
+
pass(`AGENTS.md includes bootstrap receipt snippet: ${requiredBootstrapReceiptSnippet}`);
|
|
409
406
|
} else {
|
|
410
|
-
fail(
|
|
407
|
+
fail(`AGENTS.md is missing bootstrap receipt snippet: ${requiredBootstrapReceiptSnippet}`);
|
|
411
408
|
}
|
|
412
409
|
}
|
|
413
410
|
|
|
414
411
|
for (const requiredUiReadabilitySnippet of requiredUiReadabilitySnippets) {
|
|
415
412
|
if (canonicalInstructionContent.includes(requiredUiReadabilitySnippet)) {
|
|
416
|
-
pass(
|
|
413
|
+
pass(`AGENTS.md includes UI readability snippet: ${requiredUiReadabilitySnippet}`);
|
|
417
414
|
} else {
|
|
418
|
-
fail(
|
|
415
|
+
fail(`AGENTS.md is missing UI readability snippet: ${requiredUiReadabilitySnippet}`);
|
|
419
416
|
}
|
|
420
417
|
}
|
|
421
418
|
|
|
@@ -445,83 +442,19 @@ export async function validateInstructionAdapters(context) {
|
|
|
445
442
|
|
|
446
443
|
const thinAdapterContent = await readTextFile(absoluteAdapterPath);
|
|
447
444
|
|
|
448
|
-
if (
|
|
449
|
-
|
|
450
|
-
&& thinAdapterContent.includes('Adapter Source: .instructions.md')
|
|
451
|
-
) {
|
|
452
|
-
pass(`${thinAdapterPath} declares thin adapter metadata`);
|
|
445
|
+
if (thinAdapterContent.trim() === '@AGENTS.md') {
|
|
446
|
+
pass(`${thinAdapterPath} imports AGENTS.md`);
|
|
453
447
|
} else {
|
|
454
|
-
fail(`${thinAdapterPath} must
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
for (const requiredBootstrapReceiptSnippet of requiredBootstrapReceiptSnippets) {
|
|
458
|
-
if (thinAdapterContent.includes(requiredBootstrapReceiptSnippet)) {
|
|
459
|
-
pass(`${thinAdapterPath} includes bootstrap receipt snippet: ${requiredBootstrapReceiptSnippet}`);
|
|
460
|
-
} else {
|
|
461
|
-
fail(`${thinAdapterPath} is missing bootstrap receipt snippet: ${requiredBootstrapReceiptSnippet}`);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
for (const requiredUiReadabilitySnippet of requiredUiReadabilitySnippets) {
|
|
466
|
-
if (thinAdapterContent.includes(requiredUiReadabilitySnippet)) {
|
|
467
|
-
pass(`${thinAdapterPath} includes UI readability snippet: ${requiredUiReadabilitySnippet}`);
|
|
468
|
-
} else {
|
|
469
|
-
fail(`${thinAdapterPath} is missing UI readability snippet: ${requiredUiReadabilitySnippet}`);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
const hashMatch = thinAdapterContent.match(/Canonical Snapshot SHA256:\s*([a-f0-9]{64})/);
|
|
474
|
-
if (!hashMatch) {
|
|
475
|
-
fail(`${thinAdapterPath} must declare Canonical Snapshot SHA256`);
|
|
476
|
-
continue;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
if (hashMatch[1] === canonicalSnapshotHash) {
|
|
480
|
-
pass(`${thinAdapterPath} canonical hash matches .instructions.md`);
|
|
481
|
-
} else {
|
|
482
|
-
fail(`${thinAdapterPath} canonical hash drift detected (expected ${canonicalSnapshotHash})`);
|
|
448
|
+
fail(`${thinAdapterPath} must be exactly @AGENTS.md`);
|
|
483
449
|
}
|
|
484
450
|
|
|
485
451
|
const thinAdapterLineCount = thinAdapterContent.split(/\r?\n/u).length;
|
|
486
|
-
if (thinAdapterLineCount <=
|
|
452
|
+
if (thinAdapterLineCount <= 2) {
|
|
487
453
|
pass(`${thinAdapterPath} remains thin (${thinAdapterLineCount} lines)`);
|
|
488
454
|
} else {
|
|
489
455
|
fail(`${thinAdapterPath} is too large for thin-adapter mode (${thinAdapterLineCount} lines)`);
|
|
490
456
|
}
|
|
491
457
|
}
|
|
492
|
-
|
|
493
|
-
for (const legacyRootAdapterPath of legacyRootAdapterPaths) {
|
|
494
|
-
const absoluteLegacyRootAdapterPath = join(ROOT_DIR, legacyRootAdapterPath);
|
|
495
|
-
if (!(await fileExists(absoluteLegacyRootAdapterPath))) {
|
|
496
|
-
fail(`Missing legacy root adapter file: ${legacyRootAdapterPath}`);
|
|
497
|
-
continue;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
const legacyRootAdapterContent = await readTextFile(absoluteLegacyRootAdapterPath);
|
|
501
|
-
const requiredLegacyRootAdapterSnippets = [
|
|
502
|
-
'Generated by Agentic-Senior-Core CLI v',
|
|
503
|
-
'Adapter Mode: legacy-thin',
|
|
504
|
-
'Adapter Source: .agent-instructions.md',
|
|
505
|
-
'Canonical baseline: .instructions.md',
|
|
506
|
-
'.agent-instructions.md',
|
|
507
|
-
'.agent-context/rules/',
|
|
508
|
-
];
|
|
509
|
-
|
|
510
|
-
for (const requiredLegacyRootAdapterSnippet of requiredLegacyRootAdapterSnippets) {
|
|
511
|
-
if (legacyRootAdapterContent.includes(requiredLegacyRootAdapterSnippet)) {
|
|
512
|
-
pass(`${legacyRootAdapterPath} includes legacy-thin snippet: ${requiredLegacyRootAdapterSnippet}`);
|
|
513
|
-
} else {
|
|
514
|
-
fail(`${legacyRootAdapterPath} is missing legacy-thin snippet: ${requiredLegacyRootAdapterSnippet}`);
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
const legacyRootAdapterLineCount = legacyRootAdapterContent.split(/\r?\n/u).length;
|
|
519
|
-
if (legacyRootAdapterLineCount <= 40) {
|
|
520
|
-
pass(`${legacyRootAdapterPath} remains thin (${legacyRootAdapterLineCount} lines)`);
|
|
521
|
-
} else {
|
|
522
|
-
fail(`${legacyRootAdapterPath} is too large for legacy-thin mode (${legacyRootAdapterLineCount} lines)`);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
458
|
}
|
|
526
459
|
|
|
527
460
|
export async function validateSkillPurgeSurface(context) {
|
package/scripts/validate.mjs
CHANGED
|
@@ -16,10 +16,7 @@
|
|
|
16
16
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
17
17
|
import { dirname, join, relative, resolve } from 'node:path';
|
|
18
18
|
import { fileURLToPath } from 'node:url';
|
|
19
|
-
import {
|
|
20
|
-
ALLOWED_SEVERITIES,
|
|
21
|
-
OVERRIDE_WARNING_WINDOW_DAYS,
|
|
22
|
-
} from './validate/config.mjs';
|
|
19
|
+
import { ALLOWED_SEVERITIES } from './validate/config.mjs';
|
|
23
20
|
import {
|
|
24
21
|
validateDependencyFreshnessAutomationCoverage,
|
|
25
22
|
validateDetectionTransparencyCoverage,
|
|
@@ -40,15 +37,14 @@ import {
|
|
|
40
37
|
const SCRIPT_FILE_PATH = fileURLToPath(import.meta.url);
|
|
41
38
|
const ROOT_DIR = resolve(dirname(SCRIPT_FILE_PATH), '..');
|
|
42
39
|
const AGENT_CONTEXT_DIR = join(ROOT_DIR, '.agent-context');
|
|
43
|
-
const CANONICAL_INSTRUCTION_PATH = join(ROOT_DIR, '.
|
|
40
|
+
const CANONICAL_INSTRUCTION_PATH = join(ROOT_DIR, 'AGENTS.md');
|
|
44
41
|
const PACKAGE_JSON_PATH = join(ROOT_DIR, 'package.json');
|
|
45
42
|
const PACKAGE_LOCK_PATH = join(ROOT_DIR, 'package-lock.json');
|
|
46
43
|
const BUN_LOCK_PATH = join(ROOT_DIR, 'bun.lock');
|
|
47
44
|
const CHANGELOG_PATH = join(ROOT_DIR, 'CHANGELOG.md');
|
|
48
45
|
const README_PATH = join(ROOT_DIR, 'README.md');
|
|
49
46
|
const POLICY_FILE_PATH = join(ROOT_DIR, '.agent-context', 'policies', 'llm-judge-threshold.json');
|
|
50
|
-
const
|
|
51
|
-
const GENERATED_RULE_FILES = ['.cursorrules', '.windsurfrules'];
|
|
47
|
+
const GENERATED_RULE_FILES = [];
|
|
52
48
|
|
|
53
49
|
const validationResult = {
|
|
54
50
|
passed: 0,
|
|
@@ -153,16 +149,17 @@ async function validateRequiredFiles() {
|
|
|
153
149
|
'scripts/v3-purge-audit.mjs',
|
|
154
150
|
'scripts/release-gate.mjs',
|
|
155
151
|
'scripts/generate-sbom.mjs',
|
|
156
|
-
'.cursorrules',
|
|
157
|
-
'.windsurfrules',
|
|
158
|
-
'.agent-override.md',
|
|
159
152
|
'.agent-context/policies/llm-judge-threshold.json',
|
|
160
153
|
'mcp.json',
|
|
161
154
|
'AGENTS.md',
|
|
162
|
-
'.
|
|
163
|
-
'.
|
|
155
|
+
'CLAUDE.md',
|
|
156
|
+
'GEMINI.md',
|
|
164
157
|
'README.md',
|
|
165
158
|
'CHANGELOG.md',
|
|
159
|
+
'docs/doc-index.md',
|
|
160
|
+
'docs/project-brief.md',
|
|
161
|
+
'docs/flow-overview.md',
|
|
162
|
+
'docs/api-contract.md',
|
|
166
163
|
'docs/faq.md',
|
|
167
164
|
'docs/deep-dive.md',
|
|
168
165
|
'docs/terminology-mapping.md',
|
|
@@ -292,87 +289,6 @@ async function validateChecklistConsolidation() {
|
|
|
292
289
|
}
|
|
293
290
|
}
|
|
294
291
|
|
|
295
|
-
function stripMarkdownCodeBlocks(markdownText) {
|
|
296
|
-
return markdownText.replace(/```[\s\S]*?```/g, '');
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function parseOverrideExpiryDate(rawExpiryValue) {
|
|
300
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(rawExpiryValue)) {
|
|
301
|
-
return null;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const parsedDate = new Date(`${rawExpiryValue}T00:00:00.000Z`);
|
|
305
|
-
return Number.isNaN(parsedDate.getTime()) ? null : parsedDate;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
async function validateOverrideGovernance() {
|
|
309
|
-
console.log('\nChecking override governance...');
|
|
310
|
-
|
|
311
|
-
const overrideContent = await readTextFile(OVERRIDE_FILE_PATH);
|
|
312
|
-
const overrideContentWithoutCodeBlocks = stripMarkdownCodeBlocks(overrideContent);
|
|
313
|
-
const overrideEntryPattern = /\[Rule:\s*([^\]]+)\]([\s\S]*?)(?=\n\[Rule:|$)/g;
|
|
314
|
-
const overrideEntries = [];
|
|
315
|
-
let overrideEntryMatch = overrideEntryPattern.exec(overrideContentWithoutCodeBlocks);
|
|
316
|
-
|
|
317
|
-
while (overrideEntryMatch) {
|
|
318
|
-
const ruleName = overrideEntryMatch[1].trim();
|
|
319
|
-
const entryBody = overrideEntryMatch[2];
|
|
320
|
-
const ownerMatch = entryBody.match(/(?:^|\n)Owner:\s*(.+)/);
|
|
321
|
-
const expiryMatch = entryBody.match(/(?:^|\n)Expiry:\s*(.+)/);
|
|
322
|
-
|
|
323
|
-
overrideEntries.push({
|
|
324
|
-
ruleName,
|
|
325
|
-
owner: ownerMatch ? ownerMatch[1].trim() : '',
|
|
326
|
-
expiry: expiryMatch ? expiryMatch[1].trim() : '',
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
overrideEntryMatch = overrideEntryPattern.exec(overrideContentWithoutCodeBlocks);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
if (overrideEntries.length === 0) {
|
|
333
|
-
pass('No active override entries found; governance baseline remains strict');
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
const currentDate = new Date();
|
|
338
|
-
|
|
339
|
-
for (const overrideEntry of overrideEntries) {
|
|
340
|
-
const overrideContextLabel = `[Rule: ${overrideEntry.ruleName}]`;
|
|
341
|
-
|
|
342
|
-
if (!overrideEntry.owner) {
|
|
343
|
-
fail(`${overrideContextLabel} is missing Owner metadata`);
|
|
344
|
-
continue;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
pass(`${overrideContextLabel} owner is defined`);
|
|
348
|
-
|
|
349
|
-
if (!overrideEntry.expiry) {
|
|
350
|
-
fail(`${overrideContextLabel} is missing Expiry metadata`);
|
|
351
|
-
continue;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
const expiryDate = parseOverrideExpiryDate(overrideEntry.expiry);
|
|
355
|
-
if (!expiryDate) {
|
|
356
|
-
fail(`${overrideContextLabel} has invalid Expiry format (expected YYYY-MM-DD)`);
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
const remainingMilliseconds = expiryDate.getTime() - currentDate.getTime();
|
|
361
|
-
const remainingDays = Math.floor(remainingMilliseconds / (1000 * 60 * 60 * 24));
|
|
362
|
-
|
|
363
|
-
if (remainingMilliseconds < 0) {
|
|
364
|
-
fail(`${overrideContextLabel} is expired (${overrideEntry.expiry})`);
|
|
365
|
-
continue;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
pass(`${overrideContextLabel} expiry is valid (${overrideEntry.expiry})`);
|
|
369
|
-
|
|
370
|
-
if (remainingDays <= OVERRIDE_WARNING_WINDOW_DAYS) {
|
|
371
|
-
warn(`${overrideContextLabel} expires in ${remainingDays} day(s); renew or remove soon`);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
292
|
async function validateCrossReferences() {
|
|
377
293
|
console.log('\nChecking internal links...');
|
|
378
294
|
|
|
@@ -468,10 +384,10 @@ async function validatePackageMetadata() {
|
|
|
468
384
|
pass('package.json has no unnecessary devDependencies');
|
|
469
385
|
}
|
|
470
386
|
|
|
471
|
-
if (Array.isArray(packageJson.files) && packageJson.files.includes('.
|
|
472
|
-
pass('package.json publishes canonical .
|
|
387
|
+
if (Array.isArray(packageJson.files) && packageJson.files.includes('AGENTS.md')) {
|
|
388
|
+
pass('package.json publishes canonical AGENTS.md');
|
|
473
389
|
} else {
|
|
474
|
-
fail('package.json must publish .
|
|
390
|
+
fail('package.json must publish AGENTS.md so init and upgrade can copy the canonical root instructions file');
|
|
475
391
|
}
|
|
476
392
|
|
|
477
393
|
if (await fileExists(BUN_LOCK_PATH)) {
|
|
@@ -639,7 +555,6 @@ async function main() {
|
|
|
639
555
|
await validateMarkdownFiles();
|
|
640
556
|
await validateRuleFiles();
|
|
641
557
|
await validateChecklistConsolidation();
|
|
642
|
-
await validateOverrideGovernance();
|
|
643
558
|
await validateAgentsManifest();
|
|
644
559
|
await validateCrossReferences();
|
|
645
560
|
await validatePackageMetadata();
|
package/.agent-override.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Rule Overrides
|
|
2
|
-
|
|
3
|
-
> Exception file for enterprise needs.
|
|
4
|
-
> Default policy: all rules remain strict unless explicitly overridden below.
|
|
5
|
-
|
|
6
|
-
## Override Template
|
|
7
|
-
|
|
8
|
-
Use this exact structure for every exception:
|
|
9
|
-
|
|
10
|
-
```markdown
|
|
11
|
-
[Rule: <rule-name>]
|
|
12
|
-
Scope: <module/path>
|
|
13
|
-
Reason: <business or technical constraint>
|
|
14
|
-
Permitted Deviation: <what is allowed>
|
|
15
|
-
Risk Mitigation: <how risk is controlled>
|
|
16
|
-
Expiry: <YYYY-MM-DD>
|
|
17
|
-
Owner: <team/person>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Example Override
|
|
21
|
-
|
|
22
|
-
```markdown
|
|
23
|
-
[Rule: Naming]
|
|
24
|
-
Scope: legacy-erp-sync module
|
|
25
|
-
Reason: External DB schema uses snake_case columns and strict mapping contracts.
|
|
26
|
-
Permitted Deviation: snake_case variable names are allowed only in mapper files.
|
|
27
|
-
Risk Mitigation: enforce mapper-only scope with codeowners and lint ignore pattern.
|
|
28
|
-
Expiry: 2026-12-31
|
|
29
|
-
Owner: platform-integration-team
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Enforcement Notes
|
|
33
|
-
|
|
34
|
-
1. Overrides must be narrow and time-bound.
|
|
35
|
-
2. Expired overrides are invalid and must be removed.
|
|
36
|
-
3. Broad overrides such as "allow any everywhere" are prohibited.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Initialize a project with repo-grounded guidance and required docs
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Workflow: Initialize Project
|
|
6
|
-
|
|
7
|
-
1. Read `AGENTS.md`, then follow the canonical bootstrap chain only as far as the task requires.
|
|
8
|
-
2. Use `.agent-context/prompts/init-project.md` as the canonical init prompt.
|
|
9
|
-
3. For existing projects, inspect real project files before naming the product, describing the context, or recommending runtime/architecture choices.
|
|
10
|
-
4. For fresh projects, keep questions minimal and ask the agent to recommend unresolved runtime, framework, library, and architecture choices from the brief plus live official docs.
|
|
11
|
-
5. Ensure required docs exist before implementation: project brief, architecture decision, flow overview, API/public contract when relevant, data model when relevant, UI design contract when relevant, security assumptions, and testing strategy.
|
|
12
|
-
6. Run `.agent-context/review-checklists/pr-checklist.md` before declaring the init complete.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Refactor code without changing behavior
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Workflow: Refactor Code
|
|
6
|
-
|
|
7
|
-
1. Read `AGENTS.md`.
|
|
8
|
-
2. Use `.agent-context/prompts/refactor.md` as the canonical refactor prompt.
|
|
9
|
-
3. Inspect the target files and existing repo conventions before changing structure.
|
|
10
|
-
4. Keep behavior stable unless the user explicitly approves a behavior change.
|
|
11
|
-
5. Update docs and tests when contracts, public surfaces, or architecture boundaries change.
|
|
12
|
-
6. Run `.agent-context/review-checklists/pr-checklist.md` before declaring done.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Review code with project contracts and risk-first findings
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Workflow: Review Code
|
|
6
|
-
|
|
7
|
-
1. Read `AGENTS.md`.
|
|
8
|
-
2. Use `.agent-context/prompts/review-code.md` as the canonical review prompt.
|
|
9
|
-
3. Apply `.agent-context/review-checklists/pr-checklist.md`.
|
|
10
|
-
4. Load architecture, frontend, security, testing, API, event, realtime, or Docker rules only when the changed scope needs them.
|
|
11
|
-
5. Report findings first, ordered by severity, with file/line references and concrete fixes.
|
package/.cursor/mcp.json
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Agentic Senior Core bootstrap adapter
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Cursor Rule - Thin Adapter
|
|
7
|
-
|
|
8
|
-
Adapter Mode: thin
|
|
9
|
-
Adapter Source: .instructions.md
|
|
10
|
-
Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
|
|
11
|
-
|
|
12
|
-
This repository is governed by a strict instruction contract.
|
|
13
|
-
Use [.instructions.md](../../.instructions.md) as the canonical policy source.
|
|
14
|
-
Use .agent-context/ for technical rules, prompts, checklists, policies, and state.
|
|
15
|
-
Treat README.md as public and developer overview, setup, usage, and user-facing context only when governance files conflict.
|
|
16
|
-
|
|
17
|
-
## Critical Bootstrap Floor
|
|
18
|
-
|
|
19
|
-
- If your host stops at this file, continue the chain manually before coding.
|
|
20
|
-
- Read `.agent-instructions.md` next when it exists.
|
|
21
|
-
- Memory continuity does not replace bootstrap loading.
|
|
22
|
-
- For UI, UX, layout, screen, tailwind, frontend, or redesign requests, load [bootstrap-design.md](../../.agent-context/prompts/bootstrap-design.md) and [frontend-architecture.md](../../.agent-context/rules/frontend-architecture.md) before code edits.
|
|
23
|
-
- For UI scope, include a one-line Motion/Palette Decision in the Bootstrap Receipt; product categories are heuristics, not style presets.
|
|
24
|
-
- For UI scope, create or refine `docs/DESIGN.md` and `docs/design-intent.json` before UI implementation.
|
|
25
|
-
- For documentation-first requests, create or refine required project docs in English by default and do not write application, firmware, or UI code until the user asks or approves.
|
|
26
|
-
- Create or refine root README.md as the public and developer entrypoint before implementation.
|
|
27
|
-
- For backend, API, data, auth, error, event, queue, worker, or distributed-system requests, load only relevant global rules from .agent-context/rules/ ([link](../../.agent-context/rules)).
|
|
28
|
-
- For ecosystem, framework, dependency, or Docker claims, perform live web research.
|
|
29
|
-
- Resolve runtime choices from project evidence and live official documentation; resolve structural planning from constraints and architecture boundaries.
|
|
30
|
-
|
|
31
|
-
## Mandatory Bootstrap Chain
|
|
32
|
-
|
|
33
|
-
1. Load [.instructions.md](../../.instructions.md).
|
|
34
|
-
2. Load `.agent-instructions.md` when present.
|
|
35
|
-
3. Load only relevant files from .agent-context/rules/ ([link](../../.agent-context/rules)).
|
|
36
|
-
4. Apply matching prompts from .agent-context/prompts/ ([link](../../.agent-context/prompts)).
|
|
37
|
-
5. Enforce .agent-context/review-checklists/ ([link](../../.agent-context/review-checklists/pr-checklist.md)).
|
|
38
|
-
6. Use .agent-context/state/ ([link](../../.agent-context/state)) and .agent-context/policies/ ([link](../../.agent-context/policies)) only when relevant.
|
|
39
|
-
7. Use project docs and live evidence for runtime, dependency, and architecture claims.
|
|
40
|
-
|
|
41
|
-
## Bootstrap Receipt
|
|
42
|
-
|
|
43
|
-
For non-trivial coding, review, planning, or governance work, produce a short Bootstrap Receipt before implementation output: `loaded_files`, `selected_rules`, `skipped_rules`, `unreachable_files`, and `validation_plan`.
|
|
44
|
-
|
|
45
|
-
## Completion Gate
|
|
46
|
-
|
|
47
|
-
Run [pr-checklist.md](../../.agent-context/review-checklists/pr-checklist.md) before declaring work complete.
|
|
48
|
-
|
|
49
|
-
If this adapter drifts from canonical behavior, refresh from [.instructions.md](../../.instructions.md) and update the hash metadata.
|
package/.cursorrules
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# .cursorrules - Legacy Thin Adapter
|
|
2
|
-
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v3.0.47
|
|
4
|
-
Adapter Mode: legacy-thin
|
|
5
|
-
Adapter Source: .agent-instructions.md when present; fallback .instructions.md
|
|
6
|
-
Canonical baseline: .instructions.md
|
|
7
|
-
|
|
8
|
-
This file is kept only for older Cursor discovery.
|
|
9
|
-
Read .agent-instructions.md for the compiled rulebook when present.
|
|
10
|
-
Use .instructions.md as the canonical policy source.
|
|
11
|
-
|
|
12
|
-
Mandatory load floor:
|
|
13
|
-
1. Read .agent-instructions.md when present; otherwise read .instructions.md.
|
|
14
|
-
2. Load only relevant .agent-context/rules/ by task scope.
|
|
15
|
-
3. Apply matching .agent-context/prompts/ contracts.
|
|
16
|
-
4. Enforce .agent-context/review-checklists/ before completion.
|
|
17
|
-
5. Use .agent-context/state/ and .agent-context/policies/ only when relevant.
|
|
18
|
-
6. Resolve Runtime Decision Signals from repo evidence and live official docs.
|
|
19
|
-
7. Resolve Structural Planning Signals from constraints and architecture boundaries.
|
|
20
|
-
|
|
21
|
-
Current bridges:
|
|
22
|
-
- Cursor: .cursor/rules/agentic-senior-core.mdc
|
|
23
|
-
- Windsurf: .windsurf/rules/agentic-senior-core.md
|
|
24
|
-
- Claude: CLAUDE.md
|
|
25
|
-
- Gemini: GEMINI.md and .gemini/instructions.md
|
|
26
|
-
- Copilot: .github/copilot-instructions.md and .github/instructions/agentic-senior-core.instructions.md
|
package/.gemini/instructions.md
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# Gemini Instructions - Thin Adapter
|
|
2
|
-
|
|
3
|
-
Adapter Mode: thin
|
|
4
|
-
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
|
|
6
|
-
|
|
7
|
-
This repository is governed by a strict instruction contract.
|
|
8
|
-
Use [.instructions.md](../.instructions.md) as the canonical policy source.
|
|
9
|
-
Use .agent-context/ for technical rules, prompts, checklists, policies, and state.
|
|
10
|
-
Treat README.md as public and developer overview, setup, usage, and user-facing context only when governance files conflict.
|
|
11
|
-
|
|
12
|
-
## Critical Bootstrap Floor
|
|
13
|
-
|
|
14
|
-
- If your host stops at this file, continue the chain manually before coding.
|
|
15
|
-
- Read `.agent-instructions.md` next when it exists.
|
|
16
|
-
- Memory continuity does not replace bootstrap loading.
|
|
17
|
-
- For UI, UX, layout, screen, tailwind, frontend, or redesign requests, load [bootstrap-design.md](../.agent-context/prompts/bootstrap-design.md) and [frontend-architecture.md](../.agent-context/rules/frontend-architecture.md) before code edits.
|
|
18
|
-
- For UI scope, include a one-line Motion/Palette Decision in the Bootstrap Receipt; product categories are heuristics, not style presets.
|
|
19
|
-
- For UI scope, create or refine `docs/DESIGN.md` and `docs/design-intent.json` before UI implementation.
|
|
20
|
-
- For documentation-first requests, create or refine required project docs in English by default and do not write application, firmware, or UI code until the user asks or approves.
|
|
21
|
-
- Create or refine root README.md as the public and developer entrypoint before implementation.
|
|
22
|
-
- For backend, API, data, auth, error, event, queue, worker, or distributed-system requests, load only relevant global rules from .agent-context/rules/ ([link](../.agent-context/rules)).
|
|
23
|
-
- For ecosystem, framework, dependency, or Docker claims, perform live web research.
|
|
24
|
-
- Resolve runtime choices from project evidence and live official documentation; resolve structural planning from constraints and architecture boundaries.
|
|
25
|
-
|
|
26
|
-
## Mandatory Bootstrap Chain
|
|
27
|
-
|
|
28
|
-
1. Load [.instructions.md](../.instructions.md).
|
|
29
|
-
2. Load `.agent-instructions.md` when present.
|
|
30
|
-
3. Load only relevant files from .agent-context/rules/ ([link](../.agent-context/rules)).
|
|
31
|
-
4. Apply matching prompts from .agent-context/prompts/ ([link](../.agent-context/prompts)).
|
|
32
|
-
5. Enforce .agent-context/review-checklists/ ([link](../.agent-context/review-checklists/pr-checklist.md)).
|
|
33
|
-
6. Use .agent-context/state/ ([link](../.agent-context/state)) and .agent-context/policies/ ([link](../.agent-context/policies)) only when relevant.
|
|
34
|
-
7. Use project docs and live evidence for runtime, dependency, and architecture claims.
|
|
35
|
-
|
|
36
|
-
## Bootstrap Receipt
|
|
37
|
-
|
|
38
|
-
For non-trivial coding, review, planning, or governance work, produce a short Bootstrap Receipt before implementation output: `loaded_files`, `selected_rules`, `skipped_rules`, `unreachable_files`, and `validation_plan`.
|
|
39
|
-
|
|
40
|
-
## Completion Gate
|
|
41
|
-
|
|
42
|
-
Run [pr-checklist.md](../.agent-context/review-checklists/pr-checklist.md) before declaring work complete.
|
|
43
|
-
|
|
44
|
-
If this adapter drifts from canonical behavior, refresh from [.instructions.md](../.instructions.md) and update the hash metadata.
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# GitHub Copilot Instructions - Thin Adapter
|
|
2
|
-
|
|
3
|
-
Adapter Mode: thin
|
|
4
|
-
Adapter Source: .instructions.md
|
|
5
|
-
Canonical Snapshot SHA256: 728c7ecaa49ea69a3e9b03c1c88d25f310a1827f2cebb72de102b5ae5005ff0e
|
|
6
|
-
|
|
7
|
-
This repository is governed by a strict instruction contract.
|
|
8
|
-
Use [.instructions.md](../.instructions.md) as the canonical policy source.
|
|
9
|
-
Use .agent-context/ for technical rules, prompts, checklists, policies, and state.
|
|
10
|
-
Treat README.md as public and developer overview, setup, usage, and user-facing context only when governance files conflict.
|
|
11
|
-
|
|
12
|
-
## Critical Bootstrap Floor
|
|
13
|
-
|
|
14
|
-
- If your host stops at this file, continue the chain manually before coding.
|
|
15
|
-
- Read `.agent-instructions.md` next when it exists.
|
|
16
|
-
- Memory continuity does not replace bootstrap loading.
|
|
17
|
-
- For UI, UX, layout, screen, tailwind, frontend, or redesign requests, load [bootstrap-design.md](../.agent-context/prompts/bootstrap-design.md) and [frontend-architecture.md](../.agent-context/rules/frontend-architecture.md) before code edits.
|
|
18
|
-
- For UI scope, include a one-line Motion/Palette Decision in the Bootstrap Receipt; product categories are heuristics, not style presets.
|
|
19
|
-
- For UI scope, create or refine `docs/DESIGN.md` and `docs/design-intent.json` before UI implementation.
|
|
20
|
-
- For documentation-first requests, create or refine required project docs in English by default and do not write application, firmware, or UI code until the user asks or approves.
|
|
21
|
-
- Create or refine root README.md as the public and developer entrypoint before implementation.
|
|
22
|
-
- For backend, API, data, auth, error, event, queue, worker, or distributed-system requests, load only relevant global rules from .agent-context/rules/ ([link](../.agent-context/rules)).
|
|
23
|
-
- For ecosystem, framework, dependency, or Docker claims, perform live web research.
|
|
24
|
-
- Resolve runtime choices from project evidence and live official documentation; resolve structural planning from constraints and architecture boundaries.
|
|
25
|
-
|
|
26
|
-
## Mandatory Bootstrap Chain
|
|
27
|
-
|
|
28
|
-
1. Load [.instructions.md](../.instructions.md).
|
|
29
|
-
2. Load `.agent-instructions.md` when present.
|
|
30
|
-
3. Load only relevant files from .agent-context/rules/ ([link](../.agent-context/rules)).
|
|
31
|
-
4. Apply matching prompts from .agent-context/prompts/ ([link](../.agent-context/prompts)).
|
|
32
|
-
5. Enforce .agent-context/review-checklists/ ([link](../.agent-context/review-checklists/pr-checklist.md)).
|
|
33
|
-
6. Use .agent-context/state/ ([link](../.agent-context/state)) and .agent-context/policies/ ([link](../.agent-context/policies)) only when relevant.
|
|
34
|
-
7. Use project docs and live evidence for runtime, dependency, and architecture claims.
|
|
35
|
-
|
|
36
|
-
## Bootstrap Receipt
|
|
37
|
-
|
|
38
|
-
For non-trivial coding, review, planning, or governance work, produce a short Bootstrap Receipt before implementation output: `loaded_files`, `selected_rules`, `skipped_rules`, `unreachable_files`, and `validation_plan`.
|
|
39
|
-
|
|
40
|
-
## Completion Gate
|
|
41
|
-
|
|
42
|
-
Run [pr-checklist.md](../.agent-context/review-checklists/pr-checklist.md) before declaring work complete.
|
|
43
|
-
|
|
44
|
-
If this adapter drifts from canonical behavior, refresh from [.instructions.md](../.instructions.md) and update the hash metadata.
|