@ryuenn3123/agentic-senior-core 2.0.18 → 2.0.20

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.
@@ -0,0 +1,181 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Benchmark Before-vs-After Comparison",
4
+ "description": "Schema for comparing benchmark results across releases or configuration changes. Each entry captures quality, bug signal, runtime, and token metrics for a before and after snapshot.",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "comparisonId", "generatedAt", "before", "after", "delta"],
7
+ "properties": {
8
+ "schemaVersion": {
9
+ "type": "string",
10
+ "const": "1.0.0"
11
+ },
12
+ "comparisonId": {
13
+ "type": "string",
14
+ "description": "Unique identifier for this comparison run."
15
+ },
16
+ "generatedAt": {
17
+ "type": "string",
18
+ "format": "date-time"
19
+ },
20
+ "baselineVersion": {
21
+ "type": "string",
22
+ "description": "Package version of the before snapshot."
23
+ },
24
+ "candidateVersion": {
25
+ "type": "string",
26
+ "description": "Package version of the after snapshot."
27
+ },
28
+ "comparisonType": {
29
+ "type": "string",
30
+ "enum": ["release-to-release", "config-change", "model-swap", "manual"],
31
+ "description": "What triggered this comparison."
32
+ },
33
+ "before": { "$ref": "#/$defs/snapshot" },
34
+ "after": { "$ref": "#/$defs/snapshot" },
35
+ "delta": { "$ref": "#/$defs/deltaReport" },
36
+ "verdict": {
37
+ "type": "string",
38
+ "enum": ["pass", "warn", "fail"],
39
+ "description": "Overall comparison verdict based on threshold policy."
40
+ },
41
+ "verdictReason": {
42
+ "type": "string",
43
+ "description": "Human-readable explanation of the verdict."
44
+ }
45
+ },
46
+ "$defs": {
47
+ "snapshot": {
48
+ "type": "object",
49
+ "required": ["capturedAt", "quality", "runtime"],
50
+ "properties": {
51
+ "capturedAt": {
52
+ "type": "string",
53
+ "format": "date-time"
54
+ },
55
+ "packageVersion": {
56
+ "type": "string"
57
+ },
58
+ "quality": {
59
+ "type": "object",
60
+ "properties": {
61
+ "top1Accuracy": {
62
+ "type": "number",
63
+ "minimum": 0,
64
+ "maximum": 1,
65
+ "description": "Fraction of scenarios where the top-ranked output was correct."
66
+ },
67
+ "manualCorrectionRate": {
68
+ "type": "number",
69
+ "minimum": 0,
70
+ "maximum": 1,
71
+ "description": "Fraction of outputs requiring human correction."
72
+ },
73
+ "averageJudgeScore": {
74
+ "type": "number",
75
+ "minimum": 0,
76
+ "maximum": 10,
77
+ "description": "Mean score across all judge dimensions."
78
+ },
79
+ "scenarioCount": {
80
+ "type": "integer",
81
+ "minimum": 1
82
+ }
83
+ }
84
+ },
85
+ "bugSignal": {
86
+ "type": "object",
87
+ "properties": {
88
+ "validationFailures": {
89
+ "type": "integer",
90
+ "minimum": 0,
91
+ "description": "Number of validation check failures."
92
+ },
93
+ "securityWarnings": {
94
+ "type": "integer",
95
+ "minimum": 0
96
+ },
97
+ "deprecationWarnings": {
98
+ "type": "integer",
99
+ "minimum": 0
100
+ }
101
+ }
102
+ },
103
+ "runtime": {
104
+ "type": "object",
105
+ "properties": {
106
+ "totalDurationMs": {
107
+ "type": "number",
108
+ "description": "Total benchmark suite execution time in milliseconds."
109
+ },
110
+ "averageScenarioDurationMs": {
111
+ "type": "number"
112
+ },
113
+ "peakMemoryMb": {
114
+ "type": "number"
115
+ }
116
+ }
117
+ },
118
+ "token": {
119
+ "type": "object",
120
+ "properties": {
121
+ "nativeSavingsPercent": {
122
+ "type": "number",
123
+ "description": "Token savings from native optimization."
124
+ },
125
+ "proxySavingsPercent": {
126
+ "type": "number",
127
+ "description": "Token savings from external proxy optimization."
128
+ },
129
+ "totalInputTokens": {
130
+ "type": "integer"
131
+ },
132
+ "totalOutputTokens": {
133
+ "type": "integer"
134
+ }
135
+ }
136
+ }
137
+ }
138
+ },
139
+ "deltaReport": {
140
+ "type": "object",
141
+ "properties": {
142
+ "top1AccuracyChange": {
143
+ "type": "number",
144
+ "description": "After minus before. Positive means improvement."
145
+ },
146
+ "manualCorrectionRateChange": {
147
+ "type": "number",
148
+ "description": "After minus before. Negative means improvement."
149
+ },
150
+ "averageJudgeScoreChange": {
151
+ "type": "number"
152
+ },
153
+ "validationFailureChange": {
154
+ "type": "integer"
155
+ },
156
+ "totalDurationMsChange": {
157
+ "type": "number"
158
+ },
159
+ "nativeSavingsChange": {
160
+ "type": "number"
161
+ },
162
+ "regressionDetected": {
163
+ "type": "boolean",
164
+ "description": "True if any metric crossed a threshold in the wrong direction."
165
+ },
166
+ "regressionDetails": {
167
+ "type": "array",
168
+ "items": {
169
+ "type": "object",
170
+ "properties": {
171
+ "metric": { "type": "string" },
172
+ "threshold": { "type": "number" },
173
+ "actual": { "type": "number" },
174
+ "direction": { "type": "string", "enum": ["increase", "decrease"] }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
package/.cursorrules CHANGED
@@ -1,7 +1,7 @@
1
1
  # AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
2
2
 
3
- Generated by Agentic-Senior-Core CLI v2.0.18
4
- Timestamp: 2026-04-15T00:04:29.752Z
3
+ Generated by Agentic-Senior-Core CLI v2.0.20
4
+ Timestamp: 2026-04-15T00:14:51.184Z
5
5
  Selected profile: beginner
6
6
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
7
7
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 08994f6e228b32d415dcc2024f31f0a076119a3cf87a4cd2fd2e78e86e5fbd3e
5
+ Canonical Snapshot SHA256: 2a2a036b4fb90f9e668163b83614f2339044c0d021a6eaf2f380e626dfe72de0
6
6
 
7
7
  Canonical policy source: [.instructions.md](../.instructions.md).
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 08994f6e228b32d415dcc2024f31f0a076119a3cf87a4cd2fd2e78e86e5fbd3e
5
+ Canonical Snapshot SHA256: 2a2a036b4fb90f9e668163b83614f2339044c0d021a6eaf2f380e626dfe72de0
6
6
 
7
7
  The canonical policy source for this repository is [.instructions.md](../.instructions.md).
8
8
 
package/.windsurfrules CHANGED
@@ -1,7 +1,7 @@
1
1
  # AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET
2
2
 
3
- Generated by Agentic-Senior-Core CLI v2.0.18
4
- Timestamp: 2026-04-15T00:04:29.752Z
3
+ Generated by Agentic-Senior-Core CLI v2.0.20
4
+ Timestamp: 2026-04-15T00:14:51.184Z
5
5
  Selected profile: beginner
6
6
  Selected policy file: .agent-context/policies/llm-judge-threshold.json
7
7
 
package/AGENTS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Adapter Mode: thin
4
4
  Adapter Source: .instructions.md
5
- Canonical Snapshot SHA256: 08994f6e228b32d415dcc2024f31f0a076119a3cf87a4cd2fd2e78e86e5fbd3e
5
+ Canonical Snapshot SHA256: 2a2a036b4fb90f9e668163b83614f2339044c0d021a6eaf2f380e626dfe72de0
6
6
 
7
7
  This file is an adapter entrypoint for agent discovery.
8
8
  The canonical policy source is [.instructions.md](.instructions.md).
package/README.md CHANGED
@@ -359,7 +359,7 @@ npx @ryuenn3123/agentic-senior-core upgrade --yes
359
359
  Our documentation has shifted into dedicated tracks to keep this README light:
360
360
  - **[FAQ / Concepts](docs/faq.md)**: Unfamiliar with Stacks, Blueprints, or Guardrails? Stalled on basic logic? Start here.
361
361
  - **[Deep Dive / Internals](docs/deep-dive.md)**: Explore the dynamic compiler, severity profiles, MCP integration, and granular LLM overrides here.
362
- - **[V2 Upgrade Playbook](docs/v2-upgrade-playbook.md)**: Benchmark-driven upgrade execution from antigravity-awesome-skills, awesome-copilot, and MiniMax skills.
362
+ - **[V2 Upgrade Playbook](docs/v2-upgrade-playbook.md)**: Benchmark-driven execution plus profile and preset guidance for common usage patterns.
363
363
  - **[Skill Platform](.agent-context/skills/README.md)**: Unified skill packs for frontend, backend, fullstack, CLI, distribution, and review quality with `advance` as the default tier.
364
364
  The skill platform is now folder-based, so each domain has its own README and topic docs like a curated skills library.
365
365
 
@@ -34,6 +34,13 @@ import { detectProjectContext, buildDetectionSummary, formatDetectionCandidates
34
34
  import { compileDynamicContext, writeSelectedPolicy, writeOnboardingReport } from '../compiler.mjs';
35
35
  import { runPreflightChecks } from '../preflight.mjs';
36
36
  import { createBackup } from '../backup.mjs';
37
+ import {
38
+ runProjectDiscovery,
39
+ generateProjectDocumentation,
40
+ isDirectoryEffectivelyEmpty,
41
+ hasExistingProjectDocs,
42
+ loadProjectConfig,
43
+ } from '../project-scaffolder.mjs';
37
44
  import { performRollback } from '../rollback.mjs';
38
45
  import {
39
46
  createTokenOptimizationState,
@@ -58,6 +65,9 @@ export function parseInitArguments(commandArguments) {
58
65
  tokenOptimize: true,
59
66
  tokenAgent: 'copilot',
60
67
  includeMcpTemplate: false,
68
+ scaffoldDocs: undefined,
69
+ docsLang: 'en',
70
+ projectConfig: undefined,
61
71
  };
62
72
 
63
73
  for (let argumentIndex = 0; argumentIndex < commandArguments.length; argumentIndex++) {
@@ -166,6 +176,38 @@ export function parseInitArguments(commandArguments) {
166
176
  continue;
167
177
  }
168
178
 
179
+ if (currentArgument === '--scaffold-docs') {
180
+ parsedInitOptions.scaffoldDocs = true;
181
+ continue;
182
+ }
183
+
184
+ if (currentArgument === '--no-scaffold-docs') {
185
+ parsedInitOptions.scaffoldDocs = false;
186
+ continue;
187
+ }
188
+
189
+ if (currentArgument === '--docs-lang') {
190
+ parsedInitOptions.docsLang = commandArguments[argumentIndex + 1] || 'en';
191
+ argumentIndex += 1;
192
+ continue;
193
+ }
194
+
195
+ if (currentArgument.startsWith('--docs-lang=')) {
196
+ parsedInitOptions.docsLang = currentArgument.split('=')[1] || 'en';
197
+ continue;
198
+ }
199
+
200
+ if (currentArgument === '--project-config') {
201
+ parsedInitOptions.projectConfig = commandArguments[argumentIndex + 1];
202
+ argumentIndex += 1;
203
+ continue;
204
+ }
205
+
206
+ if (currentArgument.startsWith('--project-config=')) {
207
+ parsedInitOptions.projectConfig = currentArgument.split('=')[1];
208
+ continue;
209
+ }
210
+
169
211
  throw new Error(`Unknown option: ${currentArgument}`);
170
212
  }
171
213
 
@@ -413,6 +455,46 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
413
455
  operationMode: 'init',
414
456
  });
415
457
 
458
+ // --- Project Documentation Scaffolding ---
459
+ let scaffoldingResult = null;
460
+ const shouldOfferScaffolding = initOptions.scaffoldDocs === true
461
+ || (initOptions.scaffoldDocs !== false && await isDirectoryEffectivelyEmpty(resolvedTargetDirectoryPath) && !(await hasExistingProjectDocs(resolvedTargetDirectoryPath)));
462
+
463
+ if (shouldOfferScaffolding) {
464
+ const userWantsScaffolding = initOptions.scaffoldDocs === true
465
+ || initOptions.projectConfig
466
+ || await askYesNo(
467
+ 'This is a fresh project. Want me to scaffold project documentation (architecture, database, API contract, flow)?',
468
+ userInterface,
469
+ true
470
+ );
471
+
472
+ if (userWantsScaffolding) {
473
+ let discoveryAnswers;
474
+
475
+ if (initOptions.projectConfig) {
476
+ discoveryAnswers = await loadProjectConfig(initOptions.projectConfig);
477
+ console.log(`\nLoaded project configuration from: ${initOptions.projectConfig}`);
478
+ } else {
479
+ discoveryAnswers = await runProjectDiscovery(userInterface);
480
+ }
481
+
482
+ scaffoldingResult = await generateProjectDocumentation(
483
+ resolvedTargetDirectoryPath,
484
+ discoveryAnswers,
485
+ {
486
+ stackFileName: selectedResolvedStackFileName,
487
+ blueprintFileName: selectedResolvedBlueprintFileName,
488
+ }
489
+ );
490
+
491
+ console.log(`\nProject documentation generated in docs/:`);
492
+ for (const generatedFileName of scaffoldingResult.generatedFileNames) {
493
+ console.log(` - docs/${generatedFileName}`);
494
+ }
495
+ }
496
+ }
497
+
416
498
  console.log('\nInitialization complete.');
417
499
  console.log(`- Target directory: ${resolvedTargetDirectoryPath}`);
418
500
  console.log(`- Profile: ${selectedProfile.displayName}`);
@@ -428,6 +510,9 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
428
510
  console.log(`- Blocking severities: ${formatBlockingSeverities(selectedProfile.blockingSeverities)}`);
429
511
  console.log(`- Setup time: ${formatDuration(setupDurationMs)}`);
430
512
  console.log('- Generated files: .cursorrules, .windsurfrules, and .agent-context/state/onboarding-report.json');
513
+ if (scaffoldingResult) {
514
+ console.log(`- Project docs: ${scaffoldingResult.generatedFileNames.length} files generated in docs/`);
515
+ }
431
516
  console.log(`- Repository workflows copied: no (workflows remain source-repo assets)`);
432
517
  console.log(`- MCP template file: ${shouldIncludeMcpTemplate ? 'created (.vscode/mcp.json)' : 'not created by default (use --mcp-template)'}`);
433
518
  if (isTokenOptimizationEnabled) {
@@ -437,6 +522,9 @@ export async function runInitCommand(targetDirectoryArgument, initOptions = {})
437
522
  }
438
523
  console.log('\nPlain-language summary:');
439
524
  console.log(`I prepared a ${selectedProfile.displayName.toLowerCase()} governance pack for a ${toTitleCase(selectedResolvedStackFileName)} project using the ${toTitleCase(selectedResolvedBlueprintFileName)} blueprint.`);
525
+ if (scaffoldingResult) {
526
+ console.log(`I also generated project documentation based on your project description. AI agents will use docs/ as project context.`);
527
+ }
440
528
  console.log('Your AI tools will now receive one compiled rulebook plus the original source rules, and your review threshold is stored in .agent-context/policies/llm-judge-threshold.json.');
441
529
  console.log('MCP server registration is manual inside your IDE settings, even when mcp.json exists.');
442
530
  } catch (error) {
@@ -236,6 +236,37 @@ export async function buildCompiledRulesContent({
236
236
  ].join('\n')
237
237
  );
238
238
 
239
+ const projectBriefPath = path.join(resolvedTargetDirectoryPath, 'docs', 'project-brief.md');
240
+ if (await pathExists(projectBriefPath)) {
241
+ const projectDocsEntries = ['project-brief.md'];
242
+ const candidateDocFileNames = [
243
+ 'architecture-decision-record.md',
244
+ 'database-schema.md',
245
+ 'api-contract.md',
246
+ 'flow-overview.md',
247
+ ];
248
+
249
+ for (const candidateFileName of candidateDocFileNames) {
250
+ const candidateFilePath = path.join(resolvedTargetDirectoryPath, 'docs', candidateFileName);
251
+ if (await pathExists(candidateFilePath)) {
252
+ projectDocsEntries.push(candidateFileName);
253
+ }
254
+ }
255
+
256
+ contextBlocks.push(
257
+ [
258
+ '## LAYER 9: PROJECT CONTEXT (MANDATORY)',
259
+ 'These documents describe the specific project being built.',
260
+ 'Read them before writing any application code:',
261
+ ...projectDocsEntries.map((docFileName, docIndex) => `${docIndex + 1}. docs/${docFileName}`),
262
+ '',
263
+ 'These docs were generated during project initialization and reflect the architecture,',
264
+ 'database design, API contracts, and application flows chosen for this project.',
265
+ 'Update them as the project evolves. They are living references, not frozen specs.',
266
+ ].join('\n')
267
+ );
268
+ }
269
+
239
270
  return [
240
271
  '# AGENTIC-SENIOR-CORE DYNAMIC GOVERNANCE RULESET',
241
272
  '',