### Research Authentication Libraries (Bash) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This command involves reading the package.json file to identify any installed libraries related to authentication. This step is crucial for understanding the project's current dependencies and potential tools available for implementing new authentication features. ```bash cat package.json | grep -Ei 'auth|passport|jwt|session' ``` -------------------------------- ### Research Plan Template and Example (TodoWrite) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md A template for creating a research plan using TodoWrite, outlining steps for systematic investigation. Includes an example for a 'fix the bug' scenario. ```markdown Research Plan for [Prompt Type]: 1. [What to research] - [Tool/approach] 2. [What to research] - [Tool/approach] 3. [What to research] - [Tool/approach] Research Plan for "fix the bug": 1. Check conversation history for error messages - Review recent messages 2. Search for failing tests - Grep for "failing", "error", "TODO" 3. Explore recent commits - Git log for problem areas 4. Identify patterns in similar code - Read related files ``` -------------------------------- ### Install Prompt Improver Plugin via Marketplace Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/README.md Installs the prompt-improver plugin from the Severity1 marketplace. This is the recommended installation method. ```bash claude plugin install prompt-improver@severity1-marketplace ``` -------------------------------- ### Tool Selection Guide - Read Use Case Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Explains when to use the Read tool, highlighting its purpose for reading specific files, reviewing documentation, inspecting configurations, and analyzing package.json. ```text Read: - Reading specific files - Documentation review - Configuration inspection - Package.json analysis ``` -------------------------------- ### Tool Selection Guide - WebFetch Use Case Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Explains the purpose of WebFetch, emphasizing its role in retrieving official documentation, specific documentation pages, API references, and tutorial content. ```text WebFetch: - Official documentation - Specific documentation pages - API references - Tutorial content ``` -------------------------------- ### Research Execution Pattern 1: Quick Research Example Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md An example of quick research using 1-2 tools (Glob and Read) to address a simple ambiguity like adding tests. ```text Prompt: "add tests" Research: 1. Glob: "**/*.test.ts" → Find test pattern 2. Read: "src/__tests__/example.test.ts" → See structure Findings: - Jest framework - Tests in __tests__/ directories - Pattern established ``` -------------------------------- ### Simple Clarification Question Example Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md An example JSON array containing a single question for simple clarification, such as identifying a target file, with multiple string options. ```json [ { "question": "Which file should be modified?", "header": "Target file", "multiSelect": false, "options": ["auth.ts", "middleware.ts", "session.ts"] } ] ``` -------------------------------- ### File View Context Example - System Message and User Prompt Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md This example illustrates using file view context, indicated by system messages, to understand user intent when they are focused on a specific file. ```text [System: User opened src/components/LoginForm.tsx] User: "refactor this to use hooks" Research: 1. File context: LoginForm.tsx (React component) 2. User viewing: Specific component 3. Request: Convert to hooks 4. Clear: Refactor LoginForm.tsx from class to hooks ``` -------------------------------- ### Install Claude Code Prompt Improver via Marketplace Source: https://context7.com/severity1/claude-code-prompt-improver/llms.txt Commands to add the severity1 marketplace and install the prompt-improver plugin. Requires restarting Claude Code to verify installation. ```bash claude plugin marketplace add severity1/severity1-marketplace claude plugin install prompt-improver@severity1-marketplace # Restart Claude Code and verify # Run /plugin to see installed plugins ``` -------------------------------- ### Install Prompt Improver via Local Development Marketplace Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/README.md Installs the prompt-improver plugin using the local development marketplace. This is used after cloning the repository and adding the local marketplace. ```bash claude plugin install prompt-improver@local-dev ``` -------------------------------- ### Manual Installation of Claude Code Prompt Improver Hook Source: https://context7.com/severity1/claude-code-prompt-improver/llms.txt Instructions for manually copying and making the hook script executable, followed by configuration in settings.json. ```bash # Copy the hook script cp scripts/improve-prompt.py ~/.claude/hooks/ chmod +x ~/.claude/hooks/improve-prompt.py # Add to ~/.claude/settings.json: # { # "hooks": { # "UserPromptSubmit": [ # { # "hooks": [ # { # "type": "command", # "command": "python3 ~/.claude/hooks/improve-prompt.py" # } # ] # } # ] # } # } ``` -------------------------------- ### Tool Selection Guide - Task/Explore Agent Use Case Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Describes the use cases for the Task/Explore Agent, emphasizing its utility in broad exploration, understanding architecture, finding patterns, and complex research. ```text Task/Explore Agent: - Broad exploration needed - Understanding architecture - Finding similar patterns - Complex multi-step research ``` -------------------------------- ### Tool Selection Guide - Bash (git commands) Use Case Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Describes the scenarios for using Bash with git commands, focusing on retrieving historical context, recent changes, commit messages, and file history. ```text Bash (git commands): - Historical context - Recent changes - Commit messages - File history ``` -------------------------------- ### Research-Grounded Option Example Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md An example of a well-grounded option within a JSON configuration, demonstrating how to link a choice to existing project context or research findings. ```json { "label": "Use MongoDB", "description": "NoSQL database. Project already uses MongoDB for user data (see db/connection.ts). Consistent with existing stack." } ``` -------------------------------- ### Search for Common Architectures Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Use web searches to find examples and best practices for well-known architectural patterns like the repository pattern, MVC, clean architecture, or microservices. Combining web search with fetching official documentation can yield comprehensive insights. ```bash "repository pattern TypeScript example" "MVC architecture Node.js best practices" "clean architecture Node.js implementation" "microservices patterns" ``` -------------------------------- ### Ask About Caching Target with JSON Options Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This snippet demonstrates a JSON structure for asking users about caching targets, including options for product catalog, user profiles, and database queries, along with their respective descriptions and suitability. ```json { "questions": [ { "question": "What should be cached?", "header": "Cache target", "multiSelect": true, "options": [ { "label": "Product catalog (/api/products)", "description": "Currently 500ms response time. Products change infrequently (good cache candidate). High traffic endpoint." }, { "label": "User profiles (/api/users/:id)", "description": "Currently 200ms response time. Profile data changes occasionally. Moderate traffic." }, { "label": "Database queries", "description": "Cache at ORM level for all database queries. Broadest impact but requires careful invalidation." } ] } ] } ``` -------------------------------- ### Topic Tracking Example - Message History Analysis Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md This example demonstrates how to track a user's topic of interest by analyzing recent message history to understand their working context and intent. ```text Message history: 5 messages ago: "How do I implement caching in Express?" 3 messages ago: "Should I use Redis or in-memory cache?" 1 message ago: "ok let's use Redis" Current: "implement it" Research: 1. Topic: Caching implementation with Redis 2. Decision made: Use Redis (not in-memory) 3. Context: Express.js project 4. Clear: Implement Redis caching in Express ``` -------------------------------- ### Tool Selection Guide - Glob Use Case Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Details the specific scenarios where the Glob tool is most effective, such as finding files by name patterns, known file types, and specific naming conventions. ```text Glob: - Finding files by name pattern - Known file types - Specific naming conventions ``` -------------------------------- ### Tool Selection Guide - Grep Use Case Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Outlines the applications of the Grep tool, focusing on its strengths in searching code content, finding function calls, pattern matching, and discovering TODO/FIXME comments. ```text Grep: - Searching code content - Finding function calls - Pattern matching - TODO/FIXME discovery ``` -------------------------------- ### Tool Selection Guide - WebSearch Use Case Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Details the usage of WebSearch for gathering information on current best practices, industry standards, library comparisons, and common solutions. ```text WebSearch: - Current best practices - Industry standards - Library comparisons - Common solutions ``` -------------------------------- ### Research Execution for Generic Refactoring Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md Shows the execution of the research plan for refactoring, including code analysis findings like file length and function size, and comparisons with established patterns. ```text # Step 1 Read: src/api/users.ts Findings: 450 lines, single file with all user operations # Step 2 Analysis of users.ts: - getUserById: 45 lines - createUser: 78 lines - updateUser: 89 lines - deleteUser: 34 lines - validateUser: 56 lines All in one file, mixed concerns # Step 3 Glob: "src/api/*.ts" Read: src/api/products.ts Finding: Products API uses service layer pattern (ProductService class) ``` -------------------------------- ### Research Plan for Generic Refactoring Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md Details the steps to analyze and refactor code for a generic request. It involves reading source files, identifying code quality issues, and referencing best practices. ```bash # Step 1 Read: src/api/users.ts # Step 2 Glob: "src/api/*.ts" # Step 3 Glob: "src/api/*.ts" Read: src/api/products.ts ``` -------------------------------- ### Refactor to Async/Await - JavaScript Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md Demonstrates refactoring a function from promise chains to use async/await syntax. This improves code readability and error handling for asynchronous operations in JavaScript. ```javascript // Before function getUserById(id) { return db.users.findOne({id}) .then(user => { if (!user) throw new Error('User not found'); return user; }) .then(user => validateUser(user)) .then(validatedUser => formatResponse(validatedUser)) .catch(error => handleError(error)); } // After async function getUserById(id) { try { const user = await db.users.findOne({id}); if (!user) throw new Error('User not found'); const validatedUser = await validateUser(user); return formatResponse(validatedUser); } catch (error) { return handleError(error); } } ``` -------------------------------- ### Compare Authentication Strategies (WebSearch) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This web search query compares different authentication strategies, specifically JWT (JSON Web Tokens) versus session-based authentication, within a microservices architecture. This helps in selecting the most appropriate and secure method for the project's needs. ```text JWT vs session authentication microservices ``` -------------------------------- ### Research Execution Pattern 3: Comprehensive Research Example Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Illustrates comprehensive research using 5+ tools (Read, Task/Explore, Grep, WebSearch, WebFetch, Bash) for a major feature like adding authentication. ```text Prompt: "add authentication" Research: 1. Read: package.json → Current dependencies 2. Task/Explore: Map current auth (if any) 3. Grep: "auth|login|session" → Find existing code 4. WebSearch: "Node.js authentication best practices 2024" 5. WebSearch: "JWT vs session comparison" 6. WebFetch: "https://expressjs.com/en/advanced/best-practice-security.html" 7. Bash: git log --grep="auth" → Historical attempts Findings: - No existing auth system - Express.js backend with REST API - Microservices architecture (suggests JWT) - Security requirements in docs - Industry standard: JWT with refresh tokens ``` -------------------------------- ### Ask About Caching Strategy with JSON Options Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This JSON snippet presents options for choosing a caching strategy, including Redis with TTL, in-memory caching with node-cache, and Redis with cache invalidation, detailing the pros and cons of each. ```json { "questions": [ { "question": "Which caching strategy should be used?", "header": "Strategy", "multiSelect": false, "options": [ { "label": "Redis with TTL", "description": "External cache with time-to-live expiration. Redis already installed. Best for distributed systems. Standard approach." }, { "label": "In-memory with node-cache", "description": "Simple in-process caching. Fast but not shared across instances. Good for single-server deployments." }, { "label": "Redis with cache invalidation", "description": "Active invalidation on data changes. Most complex but most accurate. Requires event hooks on updates." } ] } ] } ``` -------------------------------- ### Research Execution Pattern 2: Moderate Research Example Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Demonstrates moderate research using 3-4 tools (Grep, Read, WebSearch, Task/Explore) to improve error handling. ```text Prompt: "improve error handling" Research: 1. Grep: "try.*catch|throw new Error" → Find current patterns 2. Read: Key files with error handling 3. WebSearch: "Node.js error handling best practices 2024" 4. Task/Explore: Map error flow through app Findings: - Inconsistent error types - Some use custom errors, some generic - Best practice: Centralized error handler - Pattern: Implement custom error classes ``` -------------------------------- ### Implement JWT Authentication and Refresh Tokens Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This snippet outlines the decision to implement JWT authentication with refresh tokens. It is suitable for microservices and mobile applications, adhering to industry standards for stateless authentication. ```text Implement JWT authentication with refresh tokens, support both HttpOnly cookies (web) and Authorization header (mobile), create login/register endpoints with role-based access control. ``` -------------------------------- ### Ask About Cache TTL with JSON Options Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This JSON structure allows users to select a Time-To-Live (TTL) for their cache, offering options like 5 minutes, 1 minute, and 30 seconds, with explanations for each duration's trade-offs. ```json { "questions": [ { "question": "What should the cache TTL (time-to-live) be?", "header": "TTL", "multiSelect": false, "options": [ { "label": "5 minutes", "description": "Aggressive caching. Data can be stale up to 5 minutes. Best for very static data." }, { "label": "1 minute", "description": "Balanced approach. Reduces load while keeping data relatively fresh. Good default." }, { "label": "30 seconds", "description": "Conservative caching. Minimal staleness but less performance benefit. Use for semi-dynamic data." } ] } ] } ``` -------------------------------- ### Research Existing Authentication (Bash) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This bash command is used to search for existing authentication-related code within a project. It helps determine if any authentication mechanisms (like auth, login, session, or JWT) are already implemented, providing a baseline for further development. ```bash grep -Ei 'auth|login|session|jwt' . ``` -------------------------------- ### Research Findings for Generic Bug Fix Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md Presents the results obtained from executing the research plan for a generic bug fix. It highlights specific code locations, test failures, and error messages. ```text # Step 1 Grep: "TODO|FIXME|BUG" Results: 3 TODOs, 1 FIXME in auth.ts:89 # Step 2 Glob: "**/*.test.ts" Bash: npm test Results: 2 tests failing in test_auth.test.ts # Step 3 Bash: git log --grep="fix|bug" --oneline -10 Results: Recent commit "fix login redirect" 2 days ago # Step 4 Grep: "console.error|console.warn" Results: Error logged in auth.ts:145 "Invalid token" ``` -------------------------------- ### Research Express Authentication Best Practices (WebSearch) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md This represents a web search query to find current best practices for implementing authentication within an Express.js application. The results inform decisions on security, scalability, and maintainability, particularly in the context of microservices. ```text Express authentication best practices 2024 ``` -------------------------------- ### Research Plan for Generic Bug Fix Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md Outlines a step-by-step plan to investigate a vague bug fix request. It includes searching for code comments, checking test results, reviewing commit history, and analyzing error logs. ```bash # Step 1 Grep: "TODO|FIXME|BUG" # Step 2 Glob: "**/*.test.ts" Bash: npm test # Step 3 Bash: git log --grep="fix|bug" --oneline -10 # Step 4 Grep: "console.error|console.warn" ``` -------------------------------- ### JSON: Actionable Codebase Evidence for Refactoring Prompts Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md Provides an example of a JSON prompt for refactoring that uses specific codebase evidence, such as file paths and line numbers, to justify the suggested approach. This contrasts with generic, unhelpful prompts. ```json { "label": "Best practice approach", "description": "Use industry standard methods" } ``` ```json { "label": "Repository pattern with dependency injection", "description": "Separate data access into UserRepository, injected via constructor. Used in OrderService (see src/services/order.service.ts:15)." } ``` -------------------------------- ### Search Code Comments for Documentation Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Use grep to find documentation comments, typically starting with /** or containing Javadoc-style tags like @param or @returns. This is useful for understanding function signatures and expected behavior. ```bash # Find documentation comments pattern: "/\*\*|@param|@returns" ``` -------------------------------- ### Research Strategy: Grep for Content Search (Bash) Source: https://context7.com/severity1/claude-code-prompt-improver/llms.txt Provides examples of using `Grep` for common content searches within a codebase. These searches help identify specific issues, code structures, or implementation details relevant to prompt clarification. ```bash # Grep patterns for common searches Grep: "TODO|FIXME|BUG" # Known issues Grep: "try.*catch|throw new" # Error handling Grep: "authenticate|login|auth" # Auth implementations Grep: "process\.env|config\." # Configuration usage ``` -------------------------------- ### Add Severity1 Marketplace to Claude Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/README.md Installs the Severity1 marketplace, which is required to install the prompt-improver plugin via the marketplace. ```bash claude plugin marketplace add severity1/severity1-marketplace ``` -------------------------------- ### Fetch Framework Documentation Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Access official documentation for frameworks by visiting their dedicated websites. This provides authoritative guidance on usage, features, and best practices. Common sites include MDN, Node.js docs, TypeScript docs, and framework-specific documentation. ```bash # JavaScript/TypeScript https://developer.mozilla.org/docs/ https://nodejs.org/docs/ https://www.typescriptlang.org/docs/ # Frameworks https://reactjs.org/docs/ https://expressjs.com/ https://nextjs.org/docs/ # Tools https://jestjs.io/docs/ https://prettier.io/docs/ ``` -------------------------------- ### Web Search for Framework Best Practices Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Perform targeted web searches using specific framework names, common patterns, and the current year to find up-to-date best practices for implementation. Effective queries include framework-specific patterns, library comparisons, and common problem solutions. ```bash # Framework-specific patterns "React authentication best practices 2024" "Express.js error handling patterns 2024" # Library comparisons "JWT vs session authentication comparison" "Joi vs Zod validation library comparison" # Implementation approaches "implement rate limiting Node.js" "database transaction patterns TypeScript" # Common problems "fix N+1 query problem TypeScript" "prevent SQL injection Node.js" ``` -------------------------------- ### Manually Install Prompt Improver Hook Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/README.md Copies the prompt-improver Python script to the Claude hooks directory and makes it executable. This is part of the manual installation process. ```bash cp scripts/improve-prompt.py ~/.claude/hooks/ chmod +x ~/.claude/hooks/improve-prompt.py ``` -------------------------------- ### Multi-Tool Research Pattern 2: Implementation Approach Steps Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Details a pattern for determining an implementation approach using Grep, Read, WebSearch, and WebFetch. ```text 1. Grep: Search for existing pattern 2. Read: Example implementation 3. WebSearch: Best practices 4. WebFetch: Official docs 5. Synthesize: Combine findings ``` -------------------------------- ### Clone Prompt Improver Repository Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/README.md Clones the source code for the Claude Code Prompt Improver from GitHub. This is the first step for local development installation. ```bash git clone https://github.com/severity1/claude-code-prompt-improver.git cd claude-code-prompt-improver ``` -------------------------------- ### Add Local Marketplace for Development Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/README.md Adds a local marketplace to Claude Code, pointing to the .dev-marketplace directory of the cloned repository. This allows installing the plugin from a local source. ```bash claude plugin marketplace add /absolute/path/to/claude-code-prompt-improver/.dev-marketplace/.claude-plugin/marketplace.json ``` -------------------------------- ### JSON: Balanced Options for Authentication Mechanism Prompts Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md Demonstrates how to present a JSON prompt for an authentication mechanism choice with balanced, descriptive options. Each option includes its benefits and drawbacks, avoiding biased language and enabling informed decisions. ```json { "question": "Which authentication mechanism should be implemented?", "options": [ { "label": "JWT tokens", "description": "Stateless, scales horizontally. Client manages tokens. Trade-off: harder to invalidate." }, { "label": "Server-side sessions", "description": "Stateful, easier to invalidate. Server manages state. Trade-off: requires shared session store." } ] } ``` -------------------------------- ### JSON: Including Trade-offs in Architecture Prompts Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md Illustrates how to present architectural decisions in JSON prompts, moving from one-sided benefits to a balanced view that includes both advantages and disadvantages, along with relevant context like team expertise. ```json { "label": "Microservices architecture", "description": "Modern, scalable approach" } ``` ```json { "label": "Microservices architecture", "description": "Split into auth-service and user-service. Better scaling and independence, but adds deployment complexity. Team has Docker expertise." } ``` -------------------------------- ### Configure Claude Settings for Manual Hook Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/README.md Updates the Claude Code settings file to register the improve-prompt.py script as a UserPromptSubmit hook. This enables the manual installation of the prompt improver. ```json { "hooks": { "UserPromptSubmit": [ { "hooks": [ { "type": "command", "command": "python3 ~/.claude/hooks/improve-prompt.py" } ] } ] } } ``` -------------------------------- ### Clarifying Questions for Bug Fix Prompt (JSON) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md A JSON object containing a structured list of questions to clarify a vague bug fix request. It allows the user to select the specific bug they want addressed. ```json { "questions": [ { "question": "Which bug should be fixed?", "header": "Bug target", "multiSelect": false, "options": [ { "label": "Token validation (auth.ts:89)", "description": "FIXME comment indicates broken token validation. 2 failing tests in test_auth.test.ts related to this. Likely high priority." }, { "label": "Login redirect (recent commit)", "description": "Recent commit 2 days ago attempted to fix login redirect. May have residual issues." }, { "label": "Invalid token logging (auth.ts:145)", "description": "Errors being logged for invalid tokens. May be symptom of validation bug or separate issue." } ] } ] } ``` -------------------------------- ### Multi-Tool Research Pattern 1: Architecture Discovery Steps Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/research-strategies.md Outlines a pattern for discovering project architecture using a sequence of tools including Read, Task/Explore, and Glob. ```text 1. Read: package.json (understand stack) 2. Read: README.md (understand project) 3. Task/Explore: Map architecture 4. Glob: Find similar files 5. Read: Representative files ``` -------------------------------- ### AskUserQuestion Tool for Clarifying Prompts (JSON) Source: https://context7.com/severity1/claude-code-prompt-improver/llms.txt An example of the JSON structure used by the `AskUserQuestion` tool to generate clarifying questions for users. This includes the question text, header, selection type, and predefined options with descriptions. ```json { "questions": [ { "question": "Which authentication method should be implemented?", "header": "Auth method", "multiSelect": false, "options": [ { "label": "JWT with refresh tokens", "description": "Stateless authentication. Best for microservices and mobile apps." }, { "label": "Session-based with Redis", "description": "Server-side sessions. Simpler but requires session store." }, { "label": "OAuth 2.0 integration", "description": "Third-party providers (Google, GitHub). Good UX." } ] } ] } ``` -------------------------------- ### Test Coverage Scope Selection Prompt (JSON) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md A JSON prompt for specifying the desired level of test coverage. Options range from 'Happy path only' to 'Full coverage including edge cases', guiding the testing strategy. ```json { "question": "What level of test coverage should be added?", "header": "Test scope", "multiSelect": false, "options": [ { "label": "Happy path only", "description": "Basic test for successful operation. Quick validation that feature works." }, { "label": "Happy path + error cases", "description": "Success cases and expected errors (invalid input, not found, etc.). Comprehensive basic coverage." }, { "label": "Full coverage including edge cases", "description": "Success, errors, edge cases (empty data, null values, rate limits, etc.). Production-ready coverage." } ] } ``` -------------------------------- ### Configuration Value JSON Template Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md This JSON template illustrates a question for setting a configuration value, such as a timeout, with options describing the implications of each choice. ```json { "question": "What timeout value should be configured?", "header": "Timeout", "multiSelect": false, "options": [ { "label": "5 seconds", "description": "Aggressive timeout. Fast failures but might interrupt legitimate slow operations." }, { "label": "30 seconds", "description": "Balanced timeout. Industry standard for API requests. Recommended for most use cases." }, { "label": "120 seconds", "description": "Conservative timeout. Allows for slow operations (large file uploads, complex reports)." } ] } ``` -------------------------------- ### Fix Undefined Property Access - TypeScript Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/examples.md Illustrates fixing a TypeError in TypeScript by safely accessing nested object properties using optional chaining and the nullish coalescing operator. This prevents runtime errors when properties might be undefined. ```typescript // Before (line 145) const displayName = user.profile.name; // After (line 145) const displayName = user?.profile?.name ?? 'Anonymous'; ``` -------------------------------- ### File Selection Prompt (JSON) Source: https://github.com/severity1/claude-code-prompt-improver/blob/main/skills/prompt-improver/references/question-patterns.md A JSON template for a prompt that asks the user to select a specific file to modify. It presents a list of options with labels and descriptions, allowing for single selection. ```json { "question": "Which file should be modified?", "header": "Target file", "multiSelect": false, "options": [ { "label": "src/auth/login.ts", "description": "Main login handler with authentication logic (currently 245 lines)" }, { "label": "src/auth/middleware.ts", "description": "Authentication middleware used by all protected routes (89 lines)" }, { "label": "src/auth/session.ts", "description": "Session management and validation utilities (156 lines)" } ] } ```