@ryuenn3123/agentic-senior-core 3.0.12 → 3.0.14

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.
@@ -6,7 +6,7 @@
6
6
  import fs from 'node:fs/promises';
7
7
  import path from 'node:path';
8
8
 
9
- import { ensureDirectory, askChoice, toTitleCase, pathExists } from './utils.mjs';
9
+ import { ensureDirectory, askChoice, askYesNo, toTitleCase, pathExists } from './utils.mjs';
10
10
 
11
11
  const SUPPORTED_DOC_LANGUAGES = new Set(['en', 'id']);
12
12
  const PROJECT_DOC_FILE_NAMES = [
@@ -137,14 +137,18 @@ export function normalizeDocsLanguage(rawDocsLanguage = 'en') {
137
137
  * Returns a structured object with all user responses.
138
138
  */
139
139
  export async function runProjectDiscovery(userInterface, options = {}) {
140
- console.log('\n--- Project Discovery ---');
141
- console.log('I will ask a few questions to generate project-specific documentation.');
140
+ console.log('\n--- Project Setup ---');
141
+ console.log('I will ask one focused set of questions to bootstrap project context and documentation.');
142
142
  console.log('This helps AI agents understand your project before writing code.\n');
143
143
  console.log('You can answer in your own language.');
144
144
  console.log('CLI prompts stay in English, but non-English answers are fully supported.\n');
145
145
 
146
146
  const defaultProjectName = (options.defaultProjectName || '').trim();
147
147
  const defaultProjectDescription = String(options.defaultProjectDescription || '').trim();
148
+ const defaultIncludeCiGuardrails = typeof options.defaultIncludeCiGuardrails === 'boolean'
149
+ ? options.defaultIncludeCiGuardrails
150
+ : true;
151
+ const shouldAskForCiGuardrails = options.askForCiGuardrails !== false;
148
152
  let projectName = '';
149
153
 
150
154
  const projectNamePrompt = defaultProjectName
@@ -171,6 +175,14 @@ export async function runProjectDiscovery(userInterface, options = {}) {
171
175
  projectDescription = defaultProjectDescription || `A ${projectName} project.`;
172
176
  }
173
177
 
178
+ const includeCiGuardrails = shouldAskForCiGuardrails
179
+ ? await askYesNo(
180
+ 'Enable CI/CD quality checks (guardrails) and the LLM Judge policy?',
181
+ userInterface,
182
+ defaultIncludeCiGuardrails
183
+ )
184
+ : defaultIncludeCiGuardrails;
185
+
174
186
  const domainSelection = await askChoice(
175
187
  'Primary domain:',
176
188
  DOMAIN_CHOICES,
@@ -210,24 +222,18 @@ export async function runProjectDiscovery(userInterface, options = {}) {
210
222
  userInterface
211
223
  );
212
224
 
213
- let features = await askFeatureList(userInterface);
214
-
215
- if (features.length === 0) {
216
- features.push('Core functionality (define during development)');
217
- }
218
-
219
- const additionalContext = (await userInterface.question('\nAdditional context (optional, press Enter to skip): ')).trim()
220
- || 'No additional context provided.';
225
+ const features = await askFeatureList(userInterface);
221
226
 
222
227
  return {
223
228
  projectName,
224
229
  projectDescription,
230
+ includeCiGuardrails,
225
231
  primaryDomain,
226
232
  databaseChoice,
227
233
  authStrategy,
228
234
  dockerStrategy,
229
235
  features,
230
- additionalContext,
236
+ additionalContext: 'No additional context provided.',
231
237
  };
232
238
  }
233
239
 
@@ -508,7 +514,14 @@ function buildDesignIntentContractObject({
508
514
  primaryDomain,
509
515
  features,
510
516
  });
511
- const designSignals = architectureRecommendation?.designGuidance?.normalizedSignals || null;
517
+ const normalizedPrimaryDomain = String(primaryDomain || '').trim().toLowerCase();
518
+ const resolvedSpacingPattern = inferredKeywords.densityMode === 'dense'
519
+ ? 'compact-grid'
520
+ : normalizedPrimaryDomain.includes('mobile')
521
+ ? 'mobile-first-single-axis'
522
+ : inferredKeywords.densityMode === 'focused'
523
+ ? 'high-contrast-rhythm'
524
+ : 'balanced-grid';
512
525
 
513
526
  return {
514
527
  mode: 'dynamic',
@@ -531,14 +544,14 @@ function buildDesignIntentContractObject({
531
544
  mathSystems: {
532
545
  typographyScaleRatio: inferredKeywords.typographyScaleRatio,
533
546
  baseGridUnit: inferredKeywords.baseGridUnit,
534
- spacingPattern: designSignals?.spacingPattern || 'balanced-grid',
547
+ spacingPattern: resolvedSpacingPattern,
535
548
  densityMode: inferredKeywords.densityMode,
536
549
  },
537
550
  colorTruth: {
538
551
  format: 'OKLCH',
539
552
  allowHexDerivatives: true,
540
553
  requirePerceptualLightnessCurve: true,
541
- paletteRoles: designSignals?.paletteRoles || ['base', 'surface', 'accent'],
554
+ paletteRoles: ['base', 'surface', 'accent'],
542
555
  intent: inferredKeywords.colorIntent,
543
556
  },
544
557
  crossViewportAdaptation: {
@@ -603,7 +616,6 @@ function buildDesignIntentContractObject({
603
616
  '.agent-context/rules/microservices.md',
604
617
  ],
605
618
  },
606
- architectSignals: designSignals,
607
619
  ...supplementalFields,
608
620
  };
609
621
  }
@@ -766,7 +778,7 @@ function buildProjectContextBootstrapPrompt({
766
778
  }) {
767
779
  const featuresList = Array.isArray(discoveryAnswers.features) && discoveryAnswers.features.length > 0
768
780
  ? discoveryAnswers.features.map((feature, featureIndex) => `${featureIndex + 1}. ${feature}`).join('\n')
769
- : '1. Core functionality (define during implementation)';
781
+ : 'Derive the first concrete feature set from the project name, description, and domain. Do not invent arbitrary modules just to fill space.';
770
782
 
771
783
  const expectedDocsList = expectedDocFileNames
772
784
  .map((fileName, fileIndex) => `${fileIndex + 1}. docs/${fileName}`)
@@ -802,6 +814,11 @@ function buildProjectContextBootstrapPrompt({
802
814
  '3. Keep stack, database, and auth aligned with the project constraints below unless user explicitly requests migration.',
803
815
  '4. Output must be implementation-ready for engineers, not generic textbook explanation.',
804
816
  '5. For any research-backed claim, include citation metadata (source + fetchedAt timestamp) from the Architect Engine Snapshot.',
817
+ '6. Write for native English speakers at an 8th-grade reading level. Use clear, direct, plain language.',
818
+ '7. Avoid emoji, AI cliches, buzzwords, academic phrasing, padding, and generic filler.',
819
+ '8. Separate confirmed facts from assumptions explicitly. When context is incomplete, add an `Assumptions to Validate` section and a `Next Validation Action` line.',
820
+ '9. If user inputs conflict with repo evidence, call out the conflict and choose the safer interpretation instead of silently forcing a generic answer.',
821
+ '10. Do not invent modules or architecture layers only to make the docs look complete.',
805
822
  '',
806
823
  '## Project Inputs',
807
824
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -829,8 +846,10 @@ function buildProjectContextBootstrapPrompt({
829
846
  '',
830
847
  '## Required Execution',
831
848
  '1. Create all required docs files listed above with complete Markdown content.',
832
- '2. Keep content original, specific to this project, and actionable for implementation.',
833
- '3. After writing docs, continue coding tasks using these docs as living project context.',
849
+ '2. Make the docs adaptive to the real repo and prompt context. These are living references, not frozen templates.',
850
+ '3. In docs/project-brief.md and docs/architecture-decision-record.md, include explicit sections for confirmed facts, assumptions to validate, and next validation actions whenever context is incomplete.',
851
+ '4. Keep content original, specific to this project, and actionable for implementation.',
852
+ '5. After writing docs, continue coding tasks using these docs as living project context.',
834
853
  '',
835
854
  ].join('\n');
836
855
  }
@@ -841,8 +860,6 @@ function buildDesignBootstrapPrompt({
841
860
  docsLanguage,
842
861
  architectureRecommendation,
843
862
  }) {
844
- const designSignals = architectureRecommendation?.designGuidance?.normalizedSignals || null;
845
- const designSignalsJson = JSON.stringify(designSignals, null, 2);
846
863
  const designIntentSeed = buildDesignIntentSeed({
847
864
  discoveryAnswers,
848
865
  initContext,
@@ -918,12 +935,6 @@ function buildDesignBootstrapPrompt({
918
935
  `- Stack: ${toTitleCase(initContext.stackFileName)}`,
919
936
  `- Blueprint: ${toTitleCase(initContext.blueprintFileName)}`,
920
937
  '',
921
- '## Architect Design Signals (raw control vector)',
922
- 'Use this only as baseline fuel, then expand into full design direction with original reasoning:',
923
- '```json',
924
- designSignalsJson || 'null',
925
- '```',
926
- '',
927
938
  '## Seed Machine Contract',
928
939
  'Refine this seed instead of discarding it. Keep the final JSON aligned with the markdown design system.',
929
940
  '```json',
@@ -1133,6 +1144,7 @@ export async function loadProjectConfig(configFilePath) {
1133
1144
  return {
1134
1145
  projectName: configEntries.projectName || configEntries.name || '',
1135
1146
  projectDescription: configEntries.projectDescription || configEntries.description || '',
1147
+ includeCiGuardrails: parseBooleanLikeValue(configEntries.includeCiGuardrails) ?? parseBooleanLikeValue(configEntries.ci) ?? true,
1136
1148
  primaryDomain: configEntries.primaryDomain || configEntries.domain || 'API service',
1137
1149
  databaseChoice: configEntries.databaseChoice || configEntries.database || 'None (stateless service)',
1138
1150
  authStrategy: configEntries.authStrategy || configEntries.auth || 'None (public service)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "bin/",
11
11
  "lib/",
12
12
  "scripts/",
13
+ ".instructions.md",
13
14
  ".agent-context/",
14
15
  ".agents/",
15
16
  ".github/",
@@ -38,13 +38,14 @@ The canonical policy source is [.instructions.md](.instructions.md).
38
38
 
39
39
  ## Mandatory Bootstrap Chain
40
40
 
41
- 1. Load [.instructions.md](.instructions.md) first as the single source of truth.
42
- 2. Read baseline governance from [.agent-context/rules/](.agent-context/rules).
43
- 3. Apply request templates from [.agent-context/prompts/](.agent-context/prompts).
44
- 4. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
45
- 5. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
46
- 6. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
47
- 7. Use dynamic stack and architecture reasoning from project context docs and live research signals.
41
+ 1. Load [.instructions.md](.instructions.md) first as the canonical baseline.
42
+ 2. If \`.agent-instructions.md\` exists, read it next as the compiled project-specific snapshot.
43
+ 3. Read baseline governance from [.agent-context/rules/](.agent-context/rules).
44
+ 4. Apply request templates from [.agent-context/prompts/](.agent-context/prompts).
45
+ 5. Enforce review contracts from [.agent-context/review-checklists/](.agent-context/review-checklists).
46
+ 6. Read change-risk maps and continuity state from [.agent-context/state/](.agent-context/state).
47
+ 7. Enforce policy thresholds from [.agent-context/policies/](.agent-context/policies).
48
+ 8. Use dynamic stack and architecture reasoning from project context docs and live research signals.
48
49
 
49
50
  ## Trigger Rules
50
51
 
@@ -67,12 +68,13 @@ The canonical policy source for this repository is [.instructions.md](../.instru
67
68
 
68
69
  ## Required Load Order
69
70
 
70
- 1. Read [.instructions.md](../.instructions.md) first.
71
- 2. Read baseline rules in [.agent-context/rules/](../.agent-context/rules).
72
- 3. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
73
- 4. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
74
- 5. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
75
- 6. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
71
+ 1. Read [.instructions.md](../.instructions.md) first as the canonical baseline.
72
+ 2. If \`.agent-instructions.md\` exists, read it next as the compiled project-specific snapshot.
73
+ 3. Read baseline rules in [.agent-context/rules/](../.agent-context/rules).
74
+ 4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
75
+ 5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
76
+ 6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and thresholds from [.agent-context/policies/](../.agent-context/policies).
77
+ 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
76
78
 
77
79
  ## Completion Gate
78
80
 
@@ -91,12 +93,13 @@ Canonical policy source: [.instructions.md](../.instructions.md).
91
93
 
92
94
  ## Bootstrap Sequence
93
95
 
94
- 1. Load [.instructions.md](../.instructions.md) first.
95
- 2. Apply baseline rules from [.agent-context/rules/](../.agent-context/rules).
96
- 3. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
97
- 4. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
98
- 5. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
99
- 6. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
96
+ 1. Load [.instructions.md](../.instructions.md) first as the canonical baseline.
97
+ 2. If \`.agent-instructions.md\` exists, read it next as the compiled project-specific snapshot.
98
+ 3. Apply baseline rules from [.agent-context/rules/](../.agent-context/rules).
99
+ 4. Load request templates from [.agent-context/prompts/](../.agent-context/prompts).
100
+ 5. Apply review contracts from [.agent-context/review-checklists/](../.agent-context/review-checklists).
101
+ 6. Apply state awareness from [.agent-context/state/](../.agent-context/state) and policy thresholds from [.agent-context/policies/](../.agent-context/policies).
102
+ 7. Resolve stack and architecture choices dynamically from project context docs plus live evidence.
100
103
 
101
104
  ## Completion Gate
102
105
 
@@ -778,6 +778,12 @@ async function validatePackageMetadata() {
778
778
  } else {
779
779
  pass('package.json has no unnecessary devDependencies');
780
780
  }
781
+
782
+ if (Array.isArray(packageJson.files) && packageJson.files.includes('.instructions.md')) {
783
+ pass('package.json publishes canonical .instructions.md');
784
+ } else {
785
+ fail('package.json must publish .instructions.md so init and upgrade can copy the canonical root instructions file');
786
+ }
781
787
  }
782
788
 
783
789
  async function validatePolicyFile() {