Explain SLOP code - understand what SLOP code does and how it works
Explains SLOP code by analyzing structure, data flow, and patterns.
/plugin marketplace add standardbeagle/standardbeagle-tools/plugin install slop-coder@standardbeagle-toolsAnalyze and explain SLOP code, breaking down its structure, logic, and behavior.
/slop-explain
Then provide or paste the SLOP code you want explained.
When explaining SLOP code:
For functions:
For loops:
For LLM calls:
Follow data from input to output:
Recognize common SLOP patterns:
## Overview
<One sentence summary of what the code does>
## Structure
- **Functions defined:** <list>
- **External services:** <list>
- **Entry point:** <description>
## Detailed Walkthrough
### Section 1: <name>
<Explanation of what this section does>
### Section 2: <name>
<Explanation of what this section does>
## Data Flow
1. <Step 1>
2. <Step 2>
3. <Step 3>
## Output
<What is emitted and when>
## Safety Features
- <Feature 1>
- <Feature 2>
Given this code:
def classify(text, categories):
response = llm.call(
prompt: "Classify this text into one of: {categories}\n\nText: {text}",
schema: {
category: string,
confidence: float
}
)
return response
texts = ["Great product!", "Terrible service", "It's okay"]
for text in texts with limit(100):
result = classify(text, ["positive", "negative", "neutral"])
emit(text: text, category: result.category, confidence: result.confidence)
emit(status: "complete", count: len(texts))
Explanation:
This code classifies a list of text samples into sentiment categories using an LLM.
classify(text, categories)texts listTakes a text string and list of categories. Calls the LLM with a classification prompt and expects a structured response containing:
category: The chosen classificationconfidence: A confidence score (0.0-1.0)Iterates over the texts list with a safety limit of 100 iterations.
For each text:
classify() with the text and category optionsEmits a completion status with the total count processed.
{text: "...", category: "positive", confidence: 0.95}{status: "complete", count: 3}limit(100)