前端生成
- 作者仓库星标 10
- 许可证 MIT
- 作者更新于 实时读取
- 作者仓库 ruah-orch
- 领域
- 通用
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 98 / 100 · 已通过审计
- 作者 / 版本 / 许可
- @ruah-dev · v0.2.19 · MIT
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- Windows · Docker
- 底层运行要求
- Python · Docker
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: post-start-validation
description: Universal validation and knowledge capture. Detects what changed, runs governance gates, capture…
category: 通用
runtime: Python / Docker
---
# post-start-validation 输出预览
## PART A: 任务判断
- 适用问题:通用任务拆解、检查和交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“0. Shell Rule / 1. Determine Scope / 2. Read Governance Gates”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于通用任务拆解、检查和交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“0. Shell Rule / 1. Determine Scope / 2. Read Governance Gates”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/post-start-validation`、`/dev` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“0. Shell Rule / 1. Determine Scope / 2. Read Governance Gates”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: post-start-validation
description: Universal validation and knowledge capture. Detects what changed, runs governance gates, capture…
category: 通用
source: ruah-dev/ruah-orch
---
# post-start-validation
## 什么时候使用
- 把通用方向的常用动作沉淀成 Agent 可调用的技能 适合处理通用任务拆解、检查、交付和复盘,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额外…
- 面向通用任务拆解、检查和交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「0. Shell Rule / 1. Determine Scope / 2. Read Governance Gates」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "post-start-validation" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> 0. Shell Rule / 1. Determine Scope / 2. Read Governance Gates
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python / Docker | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} /post-start-validation
Run after completing any task. Discovers what changed, applies governance gates, captures knowledge, commits and verifies.
0. Shell Rule
Detect OS. Use Git Bash syntax on Windows (forward slashes, /dev/null).
1. Determine Scope
git diff --name-only HEAD 2>/dev/null || git status --short
Classify changes by detecting file patterns:
- Frontend? —
.ts,.tsx,.js,.jsx,.css,.vue,.sveltefiles - Backend? —
.java,.kt,.py,.go,.rs,.rbfiles - Infrastructure? —
Dockerfile,docker-compose*,k8s/,.github/workflows/,*.tf - Docs-only? —
.mdfiles only outside source directories
Skip rules: Docs-only → skip code checks. Infra-only → skip local checks.
2. Read Governance Gates
Read .claude/governance.md
The governance file defines which gates to run and in what order. If it specifies "biome → tsc → build" — run exactly that. If it specifies "pytest" — run that. The gates are project-specific; this skill is not.
3. Run Gates
3.0. Workspace-aware gate execution
If the discovery cache indicates a workspace:
- Read root governance gates (from workspace root
.claude/governance.md) - Identify which members have changes: check
git diff --name-only HEADpaths - For changed members with their own governance: read member governance, merge with root gates
- Execute merged gates in order: root cross-stack gates first, then member-specific gates
Gate annotations (v2 format)
Path-scoped sections: ### Frontend (path: frontend/)
Before running any command in this section, cd into the specified directory. After the section completes, cd back to the project root. Example:
(cd frontend/ && npx biome check .) || exit 1
Conditional sections: ### TypeScript (if: tsconfig.json)
Skip the ENTIRE section if the referenced file does not exist at project root. Check before running any gate in the section:
[ -e tsconfig.json ] || echo "Skipping TypeScript gates (no tsconfig.json)"
Gate classifications (suffix on individual gate lines):
# [MANDATORY](default) — stop execution on failure# [OPTIONAL]— log failure, print warning, continue to next gate# [ADVISORY]— always run, log result, never stop
When an OPTIONAL gate fails:
- Print:
⚠ [OPTIONAL] <gate command> failed — continuing - Record in gate_results.failed but do NOT exit
- Proceed to the next gate in order
When an ADVISORY gate fails:
- Print:
ℹ [ADVISORY] <gate command> failed (informational) - Record in gate_results.failed for session state
- Always proceed
Inheritance marker: ## Gates (inherit: root)
When found in a member's governance.md, merge root gates first (prepend), then member gates (append). Execute in order.
Standard execution (no annotations)
Execute the gates defined in governance.md, in order. Stop at first MANDATORY failure.
Common patterns (the governance file will specify which apply):
Frontend gates:
# Lint (biome, eslint, etc.)
# Type check (tsc --noEmit, mypy, etc.)
# Build (npm run build, etc.)
# Test (vitest, jest, pytest, etc.)
Backend gates:
# Compile (gradlew compileJava, cargo build, go build, etc.)
# Test (gradlew test, pytest, cargo test, go test, etc.)
# Check (gradlew check, clippy, etc.)
Use
rtkprefix on all commands for token compression.
3.5. Gate Auto-Fix (Bounded Retry)
If a gate command fails, attempt an automatic fix before escalating to the user.
Step 1 — Classify the failure:
| Error pattern | Classification | Action |
|---|---|---|
| Lint errors with auto-fix flag | Auto-fixable | Run linter with --fix / --write |
| Format errors (prettier, rustfmt, ruff, biome) | Auto-fixable | Run the formatter on affected files |
| Unused imports / variables | Auto-fixable | Remove them |
| Missing semicolons, trailing commas | Auto-fixable | Fix inline |
| Type errors in files you changed this session | Maybe fixable | Attempt one fix, re-run |
| Failing tests | NOT auto-fixable | Escalate — tests may be validating the change |
| Build errors from missing dependencies | NOT auto-fixable | Escalate |
| Errors in files you did NOT change | NOT auto-fixable | Escalate — pre-existing issue |
Step 2 — If auto-fixable, apply the fix:
# Lint auto-fix (use whichever the project has)
npx eslint --fix <files> # or: npx biome check --write <files>
npx prettier --write <files> # format
cargo clippy --fix --allow-dirty # Rust
ruff check --fix <files> # Python
ruff format <files> # Python format
For other mechanical errors (unused imports, missing semicolons): edit the files directly.
Auto-fix boundaries:
- ONLY edit files within this repository
- NEVER install new global packages as a fix
- NEVER modify files outside the repo or system config
- NEVER delete files that weren't created this session
- If a fix requires out-of-bounds changes → escalate to user
Step 3 — Re-run ONLY the failed gate. Do not re-run gates that already passed.
Step 4 — Bounded retry:
- Maximum 2 auto-fix attempts per gate
- If the same gate fails after 2 attempts → stop and escalate to the user
- Never retry the exact same fix that didn't work
- The circuit breaker hook (
PostToolUseFailure) provides an additional safety net
Step 5 — After ALL gates pass, write the sentinel:
touch .claude/.gates-passed
This sentinel is:
- Checked by the auto-post-start hook before commits
- Cleared by pre-start-context at the beginning of each session
- Ensures gates are verified at least once per session before any commit
4. Cross-Stack Consistency
If both frontend and backend changed, verify alignment:
- API contracts match (routes, types, schemas)
- New environment variables added to
.env.example - Docker/K8s configs updated if services changed
- Migration files don't conflict
Read governance.md for project-specific alignment points.
5. Security Review
Grep -rn "sk_live\|sk_test\|AKIA\|password.*=.*['\"]" . --type ts --type java --type py 2>/dev/null | grep -v node_modules | grep -v test | grep -v example | head -20
For every new endpoint/route added:
- Authentication required (unless explicitly public)?
- Input validation present?
- No mass-assignment (explicit DTOs, not raw entity binding)?
Read governance.md for project-specific security requirements (rate limiting, file upload rules, auth patterns).
6. Documentation
If changes introduced new endpoints, services, env vars, or architecture changes — update README.
If changes are bug fixes, refactors, tests, CSS — skip.
7. Knowledge Capture
If MemStack rules exist (.claude/rules/diary.md), follow them — add-insight, add-session, set-context.
If not, at minimum report:
- What was done
- Key decisions made and why
- Any gotchas discovered
- What to do next session
8. Self-Update
Check: did any governance rule get violated during this session? Did any discovery instruction find something unexpected?
If governance was violated: Flag it to the user. Do NOT change governance.md.
If the pre-start or post-start skill itself had a gap (missing a check, wrong assumption): Update the skill file. Log the change.
Discovery instructions rarely need updating — they read the filesystem. Governance rules only change when the user decides.
9. Commit & Deploy
Read governance.md for:
- Branch strategy (feature branches or trunk-based?)
- Commit convention (conventional commits or free-form?)
- Autonomy level (auto-commit after gates or ask first?)
Execute accordingly:
git add <files>
git commit -m "<type>: <description>
Co-Authored-By: Claude <noreply@anthropic.com>"
Then:
- Push to remote
- Monitor CI (if configured):
gh run list --limit 3 - Verify deployment (if governance specifies how)
Branch cleanup (if feature branch workflow)
After merge:
git branch -d <branch-name>
Skip Rules
| Change type | Skip |
|---|---|
| Docs-only | S3-S5 |
| Infra-only | S3 (local gates), S6 |
| Backend-only (no API change) | Frontend gates |
| Frontend-only (no API change) | Backend gates |
| CSS/styling only | Backend gates, S4, S5 |
10. Write Session State
Write .claude/.session-state.json for warm starts next session:
{
"version": 1,
"timestamp": "<ISO 8601 — use: date -u +%Y-%m-%dT%H:%M:%SZ>",
"branch": "<current branch>",
"commit": "<HEAD short hash>",
"task_summary": "<one-line summary of what was accomplished>",
"gate_results": {
"passed": ["<gate commands that passed>"],
"failed": ["<gate commands that failed — empty if all passed>"],
"auto_fixed": ["<gates that needed auto-fix before passing>"]
},
"files_changed": ["<files modified this session>"],
"open_questions": ["<unresolved decisions or ambiguities>"],
"next_steps": ["<suggested actions for next session>"]
}
This file is consumed by pre-start Section 0.1 for warm starts. It enables the next session to:
- Skip re-explaining context if the user is continuing the same work
- Surface open questions and next steps immediately
- Combined with the discovery cache, achieve near-zero-latency startup
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核