AI Prompts Library
Curated collection of expert prompts for coding, writing, marketing, image generation, and more
Have a great prompt? Submit it to the library →
Popular Tags:
Coding
Test Coverage Generator
Optimized for: claude-opus-4-7 • TEXT
For the file at [PATH], generate a comprehensive test suite.
Framework: [JEST / PYTEST / RSPEC / etc.].
Coverage targets:
- Happy path for every public function
- Edge cases: empty inputs, null, max values, unicode, very large inputs
- Error paths: invalid input, exceptions, timeouts
- Integration with [DEPENDENCY] (mock if needed)
For each test, include a one-line comment explaining WHY this test exists (what regression it would catch).
Use descriptive `test("...")` names - not generic ones.
After writing, run the suite and confirm all pass. Report any code changes needed for testability.
Adding test coverage, pre-deployment safety nets
Coding
React TypeScript Component Generator
Optimized for: general • TEXT
You are a senior React developer specializing in TypeScript and modern React patterns. Generate a production-ready React component based on the following specifications. **Component Request:** - Component name: [COMPONENT_NAME] - Purpose: [WHAT_IT_DOES] - Props needed: [LIST_PROPS] - State requirements: [DESCRIBE_STATE] - API calls: [DESCRIBE_API_INTERACTIONS] **Requirements for the generated component:** 1. **TypeScript**: Define a clear Props interface. Use proper generic types. No `any` types. Export the Props type for consumers. 2. **Component Structure**: - Use functional component with named export - Destructure props with defaults where appropriate - Order: type imports, component imports, hook imports, then utility imports - Internal order: hooks, derived state, handlers, effects, render 3. **Hooks Usage**: - useMemo for expensive computations - useCallback for handler functions passed to children - Custom hooks for reusable logic (extract if > 10 lines of hook logic) 4. **Error Handling**: - Error boundary wrapper for async operations - Loading, error, and empty states - Graceful fallbacks 5. **Accessibility**: - Proper ARIA labels and roles - Keyboard navigation support - Focus management - Screen reader announcements for dynamic content 6. **Styling**: Use Tailwind CSS utility classes. Support className prop for customization. Use cn() or clsx() for conditional classes. 7. **Testing**: Generate a companion .test.tsx file with: - Render tests for all states (loading, error, success, empty) - User interaction tests - Accessibility tests using testing-library - Mock API calls properly **Output**: The complete component file, types file (if complex), test file, and a Storybook story file.
Rapid development of high-quality React components with full test coverage
Coding
Test Case Generator for Unit and Integration Tests
Optimized for: general • TEXT
You are a senior QA engineer and testing expert. Generate comprehensive test cases for the given code or feature. Cover unit tests, integration tests, and edge cases. **Code/Feature to Test:** [PASTE CODE OR DESCRIBE FEATURE] **Tech Stack:** [e.g., Jest/Vitest + React Testing Library, Pytest, Go testing, JUnit] **Test Runner:** [e.g., Jest, Vitest, Pytest, Go test] **Generate tests following this structure:** 1. **Unit Tests** (isolated, fast, no external dependencies): - Happy path: Test normal expected behavior with valid inputs - Edge cases: Empty strings, null/undefined, zero, negative numbers, max values - Boundary conditions: Off-by-one errors, array bounds, string length limits - Type variations: Different input types that should be handled - Error cases: Invalid inputs that should throw specific errors 2. **Integration Tests** (test component interactions): - API calls: Mock HTTP requests, test loading/error/success states - Database operations: Test CRUD with test database or in-memory DB - Component integration: Test parent-child component communication - Service layer: Test business logic with mocked dependencies 3. **Test Organization:** - Use describe blocks to group related tests - Use clear test names: 'should [expected behavior] when [condition]' - Setup and teardown with beforeEach/afterEach - Shared fixtures and test data factories - Test isolation: Each test must be independent 4. **Mocking Strategy:** - Identify all external dependencies to mock - Create typed mock factories - Verify mock calls (called with correct arguments, correct number of times) - Reset mocks between tests 5. **Coverage Goals:** - Line coverage: > 90% - Branch coverage: > 85% - Identify untestable code and suggest refactoring **Output**: Complete test file(s) ready to run, with comments explaining the reasoning behind each test case.
Writing test suites for new features, improving test coverage, establishing testing patterns
Coding
Bug Fix Assistant with Root Cause Analysis
Optimized for: general • TEXT
You are a senior debugging expert. Help identify the root cause of a bug and provide a targeted fix. Use systematic debugging methodology rather than guesswork. **Bug Report:** - What happened: [DESCRIBE THE BUG] - Expected behavior: [WHAT SHOULD HAPPEN] - Steps to reproduce: [1. 2. 3.] - Error message/stack trace: [PASTE ERROR IF AVAILABLE] - Environment: [OS, browser, runtime version, etc.] - Frequency: [Always / Intermittent / Only under specific conditions] **Relevant Code:** [PASTE THE RELEVANT CODE SECTIONS] **Debugging Methodology:** 1. **Symptom Analysis:** - Parse the error message and stack trace - Identify the exact line and function where the error occurs - Determine if this is a runtime error, logic error, or state error 2. **Hypothesis Generation:** - List 3-5 possible causes ranked by likelihood - For each hypothesis, explain what evidence would confirm or rule it out - Consider: race conditions, null references, type coercion, off-by-one, state mutation, async timing 3. **Root Cause Identification:** - Trace the data flow from input to the error point - Identify where the actual behavior diverges from expected behavior - Check if this is a regression (what recent changes could have caused it?) - Determine if it is a symptom of a deeper architectural issue 4. **Fix Implementation:** - Provide the minimal, targeted fix - Explain why this fix addresses the root cause (not just the symptom) - Ensure the fix does not introduce new bugs - Add defensive checks for related edge cases 5. **Prevention:** - Write a test case that would have caught this bug - Suggest a linting rule or type check that would prevent similar bugs - Recommend any architectural changes to make this class of bug impossible **Output**: Root cause explanation, the fix with code, test case, and prevention recommendations.
Debugging production issues, fixing complex bugs, establishing debugging practices
No Prompts Found
Try adjusting your filters or search query.
Want Custom Prompts?
Get personalized AI prompts tailored to your specific needs and workflow.
Contact Us