Fixed ticket refining labels
All checks were successful
Publish Library / Build NPM Project (push) Successful in 5s
Publish Library / Tag Version (push) Successful in 4s

This commit is contained in:
2025-12-30 19:22:23 -05:00
parent c7f8ffb32a
commit 91d22b8b16
2 changed files with 33 additions and 25 deletions

View File

@@ -2,7 +2,7 @@ name: Ticket refinement
on:
issues:
types: [opened, labeled]
types: [labeled]
jobs:
format:
runs-on: ubuntu-latest

View File

@@ -52,7 +52,7 @@ what's happening now or the current state/gap
What should happen instead
## Steps to Reproduce
## Steps to Reproduce / Desired Flow
1. First step
2. Second step
@@ -98,27 +98,36 @@ Implementation details, constraints, dependencies, design decisions
args: {type: {type: 'string', description: 'Ticket type', enum: ['Bug', 'DevOps', 'Document', 'Enhancement', 'Refactor', 'Security'], required: true}},
fn: (args) => type = args.type
}],
system: `You are a ticket formatter. Transform raw issue descriptions into structured tickets.
system: `Transform raw tickets into structured markdown following the template EXACTLY.
**CRITICAL RULES:**
1. Identify the ticket type (Bug, DevOps, Enhancement, Refactor, Security)
2. Output MUST only contain the new ticket information in markdown, no extra fluff
3. Follow the template structure EXACTLY:
- You must call the \`title\` tool EXACTLY ONCE with the title matching this format: [Module] - [Verb] [noun]
Example: Storage - Fix file uploads
- You must call the \`type\` tool EXACTLY ONCE with the identified ticket type
- Write a clear description
- For bugs: fill Steps to Reproduce with numbered list
- For enhancements/refactors: REMOVE the Steps to Reproduce section entirely
- For documentation: REMOVE the Current Behavior, Expected Behavior and Steps to Reproduce sections entirely
- Acceptance Criteria: convert requirements into checkboxes (- [ ])
- Weight scoring (0-5 each):
* Size: Number of modules, layers & files affected by change
* Complexity: Technical difficulty to implement
* Unknowns: Research/uncertainty in work estimation
* Calculate Total as sum of the three
- Remove sections that are not applicable based on ticket type
- Use proper markdown headers (##)
**MANDATORY STEPS:**
1. Identify ticket type: Bug, DevOps, Document, Enhancement, Refactor, or Security
2. Call \`type\` tool EXACTLY ONCE with the type from step 1
3. Call \`title\` tool EXACTLY ONCE in format: "[Module] - [Verb] [subject]"
4. Output formatted markdown matching template structure below
**TEMPLATE RULES:**
- Use ## headers (match template exactly)
- Description: Clear summary of the request
- Current Behavior: What's happening now (remove for Document tickets)
- Expected Behavior: What should happen (remove for Document tickets)
- Steps to Reproduce: Numbered list for bugs, flow for enhancements, remove if not applicable
- Additional Context: Logs, screenshots, links provided by user
- Acceptance Criteria: Convert to checkboxes (- [ ] format)
- Technical Notes: Implementation approach, constraints, dependencies
- Weight table (use exact format below):
| Effort / Weight | Score |
|-----------------|----------|
| Size | 0-5 |
| Complexity | 0-5 |
| Unknowns | 0-5 |
| **Total** | **0-15** |
**SCORING:**
- Size: # of modules/layers/files changed
- Complexity: Technical difficulty
- Unknowns: Research/uncertainty needed
**README:**
\`\`\`markdown
@@ -130,8 +139,7 @@ ${readme.trim() || 'No README available'}
${template.trim()}
\`\`\`
Output ONLY the formatted ticket, no explanation.`
});
Output ONLY markdown. No explanations, labels, or extra formatting.`});
const messages = await ai.language.ask(`Title: ${issueData.title}\n\nDescription:\n${issueData.body || 'No description provided'}`).catch(() => []);
const body = messages?.pop()?.content;
@@ -160,5 +168,5 @@ Output ONLY the formatted ticket, no explanation.`
body: `["Kind/${type[0].toUpperCase() + type.slice(1).toLowerCase()}"]`
})
console.log(body);
console.log(`Title: ${title}\nType: ${type}\nBody:\n${body}`);
})();