simpy
Qué hace
Esta skill enseña a tu agente a construir simulaciones de eventos discretos con SimPy, un marco de trabajo de Python. Modela entidades que compiten por recursos. Está pensada para analistas e ingenieros que planifican procesos o capacidad.
Cuándo usarla
- ✓Cuando quieres modelar una cola de clientes que esperan a un número limitado de personal.
- ✓Cuando necesitas probar cómo se comporta una línea de fábrica con más o menos máquinas.
- ✓Cuando planificas la capacidad de un sistema logístico o de red.
Link de la skill
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/scientific/simpy/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Simula una clínica con tres médicos y llegadas aleatorias de pacientes, y dime el tiempo medio de espera.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente escribe los procesos como funciones generadoras de Python, configura los recursos compartidos y ejecuta el reloj de la simulación. Después recoge los datos de tiempo para informar de los resultados.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
SimPy - Discrete-Event Simulation
Overview
SimPy is a process-based discrete-event simulation framework based on standard Python. Use SimPy to model systems where entities (customers, vehicles, packets, etc.) interact with each other and compete for shared resources (servers, machines, bandwidth, etc.) over time.
Core capabilities:
- Process modeling using Python generator functions
- Shared resource management (servers, containers, stores)
- Event-driven scheduling and synchronization
- Real-time simulations synchronized with wall-clock time
- Comprehensive monitoring and data collection
When to Use This Skill
Use the SimPy skill when:
- Modeling discrete-event systems - Systems where events occur at irregular intervals
- Resource contention - Entities compete for limited resources (servers, machines, staff)
- Queue analysis - Studying waiting lines, service times, and throughput
- Process optimization - Analyzing manufacturing, logistics, or service processes
- Network simulation - Packet routing, bandwidth allocation, latency analysis
- Capacity planning - Determining optimal resource levels for desired performance
- System validation - Testing system behavior before implementation
Not suitable for:
- Continuous simulations with fixed time steps (consider SciPy ODE solvers)
- Independent processes without resource sharing
- Pure mathematical optimization (consider SciPy optimize)
Quick Start
Basic Simulation Structure
import simpy
def process(env, name):
"""A simple process that waits and prints."""
print(f'{name} starting at {env.now}')
yield env.timeout(5)
print(f'{name} finishing at {env.now}')
# Create environment
env = simpy.Environment()
# Start processes
env.process(process(env, 'Process 1'))
env.process(process(env, 'Process 2'))
# Run simulation
env.run(until=10)
Resource Usage Pattern
import simpy
def customer(env, name, resource):
"""Customer requests resource, uses it, then releases."""
with resource.request() as req:
yield req # Wait for resource
print(f'{name} got resource at {env.now}')
yield env.timeout(3) # Use resource
print(f'{name} released resource at {env.now}')
env = simpy.Environment()
server = simpy.Resource(env, capacity=1)
env.process(customer(env, 'Customer 1', server))
env.process(customer(env, 'Customer 2', server))
env.run()
Core Concepts
1. Environment
The simulation environment manages time and schedules events.
import simpy
# Standard environment (runs as fast as possible)
env = simpy.Environment(initial_time=0)
# Real-time environment (synchronized with wall-clock)
import simpy.rt
env_rt = simpy.rt.RealtimeEnvironment(factor=1.0)
# Run simulation
env.run(until=100) # Run until time 100
env.run() # Run until no events remain
2. Processes
Processes are defined using Python generator functions (functions with yield statements).
def my_process(env, param1, param2):
"""Process that yields events to pause execution."""
print(f'Starting at {env.now}')
# Wait for time to pass
yield env.timeout(5)
print(f'Resumed at {env.now}')
# Wait for another event
yield env.timeout(3)
print(f'Done at {env.now}')
return 'result'
# Start the process
env.process(my_process(env, 'value1', 'value2'))
3. Events
Events are the fundamental mechanism for process synchronization. Processes yield events and resume when those events are triggered.
Common event types:
env.timeout(delay)- Wait for time to passresource.request()- Request a resourceenv.event()- Create a custom eventenv.process(func())- Process as an eventevent1 & event2- Wait for all events (AllOf)event1 | event2- Wait for any event (AnyOf)
Resources
SimPy provides several resource types for different scenarios. For comprehensive details, see references/resources.md.
Resource Types Summary
| Resource Type | Use Case |
|---|---|
| Resource | Limited capacity (servers, machines) |
| PriorityResource | Priority-based queuing |
| PreemptiveResource | High-priority can interrupt low-priority |
| Container | Bulk materials (fuel, water) |
| Store | Python object storage (FIFO) |
| FilterStore | Selective item retrieval |
| PriorityStore | Priority-ordered items |
Quick Reference
import simpy
env = simpy.En
Preguntas frecuentes
¿Qué es una simulación de eventos discretos?
Es un modelo en el que las cosas ocurren en momentos concretos, como una llegada o una finalización, y no de forma continua.
¿Puede ejecutarse en tiempo real?
Sí. La skill menciona simulaciones en tiempo real sincronizadas con el reloj.
¿Sirve para planificar la capacidad?
Sí. La skill menciona el uso de simulaciones para encontrar los niveles de recursos adecuados.
Detalles
Descripción original del autor
Process-based discrete-event simulation framework in Python. Use this skill when building simulations of systems with processes, queues, resources, and time-based events such as manufacturing systems, service operations, network traffic, logistics, or any system where entities interact with shared resources over time.
Popularidad
- Estrellas en GitHub
- 33 mil
- Posición en el ranking
- #9030
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
owasp-security
33 milEnseña a tu agente la guía de seguridad OWASP para webs, APIs, móviles, contenedores y agentes de IA, para detectar debilidades comunes y sugerir correcciones.
agent-management
33 milPermite que tu agente cree, liste, hiberne, despierte, renombre y elimine agentes de IA con la CLI de AI Maestro, gestionando su ciclo de vida.
agent-messaging
33 milPermite que tu agente envíe, reciba y responda mensajes firmados entre agentes de IA con el Protocolo de Mensajería de Agentes, sobre todo en tu equipo.
docs-search
33 milBusca en la documentación generada del código las firmas de funciones, clases y comentarios, para revisar la API real antes de cambiar nada.
Skills parecidas
gitcrawl
394 milPermite que tu agente busque en un archivo guardado de incidencias y pull requests de GitHub, agrupe duplicados y revise su estado actual en GitHub.
slacrawl
394 milPermite que tu agente busque y cuente mensajes en un archivo local de Slack, revise qué tan reciente es y lo actualice cuando haga falta.
goplaces
394 milAyuda a tu agente a buscar lugares, obtener sus detalles y reseñas, y resolver nombres de lugares usando Google Places, con salida JSON para scripts.