@ryuenn3123/agentic-senior-core 3.0.15 → 3.0.16
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 +25 -18
- package/.agent-context/rules/architecture.md +13 -0
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.agent-context/state/onboarding-report.json +0 -1
- package/.cursorrules +66 -29
- package/.windsurfrules +66 -29
- package/lib/cli/architect.mjs +71 -784
- package/lib/cli/commands/init.mjs +28 -98
- package/lib/cli/commands/optimize.mjs +0 -4
- package/lib/cli/commands/upgrade.mjs +2 -5
- package/lib/cli/compiler.mjs +1 -11
- package/lib/cli/constants.mjs +3 -73
- package/lib/cli/detector/design-evidence.mjs +427 -0
- package/lib/cli/detector.mjs +13 -116
- package/lib/cli/init-options.mjs +0 -118
- package/lib/cli/project-scaffolder/constants.mjs +67 -0
- package/lib/cli/project-scaffolder/design-contract.mjs +554 -0
- package/lib/cli/project-scaffolder/discovery.mjs +315 -0
- package/lib/cli/project-scaffolder/prompt-builders.mjs +196 -0
- package/lib/cli/project-scaffolder/storage.mjs +154 -0
- package/lib/cli/project-scaffolder.mjs +32 -1210
- package/lib/cli/utils.mjs +2 -11
- package/package.json +1 -1
- package/scripts/frontend-usability-audit.mjs +53 -0
- package/scripts/validate/config.mjs +401 -0
- package/scripts/validate/coverage-checks.mjs +429 -0
- package/scripts/validate.mjs +44 -854
- package/lib/cli/init-architecture-flow.mjs +0 -233
- package/lib/cli/profile-packs.mjs +0 -108
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Init Command — Interactive project initialization.
|
|
3
|
-
* Depends on: constants, utils,
|
|
3
|
+
* Depends on: constants, utils, detector, compiler
|
|
4
4
|
*/
|
|
5
5
|
import { createInterface } from 'node:readline/promises';
|
|
6
6
|
import { stdin, stdout } from 'node:process';
|
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
pathExists,
|
|
34
34
|
} from '../utils.mjs';
|
|
35
35
|
|
|
36
|
-
import { collectProfilePacks, findProfilePackByInput } from '../profile-packs.mjs';
|
|
37
36
|
import {
|
|
38
37
|
detectProjectContext,
|
|
39
38
|
buildDetectionSummary,
|
|
@@ -81,10 +80,6 @@ import {
|
|
|
81
80
|
import { recommendArchitecture } from '../architect.mjs';
|
|
82
81
|
|
|
83
82
|
export { REPO_ROOT } from '../constants.mjs';
|
|
84
|
-
// Keep these architect option flags visible in the init command surface for validator coverage:
|
|
85
|
-
// --architect-research-mode
|
|
86
|
-
// --enable-realtime-research
|
|
87
|
-
// --architect-realtime-signal-file
|
|
88
83
|
export {
|
|
89
84
|
parseInitArguments,
|
|
90
85
|
normalizeRuntimeEnvironmentKey,
|
|
@@ -194,8 +189,7 @@ function inferProjectScopeFromDiscoveryAnswers(discoveryAnswers) {
|
|
|
194
189
|
function resolveSilentCiGuardrailsDefault({
|
|
195
190
|
initOptions,
|
|
196
191
|
selectedPreset,
|
|
197
|
-
|
|
198
|
-
selectedProfile,
|
|
192
|
+
selectedPolicyProfile,
|
|
199
193
|
}) {
|
|
200
194
|
if (typeof initOptions.ci === 'boolean') {
|
|
201
195
|
return {
|
|
@@ -211,22 +205,15 @@ function resolveSilentCiGuardrailsDefault({
|
|
|
211
205
|
};
|
|
212
206
|
}
|
|
213
207
|
|
|
214
|
-
if (
|
|
208
|
+
if (selectedPolicyProfile.lockCi) {
|
|
215
209
|
return {
|
|
216
|
-
value:
|
|
217
|
-
shouldAsk: Boolean(!selectedProfilePack.lockCi),
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (selectedProfile.lockCi) {
|
|
222
|
-
return {
|
|
223
|
-
value: selectedProfile.defaultCi,
|
|
210
|
+
value: selectedPolicyProfile.defaultCi,
|
|
224
211
|
shouldAsk: false,
|
|
225
212
|
};
|
|
226
213
|
}
|
|
227
214
|
|
|
228
215
|
return {
|
|
229
|
-
value:
|
|
216
|
+
value: selectedPolicyProfile.defaultCi,
|
|
230
217
|
shouldAsk: true,
|
|
231
218
|
};
|
|
232
219
|
}
|
|
@@ -279,6 +266,7 @@ function buildInitExistingProjectDesignIntentSeed({
|
|
|
279
266
|
repoEvidence: {
|
|
280
267
|
uiSignalReasons: uiScopeSignals.signalReasons,
|
|
281
268
|
frontendMetrics: uiScopeSignals.frontendEvidenceMetrics || null,
|
|
269
|
+
designEvidenceSummary: uiScopeSignals.designEvidenceSummary || null,
|
|
282
270
|
workspaceUiEntries: uiScopeSignals.workspaceUiEntries || [],
|
|
283
271
|
},
|
|
284
272
|
},
|
|
@@ -333,7 +321,6 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
333
321
|
console.log('[INFO] Static stack/blueprint profiles are not fully present. Using compatibility labels for dynamic reasoning mode.');
|
|
334
322
|
}
|
|
335
323
|
|
|
336
|
-
const profilePackDefinitions = await collectProfilePacks(path.dirname(AGENT_CONTEXT_DIR));
|
|
337
324
|
const selectedPreset = initOptions.preset ? INIT_PRESETS[initOptions.preset] || null : null;
|
|
338
325
|
|
|
339
326
|
const selectedStackFileNameFromOption = initOptions.stack
|
|
@@ -342,10 +329,6 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
342
329
|
const selectedBlueprintFileNameFromOption = initOptions.blueprint
|
|
343
330
|
? matchFileNameFromInput(initOptions.blueprint, blueprintFileNames)
|
|
344
331
|
: null;
|
|
345
|
-
const selectedProfilePack = initOptions.profilePack
|
|
346
|
-
? findProfilePackByInput(initOptions.profilePack, profilePackDefinitions)
|
|
347
|
-
: null;
|
|
348
|
-
|
|
349
332
|
if (initOptions.stack && !selectedStackFileNameFromOption) {
|
|
350
333
|
throw new Error(`Unknown stack: ${initOptions.stack}`);
|
|
351
334
|
}
|
|
@@ -354,26 +337,10 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
354
337
|
throw new Error(`Unknown blueprint: ${initOptions.blueprint}`);
|
|
355
338
|
}
|
|
356
339
|
|
|
357
|
-
if (initOptions.profilePack && !selectedProfilePack) {
|
|
358
|
-
throw new Error(`Unknown profile pack: ${initOptions.profilePack}`);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
340
|
if (initOptions.preset && !selectedPreset) {
|
|
362
341
|
throw new Error(`Unknown preset: ${initOptions.preset}`);
|
|
363
342
|
}
|
|
364
343
|
|
|
365
|
-
if (selectedProfilePack && !stackFileNames.includes(selectedProfilePack.defaultStackFileName)) {
|
|
366
|
-
throw new Error(
|
|
367
|
-
`Profile pack ${selectedProfilePack.fileName} references unknown stack file: ${selectedProfilePack.defaultStackFileName}`
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
if (selectedProfilePack && !blueprintFileNames.includes(selectedProfilePack.defaultBlueprintFileName)) {
|
|
372
|
-
throw new Error(
|
|
373
|
-
`Profile pack ${selectedProfilePack.fileName} references unknown blueprint file: ${selectedProfilePack.defaultBlueprintFileName}`
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
344
|
console.log(`\nAgentic-Senior-Core CLI v${CLI_VERSION}`);
|
|
378
345
|
console.log('I will copy rules operations assets (Federated Governance baseline) into your target folder and compile a single rulebook for your AI tools.');
|
|
379
346
|
|
|
@@ -398,34 +365,18 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
398
365
|
? detectedRuntimeEnvironment.key
|
|
399
366
|
: initOptions.runtimeEnv;
|
|
400
367
|
|
|
401
|
-
const
|
|
402
|
-
initOptions.profile
|
|
403
|
-
|| selectedPreset?.profile
|
|
404
|
-
|| initOptions.newbie
|
|
405
|
-
|| selectedProfilePack?.defaultProfileName
|
|
406
|
-
);
|
|
407
|
-
|
|
408
|
-
const selectedProfileName = initOptions.profile
|
|
368
|
+
const selectedPolicyProfileName = initOptions.profile
|
|
409
369
|
? initOptions.profile
|
|
410
|
-
:
|
|
411
|
-
?
|
|
412
|
-
:
|
|
413
|
-
? 'beginner'
|
|
414
|
-
: selectedProfilePack?.defaultProfileName
|
|
415
|
-
? selectedProfilePack.defaultProfileName
|
|
416
|
-
: GOLDEN_STANDARD_PROFILE_NAME;
|
|
417
|
-
|
|
418
|
-
const selectedProfile = PROFILE_PRESETS[selectedProfileName];
|
|
419
|
-
if (!selectedProfile) {
|
|
420
|
-
throw new Error(`Unknown profile: ${selectedProfileName}`);
|
|
421
|
-
}
|
|
370
|
+
: initOptions.newbie
|
|
371
|
+
? 'beginner'
|
|
372
|
+
: GOLDEN_STANDARD_PROFILE_NAME;
|
|
422
373
|
|
|
423
|
-
|
|
424
|
-
|
|
374
|
+
const selectedPolicyProfile = PROFILE_PRESETS[selectedPolicyProfileName];
|
|
375
|
+
if (!selectedPolicyProfile) {
|
|
376
|
+
throw new Error(`Unknown internal policy profile: ${selectedPolicyProfileName}`);
|
|
425
377
|
}
|
|
426
378
|
|
|
427
|
-
console.log(`\
|
|
428
|
-
console.log(`This profile will block these review severities in CI: ${formatBlockingSeverities(selectedProfile.blockingSeverities)}.`);
|
|
379
|
+
console.log(`\nReview thresholds: ${formatBlockingSeverities(selectedPolicyProfile.blockingSeverities)}.`);
|
|
429
380
|
|
|
430
381
|
const detectionMajorConstraints = buildExistingProjectMajorConstraints();
|
|
431
382
|
const detectionTransparency = {
|
|
@@ -446,9 +397,9 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
446
397
|
'.github/copilot-instructions.md',
|
|
447
398
|
],
|
|
448
399
|
stackLoadingMode: 'lazy',
|
|
449
|
-
selectedProfile:
|
|
450
|
-
selectedProfileDisplayName:
|
|
451
|
-
blockingSeverities:
|
|
400
|
+
selectedProfile: selectedPolicyProfileName,
|
|
401
|
+
selectedProfileDisplayName: selectedPolicyProfile.displayName,
|
|
402
|
+
blockingSeverities: selectedPolicyProfile.blockingSeverities,
|
|
452
403
|
ciGuardrailsEnabled: null,
|
|
453
404
|
},
|
|
454
405
|
majorConstraints: detectionMajorConstraints,
|
|
@@ -484,7 +435,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
484
435
|
|
|
485
436
|
console.log('- Active rules baseline: canonical .instructions.md -> compiled .cursorrules/.windsurfrules');
|
|
486
437
|
console.log(
|
|
487
|
-
`- Active review
|
|
438
|
+
`- Active review thresholds: ${formatBlockingSeverities(selectedPolicyProfile.blockingSeverities)}`
|
|
488
439
|
);
|
|
489
440
|
console.log('- Major constraints:');
|
|
490
441
|
for (const majorConstraint of detectionMajorConstraints) {
|
|
@@ -492,11 +443,6 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
492
443
|
}
|
|
493
444
|
}
|
|
494
445
|
|
|
495
|
-
if (selectedProfilePack) {
|
|
496
|
-
console.log(`Applying team profile pack: ${selectedProfilePack.displayName}.`);
|
|
497
|
-
console.log(`Pack defaults: stack ${toTitleCase(selectedProfilePack.defaultStackFileName)}, blueprint ${toTitleCase(selectedProfilePack.defaultBlueprintFileName)}.`);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
446
|
const hasReliableDetectedStack = projectDetection.hasExistingProjectFiles
|
|
501
447
|
&& projectDetection.recommendedStackFileName
|
|
502
448
|
&& (projectDetection.confidenceLabel === 'high' || projectDetection.confidenceLabel === 'medium');
|
|
@@ -504,7 +450,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
504
450
|
const shouldAutoApplyDetectedStack = hasReliableDetectedStack
|
|
505
451
|
&& !selectedStackFileNameFromOption
|
|
506
452
|
&& !selectedPreset?.stack
|
|
507
|
-
&& !
|
|
453
|
+
&& !selectedPolicyProfile.defaultStackFileName;
|
|
508
454
|
let detectedBlueprintFileName = projectDetection.recommendedBlueprintFileName
|
|
509
455
|
|| BLUEPRINT_RECOMMENDATIONS[projectDetection.recommendedStackFileName]
|
|
510
456
|
|| null;
|
|
@@ -522,8 +468,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
522
468
|
const ciGuardrailsSelection = resolveSilentCiGuardrailsDefault({
|
|
523
469
|
initOptions,
|
|
524
470
|
selectedPreset,
|
|
525
|
-
|
|
526
|
-
selectedProfile,
|
|
471
|
+
selectedPolicyProfile,
|
|
527
472
|
});
|
|
528
473
|
const isFreshProjectTarget = !projectDetection.hasExistingProjectFiles
|
|
529
474
|
&& wasDirectoryEffectivelyEmpty
|
|
@@ -579,8 +524,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
579
524
|
const shouldUseSilentArchitectureSelection = !selectedStackFileNameFromOption
|
|
580
525
|
&& !selectedPreset?.stack
|
|
581
526
|
&& !shouldAutoApplyDetectedStack
|
|
582
|
-
&& !
|
|
583
|
-
&& !selectedProfile.defaultStackFileName;
|
|
527
|
+
&& !selectedPolicyProfile.defaultStackFileName;
|
|
584
528
|
|
|
585
529
|
if (shouldUseSilentArchitectureSelection) {
|
|
586
530
|
const architectureScopeStackCandidates = filterStackFileNamesByCandidates(
|
|
@@ -597,11 +541,6 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
597
541
|
projectDetection,
|
|
598
542
|
stackFileNames: architectureScopeStackCandidates,
|
|
599
543
|
blueprintFileNames: architectureScopeBlueprintCandidates,
|
|
600
|
-
tokenBudget: initOptions.architectTokenBudget,
|
|
601
|
-
timeoutMs: initOptions.architectTimeoutMs,
|
|
602
|
-
researchMode: initOptions.architectResearchMode,
|
|
603
|
-
enableRealtimeResearch: initOptions.enableRealtimeResearch,
|
|
604
|
-
realtimeSignalFilePath: initOptions.architectRealtimeSignalFile,
|
|
605
544
|
});
|
|
606
545
|
|
|
607
546
|
architectureRecommendation.projectDomain = {
|
|
@@ -630,8 +569,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
630
569
|
|| selectedPreset?.stack
|
|
631
570
|
|| selectedManualStackFileName
|
|
632
571
|
|| (detectedSetupWasApplied ? projectDetection.recommendedStackFileName : null)
|
|
633
|
-
||
|
|
634
|
-
|| selectedProfile.defaultStackFileName
|
|
572
|
+
|| selectedPolicyProfile.defaultStackFileName
|
|
635
573
|
|| stackFileNames[0];
|
|
636
574
|
|
|
637
575
|
selectedAdditionalStackFileNames = normalizeAdditionalStackSelection(
|
|
@@ -644,7 +582,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
644
582
|
? detectedBlueprintFileName
|
|
645
583
|
: BLUEPRINT_RECOMMENDATIONS[selectedResolvedStackFileName] || null;
|
|
646
584
|
|
|
647
|
-
if (!recommendedBlueprintFileName && !selectedBlueprintFileNameFromOption && !
|
|
585
|
+
if (!recommendedBlueprintFileName && !selectedBlueprintFileNameFromOption && !selectedPolicyProfile.defaultBlueprintFileName) {
|
|
648
586
|
console.log('\nI could not map that stack to a first-party blueprint automatically, so I will ask you to choose one.');
|
|
649
587
|
}
|
|
650
588
|
|
|
@@ -652,8 +590,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
652
590
|
|| selectedPreset?.blueprint
|
|
653
591
|
|| selectedManualBlueprintFileName
|
|
654
592
|
|| recommendedBlueprintFileName
|
|
655
|
-
||
|
|
656
|
-
|| selectedProfile.defaultBlueprintFileName
|
|
593
|
+
|| selectedPolicyProfile.defaultBlueprintFileName
|
|
657
594
|
|| blueprintFileNames[
|
|
658
595
|
blueprintDisplayChoices.indexOf(
|
|
659
596
|
await askChoice('Which blueprint should I scaffold into the compiled rulebook?', blueprintDisplayChoices, userInterface)
|
|
@@ -815,8 +752,6 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
815
752
|
|
|
816
753
|
await compileDynamicContext({
|
|
817
754
|
targetDirectoryPath: resolvedTargetDirectoryPath,
|
|
818
|
-
selectedProfileName,
|
|
819
|
-
selectedProfilePack,
|
|
820
755
|
selectedStackFileName: selectedResolvedStackFileName,
|
|
821
756
|
selectedAdditionalStackFileNames,
|
|
822
757
|
selectedBlueprintFileName: selectedResolvedBlueprintFileName,
|
|
@@ -824,13 +759,12 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
824
759
|
includeCiGuardrails,
|
|
825
760
|
});
|
|
826
761
|
|
|
827
|
-
await writeSelectedPolicy(resolvedTargetDirectoryPath,
|
|
762
|
+
await writeSelectedPolicy(resolvedTargetDirectoryPath, selectedPolicyProfileName);
|
|
828
763
|
|
|
829
764
|
const setupDurationMs = Date.now() - setupStartedAt;
|
|
830
765
|
await writeOnboardingReport({
|
|
831
766
|
targetDirectoryPath: resolvedTargetDirectoryPath,
|
|
832
|
-
selectedProfileName,
|
|
833
|
-
selectedProfilePack,
|
|
767
|
+
selectedProfileName: selectedPolicyProfileName,
|
|
834
768
|
selectedPreset: initOptions.preset || null,
|
|
835
769
|
projectScope: {
|
|
836
770
|
key: selectedProjectScopeKey,
|
|
@@ -871,13 +805,9 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
871
805
|
|
|
872
806
|
console.log('\nInitialization complete.');
|
|
873
807
|
console.log(`- Target directory: ${resolvedTargetDirectoryPath}`);
|
|
874
|
-
console.log(`- Profile: ${selectedProfile.displayName}`);
|
|
875
808
|
if (initOptions.preset) {
|
|
876
809
|
console.log(`- Preset: ${initOptions.preset}`);
|
|
877
810
|
}
|
|
878
|
-
if (selectedProfilePack) {
|
|
879
|
-
console.log(`- Team profile pack: ${selectedProfilePack.displayName}`);
|
|
880
|
-
}
|
|
881
811
|
if (!projectDetection.hasExistingProjectFiles) {
|
|
882
812
|
console.log(`- Project domain: ${selectedProjectScopeLabel}`);
|
|
883
813
|
if (discoveryAnswers?.architectureStyle) {
|
|
@@ -894,7 +824,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
894
824
|
}
|
|
895
825
|
console.log(`- Runtime environment: ${resolveRuntimeEnvironmentLabelFromKey(selectedRuntimeEnvironmentKey)} (detected: ${detectedRuntimeEnvironment.label})`);
|
|
896
826
|
console.log(`- CI/CD quality checks (guardrails): ${includeCiGuardrails ? 'enabled' : 'disabled'}`);
|
|
897
|
-
console.log(`-
|
|
827
|
+
console.log(`- Review thresholds: ${formatBlockingSeverities(selectedPolicyProfile.blockingSeverities)}`);
|
|
898
828
|
console.log(`- Setup time: ${formatDuration(setupDurationMs)}`);
|
|
899
829
|
console.log('- Generated files: .instructions.md, .agent-instructions.md, compiled adapters, and .agent-context/state/onboarding-report.json');
|
|
900
830
|
if (scaffoldingResult?.bootstrapMode === 'ai-synthesis') {
|
|
@@ -924,7 +854,7 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
924
854
|
console.log('- Token optimization policy: disabled (--no-token-optimize)');
|
|
925
855
|
}
|
|
926
856
|
console.log('\nPlain-language summary:');
|
|
927
|
-
console.log(`I prepared a
|
|
857
|
+
console.log(`I prepared a repo-grounded rules operations pack (Federated Governance baseline) for a ${toTitleCase(selectedResolvedStackFileName)} project using the ${toTitleCase(selectedResolvedBlueprintFileName)} blueprint.`);
|
|
928
858
|
if (selectedAdditionalStackFileNames.length > 0) {
|
|
929
859
|
console.log(`I also included additional stack context for ${selectedAdditionalStackFileNames.map((stackFileName) => toTitleCase(stackFileName)).join(', ')}.`);
|
|
930
860
|
}
|
|
@@ -115,9 +115,6 @@ export async function runOptimizeCommand(targetDirectoryArgument, optimizeOption
|
|
|
115
115
|
|
|
116
116
|
await writeTokenOptimizationState(resolvedTargetDirectoryPath, tokenOptimizationState);
|
|
117
117
|
|
|
118
|
-
const selectedProfileName = typeof onboardingReport.selectedProfile === 'string'
|
|
119
|
-
? onboardingReport.selectedProfile
|
|
120
|
-
: 'balanced';
|
|
121
118
|
const selectedStackFileName = normalizeMarkdownFileName(onboardingReport.selectedStack, 'typescript.md');
|
|
122
119
|
const selectedAdditionalStackFileNames = Array.isArray(onboardingReport.selectedAdditionalStacks)
|
|
123
120
|
? onboardingReport.selectedAdditionalStacks
|
|
@@ -136,7 +133,6 @@ export async function runOptimizeCommand(targetDirectoryArgument, optimizeOption
|
|
|
136
133
|
|
|
137
134
|
await compileDynamicContext({
|
|
138
135
|
targetDirectoryPath: resolvedTargetDirectoryPath,
|
|
139
|
-
selectedProfileName,
|
|
140
136
|
selectedStackFileName,
|
|
141
137
|
selectedAdditionalStackFileNames,
|
|
142
138
|
selectedBlueprintFileName,
|
|
@@ -141,6 +141,7 @@ function buildUpgradeDesignIntentSeed({
|
|
|
141
141
|
repoEvidence: {
|
|
142
142
|
uiSignalReasons: uiScopeSignals.signalReasons,
|
|
143
143
|
frontendMetrics: uiScopeSignals.frontendEvidenceMetrics || null,
|
|
144
|
+
designEvidenceSummary: uiScopeSignals.designEvidenceSummary || null,
|
|
144
145
|
workspaceUiEntries: uiScopeSignals.workspaceUiEntries || [],
|
|
145
146
|
},
|
|
146
147
|
},
|
|
@@ -278,7 +279,7 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
278
279
|
}
|
|
279
280
|
console.log('- Active rules baseline: canonical .instructions.md -> compiled .cursorrules/.windsurfrules');
|
|
280
281
|
console.log(
|
|
281
|
-
`- Active review
|
|
282
|
+
`- Active review thresholds: ${(
|
|
282
283
|
PROFILE_PRESETS[selectedProfileName]?.blockingSeverities || []
|
|
283
284
|
).join(', ') || 'none'})`
|
|
284
285
|
);
|
|
@@ -298,7 +299,6 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
298
299
|
|
|
299
300
|
const plannedRulesContent = await buildCompiledRulesContent({
|
|
300
301
|
targetDirectoryPath: resolvedTargetDirectoryPath,
|
|
301
|
-
selectedProfileName,
|
|
302
302
|
selectedStackFileName,
|
|
303
303
|
selectedAdditionalStackFileNames,
|
|
304
304
|
selectedBlueprintFileName,
|
|
@@ -312,7 +312,6 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
312
312
|
|
|
313
313
|
console.log('\nUpgrade preview:');
|
|
314
314
|
console.log(`- Target directory: ${resolvedTargetDirectoryPath}`);
|
|
315
|
-
console.log(`- Profile: ${toTitleCase(selectedProfileName)}`);
|
|
316
315
|
console.log(`- Stack: ${toTitleCase(selectedStackFileName)}`);
|
|
317
316
|
if (selectedAdditionalStackFileNames.length > 0) {
|
|
318
317
|
console.log(`- Additional stacks: ${selectedAdditionalStackFileNames.map((stackFileName) => toTitleCase(stackFileName)).join(', ')}`);
|
|
@@ -411,7 +410,6 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
411
410
|
|
|
412
411
|
await compileDynamicContext({
|
|
413
412
|
targetDirectoryPath: resolvedTargetDirectoryPath,
|
|
414
|
-
selectedProfileName,
|
|
415
413
|
selectedStackFileName,
|
|
416
414
|
selectedAdditionalStackFileNames,
|
|
417
415
|
selectedBlueprintFileName,
|
|
@@ -424,7 +422,6 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
424
422
|
await writeOnboardingReport({
|
|
425
423
|
targetDirectoryPath: resolvedTargetDirectoryPath,
|
|
426
424
|
selectedProfileName,
|
|
427
|
-
selectedProfilePack: existingOnboardingReport?.selectedProfilePack || null,
|
|
428
425
|
projectScope: existingOnboardingReport?.projectScope || null,
|
|
429
426
|
selectedStackFileName,
|
|
430
427
|
selectedAdditionalStackFileNames,
|
package/lib/cli/compiler.mjs
CHANGED
|
@@ -35,7 +35,6 @@ export async function writeSelectedPolicy(targetDirectoryPath, selectedProfileNa
|
|
|
35
35
|
export async function writeOnboardingReport({
|
|
36
36
|
targetDirectoryPath,
|
|
37
37
|
selectedProfileName,
|
|
38
|
-
selectedProfilePack,
|
|
39
38
|
selectedPreset,
|
|
40
39
|
projectScope = null,
|
|
41
40
|
projectTopology = null,
|
|
@@ -66,12 +65,6 @@ export async function writeOnboardingReport({
|
|
|
66
65
|
generatedAt: new Date().toISOString(),
|
|
67
66
|
operationMode,
|
|
68
67
|
selectedProfile: selectedProfileName,
|
|
69
|
-
selectedProfilePack: selectedProfilePack
|
|
70
|
-
? {
|
|
71
|
-
name: selectedProfilePack.slug,
|
|
72
|
-
sourceFile: selectedProfilePack.fileName,
|
|
73
|
-
}
|
|
74
|
-
: null,
|
|
75
68
|
selectedPreset,
|
|
76
69
|
projectScope,
|
|
77
70
|
projectTopology,
|
|
@@ -114,6 +107,7 @@ export async function writeOnboardingReport({
|
|
|
114
107
|
signalReasons: uiScopeSignals.signalReasons || [],
|
|
115
108
|
workspaceUiEntries: uiScopeSignals.workspaceUiEntries || [],
|
|
116
109
|
frontendEvidenceMetrics: uiScopeSignals.frontendEvidenceMetrics || null,
|
|
110
|
+
designEvidenceSummary: uiScopeSignals.designEvidenceSummary || null,
|
|
117
111
|
}
|
|
118
112
|
: null,
|
|
119
113
|
},
|
|
@@ -134,7 +128,6 @@ export async function loadOnboardingReportIfExists(targetDirectoryPath) {
|
|
|
134
128
|
|
|
135
129
|
export async function buildCompiledRulesContent({
|
|
136
130
|
targetDirectoryPath,
|
|
137
|
-
selectedProfileName,
|
|
138
131
|
selectedStackFileName,
|
|
139
132
|
selectedAdditionalStackFileNames = [],
|
|
140
133
|
selectedBlueprintFileName,
|
|
@@ -457,7 +450,6 @@ export async function buildCompiledRulesContent({
|
|
|
457
450
|
'',
|
|
458
451
|
`Generated by Agentic-Senior-Core CLI v${CLI_VERSION}`,
|
|
459
452
|
`Timestamp: ${new Date().toISOString()}`,
|
|
460
|
-
`Selected profile: ${selectedProfileName}`,
|
|
461
453
|
`Selected policy file: .agent-context/policies/${POLICY_FILE_NAME}`,
|
|
462
454
|
'',
|
|
463
455
|
'## GOVERNANCE PRECEDENCE',
|
|
@@ -478,7 +470,6 @@ export async function buildCompiledRulesContent({
|
|
|
478
470
|
|
|
479
471
|
export async function compileDynamicContext({
|
|
480
472
|
targetDirectoryPath,
|
|
481
|
-
selectedProfileName,
|
|
482
473
|
selectedStackFileName,
|
|
483
474
|
selectedAdditionalStackFileNames = [],
|
|
484
475
|
selectedBlueprintFileName,
|
|
@@ -488,7 +479,6 @@ export async function compileDynamicContext({
|
|
|
488
479
|
const resolvedTargetDirectoryPath = path.resolve(targetDirectoryPath);
|
|
489
480
|
const compiledRules = await buildCompiledRulesContent({
|
|
490
481
|
targetDirectoryPath: resolvedTargetDirectoryPath,
|
|
491
|
-
selectedProfileName,
|
|
492
482
|
selectedStackFileName,
|
|
493
483
|
selectedAdditionalStackFileNames,
|
|
494
484
|
selectedBlueprintFileName,
|
package/lib/cli/constants.mjs
CHANGED
|
@@ -14,19 +14,6 @@ export const PACKAGE_JSON_PATH = join(REPO_ROOT, 'package.json');
|
|
|
14
14
|
export const CLI_VERSION = JSON.parse(readFileSync(PACKAGE_JSON_PATH, 'utf8')).version;
|
|
15
15
|
export const AGENT_CONTEXT_DIR = join(REPO_ROOT, '.agent-context');
|
|
16
16
|
export const POLICY_FILE_NAME = 'llm-judge-threshold.json';
|
|
17
|
-
export const PROFILE_PACKS_DIRECTORY_NAME = 'profiles';
|
|
18
|
-
|
|
19
|
-
export const PROFILE_PACK_REQUIRED_FIELDS = [
|
|
20
|
-
'slug',
|
|
21
|
-
'displayName',
|
|
22
|
-
'description',
|
|
23
|
-
'defaultProfile',
|
|
24
|
-
'defaultStack',
|
|
25
|
-
'defaultBlueprint',
|
|
26
|
-
'ciGuardrails',
|
|
27
|
-
'lockCi',
|
|
28
|
-
'blockingSeverities',
|
|
29
|
-
];
|
|
30
17
|
|
|
31
18
|
export const ALLOWED_SEVERITY_LEVELS = new Set(['critical', 'high', 'medium', 'low']);
|
|
32
19
|
|
|
@@ -71,131 +58,74 @@ export const FALLBACK_BLUEPRINT_FILE_NAMES = [
|
|
|
71
58
|
'mobile-app.md',
|
|
72
59
|
];
|
|
73
60
|
|
|
74
|
-
export const FALLBACK_PROFILE_PACK_DEFINITIONS = [
|
|
75
|
-
{
|
|
76
|
-
fileName: 'startup.md',
|
|
77
|
-
slug: 'startup',
|
|
78
|
-
displayName: 'Startup Team',
|
|
79
|
-
description: 'Fast iteration with balanced guardrails and quick onboarding defaults.',
|
|
80
|
-
defaultProfileName: 'balanced',
|
|
81
|
-
defaultStackFileName: 'typescript.md',
|
|
82
|
-
defaultBlueprintFileName: 'api-nextjs.md',
|
|
83
|
-
defaultCi: true,
|
|
84
|
-
lockCi: false,
|
|
85
|
-
blockingSeverities: ['critical', 'high'],
|
|
86
|
-
owner: 'product-engineering',
|
|
87
|
-
lastUpdated: '2026-03-19',
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
fileName: 'regulated.md',
|
|
91
|
-
slug: 'regulated',
|
|
92
|
-
displayName: 'Regulated Team',
|
|
93
|
-
description: 'Compliance-first defaults with strict policy and locked CI guardrails.',
|
|
94
|
-
defaultProfileName: 'strict',
|
|
95
|
-
defaultStackFileName: 'typescript.md',
|
|
96
|
-
defaultBlueprintFileName: 'api-nextjs.md',
|
|
97
|
-
defaultCi: true,
|
|
98
|
-
lockCi: true,
|
|
99
|
-
blockingSeverities: ['critical', 'high', 'medium'],
|
|
100
|
-
owner: 'governance-office',
|
|
101
|
-
lastUpdated: '2026-03-19',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
fileName: 'platform.md',
|
|
105
|
-
slug: 'platform',
|
|
106
|
-
displayName: 'Platform Team',
|
|
107
|
-
description: 'Reliability-oriented defaults for shared platform modules across teams.',
|
|
108
|
-
defaultProfileName: 'balanced',
|
|
109
|
-
defaultStackFileName: 'go.md',
|
|
110
|
-
defaultBlueprintFileName: 'go-service.md',
|
|
111
|
-
defaultCi: true,
|
|
112
|
-
lockCi: false,
|
|
113
|
-
blockingSeverities: ['critical', 'high'],
|
|
114
|
-
owner: 'platform-foundation',
|
|
115
|
-
lastUpdated: '2026-03-19',
|
|
116
|
-
},
|
|
117
|
-
];
|
|
118
|
-
|
|
119
61
|
export const INIT_PRESETS = {
|
|
120
62
|
'frontend-web': {
|
|
121
|
-
profile: 'balanced',
|
|
122
63
|
stack: 'typescript.md',
|
|
123
64
|
blueprint: 'api-nextjs.md',
|
|
124
65
|
ci: true,
|
|
125
66
|
description: 'Frontend-first web app starter',
|
|
126
67
|
},
|
|
127
68
|
'backend-api': {
|
|
128
|
-
profile: 'balanced',
|
|
129
69
|
stack: 'python.md',
|
|
130
70
|
blueprint: 'fastapi-service.md',
|
|
131
71
|
ci: true,
|
|
132
72
|
description: 'Backend API starter with safe defaults',
|
|
133
73
|
},
|
|
134
74
|
'fullstack-product': {
|
|
135
|
-
profile: 'balanced',
|
|
136
75
|
stack: 'typescript.md',
|
|
137
76
|
blueprint: 'api-nextjs.md',
|
|
138
77
|
ci: true,
|
|
139
78
|
description: 'Product delivery starter with fullstack governance',
|
|
140
79
|
},
|
|
141
80
|
'platform-governance': {
|
|
142
|
-
profile: 'strict',
|
|
143
81
|
stack: 'go.md',
|
|
144
82
|
blueprint: 'go-service.md',
|
|
145
83
|
ci: true,
|
|
146
|
-
description: '
|
|
84
|
+
description: 'Platform and delivery starter with Go service defaults',
|
|
147
85
|
},
|
|
148
86
|
'mobile-react-native': {
|
|
149
|
-
profile: 'balanced',
|
|
150
87
|
stack: 'react-native.md',
|
|
151
88
|
blueprint: 'mobile-app.md',
|
|
152
89
|
ci: true,
|
|
153
90
|
description: 'Mobile app starter for React Native',
|
|
154
91
|
},
|
|
155
92
|
'mobile-flutter': {
|
|
156
|
-
profile: 'balanced',
|
|
157
93
|
stack: 'flutter.md',
|
|
158
94
|
blueprint: 'mobile-app.md',
|
|
159
95
|
ci: true,
|
|
160
96
|
description: 'Mobile app starter for Flutter',
|
|
161
97
|
},
|
|
162
98
|
'observability-platform': {
|
|
163
|
-
profile: 'strict',
|
|
164
99
|
stack: 'go.md',
|
|
165
100
|
blueprint: 'observability.md',
|
|
166
101
|
ci: true,
|
|
167
102
|
description: 'Observability and platform starter',
|
|
168
103
|
},
|
|
169
104
|
'typescript-nestjs-service': {
|
|
170
|
-
profile: 'balanced',
|
|
171
105
|
stack: 'typescript.md',
|
|
172
106
|
blueprint: 'nestjs-logic.md',
|
|
173
107
|
ci: true,
|
|
174
108
|
description: 'TypeScript service starter with NestJS module blueprint',
|
|
175
109
|
},
|
|
176
110
|
'java-enterprise-api': {
|
|
177
|
-
profile: 'strict',
|
|
178
111
|
stack: 'java.md',
|
|
179
112
|
blueprint: 'spring-boot-api.md',
|
|
180
113
|
ci: true,
|
|
181
114
|
description: 'Enterprise API starter for JVM teams',
|
|
182
115
|
},
|
|
183
116
|
'dotnet-enterprise-api': {
|
|
184
|
-
profile: 'strict',
|
|
185
117
|
stack: 'csharp.md',
|
|
186
118
|
blueprint: 'aspnet-api.md',
|
|
187
119
|
ci: true,
|
|
188
|
-
description: '.NET API starter with
|
|
120
|
+
description: '.NET API starter with enterprise-friendly defaults',
|
|
189
121
|
},
|
|
190
122
|
'php-laravel-api': {
|
|
191
|
-
profile: 'balanced',
|
|
192
123
|
stack: 'php.md',
|
|
193
124
|
blueprint: 'laravel-api.md',
|
|
194
125
|
ci: true,
|
|
195
|
-
description: 'Laravel API starter with
|
|
126
|
+
description: 'Laravel API starter with current framework defaults',
|
|
196
127
|
},
|
|
197
128
|
'kubernetes-platform': {
|
|
198
|
-
profile: 'strict',
|
|
199
129
|
stack: 'go.md',
|
|
200
130
|
blueprint: 'kubernetes-manifests.md',
|
|
201
131
|
ci: true,
|