@ryuenn3123/agentic-senior-core 3.0.6 → 3.0.8
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/bootstrap-design.md +38 -12
- package/.agent-context/prompts/init-project.md +3 -3
- package/.agent-context/prompts/refactor.md +1 -1
- package/.agent-context/prompts/review-code.md +1 -1
- package/.agent-context/review-checklists/pr-checklist.md +1 -1
- package/.agent-context/rules/architecture.md +1 -1
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.cursorrules +2 -2
- package/.gemini/instructions.md +1 -1
- package/.github/copilot-instructions.md +1 -1
- package/.windsurfrules +2 -2
- package/AGENTS.md +1 -1
- package/README.md +5 -5
- package/lib/cli/commands/init.mjs +97 -2
- package/lib/cli/commands/upgrade.mjs +98 -2
- package/lib/cli/compiler.mjs +6 -2
- package/lib/cli/detector.mjs +101 -0
- package/lib/cli/init-architecture-flow.mjs +2 -0
- package/lib/cli/project-scaffolder.mjs +240 -223
- package/package.json +1 -1
- package/scripts/validate.mjs +41 -4
package/lib/cli/detector.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Depends on: constants.mjs, utils.mjs
|
|
4
4
|
*/
|
|
5
5
|
import fs from 'node:fs/promises';
|
|
6
|
+
import path from 'node:path';
|
|
6
7
|
|
|
7
8
|
import { BLUEPRINT_RECOMMENDATIONS } from './constants.mjs';
|
|
8
9
|
import { toTitleCase } from './utils.mjs';
|
|
@@ -22,6 +23,106 @@ export async function collectProjectMarkers(targetDirectoryPath) {
|
|
|
22
23
|
return markerNames;
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
async function readPackageJsonIfExists(targetDirectoryPath) {
|
|
27
|
+
const packageJsonPath = path.join(targetDirectoryPath, 'package.json');
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const packageJsonContent = await fs.readFile(packageJsonPath, 'utf8');
|
|
31
|
+
return JSON.parse(packageJsonContent);
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function detectUiScopeSignals({
|
|
38
|
+
targetDirectoryPath,
|
|
39
|
+
selectedStackFileName,
|
|
40
|
+
selectedBlueprintFileName,
|
|
41
|
+
packageManifest = null,
|
|
42
|
+
projectScopeKey = null,
|
|
43
|
+
projectScopeSourceLabel = 'project scope',
|
|
44
|
+
}) {
|
|
45
|
+
const signalReasons = [];
|
|
46
|
+
const markerNames = await collectProjectMarkers(targetDirectoryPath);
|
|
47
|
+
const resolvedPackageManifest = packageManifest || await readPackageJsonIfExists(targetDirectoryPath);
|
|
48
|
+
|
|
49
|
+
const normalizedProjectScopeKey = String(projectScopeKey || '').trim().toLowerCase();
|
|
50
|
+
if (normalizedProjectScopeKey === 'frontend-only' || normalizedProjectScopeKey === 'both') {
|
|
51
|
+
signalReasons.push(`${projectScopeSourceLabel}: ${normalizedProjectScopeKey}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const selectedStackKey = String(selectedStackFileName || '').trim().toLowerCase();
|
|
55
|
+
if (selectedStackKey === 'react-native.md' || selectedStackKey === 'flutter.md') {
|
|
56
|
+
signalReasons.push(`selected stack implies UI runtime: ${selectedStackKey}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const selectedBlueprintKey = String(selectedBlueprintFileName || '').trim().toLowerCase();
|
|
60
|
+
if (selectedBlueprintKey.includes('frontend') || selectedBlueprintKey.includes('landing') || selectedBlueprintKey.includes('mobile-app')) {
|
|
61
|
+
signalReasons.push(`selected blueprint implies UI scope: ${selectedBlueprintKey}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const directUiMarkerNames = [
|
|
65
|
+
'next.config.js',
|
|
66
|
+
'next.config.mjs',
|
|
67
|
+
'next.config.ts',
|
|
68
|
+
'tailwind.config.js',
|
|
69
|
+
'tailwind.config.mjs',
|
|
70
|
+
'tailwind.config.ts',
|
|
71
|
+
'vite.config.js',
|
|
72
|
+
'vite.config.mjs',
|
|
73
|
+
'vite.config.ts',
|
|
74
|
+
'react-native.config.js',
|
|
75
|
+
'app',
|
|
76
|
+
'pages',
|
|
77
|
+
'components',
|
|
78
|
+
'public',
|
|
79
|
+
'styles',
|
|
80
|
+
'android',
|
|
81
|
+
'ios',
|
|
82
|
+
'index.html',
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const detectedUiMarkers = directUiMarkerNames.filter((markerName) => markerNames.has(markerName));
|
|
86
|
+
if (detectedUiMarkers.length > 0) {
|
|
87
|
+
signalReasons.push(`ui markers: ${detectedUiMarkers.join(', ')}`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const dependencySource = {
|
|
91
|
+
...(resolvedPackageManifest?.dependencies || {}),
|
|
92
|
+
...(resolvedPackageManifest?.devDependencies || {}),
|
|
93
|
+
};
|
|
94
|
+
const detectableUiDependencies = [
|
|
95
|
+
'next',
|
|
96
|
+
'react',
|
|
97
|
+
'react-dom',
|
|
98
|
+
'react-native',
|
|
99
|
+
'expo',
|
|
100
|
+
'tailwindcss',
|
|
101
|
+
];
|
|
102
|
+
const detectedUiDependencies = detectableUiDependencies.filter((dependencyName) => dependencySource[dependencyName]);
|
|
103
|
+
if (detectedUiDependencies.length > 0) {
|
|
104
|
+
signalReasons.push(`ui dependencies: ${detectedUiDependencies.join(', ')}`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const hasStrongUiMarker = detectedUiMarkers.some((markerName) => (
|
|
108
|
+
markerName.startsWith('next.config')
|
|
109
|
+
|| markerName === 'react-native.config.js'
|
|
110
|
+
|| markerName === 'android'
|
|
111
|
+
|| markerName === 'ios'
|
|
112
|
+
));
|
|
113
|
+
const hasUiDependencies = detectedUiDependencies.length > 0;
|
|
114
|
+
const hasStructuralUiMarkers = detectedUiMarkers.length >= 2;
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
isUiScopeLikely: signalReasons.length > 0
|
|
118
|
+
&& (hasStrongUiMarker || hasUiDependencies || hasStructuralUiMarkers || normalizedProjectScopeKey.length > 0),
|
|
119
|
+
signalReasons,
|
|
120
|
+
detectedUiMarkers,
|
|
121
|
+
detectedUiDependencies,
|
|
122
|
+
packageManifest: resolvedPackageManifest,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
25
126
|
export async function detectProjectContext(targetDirectoryPath) {
|
|
26
127
|
const markerNames = await collectProjectMarkers(targetDirectoryPath);
|
|
27
128
|
const detectionCandidates = [];
|
|
@@ -62,6 +62,7 @@ export async function resolveArchitectureSelection({
|
|
|
62
62
|
selectedProjectScopeLabel,
|
|
63
63
|
selectedManualStackFileName,
|
|
64
64
|
selectedManualBlueprintFileName,
|
|
65
|
+
architectureProjectDescription: '',
|
|
65
66
|
architectureRecommendation,
|
|
66
67
|
architectPreferenceState: nextArchitectPreferenceState,
|
|
67
68
|
architectPreferenceUpdated,
|
|
@@ -224,6 +225,7 @@ export async function resolveArchitectureSelection({
|
|
|
224
225
|
selectedProjectScopeLabel,
|
|
225
226
|
selectedManualStackFileName,
|
|
226
227
|
selectedManualBlueprintFileName,
|
|
228
|
+
architectureProjectDescription,
|
|
227
229
|
architectureRecommendation,
|
|
228
230
|
architectPreferenceState: nextArchitectPreferenceState,
|
|
229
231
|
architectPreferenceUpdated,
|