Skip to main content

generate-run-commands

Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.

跳到安装

来源信息

仓库
microsoft/vscode
最近来源活动
2026年4月9日 21:53
检测到的 SKILL.md 语言
英语
星标
192,746
分支
42,911

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
generate-run-commands
description
Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.
<!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. --> # Generate Run Commands Help the user set up run commands for the current Agent Session workspace. Run commands appear in the session's Run button in the title bar. ## Understanding the task schema A run command is a `tasks.json` task with: - `"inAgents": true` — required: makes the task appear in the Agents run button - `"runOptions": { "runOn": "worktreeCreated" }` — optional: auto-runs the task whenever a new worktree is created (use for setup/install commands) ```json { "tasks": [ { "label": "Install dependencies", "type": "shell", "command": "npm install", "inAgents": true, "runOptions": { "runOn": "worktreeCreated" } }, { "label": "Start dev server", "type": "shell", "command": "npm run dev", "inAgents": true } ] } ``` ## Decision logic **First, read the existing `.vscode/tasks.json`** to check for existing run commands (`inAgents: true` tasks). **If run commands already exist:** treat this as a modify request — ask the user what they'd like to change (add, remove, or update a command). **If no run commands exist:** try to infer the right commands from the workspace: - Check `package.json`, `Makefile`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `.nvmrc`, or other project files to understand the stack and common commands. - If it's clear what the setup command is (e.g., `npm install`, `pip install -r requirements.txt`), add it with `"runOptions": { "runOn": "worktreeCreated" }` — no need to ask. - If it's clear what the primary run/dev command is (e.g., `npm run dev`, `cargo run`), add it with just `"inAgents": true`. - **Only ask the user** if the commands are ambiguous (e.g., multiple equally valid options, no recognizable project structure, or the project uses a non-standard setup). ## Writing the file Always write to `.vscode/tasks.json` in the workspace root. If the file already exists, merge — do not overwrite unrelated tasks. After writing, briefly confirm what was added and how to trigger it from the Run button.
在 GitHub 查看