@ryuenn3123/agentic-senior-core 2.5.22 → 3.0.0
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/init-project.md +5 -5
- package/.agent-context/prompts/refactor.md +2 -1
- package/.agent-context/prompts/review-code.md +3 -2
- package/.agent-context/review-checklists/pr-checklist.md +8 -1
- package/.agent-context/rules/architecture.md +11 -0
- package/.agent-context/rules/frontend-architecture.md +2 -2
- package/.agent-context/state/architecture-map.md +1 -1
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.agents/workflows/init-project.md +3 -3
- package/.agents/workflows/refactor.md +1 -1
- package/.agents/workflows/review-code.md +4 -5
- package/.cursorrules +27 -71
- package/.gemini/instructions.md +6 -7
- package/.github/copilot-instructions.md +5 -6
- package/.windsurfrules +27 -71
- package/AGENTS.md +7 -9
- package/CONTRIBUTING.md +18 -31
- package/README.md +21 -4
- package/bin/agentic-senior-core.js +0 -6
- package/lib/cli/commands/init.mjs +113 -650
- package/lib/cli/commands/launch.mjs +1 -23
- package/lib/cli/commands/rollback.mjs +1 -1
- package/lib/cli/commands/upgrade.mjs +1 -23
- package/lib/cli/compiler.mjs +77 -72
- package/lib/cli/constants.mjs +84 -26
- package/lib/cli/init-architecture-flow.mjs +231 -0
- package/lib/cli/init-detection-flow.mjs +123 -0
- package/lib/cli/init-options.mjs +344 -0
- package/lib/cli/init-selection.mjs +100 -0
- package/lib/cli/preflight.mjs +1 -1
- package/lib/cli/profile-packs.mjs +15 -1
- package/lib/cli/project-scaffolder.mjs +18 -154
- package/lib/cli/utils.mjs +16 -12
- package/mcp.json +19 -19
- package/package.json +5 -2
- package/scripts/context-triggered-audit.mjs +18 -18
- package/scripts/documentation-boundary-audit.mjs +92 -5
- package/scripts/forbidden-content-check.mjs +1 -1
- package/scripts/frontend-usability-audit.mjs +21 -28
- package/scripts/governance-weekly-report.mjs +29 -15
- package/scripts/llm-judge.mjs +2 -5
- package/scripts/mcp-server.mjs +389 -5
- package/scripts/release-gate.mjs +121 -145
- package/scripts/sync-thin-adapters.mjs +161 -0
- package/scripts/v3-purge-audit.mjs +231 -0
- package/scripts/validate-evidence-bundle.mjs +1 -1
- package/scripts/validate.mjs +224 -272
- package/.agent-context/blueprints/api-nextjs.md +0 -184
- package/.agent-context/blueprints/aspnet-api.md +0 -247
- package/.agent-context/blueprints/ci-github-actions.md +0 -226
- package/.agent-context/blueprints/ci-gitlab.md +0 -200
- package/.agent-context/blueprints/fastapi-service.md +0 -210
- package/.agent-context/blueprints/go-service.md +0 -217
- package/.agent-context/blueprints/graphql-grpc-api.md +0 -51
- package/.agent-context/blueprints/infrastructure-as-code.md +0 -62
- package/.agent-context/blueprints/kubernetes-manifests.md +0 -76
- package/.agent-context/blueprints/laravel-api.md +0 -233
- package/.agent-context/blueprints/mobile-app.md +0 -91
- package/.agent-context/blueprints/nestjs-logic.md +0 -247
- package/.agent-context/blueprints/observability.md +0 -227
- package/.agent-context/blueprints/spring-boot-api.md +0 -218
- package/.agent-context/profiles/platform.md +0 -13
- package/.agent-context/profiles/regulated.md +0 -13
- package/.agent-context/profiles/startup.md +0 -13
- package/.agent-context/review-checklists/frontend-excellence-rubric.md +0 -73
- package/.agent-context/review-checklists/frontend-skill-parity.md +0 -29
- package/.agent-context/review-checklists/frontend-usability.md +0 -35
- package/.agent-context/review-checklists/marketplace-acceptance.md +0 -60
- package/.agent-context/review-checklists/performance-audit.md +0 -71
- package/.agent-context/review-checklists/release-operations.md +0 -33
- package/.agent-context/review-checklists/security-audit.md +0 -119
- package/.agent-context/skills/README.md +0 -63
- package/.agent-context/skills/backend/README.md +0 -68
- package/.agent-context/skills/backend/architecture.md +0 -361
- package/.agent-context/skills/backend/compatibility-manifest.json +0 -8
- package/.agent-context/skills/backend/data-access.md +0 -231
- package/.agent-context/skills/backend/errors.md +0 -138
- package/.agent-context/skills/backend/validation.md +0 -117
- package/.agent-context/skills/backend.md +0 -29
- package/.agent-context/skills/cli/.evidence/compatibility-manifest.json +0 -5
- package/.agent-context/skills/cli/.evidence/sbom-excerpt.json +0 -10
- package/.agent-context/skills/cli/.evidence/test-report.json +0 -8
- package/.agent-context/skills/cli/CHANGELOG.md +0 -6
- package/.agent-context/skills/cli/README.md +0 -56
- package/.agent-context/skills/cli/compatibility-manifest.json +0 -8
- package/.agent-context/skills/cli/init.md +0 -38
- package/.agent-context/skills/cli/output.md +0 -36
- package/.agent-context/skills/cli/package.json +0 -5
- package/.agent-context/skills/cli/safety-telemetry.md +0 -39
- package/.agent-context/skills/cli/tests/.gitkeep +0 -1
- package/.agent-context/skills/cli/upgrade.md +0 -38
- package/.agent-context/skills/cli.md +0 -32
- package/.agent-context/skills/distribution/.evidence/compatibility-manifest.json +0 -9
- package/.agent-context/skills/distribution/.evidence/sbom-excerpt.json +0 -6
- package/.agent-context/skills/distribution/.evidence/test-report.json +0 -8
- package/.agent-context/skills/distribution/CHANGELOG.md +0 -7
- package/.agent-context/skills/distribution/README.md +0 -27
- package/.agent-context/skills/distribution/compatibility-manifest.json +0 -8
- package/.agent-context/skills/distribution/compatibility.md +0 -32
- package/.agent-context/skills/distribution/package.json +0 -5
- package/.agent-context/skills/distribution/provenance-attestation.md +0 -47
- package/.agent-context/skills/distribution/publish.md +0 -37
- package/.agent-context/skills/distribution/rollback.md +0 -32
- package/.agent-context/skills/distribution/tests/.gitkeep +0 -1
- package/.agent-context/skills/distribution.md +0 -32
- package/.agent-context/skills/frontend/.evidence/compatibility-manifest.json +0 -9
- package/.agent-context/skills/frontend/.evidence/sbom-excerpt.json +0 -6
- package/.agent-context/skills/frontend/.evidence/test-report.json +0 -8
- package/.agent-context/skills/frontend/CHANGELOG.md +0 -7
- package/.agent-context/skills/frontend/README.md +0 -50
- package/.agent-context/skills/frontend/accessibility.md +0 -107
- package/.agent-context/skills/frontend/compatibility-manifest.json +0 -8
- package/.agent-context/skills/frontend/conversion-clarity.md +0 -51
- package/.agent-context/skills/frontend/motion.md +0 -67
- package/.agent-context/skills/frontend/package.json +0 -5
- package/.agent-context/skills/frontend/performance.md +0 -63
- package/.agent-context/skills/frontend/responsive-delivery.md +0 -41
- package/.agent-context/skills/frontend/tests/.gitkeep +0 -1
- package/.agent-context/skills/frontend/ui-architecture.md +0 -128
- package/.agent-context/skills/frontend.md +0 -40
- package/.agent-context/skills/fullstack/.evidence/compatibility-manifest.json +0 -9
- package/.agent-context/skills/fullstack/.evidence/sbom-excerpt.json +0 -6
- package/.agent-context/skills/fullstack/.evidence/test-report.json +0 -8
- package/.agent-context/skills/fullstack/CHANGELOG.md +0 -7
- package/.agent-context/skills/fullstack/README.md +0 -27
- package/.agent-context/skills/fullstack/compatibility-manifest.json +0 -8
- package/.agent-context/skills/fullstack/contracts.md +0 -53
- package/.agent-context/skills/fullstack/end-to-end.md +0 -42
- package/.agent-context/skills/fullstack/feature-slicing.md +0 -65
- package/.agent-context/skills/fullstack/package.json +0 -5
- package/.agent-context/skills/fullstack/release-coordination.md +0 -51
- package/.agent-context/skills/fullstack/tests/.gitkeep +0 -1
- package/.agent-context/skills/fullstack.md +0 -30
- package/.agent-context/skills/index.json +0 -107
- package/.agent-context/skills/review-quality/.evidence/compatibility-manifest.json +0 -9
- package/.agent-context/skills/review-quality/.evidence/sbom-excerpt.json +0 -6
- package/.agent-context/skills/review-quality/.evidence/test-report.json +0 -8
- package/.agent-context/skills/review-quality/CHANGELOG.md +0 -7
- package/.agent-context/skills/review-quality/README.md +0 -27
- package/.agent-context/skills/review-quality/benchmark.md +0 -30
- package/.agent-context/skills/review-quality/compatibility-manifest.json +0 -8
- package/.agent-context/skills/review-quality/package.json +0 -5
- package/.agent-context/skills/review-quality/planning.md +0 -38
- package/.agent-context/skills/review-quality/release-decision.md +0 -49
- package/.agent-context/skills/review-quality/security.md +0 -34
- package/.agent-context/skills/review-quality/tests/.gitkeep +0 -1
- package/.agent-context/skills/review-quality.md +0 -34
- package/.agent-context/stacks/csharp.md +0 -149
- package/.agent-context/stacks/flutter.md +0 -16
- package/.agent-context/stacks/go.md +0 -181
- package/.agent-context/stacks/java.md +0 -135
- package/.agent-context/stacks/php.md +0 -192
- package/.agent-context/stacks/python.md +0 -153
- package/.agent-context/stacks/react-native.md +0 -16
- package/.agent-context/stacks/ruby.md +0 -80
- package/.agent-context/stacks/rust.md +0 -86
- package/.agent-context/stacks/typescript.md +0 -317
- package/.agent-context/state/skill-platform.json +0 -38
- package/lib/cli/skill-selector.mjs +0 -232
- package/lib/cli/templates/api-contract.md.id.tmpl +0 -143
- package/lib/cli/templates/api-contract.md.tmpl +0 -143
- package/lib/cli/templates/architecture-decision-record.md.id.tmpl +0 -106
- package/lib/cli/templates/architecture-decision-record.md.tmpl +0 -145
- package/lib/cli/templates/database-schema.md.id.tmpl +0 -74
- package/lib/cli/templates/database-schema.md.tmpl +0 -74
- package/lib/cli/templates/flow-overview.md.id.tmpl +0 -118
- package/lib/cli/templates/flow-overview.md.tmpl +0 -131
- package/lib/cli/templates/project-brief.md.id.tmpl +0 -55
- package/lib/cli/templates/project-brief.md.tmpl +0 -79
- package/scripts/init-project.ps1 +0 -105
- package/scripts/init-project.sh +0 -131
- package/scripts/skill-tier-policy.mjs +0 -76
- package/scripts/trust-scorer.mjs +0 -119
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Launch Command — Numbered interactive launcher.
|
|
3
|
-
* Depends on: constants, utils, init command
|
|
3
|
+
* Depends on: constants, utils, init command
|
|
4
4
|
*/
|
|
5
5
|
import { createInterface } from 'node:readline/promises';
|
|
6
6
|
import { stdin, stdout } from 'node:process';
|
|
@@ -8,7 +8,6 @@ import { stdin, stdout } from 'node:process';
|
|
|
8
8
|
import { CLI_VERSION, INIT_PRESETS } from '../constants.mjs';
|
|
9
9
|
import { askChoice, normalizeChoiceInput } from '../utils.mjs';
|
|
10
10
|
import { runInitCommand } from './init.mjs';
|
|
11
|
-
import { runSkillCommand } from '../skill-selector.mjs';
|
|
12
11
|
import { runOptimizeCommand } from './optimize.mjs';
|
|
13
12
|
|
|
14
13
|
export async function runLaunchCommand() {
|
|
@@ -21,24 +20,15 @@ export async function runLaunchCommand() {
|
|
|
21
20
|
const launchChoice = await askChoice(
|
|
22
21
|
'How do you want to start?',
|
|
23
22
|
[
|
|
24
|
-
'GitHub template (zero install)',
|
|
25
23
|
'npm / npx path',
|
|
26
|
-
'Bootstrap scripts',
|
|
27
24
|
'Preset starter',
|
|
28
25
|
'Interactive init wizard',
|
|
29
26
|
'Enable token optimization',
|
|
30
|
-
'Skill selector',
|
|
31
27
|
'Exit',
|
|
32
28
|
],
|
|
33
29
|
userInterface
|
|
34
30
|
);
|
|
35
31
|
|
|
36
|
-
if (launchChoice === 'GitHub template (zero install)') {
|
|
37
|
-
console.log('\nOpen the GitHub template here:');
|
|
38
|
-
console.log('https://github.com/fatidaprilian/Agentic-Senior-Core/generate');
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
32
|
if (launchChoice === 'npm / npx path') {
|
|
43
33
|
console.log('\nChoose one of these package paths:');
|
|
44
34
|
console.log('npm exec --yes @ryuenn3123/agentic-senior-core init');
|
|
@@ -47,13 +37,6 @@ export async function runLaunchCommand() {
|
|
|
47
37
|
return;
|
|
48
38
|
}
|
|
49
39
|
|
|
50
|
-
if (launchChoice === 'Bootstrap scripts') {
|
|
51
|
-
console.log('\nUse the repository bootstrap scripts:');
|
|
52
|
-
console.log('Windows: powershell -ExecutionPolicy Bypass -File .\\scripts\\init-project.ps1 -TargetDirectory .');
|
|
53
|
-
console.log('Linux/macOS: bash ./scripts/init-project.sh .');
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
40
|
if (launchChoice === 'Preset starter') {
|
|
58
41
|
const presetNames = Object.keys(INIT_PRESETS);
|
|
59
42
|
const selectedPresetName = await askChoice(
|
|
@@ -86,11 +69,6 @@ export async function runLaunchCommand() {
|
|
|
86
69
|
return;
|
|
87
70
|
}
|
|
88
71
|
|
|
89
|
-
if (launchChoice === 'Skill selector') {
|
|
90
|
-
await runSkillCommand([]);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
72
|
console.log('Exit selected.');
|
|
95
73
|
} finally {
|
|
96
74
|
userInterface.close();
|
|
@@ -25,7 +25,7 @@ export async function runRollbackCommand(commandArguments) {
|
|
|
25
25
|
|
|
26
26
|
try {
|
|
27
27
|
await ensureDirectory(resolvedTargetDirectoryPath);
|
|
28
|
-
|
|
28
|
+
} catch {
|
|
29
29
|
console.error(`[FATAL] Cannot access target directory: ${resolvedTargetDirectoryPath}`);
|
|
30
30
|
process.exit(1);
|
|
31
31
|
}
|
|
@@ -39,8 +39,6 @@ import {
|
|
|
39
39
|
import { runPreflightChecks } from '../preflight.mjs';
|
|
40
40
|
import { createBackup } from '../backup.mjs';
|
|
41
41
|
import { performRollback } from '../rollback.mjs';
|
|
42
|
-
import { inferSkillDomainNamesFromSelection } from '../skill-selector.mjs';
|
|
43
|
-
import { evaluateSkillDomainCompatibility } from '../compatibility.mjs';
|
|
44
42
|
import { detectProjectDocTemplateStaleness } from '../project-scaffolder.mjs';
|
|
45
43
|
|
|
46
44
|
export function parseUpgradeArguments(commandArguments) {
|
|
@@ -205,26 +203,8 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
205
203
|
console.log(` - ${majorConstraint}`);
|
|
206
204
|
}
|
|
207
205
|
|
|
208
|
-
const selectedSkillDomainNames = inferSkillDomainNamesFromSelection(
|
|
209
|
-
selectedStackFileName,
|
|
210
|
-
selectedBlueprintFileName,
|
|
211
|
-
selectedAdditionalStackFileNames,
|
|
212
|
-
selectedAdditionalBlueprintFileNames
|
|
213
|
-
);
|
|
214
|
-
const compatibilityWarnings = await evaluateSkillDomainCompatibility(
|
|
215
|
-
resolvedTargetDirectoryPath,
|
|
216
|
-
selectedSkillDomainNames
|
|
217
|
-
);
|
|
218
206
|
const projectDocStalenessReport = await detectProjectDocTemplateStaleness(resolvedTargetDirectoryPath);
|
|
219
207
|
|
|
220
|
-
if (compatibilityWarnings.length > 0) {
|
|
221
|
-
console.log('\n[WARN] Compatibility checks reported potential issues for this environment:');
|
|
222
|
-
for (const compatibilityWarning of compatibilityWarnings) {
|
|
223
|
-
console.log(`- ${compatibilityWarning}`);
|
|
224
|
-
}
|
|
225
|
-
console.log('Upgrade will continue, but review these warnings before production use.');
|
|
226
|
-
}
|
|
227
|
-
|
|
228
208
|
const currentRulesPath = path.join(resolvedTargetDirectoryPath, '.cursorrules');
|
|
229
209
|
const currentRulesContent = await pathExists(currentRulesPath)
|
|
230
210
|
? await fs.readFile(currentRulesPath, 'utf8')
|
|
@@ -288,7 +268,7 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
288
268
|
return;
|
|
289
269
|
}
|
|
290
270
|
|
|
291
|
-
|
|
271
|
+
await createBackup(resolvedTargetDirectoryPath);
|
|
292
272
|
|
|
293
273
|
try {
|
|
294
274
|
await fs.writeFile(currentRulesPath, plannedRulesContent, 'utf8');
|
|
@@ -307,8 +287,6 @@ export async function runUpgradeCommand(targetDirectoryArgument, upgradeOptions
|
|
|
307
287
|
includeCiGuardrails,
|
|
308
288
|
setupDurationMs,
|
|
309
289
|
projectDetection,
|
|
310
|
-
selectedSkillDomains: selectedSkillDomainNames,
|
|
311
|
-
compatibilityWarnings,
|
|
312
290
|
runtimeEnvironment: existingOnboardingReport?.runtimeEnvironment || null,
|
|
313
291
|
operationMode: 'upgrade',
|
|
314
292
|
detectionTransparency,
|
package/lib/cli/compiler.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Context Compiler — Rulebook compilation and state persistence.
|
|
3
|
-
* Depends on: constants.mjs, utils.mjs
|
|
3
|
+
* Depends on: constants.mjs, utils.mjs
|
|
4
4
|
*/
|
|
5
5
|
import fs from 'node:fs/promises';
|
|
6
6
|
import path from 'node:path';
|
|
@@ -8,7 +8,6 @@ import path from 'node:path';
|
|
|
8
8
|
import {
|
|
9
9
|
CLI_VERSION,
|
|
10
10
|
POLICY_FILE_NAME,
|
|
11
|
-
SKILL_PLATFORM_INDEX_PATH,
|
|
12
11
|
BLUEPRINT_RECOMMENDATIONS,
|
|
13
12
|
} from './constants.mjs';
|
|
14
13
|
|
|
@@ -17,10 +16,6 @@ import {
|
|
|
17
16
|
collectFileNames,
|
|
18
17
|
} from './utils.mjs';
|
|
19
18
|
|
|
20
|
-
import {
|
|
21
|
-
inferSkillDomainNamesFromSelection,
|
|
22
|
-
} from './skill-selector.mjs';
|
|
23
|
-
|
|
24
19
|
import {
|
|
25
20
|
readTokenOptimizationState,
|
|
26
21
|
buildTokenOptimizationGuidanceBlock,
|
|
@@ -49,8 +44,6 @@ export async function writeOnboardingReport({
|
|
|
49
44
|
includeCiGuardrails,
|
|
50
45
|
setupDurationMs,
|
|
51
46
|
projectDetection,
|
|
52
|
-
selectedSkillDomains = [],
|
|
53
|
-
compatibilityWarnings = [],
|
|
54
47
|
runtimeEnvironment = null,
|
|
55
48
|
operationMode = 'init',
|
|
56
49
|
tokenOptimization = undefined,
|
|
@@ -90,8 +83,6 @@ export async function writeOnboardingReport({
|
|
|
90
83
|
},
|
|
91
84
|
ciGuardrailsEnabled: includeCiGuardrails,
|
|
92
85
|
setupDurationMs,
|
|
93
|
-
selectedSkillDomains,
|
|
94
|
-
compatibilityWarnings,
|
|
95
86
|
runtimeEnvironment,
|
|
96
87
|
tokenOptimization: resolvedTokenOptimization,
|
|
97
88
|
memoryContinuity: resolvedMemoryContinuity,
|
|
@@ -141,7 +132,6 @@ export async function buildCompiledRulesContent({
|
|
|
141
132
|
const selectedRulesDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'rules');
|
|
142
133
|
const selectedStacksDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'stacks');
|
|
143
134
|
const selectedBlueprintsDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'blueprints');
|
|
144
|
-
const skillPlatformIndex = JSON.parse(await fs.readFile(SKILL_PLATFORM_INDEX_PATH, 'utf8'));
|
|
145
135
|
const normalizedAdditionalStackFileNames = Array.isArray(selectedAdditionalStackFileNames)
|
|
146
136
|
? Array.from(new Set(selectedAdditionalStackFileNames.filter((stackFileName) => stackFileName && stackFileName !== selectedStackFileName)))
|
|
147
137
|
: [];
|
|
@@ -150,22 +140,12 @@ export async function buildCompiledRulesContent({
|
|
|
150
140
|
(blueprintFileName) => blueprintFileName && blueprintFileName !== selectedBlueprintFileName
|
|
151
141
|
)))
|
|
152
142
|
: [];
|
|
153
|
-
const selectedSkillDomainNames = inferSkillDomainNamesFromSelection(
|
|
154
|
-
selectedStackFileName,
|
|
155
|
-
selectedBlueprintFileName,
|
|
156
|
-
normalizedAdditionalStackFileNames,
|
|
157
|
-
normalizedAdditionalBlueprintFileNames
|
|
158
|
-
);
|
|
159
143
|
|
|
160
144
|
const universalRuleFileNames = await collectFileNames(selectedRulesDirectoryPath);
|
|
145
|
+
const availableStackProfileFileNames = new Set(await collectFileNames(selectedStacksDirectoryPath));
|
|
146
|
+
const availableBlueprintProfileFileNames = new Set(await collectFileNames(selectedBlueprintsDirectoryPath));
|
|
161
147
|
const contextBlocks = [];
|
|
162
148
|
|
|
163
|
-
function resolveSkillPackFileName(skillDomainEntry, selectedTierName) {
|
|
164
|
-
return skillDomainEntry.tierToPackFileNames?.[selectedTierName]
|
|
165
|
-
|| skillDomainEntry.tierToPackFileNames?.[skillDomainEntry.defaultTier]
|
|
166
|
-
|| skillDomainEntry.defaultPackFileName;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
149
|
function firstMarkdownHeading(content, fallbackLabel) {
|
|
170
150
|
const headingLine = content
|
|
171
151
|
.split(/\r?\n/)
|
|
@@ -178,21 +158,27 @@ export async function buildCompiledRulesContent({
|
|
|
178
158
|
return headingLine.replace(/^#+\s*/, '').trim();
|
|
179
159
|
}
|
|
180
160
|
|
|
161
|
+
function humanizeProfileName(fileName) {
|
|
162
|
+
return String(fileName || '')
|
|
163
|
+
.replace(/\.md$/i, '')
|
|
164
|
+
.replace(/[-_]/g, ' ')
|
|
165
|
+
.trim();
|
|
166
|
+
}
|
|
167
|
+
|
|
181
168
|
contextBlocks.push(
|
|
182
169
|
[
|
|
183
170
|
'## BOOTSTRAP CHAIN (MANDATORY)',
|
|
184
171
|
'Load every layer before responding. Do not skip steps:',
|
|
185
172
|
'1. .agent-context/rules/',
|
|
186
|
-
'2.
|
|
187
|
-
'3. .agent-context/
|
|
188
|
-
'4.
|
|
189
|
-
'5. .agent-context/
|
|
190
|
-
|
|
191
|
-
'7.
|
|
192
|
-
`8. .agent-context/policies/${POLICY_FILE_NAME}`,
|
|
173
|
+
'2. Resolve architecture and stack signals from project context and live evidence.',
|
|
174
|
+
'3. .agent-context/prompts/',
|
|
175
|
+
'4. Dynamic architecture and stack signals (from project context + research evidence)',
|
|
176
|
+
'5. .agent-context/state/',
|
|
177
|
+
`6. .agent-context/policies/${POLICY_FILE_NAME}`,
|
|
178
|
+
'7. docs/ project context (or bootstrap prompts when docs are not materialized)',
|
|
193
179
|
'',
|
|
194
|
-
'Primary entrypoint: .
|
|
195
|
-
'
|
|
180
|
+
'Primary entrypoint: .agent-instructions.md',
|
|
181
|
+
'Adapter entrypoints: .cursorrules, .windsurfrules, .clauderc, .gemini/instructions.md, .github/copilot-instructions.md',
|
|
196
182
|
'Canonical baseline: .instructions.md',
|
|
197
183
|
].join('\n')
|
|
198
184
|
);
|
|
@@ -208,12 +194,16 @@ export async function buildCompiledRulesContent({
|
|
|
208
194
|
);
|
|
209
195
|
|
|
210
196
|
const stackFilePath = path.join(selectedStacksDirectoryPath, selectedStackFileName);
|
|
211
|
-
const
|
|
212
|
-
const stackSummary =
|
|
197
|
+
const hasStackProfileFile = availableStackProfileFileNames.has(selectedStackFileName);
|
|
198
|
+
const stackSummary = hasStackProfileFile
|
|
199
|
+
? firstMarkdownHeading(await fs.readFile(stackFilePath, 'utf8'), selectedStackFileName)
|
|
200
|
+
: `Dynamic stack strategy signal for ${humanizeProfileName(selectedStackFileName)}.`;
|
|
213
201
|
contextBlocks.push(
|
|
214
202
|
[
|
|
215
203
|
`## LAYER 2: STACK PROFILE (${selectedStackFileName})`,
|
|
216
|
-
|
|
204
|
+
hasStackProfileFile
|
|
205
|
+
? `Source: stack-profile:${selectedStackFileName}`
|
|
206
|
+
: 'Source: dynamic-research-signal (static stack profile file not required)',
|
|
217
207
|
`Summary: ${stackSummary}`,
|
|
218
208
|
'Load this stack profile to enforce language-specific conventions.',
|
|
219
209
|
].join('\n')
|
|
@@ -224,7 +214,13 @@ export async function buildCompiledRulesContent({
|
|
|
224
214
|
[
|
|
225
215
|
'## LAYER 2B: ADDITIONAL STACK PROFILES',
|
|
226
216
|
'This project uses multiple stacks. Load all additional stack profiles below:',
|
|
227
|
-
...normalizedAdditionalStackFileNames.map((stackFileName, stackIndex) =>
|
|
217
|
+
...normalizedAdditionalStackFileNames.map((stackFileName, stackIndex) => {
|
|
218
|
+
if (availableStackProfileFileNames.has(stackFileName)) {
|
|
219
|
+
return `${stackIndex + 1}. stack-profile:${stackFileName}`;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return `${stackIndex + 1}. ${stackFileName} (dynamic stack signal)`;
|
|
223
|
+
}),
|
|
228
224
|
].join('\n')
|
|
229
225
|
);
|
|
230
226
|
}
|
|
@@ -232,9 +228,17 @@ export async function buildCompiledRulesContent({
|
|
|
232
228
|
contextBlocks.push(
|
|
233
229
|
[
|
|
234
230
|
'## LAYER 2 POLICY: LAZY RULE LOADING',
|
|
235
|
-
|
|
231
|
+
hasStackProfileFile
|
|
232
|
+
? `Primary stack profile is always loaded for this project: stack-profile:${selectedStackFileName}`
|
|
233
|
+
: `Primary stack strategy is always loaded for this project: ${selectedStackFileName} (dynamic mode)`,
|
|
236
234
|
normalizedAdditionalStackFileNames.length > 0
|
|
237
|
-
? `Additional stack profiles load on demand: ${normalizedAdditionalStackFileNames.map((stackFileName) =>
|
|
235
|
+
? `Additional stack profiles load on demand: ${normalizedAdditionalStackFileNames.map((stackFileName) => {
|
|
236
|
+
if (availableStackProfileFileNames.has(stackFileName)) {
|
|
237
|
+
return `stack-profile:${stackFileName}`;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return `${stackFileName} (dynamic signal)`;
|
|
241
|
+
}).join(', ')}`
|
|
238
242
|
: 'Additional stack profiles load only when explicitly selected or detected.',
|
|
239
243
|
'Load stack guidance only when task scope touches that stack.',
|
|
240
244
|
'Avoid eager loading unrelated stack profiles to prevent instruction conflicts.',
|
|
@@ -242,12 +246,16 @@ export async function buildCompiledRulesContent({
|
|
|
242
246
|
);
|
|
243
247
|
|
|
244
248
|
const blueprintFilePath = path.join(selectedBlueprintsDirectoryPath, selectedBlueprintFileName);
|
|
245
|
-
const
|
|
246
|
-
const blueprintSummary =
|
|
249
|
+
const hasBlueprintProfileFile = availableBlueprintProfileFileNames.has(selectedBlueprintFileName);
|
|
250
|
+
const blueprintSummary = hasBlueprintProfileFile
|
|
251
|
+
? firstMarkdownHeading(await fs.readFile(blueprintFilePath, 'utf8'), selectedBlueprintFileName)
|
|
252
|
+
: `Dynamic architecture strategy signal for ${humanizeProfileName(selectedBlueprintFileName)}.`;
|
|
247
253
|
contextBlocks.push(
|
|
248
254
|
[
|
|
249
255
|
`## LAYER 3: BLUEPRINT PROFILE (${selectedBlueprintFileName})`,
|
|
250
|
-
|
|
256
|
+
hasBlueprintProfileFile
|
|
257
|
+
? `Source: architecture-profile:${selectedBlueprintFileName}`
|
|
258
|
+
: 'Source: dynamic-research-signal (static blueprint profile file not required)',
|
|
251
259
|
`Summary: ${blueprintSummary}`,
|
|
252
260
|
'Load this blueprint when scaffolding or changing architecture boundaries.',
|
|
253
261
|
].join('\n')
|
|
@@ -258,42 +266,31 @@ export async function buildCompiledRulesContent({
|
|
|
258
266
|
[
|
|
259
267
|
'## LAYER 3A: ADDITIONAL BLUEPRINT PROFILES',
|
|
260
268
|
'This project uses multiple architecture blueprints. Load all additional blueprint profiles below:',
|
|
261
|
-
...normalizedAdditionalBlueprintFileNames.map(
|
|
262
|
-
(blueprintFileName
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
);
|
|
266
|
-
}
|
|
269
|
+
...normalizedAdditionalBlueprintFileNames.map((blueprintFileName, blueprintIndex) => {
|
|
270
|
+
if (availableBlueprintProfileFileNames.has(blueprintFileName)) {
|
|
271
|
+
return `${blueprintIndex + 1}. architecture-profile:${blueprintFileName}`;
|
|
272
|
+
}
|
|
267
273
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
[
|
|
271
|
-
'## LAYER 3B: CI/CD GUARDRAILS',
|
|
272
|
-
'Load these CI blueprints when pipeline or release logic is touched:',
|
|
273
|
-
'1. .agent-context/blueprints/ci-github-actions.md',
|
|
274
|
-
'2. .agent-context/blueprints/ci-gitlab.md',
|
|
274
|
+
return `${blueprintIndex + 1}. ${blueprintFileName} (dynamic architecture signal)`;
|
|
275
|
+
}),
|
|
275
276
|
].join('\n')
|
|
276
277
|
);
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
if (includeCiGuardrails) {
|
|
281
|
+
const ciBlueprintEntries = ['ci-github-actions.md', 'ci-gitlab.md'].map((ciBlueprintFileName, ciBlueprintIndex) => {
|
|
282
|
+
if (availableBlueprintProfileFileNames.has(ciBlueprintFileName)) {
|
|
283
|
+
return `${ciBlueprintIndex + 1}. architecture-profile:${ciBlueprintFileName}`;
|
|
284
|
+
}
|
|
284
285
|
|
|
285
|
-
|
|
286
|
-
|
|
286
|
+
return `${ciBlueprintIndex + 1}. ${ciBlueprintFileName} (dynamic CI policy signal)`;
|
|
287
|
+
});
|
|
287
288
|
|
|
288
289
|
contextBlocks.push(
|
|
289
290
|
[
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
`Selected tier: ${selectedTierName}`,
|
|
294
|
-
`Evidence: ${skillDomainEntry.evidence}`,
|
|
295
|
-
`Purpose: ${skillDomainEntry.description}`,
|
|
296
|
-
'Load this skill pack and apply every Must-Have Check.',
|
|
291
|
+
'## LAYER 3B: CI/CD GUARDRAILS',
|
|
292
|
+
'Load these CI blueprints when pipeline or release logic is touched:',
|
|
293
|
+
...ciBlueprintEntries,
|
|
297
294
|
].join('\n')
|
|
298
295
|
);
|
|
299
296
|
}
|
|
@@ -325,8 +322,8 @@ export async function buildCompiledRulesContent({
|
|
|
325
322
|
[
|
|
326
323
|
'## REVIEW CHECKLISTS (MANDATORY)',
|
|
327
324
|
'1. .agent-context/review-checklists/pr-checklist.md',
|
|
328
|
-
'2. .agent-context/review-checklists/
|
|
329
|
-
'
|
|
325
|
+
'2. .agent-context/review-checklists/architecture-review.md',
|
|
326
|
+
'Security and performance checks are consolidated inside these two checklist files.',
|
|
330
327
|
'Do not claim done before checklist pass.',
|
|
331
328
|
].join('\n')
|
|
332
329
|
);
|
|
@@ -370,6 +367,11 @@ export async function buildCompiledRulesContent({
|
|
|
370
367
|
'Read them before writing any application code:',
|
|
371
368
|
...projectDocsEntries.map((docFileName, docIndex) => `${docIndex + 1}. docs/${docFileName}`),
|
|
372
369
|
'',
|
|
370
|
+
'Universal SOP hard block policy:',
|
|
371
|
+
'- Stop implementation if docs/architecture-decision-record.md (alias: docs/Architecture-Decision-Record.md) is missing.',
|
|
372
|
+
'- For UI scope, stop implementation if docs/DESIGN.md is missing.',
|
|
373
|
+
'- Materialize missing docs first, then continue coding.',
|
|
374
|
+
'',
|
|
373
375
|
'These docs were generated during project initialization and reflect the architecture,',
|
|
374
376
|
'database design, API contracts, and application flows chosen for this project.',
|
|
375
377
|
'Latest user prompt defines current feature scope and product direction.',
|
|
@@ -397,10 +399,11 @@ export async function buildCompiledRulesContent({
|
|
|
397
399
|
...bootstrapPromptEntries.map((promptFilePath, promptIndex) => `${promptIndex + 1}. ${promptFilePath}`),
|
|
398
400
|
'',
|
|
399
401
|
'Bootstrap policy:',
|
|
402
|
+
'- Hard block: do not write application code until docs/project-brief.md and docs/architecture-decision-record.md exist.',
|
|
400
403
|
'- If docs/project-brief.md is missing, execute bootstrap-project-context prompt immediately.',
|
|
401
404
|
hasBootstrapDesignPrompt
|
|
402
|
-
? '-
|
|
403
|
-
: '-
|
|
405
|
+
? '- For UI scope: if docs/DESIGN.md is missing, execute bootstrap-design prompt before implementing UI surfaces.'
|
|
406
|
+
: '- For UI scope: add a design bootstrap prompt before implementing UI surfaces.',
|
|
404
407
|
'- Save generated docs under docs/ and keep them updated when feature scope changes.',
|
|
405
408
|
'Latest user prompt defines current feature scope and product direction.',
|
|
406
409
|
'Treat synthesized docs as living references, then continue implementation with those docs as source of truth.',
|
|
@@ -452,8 +455,10 @@ export async function compileDynamicContext({
|
|
|
452
455
|
includeCiGuardrails,
|
|
453
456
|
});
|
|
454
457
|
|
|
458
|
+
await fs.writeFile(path.join(resolvedTargetDirectoryPath, '.agent-instructions.md'), compiledRules, 'utf8');
|
|
455
459
|
await fs.writeFile(path.join(resolvedTargetDirectoryPath, '.cursorrules'), compiledRules, 'utf8');
|
|
456
460
|
await fs.writeFile(path.join(resolvedTargetDirectoryPath, '.windsurfrules'), compiledRules, 'utf8');
|
|
461
|
+
await fs.writeFile(path.join(resolvedTargetDirectoryPath, '.clauderc'), compiledRules, 'utf8');
|
|
457
462
|
|
|
458
463
|
// Gemini (Antigravity Editor) instructions
|
|
459
464
|
const geminiDir = path.join(resolvedTargetDirectoryPath, '.gemini');
|
package/lib/cli/constants.mjs
CHANGED
|
@@ -13,8 +13,6 @@ export const REPO_ROOT = resolve(currentDirectoryPath, '..', '..');
|
|
|
13
13
|
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
|
-
export const SKILL_PLATFORM_DIRECTORY = join(AGENT_CONTEXT_DIR, 'skills');
|
|
17
|
-
export const SKILL_PLATFORM_INDEX_PATH = join(SKILL_PLATFORM_DIRECTORY, 'index.json');
|
|
18
16
|
export const POLICY_FILE_NAME = 'llm-judge-threshold.json';
|
|
19
17
|
export const PROFILE_PACKS_DIRECTORY_NAME = 'profiles';
|
|
20
18
|
|
|
@@ -43,6 +41,81 @@ export const BLUEPRINT_RECOMMENDATIONS = {
|
|
|
43
41
|
'flutter.md': 'mobile-app.md',
|
|
44
42
|
};
|
|
45
43
|
|
|
44
|
+
export const FALLBACK_STACK_FILE_NAMES = [
|
|
45
|
+
'typescript.md',
|
|
46
|
+
'python.md',
|
|
47
|
+
'go.md',
|
|
48
|
+
'java.md',
|
|
49
|
+
'php.md',
|
|
50
|
+
'csharp.md',
|
|
51
|
+
'rust.md',
|
|
52
|
+
'ruby.md',
|
|
53
|
+
'react-native.md',
|
|
54
|
+
'flutter.md',
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
export const FALLBACK_BLUEPRINT_FILE_NAMES = [
|
|
58
|
+
'api-nextjs.md',
|
|
59
|
+
'nestjs-logic.md',
|
|
60
|
+
'fastapi-service.md',
|
|
61
|
+
'spring-boot-api.md',
|
|
62
|
+
'go-service.md',
|
|
63
|
+
'aspnet-api.md',
|
|
64
|
+
'laravel-api.md',
|
|
65
|
+
'graphql-grpc-api.md',
|
|
66
|
+
'ci-github-actions.md',
|
|
67
|
+
'ci-gitlab.md',
|
|
68
|
+
'kubernetes-manifests.md',
|
|
69
|
+
'infrastructure-as-code.md',
|
|
70
|
+
'observability.md',
|
|
71
|
+
'mobile-app.md',
|
|
72
|
+
];
|
|
73
|
+
|
|
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
|
+
|
|
46
119
|
export const INIT_PRESETS = {
|
|
47
120
|
'frontend-web': {
|
|
48
121
|
profile: 'balanced',
|
|
@@ -164,38 +237,23 @@ export const GOLDEN_STANDARD_PROFILE_NAME = 'balanced';
|
|
|
164
237
|
|
|
165
238
|
export const PROJECT_SCOPE_CHOICES = [
|
|
166
239
|
{
|
|
167
|
-
key: '
|
|
168
|
-
label: '
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
key: 'web-application',
|
|
172
|
-
label: 'Web application',
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
key: 'mobile-app',
|
|
176
|
-
label: 'Mobile app',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
key: 'cli-tool',
|
|
180
|
-
label: 'CLI tool',
|
|
240
|
+
key: 'frontend-only',
|
|
241
|
+
label: 'Frontend only',
|
|
181
242
|
},
|
|
182
243
|
{
|
|
183
|
-
key: '
|
|
184
|
-
label: '
|
|
244
|
+
key: 'backend-only',
|
|
245
|
+
label: 'Backend only',
|
|
185
246
|
},
|
|
186
247
|
{
|
|
187
|
-
key: '
|
|
188
|
-
label: '
|
|
248
|
+
key: 'both',
|
|
249
|
+
label: 'Both (frontend + backend)',
|
|
189
250
|
},
|
|
190
251
|
];
|
|
191
252
|
|
|
192
253
|
export const PROJECT_SCOPE_STACK_FILTERS = {
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
|
|
196
|
-
'cli-tool': ['typescript.md', 'python.md', 'go.md', 'rust.md', 'ruby.md', 'java.md', 'csharp.md'],
|
|
197
|
-
'library-sdk': ['typescript.md', 'python.md', 'go.md', 'rust.md', 'java.md', 'csharp.md', 'php.md', 'ruby.md'],
|
|
198
|
-
other: null,
|
|
254
|
+
'frontend-only': ['typescript.md'],
|
|
255
|
+
'backend-only': ['typescript.md', 'python.md', 'go.md', 'java.md', 'php.md', 'csharp.md', 'ruby.md', 'rust.md'],
|
|
256
|
+
both: ['typescript.md', 'python.md', 'go.md', 'java.md', 'php.md', 'csharp.md', 'ruby.md', 'rust.md'],
|
|
199
257
|
};
|
|
200
258
|
|
|
201
259
|
export const WEB_FRONTEND_STACK_CANDIDATES = ['typescript.md'];
|