@ryuenn3123/agentic-senior-core 2.5.20 → 2.5.22
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/state/memory-continuity-benchmark.json +1 -1
- package/.cursorrules +1 -1
- package/.windsurfrules +1 -1
- package/README.md +14 -1
- package/lib/cli/commands/init.mjs +36 -11
- package/lib/cli/compiler.mjs +41 -0
- package/lib/cli/project-scaffolder.mjs +203 -19
- package/lib/cli/utils.mjs +4 -3
- package/package.json +1 -1
package/.cursorrules
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
|
|
2
2
|
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v2.5.
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v2.5.22
|
|
4
4
|
Timestamp: 2026-04-18T03:00:00.000Z
|
|
5
5
|
Selected profile: beginner
|
|
6
6
|
Selected policy file: .agent-context/policies/llm-judge-threshold.json
|
package/.windsurfrules
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
|
|
2
2
|
|
|
3
|
-
Generated by Agentic-Senior-Core CLI v2.5.
|
|
3
|
+
Generated by Agentic-Senior-Core CLI v2.5.22
|
|
4
4
|
Timestamp: 2026-04-18T03:00:00.000Z
|
|
5
5
|
Selected profile: beginner
|
|
6
6
|
Selected policy file: .agent-context/policies/llm-judge-threshold.json
|
package/README.md
CHANGED
|
@@ -36,7 +36,13 @@ Project-description-first path (AI as Architect with veto control):
|
|
|
36
36
|
npx @ryuenn3123/agentic-senior-core init --project-description "Machine learning API for fraud detection"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Default init path now attempts trusted realtime stack research first (with automatic snapshot fallback):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx @ryuenn3123/agentic-senior-core init --project-description "Event-driven payments platform"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Force deterministic snapshot-only mode:
|
|
40
46
|
|
|
41
47
|
```bash
|
|
42
48
|
npx @ryuenn3123/agentic-senior-core init --project-description "Event-driven payments platform" --architect-research-mode snapshot
|
|
@@ -48,6 +54,13 @@ Optional trusted realtime enrichment (explicitly gated):
|
|
|
48
54
|
npx @ryuenn3123/agentic-senior-core init --project-description "Modern conversion-focused product website" --architect-research-mode realtime --enable-realtime-research --architect-realtime-signal-file ./realtime-signals.json
|
|
49
55
|
```
|
|
50
56
|
|
|
57
|
+
AI-first project context bootstrap (no static docs template rendering):
|
|
58
|
+
|
|
59
|
+
- Init now generates bootstrap prompts under `.agent-context/prompts/`.
|
|
60
|
+
- On first IDE chat, execute `bootstrap-project-context.md` when `docs/project-brief.md` is missing.
|
|
61
|
+
- For UI-first projects, execute `bootstrap-design.md` when `docs/DESIGN.md` is missing.
|
|
62
|
+
- The assistant should synthesize docs from scratch into `docs/` and treat them as living context.
|
|
63
|
+
|
|
51
64
|
---
|
|
52
65
|
|
|
53
66
|
## Before / After
|
|
@@ -65,7 +65,6 @@ import { evaluateSkillDomainCompatibility } from '../compatibility.mjs';
|
|
|
65
65
|
import {
|
|
66
66
|
ARCHITECT_DEFAULT_TOKEN_BUDGET,
|
|
67
67
|
ARCHITECT_DEFAULT_TIMEOUT_MS,
|
|
68
|
-
ARCHITECT_DEFAULT_RESEARCH_MODE,
|
|
69
68
|
ARCHITECT_MIN_TOKEN_BUDGET,
|
|
70
69
|
ARCHITECT_MAX_TOKEN_BUDGET,
|
|
71
70
|
ARCHITECT_MIN_TIMEOUT_MS,
|
|
@@ -80,6 +79,8 @@ import {
|
|
|
80
79
|
|
|
81
80
|
export { REPO_ROOT } from '../constants.mjs';
|
|
82
81
|
|
|
82
|
+
const INIT_DEFAULT_RESEARCH_MODE = 'realtime';
|
|
83
|
+
|
|
83
84
|
export function parseInitArguments(commandArguments) {
|
|
84
85
|
const parsedInitOptions = {
|
|
85
86
|
targetDirectory: '.',
|
|
@@ -101,8 +102,8 @@ export function parseInitArguments(commandArguments) {
|
|
|
101
102
|
projectDescription: '',
|
|
102
103
|
architectTokenBudget: ARCHITECT_DEFAULT_TOKEN_BUDGET,
|
|
103
104
|
architectTimeoutMs: ARCHITECT_DEFAULT_TIMEOUT_MS,
|
|
104
|
-
architectResearchMode:
|
|
105
|
-
enableRealtimeResearch:
|
|
105
|
+
architectResearchMode: INIT_DEFAULT_RESEARCH_MODE,
|
|
106
|
+
enableRealtimeResearch: true,
|
|
106
107
|
architectRealtimeSignalFile: null,
|
|
107
108
|
runtimeEnv: 'auto',
|
|
108
109
|
runtimeEnvProvided: false,
|
|
@@ -313,13 +314,13 @@ export function parseInitArguments(commandArguments) {
|
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
if (currentArgument === '--architect-research-mode') {
|
|
316
|
-
parsedInitOptions.architectResearchMode = commandArguments[argumentIndex + 1] ||
|
|
317
|
+
parsedInitOptions.architectResearchMode = commandArguments[argumentIndex + 1] || INIT_DEFAULT_RESEARCH_MODE;
|
|
317
318
|
argumentIndex += 1;
|
|
318
319
|
continue;
|
|
319
320
|
}
|
|
320
321
|
|
|
321
322
|
if (currentArgument.startsWith('--architect-research-mode=')) {
|
|
322
|
-
parsedInitOptions.architectResearchMode = currentArgument.split('=')[1] ||
|
|
323
|
+
parsedInitOptions.architectResearchMode = currentArgument.split('=')[1] || INIT_DEFAULT_RESEARCH_MODE;
|
|
323
324
|
continue;
|
|
324
325
|
}
|
|
325
326
|
|
|
@@ -387,7 +388,7 @@ export function parseInitArguments(commandArguments) {
|
|
|
387
388
|
}
|
|
388
389
|
|
|
389
390
|
const normalizedArchitectResearchMode = normalizeChoiceInput(
|
|
390
|
-
parsedInitOptions.architectResearchMode ||
|
|
391
|
+
parsedInitOptions.architectResearchMode || INIT_DEFAULT_RESEARCH_MODE
|
|
391
392
|
);
|
|
392
393
|
const supportedArchitectResearchModes = new Set(['snapshot', 'realtime']);
|
|
393
394
|
if (!supportedArchitectResearchModes.has(normalizedArchitectResearchMode)) {
|
|
@@ -1170,15 +1171,24 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
1170
1171
|
additionalBlueprintFileNames: selectedAdditionalBlueprintFileNames,
|
|
1171
1172
|
runtimeEnvironmentKey: selectedRuntimeEnvironmentKey,
|
|
1172
1173
|
runtimeEnvironmentLabel: resolveRuntimeEnvironmentLabelFromKey(selectedRuntimeEnvironmentKey),
|
|
1174
|
+
architectureRecommendation,
|
|
1173
1175
|
},
|
|
1174
1176
|
{
|
|
1175
1177
|
docsLanguage: selectedDocsLanguage,
|
|
1176
1178
|
}
|
|
1177
1179
|
);
|
|
1178
1180
|
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1181
|
+
if (scaffoldingResult.bootstrapMode === 'ai-synthesis') {
|
|
1182
|
+
console.log(`\nAI synthesis bootstrap prompts generated in .agent-context/prompts/:`);
|
|
1183
|
+
for (const generatedPromptFileName of scaffoldingResult.generatedPromptFileNames || []) {
|
|
1184
|
+
console.log(` - .agent-context/prompts/${generatedPromptFileName}`);
|
|
1185
|
+
}
|
|
1186
|
+
console.log('Project docs will be authored dynamically by your IDE assistant from these prompts.');
|
|
1187
|
+
} else {
|
|
1188
|
+
console.log(`\nProject documentation generated in docs/:`);
|
|
1189
|
+
for (const generatedFileName of scaffoldingResult.generatedFileNames) {
|
|
1190
|
+
console.log(` - docs/${generatedFileName}`);
|
|
1191
|
+
}
|
|
1182
1192
|
}
|
|
1183
1193
|
}
|
|
1184
1194
|
}
|
|
@@ -1271,7 +1281,11 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
1271
1281
|
console.log(`- Blocking severities: ${formatBlockingSeverities(selectedProfile.blockingSeverities)}`);
|
|
1272
1282
|
console.log(`- Setup time: ${formatDuration(setupDurationMs)}`);
|
|
1273
1283
|
console.log('- Generated files: .cursorrules, .windsurfrules, and .agent-context/state/onboarding-report.json');
|
|
1274
|
-
if (scaffoldingResult) {
|
|
1284
|
+
if (scaffoldingResult?.bootstrapMode === 'ai-synthesis') {
|
|
1285
|
+
console.log(`- Bootstrap prompts: ${(scaffoldingResult.generatedPromptFileNames || []).length} files generated in .agent-context/prompts/`);
|
|
1286
|
+
console.log(`- Bootstrap docs language: ${scaffoldingResult.docsLanguage}`);
|
|
1287
|
+
console.log(`- Expected project docs after synthesis: ${scaffoldingResult.generatedFileNames.length} files in docs/`);
|
|
1288
|
+
} else if (scaffoldingResult) {
|
|
1275
1289
|
console.log(`- Project docs: ${scaffoldingResult.generatedFileNames.length} files generated in docs/`);
|
|
1276
1290
|
console.log(`- Project docs language: ${scaffoldingResult.docsLanguage}`);
|
|
1277
1291
|
}
|
|
@@ -1295,7 +1309,18 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
|
|
|
1295
1309
|
if (selectedAdditionalBlueprintFileNames.length > 0) {
|
|
1296
1310
|
console.log(`I also included additional blueprint context for ${selectedAdditionalBlueprintFileNames.map((blueprintFileName) => toTitleCase(blueprintFileName)).join(', ')}.`);
|
|
1297
1311
|
}
|
|
1298
|
-
if (scaffoldingResult) {
|
|
1312
|
+
if (scaffoldingResult?.bootstrapMode === 'ai-synthesis') {
|
|
1313
|
+
console.log(`I prepared dynamic synthesis bootstrap prompts (${scaffoldingResult.docsLanguage}) so your IDE assistant can author project docs from scratch on first chat.`);
|
|
1314
|
+
|
|
1315
|
+
const promptProjectName = scaffoldingResult.discoveryAnswers?.projectName || 'this project';
|
|
1316
|
+
console.log('\nPrompt starter examples (copy and adapt in your IDE):');
|
|
1317
|
+
console.log('- If docs/project-brief.md is missing, execute .agent-context/prompts/bootstrap-project-context.md now and create all required docs files.');
|
|
1318
|
+
if ((scaffoldingResult.generatedPromptFileNames || []).includes('bootstrap-design.md')) {
|
|
1319
|
+
console.log('- If docs/DESIGN.md is missing, execute .agent-context/prompts/bootstrap-design.md now before building UI components.');
|
|
1320
|
+
}
|
|
1321
|
+
console.log(`- Build an MVP for ${promptProjectName} using the newly synthesized docs as strict project context.`);
|
|
1322
|
+
console.log('- When scope changes, update docs/* in the same change so future prompts stay aligned.');
|
|
1323
|
+
} else if (scaffoldingResult) {
|
|
1299
1324
|
console.log(`I also generated project documentation (${scaffoldingResult.docsLanguage}) based on your project description. AI agents will use docs/ as project context.`);
|
|
1300
1325
|
|
|
1301
1326
|
const promptProjectName = scaffoldingResult.discoveryAnswers?.projectName || 'this project';
|
package/lib/cli/compiler.mjs
CHANGED
|
@@ -332,6 +332,21 @@ export async function buildCompiledRulesContent({
|
|
|
332
332
|
);
|
|
333
333
|
|
|
334
334
|
const projectBriefPath = path.join(resolvedTargetDirectoryPath, 'docs', 'project-brief.md');
|
|
335
|
+
const bootstrapProjectContextPromptPath = path.join(
|
|
336
|
+
resolvedTargetDirectoryPath,
|
|
337
|
+
'.agent-context',
|
|
338
|
+
'prompts',
|
|
339
|
+
'bootstrap-project-context.md'
|
|
340
|
+
);
|
|
341
|
+
const bootstrapDesignPromptPath = path.join(
|
|
342
|
+
resolvedTargetDirectoryPath,
|
|
343
|
+
'.agent-context',
|
|
344
|
+
'prompts',
|
|
345
|
+
'bootstrap-design.md'
|
|
346
|
+
);
|
|
347
|
+
const hasBootstrapProjectContextPrompt = await pathExists(bootstrapProjectContextPromptPath);
|
|
348
|
+
const hasBootstrapDesignPrompt = await pathExists(bootstrapDesignPromptPath);
|
|
349
|
+
|
|
335
350
|
if (await pathExists(projectBriefPath)) {
|
|
336
351
|
const projectDocsEntries = ['project-brief.md'];
|
|
337
352
|
const candidateDocFileNames = [
|
|
@@ -365,6 +380,32 @@ export async function buildCompiledRulesContent({
|
|
|
365
380
|
'Update them as the project evolves. They are living references, not frozen specs.',
|
|
366
381
|
].join('\n')
|
|
367
382
|
);
|
|
383
|
+
} else if (hasBootstrapProjectContextPrompt) {
|
|
384
|
+
const bootstrapPromptEntries = [
|
|
385
|
+
'.agent-context/prompts/bootstrap-project-context.md',
|
|
386
|
+
];
|
|
387
|
+
|
|
388
|
+
if (hasBootstrapDesignPrompt) {
|
|
389
|
+
bootstrapPromptEntries.push('.agent-context/prompts/bootstrap-design.md');
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
contextBlocks.push(
|
|
393
|
+
[
|
|
394
|
+
'## LAYER 9: PROJECT CONTEXT (MANDATORY)',
|
|
395
|
+
'Project docs are not materialized yet. Bootstrap them before writing application code.',
|
|
396
|
+
'Execute these prompts in your IDE assistant first:',
|
|
397
|
+
...bootstrapPromptEntries.map((promptFilePath, promptIndex) => `${promptIndex + 1}. ${promptFilePath}`),
|
|
398
|
+
'',
|
|
399
|
+
'Bootstrap policy:',
|
|
400
|
+
'- If docs/project-brief.md is missing, execute bootstrap-project-context prompt immediately.',
|
|
401
|
+
hasBootstrapDesignPrompt
|
|
402
|
+
? '- If docs/DESIGN.md is missing, execute bootstrap-design prompt before implementing UI surfaces.'
|
|
403
|
+
: '- If UI scope is later introduced, add a design bootstrap prompt before implementing UI surfaces.',
|
|
404
|
+
'- Save generated docs under docs/ and keep them updated when feature scope changes.',
|
|
405
|
+
'Latest user prompt defines current feature scope and product direction.',
|
|
406
|
+
'Treat synthesized docs as living references, then continue implementation with those docs as source of truth.',
|
|
407
|
+
].join('\n')
|
|
408
|
+
);
|
|
368
409
|
}
|
|
369
410
|
|
|
370
411
|
return [
|
|
@@ -23,6 +23,7 @@ const PROJECT_DOC_FILE_NAMES = [
|
|
|
23
23
|
];
|
|
24
24
|
|
|
25
25
|
export const PROJECT_DOC_TEMPLATE_VERSION = '1.2.0';
|
|
26
|
+
export const PROJECT_DOC_SYNTHESIS_PROMPT_VERSION = '2.0.0';
|
|
26
27
|
|
|
27
28
|
const DOMAIN_CHOICES = [
|
|
28
29
|
'API service',
|
|
@@ -597,8 +598,173 @@ export function renderTemplate(templateContent, templateContext) {
|
|
|
597
598
|
return renderedContent;
|
|
598
599
|
}
|
|
599
600
|
|
|
601
|
+
function shouldBootstrapDesignDocument(discoveryAnswers, initContext) {
|
|
602
|
+
const normalizedDomain = String(discoveryAnswers.primaryDomain || '').trim().toLowerCase();
|
|
603
|
+
const normalizedBlueprint = String(initContext.blueprintFileName || '').trim().toLowerCase();
|
|
604
|
+
|
|
605
|
+
const isUiDomain = normalizedDomain.includes('web')
|
|
606
|
+
|| normalizedDomain.includes('mobile')
|
|
607
|
+
|| normalizedDomain.includes('frontend')
|
|
608
|
+
|| normalizedDomain.includes('ui');
|
|
609
|
+
|
|
610
|
+
const isBackendOnlyDomain = normalizedDomain.includes('api service')
|
|
611
|
+
|| normalizedDomain.includes('cli tool')
|
|
612
|
+
|| normalizedDomain.includes('library');
|
|
613
|
+
|
|
614
|
+
const blueprintLooksUi = normalizedBlueprint.includes('frontend')
|
|
615
|
+
|| normalizedBlueprint.includes('landing')
|
|
616
|
+
|| normalizedBlueprint.includes('ui');
|
|
617
|
+
|
|
618
|
+
if (isUiDomain) {
|
|
619
|
+
return true;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
if (!isBackendOnlyDomain && blueprintLooksUi) {
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
return false;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
function buildProjectContextBootstrapPrompt({
|
|
630
|
+
discoveryAnswers,
|
|
631
|
+
initContext,
|
|
632
|
+
expectedDocFileNames,
|
|
633
|
+
docsLanguage,
|
|
634
|
+
architectureRecommendation,
|
|
635
|
+
}) {
|
|
636
|
+
const featuresList = Array.isArray(discoveryAnswers.features) && discoveryAnswers.features.length > 0
|
|
637
|
+
? discoveryAnswers.features.map((feature, featureIndex) => `${featureIndex + 1}. ${feature}`).join('\n')
|
|
638
|
+
: '1. Core functionality (define during implementation)';
|
|
639
|
+
|
|
640
|
+
const expectedDocsList = expectedDocFileNames
|
|
641
|
+
.map((fileName, fileIndex) => `${fileIndex + 1}. docs/${fileName}`)
|
|
642
|
+
.join('\n');
|
|
643
|
+
|
|
644
|
+
const architectureSnapshot = architectureRecommendation
|
|
645
|
+
? JSON.stringify({
|
|
646
|
+
stack: architectureRecommendation.recommendedStackFileName,
|
|
647
|
+
blueprint: architectureRecommendation.recommendedBlueprintFileName,
|
|
648
|
+
confidenceLabel: architectureRecommendation.confidenceLabel,
|
|
649
|
+
confidenceScore: architectureRecommendation.confidenceScore,
|
|
650
|
+
research: architectureRecommendation.research,
|
|
651
|
+
evidenceCitations: architectureRecommendation.evidenceCitations,
|
|
652
|
+
designGuidance: architectureRecommendation.designGuidance,
|
|
653
|
+
}, null, 2)
|
|
654
|
+
: 'null';
|
|
655
|
+
|
|
656
|
+
return [
|
|
657
|
+
'# Bootstrap Prompt: Dynamic Project Context Synthesis',
|
|
658
|
+
'',
|
|
659
|
+
`Protocol version: ${PROJECT_DOC_SYNTHESIS_PROMPT_VERSION}`,
|
|
660
|
+
'',
|
|
661
|
+
'You are a Lead Solution Architect and Principal Engineer.',
|
|
662
|
+
'Write project context docs from scratch (no template rendering, no placeholder boilerplate).',
|
|
663
|
+
'',
|
|
664
|
+
'## Mission',
|
|
665
|
+
`Create or update these files in ${docsLanguage.toUpperCase()} language:`,
|
|
666
|
+
expectedDocsList,
|
|
667
|
+
'',
|
|
668
|
+
'## Hard Rules',
|
|
669
|
+
'1. No copy-paste from external prose.',
|
|
670
|
+
'2. Every major section must explain rationale and tradeoffs.',
|
|
671
|
+
'3. Keep stack, database, and auth aligned with the project constraints below unless user explicitly requests migration.',
|
|
672
|
+
'4. Output must be implementation-ready for engineers, not generic textbook explanation.',
|
|
673
|
+
'',
|
|
674
|
+
'## Project Inputs',
|
|
675
|
+
`- Project name: ${discoveryAnswers.projectName}`,
|
|
676
|
+
`- Project description: ${discoveryAnswers.projectDescription}`,
|
|
677
|
+
`- Primary domain: ${discoveryAnswers.primaryDomain}`,
|
|
678
|
+
`- Database strategy: ${discoveryAnswers.databaseChoice}`,
|
|
679
|
+
`- Auth strategy: ${discoveryAnswers.authStrategy}`,
|
|
680
|
+
`- Docker strategy: ${discoveryAnswers.dockerStrategy}`,
|
|
681
|
+
`- Runtime environment: ${initContext.runtimeEnvironmentLabel || initContext.runtimeEnvironmentKey || 'Linux'}`,
|
|
682
|
+
`- Selected stack: ${toTitleCase(initContext.stackFileName)}`,
|
|
683
|
+
`- Selected blueprint: ${toTitleCase(initContext.blueprintFileName)}`,
|
|
684
|
+
`- Additional stacks: ${Array.isArray(initContext.additionalStackFileNames) && initContext.additionalStackFileNames.length > 0 ? initContext.additionalStackFileNames.map((stackFileName) => toTitleCase(stackFileName)).join(', ') : 'none'}`,
|
|
685
|
+
`- Additional blueprints: ${Array.isArray(initContext.additionalBlueprintFileNames) && initContext.additionalBlueprintFileNames.length > 0 ? initContext.additionalBlueprintFileNames.map((blueprintFileName) => toTitleCase(blueprintFileName)).join(', ') : 'none'}`,
|
|
686
|
+
'',
|
|
687
|
+
'## Key Features',
|
|
688
|
+
featuresList,
|
|
689
|
+
'',
|
|
690
|
+
'## Additional Context',
|
|
691
|
+
discoveryAnswers.additionalContext || 'No additional context provided.',
|
|
692
|
+
'',
|
|
693
|
+
'## Architect Engine Snapshot (for grounding)',
|
|
694
|
+
'```json',
|
|
695
|
+
architectureSnapshot,
|
|
696
|
+
'```',
|
|
697
|
+
'',
|
|
698
|
+
'## Required Execution',
|
|
699
|
+
'1. Create all required docs files listed above with complete Markdown content.',
|
|
700
|
+
'2. Keep content original, specific to this project, and actionable for implementation.',
|
|
701
|
+
'3. After writing docs, continue coding tasks using these docs as living project context.',
|
|
702
|
+
'',
|
|
703
|
+
].join('\n');
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
function buildDesignBootstrapPrompt({
|
|
707
|
+
discoveryAnswers,
|
|
708
|
+
initContext,
|
|
709
|
+
docsLanguage,
|
|
710
|
+
architectureRecommendation,
|
|
711
|
+
}) {
|
|
712
|
+
const designSignals = architectureRecommendation?.designGuidance?.normalizedSignals || null;
|
|
713
|
+
const designSignalsJson = JSON.stringify(designSignals, null, 2);
|
|
714
|
+
|
|
715
|
+
return [
|
|
716
|
+
'# Bootstrap Prompt: Dynamic DESIGN.md Synthesis',
|
|
717
|
+
'',
|
|
718
|
+
`Protocol version: ${PROJECT_DOC_SYNTHESIS_PROMPT_VERSION}`,
|
|
719
|
+
'',
|
|
720
|
+
'You are the Lead UI/UX Art Director for this project.',
|
|
721
|
+
'Write docs/DESIGN.md from zero. Do not use generic template prose.',
|
|
722
|
+
'',
|
|
723
|
+
'## Mission',
|
|
724
|
+
`Author docs/DESIGN.md in ${docsLanguage.toUpperCase()} language with strong art direction and engineering-ready guidance.`,
|
|
725
|
+
'',
|
|
726
|
+
'## Required Sections',
|
|
727
|
+
'1. Design Vision and Product Personality',
|
|
728
|
+
'2. Theme and Atmosphere Direction',
|
|
729
|
+
'3. Color System (tokens, semantic roles, accessibility rationale)',
|
|
730
|
+
'4. Typography System (pairing, scale, usage rules)',
|
|
731
|
+
'5. Spacing and Layout Rhythm',
|
|
732
|
+
'6. Motion and Interaction Principles',
|
|
733
|
+
'7. Component Language (cards, forms, nav, states)',
|
|
734
|
+
'8. Do and Don\'t Rules',
|
|
735
|
+
'9. Accessibility Non-Negotiables',
|
|
736
|
+
'10. Redesign Protocol (how to evolve without breaking design identity)',
|
|
737
|
+
'',
|
|
738
|
+
'## Hard Rules',
|
|
739
|
+
'1. No copy-paste from external style guides.',
|
|
740
|
+
'2. Every major decision must include psychological/product rationale.',
|
|
741
|
+
'3. Keep implementation feasible for the selected stack and blueprint.',
|
|
742
|
+
'4. Keep tone decisive like an art director, not generic AI boilerplate.',
|
|
743
|
+
'',
|
|
744
|
+
'## Project Inputs',
|
|
745
|
+
`- Project name: ${discoveryAnswers.projectName}`,
|
|
746
|
+
`- Product context: ${discoveryAnswers.projectDescription}`,
|
|
747
|
+
`- Domain: ${discoveryAnswers.primaryDomain}`,
|
|
748
|
+
`- Stack: ${toTitleCase(initContext.stackFileName)}`,
|
|
749
|
+
`- Blueprint: ${toTitleCase(initContext.blueprintFileName)}`,
|
|
750
|
+
'',
|
|
751
|
+
'## Architect Design Signals (raw control vector)',
|
|
752
|
+
'Use this only as baseline fuel, then expand into full design direction with original reasoning:',
|
|
753
|
+
'```json',
|
|
754
|
+
designSignalsJson || 'null',
|
|
755
|
+
'```',
|
|
756
|
+
'',
|
|
757
|
+
'## Required Execution',
|
|
758
|
+
'1. Create docs/DESIGN.md with complete content.',
|
|
759
|
+
'2. Ensure rules are practical for implementation and review.',
|
|
760
|
+
'3. After DESIGN.md exists, use it as first-class source for future UI tasks.',
|
|
761
|
+
'',
|
|
762
|
+
].join('\n');
|
|
763
|
+
}
|
|
764
|
+
|
|
600
765
|
/**
|
|
601
|
-
* Generate project documentation
|
|
766
|
+
* Generate AI-first bootstrap prompts for dynamic project documentation synthesis.
|
|
767
|
+
* Legacy template rendering utilities are retained for backward compatibility checks.
|
|
602
768
|
*/
|
|
603
769
|
export async function generateProjectDocumentation(
|
|
604
770
|
targetDirectoryPath,
|
|
@@ -612,34 +778,52 @@ export async function generateProjectDocumentation(
|
|
|
612
778
|
}
|
|
613
779
|
|
|
614
780
|
const docsDirectoryPath = path.join(targetDirectoryPath, 'docs');
|
|
615
|
-
|
|
781
|
+
const promptsDirectoryPath = path.join(targetDirectoryPath, '.agent-context', 'prompts');
|
|
782
|
+
await ensureDirectory(promptsDirectoryPath);
|
|
616
783
|
|
|
617
784
|
const templateContext = buildTemplateContext(discoveryAnswers, initContext);
|
|
618
785
|
const { documentManifest } = resolveDocumentManifest(discoveryAnswers);
|
|
619
|
-
const
|
|
786
|
+
const expectedDocFileNames = documentManifest.map((documentEntry) => documentEntry.outputFileName);
|
|
787
|
+
const generatedPromptFileNames = [];
|
|
620
788
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
789
|
+
const projectContextPromptFileName = 'bootstrap-project-context.md';
|
|
790
|
+
const architectureRecommendation = initContext.architectureRecommendation || null;
|
|
791
|
+
const projectContextPromptContent = buildProjectContextBootstrapPrompt({
|
|
792
|
+
discoveryAnswers,
|
|
793
|
+
initContext: templateContext,
|
|
794
|
+
expectedDocFileNames,
|
|
795
|
+
docsLanguage: normalizedDocsLanguage,
|
|
796
|
+
architectureRecommendation,
|
|
797
|
+
});
|
|
798
|
+
await fs.writeFile(
|
|
799
|
+
path.join(promptsDirectoryPath, projectContextPromptFileName),
|
|
800
|
+
projectContextPromptContent,
|
|
801
|
+
'utf8'
|
|
802
|
+
);
|
|
803
|
+
generatedPromptFileNames.push(projectContextPromptFileName);
|
|
804
|
+
|
|
805
|
+
if (shouldBootstrapDesignDocument(discoveryAnswers, initContext)) {
|
|
806
|
+
const designPromptFileName = 'bootstrap-design.md';
|
|
807
|
+
const designPromptContent = buildDesignBootstrapPrompt({
|
|
808
|
+
discoveryAnswers,
|
|
809
|
+
initContext: templateContext,
|
|
810
|
+
docsLanguage: normalizedDocsLanguage,
|
|
811
|
+
architectureRecommendation,
|
|
812
|
+
});
|
|
813
|
+
await fs.writeFile(path.join(promptsDirectoryPath, designPromptFileName), designPromptContent, 'utf8');
|
|
814
|
+
generatedPromptFileNames.push(designPromptFileName);
|
|
626
815
|
|
|
627
|
-
if (!
|
|
628
|
-
|
|
629
|
-
continue;
|
|
816
|
+
if (!expectedDocFileNames.includes('DESIGN.md')) {
|
|
817
|
+
expectedDocFileNames.push('DESIGN.md');
|
|
630
818
|
}
|
|
631
|
-
|
|
632
|
-
const templateContent = await fs.readFile(templateFilePath, 'utf8');
|
|
633
|
-
const renderedContent = renderTemplate(templateContent, templateContext);
|
|
634
|
-
const outputFilePath = path.join(docsDirectoryPath, documentEntry.outputFileName);
|
|
635
|
-
|
|
636
|
-
await fs.writeFile(outputFilePath, renderedContent, 'utf8');
|
|
637
|
-
generatedFileNames.push(documentEntry.outputFileName);
|
|
638
819
|
}
|
|
639
820
|
|
|
640
821
|
return {
|
|
641
822
|
docsDirectoryPath,
|
|
642
|
-
generatedFileNames,
|
|
823
|
+
generatedFileNames: expectedDocFileNames,
|
|
824
|
+
generatedPromptFileNames,
|
|
825
|
+
bootstrapMode: 'ai-synthesis',
|
|
826
|
+
synthesisPromptVersion: PROJECT_DOC_SYNTHESIS_PROMPT_VERSION,
|
|
643
827
|
templateVersion: PROJECT_DOC_TEMPLATE_VERSION,
|
|
644
828
|
docsLanguage: normalizedDocsLanguage,
|
|
645
829
|
discoveryAnswers,
|
package/lib/cli/utils.mjs
CHANGED
|
@@ -49,8 +49,9 @@ export function printUsage() {
|
|
|
49
49
|
console.log(' --project-description Architecture intent text used for stack/blueprint recommendation');
|
|
50
50
|
console.log(' --architect-token-budget Max token estimate used by recommendation research (default: 900)');
|
|
51
51
|
console.log(' --architect-timeout-ms Max recommendation research time in milliseconds (default: 1500)');
|
|
52
|
-
console.log(' --architect-research-mode Recommendation evidence mode (snapshot or realtime; default:
|
|
53
|
-
console.log(' --enable-realtime-research
|
|
52
|
+
console.log(' --architect-research-mode Recommendation evidence mode (snapshot or realtime; default: realtime in init)');
|
|
53
|
+
console.log(' --enable-realtime-research Allow trusted realtime evidence ingestion (enabled by default in init)');
|
|
54
|
+
console.log(' --disable-realtime-research Force deterministic snapshot-only baseline in init');
|
|
54
55
|
console.log(' --architect-realtime-signal-file Optional JSON payload path for trusted realtime stack/design signals');
|
|
55
56
|
console.log(' --ci Override CI/CD quality checks (guardrails) (true|false)');
|
|
56
57
|
console.log(' --token-optimize Explicitly enable token optimization policy during init (default behavior)');
|
|
@@ -62,7 +63,7 @@ export function printUsage() {
|
|
|
62
63
|
console.log(' --no-mcp-template Disable automatic MCP configuration across your IDEs');
|
|
63
64
|
console.log(' --scaffold-docs Force project documentation scaffolding (architecture, database, API, flow)');
|
|
64
65
|
console.log(' --no-scaffold-docs Skip project documentation scaffolding');
|
|
65
|
-
console.log(' --docs-lang Optional override for
|
|
66
|
+
console.log(' --docs-lang Optional override for bootstrap docs synthesis language (default: en)');
|
|
66
67
|
console.log(' --project-config Path to a project config file for non-interactive doc scaffolding');
|
|
67
68
|
console.log(' --runtime-env Override runtime environment hint (auto, linux-wsl, linux, windows, macos)');
|
|
68
69
|
console.log(' --dry-run Preview upgrade without writing files');
|