xiaohongshu
xiaohongshu
antipattern-catalog
Document technical debt, anti-patterns, and patterns to avoid from analyzed frameworks. Use when (1) creating a "Do Not Repeat" list from framework analysis, (2) categorizing observed code smells and issues, (3) assessing severity of architectural problems, (4) generating remediation suggestions,...
Full skill instructions
Documents technical debt and patterns to avoid.
Issues with code organization, inheritance, and modularity.
| Pattern | Symptom | Example |
|---|---|---|
| Deep Inheritance | 5+ levels of class hierarchy | Agent → BaseAgent → RunnableAgent → ExecutableAgent → ... |
| God Class | One class with 50+ methods | AgentExecutor doing routing, execution, memory, tools |
| Circular Dependencies | Module A imports B, B imports A | agent.py ↔ tools.py |
| Leaky Abstraction | Implementation details exposed | Base class assumes specific LLM response format |
| Premature Abstraction | Over-engineered for flexibility | 5 interfaces for a single implementation |
Issues with runtime behavior and logic.
| Pattern | Symptom | Example |
|---|---|---|
| Hidden State Mutation | State changes not obvious | tool.run() modifies agent's memory |
| Implicit Contracts | Undocumented assumptions | Tools assume specific message format |
| Silent Failures | Errors swallowed | except: pass in tool execution |
| Infinite Loop Risk | No termination guarantee | No step limit on agent loop |
| Race Conditions | Concurrent state access | Shared dict without locks |
Issues with debugging and monitoring.
| Pattern | Symptom | Example |
|---|---|---|
| Hidden LLM Response | Raw response not accessible | Token counts unavailable |
| Opaque Errors | Generic error messages | "Something went wrong" |
| No Tracing | Can't follow execution | No request IDs, no spans |
| Swallowed Context | Information lost | Tool error not fed back to LLM |
| Missing Metrics | No performance data | No latency, token, or cost tracking |
Issues affecting speed and resource usage.
| Pattern | Symptom | Example |
|---|---|---|
| Sync in Async | Blocking calls in async code | requests.get() in async function |
| N+1 Queries | Repeated similar operations | Loading each tool config separately |
| Unbounded Memory | History grows forever | No eviction policy |
| Eager Loading | Loading unused resources | All tools initialized at startup |
| No Caching | Repeated expensive operations | Re-parsing same schema each call |
### [Pattern Name]
**Category**: [Structural/Behavioral/Observability/Performance]
**Severity**: [Critical/Major/Minor/Cosmetic]
**Framework(s)**: [Where observed]
#### Description
[Brief explanation of the anti-pattern]
#### Example
[Code snippet showing the problem]
#### Impact
- [Impact 1]
- [Impact 2]
#### Remediation
[How to fix or avoid this pattern]
#### Code Example (Fixed)
[Corrected code snippet]
Problem:
class Agent(BaseAgent):
pass
class BaseAgent(RunnableAgent):
pass
class RunnableAgent(ExecutableAgent):
pass
class ExecutableAgent(ConfigurableAgent):
pass
class ConfigurableAgent(LoggableAgent):
pass
class LoggableAgent(ABC):
pass
# 6 layers! Which method comes from where?
Remediation: Prefer composition over inheritance
class Agent:
def __init__(
self,
executor: Executor,
config: Config,
logger: Logger
):
self.executor = executor
self.config = config
self.logger = logger
Problem:
def run_tool(self, tool, args):
try:
return tool.execute(args)
except Exception:
return None # Error lost forever!
Remediation: Capture and propagate errors
def run_tool(self, tool, args) -> ToolResult:
try:
output = tool.execute(args)
return ToolResult(success=True, output=output)
except Exception as e:
return ToolResult(
success=False,
error=f"{type(e).__name__}: {e}",
traceback=traceback.format_exc()
)
Problem:
class LLMWrapper:
def generate(self, prompt: str) -> str:
response = self.client.chat(prompt)
return response.content # Token counts, model info lost!
Remediation: Expose full response
class LLMWrapper:
def generate(self, prompt: str) -> LLMResponse:
response = self.client.chat(prompt)
return LLMResponse(
content=response.content,
model=response.model,
usage=TokenUsage(
prompt=response.usage.prompt_tokens,
completion=response.usage.completion_tokens
),
raw=response # Always keep raw
)
# Anti-Pattern Catalog: [Analysis Name]
## Summary
| Severity | Count |
|----------|-------|
| Critical | 2 |
| Major | 5 |
| Minor | 8 |
| Cosmetic | 3 |
## Critical Issues
### 1. [Pattern Name]
[Full catalog entry]
### 2. [Pattern Name]
[Full catalog entry]
## Major Issues
### 1. [Pattern Name]
[Full catalog entry]
...
## Do Not Repeat Checklist
- [ ] Never use more than 3 levels of inheritance
- [ ] Always expose raw LLM response with token counts
- [ ] Never swallow exceptions without logging
- [ ] Always include step limits on agent loops
- [ ] Never mutate shared state without locks
- [ ] Always provide structured error feedback to LLM
...
architecture-synthesis for design decisionscomparative-matrix for pattern comparisonxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience