safepropel 1.4.1 → 1.4.2
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/engine/workflow-executor.js +17 -8
- package/package.json +1 -1
|
@@ -209,12 +209,15 @@ class WorkflowExecutor {
|
|
|
209
209
|
const workflow = this.runtime.get(promptPath);
|
|
210
210
|
|
|
211
211
|
// Extract template reference ONLY from Output section to avoid loading multiple templates
|
|
212
|
-
// Look for
|
|
212
|
+
// Look for various patterns:
|
|
213
|
+
// - "Generate the output using the `.propel/templates/xxx-template.md` template"
|
|
214
|
+
// - "generate ... using `.propel/templates/xxx-template.md` template"
|
|
215
|
+
// - "using `.propel/templates/requirements-template.md` template"
|
|
213
216
|
const outputSectionMatch = workflow.content.match(/## Output[\s\S]*?(?=##|$)/);
|
|
214
217
|
const outputSection = outputSectionMatch ? outputSectionMatch[0] : workflow.content;
|
|
215
218
|
|
|
216
|
-
// Extract template reference from output section
|
|
217
|
-
const templateMatch = outputSection.match(/
|
|
219
|
+
// Extract template reference from output section - flexible pattern
|
|
220
|
+
const templateMatch = outputSection.match(/using\s+`(\.propel\/templates\/[a-z-]+\.md)`\s+template/i);
|
|
218
221
|
const templates = [];
|
|
219
222
|
|
|
220
223
|
if (templateMatch) {
|
|
@@ -348,8 +351,13 @@ class WorkflowExecutor {
|
|
|
348
351
|
|
|
349
352
|
prompt += `\n⚠️ CRITICAL TEMPLATE ENFORCEMENT for ${template.path}:\n`;
|
|
350
353
|
prompt += `\n1. DOCUMENT TITLE:\n`;
|
|
351
|
-
prompt += ` ✅ MUST be
|
|
352
|
-
prompt += `
|
|
354
|
+
prompt += ` ✅ MUST be EXACTLY: "${title}"\n`;
|
|
355
|
+
prompt += ` ✅ Use NO project name, NO prefixes, NO suffixes, NO modifications\n`;
|
|
356
|
+
prompt += ` ❌ WRONG: "# Project Name - ${title}"\n`;
|
|
357
|
+
prompt += ` ❌ WRONG: "# ${title} - Project Name"\n`;
|
|
358
|
+
prompt += ` ❌ WRONG: "# ${title} for Project"\n`;
|
|
359
|
+
prompt += ` ✅ CORRECT: "# ${title}"\n`;
|
|
360
|
+
prompt += ` ⚠️ CRITICAL: The title "${title}" is the COMPLETE title - add NOTHING to it\n`;
|
|
353
361
|
|
|
354
362
|
prompt += `\n2. REQUIRED SECTIONS (EXACT order and names):\n`;
|
|
355
363
|
sectionList.forEach((section, idx) => {
|
|
@@ -386,14 +394,15 @@ class WorkflowExecutor {
|
|
|
386
394
|
|
|
387
395
|
prompt += `\n6. MANDATORY ACTIONS:\n`;
|
|
388
396
|
prompt += ` ✅ Use section names VERBATIM from list in step 2\n`;
|
|
397
|
+
prompt += ` ✅ Use document title VERBATIM from step 1 (no modifications)\n`;
|
|
389
398
|
prompt += ` ✅ Fill bracketed placeholders [like this] with actual content\n`;
|
|
390
399
|
prompt += ` ✅ Maintain exact heading levels (# ## ### ####)\n`;
|
|
391
400
|
prompt += ` ✅ Include ONLY sections from template\n`;
|
|
392
401
|
prompt += ` ✅ Skip [CONDITIONAL] sections if not applicable\n`;
|
|
393
402
|
prompt += ` ✅ Follow requirement format patterns exactly\n`;
|
|
394
|
-
prompt += ` ⚠️ CRITICAL:
|
|
395
|
-
prompt += ` ⚠️ CRITICAL:
|
|
396
|
-
prompt += ` ⚠️ CRITICAL:
|
|
403
|
+
prompt += ` ⚠️ CRITICAL: Template structure is MANDATORY - no additions, no changes\n`;
|
|
404
|
+
prompt += ` ⚠️ CRITICAL: Section names and order are FIXED - use them exactly\n`;
|
|
405
|
+
prompt += ` ⚠️ CRITICAL: Document title is COMPLETE - do not prepend project name\n`;
|
|
397
406
|
|
|
398
407
|
prompt += `\n7. TEMPLATE TYPE VALIDATION:\n`;
|
|
399
408
|
prompt += ` 🔍 This is a "${title}" - NOT a requirements document\n`;
|
package/package.json
CHANGED