@eldrforge/ai-service 0.1.1 → 0.1.3

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.
Files changed (46) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/src/ai.d.ts +55 -0
  4. package/{src/index.ts → dist/src/index.d.ts} +1 -2
  5. package/dist/src/interactive.d.ts +122 -0
  6. package/dist/src/logger.d.ts +19 -0
  7. package/dist/src/prompts/commit.d.ts +29 -0
  8. package/dist/src/prompts/index.d.ts +10 -0
  9. package/dist/src/prompts/release.d.ts +25 -0
  10. package/dist/src/prompts/review.d.ts +21 -0
  11. package/dist/src/types.d.ts +99 -0
  12. package/package.json +11 -8
  13. package/.github/dependabot.yml +0 -12
  14. package/.github/workflows/npm-publish.yml +0 -48
  15. package/.github/workflows/test.yml +0 -33
  16. package/eslint.config.mjs +0 -84
  17. package/src/ai.ts +0 -421
  18. package/src/interactive.ts +0 -562
  19. package/src/logger.ts +0 -69
  20. package/src/prompts/commit.ts +0 -85
  21. package/src/prompts/index.ts +0 -28
  22. package/src/prompts/instructions/commit.md +0 -133
  23. package/src/prompts/instructions/release.md +0 -188
  24. package/src/prompts/instructions/review.md +0 -169
  25. package/src/prompts/personas/releaser.md +0 -24
  26. package/src/prompts/personas/you.md +0 -55
  27. package/src/prompts/release.ts +0 -118
  28. package/src/prompts/review.ts +0 -72
  29. package/src/types.ts +0 -112
  30. package/tests/ai-complete-coverage.test.ts +0 -241
  31. package/tests/ai-create-completion.test.ts +0 -288
  32. package/tests/ai-edge-cases.test.ts +0 -221
  33. package/tests/ai-openai-error.test.ts +0 -35
  34. package/tests/ai-transcribe.test.ts +0 -169
  35. package/tests/ai.test.ts +0 -139
  36. package/tests/interactive-editor.test.ts +0 -253
  37. package/tests/interactive-secure-temp.test.ts +0 -264
  38. package/tests/interactive-user-choice.test.ts +0 -173
  39. package/tests/interactive-user-text.test.ts +0 -174
  40. package/tests/interactive.test.ts +0 -94
  41. package/tests/logger-noop.test.ts +0 -40
  42. package/tests/logger.test.ts +0 -122
  43. package/tests/prompts.test.ts +0 -179
  44. package/tsconfig.json +0 -35
  45. package/vite.config.ts +0 -69
  46. package/vitest.config.ts +0 -25
@@ -1,85 +0,0 @@
1
- import { Prompt, recipe } from '@riotprompt/riotprompt';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- // Types for the commit prompt
9
- export type CommitContent = {
10
- diffContent: string;
11
- userDirection?: string;
12
- isFileContent?: boolean; // Flag to indicate if diffContent is actually file content
13
- githubIssuesContext?: string; // GitHub issues related to current version/milestone
14
- };
15
-
16
- export type CommitContext = {
17
- logContext?: string;
18
- context?: string;
19
- directories?: string[];
20
- };
21
-
22
- export type CommitConfig = {
23
- overridePaths?: string[];
24
- overrides?: boolean;
25
- }
26
-
27
- /**
28
- * Build a commit prompt using RiotPrompt Recipes.
29
- *
30
- * This prompt is configured to generate multiline commit messages by default,
31
- * with separate lines/bullet points for different groups of changes rather
32
- * than squeezing everything into single lines.
33
- *
34
- * @param config The configuration for overrides
35
- * @param content Mandatory content inputs (e.g. diff)
36
- * @param ctx Optional contextual inputs configured by the user
37
- */
38
- export const createCommitPrompt = async (
39
- { overridePaths: _overridePaths, overrides: _overrides }: CommitConfig,
40
- { diffContent, userDirection, isFileContent, githubIssuesContext }: CommitContent,
41
- { logContext, context, directories }: CommitContext = {}
42
- ): Promise<Prompt> => {
43
- const basePath = __dirname;
44
-
45
- // Build content items for the prompt
46
- const contentItems = [];
47
- const contextItems = [];
48
-
49
- // Developer Note: Direction is injected first as the highest-priority prompt input
50
- // This ensures user guidance takes precedence over other context sources like
51
- // GitHub issues or commit history.
52
- if (userDirection) {
53
- contentItems.push({ content: userDirection, title: 'User Direction' });
54
- }
55
- if (diffContent) {
56
- const contentTitle = isFileContent ? 'Project Files' : 'Diff';
57
- contentItems.push({ content: diffContent, title: contentTitle });
58
- }
59
- if (githubIssuesContext) {
60
- contentItems.push({ content: githubIssuesContext, title: 'Recent GitHub Issues' });
61
- }
62
-
63
- // IMPORTANT: Log context provides background but can contaminate output if too large.
64
- // LLMs tend to pattern-match against recent commits instead of describing the actual diff.
65
- // Keep messageLimit low (3-5) to minimize contamination.
66
- if (logContext) {
67
- contextItems.push({ content: logContext, title: 'Log Context' });
68
- }
69
- if (context) {
70
- contextItems.push({ content: context, title: 'User Context' });
71
- }
72
- if (directories && directories.length > 0) {
73
- contextItems.push({ directories, title: 'Directories' });
74
- }
75
-
76
- return recipe(basePath)
77
- .persona({ path: 'personas/you.md' })
78
- .instructions({ path: 'instructions/commit.md' })
79
- .overridePaths(_overridePaths ?? [])
80
- .overrides(_overrides ?? true)
81
- .content(...contentItems)
82
- .context(...contextItems)
83
- .cook();
84
- };
85
-
@@ -1,28 +0,0 @@
1
- /**
2
- * Structured prompt builders for AI content generation
3
- */
4
-
5
- export * from './commit';
6
- export * from './release';
7
- export * from './review';
8
-
9
- // Re-export types for convenience
10
- export type {
11
- CommitContent,
12
- CommitContext,
13
- CommitConfig,
14
- } from './commit';
15
-
16
- export type {
17
- ReleaseContent,
18
- ReleaseContext,
19
- ReleaseConfig,
20
- ReleasePromptResult,
21
- } from './release';
22
-
23
- export type {
24
- ReviewContent,
25
- ReviewContext,
26
- ReviewConfig,
27
- } from './review';
28
-
@@ -1,133 +0,0 @@
1
- **🔧 Task Definition**
2
-
3
- You are generating a Git commit message that describes **ONLY THE CURRENT DIFF**.
4
-
5
- ---
6
-
7
- ## ⚠️ CRITICAL RULES - READ FIRST
8
-
9
- 1. **THE DIFF IS YOUR ONLY SOURCE OF TRUTH** - Your commit message must describe ONLY what appears in the `[Diff]` section
10
- 2. **IGNORE LOG CONTEXT** - Previous commits are shown for background only. DO NOT describe them, reference them, or let them influence your message
11
- 3. **CITE SPECIFIC FILES** - Every change you mention must reference actual files from the diff (e.g., "Remove post-publish sync logic in src/commands/publish.ts")
12
- 4. **NO HALLUCINATIONS** - If you mention a change, it MUST exist in the diff. Describing changes not in the diff is a critical failure
13
- 5. **LENGTH FOLLOWS SCOPE** - Typical commits are 3-6 lines. Very large architectural changes may warrant essay-length messages, but every line must still describe actual changes from the diff
14
-
15
- ---
16
-
17
- ## 📋 Input Sections
18
-
19
- * **\[User Direction]** — When present, use this to understand the user's INTENT, but your commit message must still accurately describe what's in the diff
20
- * **\[User Context]** — Optional background about the user's environment
21
- * **\[Diff]** — **THE ONLY SOURCE OF TRUTH** - This shows exactly what changed. Describe ONLY these changes
22
- * **\[Project Files]** — Only present for new repositories with no diff
23
- * **\[Recent GitHub Issues]** — Optional context for understanding motivation. Only reference issues if the diff clearly addresses them
24
- * **\[Log Context]** — **IGNORE THIS** - Previous commit messages shown for background only. DO NOT describe previous commits or copy their language
25
-
26
- ---
27
-
28
- ## 🧠 COMMIT MESSAGE GUIDELINES
29
-
30
- ### ✅ DO:
31
-
32
- * **Ground every statement in the diff** - Mention specific files that changed (e.g., "Add retry logic to src/api/client.ts")
33
- * **Start with clear intent** - One line explaining the overall purpose
34
- * **Use bullet points** - Separate distinct changes into individual bullets
35
- * **Be specific** - "Remove 68 lines of post-publish sync code" not "Refactor publish flow"
36
- * **Match length to scope** - Most commits are 3-6 lines. Massive architectural changes can warrant longer, detailed messages when the scope justifies it
37
- * **Use technical language** - Direct, precise, no fluff
38
-
39
- ### ❌ DO NOT:
40
-
41
- * ❌ **NEVER describe changes not in the diff** - This is the #1 failure mode
42
- * ❌ **NEVER reference log context** - Don't describe "this continues previous work" or similar
43
- * ❌ **NEVER use vague language** - "Improve", "refactor", "enhance" without specifics
44
- * ❌ **NEVER write multi-paragraph essays** - Keep it concise
45
- * ❌ **NEVER mention test changes unless they're significant** - Focus on production code
46
- * ❌ **NEVER use markdown** - Plain text only
47
- * ❌ **NEVER begin with "This commit..."** - Just describe what changed
48
-
49
- ---
50
-
51
- ## 📝 OUTPUT FORMATS & EXAMPLES
52
-
53
- ### ✅ GOOD: Concise with file citations (3-6 lines)
54
-
55
- > Remove post-publish branch sync and version bump automation
56
- >
57
- > * Delete 68 lines of merge/version-bump code from src/commands/publish.ts (lines 1039-1106)
58
- > * Replace with simple completion message and manual next-steps guidance
59
- > * Add verbose logging to git tag search in src/util/git.ts for debugging
60
-
61
- **Why this is good:** Specific files, line counts, describes what actually changed
62
-
63
- ---
64
-
65
- ### ✅ GOOD: Single atomic change (1 line)
66
-
67
- > Fix typo in error message for invalid credentials in src/auth/validator.ts
68
-
69
- **Why this is good:** One file, one change, specific
70
-
71
- ---
72
-
73
- ### ✅ GOOD: Multiple related changes (4-7 lines)
74
-
75
- > Add retry logic for API timeout errors
76
- >
77
- > * Implement exponential backoff in src/api/client.ts
78
- > * Add max retry configuration to src/config/api.ts
79
- > * Update error handling in src/api/error-handler.ts to detect retryable errors
80
- > * Add retry tests in tests/api/client.test.ts
81
-
82
- **Why this is good:** Grounded in actual files, specific changes, concise
83
-
84
- ---
85
-
86
- ### ❌ BAD: Hallucinated changes (DO NOT DO THIS)
87
-
88
- > Centralize ref-detection and streamline publish flow
89
- >
90
- > * Move to single ref-detection approach and stop passing from/to into Log.create()
91
- > * Replace ad-hoc fromRef/toRef handling in src/commands/release.ts
92
- > * Scale diff context: DEFAULT_MAX_DIFF_BYTES now 20480
93
- > * Update tests to mock new git boundary
94
- > * Update docs/public/commands/publish.md
95
-
96
- **Why this is terrible:** These changes aren't in the diff! The LLM is describing previous commits from log context instead of the actual diff. This is the #1 failure mode to avoid.
97
-
98
- ---
99
-
100
- ### ❌ BAD: Verbose multi-paragraph essay (DO NOT DO THIS)
101
-
102
- > Reorganize pipeline logic to improve readability and make phase execution more testable. This is part of ongoing work to modularize transition handling.
103
- >
104
- > The main change separates phase node execution into its own module, reduces reliance on shared state, and simplifies test construction. Existing functionality remains unchanged, but internal structure is now better aligned with future transition plugin support.
105
- >
106
- > This commit represents a significant cleanup of the execution flow and provides a safer foundation for future operations.
107
- >
108
- > * Extract executePhaseNode() from pipeline.ts
109
- > * Add phase-runner.ts with dedicated error handling
110
- > ...
111
-
112
- **Why this is terrible:** Way too verbose (could be 3 lines), fluffy language, unnecessary context paragraphs
113
-
114
- ---
115
-
116
- ### ❌ BAD: Vague without file citations (DO NOT DO THIS)
117
-
118
- > Improve error handling and refactor configuration logic
119
-
120
- **Why this is terrible:** No specific files, vague verbs like "improve" and "refactor", no details
121
-
122
- ---
123
-
124
- ## 🎯 Length Guidelines
125
-
126
- * **Single change:** 1 line
127
- * **Typical commit:** 3-6 lines (summary + 2-5 bullets)
128
- * **Large commit:** 6-15 lines
129
- * **Major architectural change:** Essay-length if warranted (rare but valid)
130
-
131
- **There is no hard upper limit.** The constraint is not length - it's **accuracy**. Every line must describe actual changes from the diff.
132
-
133
- Write as much as you need to accurately describe the changes, but no more. A 50-line commit message is fine if the diff touches 30 files and restructures core systems. A 6-line commit message that describes changes not in the diff is a critical failure, regardless of its brevity.
@@ -1,188 +0,0 @@
1
- ## ⚠️ CRITICAL RULES - READ FIRST
2
-
3
- 1. **LOG MESSAGES ARE YOUR SOURCE OF TRUTH** - Every change you describe must come from actual commit messages in the `[Log Context]` section or issues in `[Resolved Issues from Milestone]`
4
- 2. **NO HALLUCINATIONS** - Do not invent features, fixes, or changes that aren't explicitly mentioned in the log messages or milestone issues
5
- 3. **CITE ACTUAL COMMITS** - When describing changes, refer to what's in the actual commit messages, not what you think should be there
6
- 4. **USE RELEASE FOCUS FOR FRAMING** - The `[Release Focus]` guides how you frame and emphasize changes, but doesn't add new changes not in the logs
7
- 5. **LENGTH FOLLOWS SCOPE** - Small releases get concise notes. Large releases deserve comprehensive documentation. Match the actual scope of changes in the log
8
-
9
- ---
10
-
11
- ## Your Task
12
-
13
- Write release notes by reading all commit messages in `[Log Context]` and milestone issues in `[Resolved Issues from Milestone]`. Every change you mention must be traceable to an actual commit message or resolved issue.
14
-
15
- ### Output Format
16
-
17
- Your response MUST be a valid JSON object with the following structure:
18
- {
19
- "title": "A single-line, concise title for the release.",
20
- "body": "The detailed release notes in Markdown format."
21
- }
22
-
23
- **Instructions for the `title` field:**
24
- - It must be a single line and should be concise and readable (aim for under 80 characters).
25
- - It should capture the most significant, substantive changes in the release.
26
- - Focus on what is noticeable to developers using the software.
27
- - Use natural, conversational language that a human would write, not marketing-speak.
28
- - AVOID mentioning trivial changes like "improving formatting," "updating dependencies," or "refactoring code."
29
-
30
- **Instructions for the `body` field:**
31
- - This should be the full release notes in Markdown format.
32
- - Follow the detailed instructions below for structuring and writing the release notes.
33
- - **For large releases**: Be comprehensive and detailed. Users deserve thorough documentation when there are many changes.
34
-
35
- ### Output Restrictions
36
-
37
- - Do not mention and people or contributors in the release notes. For example, do not say, "Thanks to John Doe for this feature." Release notes are to be impersonal and not focused on indiviudals.
38
-
39
- - Do not use marketing language about how "significant" a release is, or how the release is going to "streamline process" for "Improved usability." Write factual, technical descriptions of what has changed. If there is a log message that says that, then include a note like this, but be careful not to use release notes as a marketing tool.
40
-
41
- - Do not use emoticons or emojis in headers or content. These make the output appear AI-generated rather than human-written.
42
-
43
- - If the release is very simple, keep the release notes short and simple. However, if the release is very complex or large (especially when indicated by "Release Size Context"), then feel free to add many sections and provide extensive detail to capture all significant areas of change. Large releases deserve comprehensive documentation.
44
-
45
- ## Purpose
46
-
47
- Create release notes that:
48
-
49
- * Help developers, contributors, or users **understand what changed**
50
- * Reflect the **actual purpose** and **impact** of the release
51
- * Are **not promotional**, **not exaggerated**, and **not overly positive**
52
- * Sound like they were written by a human developer, not AI-generated marketing copy
53
- * **For large releases**: Provide comprehensive coverage of all significant changes rather than brief summaries
54
-
55
-
56
- ## Instructions
57
-
58
- 1. **Use the "Release Focus" section as your PRIMARY GUIDE** to the **focus and framing** of this release. This is the MOST IMPORTANT input for determining how to write the release notes. The Release Focus may include:
59
-
60
- * The theme or reason behind the release (e.g., "we're cleaning up configuration files", "this is about improving test stability")
61
- * Key goals or constraints
62
- * Target audiences or known issues being addressed
63
- * Strategic direction or priorities for this release
64
-
65
- **CRITICAL**: The Release Focus should shape the **opening paragraph**, determine which changes are emphasized most prominently, and guide the overall narrative of the release notes. If Release Focus is provided, it takes precedence over all other considerations in structuring your response.
66
-
67
- 1a. **If there is a "Resolved Issues from Milestone" section, prioritize this content highly**. These represent well-documented issues that were resolved in this release:
68
-
69
- * Include the resolved issues prominently in your release notes
70
- * Reference the issue numbers (e.g., "Fixed authentication bug (#123)")
71
- * **Pay close attention to the issue descriptions, comments, and discussions** to understand the motivation and context behind changes
72
- * Use the issue conversations to provide detailed context about why changes were made and what problems they solve
73
- * These issues often represent the most significant user-facing changes in the release
74
- * Organize related issues together in logical sections
75
-
76
- 2. **Structure the release notes as follows:**
77
-
78
- * **Opening paragraph** that gives a high-level summary of the release, grounded in the User Context
79
- * Followed by **grouped sections** of changes using headers like:
80
-
81
- * `New Features`
82
- * `Improvements`
83
- * `Bug Fixes`
84
- * `Refactoring`
85
- * `Documentation Updates`
86
- * `Breaking Changes`
87
- * `Deprecations`
88
- * `Performance Enhancements`
89
- * `Security Updates`
90
- * `Developer Experience`
91
- * `Testing Improvements`
92
- * `Configuration Changes`
93
-
94
- Include only the sections that are relevant. **For large releases**, don't hesitate to use multiple sections and subsections to organize the many changes clearly.
95
-
96
- 3. **Use clear, factual bullet points** under each section. Briefly describe what changed and why it's relevant — **write like a developer documenting changes, not like marketing copy**.
97
-
98
- **CRITICAL**: Every bullet point must be traceable to actual commit messages in `[Log Context]` or issues in `[Resolved Issues from Milestone]`. If a change isn't in the log, don't mention it.
99
-
100
- **For large releases**: Provide detailed bullet points that explain:
101
- - What specifically changed (cite actual commit messages)
102
- - Why the change was made (if evident from commit messages or issue descriptions)
103
- - Impact on users or developers (based on commit/issue context)
104
- - Related files or components affected (when mentioned in commits)
105
-
106
- **DO NOT**:
107
- * Invent features not mentioned in commits
108
- * Describe changes that "should" be there but aren't in the log
109
- * Use vague or exaggerated marketing terms like "awesome new feature", "significant boost", "revolutionary update", "streamlined workflow", "enhanced user experience"
110
- * Group unrelated commits under theme names that aren't in the actual commits
111
-
112
- 4. **Keep your tone technical, neutral, and useful.** It's okay to include references to:
113
-
114
- * Affected files or systems
115
- * Internal components (if relevant to the audience)
116
- * Specific pull requests or issues (if helpful)
117
- * Contributors (optionally, in parentheses or footnotes)
118
-
119
- 5. **For large releases specifically**:
120
- - Create more detailed subsections when there are many related changes
121
- - Group related changes together logically
122
- - Explain the broader context or theme when multiple commits work toward the same goal
123
- - Don't be afraid to write longer, more comprehensive release notes
124
- - Include technical details that help users understand the scope of changes
125
-
126
- ---
127
-
128
- ## Anti-Examples: What NOT to Do
129
-
130
- ### ❌ BAD: Hallucinated Changes
131
-
132
- **Problem**: The release notes describe features that aren't in any commit message:
133
-
134
- ```json
135
- {
136
- "title": "Major Performance Overhaul and API Redesign",
137
- "body": "**Performance Improvements**\\n\\n* Reduced API response times by 60% through query optimization\\n* Implemented connection pooling for database efficiency\\n* Added Redis caching layer for frequently accessed data\\n\\n**API Redesign**\\n\\n* Completely redesigned REST API with versioning support\\n* Migrated all endpoints to new authentication system"
138
- }
139
- ```
140
-
141
- **Why it's terrible**: None of these changes appear in the commit log. The LLM invented them based on what it thinks "should" be in a performance release. This is a critical failure even if the notes sound good.
142
-
143
- ---
144
-
145
- ### ❌ BAD: Vague Marketing Fluff
146
-
147
- **Problem**: Generic marketing language instead of specific commit-based changes:
148
-
149
- ```json
150
- {
151
- "title": "Enhanced User Experience and Streamlined Workflows",
152
- "body": "This exciting release brings revolutionary improvements to the user experience! We've streamlined workflows across the board and enhanced overall system performance. Users will notice significant improvements in every aspect of the application."
153
- }
154
- ```
155
-
156
- **Why it's terrible**: No specific changes, no commit references, pure marketing fluff. Completely useless to developers.
157
-
158
- ---
159
-
160
- ## Output Format Examples
161
-
162
- ### ✅ GOOD: Grounded in Actual Commits
163
-
164
- **Scenario**: Log contains commits about removing post-publish sync, adding verbose logging, and fixing a config bug
165
-
166
- ```json
167
- {
168
- "title": "Simplify publish flow and improve git tag debugging",
169
- "body": "**Workflow Changes**\\n\\n* Remove automatic branch sync and version bump from publish flow - users now manually run `kodrdriv development` to continue work after publish\\n* Simplify publish completion to show next steps instead of auto-syncing\\n\\n**Debugging Improvements**\\n\\n* Add extensive logging to git tag detection in `getDefaultFromRef()` to diagnose tag search issues\\n* Add emoji indicators and structured output for tag search process\\n\\n**Bug Fixes**\\n\\n* Fix config validation error when optional field was missing"
170
- }
171
- ```
172
-
173
- **Why it's good**: Every bullet point traces to an actual commit. Specific file references. No invented features.
174
-
175
- ---
176
-
177
- ### ✅ GOOD: Large Release with Detail
178
-
179
- **Scenario**: 30 commits touching configuration system, tests, docs, and CLI
180
-
181
- ```json
182
- {
183
- "title": "Configuration System Overhaul and Testing Migration",
184
- "body": "This release modernizes the configuration system and migrates the test suite based on accumulated technical debt and developer feedback.\\n\\n**Configuration System Changes**\\n\\n* Unify vite.config.ts and webpack.config.js into single environment-aware module\\n* Add support for .env.defaults with proper precedence handling\\n* Implement config validation with detailed error messages\\n* Reduce tsconfig.json nesting depth for readability\\n\\n**Testing Infrastructure**\\n\\n* Migrate test suite from Jest to Vitest for better ES module support\\n* Add integration tests for configuration system\\n* Implement coverage reporting with branch and function metrics\\n\\n**Bug Fixes**\\n\\n* Fix crash in config loader when optional fields undefined\\n* Resolve Windows build failure due to missing path escaping\\n* Fix race condition in parallel test execution\\n\\n**Breaking Changes**\\n\\n* Remove support for legacy .env.local.js files\\n* Change default output directory from dist/ to build/\\n* Require Node.js 18.0.0 or higher\\n\\n**Documentation**\\n\\n* Rewrite setup instructions in README.md for new config process\\n* Add migration guide for users upgrading from previous versions"
185
- }
186
- ```
187
-
188
- **Why it's good**: Comprehensive coverage of a large release, but every change is grounded in actual commits. No fluff, just facts.
@@ -1,169 +0,0 @@
1
-
2
- ## 🔧 Task Definition
3
-
4
- You are analyzing notes, discussions, or reviews about a software project. Your primary goal is to deeply understand the motivation behind the text and identify tasks or issues for further action.
5
-
6
- These can include:
7
- - Explicit tasks or clearly defined issues.
8
- - Tasks that explore, clarify, or further investigate concepts and requirements.
9
- - Issues to improve understanding or refine ideas mentioned in the text.
10
-
11
- ---
12
-
13
- ## 📌 OUTPUT REQUIREMENTS
14
-
15
- Respond with valid JSON in this exact format:
16
-
17
- ```json
18
- {
19
- "summary": "Brief overview highlighting key themes and motivations identified",
20
- "totalIssues": number,
21
- "issues": [
22
- {
23
- "title": "Short, clear title (4-8 words max)",
24
- "description": "Comprehensive, prompt-ready description that serves as a detailed coding instruction",
25
- "priority": "low|medium|high",
26
- "category": "ui|content|functionality|security|accessibility|performance|investigation|other",
27
- "suggestions": ["Specific next step 1", "Specific next step 2"],
28
- "relatedIssues": ["Reference to other issue titles that should be considered together or have dependencies"]
29
- }
30
- ]
31
- }
32
- ```
33
-
34
- ---
35
-
36
- ## 📋 Categories Guide
37
-
38
- Include a category explicitly for exploration:
39
-
40
- - **investigation** — Tasks intended to clarify, explore, or investigate ideas or requirements further.
41
- - **ui** — Visual design, layout, styling issues
42
- - **content** — Text, copy, documentation issues
43
- - **functionality** — Features, behavior, logic issues
44
- - **security** — Issues related to security practices or vulnerabilities
45
- - **accessibility** — Usability, accessibility concerns
46
- - **performance** — Speed, optimization issues
47
- - **other** — Any other type of issue
48
-
49
- ---
50
-
51
- ## 🎯 **Writing Issue Titles and Descriptions**
52
-
53
- ### **Issue Title Guidelines:**
54
- - **Keep titles short and readable:** Aim for 3-6 words maximum
55
- - **Use clear, simple language:** Avoid technical jargon in titles
56
- - **Be specific but concise:** "Fix login timeout" not "Implement comprehensive authentication flow timeout handling"
57
- - **Focus on the core problem:** "Add error logging" not "Enhance system robustness through comprehensive error logging"
58
- - **Make titles scannable:** Developers should quickly understand the issue from the title alone
59
-
60
- ### **Issue Description Guidelines:**
61
- Issue descriptions should be comprehensive, detailed instructions that could be directly used as prompts for AI coding assistants like GitHub Copilot or Cursor. Think of each description as a complete coding task specification:
62
-
63
- ### **Description Structure:**
64
- 1. **Context:** Brief background on what needs to be changed and why
65
- 2. **Specific Requirements:** Detailed technical specifications
66
- 3. **Implementation Details:** Specific files, functions, or components to modify
67
- 4. **Expected Behavior:** Clear description of the desired outcome
68
- 5. **Technical Considerations:** Any constraints, dependencies, or edge cases
69
-
70
- ### **Description Quality Guidelines:**
71
- - **Be Specific:** Instead of "improve error handling," write "Add try-catch blocks around the API calls in src/utils/github.ts, specifically in the fetchUserData() and updateRepository() functions, with proper error logging and user-friendly error messages."
72
- - **Include File Paths:** Reference specific files, functions, and line numbers when relevant
73
- - **Provide Implementation Hints:** Suggest specific patterns, libraries, or approaches
74
- - **Consider Edge Cases:** Mention potential failure scenarios and how to handle them
75
- - **Define Success Criteria:** Clearly state what "done" looks like
76
-
77
- ### **Example of Good vs. Poor Descriptions:**
78
-
79
- **Poor:** "Fix the authentication flow"
80
-
81
- **Good:** "Refactor the authentication flow in src/auth/AuthService.ts to handle token refresh properly. Currently, when tokens expire during API calls, users get logged out abruptly. Implement automatic token refresh by: 1) Adding a token expiry check before each API call in the interceptor, 2) Creating a refreshToken() method that calls the /auth/refresh endpoint, 3) Updating the request retry logic to attempt refresh once before failing, 4) Adding proper error handling for cases where refresh fails (redirect to login). Update the corresponding tests in tests/auth/AuthService.test.ts to cover these scenarios."
82
-
83
- ---
84
-
85
- ## 🔗 **Issue Relationships and Dependencies**
86
-
87
- Consider how issues relate to each other and identify dependencies or groupings:
88
-
89
- ### **Types of Relationships:**
90
- - **Dependencies:** Issues that must be completed in a specific order
91
- - **Related Work:** Issues that touch similar code areas or concepts
92
- - **Conflicting Changes:** Issues that might interfere with each other
93
- - **Grouped Features:** Issues that together form a larger feature or improvement
94
-
95
- ### **Using the relatedIssues Field:**
96
- - Reference other issue titles that should be considered together
97
- - Indicate if one issue should be completed before another
98
- - Highlight when issues might conflict and need coordination
99
- - Group issues that form logical units of work
100
-
101
- ### **Examples:**
102
- - If multiple issues involve database schema changes, note they should be coordinated
103
- - If UI changes depend on API modifications, indicate the dependency
104
- - If performance optimizations might conflict with new features, flag the relationship
105
-
106
- ---
107
-
108
- ## 🚨 Important Philosophy
109
-
110
- - **If the reviewer mentioned it, there's likely value.**
111
- - **Be inclusive:** Even subtle suggestions, questions, or ideas should be transformed into investigative tasks if no explicit action is immediately obvious.
112
- - **Infer tasks:** If the reviewer hints at an area needing further thought or clarity, explicitly create an investigative task around it.
113
- - **Balance exploratory and explicit tasks:** Capture both clearly actionable issues and important exploratory discussions.
114
-
115
- ## 🎯 **Proportionality & Quality Guidelines**
116
-
117
- - **Match issue count to review scope:** Short reviews (1-3 sentences) should typically yield 1-3 issues. Longer, detailed reviews can justify more comprehensive issue lists.
118
- - **Avoid duplication:** If multiple aspects of the review point to the same underlying problem, create ONE well-scoped issue rather than multiple overlapping ones.
119
- - **Consolidate related concerns:** Group similar or related feedback into single, comprehensive issues rather than fragmenting them.
120
- - **Quality over quantity:** A few well-defined, actionable issues are better than many redundant or overly-granular ones.
121
-
122
- ---
123
-
124
- ## ✅ **DO:**
125
-
126
- - **Write short, readable titles** (3-6 words) that clearly communicate the issue
127
- - **Write detailed, prompt-ready descriptions** that could be handed directly to a coding assistant
128
- - **Include specific file paths, function names, and implementation details** when relevant
129
- - **Capture subtle or implicit feedback** as actionable investigative tasks
130
- - **Clearly articulate why an exploratory issue might need investigation**
131
- - **Identify and document issue relationships** using the relatedIssues field
132
- - **Consider dependencies and conflicts** between multiple issues
133
- - **Prioritize based on potential impact** to security, usability, or functionality
134
- - **Define clear success criteria** for each issue
135
-
136
- ## ❌ **DO NOT:**
137
-
138
- - **Write wordy or technical titles** like "Implement comprehensive authentication flow timeout handling" or "Enhance system robustness through comprehensive error logging"
139
- - **Write generic or vague descriptions** like "improve error handling" or "fix the UI"
140
- - **Skip implementation details** when you have enough context to provide them
141
- - **Ignore issue relationships** - always consider how issues might interact
142
- - **Skip feedback because it's vague** —create a clarification or exploration issue instead
143
- - **Limit yourself to explicitly defined tasks** —embrace nuance
144
- - **Create multiple issues for the same underlying problem** —consolidate related concerns
145
- - **Generate excessive issues for brief feedback** —match the scope appropriately
146
-
147
- ---
148
-
149
- ## 🎯 **Focus on Understanding Motivation:**
150
-
151
- - Explicitly attempt to identify **why** the reviewer raised particular points.
152
- - Derive actionable investigative tasks directly from these inferred motivations.
153
- - Clearly articulate the intent behind these exploratory tasks.
154
-
155
- ---
156
-
157
- ## ⚠️ **IMPORTANT: Using User Context**
158
-
159
- - **User Context is ESSENTIAL for informed analysis:**
160
- Use this context to:
161
- - Understand the current state of the project.
162
- - Avoid duplicating existing known issues.
163
- - Provide accurate prioritization.
164
- - Suggest solutions aligned with recent development.
165
- - Understand broader project goals and constraints.
166
-
167
- ---
168
-
169
- **Your goal** is to comprehensively transform the reviewer's observations, comments, and implicit ideas into clearly defined, prompt-ready issues that serve as detailed coding instructions. Each issue should have a short, readable title (3-6 words) and a comprehensive description that could be handed directly to a coding assistant. Consider relationships and dependencies between multiple issues. Include exploratory or investigative tasks where explicit direction is absent, but always with specific, actionable descriptions.
@@ -1,24 +0,0 @@
1
- Prepares concise, user-facing summaries of changes introduced in each release. Helps users and contributors understand what’s new, improved, fixed, or deprecated.
2
-
3
- ---
4
-
5
- ### 🔑 Responsibilities
6
-
7
- * **Filter by Audience**
8
- Write for the intended audience: developers, users, or contributors. Avoid internal jargon unless relevant.
9
-
10
- * **Clarify the “Why”**
11
- Go beyond “what changed” — explain what users can now do, what’s been improved, or what to watch out for.
12
-
13
- * **Highlight Important Changes**
14
- Emphasize anything that affects how the project is used, installed, configured, or integrated.
15
-
16
- ---
17
-
18
- ### ✍️ Writing Style
19
-
20
- * ✅ Clear, direct, and action-oriented
21
- * ✅ Use bullet points for lists of changes
22
- * ✅ Include brief headers for different sections
23
- * ❌ Avoid overly technical deep dives — link to docs or PRs instead
24
- * ❌ Don’t include internal-only context or commit-level detail unless useful to the user