You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add task preprocessing workflow and Confluence requirements documentation
- Add aicode-preprocess.yml: Converts one-liner tasks to structured user stories via OpenAI
- Add preprocess-task.mjs: Script for OpenAI task conversion
- Add confluence-requirements.yml: Publishes requirements to Confluence in parallel with code generation
- Update aicode-agent.yml: Use enhanced tasks from preprocessing workflow
- Workflow flow: aicode → preprocess → aicode-enhanced (triggers both agent and Confluence workflows)
console.error("[PREPROCESS] TASK environment variable not set");
16
+
process.exit(1);
17
+
}
18
+
19
+
if(!openaiApiKey){
20
+
console.warn("[PREPROCESS] OPENAI_API_KEY not set, skipping preprocessing");
21
+
console.log(`[PREPROCESS] Original task: ${task}`);
22
+
process.exit(0);
23
+
}
24
+
25
+
constopenai=newOpenAI({apiKey: openaiApiKey});
26
+
27
+
constsystemPrompt=`You are a task analysis assistant for a code generation system. Your job is to convert natural language task descriptions into structured user stories that are clearer and more actionable for AI code generation.
28
+
29
+
Convert the given task description into a structured user story format following this template:
30
+
31
+
"As a [role], I want to [action] so that [benefit].
32
+
33
+
Acceptance Criteria:
34
+
- [Criterion 1]
35
+
- [Criterion 2]
36
+
- [Criterion 3]"
37
+
38
+
Guidelines:
39
+
- Identify the user role (administrator, developer, end user, etc.)
40
+
- Extract the main action/feature requested
41
+
- Clarify the benefit or goal
42
+
- Break down the task into specific, testable acceptance criteria
43
+
- Maintain all technical context and requirements
44
+
- Keep it concise but comprehensive
45
+
- If the task is already well-structured, enhance it rather than completely rewriting
46
+
47
+
Output ONLY the user story, no explanations or markdown formatting.`;
48
+
49
+
constuserPrompt=`Convert this task description into a structured user story:
50
+
51
+
${task}`;
52
+
53
+
asyncfunctionpreprocessTask(){
54
+
try{
55
+
console.log(`[PREPROCESS] Converting task to user story using ${model}...`);
56
+
console.log(`[PREPROCESS] Original task: ${task}`);
-d "{\"text\":\"⚠️ Preprocessing failed, using original task\",\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"⚠️ *Preprocessing Warning*\\n\\nPreprocessing failed, but code generation will continue with original task.\"}}]}"
0 commit comments