- Home
- Skills
- Sammcj
- Agentic Coding
- Deferred Task Execution
deferred-task-execution_skill
- Python
110
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill sammcj/agentic-coding --skill deferred-task-execution- SKILL.md2.6 KB
Overview
This skill delays execution of a task until a user-specified time or after a duration. It parses natural language scheduling requests, launches a background wait timer, and runs the deferred work when the timer finishes. It also provides confirmations, status tracking, and cancellation support.
How this skill works
The skill confirms the user’s intent and converts a natural-language time or duration into a wait-until argument (e.g., 30m, 1h15m, 3pm). It launches a background shell timer script that returns a task ID, then polls that task with TaskOutput (blocking) until the timer reports completion. After receiving the completion message, it executes the requested task. If needed, it can stop the background task with TaskStop.
When to use it
- User asks to run something after a relative duration (e.g., in 30 minutes, in 2 hours).
- User requests execution at a specific clock time (e.g., at 3pm, at 14:30).
- User wants to schedule a command or workflow to run later without manual re-triggering.
- User needs to defer work during long-running sessions or postpone notifications.
- User requests cancellation or change of a previously scheduled deferred task.
Best practices
- Always confirm the exact action and the parsed wait argument before launching the timer. Tell the user the calculated wake time (date and clock).
- Use the script’s supported formats for durations and clock times (e.g., 30m, 1h15m, 3pm). Show examples when parsing ambiguous phrasing.
- Warn users that the agent session must remain open for the deferred task to run; for multi-hour waits remind them again.
- When starting the timer, capture and save the returned task ID; it’s required for polling and for TaskStop if the user cancels.
- If TaskOutput times out (max 600000ms), call TaskOutput again with the same task ID and block until you see the completion message.
Example use cases
- “Remind me to run the deployment in 45 minutes” — parses to 45m, starts background timer, runs deployment after timer completes.
- “Run the tests at 9pm” — converts to 21:00 (or tomorrow if already past), confirms, then executes test suite at that time.
- “Pause work and resume in 2h30m to continue the refactor” — launches timer and resumes the coding task when done.
- “Schedule a data backup at 03:00” — sets wait-until 03:00 and executes backup script when the timer completes.
- “Cancel my deferred job” — uses the saved task ID and TaskStop to terminate the background timer.
FAQ
Durations like 30s, 5m, 1h, 2h30m and clock times like 14:30, 3pm, 9:30am are supported. If a clock time is already past today, it schedules for tomorrow.
What happens if the session closes before the timer fires?
The deferred task will not execute. Always warn users that the agent session must remain open for the timer to complete.
How do I cancel a scheduled deferred task?
Use TaskStop with the background task ID returned when the timer was launched.