搜索

PythonReactSEOPDF
GitHub Skill

deepwork-rules

Creates file-change rules that enforce guidelines during AI sessions. Use when automating documentation sync or code review triggers.

Unsupervisedcom☆ 9 仓库 Stars1 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

deepwork_rules

Multi-step workflow: Creates file-change rules that enforce guidelines during AI sessions. Use when automating documentation sync or code review triggers.

CRITICAL: Always invoke steps using the Skill tool. Never copy/paste step instructions directly.

Manages rules that automatically trigger when certain files change during an AI agent session. Rules help ensure that code changes follow team guidelines, documentation is updated, and architectural decisions are respected.

IMPORTANT: Rules are evaluated at the "Stop" hook, which fires when an agent finishes its turn. This includes when sub-agents complete their work. Rules are NOT evaluated immediately after each file edit - they batch up and run once at the end of the agent's response cycle.

  • Command action rules: Execute their command (e.g., uv sync) when the agent stops
  • Prompt action rules: Display instructions to the agent, blocking until addressed

Rules are stored as individual markdown files with YAML frontmatter in the .deepwork/rules/ directory. Each rule file specifies:

  • Detection mode: trigger/safety, set (bidirectional), or pair (directional)
  • Patterns: Glob patterns for matching files, with optional variable capture
  • Action type: prompt (default) to show instructions, or command to run a shell command
  • Instructions: Markdown content describing what the agent should do

Example use cases:

  • Update installation docs when configuration files change
  • Require security review when authentication code is modified
  • Ensure API documentation stays in sync with API code
  • Enforce source/test file pairing
  • Auto-run uv sync when pyproject.toml changes (command action)

Available Steps

  1. define - Creates a rule file that triggers when specified files change. Use when setting up documentation sync, code review requirements, or automated commands.

Execution Instructions

Step 1: Analyze Intent

Parse any text following /deepwork_rules to determine user intent:

  • "define" or related terms → start at deepwork_rules.define
Step 2: Invoke Starting Step

Use the Skill tool to invoke the identified starting step:

Skill tool: deepwork_rules.define
Step 3: Continue Workflow Automatically

After each step completes:

  1. Check if there's a next step in the sequence
  2. Invoke the next step using the Skill tool
  3. Repeat until workflow is complete or user intervenes
Handling Ambiguous Intent

If user intent is unclear, use AskUserQuestion to clarify:

  • Present available steps as numbered options
  • Let user select the starting point

Guardrails

  • Do NOT copy/paste step instructions directly; always use the Skill tool to invoke steps
  • Do NOT skip steps in the workflow unless the user explicitly requests it
  • Do NOT proceed to the next step if the current step's outputs are incomplete
  • Do NOT make assumptions about user intent; ask for clarification when ambiguous

Context Files

  • Job definition: .deepwork/jobs/deepwork_rules/job.yml

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-02-05
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!