Agent skill

New Async Task

by Rain-kl in Rain-kl/OpenFlare

Wavelet 项目专用:新增或修改 Asynq 异步任务、后台任务、定时任务、任务元数据、TaskHandler、TaskParam、PayloadValidator、AppendLog、任务重试、任务执行记录或 Admin 任务 API 时必须使用。

Apache-2.0Auto-check passed

Install New Async Task

skills CLI
$ npx skills add Rain-kl/OpenFlare --skill new-async-task -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Rain-kl/OpenFlare new-async-task --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/new-async-task .claude/skills/new-async-task && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
new-async-task
GitHub stars
288
Token cost
~949 tokens
SKILL.md length
251 words
Files
2 (incl. references)
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Wavelet 项目专用:新增或修改 Asynq 异步任务、后台任务、定时任务、任务元数据、TaskHandler、TaskParam、PayloadValidator、AppendLog、任务重试、任务执行记录或 Admin 任务 API 时必须使用。

  • SKILL.md covers 开始前, 实现要求, 日志要求 and 重试要求, plus 3 more sections
  • Calls make

What it does

New Async Task is an agent skill from Rain-kl/OpenFlare. Wavelet 项目专用:新增或修改 Asynq 异步任务、后台任务、定时任务、任务元数据、TaskHandler、TaskParam、PayloadValidator、AppendLog、任务重试、任务执行记录或 Admin 任务 API 时必须使用。

Its SKILL.md is about 950 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/CODE-EXAMPLES.md`).

It works with Cloudflare. The repository describes itself as: OpenFlare is an open-source CDN orchestration and edge security platform. It supports reverse proxy, centralized configuration synchronization, in-network tunneling (Tunnels)… The licence is Apache-2.0.

Example prompts

  • “/new-async-task”

What it can do on your machine

Read from SKILL.md and the folder at commit 7483897. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

New Async Task loads about 949 tokens when it runs, and up to ~3.1k if it reads all its reference files. Until then it costs about 36 tokens; SKILL.md has 251 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~949
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Rain-kl/OpenFlare at commit 7483897, republished under its Apache-2.0 licence (© Rain-kl). 251 words, ~949 tokens.

Download SKILL.mdSave it as .claude/skills/new-async-task/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
new-async-task
description
Wavelet 项目专用:新增或修改 Asynq 异步任务、后台任务、定时任务、任务元数据、TaskHandler、TaskParam、PayloadValidator、AppendLog、任务重试、任务执行记录或 Admin 任务 API 时必须使用。

异步任务开发

开始前阅读根目录 AGENTS.md。只修改任务相关链路,遵守项目路由、日志、数据库迁移和质量门禁要求。

开始前

按任务范围检查当前实现:

  • internal/infra/task/handler.go:TaskHandler、TaskResult、PayloadValidator
  • internal/infra/task/meta.go:TaskMeta、TaskParam
  • internal/infra/task/executor.go:下发、执行、日志、重试、OnTaskCompleted 订阅
  • internal/infra/task/handlers/register.go:Handler 和元数据注册(由 bootstrap 调用)
  • internal/platform/bootstrap/bootstrap.go:任务注册与进程级装配入口
  • internal/infra/task/worker/worker.go:Worker 路由和队列
  • internal/infra/task/scheduler/scheduler.go:定时调度
  • internal/apps/admin/task/routers.go:Admin 任务 API
  • internal/model/task_execution.go:执行记录实体与 DTO
  • internal/repository/task_execution.go:执行记录和日志持久化

需要模板时阅读 references/CODE-EXAMPLES.md。

实现要求

任务定义
  • 在 internal/apps/<module>/tasks.go 定义任务类型、Admin 任务类型和 TaskMeta。
  • Asynq 任务类型使用 <module>:<action> 格式。
  • 完整设置 Type、AsynqTask、Name、Description、MaxRetry、Queue、Retryable。
  • 有参数任务必须定义 payload struct。
  • TaskParam.Name 必须与 payload JSON tag 一致。
  • TaskParam 只描述前端表单,不代替服务端校验。
Handler
  • Handler 必须实现 task.TaskHandler。
  • 有参数任务必须实现 task.PayloadValidator,负责校验和标准化 Admin 下发参数。
  • Execute 必须再次解析 payload;不要假设入口一定经过 Admin 校验。
  • 成功返回 &task.TaskResult{Message: ..., Detail: ...}。
  • 失败返回 error,由任务框架处理状态和重试。
  • 不要吞掉关键错误。
  • 持久化只通过 internal/repository/(唯一入口);业务编排放模块内 logics.go / service.go。internal/model 仅实体/DTO,禁止 CRUD 与 DB 访问。
注册
  • 在 internal/infra/task/handlers/register.go 同时注册 Handler 和 TaskMeta。
  • 不要在其他位置单独注册任务。
  • 禁止在业务包 routers.go 或 init() 中调用 task.RegisterHandler;统一由 bootstrap.RegisterTasks() → taskhandlers.Register() 在进程启动时装配。
  • 任务完成钩子(如 push 通知)通过 task.OnTaskCompleted 注册,在 bootstrap.RegisterTaskListeners() 中装配(Worker/all 进程)。
进程装配分工
进程注册入口
apicmd/api.go → bootstrap.RegisterAPI()(含 RegisterTasks)
workerworker.StartWorker() → bootstrap.RegisterWorker()(含 RegisterTasks + RegisterTaskListeners)
schedulerscheduler.StartScheduler() → bootstrap.RegisterScheduler()
allcmd/all.go → bootstrap.RegisterAll()

所有 Register* 使用 sync.Once,重复调用安全。

测试
  • 依赖已注册任务类型或 Handler 的测试(如 internal/apps/admin/task/routers_test.go),必须在 setup 中显式调用 bootstrap.RegisterTasks()。
  • 不得依赖 init() 副作用或 import 链触发注册。

日志要求

  • 在 TaskHandler.Execute 中使用 task.AppendLog(ctx, format, args...)。
  • 记录任务开始、参数摘要、批次进度、关键状态、可继续错误和完成摘要。
  • 批量处理按批次记录;禁止为大循环中的每条数据写日志。
  • 不要直接修改任务日志的 Redis key 或 w_task_executions.log。

日志框架约束:

  • 执行状态实时写入数据库:pending、running、succeeded、failed。
  • 实时日志写入 Redis,每个任务最多保留最近 1000 行。
  • Redis 日志 TTL 为 24 小时,每次追加时刷新。
  • 查询时优先返回 Redis 日志,Redis 不存在时读取数据库。
  • 任务成功或自动重试耗尽后,将日志写入数据库并删除 Redis 缓冲。
  • 自动重试期间保留同一 taskID 的 Redis 日志。

重试要求

  • Handler 返回 error 以触发 Asynq 自动重试。
  • 不要在 Handler 内自行实现重复重试循环。
  • Admin 手动重试只允许:
    • 原任务状态为 failed
    • Retryable=true
    • RetryCount < MaxRetry
  • 修改重试行为时同时检查:
    • internal/infra/task/executor.go
    • internal/model/task_execution.go
    • internal/apps/admin/task/routers.go
    • 前端任务执行列表

定时任务

  • 默认定时任务必须通过 Goose SQL 迁移写入 schedules。
  • PostgreSQL 和 SQLite 迁移必须同时提供。
  • 初始化 SQL 必须幂等。
  • 涉及迁移时使用 database-migration skill。

Admin API

  • Handler 放在现有 Admin task 模块或 internal/apps/admin/<module>/。
  • 路由只在 internal/router/router.go 注册。
  • 响应保持 { "error_msg": "", "data": ... }。
  • 分页数据保持 { "total": 0, "results": [] }。
  • Swagger 注释必须完整;API 变化后运行 make swagger。

前端

  • 仅任务元数据变化时,优先复用现有动态任务表单,不新增页面。
  • API 调用必须通过 frontend/lib/services/。
  • 修改 shadcn/ui 时使用 shadcn skill。
  • 不使用 any。
  • 页面根容器使用 w-full,不添加页面级 max-w-*。

© Rain-kl, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/new-async-task of Rain-kl/OpenFlare.

  • SKILL.md
  • references/CODE-EXAMPLES.md

Open the folder on GitHubat commit 7483897

Compare with similar skills

New Async Task next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

New Async Task compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
New Async Task this skillRain-kl/OpenFlare288—~949Automated safety check: PassApache-2.0
Cloudflare Browser Renderingcloudflare/moltworker9.9k—~742Automated safety check: PassApache-2.0
Turnstile Spincloudflare/skills3k4 repos~7.2kAutomated safety check: NotesApache-2.0
Star Office UI Setupringhyacinth/Star-Office-UI7.5k—~1.3kAutomated safety check: PassMIT
Cloudflarehodgef/apiker1277 repos~2.2kAutomated safety check: PassMIT
Webhome Extension Builderwebhtv/webhtv1.7k—~2.8kAutomated safety check: PassGPL-3.0

Similar skills

  • Cloudflare Browser Rendering

    cloudflare/moltworker

    Official

    Drives headless Chrome through Cloudflare Browser Rendering over a CDP WebSocket to take screenshots, navigate and scrape pages, and record multi-page videos.

    9.9k GitHub stars~742 tokensUpdated 5 mo ago
    Productivity & AutomationAuto-check passed
  • Turnstile Spin

    cloudflare/skills

    Official

    Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

    3k GitHub starsUsed in 4 repos~7.2k tokens
    Frontend & DesignAuto-check: notes
  • Star Office UI Setup

    ringhyacinth/Star-Office-UI

    Sets up Star Office UI, a pixel-art office dashboard that shows AI agent states, lets other agents join and can be opened from a phone or a public link.

    7.5k GitHub stars~1.3k tokensUpdated 7 mo ago
    Agent WorkflowsAuto-check passed
  • Cloudflare

    hodgef/apiker

    Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF…

    127 GitHub starsUsed in 7 repos~2.2k tokens
    DevOps & CloudAuto-check passed
  • Build, review, debug, reverse-engineer, and package WebHome injected extension scripts for FongMi/WebHome App WebView pages.

    1.7k GitHub stars~2.8k tokensUpdated today
    SecurityAuto-check passed
  • Nextjs On Cloudflare

    cloudflare/skills

    Official

    Build, migrate, and deploy Next.js apps on Cloudflare Workers with vinext.

    3k GitHub starsUsed in 2 repos~678 tokens
    DevOps & CloudAuto-check passed

More from Rain-kl/OpenFlare

All 12 skills in this repo
  • Code Review Skill

    Rain-kl/OpenFlare

    Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, PHP, Python, Django, Go, C/.NET, Kotlin, Swift, NestJS, C/C++, and more.

    288 GitHub stars~2.3k tokensUpdated today
    Auto-check: notes
  • Go Logging

    Rain-kl/OpenFlare

    在选择日志方案、配置 slog、编写结构化日志语句或决定日志级别时使用。也适用于设置生产日志、为日志添加请求作用域上下文或从 log 迁移到 slog 的场景,即使用户未明确提及日志。不涵盖错误处理策略(参见 go-error-handling)。

    288 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • New API

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。

    288 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Cache Framework

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改业务缓存(RAM/Redis/DB 三层读路径)、缓存失效、多节点 pub/sub 同步、或评估高频读是否应接入缓存时必须使用。本技能说明系统标准缓存框架、参考实现、禁止写法与分布式一致性要求。

    288 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Clickhouse Batchwriter

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改 ClickHouse 批量写入、接入 internal/infra/persistence/batchwriter、将业务域异步 flush 到分析表、迁移 riskcontrol/节点访问日志/可观测时序写入、或评估 asyncinsert 与背压策略时必须使用。本技能指导分层职责、各域独立 Writer 实例、repository 批量 API…

    288 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Database Migration

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…

    288 GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Works with

Questions about New Async Task

What does New Async Task do?

Wavelet 项目专用:新增或修改 Asynq 异步任务、后台任务、定时任务、任务元数据、TaskHandler、TaskParam、PayloadValidator、AppendLog、任务重试、任务执行记录或 Admin 任务 API 时必须使用。. New Async Task is an agent skill from Rain-kl/OpenFlare.

How do I install New Async Task in Claude Code?

Run `npx skills add Rain-kl/OpenFlare --skill new-async-task -a claude-code`. Or copy the skill folder (.agents/skills/new-async-task in Rain-kl/OpenFlare) into .claude/skills/new-async-task in your project. Claude Code loads it when a task matches its description.

How do I install New Async Task in Codex?

Run `npx skills add Rain-kl/OpenFlare --skill new-async-task -a codex`. Or copy the skill folder (.agents/skills/new-async-task in Rain-kl/OpenFlare) into .agents/skills/new-async-task in your project. Codex loads it when a task matches its description.

Can I use New Async Task in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Rain-kl/OpenFlare --skill new-async-task -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/new-async-task, .gemini/skills/new-async-task, .github/skills/new-async-task and .opencode/skills/new-async-task in your project.

What does New Async Task need to run?

Going by SKILL.md and its folder, New Async Task needs the command-line tools its instructions call (make).

Does New Async Task access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is New Async Task safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does New Async Task use?

New Async Task is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does New Async Task use?

About 949 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.2k tokens, read only when the agent opens those files.

What are the alternatives to New Async Task?

Skills that share tags, products or a category with New Async Task: Cloudflare Browser Rendering (cloudflare/moltworker, 9.9k stars), Turnstile Spin (cloudflare/skills, 3k stars), Star Office UI Setup (ringhyacinth/Star-Office-UI, 7.5k stars) and Cloudflare (hodgef/apiker, 127 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains New Async Task?

Rain-kl (a GitHub user) maintains it in Rain-kl/OpenFlare, which has 288 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 7, 2026.

Source: Rain-kl/OpenFlare on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.