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.
["Identify your project: Open your [PROJECT_NAME] repository in your preferred IDE or code editor.","Define scope: Specify the [PROGRAMMING_LANGUAGE] and [AREAS_TO_CHECK] you want Codex to analyze (e.g., 'JavaScript backend, focusing on API integrations and error handling').","Run analysis: Paste the prompt template into your AI assistant, replacing all [PLACEHOLDERS] with your specific context. For advanced users, add additional constraints like performance targets.","Review results: Examine Codex's output which will include code examples, refactoring suggestions, and impact metrics. Use the 'example_output' as a reference for expected format.","Implement fixes: Prioritize recommendations based on your [PERFORMANCE_METRIC] or [MAINTAINABILITY_METRIC] goals. Start with high-impact changes that have clear before/after metrics.","Validate changes: Use your project's test suite and performance monitoring tools to verify the improvements. For database changes, run A/B tests with production-like data volumes."]
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 Codex, an intelligent coding assistant. For the [PROJECT_NAME] repository, analyze the current [PROGRAMMING_LANGUAGE] codebase and identify [NUMBER] common inefficiencies or anti-patterns. For each inefficiency, provide: (1) a concrete code example showing the issue, (2) the recommended refactoring, and (3) the expected performance or maintainability benefit. Focus on areas like [AREAS_TO_CHECK] such as error handling, logging, or API integrations. Prioritize fixes that would have the highest impact on [PERFORMANCE_METRIC] or [MAINTAINABILITY_METRIC].
### Codebase Analysis for 'FinTrack' - Python Repository
I've analyzed the FinTrack codebase (12,450 lines of Python) and identified 5 critical inefficiencies that are impacting performance and maintainability:
1. **Inefficient Database Queries in `transaction_service.py`**
- *Current Issue*: The `get_transactions_by_date_range()` function executes 15 separate SQL queries to build a monthly report, each fetching the same customer data repeatedly.
```python
# Anti-pattern example:
for month in months:
query = f"SELECT * FROM transactions WHERE customer_id = {customer_id} AND date BETWEEN {month_start} AND {month_end}"
results.extend(db.execute(query))
```
- *Recommended Fix*: Use a single query with JOIN operations:
```python
query = """
SELECT t.*, c.name, c.email
FROM transactions t
JOIN customers c ON t.customer_id = c.id
WHERE t.date BETWEEN %s AND %s
"""
results = db.execute(query, (start_date, end_date))
```
- *Impact*: Reduces query time from 8.2s to 120ms (68x improvement) and eliminates N+1 query problem.
2. **Hardcoded API Endpoints in `payment_gateway.py`**
- *Current Issue*: Payment URLs are hardcoded as strings throughout 8 different files, causing maintenance nightmares when endpoints change.
```python
# Anti-pattern:
PAYMENT_API = "https://api.stripe.com/v1/charges"
```
- *Recommended Fix*: Centralize in a configuration file:
```python
# config.py
STRIPE_API = {
'base_url': 'https://api.stripe.com',
'version': 'v1',
'endpoints': {
'charges': '/charges',
'customers': '/customers'
}
}
```
- *Impact*: Reduces maintenance effort by 70% when API versions change and enables easier testing.
3. **Excessive Logging in `user_auth.py`**
- *Current Issue*: Every authentication attempt logs sensitive user data (including passwords) to debug files.
```python
# Anti-pattern:
logger.info(f"User {username} attempted login with password {password}")
```
- *Recommended Fix*: Implement structured logging with sensitive data masking:
```python
logger.info("Authentication attempt", extra={'user': username, 'success': False})
```
- *Impact*: Reduces security risk while maintaining audit capabilities.
4. **Manual Error Handling in `report_generator.py`**
- *Current Issue*: Error handling is duplicated across 12 functions with inconsistent messages.
```python
# Anti-pattern:
try:
data = fetch_data()
except Exception as e:
print(f"Error fetching data: {str(e)}")
raise
```
- *Recommended Fix*: Centralized error handler:
```python
# error_handler.py
def handle_api_error(e, context=""):
logger.error(f"API Error in {context}: {str(e)}")
raise CustomAPIError(f"Failed to {context}: {str(e)}")
```
- *Impact*: Reduces error handling code by 60% and ensures consistent error messages.
5. **Inefficient Data Processing in `financial_calculations.py`**
- *Current Issue*: The `calculate_monthly_roi()` function processes 50,000 records using nested loops (O(n²) complexity).
```python
# Anti-pattern:
for month in months:
for transaction in transactions:
if transaction.month == month:
roi += transaction.amount * transaction.rate
```
- *Recommended Fix*: Use vectorized operations with pandas:
```python
df['roi'] = df['amount'] * df['rate']
monthly_roi = df.groupby('month')['roi'].sum()
```
- *Impact*: Reduces processing time from 45s to 120ms (375x improvement) for large datasets.
**Priority Recommendations:**
1. Fix the database query inefficiency first (highest performance impact)
2. Address the hardcoded API endpoints (highest maintainability impact)
3. Implement centralized error handling (medium impact but quick win)
Would you like me to generate pull request-ready code snippets for any of these fixes?Your one-stop shop for church and ministry supplies.
Automate your browser workflows effortlessly
Control SaaS spending with visibility and analytics
Orchestrate workloads with multi-cloud support, job scheduling, and integrated service discovery features.
CI/CD automation with build configuration as code
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