-
Notifications
You must be signed in to change notification settings - Fork 1
Build user story generator from brief descriptions #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build user story generator from brief descriptions #91
Conversation
- Add 'user-story' template with title, description, tasks, acceptance criteria, and time estimate
- Include template metadata in picker with description
- Add User Stories category with 📝 icon for organization
- Support auto-categorization with 'user-story' and 'story' keywords
- Template includes placeholders for {filename}, {date}, and {user}
- Add 'noted.createUserStoryWithAI' command to create user stories from brief descriptions - Uses VS Code LLM API (GitHub Copilot) to analyze description and populate: - Story title - User story format (As a... I want... So that...) - 3-5 actionable tasks as checklist - 3-5 testable acceptance criteria - Realistic time estimate - Creates note in User Stories folder with YAML frontmatter - Supports fallback when AI is unavailable - Register command in extension.ts and package.json - Icon: $(notebook) for command palette
Summary of ChangesHello @jsonify, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a significant new feature that leverages AI to streamline the creation of user stories within the application. By providing a brief description, users can now automatically generate fully structured user stories, complete with titles, descriptions, tasks, acceptance criteria, and time estimates, which are then saved as new notes. This enhancement aims to boost productivity for agile development workflows by automating a common documentation task. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a great new feature for generating user stories with AI. The implementation is well-structured, with clear separation of concerns for building the prompt, parsing the response, and creating the note file. The use of a fallback mechanism in parseUserStoryResponse is particularly robust.
I've left a few comments with suggestions for improvement, mainly related to making the progress indicator cancellable for better UX, removing hardcoded strings, avoiding require() inside functions, and addressing some code duplication.
Overall, this is a solid contribution that enhances the AI capabilities of the extension.
Issue 1 - Fix workspace folder error: - Use getNotesPath() from configService instead of workspace folders - Support absolute path configurations for notes folder - Add getNotesPath import to templateCommands.ts - Provide clearer error message when notes folder not configured Issue 2 - Add AI User Story to templates picker: - Add "$(sparkle) User Story with AI" option at top of template picker - Shows as "AI-Enhanced" category in picker UI - Accessible via Cmd+K Cmd+N template selection flow - Special value '__ai_user_story__' triggers handleCreateUserStoryWithAI() - Also added regular "User Story" template to built-in list
Update model selection priority in both TemplateGenerator and user story creation: Priority hierarchy: 1. Claude Sonnet (latest version) - best for structured JSON output 2. Claude Opus - most capable 3. Other Claude models 4. Direct Anthropic vendor 5. GPT-4 models 6. Other GPT models 7. Gemini models 8. First available model Key improvements: - Filters for all Sonnet models and sorts by ID to get latest (e.g., sonnet-4-5) - Case-insensitive matching for model family/ID - Checks both 'copilot' and 'anthropic' vendors for Claude models - Maintains user preference override at top of hierarchy - Provides clear fallback chain for reliability Applies to: - User story AI generation (templateCommands.ts) - Template creation with AI (TemplateGenerator.ts)
Add both manual and AI-enhanced User Story options to the Standard Templates section: Standard Templates section now includes: - Problem/Solution - Meeting - Research - User Story (manual template) - ✨ User Story with AI (AI-powered generation) - Quick Note Changes: - Add 'user-story' to STANDARD_TEMPLATES array - Insert AI-enhanced option after regular User Story template - AI option uses sparkle icon (✨) to distinguish it visually - Both options now appear in the collapsible "Standard Templates" section of the Templates panel User can now access user story creation from three places: 1. Templates panel > Standard Templates 2. Command Palette (Cmd+K Cmd+N) 3. Direct command palette search for "Create User Story with AI"
CI/CD Fix:
- Fix TypeScript compilation error in templatesTreeProvider.ts
- Explicitly type items array as TreeItem[] to allow mixing TemplateActionItem and ActionButtonItem
- Resolves: error TS2345 "Property 'templateType' is missing in type 'ActionButtonItem'"
Code Review Improvements:
1. Cancellation Support:
- Add cancellable: true to withProgress in handleCreateUserStoryWithAI
- Use token from progress callback instead of creating new CancellationTokenSource
- Check token.isCancellationRequested during response streaming
- Add early return if cancelled to prevent partial operations
2. ES6 Import Refactoring:
- Replace require('os') with top-level import * as os from 'os'
- Change require('os').userInfo().username to os.userInfo().username
- Improves code readability and enables static analysis
3. DRY Principle - Shared AI Model Service:
- Create new src/services/aiModelService.ts with shared selectAIModel()
- Remove duplicate selectModel() from TemplateGenerator.ts (84 lines)
- Remove duplicate selectAIModel() from templateCommands.ts (75 lines)
- Both files now import and use shared selectAIModel()
- Single source of truth for AI model selection logic
- Prioritizes Claude Sonnet (latest) > Opus > other Claude > GPT-4 > GPT > Gemini
Benefits:
- Easier to maintain model selection logic in one place
- Consistent behavior across all AI features
- Reduced code duplication by ~160 lines
- Future AI features can reuse the same selection logic
No description provided.