Skip to content

Commit 2a75c9b

Browse files
DavidsonGomesclaude
andcommitted
release: v0.8.0 — scheduled tasks & dynamic routine discovery
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ce970f0 commit 2a75c9b

26 files changed

Lines changed: 1653 additions & 296 deletions

File tree

.claude/skills/create-routine/SKILL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ Key rules for systematic routines:
116116
- No `agent` parameter — systematic routines don't use agents
117117
- Common patterns: `requests.get()` for API polling, `os.walk()` for file ops, `csv.writer()` for data export, `shutil` for backups
118118

119-
## Step 3: Add to Makefile
119+
## Step 3: Run It
120120

121-
Append a make target:
121+
No Makefile changes needed — routines are discovered dynamically from scripts.
122122

123-
```makefile
124-
{routine-id}: ## {emoji} {Description} (@{agent})
125-
$(PYTHON) $(ADW_DIR)/custom/{script_name}.py
123+
```bash
124+
make run R={routine-id} # Run by ID
125+
make list-routines # List all available
126126
```
127127

128128
## Step 4: Add to Scheduler (Optional)
@@ -147,7 +147,7 @@ schedule.every({N}).minutes.do(run_adw, "{Routine Name}", "custom/{script_name}.
147147

148148
Run the routine manually:
149149
```bash
150-
make {routine-id}
150+
make run R={routine-id}
151151
```
152152

153153
Check the output and adjust the prompt if needed.
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
---
2+
name: schedule-task
3+
description: "Create, update, list, or run scheduled tasks (one-off actions). Schedule a skill, prompt, or script to run at a specific date/time without creating a full routine. Use when user says 'schedule this for', 'run this at', 'agendar para', 'roda isso amanha', 'post this on Friday at 10am', 'schedule a task', or any reference to one-off scheduled actions."
4+
metadata:
5+
author: openclaude
6+
version: "1.0"
7+
---
8+
9+
# Schedule Task — One-Off Scheduled Actions
10+
11+
Create and manage one-off scheduled tasks that run at a specific date/time. Unlike routines (which repeat on cron), scheduled tasks execute once and are done.
12+
13+
## When to Use
14+
15+
- User wants to schedule something for a specific time: "posta no LinkedIn sexta 10h"
16+
- User wants to run a report later: "roda o financial pulse amanha as 8h"
17+
- User says "agenda pra", "schedule this for", "run at", "agendar tarefa"
18+
- User wants to list or manage pending tasks: "quais tarefas agendadas?"
19+
20+
## API Reference
21+
22+
The dashboard backend exposes these endpoints:
23+
24+
| Method | Endpoint | Action |
25+
|--------|----------|--------|
26+
| GET | `/api/tasks` | List tasks (query: `?status=pending\|running\|completed\|failed`) |
27+
| POST | `/api/tasks` | Create a new task |
28+
| GET | `/api/tasks/<id>` | Get task details |
29+
| PUT | `/api/tasks/<id>` | Edit a pending task |
30+
| DELETE | `/api/tasks/<id>` | Cancel (pending) or delete (completed/failed) |
31+
| POST | `/api/tasks/<id>/run` | Execute immediately |
32+
33+
## Task Types
34+
35+
| Type | Payload | When to Use |
36+
|------|---------|-------------|
37+
| `skill` | Skill name + args (e.g. `social-post-writer LinkedIn post about X`) | Running a Claude skill |
38+
| `prompt` | Free-form prompt text | Running a raw Claude prompt |
39+
| `script` | Script path relative to `ADWs/routines/` (e.g. `custom/financial_pulse.py`) | Running an existing routine script |
40+
41+
## Agents
42+
43+
| Agent ID | Short Name |
44+
|----------|------------|
45+
| `clawdia-assistant` | @clawdia |
46+
| `flux-financeiro` | @flux |
47+
| `atlas-project` | @atlas |
48+
| `kai-personal-assistant` | @kai |
49+
| `pulse-community` | @pulse |
50+
| `sage-strategy` | @sage |
51+
| `pixel-social-media` | @pixel |
52+
| `nex-comercial` | @nex |
53+
| `mentor-courses` | @mentor |
54+
55+
## Workflow
56+
57+
### Creating a Task
58+
59+
1. **Understand the request** — extract what, when, and how:
60+
- **What:** the action to perform
61+
- **When:** date + time (convert relative dates like "amanha", "sexta" to absolute ISO 8601 in UTC)
62+
- **Type:** skill, prompt, or script
63+
- **Agent:** which agent should handle it (if applicable)
64+
65+
2. **Confirm with user** — show a summary before creating:
66+
```
67+
Agendar:
68+
- Nome: Post LinkedIn sobre Evolution Summit
69+
- Tipo: skill
70+
- Payload: social-post-writer LinkedIn post about Evolution Summit April 14-16
71+
- Agent: @pixel
72+
- Quando: 2026-04-11 13:00 (BRT)
73+
74+
Confirma?
75+
```
76+
77+
3. **Create via API:**
78+
79+
```bash
80+
curl -s -X POST http://localhost:8080/api/tasks \
81+
-H "Content-Type: application/json" \
82+
-b "session=..." \
83+
-d '{
84+
"name": "Post LinkedIn sobre Evolution Summit",
85+
"description": "LinkedIn post promoting the Evolution Summit event",
86+
"type": "skill",
87+
"payload": "social-post-writer LinkedIn post about Evolution Summit April 14-16",
88+
"agent": "pixel-social-media",
89+
"scheduled_at": "2026-04-11T16:00:00Z"
90+
}'
91+
```
92+
93+
**Important:** Convert BRT times to UTC by adding 3 hours. The user's timezone is America/Sao_Paulo (UTC-3).
94+
95+
### Listing Tasks
96+
97+
```bash
98+
# All pending tasks
99+
curl -s http://localhost:8080/api/tasks?status=pending -b "session=..."
100+
101+
# All tasks
102+
curl -s http://localhost:8080/api/tasks -b "session=..."
103+
```
104+
105+
Present as a clean table:
106+
```
107+
ID | Nome | Tipo | Agendado | Status
108+
---|-------------------------------|-------|-----------------|--------
109+
1 | Post LinkedIn Summit | skill | 11/04 13:00 BRT | pending
110+
2 | Financial Weekly extra | script| 12/04 08:00 BRT | completed
111+
```
112+
113+
### Running Now
114+
115+
If user wants to execute immediately:
116+
```bash
117+
curl -s -X POST http://localhost:8080/api/tasks/<id>/run -b "session=..."
118+
```
119+
120+
### Cancelling
121+
122+
```bash
123+
curl -s -X DELETE http://localhost:8080/api/tasks/<id> -b "session=..."
124+
```
125+
126+
## Date Parsing Rules
127+
128+
The user speaks Portuguese. Common patterns:
129+
- "amanha as 10h" → tomorrow at 10:00 BRT → +1 day, 13:00 UTC
130+
- "sexta 15h" → next Friday at 15:00 BRT → Friday 18:00 UTC
131+
- "segunda de manha" → next Monday at 09:00 BRT → Monday 12:00 UTC
132+
- "hoje a noite" → today at 21:00 BRT → today 00:00+1 UTC
133+
- "daqui 2 horas" → now + 2 hours
134+
135+
Always confirm the parsed date with the user before creating.
136+
137+
## Examples
138+
139+
### "Agenda um post no LinkedIn pra sexta as 10h sobre o Summit"
140+
```json
141+
{
142+
"name": "Post LinkedIn — Evolution Summit",
143+
"type": "skill",
144+
"payload": "social-post-writer LinkedIn post about Evolution Summit April 14-16, 2026",
145+
"agent": "pixel-social-media",
146+
"scheduled_at": "2026-04-10T13:00:00Z"
147+
}
148+
```
149+
150+
### "Roda o community pulse amanha as 8h"
151+
```json
152+
{
153+
"name": "Community Pulse (manual)",
154+
"type": "script",
155+
"payload": "custom/community_daily.py",
156+
"agent": null,
157+
"scheduled_at": "2026-04-10T11:00:00Z"
158+
}
159+
```
160+
161+
### "Manda um resumo pro Telegram amanha 14h com status dos projetos"
162+
```json
163+
{
164+
"name": "Resumo projetos via Telegram",
165+
"type": "prompt",
166+
"payload": "Check the status of all active projects (Evo AI, Evolution Summit, Evo Academy) and send a summary via Telegram to Davidson",
167+
"agent": "atlas-project",
168+
"scheduled_at": "2026-04-10T17:00:00Z"
169+
}
170+
```
171+
172+
## Important Notes
173+
174+
- Tasks are one-off. For recurring actions, use `create-routine` skill instead.
175+
- The scheduler checks for pending tasks every 30 seconds.
176+
- Tasks run in background threads — they won't block the scheduler.
177+
- Results are saved in `result_summary` and visible in the dashboard at `/tasks`.
178+
- Always confirm with the user before creating a task.
179+
- Convert all times from BRT (UTC-3) to UTC before sending to the API.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.8.0] - 2026-04-09
9+
10+
### Added
11+
- **Scheduled Tasks** — new one-off task scheduling system. Schedule a skill, prompt, or script to run at a specific date/time without creating a full routine. Dashboard page at `/tasks` with create/edit/cancel/run-now/view-result. API CRUD at `/api/tasks`. Scheduler checks pending tasks every 30 seconds.
12+
- **`schedule-task` skill** — conversational interface to create scheduled tasks ("agendar pra sexta 10h", "schedule this for tomorrow")
13+
- **Dynamic routine discovery**`ROUTINE_SCRIPTS` and `SCRIPT_AGENTS` are no longer hardcoded. Agent and script mappings are built dynamically by scanning `ADWs/routines/` scripts and extracting metadata from docstrings (`via AgentName` pattern). New scripts are auto-discovered.
14+
- **`make run R=<id>`** — generic dynamic runner for any routine (core or custom)
15+
- **`make list-routines`** — lists all discovered routines with agent, script, and name
16+
- **Workspace file browser** — reports page replaced with a full file browser that navigates workspace folders
17+
18+
### Changed
19+
- **Makefile cleaned** — custom routine targets (user-specific) removed from Makefile. Only core routine targets remain (`morning`, `eod`, `memory`, `memory-lint`, `weekly`). Custom routines run via `make run R=<id>`.
20+
- **`ROUTINES.md`** — expanded with scheduled tasks docs, dynamic discovery, and updated manual execution section
21+
- **Documentation** — new `docs/routines/scheduled-tasks.md`, updated makefile reference, dashboard overview, creating-routines guide, and skills overview
22+
823
## [0.7.0] - 2026-04-09
924

1025
### Added

0 commit comments

Comments
 (0)