用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/bdfinst/vsm-workshop --skill run-simulation命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | run-simulation |
| description | Create or run simulation features for analyzing work flow through value streams |
| user-invocable | true |
| allowed-tools | Read, Write, Edit, Grep, Glob, Bash |
Add a new simulation or what-if scenario feature.
/run-simulation <feature-name>
Create a feature file first using /new-feature that describes:
Feature: Work Flow Simulation
As a team analyzing their process
I want to simulate work flowing through our value stream
So that I can identify bottlenecks and queuing problems
Scenario: Run basic flow simulation
Given a value stream with 3 steps
And each step has capacity for 1 item at a time
When I add 5 work items to the queue
And run the simulation
Then I should see items move through each step
And completed items should appear at the end
Scenario: Identify bottleneck through simulation
Given a value stream where step 2 takes twice as long as others
When I run the simulation with 10 work items
Then step 2 should show the largest queue buildup
And it should be highlighted as a bottleneck
Scenario: Adjust batch size and see impact
Given a value stream with batch size of 5 at deployment
When I change batch size to 1
And run the simulation comparison
Then I should see reduced lead time in the smaller batch scenario
Simulations follow this pattern:
src/utils/simulation/{feature}.jssrc/components/simulation/{Feature}Config.jsxsrc/components/simulation/{Feature}Viz.jsxsrc/components/simulation/{Feature}Results.jsx// src/utils/simulation/{feature}.js
/**
* Initialize simulation state
* @param {Object} vsm - Value stream map
* @param {Object} config - Simulation configuration
* @returns {Object} Initial simulation state
*/
export function initializeSimulation(vsm, config) {
return {
currentTick: 0,
workItems: Array.from({ length: config.workItemCount }, (_, i) => ({
id: `item-${i}`,
currentStep: null,
stepProgress: 0,
history: []
})),
stepStates: new Map(vsm.steps.map(step => [
step.id,
{ queue: [], processing: null, completed: 0 }
])),
metrics: {
throughput: 0,
avgCycleTime: 0,
maxQueueSize: 0
}
};
}
/**
* Simulate one tick of the system
* Pure function: returns new state without mutation
* {} - Current simulation state
* {} - Value stream map
* {} New simulation state
*/
() {
newState = {
...state,
: state. + ,
: [...state.],
: (state.)
};
( step vsm.) {
}
newState. = (newState);
newState;
}
() {
state = (vsm, config);
history = [state];
( i = ; i < config.; i++) {
state = (state, vsm);
history.(state);
}
{
: state,
history,
: (history, vsm)
};
}
// src/components/simulation/{Feature}Viz.jsx
import { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
function {Feature}Viz({ simulationHistory, speed }) {
const [currentFrame, setCurrentFrame] = useState(0);
useEffect(() => {
if (currentFrame >= simulationHistory.length - 1) return;
const timer = setTimeout(() => {
setCurrentFrame(f => f + 1);
}, 1000 / speed);
return () => clearTimeout(timer);
}, [currentFrame, simulationHistory.length, speed]);
const state = simulationHistory[currentFrame];
return (
<div data-testid="simulation-viz">
<div className="simulation-controls">
<span>Tick: {state.currentTick}</span>
<button onClick={() => setCurrentFrame(0)}>Reset</>
{/* Render work items at their current positions */}
);
}
{}. = {
: ..,
: .
};
{}. = {
:
};
{};