logic-master
π―Skillfrom mineru98/skills-store
logic-master skill from mineru98/skills-store
Installation
npx skills add https://github.com/mineru98/skills-store --skill logic-masterSkill Details
Logic optimization and image-based code tasks with Codex CLI in --yolo mode. Use when (1) optimizing code logic or algorithms, (2) processing image inputs (screenshots, diagrams, mockups) to generate or modify code, (3) refactoring business logic, (4) debugging complex logic issues, (5) code generation from visual references, or (6) any task requiring image attachment for context.
Overview
# Codex Logic Skill
Execute logic optimization and image-based code tasks using Codex CLI in --yolo mode.
When to Use
- Logic optimization: algorithm improvements, performance tuning
- Image-based tasks: generate code from screenshots, mockups, diagrams
- Refactoring: extract functions, simplify conditionals, reduce complexity
- Business logic: validation rules, data transformations, state machines
- Debugging: fix complex logic bugs, race conditions
When NOT to Use
- Visual/styling changes (use
frontend-masterskill instead) - CSS, layout, colors, typography, animations
Execution Pattern
Basic Command Structure
```bash
# Direct prompt
codex exec --yolo "
# With file context via stdin
cat
# With image attachment
codex exec --yolo --image
# With directory context
codex exec --yolo -C
```
Required Flags
| Flag | Purpose |
|------|---------|
| --yolo | MANDATORY - Auto-approve and bypass sandbox |
| --image or -i | Attach image files for visual context |
| --json | Get JSONL event stream for parsing |
| -o or --output-last-message | Save final output to file |
| -C or --cd | Change working directory |
| --sandbox | Set access level (workspace-write recommended) |
| --model or -m | Override model selection |
Workflow
- Identify task type: logic optimization or image-based
- Prepare inputs: file content or image path
- Construct Codex command with
--yoloflag - Execute via bash tool
- Capture output and delegate to subagent for implementation
- Verify results with
lsp_diagnostics
Image-Based Tasks
Generate Code from Screenshot
```bash
# UI mockup to component
codex exec --yolo --image mockup.png "Generate React component matching this design"
# Diagram to code
codex exec --yolo --image architecture.png "Implement the data flow shown in this diagram"
# Error screenshot to fix
codex exec --yolo --image error-screenshot.png "Analyze this error and provide fix"
```
Multiple Images
```bash
codex exec --yolo --image before.png --image after.png "Generate code to transform UI from before to after state"
```
Logic Optimization Tasks
Algorithm Optimization
```bash
# Optimize function
cat src/utils/sort.ts | codex exec --yolo - "Optimize this sorting algorithm for large datasets"
# Reduce complexity
cat src/services/parser.ts | codex exec --yolo - "Refactor to reduce cyclomatic complexity"
```
Refactoring
```bash
# Extract functions
cat src/handlers/user.ts | codex exec --yolo - "Extract reusable validation logic into separate functions"
# Simplify conditionals
cat src/logic/pricing.ts | codex exec --yolo - "Simplify nested conditionals using early returns"
```
Performance Tuning
```bash
# Memory optimization
cat src/data/processor.ts | codex exec --yolo - "Optimize memory usage, avoid unnecessary allocations"
# Async optimization
codex exec --yolo -C src/services "Identify and fix N+1 query patterns"
```
Output Handling
JSON Output for Parsing
```bash
codex exec --yolo --json "Generate utility function" | jq -r '.content'
```
Save to File
```bash
codex exec --yolo -o result.ts "Generate TypeScript interface from this JSON schema"
```
Resume Session
```bash
# Continue previous work
codex exec resume --last "Apply the suggested changes"
```
Integration with Subagents
After Codex CLI provides analysis/suggestions, delegate implementation:
```
- TASK: Implement logic changes based on Codex analysis
- EXPECTED OUTCOME: Optimized code matching Codex recommendations
- REQUIRED SKILLS: logic-master
- REQUIRED TOOLS: Bash (for codex CLI), Read, Edit, lsp_diagnostics
- MUST DO:
- Execute codex exec with --yolo flag first
- Parse Codex output for implementation steps
- Apply changes using Edit tool
- Verify with lsp_diagnostics
- Run tests if available
- MUST NOT DO:
- Modify styling/visual elements
- Skip verification step
- Ignore Codex warnings or caveats
- CONTEXT: [file paths, performance requirements, constraints]
```
Image-Based Workflow Example
```
- TASK: Generate component from design mockup
- EXPECTED OUTCOME: Working React component matching mockup
- REQUIRED SKILLS: logic-master
- REQUIRED TOOLS: Bash (for codex CLI), Write, lsp_diagnostics
- MUST DO:
- Use codex exec --yolo --image
- Create component based on Codex output
- Match existing component patterns in codebase
- Verify types with lsp_diagnostics
- MUST NOT DO:
- Generate inline styles (use existing CSS framework)
- Create new dependencies without approval
- CONTEXT: [mockup path, component location, existing patterns]
```
Example Complete Workflow
```bash
# Step 1: Analyze image and get code suggestion
codex exec --yolo --image ui-mockup.png "Analyze this mockup and describe the React component structure needed" -o analysis.md
# Step 2: Generate implementation
codex exec --yolo --image ui-mockup.png "Generate React component code for this mockup using Tailwind CSS" -o Component.tsx
# Step 3: Verify and integrate
# (delegate to subagent to place file, add imports, run diagnostics)
```
Troubleshooting
| Issue | Solution |
|-------|----------|
| Image not recognized | Use absolute path or ensure file exists |
| Command hangs | Ensure --yolo flag is present |
| Sandbox errors | Add --sandbox workspace-write |
| Large output truncated | Use -o to save full output |
| Model unavailable | Try --model gpt-4o or check API key |
Security Note
--yolo mode bypasses approval and sandbox restrictions. Use only when:
- Working in version-controlled directories
- Changes can be easily reverted
- No sensitive operations or credentials involved
- Running in isolated development environment
More from this repository7
explaining-code skill from mineru98/skills-store
frontend-design-patterns skill from mineru98/skills-store
Detects and automatically fixes PowerShell script encoding issues, ensuring correct display of non-ASCII characters like Korean text and emojis on Windows.
Analyzes Excel files to detect data quality issues, format inconsistencies, and generate comprehensive statistical reports with actionable insights.
Guides creating specialized Claude subagents for targeted, efficient task delegation across different domains. ``` Generates specialized subagents for precise, domain-specific task delegation and ...
commands-creator skill from mineru98/skills-store
Transforms frontend UI/UX by automatically modifying styling, layout, components, and responsive designs using Gemini CLI in --yolo mode.