CommunityResearch & Data Analysisgithub.com

lingyu9495-source/agent-responsiveness-delegation

Assigns heavy tasks to sub-agents so the main agent stays responsive and can handle user interruptions immediately.

What is agent-responsiveness-delegation?

This skill solves the common problem of AI assistants becoming unresponsive during long-running tasks. When a main agent executes heavy work (like batch processing or multi-file handling) in the foreground, it blocks the entire conversation round—users' messages queue up, and the agent only replies after minutes. The root cause isn't model latency but the main agent monopolizing the dialog with foreground tasks. The skill enforces a discipline: classify tasks by severity (L0-L3), delegate any heavy work (L2+) to sub-agents immediately, and always return control to the user by ending the turn after delegation. It includes a portable rules block that can be pasted into system prompts or instruction files for any AI agent platform. For platforms with tested file locations (Hermes SOUL.md, Claude Code CLAUDE.md), a provision script (scripts/provision_agent_responsiveness.py) idempotently writes the rules with automatic backup, without overwriting existing content. An audit script (scripts/audit_agent_responsiveness.py) verifies rules presence, placement, and consistency with the template, returning exit code 2 with an honest message if no supported platform is detected. The skill is pure standard library, zero dependencies, and works on Windows/macOS/Linux.

Works with✓Claude Code✓Codex CLI✓Cursor
npx skills add https://github.com/lingyu9495-source/agent-skills/tree/main/skills/agent-responsiveness-delegation

Installed? Explore more Research & Data Analysis skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Preview

From the skill README

WeChat QR Code of 九品锦锂e

Documentation

Main Agent Only Orchestrates · Heavy Tasks All Delegated to Sub-Agents · Always Responsive

Problem: You assign a heavy task to an AI assistant, and then it doesn't reply to your messages, you can only queue to interrupt, and you wait over ten minutes for a single response. Root cause: The model isn't slow—the main agent runs the heavy task in the foreground, locking up the entire turn—your messages just queue behind it. Solution: Turn "delegate heavy tasks + always respond" into a hard rule written into the Agent's instructions, and use scripts to idempotently apply it to your machine.

Platform-independent: The rules block itself is platform-agnostic and works with any AI Agent that supports instruction files / system prompts / sub-agents (Claude Code / Codex / Cursor / WorkBuddy / Hermes / other similar platforms). The provisioner only writes directly to two tested locations; for other platforms, it generates a paste-ready rules block—no guessing config paths or fabricating fields.


When to Use

  • Users complain "waiting too long / interruption freezes / no one answers / I need to chat with you often";
  • You want to institutionalize "delegate heavy tasks to sub-agents, main agent always responsive" on one or more local Agent instances;
  • You want to install this mechanism on an instance (via scripts/provision_agent_responsiveness.py) and verify it's truly active (via scripts/audit_agent_responsiveness.py).

Root Cause

The main agent runs heavy tasks (batch scraping, multi-file processing, long scripts) in the foreground → the entire reply turn is locked up:

  • During a foreground long command, user messages can only queue;
  • On some platforms, when sub-agents are running, user interruptions are downgraded to "queued" and only read after the full turn ends;
  • So the user experiences "this assistant ignores me"—when it's actually just busy working.

Conclusion: To let people reach the assistant anytime, the assistant must not do heavy work itself, and when it is busy, retain an immediate interruption channel. These two things must be done together.


Three Things to Do Together (All Essential)

1. Write the Rules Block into the Agent's Instruction Layer (Pinned)

Full rules block in templates/agent-ops-rules.md (used by the script). Core six rules:

  • Four-level triage (assess level before acting): L0 Q&A → answer directly, no delegation|L1 single-step quick task (≤1 tool and ≤20 seconds) → do directly|L2 multi-step/long task/batch/network → always delegate|L3 requires user approval → first reply "This needs your decision on X".
  • After delegation, immediately reply and end the turn (no waiting; waiting = didn't delegate).
  • Commands exceeding 60 seconds go to background (foreground long commands lock the entire turn).
  • Sub-agents only return conclusions + artifact paths; integration analysis is done by the main agent.
  • User interruption as highest priority: acknowledge immediately, answer if possible, never leave the user waiting.
  • Tasks needing questions/approval stay with the main agent (sub-agents can't ask people).

The rules block is wrapped with <!-- agent-ops-rules:v1 --> … <!-- /agent-ops-rules -->. The provisioner uses these markers for idempotent operation: repeated runs only replace the marked block, leaving your other content untouched.

2. Retain an Immediate Interruption Channel (Platform-Dependent)

Different platforms have different semantics for "user interrupts busy AI", with vastly different results:

Interruption SemanticsActual ExperienceSatisfies "Always Responsive"?
Read only after full turn endsUser waits idly❌
Attached to "last tool result", delivered only after current batch of tools finishesWhen main agent runs foreground long command, stuck until command exits❌ (Fails for long-command scenarios)
Immediately interrupts current generation/request, injects user message as new input, and completed work is preservedInterruption almost instant✅

Criterion (one sentence): To enable "interrupt anytime", you must choose the semantics of "immediately interrupt + preserve completed work"; and combine it with the "long commands go to background" rule—both together make it work. (Hermes key names and test details in references/hermes-implementation.md; for other platforms, find equivalent semantics in your platform's settings.)

3. Sufficient Sub-Agent Concurrency (Otherwise "Delegate All" Gets Stuck by Slot Limits)

"Always delegate heavy tasks" requires being able to send out several simultaneously. If concurrency is too low, delegation becomes queuing—the user still waits.

  • Set concurrency ceiling to an acceptable level (common 3–6); consequences of exceeding ceiling vary by platform (some reject entire batch, some truncate), so batch delegation is safer than hitting the ceiling.
  • Concurrency directly affects cost: each sub-agent is billed independently; set as needed, don't blindly max out.

4. After Changes, Force Agent to Reload Instructions

Instruction files / system prompts are typically read once at process startup. Not restarting after writing = not effective:

  • Restart the corresponding Agent process / gateway / session (per your platform);
  • Verify after restart: ask the Agent to recite the rule—if it can, the instructions were actually loaded (not "I think it read them").

One-Click Provisioning / Audit

# ① Dry-run (default behavior, no files written): preview which files will be affected
python3 scripts/provision_agent_responsiveness.py

# ② Apply changes (auto-backup + idempotent; exports paste-ready block if platform not detected)
python3 scripts/provision_agent_responsiveness.py --apply

# ③ Force export paste-ready rules block (for Codex / Cursor / WorkBuddy / unknown platforms)
python3 scripts/provision_agent_responsiveness.py --apply --export --out ./agent-ops-rules.md

# ④ Audit: check if rules block exists / is pinned / matches current template
python3 scripts/audit_agent_responsiveness.py

Provisioner Behavior Conventions (hardcoded, verifiable):

ConventionDescription
Default dry-runNo --apply, never writes to disk
Auto-backupGenerates <filename>.bak-agent-ops-<timestamp> before writing
IdempotentIf markers exist, compare content: match → skip; mismatch → replace only marked block
No overwriting user contentInsert only at file top (skip YAML frontmatter), never delete your original text
No guessing pathsWrite only to two tested locations (Hermes SOUL.md, Claude Code ~/.claude/CLAUDE.md); for other platforms, export paste block
Pure standard libraryUses only argparse / pathlib / json etc., Windows / macOS / Linux compatible

Audit Script Behavior Conventions: Checks facts verifiable at the file level (exists / marked / pinned / content up-to-date); when no supported platform is detected, outputs "No supported platforms detected" truthfully and returns exit code 2—never falsely reports success.


Platform Adaptation Layer (Tool Name Mapping Table)

Abstract ActionHermes (Tested)Claude CodeCursor / Codex / WorkBuddyOther Similar Platforms
Rules block location<HERMES_HOME>/SOUL.md (and <HERMES_HOME>/profiles/<p>/SOUL.md)~/.claude/CLAUDE.mdPer your platform's global instructions / system prompt locationExport agent-ops-rules.md, then paste into system prompt
Delegate sub-agentdelegate_taskTask / sub-agent tool (map per your platform)Per your platform's sub-agent / task tool mappingPer your platform's sub-agent / task tool mapping
Long command to backgroundBackground execution + completion notificationBackground task / async mode of command toolPer your platform's background execution methodSystem background process + log to disk

Honest boundary: Hermes column keys and semantics from local tests; Claude Code ~/.claude/CLAUDE.md is a tested path. Cursor / Codex / WorkBuddy tool names may change per version; this skill does not fabricate commands or field names—please map per the table above. For a more complete cross-platform delegation discipline, see the same author's subagent-first skill.


Pitfalls (Cross-Platform)

  1. Instruction files are read only at process startup: Changing without restarting (or restarting the wrong instance) = no effect. Don't use "it's written in the file" as evidence of effectiveness.
  2. Wrong interruption semantics: Choosing semantics like "delivered after this batch of tools finishes", combined with "main agent runs foreground long commands", results in the user feeling ignored. Must choose "immediately interrupt + preserve completed work".
  3. Environment variables may override config files: Many platforms prioritize env over config. After changes, confirm actual active source, don't just look at config files.
  4. Fake restart: Only terminating the wrapper process / scheduled task instance, while the real child processes still run old config. Verify by checking process start time, not process count.
  5. Concurrency ceiling not verified: Assuming "all can be delegated", while exceeding ceiling causes whole batch rejection or truncation → delegate in batches, and verify the current effective ceiling value.
  6. Only installed in one place: Multi-instance / multi-profile instruction files and skill directories are independent; write to each separately (provisioner traverses Hermes profiles; for other platforms, install per instance).
  7. Don't disable the main agent's heavy tools to force delegation: On most platforms, sub-agents' toolset is a subset of the main agent (can't have tools the main agent lacks); disabling them cripples yourself.
  8. False success: Audit script checking only "does the file contain these words" can easily report success when content is outdated or overwritten by later changes. Verify content matches current template; if not detected, truthfully say "No supported platforms detected".

Acceptance Checklist (Answer "Is it really working?" with this)

A. File Level (Script-Auditable)

  • Rules block target file exists and agent-ops-rules:v1 marker is grep-able;
  • Rules block is pinned (in top 1/3 of file);
  • Rules block content matches current template (not an old residual);
  • Repeated runs of provisioner: produce no second copy, don't overwrite existing content;
  • audit_agent_responsiveness.py all green (exit code 0); exit code 2 + clear message when platform not detected.

B. Runtime (Manual Verification)

  • After restart, ask the Agent to recite this rule → if it can, instructions were actually loaded;
  • Give the Agent a heavy task → it immediately replies "Delegated (who is doing what)", not working silently for minutes;
  • User interrupts during heavy task → immediately receives acknowledgment, and reply is not broken;
  • After heavy task completes: output can be re-read and verified by main agent (not just "self-reported complete").

C. Boundaries

  • During user interruption, running sub-agents are not cascadingly canceled (or any canceled ones are explicitly accounted for);
  • Tasks needing user approval are not delegated to sub-agents.

License

MIT License. Free for personal and commercial use with author attribution.


🙋 About the Author

九品锦锂e | Encapsulates hard-won lessons into "ready-to-run" skills, not textbooks. This skill is the version I use daily.

WeChat: ly5419495 (Add with note "SkillHub" for priority approval) Public Account: 初五Agent (Search on WeChat; reviews and methods are written there, readable without adding me)

My other ready-to-run tools are on this shelf page (copy to browser): https://skillpay.alipay.com/public/jiupinjinlie

If you get stuck or have other scenarios you want me to package into a skill, reach me via any of the above.

WeChat QR Code of 九品锦锂e

This Skill is the complete version with no features removed.

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

lingyu9495-source/ai-image-watermark-removal-boss

去除 AI 生成图角落的"XXAI生成"半透明/白色角标水印。像素级验证不自我欺骗、双信号交叉定位抗幻觉、多候选客观指标投票覆盖。当用户要求去除图片水印、清理 AI 生成角标、去"豆包/即梦/Kolors 生成"水印时使用。

lingyu9495-source/bank-scan-household-splitter

客户丢来一个压缩包,里面几百张身份证正反面、开卡申请书、合同——**人工一张张挑,一下午就没了,还容易漏**。

lingyu9495-source/cn-pdf-report-typeset

中文报告做成 PDF,常见翻车三件套:**字体乱码、表格错位、字号小到客户在手机上根本看不清**。这套是交付级的排版标准加可直接跑的模板。

lingyu9495-source/company-law

公司出事,十有八九出在**治理和控制权**上——股权结构一开始搭歪,后面融资、上市、分家全是坑。

lingyu9495-source/excel-keep-format-edit

客户拿来一张老报表说「就在原表上改个数,格式一点都不要动」——用 openpyxl 重建一次,字体、边框、合并单元格、条件格式、列宽全丢,客户一打开就知道这不是他原来那张表。

lingyu9495-source/feasibility-report-engine

做可研报告,卡住的往往不是不会写,是**不知道按哪版大纲、财务测算六表和正文对不上、交付前排版被退稿**。这套是从二十多万字、131 张表的真实交付里固化的流水线。

lingyu9495-source/feasibility-study-consultant

项目可行性论证与研究报告写作框架 —— 任何「这事能不能做、怎么做、值不值得做」的商业决策场景:可行性研究/立项论证/新项目评估/创业方向验证。10大论证模块 + 强制联网尽调 + 多源交叉验证 + 读者视角写作 + 结构化报告输出。(v1.4 升级:从「引导客户把项目情况讲清楚」到「按问题类型与项目类型选论证方法」再到「用假设台账逐条验证」的六步教练流程;附可行性门槛评分器与假设台账两个零依赖脚本、项目卡与决策门清单模板)

lingyu9495-source/financial-statement-adjustment

存量财务报表在原表基础上改数字并保持三表勾稽关系。当用户要求「在原报表上改某些数字,其他数据跟着调整且格式完全不变」时使用:资产负债表/利润表/现金流量表的目标值调整、未分配利润与利润总额联动、勾稽校验。

lingyu9495-source/funding-fit-diagnosis

项目想融资,卡住的往往不是不会写 BP,而是不知道够不够格、该找谁、还缺什么、多久能到钱——问 AI 只得到"建议加强团队"这类正确的废话。这套引擎把它拆成可执行的四步:①10 问项目画像采集(缺关键项就先追问,不猜)②双轨评分:市场化 VC 适配分与政府基金适配分**分开算、各自判定**(≥75 强匹配 / 60-74 可争取 / 45-59 需补短板 / <45 暂不建议,低分不许只说"不行",要给替代路径)③点名机构:按赛道/阶段/地域从 23 家头部 VC 与产业资本(CVC)、21 家政府基金的卡片里逐条对照"匹配信号/劝退信号",每家写清"为什么是你、你还缺什么、材料怎么准备、递送路径",并单列"不建议碰"的机构省时间④差距清单(差距|补齐动作|耗时|难度|优先级,只挑 3 个月内能推动的)+ 三线找钱路线图(市场化 / 政府 / 替代路径)+ 时间预期与现金流提醒。包内另附 30 个真实融资案例对标、TS 条款红线、估值倍数参考、BP 制作铁律,以及零依赖离线评分脚本(纯标准库、不联网、不调大模型 API)。输入:项目情况(照着 10 问答即可);输出:一份研判报告(评分 + 优先接触名单 + 差距清单 + 路线图 + 风险提示),脚本侧可另出 JSON 评分结果。评分是适配度不是成功率,不承诺融资结果。触发词:融资、找投资、融资研判、能不能融到钱、找哪家风投、风险投资、VC、产业资本、CVC、政府引导基金、政府基金申报、产业基金、招商返投、项目申报、补贴申报、商业计划书、BP、路演、估值、股权稀释、TS 条款、对赌、回购、FA、财务顾问、找钱、融资渠道、天使轮、Pre-A、A轮。

lingyu9495-source/gov-fund-application

想拿政府的钱,最容易白跑半年——层级选错、赛道不在目录里、返投算不清,材料递上去才发现方向不对。这套参谋按可执行顺序走:①先判层级(国家级/省级/市级/区级,门槛与目的完全不同)②赛道对目录:不在目录里直接如实说没戏,不让用户白跑③21 家基金卡片逐家对照(投资方式、返投比例、让利规则、申报条件、申报通道、真实案例),点名"你这个项目适合找谁"④返投博弈:算清落地要求,给"不想迁注册地"的三条合规路径⑤材料与时间表:申报材料清单、评审周期(6-12 个月是常态)与现金流提醒。与主技能 `funding-fit-diagnosis` 配套(做整体融资研判时用主技能,VC 与政府双轨分开算)。输入:项目基本情况与注册地/落地意愿;输出:层级判定 + 可申报基金名单 + 返投方案 + 材料清单 + 时间预期。不承诺拿到资金,申报须如实提交材料;政策口径标注截止时间,细则请向当地主管部门核实。触发词:政府基金、政府引导基金、产业基金、政府补贴、专项资金、项目申报、补贴申报、申报条件、返投、招商落地、母基金、投资方式、让利、国家级基金、省级引导基金、市级基金、科技成果转化、专精特新、科技型企业、中小企业发展基金。

lingyu9495-source/hermes-profile-browser-isolation

多个 AI 助手同时干活时,浏览器会互相抢占:弹窗抢焦点、任务互相打断、你正在用的 Chrome/Edge 被顶掉——**你连自己的网页都点不动了**。

lingyu9495-source/investment-finance

做投融资最容易踩的坑不是"不懂概念",是**条款里的每一个字都在分钱**——估值方法选错、对赌触发条件写松、回购条款没兜底,签完才发现少拿几千万。

lingyu9495-source/lowvram-ai-video-comfyui

网上的 AI 视频教程开口就是 24G 显存,一看就把人劝退——**其实 8G 的 4060 也能跑**。这套是 RTX 4060 Laptop 8G 显存 / 32G 内存 / Win11 上真跑出来的配置与调参。

lingyu9495-source/novel-deai-detector

写完的稿子发布前想知道会不会被判 AI 生成、平台审核会不会卡、读者会不会一眼看出机器味——这套是检测到清洗的完整闭环。

lingyu9495-source/npl

不良资产这行的钱,赚在**买入价**上——买贵了,后面怎么处置都白搭。

lingyu9495-source/subagent-first

AI 助手不是不够聪明,是被重活占住了:你让它整理 40 个文件,它一头扎进去十几分钟不抬头——你想问进度、想补需求、想改方向,只能干等。这套作业纪律解决的就是这件事:凡是预计要跑多轮的活(多文件/长研究/批量/长搜索),一律派给后台子代理并行执行,主代理只保留四个动作——拆解、派活、汇总、对话,永远保留随时回你话的能力。我们自己在多智能体团队里天天跑,踩过的 12 个坑全部写进正文:子代理自报成功却发现产出是空的、context 没写全导致跑偏返工、两个子代理并行写同一文件互相覆盖、把需要用户拍板的活派给问不了人的子代理、跨会话长任务错用子代理导致某天悄悄停掉……① 决策树四问判定轻重(一轮工具调用能做完吗/需要用户拍板吗/要活过本次会话吗/能拆成互不依赖的块吗)② 派活四要素(goal / context 必须自包含——子代理看不到你和用户的对话 / output_schema / 验收方式)③ 五步流程:拆解→派活→并行调度→验收→收口 ④ 验收清单:存在性/合规性/真实性/完整性四组逐项打勾,并随机抽一处回一手来源核对 ⑤ 6 种委派模式 + 12 条反模式。配套 scripts/delegation_planner.py:纯标准库零依赖,喂一份任务清单(轮数/文件数/是否研究/是否批量/是否需拍板/是否不可逆/是否跨会话),直接输出「该派子代理 / 自己做 / 转定时任务」+ 并行分组建议 + 主代理必做清单。正文按平台无关的作业纪律写,并附常见平台工具名对照表;Hermes 的字段名/并发上限/后台语义另附一页实况对齐,其他平台按对照表映射即可。触发词:子代理、委派、delegate、任务编排、多智能体、并行执行、上下文管理、主代理被占住、AI不回话、等太久、插话卡住、批量处理、长研究、fork-join、fan-out。

lingyu9495-source/ts-term-review

拿到 TS 或投资协议,看半天不知道哪条能签哪条得改——风险全藏在具体条目里,一句"整体没大问题"最要命。这套审查按 15 条核心条款逐条过:估值 Pre/Post、清算优先权、反稀释(完全棘轮是红线)、优先购买权、领售/拖售、对赌与业绩承诺、回购条款、个人连带担保、董事会与一票否决、保护性条款、竞业与知识产权、信息权、交割条件、股东会表决权、违约责任。每条给三级判定(🔴 红线不改就别签 / 🟡 可谈争取改 / 🟢 行业惯例)+ 谈判话术 + 替代方案,并区分"对公司"和"对创始人个人"——个人连带回购是绝大多数血案的源头,重点标红。另附谈判筹码排序、常见坑清单、BP 与数据室准备。与主技能 `funding-fit-diagnosis` 配套(做整体融资研判时用主技能)。输入:TS/投资协议条款(粘贴或描述);输出:逐条判定表 + 必须改的清单 + 谈判话术 + 底线建议。**不构成法律意见**,正式签署与司法效力请找执业律师确认。触发词:TS、Term Sheet、投资条款清单、投资协议、增资协议、股权转让协议、对赌、业绩承诺、回购、清算优先权、反稀释、完全棘轮、个人连带、一票否决、领售权、拖售权、估值、Pre/Post、股权稀释、条款谈判、FA。

Related Skills