Codex is your intelligent coding assistant that accelerates software development by automating repetitive tasks and providing instant coding solutions. Save time and enhance productivity with Codex, the ultimate tool for developers of all levels.
npx skills add sh/agentsCodex is your intelligent coding assistant that accelerates software development by automating repetitive tasks and providing instant coding solutions. Save time and enhance productivity with Codex, the ultimate tool for developers of all levels.
Code generation
Debugging assistance
Learning new programming languages
npx skills add sh/agentsgit clone https://github.com/sh/agentsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as a coding assistant. I'm working on a [PROGRAMMING_LANGUAGE] project for [COMPANY] in the [INDUSTRY] sector. I need help with [SPECIFIC_TASK]. Provide me with a code snippet, explain the logic, and suggest best practices for this scenario.
# Code Review and Optimization for E-Commerce Platform
## Current Code Analysis
```python
def calculate_discount(price, discount_code):
if discount_code == 'SUMMER20':
return price * 0.8
elif discount_code == 'BLACKFRIDAY':
return price * 0.7
else:
return price
```
## Issues Identified
- **Hardcoded Discounts**: Discount codes and percentages are hardcoded, making updates cumbersome.
- **Limited Flexibility**: The function doesn't account for invalid discount codes or expired promotions.
- **No Logging**: There's no tracking of applied discounts for analytics.
## Optimized Solution
```python
class DiscountManager:
def __init__(self):
self.discounts = {
'SUMMER20': 0.2,
'BLACKFRIDAY': 0.3,
'NEWYEAR': 0.15
}
self.active_discounts = self.discounts
def apply_discount(self, price, discount_code):
if discount_code in self.active_discounts:
discount_percentage = self.active_discounts[discount_code]
discounted_price = price * (1 - discount_percentage)
return discounted_price
return price
```
## Implementation Recommendations
- **Database Integration**: Store discount codes and percentages in a database for easy management.
- **Validation**: Add input validation for discount codes and price values.
- **Logging**: Implement logging to track discount usage patterns.
- **Unit Tests**: Create comprehensive unit tests to ensure discount logic works as expected.Your one-stop shop for church and ministry supplies.
Automate your browser workflows effortlessly
Gain insights into SaaS spending with real-time analytics and budget forecasting tools.
Orchestrate workloads with multi-cloud support, job scheduling, and integrated service discovery features.
Manage CI/CD processes efficiently with build configuration as code and multi-language support.
Enhance performance monitoring and root cause analysis with real-time distributed tracing.
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan