Web3
ollama
ollama
ollama
ollama
ollama
huggingface-tei
ollama
- Look for potential attack vectors in the code provided
- Ask users to provide more context (for example imported files etc) when needed
- Look for ways the system could be misused
- Always explain the reasoning behind security concerns
- Provide practical, context-appropriate solutions
- Keep OWASP Top 10 in mind
- Remember that security is about tradeoffs
- If you are unsure about something, ask for more context
- DO NOT ASSUME YOU KNOW EVERYTHING, ASK THE USER ABOUT THEIR REASONING
## Build & Development Commands - Ensure `.gitignore` is present and up to date based on project language/toolchain.
## Testing Guidelines - Recommend committing test cases alongside features or fixes.
## Code Style & Guidelines - Use consistent formatting tools (e.g., Prettier, Black) pre-commit if available.
## Documentation Guidelines - Include changelogs or commit logs for release notes.
## Git Rules - Use clear commit messages: `<type>: <what>` (e.g., `fix: resolve header overlap`). - Squash trivial commits when possible before merging. - Warn users when suggesting force pushes or rebase.
# Airbnb React/JSX Style Guide - Summary
- **Component Structure**
- One React component per file (multiple stateless components allowed)
- Always use JSX syntax instead of `React.createElement`
- Use `class extends React.Component` for stateful components
- Use function declarations for stateless components
- Don't use mixins
- **Naming & Files**
- Use `.jsx` extension for React components
- Use PascalCase for component filenames and references
- Use camelCase for component instances
- Use composite names for HOCs (e.g., `withFoo(Bar)`)
- **Syntax & Formatting**
- Use double quotes for JSX attributes, single quotes for JS
- Include a space in self-closing tags
- Don't pad JSX curly braces with spaces
- Wrap multiline JSX in parentheses
- Always self-close tags without children
- **Props**
- Use camelCase for prop names
- Omit value when prop is explicitly `true`
- Always include `alt` attributes on `<img>` tags
- Don't use array index as `key` prop
- Define defaultProps for all non-required props
- Use spread props sparingly
- **Methods & Events**
- Use arrow functions to close over local variables
- Bind event handlers in the constructor
- Don't use underscore prefix for internal methods
- Always return a value in render methods
- **Component Organization**
- Follow specific ordering for lifecycle methods
- Follow specific patterns for defining propTypes and defaultProps
- Don't use `isMounted` (anti-pattern)
- Follow Next.js patterns, use app router and correctly use server and client components.
- Use Tailwind CSS for styling.
- Use Shadcn UI for components.
- Use TanStack Query (react-query) for frontend data fetching.
- Use React Hook Form for form handling.
- Use Zod for validation.
- Use React Context for state management.
- Use Prisma for database access.
- Follow AirBnB style guide for code formatting.
- Use PascalCase when creating new React files. UserCard, not user-card.
- Use named exports when creating new react components.
- DO NOT TEACH ME HOW TO SET UP THE PROJECT, JUMP STRAIGHT TO WRITING COMPONENTS AND CODE.
- Follow the Solidity best practices.
- Use the latest version of Solidity.
- Use OpenZeppelin libraries for common patterns like ERC20 or ERC721.
- Utilize Hardhat for development and testing.
- Employ Chai for contract testing.
- Use Infura for interacting with Ethereum networks.
- Follow AirBnB style guide for code formatting.
- Use CamelCase for naming functions and variables in Solidity.
- Use named exports for JavaScript files related to smart contracts.
- DO NOT TEACH ME HOW TO SET UP THE PROJECT, JUMP STRAIGHT TO WRITING CONTRACTS AND CODE.
Please review my Next.js code with a focus on security issues.
Use the below as a starting point, but consider any other potential issues
You do not need to address every single area below, only what is relevant to the user's code.
1. Data Exposure:
- Verify Server Components aren't passing full database objects to Client Components
- Check for sensitive data in props passed to 'use client' components
- Look for direct database queries outside a Data Access Layer
- Ensure environment variables (non NEXT_PUBLIC_) aren't exposed to client
2. Server Actions ('use server'):
- Confirm input validation on all parameters
- Verify user authentication/authorization checks
- Check for unencrypted sensitive data in .bind() calls
3. Route Safety:
- Validate dynamic route parameters ([params])
- Check custom route handlers (route.ts) for proper CSRF protection
- Review middleware.ts for security bypass possibilities
4. Data Access:
- Ensure parameterized queries for database operations
- Verify proper authorization checks in data fetching functions
- Look for sensitive data exposure in error messages
Key files to focus on: files with 'use client', 'use server', route.ts, middleware.ts, and data access functions.
Review this API route for security vulnerabilities. Ask questions about the context, data flow, and potential attack vectors. Be thorough in your investigation.
Create a client component with the following functionality. If writing this as a server component is not possible, explain why.
Analyze this code for data validation vulnerabilities. Ask about data sources, validation rules, and how the data is used throughout the application.
Your task is to analyze the user's code to help them understand it's current caching behavior, and mention any potential issues.
Be concise, only mentioning what is necessary.
Use the following as a starting point for your review:
1. Examine the four key caching mechanisms:
- Request Memoization in Server Components
- Data Cache behavior with fetch requests
- Full Route Cache (static vs dynamic rendering)
- Router Cache for client-side navigation
2. Look for and identify:
- Fetch configurations (cache, revalidate options)
- Dynamic route segments and generateStaticParams
- Route segment configs affecting caching
- Cache invalidation methods (revalidatePath, revalidateTag)
3. Highlight:
- Potential caching issues or anti-patterns
- Opportunities for optimization
- Unexpected dynamic rendering
- Unnecessary cache opt-outs
4. Provide clear explanations of:
- Current caching behavior
- Performance implications
- Recommended adjustments if needed
Lastly, point them to the following link to learn more: https://nextjs.org/docs/app/building-your-application/caching
Create a new Next.js page based on the following description.
No Data configured
No MCP Servers configured