@baseline-studio/cli 2.6.0 → 2.6.1
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/dist/commands/init.js +37 -23
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -102,30 +102,31 @@ async function init() {
|
|
|
102
102
|
}
|
|
103
103
|
// 5. Collect unique context file paths from manifests
|
|
104
104
|
const contextFiles = collectContextPaths(tmpDir);
|
|
105
|
-
// 6. Load
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
// 6. Load prompts
|
|
106
|
+
// init-prompts.yaml has the slim essential questions for onboarding
|
|
107
|
+
// context-prompts.yaml has the full question set (used for template titles)
|
|
108
|
+
const initPromptsPath = (0, path_1.join)(tmpDir, "init-prompts.yaml");
|
|
109
|
+
const fullPromptsPath = (0, path_1.join)(tmpDir, "context-prompts.yaml");
|
|
110
|
+
let initPrompts = {};
|
|
111
|
+
let fullPrompts = {};
|
|
112
|
+
if ((0, fs_1.existsSync)(initPromptsPath)) {
|
|
113
|
+
initPrompts = (0, js_yaml_1.load)((0, fs_1.readFileSync)(initPromptsPath, "utf-8"));
|
|
110
114
|
}
|
|
111
|
-
|
|
115
|
+
if ((0, fs_1.existsSync)(fullPromptsPath)) {
|
|
116
|
+
fullPrompts = (0, js_yaml_1.load)((0, fs_1.readFileSync)(fullPromptsPath, "utf-8"));
|
|
117
|
+
}
|
|
118
|
+
// 7. Ask essential questions (slim init)
|
|
112
119
|
console.log();
|
|
113
|
-
ui.info("Let's set up your context
|
|
120
|
+
ui.info("Let's set up your core context — the essential info that powers every skill.");
|
|
114
121
|
ui.skipHint();
|
|
115
|
-
|
|
116
|
-
const promptSections = contextFiles.filter((f) => prompts[f]);
|
|
122
|
+
const initSections = Object.keys(initPrompts);
|
|
117
123
|
let sectionIndex = 0;
|
|
118
|
-
for (const ctxFile of
|
|
119
|
-
const prompt =
|
|
120
|
-
if (!prompt)
|
|
121
|
-
// Create empty template for files without prompts
|
|
122
|
-
const fullPath = (0, path_1.join)(destDir, "context", ctxFile);
|
|
123
|
-
(0, fs_1.mkdirSync)((0, path_1.dirname)(fullPath), { recursive: true });
|
|
124
|
-
(0, fs_1.writeFileSync)(fullPath, `# ${ctxFile}\n\n<!-- Add your content here -->\n`);
|
|
124
|
+
for (const ctxFile of initSections) {
|
|
125
|
+
const prompt = initPrompts[ctxFile];
|
|
126
|
+
if (!prompt)
|
|
125
127
|
continue;
|
|
126
|
-
}
|
|
127
128
|
sectionIndex++;
|
|
128
|
-
ui.sectionHeader(prompt.title, sectionIndex,
|
|
129
|
+
ui.sectionHeader(prompt.title, sectionIndex, initSections.length);
|
|
129
130
|
const answers = [];
|
|
130
131
|
let answeredCount = 0;
|
|
131
132
|
// Pre-fill company name into identity file
|
|
@@ -151,7 +152,18 @@ async function init() {
|
|
|
151
152
|
}
|
|
152
153
|
ui.sectionComplete(prompt.title, answeredCount, prompt.questions.length);
|
|
153
154
|
}
|
|
154
|
-
// 8. Create context
|
|
155
|
+
// 8. Create empty templates for all remaining context files
|
|
156
|
+
for (const ctxFile of contextFiles) {
|
|
157
|
+
if (initPrompts[ctxFile])
|
|
158
|
+
continue; // Already handled above
|
|
159
|
+
const fullPath = (0, path_1.join)(destDir, "context", ctxFile);
|
|
160
|
+
if ((0, fs_1.existsSync)(fullPath))
|
|
161
|
+
continue; // Don't overwrite
|
|
162
|
+
(0, fs_1.mkdirSync)((0, path_1.dirname)(fullPath), { recursive: true });
|
|
163
|
+
const title = fullPrompts[ctxFile]?.title || ctxFile;
|
|
164
|
+
(0, fs_1.writeFileSync)(fullPath, `# ${title}\n\n<!-- Add your content here -->\n`);
|
|
165
|
+
}
|
|
166
|
+
// 9. Create context.yaml
|
|
155
167
|
const contextYaml = buildContextYaml(tmpDir, contextFiles);
|
|
156
168
|
(0, fs_1.writeFileSync)((0, path_1.join)(destDir, "context", "context.yaml"), contextYaml);
|
|
157
169
|
// 9. Create baseline.config.json
|
|
@@ -218,10 +230,12 @@ async function init() {
|
|
|
218
230
|
["Frameworks:", `${frameworkCount}`],
|
|
219
231
|
["Scripts:", `${scriptCount}`],
|
|
220
232
|
]);
|
|
221
|
-
ui.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
console.log(` ${ui.bold("Add more context to improve output quality:")}`);
|
|
234
|
+
console.log(` The more context you provide, the better every skill performs.`);
|
|
235
|
+
console.log(` Run ${ui.accent("npx baseline context")} to fill out any section.\n`);
|
|
236
|
+
console.log(` ${ui.dim("Priority:")} ${ui.accent("product")} ${ui.dim("→")} ${ui.accent("users")} ${ui.dim("→")} ${ui.accent("icp")} ${ui.dim("→")} ${ui.accent("competitive")}`);
|
|
237
|
+
console.log(` ${ui.dim("Also:")} ${ui.accent("pricing")} ${ui.dim("·")} ${ui.accent("technical")} ${ui.dim("·")} ${ui.accent("visual-identity")} ${ui.dim("·")} ${ui.accent("formatting")}`);
|
|
238
|
+
console.log();
|
|
225
239
|
}
|
|
226
240
|
/** Scan all skill manifests and return unique context file paths (relative to context/) */
|
|
227
241
|
function collectContextPaths(coreDir) {
|