Plan Do Check Act
by @brucezhu888
PDCA workflow automation with session binding and progress recovery. Requires Python 3.6 and Git (optional).
clawhub install plan-do-check-actπ About This Skill
name: plan-do-check-act description: PDCA workflow automation with session binding and progress recovery. Requires Python 3.6 and Git (optional).
Plan-Do-Check-Act Skill
This skill implements the PDCA (Plan-Do-Check-Act) workflow to ensure tasks are systematically planned and executed.
Requirements
Setup Guide (First Time)
After installing, run the setup wizard:
# Run interactive setup
python3 scripts/setup.py
The wizard will:
1. Check Python and Git dependencies
2. Create workspace directory (default: ~/pdca-workspace)
3. Create a test plan
4. Optionally initialize Git for progress tracking
5. Show next steps
Manual Setup
If you prefer manual setup:
# 1. Create workspace directory
mkdir -p ~/pdca-workspace2. Create a test plan
cd ~/pdca-workspace
manage_plan.py create "My First Plan" "Task 1" "Task 2" "Task 3"3. Verify it works
manage_plan.py check plan.md4. (Optional) Set up git for progress tracking
git init
Security Notes
plan*.md files in the configured workspace directorycleanup command deletes archived files older than specified days (default 7)cleanup --dry-run to preview before deletingCore Process
1. Plan
When receiving a user task, createplan.md:
2. Do
Execute tasks according to plan.md:[x][>]3. Check
After all tasks are completed:4. Act
Based on check results:plan.md Template
# Task Plan: [Task Name]Session: discord:1488795270769676318
Created: YYYY-MM-DD HH:MM
Status: IN_PROGRESS | COMPLETED | PAUSED
Current Task
> Task 3 - Implement Login API (in progress)
Checklist
[x] Task 1 - Database Design
[x] Task 2 - User Model Creation
[>] Task 3 - Implement Login API (in progress)
[ ] Task 4 - Implement Registration API
[ ] Task 5 - Unit Testing Notes
Records during execution...
Check Results
Fill in after completion...
Trigger Scenarios
Core Logic: Step Analysis
After receiving a task, quickly analyze how many steps are needed:
1-2 steps β Execute directly, no plan
3-5 steps β Optional plan (ask user)
5+ steps β Auto trigger PDCA
Step Analysis Dimensions
| Dimension | 1 step | 2-3 steps | 5+ steps | |-----------|--------|-----------|----------| | File Changes | Single file | 2-3 files | Multiple modules/dirs | | Dependencies | None | Simple | Multi-layer/sequential | | Tech Stack | Single tech | 2 techs | Full-stack/multi-service | | Testing | No testing | Simple validation | Full test suite | | Deploy/Config | No deploy | Local run | Deploy + config + docs |
Keyword Triggers
Trigger regardless of step count when user explicitly requests:
Session Binding
plan.md Records Session ID
Session: discord:1488795270769676318
Categorized Display After Wake
Uncompleted plans for current session:
1. plan.md - User System Development (2/5)Uncompleted plans for other sessions:
2. plan-blog.md - Blog Setup (1/3) β telegram:123456
Interruption Recovery
Two Interruption Scenarios
| Scenario | Handling |
|----------|----------|
| Unexpected (network down, crash) | Check file modifications within 10 minutes |
| Manual Pause ("pause for now") | Use PAUSED status explicitly |
Progress Inference (Active Check)
1. Check git status - Uncommitted changes 2. Check file modification time - Files within 10 minutes 3. Compare task description - Keyword matching 4. Identify task type - Code/Test/Deploy/Docs/General 5. Ask user confirmation - Final confirmation
Recovery Flow
Wake β on-start β Read plan.md β Check files within 10 min
β
"login_api.py modified 3 min ago, continue?"
Consumption Mechanism
Status Flow
CREATED β IN_PROGRESS β PAUSED β RESUMED β COMPLETED β ARCHIVED
Execution Rules
[x]Concurrency Control
Destruction Mechanism
Archive Strategy
| Status | Retention | Action |
|--------|-----------|--------|
| COMPLETED | 7 days | Move to archive/plan-YYYY-MM-DD-taskname.md |
| PAUSED | 30 days | Ask user to continue or delete |
| STALE (no update >14 days) | Immediate | Mark as ABANDONED, wait for confirmation |
Cleanup Commands
# Archive completed
manage_plan.py archiveCleanup expired files (>7 days)
manage_plan.py cleanup --days 7List all plans
manage_plan.py list
Usage
Agent Workflow
Trigger Conditions
Automatically trigger PDCA when user:
Plan Phase
1. Analyze steps withanalyze_steps.py
2. If 5+ steps β create plan.md
3. Output plan content to userDo Phase
1. Execute tasks one by one 2. After each task β update plan.md 3. Report progress to userExample:
γβ Task 1 complete (Database Design)
β Starting Task 2 (User Model Creation)γ
Check Phase
1. When user asks "What's not done?" β runmanage_plan.py on-start
2. Output incomplete plans with progress
3. Example response:
γYou have 1 incomplete plan:User System Development (2/5 complete)
β Database Design
β User Model Creation
β Implement Login API (in progress)
β Implement Registration API
β Unit Testing
Next task: Implement Login APIγ
Act Phase
1. Fix identified issues 2. Archive completed plansCreate Plan
# Simple create
manage_plan.py create "User System" "Database Design" "User Model" "Login API"With session
manage_plan.py create "User System" "Task 1" "Task 2" \
--session "discord:1488795270769676318"Specify output file
manage_plan.py create "Blog Setup" "Buy Domain" "Deploy" \
--output plan-blog.md
Update Status
# Complete tasks 1 and 2
manage_plan.py update plan.md --completed 0,1Mark current task (in progress)
manage_plan.py update plan.md --current 2
Pause/Resume
# Pause
manage_plan.py pause plan.md --reason "Waiting for API response"Resume
manage_plan.py resume plan.md
Session Start Check
# Check incomplete plans
manage_plan.py on-start . "discord:1488795270769676318"
Progress Check
# Check current progress
manage_plan.py check plan.mdDetailed progress check (with git and files)
python3 scripts/check_progress.py . plan.md
Scripts
| Script | Function |
|--------|----------|
| manage_plan.py | Main management script (create/update/pause/resume/archive) |
| check_progress.py | Progress check (git + file modification + keyword matching) |
| analyze_steps.py | Step analysis (decide whether to plan) |
| check_deps.py | Dependency check |
Configuration
Default workspace: ~/.openclaw/workspace/
Plan files: plan.md or plan-*.md
Archive directory: archive/
Security:
plan*.md files in the workspacearchive/ directory--dry-run to preview cleanup before deletingπ‘ Examples
Agent Workflow
Trigger Conditions
Automatically trigger PDCA when user:
Plan Phase
1. Analyze steps withanalyze_steps.py
2. If 5+ steps β create plan.md
3. Output plan content to userDo Phase
1. Execute tasks one by one 2. After each task β update plan.md 3. Report progress to userExample:
γβ Task 1 complete (Database Design)
β Starting Task 2 (User Model Creation)γ
Check Phase
1. When user asks "What's not done?" β runmanage_plan.py on-start
2. Output incomplete plans with progress
3. Example response:
γYou have 1 incomplete plan:User System Development (2/5 complete)
β Database Design
β User Model Creation
β Implement Login API (in progress)
β Implement Registration API
β Unit Testing
Next task: Implement Login APIγ
Act Phase
1. Fix identified issues 2. Archive completed plansCreate Plan
# Simple create
manage_plan.py create "User System" "Database Design" "User Model" "Login API"With session
manage_plan.py create "User System" "Task 1" "Task 2" \
--session "discord:1488795270769676318"Specify output file
manage_plan.py create "Blog Setup" "Buy Domain" "Deploy" \
--output plan-blog.md
Update Status
# Complete tasks 1 and 2
manage_plan.py update plan.md --completed 0,1Mark current task (in progress)
manage_plan.py update plan.md --current 2
Pause/Resume
# Pause
manage_plan.py pause plan.md --reason "Waiting for API response"Resume
manage_plan.py resume plan.md
Session Start Check
# Check incomplete plans
manage_plan.py on-start . "discord:1488795270769676318"
Progress Check
# Check current progress
manage_plan.py check plan.mdDetailed progress check (with git and files)
python3 scripts/check_progress.py . plan.md
βοΈ Configuration
Default workspace: ~/.openclaw/workspace/
Plan files: plan.md or plan-*.md
Archive directory: archive/
Security:
plan*.md files in the workspacearchive/ directory--dry-run to preview cleanup before deletingπ Tips & Best Practices
Records during execution...