Skill: nollio/normieclaw-project-manager-pro (version 1.0.3)

# Project Manager Pro — SKILL.md > Conversational task & project management for OpenClaw agents. > Your agent creates, organizes, prioritizes, and follows up on tasks — no UI required. --- ## Trigger Phrases Use this skill when the user: - Asks to add, create, or schedule a task/project/to-do - Says something like "I need to...", "remind me to...", "don't let me forget..." - Asks "what's on my plate?", "what should I work on?", "what's due?" - Requests a project breakdown ("break this down", "plan out X") - Responds to a proactive check-in (morning/evening/weekly) - Mentions priorities, deadlines, blockers, or task status - Says "mark X as done", "I finished X", "block X", "move X to in-progress" - Asks to see tasks by project, priority, tag, or timeframe - Requests task export or weekly review Do NOT use this skill for: - Calendar scheduling (use calendar tools) - Team task assignment or collaboration - Time tracking or Pomodoro sessions - General reminders without actionable task context --- ## 1. Data Model ### Task Structure Every task is stored as a JSON object in the tasks database file at `~/.openclaw/workspace/pm-pro/tasks.json`. ```json { "id": "task_20260311_001", "title": "Research co-packing facilities in Denver", "description": "Find 3+ co-packers that handle hot sauce bottling, get quotes, compare MOQs", "priority": "P2", "eisenhower": "important-not-urgent", "status": "todo", "due_date": "2026-03-18", "created_date": "2026-03-11", "completed_date": null, "project": "teekha-launch", "parent_task": null, "subtasks": ["task_20260311_002", "task_20260311_003", "task_20260311_004"], "dependencies": [], "blocked_by": [], "tags": ["teekha", "vendor", "research"], "time_estimate_min": 120, "notes": "Cody mentioned preference for facilities within 2-hour drive", "source": "user", "recurrence": null } ``` ### Project Structure Projects are stored in `~/.openclaw/workspace/pm-pro/projects.json`: ```json { "id": "teekha-launch", "name": "Teekha Foods Launch", "description": "Launch 3 SKU hot sauce line by Q2 2026", "status": "active", "created_date": "2026-03-01", "target_date": "2026-06-30", "tags": ["teekha", "cpg", "launch"], "task_count": 0, "completed_count": 0 } ``` ### File Layout ``` ~/.openclaw/workspace/pm-pro/ ├── tasks.json # All tasks (array) ├── projects.json # All projects (array) ├── archive/ # Completed tasks moved here monthly │ └── 2026-03.json └── check-in-log.json # Record of check-ins delivered ``` --- ## 2. Conversational Task Creation ### Parsing Natural Language When the user says something that implies a task, parse it into structured data. Use these patterns: **Direct task creation:** - "Add a task to call the dentist by Friday" → title: "Call the dentist", due: next Friday, priority: P3 - "I need to file taxes by April 15" → title: "File taxes", due: 2026-04-15, priority: P1 (deadline-driven) - "Don't forget to buy groceries" → title: "Buy groceries", priority: P3, no due date - "Remind me to review the pitch deck tomorrow morning" → title: "Review the pitch deck", due: tomorrow **Project creation:** - "I need to launch a website by March 20" → Create project + subtask tree (see Section 3) - "Plan a trip to Japan for October" → Create project + subtask tree - "Break down the hot sauce launch" → Create project + subtask tree ### Parsing Rules 1. **Extract the action verb.** The task title should start with a verb: "Call," "Buy," "Review," "Research," "Send," "Schedule." 2. **Detect due dates.** Parse relative dates ("tomorrow," "next Friday," "end of month") and absolute dates ("March 20," "April 15"). Resolve relative dates against today's date. 3. **Infer priority from urgency signals:** - P1: "urgent," "ASAP," "critical," "today," "overdue," deadline within 24 hours - P2: "important," "this week," "high priority," deadline within 7 days - P3: Default for most tasks - P4: "whenever," "low priority," "someday," "nice to have" 4. **Detect project association.** If the task references an existing project name or tag, associate it automatically. 5. **Ask clarifying questions when ambiguous** — but keep it to one question max. Don't interrogate. ### Response Format for Task Creation After creating a task, confirm concisely: ``` ✅ Added: "Call the dentist" 📅 Due: Friday, Mar 13 · 🔴 P2 · 🏷 health ``` For projects with subtasks, show the tree: ``` 📁 New project: Launch Website (due Mar 20) ├── 🔲 Finalize homepage copy (Mar 12) · P2 ├── 🔲 Design landing page mockup (Mar 13) · P2 │ └── 🔲 Get feedback from stakeholders (Mar 14) · P3 ├── 🔲 Set up hosting and domain (Mar 14) · P2 ├── 🔲 Develop and deploy site (Mar 15-18) · P1 │ ├── 🔲 Build responsive layout (Mar 15-16) · P2 │ └── 🔲 Integrate contact form (Mar 16) · P3 ├── 🔲 QA testing across devices (Mar 18) · P1 └── 🔲 Go live and verify DNS (Mar 20) · P1 8 tasks created · Estimated: ~18 hours ``` --- ## 3. Smart Decomposition ### When to Decompose Automatically offer to break down a task when: - The user explicitly says "break this down" or "plan this out" - The task title implies a multi-step project (launch, move, plan, build, organize, prepare) - The time estimate would exceed 4 hours for a single task - The due date is more than 7 days out and the scope is broad ### Decomposition Process 1. **Identify the end state.** What does "done" look like for this project? 2. **Work backwards from the deadline.** Assign subtask due dates that leave buffer before the final deadline. 3. **Group into phases** where logical (research → plan → execute → verify). 4. **Set dependencies.** Mark which tasks can't start until others complete. 5. **Estimate time** for each subtask. Use these rough baselines: - Research/discovery tasks: 30-90 min - Writing/creation tasks: 60-180 min - Communication tasks (calls, emails): 15-30 min - Review/decision tasks: 15-60 min - Technical/build tasks: 120-480 min - Administrative tasks: 15-60 min 6. **Assign priorities** within the project based on dependency order and deadline proximity. ### Dependency Rules - A task with unfinished dependencies has status `blocked` displayed in views - When a dependency completes, notify the user: "🔓 Unblocked: 'Design landing page' — its dependency 'Finalize copy' is done" - Circular dependencies are rejected at creation time - Cross-project dependencies are supported --- ## 4. Priority Framework ### Default: Eisenhower Matrix Map every task to one of four quadrants: | | Urgent | Not Urgent | |---|---|---| | **Important** | 🔴 DO FIRST (P1) | 🟡 SCHEDULE (P2) | | **Not Important** | 🟠 DELEGATE/QUICK (P3) | ⚪ ELIMINATE/DEFER (P4) | ### Auto-Classification Rules **Urgent** if: - Due today or overdue - Due within 48 hours and not yet started - Explicitly marked urgent by user - Blocking other tasks that are due soon **Important** if: - Part of an active project with a target date - Tagged with a high-value domain (work, finance, health) - Has downstream dependencies (other tasks waiting on it) - User explicitly marked it important ### Priority Escalation The agent automatically escalates priority when: - A P3/P4 task's due date is within 48 hours → escalate to P2 - A P2 task's due date is within 24 hours → escalate to P1 - A task has been in `todo` status for more than 7 days → flag in check-in - A blocker task is preventing 2+ downstream tasks → escalate the blocker to P1 ### Alternative Frameworks (configurable in settings.json) - **eisenhower** (default): Urgent/Important matrix as above - **ice**: Impact × Confidence × Ease (1-10 each) — score-based ranking - **value-effort**: Value vs Effort quadrants - **simple**: Manual P1-P4, no auto-classification --- ## 5. Proactive Check-Ins ### Morning Check-In (Default: 8:00 AM local time) Triggered by the agent's scheduled check-in. Present: 1. **Overdue tasks** (if any) — these come first, always 2. **Today's tasks** — sorted by priority, then due time 3. **Blocked tasks** — with explanation of what's blocking them 4. **Quick wins** — P3/P4 tasks estimated under 15 minutes Format: ``` ☀️ Morning — Wednesday, March 11 🔴 OVERDUE (1): • Submit expense report (was due Mar 9) · P2 📋 TODAY (3): • Review pitch deck · P1 · ~30 min • Call insurance company · P2 · ~15 min • Order packaging samples · P3 · ~10 min 🚫 BLOCKED (1): • Design label mockup — waiting on "Finalize brand colors" (in-progress) ⚡ QUICK WINS: • Reply to vendor email · P4 · ~5 min • Update LinkedIn headline · P4 · ~5 min What do you want to tackle first? ``` ### Evening Review (Default: 7:00 PM local time) Summarize the day: ``` 🌙 Evening Review — Wednesday, March 11 ✅ Completed today (2): • Review pitch deck • Order packaging samples 🔄 Still open (2): • Call insurance company (moved to tomorrow) • Submit expense report (overdue — day 3) 📊 Week progress: 8/14 tasks done (57%) Anything to add for tomorrow? ``` ### Weekly Summary (Default: Sunday 10:00 AM) ``` 📊 Weekly Summary — Week of March 8-14 ✅ Completed: 12 tasks 🆕 Created: 8 tasks 📈 Net progress: +4 tasks cleared 🏆 Biggest wins: • Finished "Research co-packers" project (5 subtasks) • Cleared all P1 tasks by Wednesday ⚠️ Attention needed: • "Submit expense report" overdue 5 days • "Teekha Launch" project is 34% complete, target date June 30 📅 Next week preview: • 6 tasks due • 2 tasks blocked (waiting on vendor responses) Want to adjust priorities for next week? ``` ### Check-In Configuration Users can customize in `config/settings.json`: - Enable/disable each check-in type - Change times - Change weekly summary day - Set quiet hours (no check-ins) --- ## 6. Task Views ### Today View Show all tasks due today + overdue, sorted by priority: ``` 📋 Today — Wednesday, March 11 🔴 P1: • Review pitch deck · ~30 min 🟡 P2: • Call insurance company · ~15 min • Submit expense report ⚠️ OVERDUE (Mar 9) 🟠 P3: • Order packaging samples · ~10 min ─────────── 4 tasks · ~70 min estimated ``` ### This Week View Group by day with completion counts per day. Show total remaining. ### Project View Show all tasks as a phased tree with status icons, completion counts per phase, and dependency indicators. Collapse completed phases to one line. ### All Tasks View Default: group by priority. Supports filters: - `show all tasks` — everything, grouped by priority - `show tasks tagged finance` — filter by tag - `show blocked tasks` — only status=blocked - `show tasks due this month` — date range filter - `show tasks for teekha-launch` — project filter - `show done tasks this week` — completed + date range ### Filter Syntax The agent interprets natural language filters: - "What's overdue?" → status=todo/in-progress, due_date < today - "Show me P1 tasks" → priority=P1 - "What's blocked?" → status=blocked - "What did I finish last week?" → status=done, completed_date in last 7 days - "Everything for the hot sauce project" → project=teekha-launch --- ## 7. Task Operations ### Status Changes - "I finished X" / "mark X as done" → status=done, completed_date=today - "I'm working on X" / "start X" → status=in-progress - "X is blocked by Y" / "block X" → status=blocked, blocked_by=[Y] - "Unblock X" → status=todo (or in-progress if it was before), clear blocked_by - "Delete X" / "remove X" → Remove from tasks.json (confirm first) ### Bulk Operations - "Mark all overdue tasks as P1" → batch priority update - "Move all 'teekha' tasks to next week" → batch due date shift - "Archive all done tasks" → move to archive/ ### Editing - "Change the due date on X to Friday" → update due_date - "Add a note to X: waiting on vendor callback" → append to notes - "Move X to the teekha-launch project" → update project - "Add tag 'finance' to X" → append to tags ### Recurrence - "Add a recurring task: review budget every Monday" → create with recurrence config - When a recurring task is marked done, auto-create the next instance - Recurrence options: daily, weekly (specify days), monthly (specify date), custom interval --- ## 8. Cross-Tool Integration ### How It Works When other NormieClaw tools generate actionable items, Project Manager Pro creates tasks automatically. The agent detects cross-tool events and creates tasks with `source: "cross-tool"`. ### Integration Patterns **Expense Tracker Pro → PM Pro:** - Bill due date approaching → "Pay electric bill" task, due date = bill due date, P2 - Subscription renewal coming → "Review/cancel X subscription" task, 7 days before renewal - Budget threshold exceeded → "Review spending in [category]" task, P2 **Meal Planner Pro → PM Pro:** - Meal plan created for the week → "Grocery shopping" task with ingredient list in notes - Recipe requires advance prep → "Prep [ingredient] for [meal]" task, due day before **Fitness Tracker Pro → PM Pro:** - Workout scheduled → "Complete [workout type] session" task - Rest day reminders → "Active recovery / stretching" task - Supplement reorder → "Reorder [supplement]" task when supply runs low **Content Calendar Pro → PM Pro:** - Post scheduled → "Write/record [content piece]" task, due 2 days before publish date - Content series → project with subtasks per episode/post **General Pattern:** Cross-tool tasks are tagged with the source tool name (e.g., `expense-tracker`, `meal-planner`) and include context in the notes field. They follow the same priority rules as manual tasks but default to P3 unless the source tool specifies urgency. ### Cross-Tool Task Format ``` 🔗 Auto-task from Expense Tracker: ✅ Added: "Pay electric bill" 📅 Due: March 15 · 🟡 P2 · 🏷 expense-tracker, bills 📝 Amount: $142.50 — Xcel Energy ``` --- ## 9. Dashboard Integration Project Manager Pro exposes data for the NormieClaw dashboard system. See `dashboard-kit/DASHBOARD-SPEC.md` for full widget specifications. ### Dashboard Widgets (prefix: `pm_`) | Widget ID | Type | Description | |-----------|------|-------------| | `pm_today` | task-list | Today's tasks with priority badges | | `pm_overdue` | alert-list | Overdue tasks with days-overdue count | | `pm_progress` | progress-bar | Weekly completion percentage | | `pm_project_status` | multi-bar | Per-project completion bars | | `pm_trends` | line-chart | Tasks completed per day (7/30 day) | | `pm_priority_dist` | donut-chart | Task distribution by priority level | | `pm_upcoming` | timeline | Next 7 days task timeline | --- ## 10. Data Management ### Storage All data lives in `~/.openclaw/workspace/pm-pro/`. This is a local JSON-based store — no external database required. ### Initialization On first use, run the setup script or let the agent create the directory structure: ```bash ~/.openclaw/workspace/pm-pro/scripts/setup.sh ``` This creates the directory structure and empty JSON files. ### Export Users can export tasks via: - `export-tasks.sh markdown` → Markdown file with full task tree - `export-tasks.sh csv` → CSV for spreadsheet import - `export-tasks.sh json` → Raw JSON dump ### Archival - Tasks marked `done` for 30+ days are moved to `archive/YYYY-MM.json` on the first of each month - Archived tasks are excluded from active views but searchable - The weekly review script handles archival automatically ### Backup The `pm-pro/` directory should be included in any workspace backup strategy. No external sync is configured by default. --- ## 11. Agent Behavior Rules ### Do: - Create tasks immediately when the user implies one — don't ask "would you like me to create a task?" - Confirm task creation with the concise format shown above - Proactively surface overdue and blocked tasks during any conversation - Suggest decomposition for large tasks - Track completion trends and celebrate streaks ("5 tasks done today — that's your best this week") - Keep check-in messages scannable — bullet points, not paragraphs - Auto-escalate priority when deadlines approach ### Don't: - Create duplicate tasks — check for similar titles before creating - Nag about the same overdue task more than once per check-in - Create tasks from casual conversation ("I should really clean my desk" is not a task unless confirmed) - Override user-set priorities without asking - Send check-ins during configured quiet hours - Make assumptions about project scope — ask before decomposing unless the user explicitly requests it ### Conversation Style: - Task confirmations: 1-2 lines max - Check-ins: scannable bullet format, total counts at bottom - Project views: tree format with status icons - Always use emoji status indicators: ✅ done, 🔲 todo, 🔄 in-progress, 🚫 blocked, ⚠️ overdue - When the user asks "what should I work on?" — give ONE recommendation with reasoning, not a full task dump --- ## 12. Setup ### First Run 1. Run `scripts/setup.sh` to create the data directory and empty stores 2. The agent will walk through initial configuration via `SETUP-PROMPT.md` 3. User sets: check-in times, priority framework, quiet hours, active projects ### Configuration All settings in `config/settings.json`. The agent reads this on every session start. Users modify settings conversationally: - "Change my morning check-in to 7 AM" - "Disable evening reviews" - "Switch to ICE scoring" - "Set quiet hours from 10 PM to 7 AM" --- ## 13. Script Reference | Script | Purpose | Usage | |--------|---------|-------| | `setup.sh` | Initialize data directory and empty stores | Run once on install | | `export-tasks.sh` | Export tasks as markdown, CSV, or JSON | `./export-tasks.sh [markdown\|csv\|json]` | | `weekly-review.sh` | Generate weekly progress summary | Called by agent on Sunday or manually | All scripts live in the skill's `scripts/` directory and operate on `~/.openclaw/workspace/pm-pro/`.

path: README.md
content: # Project Manager Pro

**Conversational task & project management for OpenClaw agents.**

Your AI agent becomes your project manager. Tell it what you need to do in plain language — it creates tasks, breaks down projects, tracks dependencies, and follows up proactively. No app to open. No UI to click. Just talk.

## What It Does

- **Conversational task creation** — "I need to launch the website by March 20" → structured project with subtasks, deadlines, and dependencies
- **Smart decomposition** — Break big goals into actionable task trees with time estimates
- **Proactive check-ins** — Morning priorities, evening review, weekly progress summary
- **Context-aware prioritization** — Eisenhower matrix by default, auto-escalates as deadlines approach
- **Cross-tool integration** — Auto-generates tasks from other NormieClaw tools (expenses, meal prep, fitness, content)
- **Natural language everything** — Add, edit, complete, filter, and view tasks through conversation

## What It Replaces

| Tool | Annual Cost | What PM Pro Does Instead |
|------|-------------|--------------------------|
| Todoist Pro | $48/yr | Full task management with AI prioritization |
| Asana (Starter) | $132/yr | Project breakdown, dependencies, progress tracking |
| Motion | $348/yr | AI-driven prioritization and proactive follow-ups |

**Project Manager Pro: free.**

## Quick Start

### 1. Install

Copy the `project-manager-pro/` folder into your OpenClaw agent's skills directory:

```bash
cp -r project-manager-pro/ ~/.openclaw/skills/project-manager-pro/
```

### 2. Setup

Run the setup script to create the data directory:

```bash
chmod 700 ~/.openclaw/skills/project-manager-pro/scripts/*.sh
~/.openclaw/skills/project-manager-pro/scripts/setup.sh
```

### 3. Configure

Start a conversation with your agent. It will walk you through setup using `SETUP-PROMPT.md`:
- Set your active projects
- Choose a priority framework
- Configure check-in times
- Enable cross-tool integrations

### 4. Use

Just talk to your agent:
- "Add a task to review the contract by Thursday"
- "Break down the apartment move into subtasks"
- "What's on my plate today?"
- "Mark the dentist appointment as done"
- "Show me everything that's overdue"

## File Structure

```
project-manager-pro/
├── SKILL.md              # Agent instructions (the brain)
├── SETUP-PROMPT.md       # First-run configuration conversation
├── README.md             # This file
├── SECURITY.md           # Security considerations
├── config/
│   └── settings.json     # User preferences and defaults
├── scripts/
│   ├── setup.sh          # Initialize data directory
│   ├── export-tasks.sh   # Export as markdown/CSV/JSON
│   └── weekly-review.sh  # Generate weekly progress summary
├── examples/
│   ├── example-project-breakdown.md
│   ├── example-daily-checkin.md
│   └── example-cross-tool-tasks.md
└── dashboard-kit/
    ├── manifest.json
    └── DASHBOARD-SPEC.md
```

## Data Storage

Tasks and projects are stored as JSON files in `~/.openclaw/workspace/pm-pro/`. No external database. No cloud sync. No account required.

## Export

Export your tasks anytime:

```bash
./scripts/export-tasks.sh markdown   # Readable markdown report
./scripts/export-tasks.sh csv        # Spreadsheet-compatible CSV
./scripts/export-tasks.sh json       # Raw JSON dump
```

## Dashboard

If you're using the NormieClaw dashboard system, Project Manager Pro includes widgets for:
- Today's task list
- Overdue alerts
- Weekly progress bar
- Per-project completion status
- Completion trend charts

See `dashboard-kit/DASHBOARD-SPEC.md` for integration details.

## Requirements

- OpenClaw agent with skill loading support
- Bash shell (macOS, Linux, or WSL)
- `jq` (installed automatically by setup.sh if missing)

## Support

Questions or issues? Reach out at [normieclaw.ai](https://normieclaw.ai).

---

*Built by NormieClaw — AI tools for the rest of us.*


path: SECURITY.md
content: # Project Manager Pro — Security Considerations

## Data Storage

Project Manager Pro stores tasks and project data as JSON files in your OpenClaw workspace directory (`~/.openclaw/workspace/pm-pro/`). This is local file storage on whatever machine runs your OpenClaw agent.

**No data is sent to NormieClaw servers.** The tool operates entirely through your agent's existing infrastructure.

However, be aware:

- **Your AI agent processes task data.** Task content is sent to your configured LLM provider (Anthropic, OpenAI, etc.) as part of normal agent conversations. This is inherent to how AI agents work — the agent needs to read your tasks to manage them.
- **Cross-tool tasks include context.** If you enable cross-tool integration, task notes may contain information from other tools (expense amounts, meal plans, workout details). This data flows through the same LLM provider.
- **Export files are unencrypted.** Markdown, CSV, and JSON exports are plain text files. Handle them according to your own security practices.
- **No encryption at rest.** Task JSON files are stored as plain text. If your machine's disk is not encrypted, your task data is not encrypted.

## What We Don't Control

- **Your LLM provider's data policies.** How your AI provider (Anthropic, OpenAI, Google, etc.) handles the conversation data that includes your tasks is governed by their terms of service, not ours.
- **Your machine's security posture.** Disk encryption, access controls, backup security, and network security are your responsibility.
- **Your OpenClaw configuration.** How your agent is configured, which channels it operates on, and who has access to those channels affects who can see your task data.

## Recommendations

1. **Use disk encryption** on the machine running your OpenClaw agent (FileVault on macOS, LUKS on Linux, BitLocker on Windows).
2. **Review your LLM provider's data policy** if your tasks contain sensitive information.
3. **Be mindful of channel visibility.** If your agent operates in shared channels (Discord servers, group chats), task responses will be visible to other participants.
4. **Secure exported files.** If you export tasks to CSV/markdown, store or transmit those files with appropriate care.
5. **Back up your data.** The `pm-pro/` directory contains all your task data. Include it in your backup strategy.

## No Telemetry

Project Manager Pro does not phone home, collect analytics, or transmit usage data. The scripts and skill file operate entirely within your local environment and agent context.

## Reporting Issues

If you discover a security concern with Project Manager Pro, contact us at [normieclaw.ai](https://normieclaw.ai).


path: SETUP-PROMPT.md
content: # Project Manager Pro — Setup Prompt

> Run this conversation on first install to configure the tool for the user.

---

## Step 1: Welcome & Active Projects

```
🎯 Project Manager Pro — Let's get you set up (2 min).

First — any active projects or big goals? Examples:
  • "Launch a website by April"
  • "Move apartments in June"
  • "Study for certification exam"

Tell me what's on your plate and I'll create them. Add more anytime.
```

**Action:** Create project entries for each one the user mentions. Ask for target dates if not provided.

## Step 3: Priority Framework

```
How do you want me to prioritize your tasks?

1️⃣ Eisenhower Matrix (recommended) — Urgent/Important grid. I auto-classify based on deadlines and context.
2️⃣ ICE Scoring — Rate Impact, Confidence, Ease (1-10 each). Best for business-heavy task lists.
3️⃣ Value/Effort — High/Low value vs effort quadrants. Good for decision-heavy workflows.
4️⃣ Simple P1-P4 — You assign priority manually. No auto-classification.

Pick a number, or just say "default" for Eisenhower.
```

**Action:** Set `priority_framework` in settings.json.

## Step 4: Check-In Schedule

```
I can check in with you to keep things on track:

☀️ Morning brief — Your priorities for the day
🌙 Evening review — What got done, what's carrying over  
📊 Weekly summary — Progress report + next week preview

What times work? Defaults:
  • Morning: 8:00 AM
  • Evening: 7:00 PM
  • Weekly: Sunday 10:00 AM

You can change these anytime. Want all three, or just some?
```

**Action:** Set `check_ins` schedule in settings.json. Respect the user's timezone from their agent config.

## Step 5: Quiet Hours

```
When should I NOT bug you?

Default quiet hours: 10:00 PM – 7:00 AM
No check-ins, no task alerts during this window.

Works for you, or want to adjust?
```

**Action:** Set `quiet_hours` in settings.json.

## Step 6: Cross-Tool Integration

```
If you're using other NormieClaw tools, I can auto-create tasks from them:

  💰 Expense Tracker → bill reminders, subscription renewals
  🍽 Meal Planner → grocery shopping, meal prep tasks
  💪 Fitness Tracker → workout tasks, supplement reorders
  📝 Content Calendar → content creation deadlines

Want me to pick up tasks from your other tools automatically?
(You can always turn specific integrations on/off later.)
```

**Action:** Set `cross_tool_integrations` in settings.json with enabled/disabled per tool.

## Step 7: Confirmation

Summarize all configured settings, then: "Start by telling me something you need to do, or say 'show my tasks' anytime."

**Action:** Write settings.json, create pm-pro data directory via setup.sh.

## Agent Notes

- Run setup.sh before the conversation begins
- If the user skips questions, use defaults — don't stall
- If the user mentions tasks during setup, create them immediately
- One-time conversation. After completion, operate via SKILL.md


path: config/settings.json
content: {
  "version": "1.0.0",
  "data_dir": "~/.openclaw/workspace/pm-pro",

  "priority_framework": "eisenhower",

  "check_ins": {
    "morning": {
      "enabled": true,
      "time": "08:00",
      "include_overdue": true,
      "include_quick_wins": true,
      "max_tasks_shown": 10
    },
    "evening": {
      "enabled": true,
      "time": "19:00",
      "include_completion_stats": true,
      "include_tomorrow_preview": true
    },
    "weekly": {
      "enabled": true,
      "day": "sunday",
      "time": "10:00",
      "include_trends": true,
      "include_project_status": true
    }
  },

  "quiet_hours": {
    "enabled": true,
    "start": "22:00",
    "end": "07:00"
  },

  "views": {
    "default_view": "today",
    "default_sort": "priority",
    "show_time_estimates": true,
    "show_tags": true,
    "completed_tasks_visible_days": 7
  },

  "decomposition": {
    "auto_suggest_threshold_hours": 4,
    "auto_suggest_for_keywords": ["launch", "move", "plan", "build", "organize", "prepare", "migrate", "redesign", "overhaul"],
    "default_buffer_days": 2
  },

  "priority_escalation": {
    "enabled": true,
    "escalate_p3_within_hours": 48,
    "escalate_p2_within_hours": 24,
    "flag_stale_after_days": 7
  },

  "cross_tool_integrations": {
    "expense-tracker": {
      "enabled": false,
      "bill_reminder_days_before": 3,
      "subscription_reminder_days_before": 7
    },
    "meal-planner": {
      "enabled": false,
      "grocery_task_day": "saturday",
      "prep_reminder_hours_before": 12
    },
    "fitness-tracker": {
      "enabled": false,
      "include_workout_tasks": true,
      "supplement_reorder_days_before": 7
    },
    "content-calendar": {
      "enabled": false,
      "creation_task_days_before": 2
    }
  },

  "archival": {
    "auto_archive_after_days": 30,
    "archive_on_day": 1
  },

  "recurrence": {
    "auto_create_next": true,
    "create_days_before": 1
  }
}


path: dashboard-kit/DASHBOARD-SPEC.md
content: # Project Manager Pro — Dashboard Specification

## Overview

Project Manager Pro exposes 7 dashboard widgets for the NormieClaw dashboard system. All widgets use the `pm_` prefix and read from the local JSON data stores.

## Data Sources

| File | Path | Content |
|------|------|---------|
| `tasks.json` | `~/.openclaw/workspace/pm-pro/tasks.json` | All active tasks |
| `projects.json` | `~/.openclaw/workspace/pm-pro/projects.json` | All projects |
| `check-in-log.json` | `~/.openclaw/workspace/pm-pro/check-in-log.json` | Check-in history |

## Widget Specifications

### pm_today — Today's Tasks

**Type:** task-list
**Size:** 2×2
**Refresh:** Every 15 minutes

Displays all tasks due today plus any overdue tasks. Each task row shows:
- Priority badge (colored dot: 🔴 P1, 🟡 P2, 🟠 P3, ⚪ P4)
- Task title (truncated to 60 chars)
- Status icon (🔲 todo, 🔄 in-progress, 🚫 blocked)
- Time estimate if available
- "OVERDUE" badge in red for past-due tasks

**Sort order:** Priority (P1 first), then due date ascending.

**Empty state:** "Nothing due today — enjoy it or add something."

### pm_overdue — Overdue Alerts

**Type:** alert-list
**Size:** 1×1
**Refresh:** Every 30 minutes

Red-themed alert widget showing tasks past their due date. Each row:
- Task title
- Days overdue (e.g., "3 days late")
- Priority badge

**Sort order:** Days overdue descending (oldest first).

**Empty state:** Green checkmark with "All caught up."

**Behavior:** Widget border pulses red when items exist. Static green border when empty.

### pm_progress — Weekly Progress

**Type:** progress-bar
**Size:** 2×1
**Refresh:** Every 30 minutes

Horizontal progress bar showing completed tasks vs total tasks due this week (Monday–Sunday).

**Display:**
- Green fill bar proportional to completion percentage
- Text overlay: "8/14 done (57%)"
- Below bar: "Week of March 8–14"

**Color thresholds:**
- 0-33%: Red (#e53e3e)
- 34-66%: Yellow (#ecc94b)
- 67-100%: Green (#38a169)

### pm_project_status — Project Status

**Type:** multi-bar
**Size:** 2×2
**Refresh:** Every 60 minutes

Shows completion bars for each active project. Each row:
- Project name (truncated to 40 chars)
- Horizontal bar showing completed/total tasks
- Fraction text: "8/23 tasks"
- Target date badge if set

**Sort order:** Lowest completion percentage first (most attention needed).

**Max display:** 6 projects. If more exist, show "and N more..." link.

**Empty state:** "No active projects. Tell your agent to create one."

### pm_trends — Completion Trends

**Type:** line-chart
**Size:** 2×2
**Refresh:** Every 60 minutes

Line chart showing tasks completed per day. Toggle between 7-day and 30-day views.

**Chart elements:**
- X-axis: Dates (abbreviated: "Mar 5", "Mar 6", etc.)
- Y-axis: Task count (integer, starts at 0)
- Primary line: Tasks completed (purple, #805ad5)
- Dashed line: 7-day rolling average
- Hover tooltip: "Mar 11: 5 tasks completed"

**Empty state (< 3 days of data):** "Complete a few more tasks to see your trend."

### pm_priority_dist — Priority Distribution

**Type:** donut-chart
**Size:** 1×1
**Refresh:** Every 60 minutes

Donut chart showing active (non-done) task count by priority.

**Segments:**
- P1 Critical: Red (#e53e3e)
- P2 High: Yellow (#ecc94b)
- P3 Medium: Orange (#ed8936)
- P4 Low: Gray (#a0aec0)

**Center text:** Total active task count.

**Legend:** Below chart, compact format: "P1: 3 · P2: 7 · P3: 12 · P4: 4"

### pm_upcoming — Upcoming Timeline

**Type:** timeline
**Size:** 3×1
**Refresh:** Every 30 minutes

Horizontal 7-day timeline showing upcoming tasks grouped by date.

**Display:**
- 7 columns (today through +6 days)
- Column headers: Day name + date ("Wed 11", "Thu 12", etc.)
- Task pills within each column showing title (truncated) and priority dot
- Today's column highlighted with subtle background

**Interaction:** Hovering a task pill shows full title, project, and time estimate.

**Empty state:** "Clear week ahead."

## Integration Notes

- Widgets read directly from the JSON files — no API layer required
- The agent updates JSON files during conversation, so widgets reflect near-real-time state
- Archive files are NOT read by dashboard widgets — only active tasks/projects
- All timestamps are in the user's configured timezone
- Widget refresh intervals are suggestions — the dashboard system may adjust based on visibility

## Color Palette

| Usage | Hex | Name |
|-------|-----|------|
| P1 / Critical / Overdue | #e53e3e | Red |
| P2 / High | #ecc94b | Yellow |
| P3 / Medium | #ed8936 | Orange |
| P4 / Low / Inactive | #a0aec0 | Gray |
| Completed / On-track | #38a169 | Green |
| Projects / Info | #4299e1 | Blue |
| Trends / Charts | #805ad5 | Purple |
| Background | #1a202c | Dark |
| Card surface | #2d3748 | Dark Gray |
| Text primary | #e2e8f0 | Light |
| Text secondary | #a0aec0 | Muted |


path: dashboard-kit/manifest.json
content: {
  "skill": "project-manager-pro",
  "version": "1.0.0",
  "prefix": "pm_",
  "widgets": [
    {
      "id": "pm_today",
      "name": "Today's Tasks",
      "type": "task-list",
      "description": "Tasks due today and overdue, sorted by priority",
      "default_size": "2x2",
      "refresh_interval_min": 15,
      "data_source": "tasks.json",
      "filter": {
        "status": ["todo", "in-progress", "blocked"],
        "due_date": "today_or_overdue"
      }
    },
    {
      "id": "pm_overdue",
      "name": "Overdue Alerts",
      "type": "alert-list",
      "description": "Overdue tasks with days-overdue count and priority badge",
      "default_size": "1x1",
      "refresh_interval_min": 30,
      "data_source": "tasks.json",
      "filter": {
        "status": ["todo", "in-progress"],
        "due_date": "past"
      },
      "display": {
        "show_days_overdue": true,
        "sort_by": "days_overdue_desc",
        "alert_color": "#e53e3e"
      }
    },
    {
      "id": "pm_progress",
      "name": "Weekly Progress",
      "type": "progress-bar",
      "description": "Tasks completed this week as percentage of total due",
      "default_size": "2x1",
      "refresh_interval_min": 30,
      "data_source": "tasks.json",
      "calculation": {
        "numerator": "completed_this_week",
        "denominator": "total_due_this_week",
        "format": "percentage"
      },
      "display": {
        "bar_color": "#38a169",
        "show_fraction": true
      }
    },
    {
      "id": "pm_project_status",
      "name": "Project Status",
      "type": "multi-bar",
      "description": "Per-project completion bars with task counts",
      "default_size": "2x2",
      "refresh_interval_min": 60,
      "data_source": "projects.json",
      "filter": {
        "status": "active"
      },
      "display": {
        "bar_color": "#4299e1",
        "show_fraction": true,
        "show_target_date": true,
        "max_projects_shown": 6
      }
    },
    {
      "id": "pm_trends",
      "name": "Completion Trends",
      "type": "line-chart",
      "description": "Tasks completed per day over the selected period",
      "default_size": "2x2",
      "refresh_interval_min": 60,
      "data_source": "tasks.json",
      "options": {
        "periods": ["7d", "30d"],
        "default_period": "7d",
        "y_axis": "tasks_completed",
        "x_axis": "date",
        "line_color": "#805ad5",
        "show_average_line": true
      }
    },
    {
      "id": "pm_priority_dist",
      "name": "Priority Distribution",
      "type": "donut-chart",
      "description": "Active task count by priority level",
      "default_size": "1x1",
      "refresh_interval_min": 60,
      "data_source": "tasks.json",
      "filter": {
        "status": ["todo", "in-progress", "blocked"]
      },
      "display": {
        "segments": [
          { "key": "P1", "label": "Critical", "color": "#e53e3e" },
          { "key": "P2", "label": "High", "color": "#ecc94b" },
          { "key": "P3", "label": "Medium", "color": "#ed8936" },
          { "key": "P4", "label": "Low", "color": "#a0aec0" }
        ],
        "show_counts": true
      }
    },
    {
      "id": "pm_upcoming",
      "name": "Upcoming Timeline",
      "type": "timeline",
      "description": "Next 7 days of tasks displayed as a horizontal timeline",
      "default_size": "3x1",
      "refresh_interval_min": 30,
      "data_source": "tasks.json",
      "filter": {
        "status": ["todo", "in-progress"],
        "due_date": "next_7_days"
      },
      "display": {
        "group_by": "date",
        "show_priority_badge": true,
        "show_project_tag": true
      }
    }
  ]
}


path: examples/example-cross-tool-tasks.md
content: # Example: Cross-Tool Auto-Generated Tasks

> These examples show how Project Manager Pro automatically creates tasks from events in other NormieClaw tools.

---

## From Expense Tracker Pro

### Bill Due Date Approaching

When Expense Tracker detects an upcoming bill:

```
🔗 Auto-task from Expense Tracker:
   ✅ Added: "Pay electric bill — Xcel Energy"
   📅 Due: March 15 · 🟡 P2 · 🏷 expense-tracker, bills
   📝 Amount: $142.50 · Account: Xcel Energy · Auto-pay: OFF
```

### Subscription Renewal Warning

When a subscription renewal is detected 7 days before charge:

```
🔗 Auto-task from Expense Tracker:
   ✅ Added: "Review/cancel Adobe Creative Cloud renewal"
   📅 Due: March 18 (renews Mar 25) · 🟠 P3 · 🏷 expense-tracker, subscriptions
   📝 Amount: $54.99/mo · Last used: Feb 12 · Consider canceling?
```

### Budget Threshold Alert

When spending exceeds a category threshold:

```
🔗 Auto-task from Expense Tracker:
   ✅ Added: "Review dining out spending — over budget"
   📅 Due: March 12 · 🟡 P2 · 🏷 expense-tracker, budget
   📝 Dining out: $620 spent of $500 budget (124%) · 19 days left in month
```

---

## From Meal Planner Pro

### Weekly Grocery Run

When a meal plan is created for the week:

```
🔗 Auto-task from Meal Planner:
   ✅ Added: "Grocery shopping — week of March 10"
   📅 Due: Saturday, March 8 · 🟠 P3 · 🏷 meal-planner, groceries

   📝 Shopping list (14 items):
   Produce: chicken thighs (2 lbs), bell peppers (4), cilantro, limes (6),
   sweet potatoes (3), spinach (1 bag)
   Pantry: coconut milk (2 cans), garam masala, red curry paste
   Dairy: Greek yogurt (32 oz), shredded mozzarella
   Other: corn tortillas, eggs (1 dozen), hot sauce (obviously)
```

### Advance Meal Prep

When a recipe requires prep the day before:

```
🔗 Auto-task from Meal Planner:
   ✅ Added: "Prep overnight oats for tomorrow"
   📅 Due: Sunday, March 9 (evening) · 🟠 P3 · 🏷 meal-planner, prep
   📝 Recipe: Mango Coconut Overnight Oats · Prep time: 10 min
       Mix oats, coconut milk, chia seeds, diced mango. Refrigerate overnight.
```

---

## From Fitness Tracker Pro

### Scheduled Workout

When a workout is on the calendar:

```
🔗 Auto-task from Fitness Tracker:
   ✅ Added: "Upper body strength session"
   📅 Due: Wednesday, March 11 · 🟠 P3 · 🏷 fitness-tracker, workout
   📝 Program: Week 4, Day 3 · Target: chest, shoulders, triceps
       Estimated duration: 55 min · Location: home gym
```

### Supplement Reorder

When a supplement supply is running low:

```
🔗 Auto-task from Fitness Tracker:
   ✅ Added: "Reorder creatine monohydrate"
   📅 Due: March 14 · ⚪ P4 · 🏷 fitness-tracker, supplements
   📝 Current supply: ~5 days remaining · Last purchased: Amazon, $28.99
       Reorder link in notes.
```

---

## From Content Calendar Pro

### Content Creation Deadline

When a post is scheduled and needs to be created:

```
🔗 Auto-task from Content Calendar:
   ✅ Added: "Write blog post: '5 Ways to Use Hot Sauce Beyond Wings'"
   📅 Due: March 13 (publishes Mar 15) · 🟡 P2 · 🏷 content-calendar, blog
   📝 Target: 800-1200 words · SEO keyword: "hot sauce recipes"
       Publish platform: normieclaw.ai/blog · Needs: 2 product photos
```

### Content Series Project

When a multi-part content series is planned:

```
🔗 Auto-tasks from Content Calendar:
   📁 New project: March Social Media Series — "Spice Education" (4 posts)

   ├── 🔲 Write + design "Scoville Scale Explained" carousel (Mar 10) · P2
   ├── 🔲 Write + design "Habanero vs Ghost Pepper" comparison (Mar 14) · P2
   │   └── ⏳ Depends on: Scoville post published
   ├── 🔲 Write + design "Indian Spice Blends 101" post (Mar 18) · P2
   └── 🔲 Write + design "Behind the Recipe: Tikka Masala Sauce" (Mar 22) · P2

   4 tasks created · All due 2 days before publish date
```

---

## How Cross-Tool Tasks Behave

- **Tagged with source tool** — easy to filter ("show me all meal planner tasks")
- **Follow normal priority rules** — auto-escalate as deadlines approach
- **Editable like any task** — change due dates, priority, add notes
- **Deletable** — if you don't want auto-generated tasks, delete them or disable the integration
- **Don't duplicate** — if a similar task already exists, the agent skips creation and notes it in the check-in log
- **Respect quiet hours** — cross-tool task creation notifications follow your quiet hours settings


path: examples/example-daily-checkin.md
content: # Example: Daily Check-In Conversation

> Agent delivers morning check-in at 8:00 AM on Wednesday, March 11

---

## Morning Check-In

**Agent:**
```
☀️ Morning — Wednesday, March 11

🔴 OVERDUE (1):
  • Submit Q4 expense report (was due Mar 9) · P2 · ~45 min

📋 TODAY (4):
  • Review hot sauce label proof from designer · P1 · ~20 min
  • Call co-packer to confirm March production slot · P1 · ~15 min
  • Write product descriptions for 3 SKUs · P2 · ~60 min
  • Update budget spreadsheet with ingredient costs · P3 · ~30 min

🚫 BLOCKED (1):
  • Order packaging materials — waiting on "Finalize label design" (in-progress)

⚡ QUICK WINS:
  • Reply to vendor email about shipping rates · P4 · ~5 min
  • Renew GoDaddy domain (expires Mar 15) · P3 · ~5 min

What do you want to tackle first?
```

**User:** "Let me knock out those quick wins first, then the label review"

**Agent:**
```
Good call — starting light and building momentum.

🔄 In-progress: Reply to vendor email
🔄 In-progress: Renew GoDaddy domain

I'll have "Review hot sauce label proof" queued up next. Let me know when the quick wins are done.
```

**User:** "Done with both. The domain renewal is actually due the 18th not the 15th, fix that"

**Agent:**
```
✅ Done: Reply to vendor email
✅ Done: Renew GoDaddy domain
📅 Updated due date: Mar 15 → Mar 18

Next up: Review hot sauce label proof · P1 · ~20 min
```

**User:** "Reviewed the label, it needs changes. I sent feedback to the designer. Block the packaging order until the label is finalized."

**Agent:**
```
✅ Done: Review hot sauce label proof
📝 Note added: "Feedback sent to designer, revision needed"
🚫 Confirmed blocked: Order packaging materials — still waiting on label finalization

3 down, 3 to go. The co-packer call is P1 — want to do that next?
```

**User:** "Yeah, calling now"

**Agent:**
```
🔄 In-progress: Call co-packer to confirm March production slot

Let me know how it goes.
```

**User:** "Production confirmed for March 25. They need final labels by March 20."

**Agent:**
```
✅ Done: Call co-packer to confirm March production slot
📝 Note: "Production confirmed Mar 25. Labels due to co-packer by Mar 20."

⚠️ This means "Finalize label design" just became more urgent — 
   the designer revision + your approval + print-ready files all need 
   to happen before Mar 20.

I've escalated "Finalize label design" to P1 and set a hard deadline of Mar 18 
(2-day buffer before the Mar 20 co-packer deadline).

Updated dependency chain:
  🔄 Finalize label design (P1, due Mar 18)
  └── 🚫 Order packaging materials (blocked)
      └── 🔲 Ship materials to co-packer (due Mar 22)
          └── 🔲 Production run (Mar 25)
```

---

## Evening Review

**Agent (7:00 PM):**
```
🌙 Evening Review — Wednesday, March 11

✅ Completed today (5):
  • Reply to vendor email
  • Renew GoDaddy domain
  • Review hot sauce label proof
  • Call co-packer — production confirmed Mar 25
  • Write product descriptions for 3 SKUs

🔄 Carrying over (2):
  • Update budget spreadsheet · P3 · moved to tomorrow
  • Submit Q4 expense report · P2 · overdue day 3

📊 Week progress: 9/16 tasks done (56%)

5 tasks knocked out — solid day. The expense report is stacking up though. 
Want me to bump it to P1 for tomorrow?
```

**User:** "Yeah, make it P1. I'll do it first thing."

**Agent:**
```
✅ Submit Q4 expense report → P1, first on tomorrow's list.

See you in the morning. 🌙
```


path: examples/example-project-breakdown.md
content: # Example: Project Breakdown — "Launch Website"

> User says: "I need to launch a website for my hot sauce brand by March 20"

## Agent Response

```
📁 New project: Launch Hot Sauce Website (due Mar 20)

Phase 1: Content & Design (Mar 11-13)
├── 🔲 Write homepage copy — hero, about, product descriptions (Mar 11) · P2 · ~90 min
├── 🔲 Gather product photos — 3 SKUs, lifestyle shots (Mar 11) · P2 · ~60 min
├── 🔲 Design landing page mockup in Figma or similar (Mar 12) · P2 · ~120 min
│   └── ⏳ Depends on: homepage copy, product photos
├── 🔲 Write FAQ and shipping/returns policy (Mar 12) · P3 · ~45 min
└── 🔲 Review and approve design mockup (Mar 13) · P1 · ~30 min
    └── ⏳ Depends on: design mockup

Phase 2: Technical Setup (Mar 13-15)
├── 🔲 Purchase domain if not already owned (Mar 13) · P2 · ~15 min
├── 🔲 Set up hosting — Vercel, Netlify, or Shopify (Mar 13) · P2 · ~30 min
├── 🔲 Configure DNS and SSL certificate (Mar 13) · P2 · ~20 min
│   └── ⏳ Depends on: domain purchase, hosting setup
└── 🔲 Set up email forwarding for contact form (Mar 14) · P3 · ~15 min

Phase 3: Build & Integrate (Mar 14-17)
├── 🔲 Build responsive site from approved mockup (Mar 14-16) · P1 · ~360 min
│   └── ⏳ Depends on: approved mockup, hosting setup
├── 🔲 Integrate payment processing — Stripe or Shopify Payments (Mar 16) · P1 · ~120 min
│   └── ⏳ Depends on: site build
├── 🔲 Add contact form with email notification (Mar 16) · P3 · ~30 min
├── 🔲 Set up Google Analytics and Meta Pixel (Mar 16) · P3 · ~20 min
└── 🔲 Add SEO meta tags, sitemap, robots.txt (Mar 17) · P2 · ~30 min

Phase 4: Test & Launch (Mar 18-20)
├── 🔲 QA test on Chrome, Safari, Firefox + mobile (Mar 18) · P1 · ~90 min
│   └── ⏳ Depends on: site build complete
├── 🔲 Fix any QA issues found (Mar 18-19) · P1 · ~120 min
├── 🔲 Test checkout flow end-to-end with real payment (Mar 19) · P1 · ~30 min
├── 🔲 Submit sitemap to Google Search Console (Mar 19) · P3 · ~10 min
├── 🔲 Go live — point production domain and verify (Mar 20) · P1 · ~20 min
│   └── ⏳ Depends on: QA complete, DNS configured
└── 🔲 Post launch announcement on social media (Mar 20) · P2 · ~30 min

18 tasks created · Estimated: ~20 hours total
Buffer: 2 days built in before deadline
```

## What the Agent Did

1. **Identified the end state:** A live, functional e-commerce website for a hot sauce brand
2. **Worked backwards from March 20** with 2 days of buffer
3. **Grouped into 4 phases:** Content → Technical → Build → Launch
4. **Set dependencies:** Build can't start until mockup is approved; QA can't start until build is done
5. **Estimated time per task** using reasonable baselines for web development work
6. **Assigned priorities:** Launch-critical tasks (build, QA, go-live) are P1; supporting tasks are P2-P3

## User Follow-Up

The user can then:
- "Looks good, but move the social media post to March 21" → agent adjusts due date
- "Add a task to set up Instagram shop integration" → agent adds to Phase 3
- "I already have the domain, mark that as done" → agent marks done, unblocks DNS task
- "Show me just Phase 1" → agent shows filtered view


path: scripts/export-tasks.sh
content: #!/usr/bin/env bash
set -euo pipefail

# Project Manager Pro — Export Tasks
# Usage: ./export-tasks.sh [markdown|csv|json] [output-path]

DATA_DIR="${HOME}/.openclaw/workspace/pm-pro"
TASKS_FILE="$DATA_DIR/tasks.json"
PROJECTS_FILE="$DATA_DIR/projects.json"

FORMAT="${1:-markdown}"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
OUTPUT="${2:-$DATA_DIR/exports/tasks_export_${TIMESTAMP}}"

# Validate
if [ ! -f "$TASKS_FILE" ]; then
    echo "❌ No tasks file found at $TASKS_FILE"
    echo "   Run setup.sh first."
    exit 1
fi

TASK_COUNT=$(jq 'length' "$TASKS_FILE")
if [ "$TASK_COUNT" -eq 0 ]; then
    echo "📋 No tasks to export."
    exit 0
fi

# Ensure export directory
mkdir -p "$(dirname "$OUTPUT")"

case "$FORMAT" in
    markdown|md)
        OUTPUT="${OUTPUT}.md"
        {
            echo "# Task Export — $(date '+%B %d, %Y')"
            echo ""
            echo "**Total tasks:** $TASK_COUNT"
            echo ""

            # Overdue
            echo "## 🔴 Overdue"
            echo ""
            jq -r --arg today "$(date +%Y-%m-%d)" '
                .[] | select(.status != "done" and .due_date != null and .due_date < $today) |
                "- **\(.title)** — Due: \(.due_date) · \(.priority) · Status: \(.status)"
            ' "$TASKS_FILE" || echo "_None_"
            echo ""

            # By priority
            for p in P1 P2 P3 P4; do
                LABEL=""
                case "$p" in
                    P1) LABEL="🔴 P1 — Critical" ;;
                    P2) LABEL="🟡 P2 — High" ;;
                    P3) LABEL="🟠 P3 — Medium" ;;
                    P4) LABEL="⚪ P4 — Low" ;;
                esac
                echo "## $LABEL"
                echo ""
                jq -r --arg p "$p" '
                    .[] | select(.priority == $p and .status != "done") |
                    "- **\(.title)**\(if .due_date then " — Due: \(.due_date)" else "" end) · \(.status)\(if .project then " · 📁 \(.project)" else "" end)"
                ' "$TASKS_FILE" || echo "_None_"
                echo ""
            done

            # Completed
            echo "## ✅ Completed"
            echo ""
            jq -r '
                .[] | select(.status == "done") |
                "- ~~\(.title)~~ — Completed: \(.completed_date // "unknown")"
            ' "$TASKS_FILE" || echo "_None_"
            echo ""

            # Projects summary
            if [ -f "$PROJECTS_FILE" ] && [ "$(jq 'length' "$PROJECTS_FILE")" -gt 0 ]; then
                echo "## 📁 Projects"
                echo ""
                jq -r '.[] | "- **\(.name)** — \(.status) · Target: \(.target_date // "none") · \(.completed_count)/\(.task_count) tasks done"' "$PROJECTS_FILE"
                echo ""
            fi
        } > "$OUTPUT"
        echo "✅ Exported $TASK_COUNT tasks to $OUTPUT"
        ;;

    csv)
        OUTPUT="${OUTPUT}.csv"
        {
            echo "id,title,priority,status,due_date,project,tags,time_estimate_min,created_date,completed_date"
            jq -r '.[] | [
                .id,
                (.title | gsub(","; ";")),
                .priority,
                .status,
                (.due_date // ""),
                (.project // ""),
                ((.tags // []) | join(";")),
                (.time_estimate_min // ""),
                .created_date,
                (.completed_date // "")
            ] | @csv' "$TASKS_FILE"
        } > "$OUTPUT"
        echo "✅ Exported $TASK_COUNT tasks to $OUTPUT"
        ;;

    json)
        OUTPUT="${OUTPUT}.json"
        jq '.' "$TASKS_FILE" > "$OUTPUT"
        echo "✅ Exported $TASK_COUNT tasks to $OUTPUT"
        ;;

    *)
        echo "❌ Unknown format: $FORMAT"
        echo "   Usage: ./export-tasks.sh [markdown|csv|json] [output-path]"
        exit 1
        ;;
esac


path: scripts/setup.sh
content: #!/usr/bin/env bash
set -euo pipefail

# Project Manager Pro — Setup Script
# Creates the data directory and initializes empty stores.

DATA_DIR="${HOME}/.openclaw/workspace/pm-pro"

echo "🎯 Project Manager Pro — Setup"
echo ""

# Check for jq
if ! command -v jq &>/dev/null; then
    echo "⚠️  jq not found. Installing..."
    if command -v brew &>/dev/null; then
        brew install jq
    elif command -v apt-get &>/dev/null; then
        sudo apt-get install -y jq
    elif command -v dnf &>/dev/null; then
        sudo dnf install -y jq
    else
        echo "❌ Could not install jq automatically."
        echo "   Install it manually: https://jqlang.github.io/jq/download/"
        exit 1
    fi
    echo "✅ jq installed"
fi

# Create data directory
if [ -d "$DATA_DIR" ]; then
    echo "📁 Data directory already exists: $DATA_DIR"
else
    mkdir -p "$DATA_DIR/archive"
    echo "📁 Created data directory: $DATA_DIR"
fi

# Initialize tasks.json
if [ ! -f "$DATA_DIR/tasks.json" ]; then
    echo "[]" > "$DATA_DIR/tasks.json"
    echo "📋 Initialized tasks.json"
else
    TASK_COUNT=$(jq 'length' "$DATA_DIR/tasks.json")
    echo "📋 tasks.json exists ($TASK_COUNT tasks)"
fi

# Initialize projects.json
if [ ! -f "$DATA_DIR/projects.json" ]; then
    echo "[]" > "$DATA_DIR/projects.json"
    echo "📁 Initialized projects.json"
else
    PROJECT_COUNT=$(jq 'length' "$DATA_DIR/projects.json")
    echo "📁 projects.json exists ($PROJECT_COUNT projects)"
fi

# Initialize check-in log
if [ ! -f "$DATA_DIR/check-in-log.json" ]; then
    echo "[]" > "$DATA_DIR/check-in-log.json"
    echo "📝 Initialized check-in-log.json"
else
    echo "📝 check-in-log.json exists"
fi

# Ensure archive directory exists
mkdir -p "$DATA_DIR/archive"

echo ""
echo "✅ Setup complete!"
echo ""
echo "Data directory: $DATA_DIR"
echo "Next step: Start a conversation with your agent to configure preferences."


path: scripts/weekly-review.sh
content: #!/usr/bin/env bash
set -euo pipefail

# Project Manager Pro — Weekly Review Generator
# Produces a summary of the past week's task activity.
# Called by the agent on Sundays or manually.

DATA_DIR="${HOME}/.openclaw/workspace/pm-pro"
TASKS_FILE="$DATA_DIR/tasks.json"
PROJECTS_FILE="$DATA_DIR/projects.json"
ARCHIVE_DIR="$DATA_DIR/archive"

if [ ! -f "$TASKS_FILE" ]; then
    echo "❌ No tasks file found. Run setup.sh first."
    exit 1
fi

# Date calculations
if [[ "$(uname)" == "Darwin" ]]; then
    WEEK_START=$(date -v-7d +%Y-%m-%d)
    TODAY=$(date +%Y-%m-%d)
    NEXT_WEEK=$(date -v+7d +%Y-%m-%d)
    MONTH_FILE="$ARCHIVE_DIR/$(date +%Y-%m).json"
else
    WEEK_START=$(date -d "7 days ago" +%Y-%m-%d)
    TODAY=$(date +%Y-%m-%d)
    NEXT_WEEK=$(date -d "7 days" +%Y-%m-%d)
    MONTH_FILE="$ARCHIVE_DIR/$(date +%Y-%m).json"
fi

echo "📊 Weekly Summary — Week of ${WEEK_START} to ${TODAY}"
echo ""

# Completed this week
COMPLETED=$(jq -r --arg start "$WEEK_START" --arg end "$TODAY" '
    [.[] | select(.status == "done" and .completed_date != null and .completed_date >= $start and .completed_date <= $end)] | length
' "$TASKS_FILE")
echo "✅ Completed: $COMPLETED tasks"

# Created this week
CREATED=$(jq -r --arg start "$WEEK_START" --arg end "$TODAY" '
    [.[] | select(.created_date >= $start and .created_date <= $end)] | length
' "$TASKS_FILE")
echo "🆕 Created: $CREATED tasks"

# Net progress
NET=$((COMPLETED - CREATED))
if [ "$NET" -gt 0 ]; then
    echo "📈 Net progress: +${NET} tasks cleared"
elif [ "$NET" -lt 0 ]; then
    echo "📉 Net: ${NET} (more created than completed)"
else
    echo "📊 Net: Even (created = completed)"
fi
echo ""

# Completed task titles
if [ "$COMPLETED" -gt 0 ]; then
    echo "🏆 Completed this week:"
    jq -r --arg start "$WEEK_START" --arg end "$TODAY" '
        .[] | select(.status == "done" and .completed_date != null and .completed_date >= $start and .completed_date <= $end) |
        "  • \(.title)\(if .project then " (📁 \(.project))" else "" end)"
    ' "$TASKS_FILE"
    echo ""
fi

# Overdue tasks
OVERDUE=$(jq -r --arg today "$TODAY" '
    [.[] | select(.status != "done" and .due_date != null and .due_date < $today)] | length
' "$TASKS_FILE")
if [ "$OVERDUE" -gt 0 ]; then
    echo "⚠️ Overdue ($OVERDUE):"
    jq -r --arg today "$TODAY" '
        .[] | select(.status != "done" and .due_date != null and .due_date < $today) |
        "  • \(.title) — due \(.due_date) · \(.priority)"
    ' "$TASKS_FILE"
    echo ""
fi

# Blocked tasks
BLOCKED=$(jq '[.[] | select(.status == "blocked")] | length' "$TASKS_FILE")
if [ "$BLOCKED" -gt 0 ]; then
    echo "🚫 Blocked ($BLOCKED):"
    jq -r '.[] | select(.status == "blocked") | "  • \(.title)"' "$TASKS_FILE"
    echo ""
fi

# Next week preview
NEXT_WEEK_TASKS=$(jq -r --arg today "$TODAY" --arg next "$NEXT_WEEK" '
    [.[] | select(.status != "done" and .due_date != null and .due_date >= $today and .due_date <= $next)] | length
' "$TASKS_FILE")
echo "📅 Next week: $NEXT_WEEK_TASKS tasks due"
if [ "$NEXT_WEEK_TASKS" -gt 0 ]; then
    jq -r --arg today "$TODAY" --arg next "$NEXT_WEEK" '
        .[] | select(.status != "done" and .due_date != null and .due_date >= $today and .due_date <= $next) |
        "  • \(.title) — \(.due_date) · \(.priority)"
    ' "$TASKS_FILE" | head -10
fi
echo ""

# Project status
if [ -f "$PROJECTS_FILE" ] && [ "$(jq 'length' "$PROJECTS_FILE")" -gt 0 ]; then
    echo "📁 Project Status:"
    jq -r '.[] | select(.status == "active") |
        "  • \(.name): \(.completed_count)/\(.task_count) tasks (\(if .task_count > 0 then ((.completed_count * 100 / .task_count) | floor) else 0 end)%)\(if .target_date then " — target \(.target_date)" else "" end)"
    ' "$PROJECTS_FILE"
    echo ""
fi

# Auto-archive old completed tasks
if [ -d "$ARCHIVE_DIR" ]; then
    if [[ "$(uname)" == "Darwin" ]]; then
        ARCHIVE_CUTOFF=$(date -v-30d +%Y-%m-%d)
    else
        ARCHIVE_CUTOFF=$(date -d "30 days ago" +%Y-%m-%d)
    fi

    ARCHIVE_COUNT=$(jq -r --arg cutoff "$ARCHIVE_CUTOFF" '
        [.[] | select(.status == "done" and .completed_date != null and .completed_date < $cutoff)] | length
    ' "$TASKS_FILE")

    if [ "$ARCHIVE_COUNT" -gt 0 ]; then
        # Append to monthly archive
        if [ -f "$MONTH_FILE" ]; then
            EXISTING=$(cat "$MONTH_FILE")
        else
            EXISTING="[]"
        fi

        jq -r --arg cutoff "$ARCHIVE_CUTOFF" '
            [.[] | select(.status == "done" and .completed_date != null and .completed_date < $cutoff)]
        ' "$TASKS_FILE" | jq -s ".[0] + .[1]" <(echo "$EXISTING") - > "${MONTH_FILE}.tmp"
        mv "${MONTH_FILE}.tmp" "$MONTH_FILE"

        # Remove archived from active
        jq --arg cutoff "$ARCHIVE_CUTOFF" '
            [.[] | select(.status != "done" or .completed_date == null or .completed_date >= $cutoff)]
        ' "$TASKS_FILE" > "${TASKS_FILE}.tmp"
        mv "${TASKS_FILE}.tmp" "$TASKS_FILE"

        echo "🗄 Archived $ARCHIVE_COUNT completed tasks (older than 30 days)"
    fi
fi

echo "───────────"
echo "Generated: $(date '+%Y-%m-%d %H:%M')"


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)