@ryuenn3123/agentic-senior-core 2.0.17 → 2.0.18

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/README.md CHANGED
@@ -281,6 +281,18 @@ For CI pipelines that only need stdout JSON:
281
281
  node ./scripts/benchmark-writer-judge-matrix.mjs --stdout-only
282
282
  ```
283
283
 
284
+ ### Benchmark Quickstart Path (V2.5)
285
+
286
+ For new users, run this minimal sequence first:
287
+
288
+ ```bash
289
+ npm run benchmark:detection
290
+ npm run benchmark:writer-judge
291
+ npm run benchmark:bundle
292
+ ```
293
+
294
+ This gives a fast baseline of accuracy, writer-judge comparison, and evidence packaging in one pass.
295
+
284
296
  ### Install and Setup Choices
285
297
 
286
298
  The CLI now supports a smaller decision surface for first-time setup:
@@ -357,7 +369,7 @@ Our documentation has shifted into dedicated tracks to keep this README light:
357
369
 
358
370
  - **Delivery Engine (CLI):** Interactive setup via GitHub source, bootstrap scripts, or `npx` after publish. Supported by a robust transactional installer with rollback protection.
359
371
  - **Verified Skill Marketplace:** Distribute and validate plugins securely with automated 4-dimension Trust Scoring and Evidence Bundles constraint validation.
360
- - **Dynamic Context Compiler:** Merges universal rules + selected stack + selected blueprint + optional CI guardrails into one dense, indexed rule file.
372
+ - **Dynamic Context Compiler:** Builds a compact modular bootstrap index that points to all required governance layers before execution.
361
373
  - **Codebase Intelligence:** `.agent-context/state/` gives architecture/dependency boundaries so the agent understands high-risk areas.
362
374
  - **Override System:** `.agent-override.md` allows controlled enterprise exceptions without forking core rules.
363
375
  - **Automated Guardrails:** CI blueprints include LLM-as-a-Judge flow using `pr-checklist.md`.
@@ -18,7 +18,6 @@ import {
18
18
 
19
19
  import {
20
20
  inferSkillDomainNamesFromSelection,
21
- buildSkillPackSection,
22
21
  } from './skill-selector.mjs';
23
22
 
24
23
  import {
@@ -102,51 +101,91 @@ export async function buildCompiledRulesContent({
102
101
  const selectedRulesDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'rules');
103
102
  const selectedStacksDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'stacks');
104
103
  const selectedBlueprintsDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'blueprints');
105
- const selectedStateDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'state');
106
- const selectedReviewDirectoryPath = path.join(resolvedTargetDirectoryPath, '.agent-context', 'review-checklists');
107
104
  const skillPlatformIndex = JSON.parse(await fs.readFile(SKILL_PLATFORM_INDEX_PATH, 'utf8'));
108
105
  const selectedSkillDomainNames = inferSkillDomainNamesFromSelection(selectedStackFileName, selectedBlueprintFileName);
109
106
 
110
107
  const universalRuleFileNames = await collectFileNames(selectedRulesDirectoryPath);
111
108
  const contextBlocks = [];
112
109
 
113
- for (const universalRuleFileName of universalRuleFileNames) {
114
- const universalRuleFilePath = path.join(selectedRulesDirectoryPath, universalRuleFileName);
115
- const universalRuleContent = await fs.readFile(universalRuleFilePath, 'utf8');
110
+ function resolveSkillPackFileName(skillDomainEntry, selectedTierName) {
111
+ return skillDomainEntry.tierToPackFileNames?.[selectedTierName]
112
+ || skillDomainEntry.tierToPackFileNames?.[skillDomainEntry.defaultTier]
113
+ || skillDomainEntry.defaultPackFileName;
114
+ }
116
115
 
117
- contextBlocks.push(
118
- `## UNIVERSAL RULE: ${universalRuleFileName}\nSource: .agent-context/rules/${universalRuleFileName}\n\n${universalRuleContent.trim()}`
119
- );
116
+ function firstMarkdownHeading(content, fallbackLabel) {
117
+ const headingLine = content
118
+ .split(/\r?\n/)
119
+ .find((line) => line.trim().startsWith('#'));
120
+
121
+ if (!headingLine) {
122
+ return fallbackLabel;
123
+ }
124
+
125
+ return headingLine.replace(/^#+\s*/, '').trim();
120
126
  }
121
127
 
128
+ contextBlocks.push(
129
+ [
130
+ '## BOOTSTRAP CHAIN (MANDATORY)',
131
+ 'Load every layer before responding. Do not skip steps:',
132
+ '1. .agent-context/rules/',
133
+ '2. .agent-context/stacks/',
134
+ '3. .agent-context/blueprints/',
135
+ '4. .agent-context/skills/',
136
+ '5. .agent-context/prompts/',
137
+ '6. .agent-context/profiles/',
138
+ '7. .agent-context/state/',
139
+ `8. .agent-context/policies/${POLICY_FILE_NAME}`,
140
+ '',
141
+ 'Primary entrypoint: .cursorrules',
142
+ 'Mirror entrypoint: .windsurfrules',
143
+ 'Canonical baseline: .instructions.md',
144
+ ].join('\n')
145
+ );
146
+
147
+ contextBlocks.push(
148
+ [
149
+ '## LAYER 1: UNIVERSAL RULES (MANDATORY)',
150
+ 'Read every file under .agent-context/rules/ before implementation:',
151
+ ...universalRuleFileNames.map((universalRuleFileName, index) => `${index + 1}. .agent-context/rules/${universalRuleFileName}`),
152
+ '',
153
+ 'Conflict resolution: prioritize data safety and API contract integrity first, then writing polish.',
154
+ ].join('\n')
155
+ );
156
+
122
157
  const stackFilePath = path.join(selectedStacksDirectoryPath, selectedStackFileName);
123
158
  const stackContent = await fs.readFile(stackFilePath, 'utf8');
159
+ const stackSummary = firstMarkdownHeading(stackContent, selectedStackFileName);
124
160
  contextBlocks.push(
125
- `## STACK PROFILE: ${selectedStackFileName}\nSource: .agent-context/stacks/${selectedStackFileName}\n\n${stackContent.trim()}`
161
+ [
162
+ `## LAYER 2: STACK PROFILE (${selectedStackFileName})`,
163
+ `Source: .agent-context/stacks/${selectedStackFileName}`,
164
+ `Summary: ${stackSummary}`,
165
+ 'Load this stack profile to enforce language-specific conventions.',
166
+ ].join('\n')
126
167
  );
127
168
 
128
169
  const blueprintFilePath = path.join(selectedBlueprintsDirectoryPath, selectedBlueprintFileName);
129
170
  const blueprintContent = await fs.readFile(blueprintFilePath, 'utf8');
171
+ const blueprintSummary = firstMarkdownHeading(blueprintContent, selectedBlueprintFileName);
130
172
  contextBlocks.push(
131
- `## BLUEPRINT PROFILE: ${selectedBlueprintFileName}\nSource: .agent-context/blueprints/${selectedBlueprintFileName}\n\n${blueprintContent.trim()}`
173
+ [
174
+ `## LAYER 3: BLUEPRINT PROFILE (${selectedBlueprintFileName})`,
175
+ `Source: .agent-context/blueprints/${selectedBlueprintFileName}`,
176
+ `Summary: ${blueprintSummary}`,
177
+ 'Load this blueprint when scaffolding or changing architecture boundaries.',
178
+ ].join('\n')
132
179
  );
133
180
 
134
181
  if (includeCiGuardrails) {
135
- const githubCiBlueprintContent = await fs.readFile(path.join(selectedBlueprintsDirectoryPath, 'ci-github-actions.md'), 'utf8');
136
- const gitlabCiBlueprintContent = await fs.readFile(path.join(selectedBlueprintsDirectoryPath, 'ci-gitlab.md'), 'utf8');
137
-
138
- contextBlocks.push(
139
- `## CI/CD GUARDRAILS: ci-github-actions.md\nSource: .agent-context/blueprints/ci-github-actions.md\n\n${githubCiBlueprintContent.trim()}`
140
- );
141
- contextBlocks.push(
142
- `## CI/CD GUARDRAILS: ci-gitlab.md\nSource: .agent-context/blueprints/ci-gitlab.md\n\n${gitlabCiBlueprintContent.trim()}`
143
- );
144
- }
145
-
146
- const tokenOptimizationState = await readTokenOptimizationState(resolvedTargetDirectoryPath);
147
- if (tokenOptimizationState?.enabled) {
148
182
  contextBlocks.push(
149
- `## TOKEN OPTIMIZATION PROFILE\nSource: .agent-context/state/token-optimization.json\n\n${buildTokenOptimizationGuidanceBlock(tokenOptimizationState).trim()}`
183
+ [
184
+ '## LAYER 3B: CI/CD GUARDRAILS',
185
+ 'Load these CI blueprints when pipeline or release logic is touched:',
186
+ '1. .agent-context/blueprints/ci-github-actions.md',
187
+ '2. .agent-context/blueprints/ci-gitlab.md',
188
+ ].join('\n')
150
189
  );
151
190
  }
152
191
 
@@ -156,21 +195,45 @@ export async function buildCompiledRulesContent({
156
195
  continue;
157
196
  }
158
197
 
159
- contextBlocks.push(await buildSkillPackSection(skillDomainEntry, skillPlatformIndex.defaultTier || 'advance'));
160
- }
198
+ const selectedTierName = skillPlatformIndex.defaultTier || 'advance';
199
+ const resolvedPackFileName = resolveSkillPackFileName(skillDomainEntry, selectedTierName);
161
200
 
162
- const architectureMapContent = await fs.readFile(path.join(selectedStateDirectoryPath, 'architecture-map.md'), 'utf8');
163
- const dependencyMapContent = await fs.readFile(path.join(selectedStateDirectoryPath, 'dependency-map.md'), 'utf8');
164
- const prChecklistContent = await fs.readFile(path.join(selectedReviewDirectoryPath, 'pr-checklist.md'), 'utf8');
201
+ contextBlocks.push(
202
+ [
203
+ `## SKILL PACK: ${skillDomainEntry.displayName}`,
204
+ `Source: .agent-context/skills/${resolvedPackFileName}`,
205
+ `Default tier: ${skillDomainEntry.defaultTier}`,
206
+ `Selected tier: ${selectedTierName}`,
207
+ `Evidence: ${skillDomainEntry.evidence}`,
208
+ `Purpose: ${skillDomainEntry.description}`,
209
+ 'Load this skill pack and apply every Must-Have Check.',
210
+ ].join('\n')
211
+ );
212
+ }
165
213
 
214
+ const tokenOptimizationState = await readTokenOptimizationState(resolvedTargetDirectoryPath);
215
+ if (tokenOptimizationState?.enabled) {
216
+ contextBlocks.push(
217
+ `## TOKEN OPTIMIZATION PROFILE\nSource: .agent-context/state/token-optimization.json\n\n${buildTokenOptimizationGuidanceBlock(tokenOptimizationState).trim()}`
218
+ );
219
+ }
166
220
  contextBlocks.push(
167
- `## STATE MAP: architecture-map.md\nSource: .agent-context/state/architecture-map.md\n\n${architectureMapContent.trim()}`
168
- );
169
- contextBlocks.push(
170
- `## STATE MAP: dependency-map.md\nSource: .agent-context/state/dependency-map.md\n\n${dependencyMapContent.trim()}`
221
+ [
222
+ '## LAYER 7: STATE AWARENESS (MANDATORY)',
223
+ 'Load these files before touching critical paths:',
224
+ '1. .agent-context/state/architecture-map.md',
225
+ '2. .agent-context/state/dependency-map.md',
226
+ 'Use these maps to prevent unsafe cross-module changes.',
227
+ ].join('\n')
171
228
  );
172
229
  contextBlocks.push(
173
- `## REVIEW CHECKLIST: pr-checklist.md\nSource: .agent-context/review-checklists/pr-checklist.md\n\n${prChecklistContent.trim()}`
230
+ [
231
+ '## REVIEW CHECKLISTS (MANDATORY)',
232
+ '1. .agent-context/review-checklists/pr-checklist.md',
233
+ '2. .agent-context/review-checklists/security-audit.md (when security-sensitive)',
234
+ '3. .agent-context/review-checklists/performance-audit.md (when perf-critical)',
235
+ 'Do not claim done before checklist pass.',
236
+ ].join('\n')
174
237
  );
175
238
 
176
239
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -58,6 +58,7 @@ const REQUIRED_HUMAN_WRITING_SNIPPETS = [
58
58
  snippets: [
59
59
  '## Human Writing Standard (Mandatory)',
60
60
  'This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations.',
61
+ 'Style baseline findings are advisory by default and must not block endpoint-change commits that already include accurate docs/spec updates.',
61
62
  'No emoji in formal artifacts.',
62
63
  ],
63
64
  },
@@ -65,6 +66,7 @@ const REQUIRED_HUMAN_WRITING_SNIPPETS = [
65
66
  path: '.agent-context/review-checklists/pr-checklist.md',
66
67
  snippets: [
67
68
  'Scope applied: This applies to documentation, release notes, onboarding text, review summaries, and agent-facing explanations',
69
+ 'Style scope review is advisory and does not block merge when API docs are synced in the same commit and contract details are correct',
68
70
  'No emoji in formal documentation or review summaries',
69
71
  'Documentation uses plain English and avoids AI cliches',
70
72
  ],