new-saga-step

new-saga-step is a skill for Claude Code from zuoyebang/aiweave. It costs 66 tokens per session (1,815 once invoked), scanned A, original, Apache-2.0.

A code generator for one step in a Saga, a way to coordinate a multi-step transaction that can undo earlier work if a later step fails. It creates the main action, its compensation action, and checks that repeating the step is safe.

In plain words
What is it for?
Use it to generate a Go service method for a specified Saga step from the project's transaction and service design documents.
Why use it?
It reduces the risk of partially completed transactions and duplicate effects. It also refuses to generate code when the required transaction and idempotency documentation is missing.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go build ./service/{module}/....

Good fit Use it to generate a Go service method for a specified Saga step from the project's transaction and service design documents.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/zuoyebang/aiweave
agentmods
npx agentmods add skills/zuoyebang/aiweave/new-saga-step

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for new-saga-step

README.md
[![agentmods](https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-saga-step/github.svg)](https://agentmods.dev/skills/zuoyebang/aiweave/new-saga-step)
Your own site
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-saga-step"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-saga-step/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for new-saga-step

Your own site · 80×15
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-saga-step"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-saga-step.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,815 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00066 $0.01815
Opus 5 $0.00033 $0.00907
Sonnet 5 $0.00013 $0.00363
Haiku 4.5 $0.00007 $0.00181

Measured 10d ago against content hash e00263148720, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

new-saga-step scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/skills/new-saga-step/SKILL.md · 141 lines

How it starts

The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.

生成 Saga 步骤代码。参数:$ARGUMENTS,格式 {module}/{Method}/step-{N}

公共步骤模板见 skills-spec/01_skill_authoring_guide.md §A-§E。

第 0 步:🚫 模块 + 启用状态检查

  1. BUILD_STATUS.md §0 —— 命中 🚫 模块立即拒绝
  2. INDEX.md §0 AIWeave 采纳进度 —— 如 docs-spec/21_distributed_transaction 未启用 → 拒绝,提示"本工程未启用 21,请先启用"

第 1 步:读设计文档

按顺序读:

  1. docs/service/transaction_design.md —— §2 事务边界清单 + §3 补偿逻辑设计 + §4 幂等性设计 + §6 失败路径全景图
  2. docs/service/{module}_service.md —— §4.N 单个方法的完整规格 + §4.N.3 处理步骤伪码 + §4.N.8 事务与一致性
  3. docs/architecture/concurrency_safety.md §2 —— 涉及的共享状态(如 Redis Key 锁)
  4. docs/architecture/ai_dev_guide.md §8.2 —— 事务与一致性约束总清单

第 2 步:校验前置

  • 目标方法必须在 transaction_design.md §2 标 "Saga N 步";如未登记 → 拒绝,要求先补 §2
  • 目标 step-N 必须在 §3 补偿逻辑设计表中有"正向 + 补偿"对照行;如缺 → 拒绝,要求先补 §3
  • 幂等 Key 必须在 §4 已定义;如缺 → 拒绝,要求先补 §4

第 3 步:生成代码

按 service 方法伪码生成 step-N 代码。必须包含以下结构:

// {Module}{Method}Step{N} 是 Saga 第 N 步的正向操作
func (s *{Module}Service) {Method}Step{N}(ctx context.Context, req *{Method}Step{N}Req) error {
    // [IDEMPOTENT-CHECK: key={ns}:idemp:{action}:{key-field}]
    if exists, err := s.checkIdempotent(ctx, req); err != nil {
        return err
    } else if exists {
        return nil // 幂等,跳过
    }

    // [INVARIANT-CHECK: I-N]  // 如本步关联领域不变量
    if violates := s.checkInvariant(req); violates != nil {
        return violates
    }

    // [SAGA-STEP-N] 正向操作
    if err := s.do{Step-N-Action}(ctx, req); err != nil {
        return err
    }

    // [METRIC-EMIT: {action}_step_{N}_total{result="ok"}]
    return nil
}

// {Module}{Method}Compensate{N} 是 Saga 第 N 步的补偿操作
// 必须可重复执行而不产生副作用(详见 transaction_design.md §3.2)
func (s *{Module}Service) {Method}Compensate{N}(ctx context.Context, req *{Method}Step{N}Req) error {
    // 补偿幂等去重
    lockKey := "{ns}:compensation_lock:{key-field}"
    if locked, err := s.acquireLock(ctx, lockKey); err != nil || !locked {
        return err
    }
    defer s.releaseLock(ctx, lockKey)

    // [COMPENSATE-N] 补偿操作
    return s.undo{Step-N-Action}(ctx, req)
}

Read the full file on GitHub · 141 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 141 lines · 66 tokens per session scan A e00263148720

Subscribe to this mod's changes

new-saga-step is a skill published in the GitHub repository zuoyebang/aiweave (20 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 66 tokens to every session and 1,815 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

build-teaql-app

Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…

teaql/teaql-agent-kit · 112 tokens

add-rpc

Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality.

mits-pl/wove · 36 tokens

wps-events

Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components.

mits-pl/wove · 41 tokens

electron-api

Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC.

mits-pl/wove · 27 tokens

compact-error-handling

How to eliminate verbose, repetitive try-catch blocks in generated code by using multi-exception tuples, contextlib.suppress, and functional Result types, cutting error boilerplate by 60%.

alivirgo/Major-AI-Skills · 43 tokens

api-runtime-verify

Verify an implemented backend HTTP surface at runtime: per route, record the request actually made, the HTTP status, the response content-type, and the observed body shape, assert each response against the slice's acceptance behavior, classify the findings, and decide a PASS/FAIL/BLOCKED runtime gate. The probe's real…

Mozurok/fhorja.dev · 216 tokens