更新了skill

This commit is contained in:
Myfro9
2026-06-22 16:41:44 +08:00
parent 48b965ec4e
commit 814dbf1681
13 changed files with 845 additions and 13 deletions
+27
View File
@@ -7,6 +7,32 @@ description: Use the LangGraph plan-review workflow from the current Claude Code
Use this skill to run the LangGraph plan-review workflow. All scripts are bundled under the skill's own `scripts\` directory (`C:\Users\bowei\.claude\skills\langgraph-plan-review\scripts\`) — no dependency on `E:\LangGraph_Design\lab00`.
## ⚠️ 强制执行规则(MANDATORY — read first)
**plan-review 工作流必须、且只能通过 `langgraph dev` 服务器来驱动。**
- ✅ **唯一允许的入口**:`run_langgraph.ps1` → `run_workflow.py`。后者是一个**纯 REST/SDK 客户端**
(`langgraph_sdk.get_sync_client(url=http://127.0.0.1:2024)`),每次 start/resume 都把 run
投递到 `langgraph dev` 服务器执行。先用 `manage_dev_server.ps1 start` 把服务器拉起。
这样 LangGraph Studio 才能实时追踪线程、节点、中断与状态。
- 🚫 **绝对禁止**:直接 `import` / 在进程内运行本 skill 的图定义模块
(`scripts\graph.py`、`scripts\workflow.py`、`scripts\agents.py`)来跑工作流。包括但不限于:
- `python -c "from graph import ...; graph.invoke(...)"` 或 `.stream(...)`
- 写临时脚本 build 编译图后在进程内调用
- 任何绕过 `http://127.0.0.1:2024` 的「就地执行」方式
这类调用在 dev server 进程**之外**运行,Studio 追踪不到状态,**一律不允许**——
即使只是想「快速验证一个节点」也不行。
- ℹ️ **例外说明**:`review_task.py`(Codex 评审 shim)会直接调 `codex`,这是**合规的**——
它是由运行在 dev server 内的图通过 `codex_review_command` 调起的评审步骤,不是绕过
dev server 去驱动工作流本身。区别在于:驱动图 = 必须走 dev server;图内部调用的工具 = 正常。
- 🛠 **改了 `graph.py`/`workflow.py`/`agents.py` 后**:dev server 内存里仍是旧代码。先
`manage_dev_server.ps1 stop` 再 `start`(或让 `--reload` 生效),再经 `run_langgraph.ps1`
重跑,使改动在被追踪的运行中生效。
## Pre-flight: Environment Setup
Before running the workflow for the first time (or when unsure the environment is ready), verify that the required packages are installed in the `langgraph` conda env:
@@ -32,6 +58,7 @@ conda run -n langgraph langgraph --version
## Invariants
- **Drive the graph only through the dev server** (see the mandatory rule above): `run_langgraph.ps1` → `run_workflow.py` → `http://127.0.0.1:2024`. Never import or run `graph.py`/`workflow.py`/`agents.py` in-process to execute the workflow — that bypasses the dev server and LangGraph Studio cannot track it.
- Use the current Claude Code session for all Claude Code work. Do not launch another `claude` process.
- Assume the current Claude Code session already has `--dangerously-skip-permissions`.
- Run Python through the recorded conda environment. `run_langgraph.ps1` resolves conda from `-CondaExe`, `CONDA_EXE`, `conda` on PATH, or the user-profile miniconda fallback:
@@ -40,9 +40,9 @@ function Get-StoredPid {
}
function Test-ServerRunning {
$pid = Get-StoredPid
if ($pid -eq 0) { return $false }
$proc = Get-Process -Id $pid -ErrorAction SilentlyContinue
$storedPid = Get-StoredPid
if ($storedPid -eq 0) { return $false }
$proc = Get-Process -Id $storedPid -ErrorAction SilentlyContinue
if (-not $proc) { return $false }
return (Test-HttpOk "$ApiUrl/ok")
}
@@ -107,8 +107,8 @@ switch ($Command) {
"start" {
if (Test-ServerRunning) {
$pid = Get-StoredPid
Write-Host "[dev-server] Already running (PID $pid) at $ApiUrl"
$storedPid = Get-StoredPid
Write-Host "[dev-server] Already running (PID $storedPid) at $ApiUrl"
Write-Host "[dev-server] Studio: https://smith.langchain.com/studio/?baseUrl=$ApiUrl"
exit 0
}
@@ -122,6 +122,10 @@ switch ($Command) {
Remove-Item $StdoutLog -ErrorAction SilentlyContinue
Remove-Item $StderrLog -ErrorAction SilentlyContinue
# Force UTF-8 to avoid GBK decode errors on Chinese Windows systems
$env:PYTHONUTF8 = "1"
$env:PYTHONIOENCODING = "utf-8"
$proc = Start-Process -FilePath $lgExe `
-ArgumentList "dev", "--no-browser" `
-WorkingDirectory $SkillDir `
@@ -167,9 +171,9 @@ switch ($Command) {
}
"stop" {
$pid = Get-StoredPid
if ((Stop-ServerProcess -PidValue $pid)) {
Write-Host "[dev-server] Stopped (PID $pid)"
$storedPid = Get-StoredPid
if ((Stop-ServerProcess -PidValue $storedPid)) {
Write-Host "[dev-server] Stopped (PID $storedPid)"
} else {
Write-Host "[dev-server] Not running (nothing to stop)"
}
@@ -178,8 +182,8 @@ switch ($Command) {
"status" {
if (Test-ServerRunning) {
$pid = Get-StoredPid
Write-Host "[dev-server] Running (PID $pid) at $ApiUrl"
$storedPid = Get-StoredPid
Write-Host "[dev-server] Running (PID $storedPid) at $ApiUrl"
Write-Host "[dev-server] Studio: https://smith.langchain.com/studio/?baseUrl=$ApiUrl"
} else {
Write-Host "[dev-server] Not running"