Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

create-playground创建游乐场

Agent Skill

create-playground 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

196

周安装

8

GitHub Stars

1

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:create-playground(创建游乐场)
来源仓库:https://github.com/dudusoar/vrp-toolkit
仓库路径:skills/create-playground
安装命令:
npx skills add https://github.com/dudusoar/vrp-toolkit --skill create-playground
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/dudusoar/vrp-toolkit --skill create-playground

简介

构建交互式 Streamlit 游乐场,让用户通过实验而非阅读代码来学习 VRP 算法。

  • 支持问题选择、实例生成、结果可视化和算法对比等探索式学习功能。
  • 采用三层学习模型:界面操作→管道理解→机制掌握,循序渐进提升认知深度。
  • 使用前应确认 Streamlit 环境就绪,避免因依赖缺失导致 playground 无法启动。
  • create-playground 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Create Playground Skill

Create and maintain an interactive Streamlit playground that enables "learn by playing" instead of "learn by reading code."

Goal

Build and evolve a web-based playground where users can:

  1. Explore VRP problems interactively (select, generate, visualize instances)
  2. Experiment with algorithms (configure parameters, run solvers, compare results)
  3. Learn through interaction (understand interfaces, pipelines, mechanisms)
  4. Reproduce experiments (save configs, replay runs, export results)

Core Philosophy

Following the vision in playground/VISION.md:

  • Three-layer learning: Interface → Pipeline → Mechanism
  • Minimal cognitive load: Only expose what's needed for current task
  • Contract-based trust: Playground behavior matches actual code (verified by tests)
  • Just-in-time learning: Dive deeper only when hitting limitations

Workflow

Step 1: Analyze User Request

Understand what the user wants to learn or build:

Questions to ask:

  • What feature/algorithm do you want to explore?
  • Which parameters are most important?
  • What level of detail (beginner/intermediate/advanced)?
  • What kind of visualization helps understanding?

Common requests:

  • "Add support for CVRP problems"
  • "Show how temperature affects ALNS search"
  • "Visualize operator impact step-by-step"
  • "Compare two algorithm configurations"

Step 2: Design UI/UX

Choose appropriate Streamlit components:

Reference: references/ui_components.md for patterns

Component selection guide:

  • Parameters: st.slider, st.number_input, st.selectbox
  • Problem definition: st.file_uploader, st.radio, st.multiselect
  • Visualization: st.pyplot, st.plotly_chart, st.map
  • Results: st.dataframe, st.metric, st.json
  • Layout: st.columns, st.tabs, st.expander

Progressive disclosure:

  • Start with 5-10 key parameters
  • Hide advanced parameters in st.expander("Advanced")
  • Use defaults for 80% use cases

Step 3: Integrate VRP-Toolkit Modules

Map playground interactions to toolkit APIs:

Reference: references/integration_patterns.md for examples

Integration checklist:

  • Import correct modules (from vrp_toolkit.problems import...)
  • Convert UI inputs to API format (e.g., sliders → config dict)
  • Handle errors gracefully (try-except with user-friendly messages)
  • Extract outputs for display (solution → routes, cost, metrics)

Key integration points:

  1. Problem layer: PDPTWInstance, VRPProblem, etc.
  2. Algorithm layer: ALNSSolver, ALNSConfig, etc.
  3. Data layer: OrderGenerator, DemandGenerator, RealMap
  4. Visualization layer: PDPTWVisualizer, route plotting

Step 4: Implement Visualization

Make algorithm behavior visible:

Visualization types:

  • Route maps: Show vehicle routes on 2D map with nodes/edges
  • Convergence plots: Cost vs. iteration (line chart)
  • Operator impact: Before/after comparison (side-by-side)
  • Metrics dashboard: Cost breakdown, constraint violations, runtime

Best practices:

  • Use existing vrp_toolkit.visualization modules when possible
  • Add interactive elements (hover for details, zoom, pan)
  • Color-code for clarity (feasible=green, infeasible=red)
  • Include legends and axis labels

Step 5: Add Contract Tests

Ensure playground behavior matches actual code:

Reference: Create tests in contracts/ directory

Critical contracts to test:

  1. Reproducibility: Same seed + same config → same result def test_reproducibility(): config = {...} result1 = run_with_seed(config, seed=42) result2 = run_with_seed(config, seed=42) assert result1 == result2
  2. Feasibility: Playground claims "feasible" → solution actually feasible def test_feasibility_contract(): solution = playground_run(...) if playground_says_feasible(solution): assert actually_feasible(solution)
  3. Evaluation consistency: Playground displays correct objective value def test_objective_value_contract(): solution = playground_run(...) displayed_cost = playground_display_cost(solution) actual_cost = solution.objective_value assert displayed_cost == actual_cost
  4. Parameter validation: Invalid inputs rejected with clear messages def test_parameter_validation(): with pytest.raises(ValueError, match="num_vehicles must be positive"): playground_run(num_vehicles=-1)

Step 6: Update Documentation

Keep documentation synchronized with playground features:

Files to update:

  1. playground/README.md - User-facing usage guide

- Installation instructions - How to launch playground - Quick start guide - Feature overview

  1. playground/FEATURES.md - Feature tracking

- Current features (with status: ✅ Stable, 🚧 Beta, 🔮 Planned) - Recent additions - Known limitations - Roadmap

  1. playground/ARCHITECTURE.md - Technical documentation

- File structure (app.py, pages/, components/, utils/) - Component responsibilities - State management (session_state usage) - Extension guide (how to add new features)

  1. CHANGELOG_LEARNINGS.md (if bugs fixed)

- Root cause analysis - Fix description - Impact on playground features - New contract tests added

Component Structure

Organize playground code for maintainability:

playground/
├── app.py                    # Main entry point (home page)
├── pages/                    # Multi-page app sections
│   ├── 1_Problem_Definition.py
│   ├── 2_Algorithm_Config.py
│   └── 3_Experiments.py
├── components/               # Reusable UI components
│   ├── instance_viewer.py   # Display instance details
│   ├── route_visualizer.py  # Plot routes on map
│   ├── convergence_plot.py  # Show cost over iterations
│   └── metrics_dashboard.py # Display KPIs
├── utils/                    # Helper functions
│   ├── state_manager.py     # Session state management
│   ├── export_utils.py      # Save/load experiments
│   └── validation.py        # Input validation
├── README.md                 # Usage guide
├── FEATURES.md               # Feature tracking
├── ARCHITECTURE.md           # Technical docs
└── requirements.txt          # Streamlit + dependencies

Development Stages

Stage 1: MVP (Minimal Viable Playground)

Timeline: 1-2 evenings Goal: Get something playable

Features:

  • Single-page app with basic workflow
  • Instance selection (upload CSV or generate synthetic)
  • Algorithm config (5-10 key parameters)
  • Run button → display results
  • Route visualization + cost metric

Deliverables:

  • playground/app.py (~200 lines)
  • playground/README.md (installation + quick start)
  • 1-2 contract tests (reproducibility, feasibility)

Stage 2: Explainability & Quality

Timeline: 2-3 evenings Goal: Make learning actionable

Features:

  • Multi-page app (Problem | Algorithm | Experiments)
  • Seed control for reproducibility
  • Convergence plot (cost vs. iteration)
  • Experiment saving (runs/ directory)
  • Contract test suite (5+ tests)

Deliverables:

  • playground/pages/ (3 pages)
  • contracts/ (5+ tests)
  • runs/ directory structure
  • playground/FEATURES.md

Stage 3: Gamified Learning

Timeline: Future iterations Goal: Self-driven learning

Features:

  • Learning missions ("Get feasible solution in 30s")
  • Step-by-step operator visualization
  • Parameter impact hints
  • Achievement tracking

Common Patterns

Pattern 1: Parameter Configuration UI

import streamlit as st

def render_algorithm_config():
    """Render ALNS parameter configuration UI."""
    st.subheader("ALNS Configuration")

    # Core parameters (always visible)
    max_iterations = st.slider("Max Iterations", 100, 10000, 1000, step=100)
    start_temp = st.number_input("Start Temperature", 0.1, 100.0, 10.0)

    # Advanced parameters (in expander)
    with st.expander("Advanced Parameters"):
        cooling_rate = st.slider("Cooling Rate", 0.90, 0.99, 0.95)
        segment_length = st.number_input("Segment Length", 10, 200, 100)

    # Create config object
    from vrp_toolkit.algorithms.alns import ALNSConfig
    config = ALNSConfig(
        max_iterations=max_iterations,
        start_temp=start_temp,
        cooling_rate=cooling_rate,
        segment_length=segment_length
    )

    return config

Pattern 2: Experiment Saving/Loading

import json
from datetime import datetime
from pathlib import Path

def save_experiment(config, solution, metrics):
    """Save experiment to runs/ directory."""
    timestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
    run_dir = Path(f"runs/{timestamp}")
    run_dir.mkdir(parents=True, exist_ok=True)

    # Save config
    with open(run_dir / "config.json", "w") as f:
        json.dump(config, f, indent=2)

    # Save solution
    with open(run_dir / "solution.json", "w") as f:
        json.dump(solution.to_dict(), f, indent=2)

    # Save metrics
    with open(run_dir / "metrics.json", "w") as f:
        json.dump(metrics, f, indent=2)

    st.success(f"Experiment saved to {run_dir}")
    return run_dir

Pattern 3: Error Handling

def run_algorithm_with_feedback():
    """Run algorithm with user-friendly error handling."""
    try:
        solution = solver.solve(instance)
        st.success("✅ Algorithm completed successfully")
        return solution
    except ValueError as e:
        st.error(f"❌ Invalid input: {e}")
        st.info("💡 Hint: Check that all parameters are positive")
        return None
    except Exception as e:
        st.error(f"❌ Unexpected error: {e}")
        st.warning("🐛 This might be a bug. Please report it.")
        return None

Quality Checklist

Before marking a playground feature as "complete":

  • Functionality: Feature works as designed
  • UI/UX: Interface is intuitive (5-second rule: can user figure it out in 5s?)
  • Integration: Correctly calls vrp-toolkit APIs
  • Visualization: Results are clearly visible
  • Error handling: Invalid inputs show helpful messages
  • Contract tests: At least 1 test verifies feature behavior
  • Documentation: README.md and FEATURES.md updated
  • Reproducibility: Same inputs → same outputs (when using fixed seed)

Integration with Other Skills

Works with:

  • maintain-architecture-map: Reference ARCHITECTURE_MAP.md to understand module structure
  • maintain-data-structures: Reference data structure docs when integrating APIs
  • create-tutorial: Playground features can inspire tutorial topics
  • track-learnings: When bugs found, use track-learnings to document fixes

Maintains:

  • playground/README.md
  • playground/FEATURES.md
  • playground/ARCHITECTURE.md
  • contracts/ tests

References

  • references/streamlit_guide.md - Streamlit basics and best practices
  • references/ui_components.md - Common UI component patterns
  • references/integration_patterns.md - How to integrate vrp-toolkit modules
  • playground/VISION.md - Design philosophy and principles

Remember: The goal is learning through interaction, not building a production app. Prioritize clarity and educational value over performance optimization.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.43%
按下载量换算19

windsurf

20.95%
按下载量换算13

trae

16.98%
按下载量换算11

OpenCode

11.69%
按下载量换算7

Codex

7.3%
按下载量换算5

github-copilot

3.3%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills