|
|
@@ -47,9 +47,56 @@ export class ClaudeClient {
|
|
|
? `\n=== PROJECT MEMORY (CLAUDE.md) ===\n\nThe following is the project memory file that contains important context about this repository.\nYou MUST read and understand this information as it contains project-specific guidelines, architecture details, and development patterns.\n\n${memoryContent}\n\n`
|
|
|
: '';
|
|
|
|
|
|
+ // Parse labels if provided
|
|
|
+ const labels = issue.labels ? issue.labels.split(',').filter(l => l.trim()) : [];
|
|
|
+ const hasQuestionLabel = labels.includes('question');
|
|
|
+ const hasDocumentationLabel = labels.includes('documentation');
|
|
|
+ const hasBugLabel = labels.includes('bug');
|
|
|
+ const hasEnhancementLabel = labels.includes('enhancement');
|
|
|
+
|
|
|
+ // Build label-specific instructions
|
|
|
+ let labelInstructions = '';
|
|
|
+ if (labels.length > 0) {
|
|
|
+ labelInstructions = `\n=== ISSUE LABELS AND BEHAVIOR ===\n\n`;
|
|
|
+ labelInstructions += `This issue has the following labels: ${labels.join(', ')}\n\n`;
|
|
|
+
|
|
|
+ if (hasQuestionLabel) {
|
|
|
+ labelInstructions += `⚠️ QUESTION LABEL DETECTED:\n`;
|
|
|
+ labelInstructions += `- This issue is labeled as "question"\n`;
|
|
|
+ labelInstructions += `- DO NOT implement any code changes or features\n`;
|
|
|
+ labelInstructions += `- Your role is to provide information, guidance, and answers only\n`;
|
|
|
+ labelInstructions += `- You may read code to understand context, but do not modify files\n`;
|
|
|
+ labelInstructions += `- Respond with helpful explanations, suggestions, or clarifications\n\n`;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (hasDocumentationLabel) {
|
|
|
+ labelInstructions += `📚 DOCUMENTATION LABEL DETECTED:\n`;
|
|
|
+ labelInstructions += `- This issue is about documentation\n`;
|
|
|
+ labelInstructions += `- Focus on creating, updating, or improving documentation files\n`;
|
|
|
+ labelInstructions += `- Acceptable changes: README.md, CLAUDE.md, other .md files, code comments\n`;
|
|
|
+ labelInstructions += `- Avoid implementation changes unless specifically requested for documentation examples\n\n`;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (hasBugLabel) {
|
|
|
+ labelInstructions += `🐛 BUG LABEL DETECTED:\n`;
|
|
|
+ labelInstructions += `- This issue reports a bug or defect\n`;
|
|
|
+ labelInstructions += `- Focus on identifying and fixing the root cause\n`;
|
|
|
+ labelInstructions += `- Implement minimal changes necessary to resolve the bug\n`;
|
|
|
+ labelInstructions += `- Add tests if appropriate to prevent regression\n\n`;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (hasEnhancementLabel) {
|
|
|
+ labelInstructions += `✨ ENHANCEMENT LABEL DETECTED:\n`;
|
|
|
+ labelInstructions += `- This issue requests a new feature or improvement\n`;
|
|
|
+ labelInstructions += `- You may implement code changes as requested\n`;
|
|
|
+ labelInstructions += `- Follow existing code patterns and architecture\n`;
|
|
|
+ labelInstructions += `- Consider backward compatibility\n\n`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return `IMPORTANT: Issue #${issue.number} was assigned in repository ${issue.owner}/${issue.repo}.
|
|
|
${memorySection}
|
|
|
-
|
|
|
+${labelInstructions}
|
|
|
|
|
|
=== MANDATORY FIRST STEPS - READ ALL MESSAGES ===
|
|
|
|