Batch Article 标志

Batch Article

社区
XuanRanL
batch-article

Run /article end-to-end for a list of keywords. Each keyword goes through the FULL pipeline (research → plan → build → optimize → publish → monitor baseline). Use for agency-scale operations — drop 10-500 keywords, get 10-500 published articles. Resumable across sessions.

概览

发布者XuanRanL
代码仓库loamwright-SEO-Skill
技能名称batch-article
星标数
52
复刻数
9
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 XuanRanL 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Batch Article AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/XuanRanL/loamwright-SEO-Skill/tree/main/subskills/cross-cutting/batch-article
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/XuanRanL/loamwright-SEO-Skill.git /tmp/loamwright-SEO-Skill
mkdir -p .claude/skills
cp -r /tmp/loamwright-SEO-Skill/subskills/cross-cutting/batch-article .claude/skills/batch-article
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Batch Article,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Batch Article。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Batch Article 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

/batch-article — Bulk full-pipeline content production

For agency-scale ops: give a list of keywords, get a list of published articles. Each goes through the COMPLETE /article pipeline — no shortcuts, no quality compromises.

When to invoke

  • /batch-article --project my-site --file keywords.txt
  • /batch-article --project my-site --keywords "kw1,kw2,kw3"
  • /batch-article --resume <batch_id> — pick up after interruption
  • /batch-article --status <batch_id> — check progress
  • /batch-article --list — all known batches

Input file formats (auto-detected)

Plain text (.txt) — one keyword per line, optional comma-separated fields:

best fishing rods 2026, listicle
how to choose fishing rod, how-to-guide, professional, 4500
graphite vs fiberglass rods, comparison

CSV (.csv) — header with keyword column required:

csv
keyword,format,voice,word_count
"best fishing rods 2026",listicle,professional,6000
"how to choose fishing rod",how-to-guide,casual,4500

JSON (.json) — array of objects:

json
[
  {"keyword": "best fishing rods 2026", "format": "listicle"},
  {"keyword": "how to choose fishing rod", "format": "how-to-guide", "word_count": 4500}
]

Workflow (Claude executes this)

Phase 1: Enqueue

bash
python -m scripts._core.batch_queue enqueue \
    --project {project_slug} \
    --file {keywords_file}

This creates workspace/batches/{batch_id}/index.json with all entries pending. Output shows: batch_id + entry count + total estimated cost.

Contract notes (v3.41.0):

  • Generated task_ids are underscore-form (art_YYYYmmddHHMMSS_NNN_hex) — they MUST satisfy schemas/state.schema.json :: task_id ^[a-z0-9_]{8,32}$, because assemble.py validates the full state against it mid-pipeline. The pre-v3.41.0 hyphenated ids passed the early stages then hard-failed at assembly (2026-07-17 project-lima batch). Pinned by tests/test_batch_queue_taskid_schema.py.
  • daily_cost_cap_usd in the index comes from ~/.xuanran-seo/config.yaml :: cost_limits.daily_total_usd — never a hardcode. A stale index with an empty cap is backfilled from config on load.
  • Task workspaces live under memory/workspace/{task_id}/ (the runner's WS_ROOT); the workspace/ root holds only batches/.
  • FORMAT IDS (v3.41.4): the per-row format column validates against schemas/angle.schema.json :: format_id enum — the single source of truth, mirrored 1:1 by templates/*.md basenames. An unknown format still soft-falls back to the default, but now WARNS on stderr; pre-v3.41.4 the check ran against a stale hand-maintained 10-item literal, so a REAL format like buyers-guide was silently rewritten to listicle and the whole article was planned in the wrong format with no error anywhere (2026-07-24 project-india batch). Pinned by tests/test_batch_queue_format_enum_seam.py. Watch the enqueue output's format column — it must echo the format you asked for.

STOP & CONFIRM: surface the estimate to user. Example:

"Created batch-20260519-143201-7c2f8 with 25 entries. Estimated total cost: $58.40. Proceed?"

Wait for user approval before iteration.

Phase 2: Iterate (one entry at a time, sequential)

For each pending entry (call batch_queue next --batch-id X until empty):

1. Get next entry:
   python -m scripts._core.batch_queue next --batch-id {batch_id} --json
   → returns {task_id, keyword, format, voice, ...}

2. Mark as running:
   python -m scripts._core.batch_queue mark --batch-id {batch_id} \
     --task-id {task_id} --status running

3. Create workspace + brief:
   - Create workspace/{task_id}/
   - Write brief.json with {keyword, format, voice, project_slug, ...}
   - Write initial state.json with stage=brief-intake
   - BRIEF ENUM DISCIPLINE (v3.41.3): `intent_override` accepts ONLY
     informational|commercial|transactional|navigational|null — the analyst
     label "commercial-investigation" is NOT a valid enum and now fails the
     fresh-task schema gate at the first runner advance (before any spend).
   - CTA PRODUCT ANGLE (2026-08-08): if the content-plan row names a CTA
     product angle (e.g. "Ear wash", "Gut probiotic"), set
     `brief.cta_category_hint` to that category's slug or name. The
     cta-brief-builder prefers the hint over content matching (which
     structurally cannot select one-token or long category names) while still
     enforcing `excluded_categories` + in-stock validation. Without the hint,
     short-named categories silently degrade to `default_category` and the
     operator's intended product angle is lost.
   - KEYWORD DIALECT (Rule 1): a keyword with opposite-dialect spelling
     ("optimisation" on an en-US project) stays VERBATIM in title/slug/meta;
     set `target_market_locale` to the keyword's dialect only if the audience
     really is that market — `spelling_dialect_check` auto-exempts the exact
     keyword's inflections either way (v3.41.3).
   - IMAGE COUNT (v3.42.17): OMIT `image_count` from the brief unless overriding —
     the enforced default is `scripts/_core/image_policy.py :: DEFAULT_IMAGE_COUNT`
     (6 = 1 cover + 5 section images; max 8), pinned to the schema annotation by
     `tests/test_image_count_policy.py`. Short formats (news-analysis,
     faq-knowledge, shortlist-validation) SHOULD set a lower explicit count —
     the cost estimator's per-format rows assume they do; generation itself
     always follows the brief, not the format.
   - QUALITY TARGET (v3.42.16): OMIT `quality_target_score` from the brief
     unless the operator explicitly requested a stricter bar. The enforced
     default is `scripts/_core/review_target.py :: DEFAULT_REVIEW_TARGET` (80);
     the schema annotation is pinned to that constant by
     `tests/test_review_target_single_source.py`. Do NOT copy a number out of
     the schema into the brief "to be safe" — a bootstrapped 95 (the schema's
     old, enforced-by-nothing annotation) burned six reviewer/repair rounds on
     2026-08-17 against content every review round called clean. Review scores
     are LLM judgments with ±4-point run-to-run variance; a target above ~90
     turns that variance into an unpassable gate. If a mis-set target is
     discovered mid-run, the sanctioned correction is
     `file_bus.update_state(task_id, brief=...)` plus a note in the batch-queue
     entry — never a silent edit, and NEVER an edit to review.json's score.

4. Invoke L1 seo-blog SKILL.md with this task_id:
   - This runs the FULL pipeline (research → plan → build → optimize → publish → monitor baseline)
   - L1 reads workspace/{task_id}/brief.json
   - L1 writes all artifacts back to workspace/{task_id}/
   - L1 ends with publish-complete + baseline

5. After L1 returns:
   - Read workspace/{task_id}/publish-log.json for post_url
   - Sum cost from filtered cost-ledger by task_id
   - Mark entry:
     python -m scripts._core.batch_queue mark --batch-id {batch_id} \
       --task-id {task_id} --status completed \
       --workspace-path workspace/{task_id} \
       --published-url <url> \
       --actual-cost-usd <cost>

6. If L1 fails (error.json present):
   - Mark entry as failed with error message
   - Continue to next entry (do NOT abort the batch)

Phase 3: Summary

After the queue is exhausted:

bash
python -m scripts._core.batch_queue status --batch-id {batch_id}

Report to user:

  • N completed / M failed / K skipped
  • Total actual cost vs estimate
  • Failed entries list (with reasons)
  • Suggest: /refresh-queue for failed entries OR manual review

Safety guards

Daily cost cap

Before each iteration, check daily total via cost-ledger summary:

bash
python -m scripts._core.cost_ledger --summary --period day --json

If total_usd > daily_total_usd × 0.95:

  • Pause batch (mark remaining entries still pending)
  • Tell user: "Daily cap approached; pausing batch. Resume tomorrow with /batch-article --resume {batch_id}."

Per-article cost cap

Before each L1 invocation, pre-flight:

bash
python -m scripts._core.cost_estimator --format {fmt} --words {wc} --json

If check == "blocked":

  • Mark entry skipped with reason
  • Continue to next

Rate limit / API failure

If 3 consecutive entries fail with API errors (rate limit, network):

  • Pause batch (wait 5 min)
  • Re-probe with /status check
  • Resume if cleared

Parallelism

Default sequential (parallelism: 1). For agency use with --parallelism 3:

  • Spawn 3 parallel L1 invocations
  • Each writes to its own workspace/{task_id}/
  • Image Batch API contention: keep ≤3 (OpenAI Batch concurrent limit)
  • Cost guard remains active across all running tasks

Resume protocol

/batch-article --resume {batch_id}

Does:

  1. Read workspace/batches/{batch_id}/index.json
  2. Find entries with status=pending OR status=running (interrupted mid-pipeline)
  3. For status=running entries: invoke /resume {task_id} instead of fresh L1
  4. For status=pending: standard new L1 invocation
  5. Continue until queue exhausted

One operator per task (2026-08-17)

The runner's .pipeline-driver.lock serializes run_pipeline INVOCATIONS, but no lock can stop two OPERATORS — a resumed/background driver and the parent session — from editing the same workspace's artifacts concurrently. On 2026-08-17 a parent session hand-repaired a draft and dispatched its own reviewer while the background driver it had earlier resumed was still running its own repair rounds on the same task; the two interleaved without corruption only by luck, and the task ended up marked failed in the batch queue while its artifacts said otherwise. The rule:

  • A task has exactly ONE operator at a time. Before taking over a task you delegated, either (a) confirm the driver has terminated (its final report arrived and it holds no live children), or (b) explicitly order it to stand down and wait for the acknowledgment.
  • Never repair artifacts of a task whose driver may still be live. To see where a possibly-live task really is, read state.json :: stage_history — never invoke the runner as a "status check" (that is the v3.36.2 double-publish pattern this file already bans).
  • A batch-queue status set by a driver that was later overridden (e.g. failed on a task that then completed) must be corrected with a note explaining the override — the queue is the operator-facing record; a stale error field on a completed entry reads as an unresolved defect in the next audit.

Cost transparency

Before starting:

  • Show estimate per format breakdown
  • Show daily budget remaining
  • Show per-client cost attribution (if project has client metadata)

During iteration:

  • After every 5 completed entries, print a mini-status:

    "[12/25] last 5 cost $11.20; on track for $58 total"

After completion:

  • Final summary with actual vs estimated
  • Cost overrun analysis if >20% delta

What this skill does NOT do

  • ❌ Skip pipeline steps for speed (each article gets FULL treatment)
  • ❌ Share research between entries (each is independent — different keywords)
  • ❌ Auto-publish without per-article gate-checks (each L1 still hits all 4 quality gates)
  • ❌ Continue past daily cap (safety)

Composition

Daily agency workflow with /batch-article:

morning:  /batch-article --project client-a --file daily-keywords.txt
          (review estimate, approve)
          → batch runs, Claude iterates through

mid-day:  /status                          (check pipeline)
          /cost                            (track burn)

evening:  /batch-article --status {batch_id}
          (review failures, decide on /refresh-queue or manual)

next-day: /batch-article --resume {batch_id}
          (if paused by daily cap)

Recommended sizing per session

ArticlesSession lengthDaily budget needed
1-5~30 min~$10
10-25~2-5 hr~$30-60
25-50use --resume across days~$60-120
50+multiple batches, multiple daysscale daily cap

For 100+ articles, split into 4× 25-article batches across 4 days.

常见问题

Batch Article AI 技能有什么作用?

Run /article end-to-end for a list of keywords. Each keyword goes through the FULL pipeline (research → plan → build → optimize → publish → monitor baseline). Use for agency-scale operations — drop 10-500 keywords, get 10-500 published articles. Resumable across sessions.

为什么在 TypingMind 中使用 Batch Article?

因为您只需安装一次,就能搭配任何模型使用。Batch Article 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Batch Article?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/XuanRanL/loamwright-SEO-Skill/tree/main/subskills/cross-cutting/batch-article。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Batch Article?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Batch Article 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Batch Article 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Batch Article AI 技能免费吗?

是的。XuanRanL 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇