mtk-agent-toolkit: Skill for Claude Code

.claude/skills/workflow-artifacts/SKILL.md

workflow-artifacts is a skill for Claude Code from moberghr/mtk-agent-toolkit. It costs 36 tokens per session (2,810 once invoked), scanned A, original, MIT.

A way to save workflow progress and decisions as files under .mtk/workflows/. The saved records include an event log so work can continue after a restart, crash, or lost chat context.

In plain words
What is it for?
Use it during planning, building, debugging, reviewing, and fixing work, especially when a workflow has multiple phases or must be resumed later.
Why use it?
Important workflow state can disappear from a conversation, making it difficult to resume safely or know which steps were completed.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md; mentions subagents; names the AskUserQuestion tool.

This is moberghr/mtk-agent-toolkit's own configuration. It tells Claude Code how to work on mtk-agent-toolkit itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mtk-agent-toolkit configures →

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the mtk plugin — 33 skills, 7 agents, 6 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to moberghr/mtk-agent-toolkit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/moberghr/mtk-agent-toolkit/main/.claude/skills/workflow-artifacts/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/moberghr/mtk-agent-toolkit

Made for: Claude Code.

Or install mtk, the plugin that ships this one along with the rest of its 33 skills, 7 agents, 6 hooks.

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 workflow-artifacts

README.md
[![agentmods](https://agentmods.dev/badge/skills/moberghr/mtk-agent-toolkit/workflow-artifacts/github.svg)](https://agentmods.dev/skills/moberghr/mtk-agent-toolkit/workflow-artifacts)
Your own site
<a href="https://agentmods.dev/skills/moberghr/mtk-agent-toolkit/workflow-artifacts"><img src="https://agentmods.dev/badge/skills/moberghr/mtk-agent-toolkit/workflow-artifacts/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 workflow-artifacts

Your own site · 80×15
<a href="https://agentmods.dev/skills/moberghr/mtk-agent-toolkit/workflow-artifacts"><img src="https://agentmods.dev/badge/skills/moberghr/mtk-agent-toolkit/workflow-artifacts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,810 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.00036 $0.02810
Opus 5.5 $0.00014 $0.01124
Sonnet 5.5 $0.00007 $0.00562
Haiku 4.5 $0.00004 $0.00281

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

Security

Grade A, and why

workflow-artifacts 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 8d 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.

.claude/skills/workflow-artifacts/SKILL.md · 129 lines

How it starts

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

Workflow Artifacts

Overview

Orchestration state that lives only in chat is lost on compaction or restart. This skill stores it on disk under .mtk/workflows/{uuid}.json plus an append-only event log, using a small bash helper. implement (a BUILD workflow) and setup-audit / setup-bootstrap create workflows; the skills implement composes (incremental- and subagent-implementation, verification, review) write to the active one at phase boundaries and gate decisions. fix and batch-fix do not create a workflow. The helper also accepts DEBUG, REVIEW, PLAN and FIX types, but no shipped skill initialises them today.

When To Use

  • At the start of every /mtk implement (BUILD) run, and of setup-audit / setup-bootstrap.
  • At every phase transition inside /mtk implement.
  • Whenever a named orchestration gate is evaluated (see .claude/references/orchestration-gates.md).
  • When resuming after compaction, restart, or handoff — list active workflows before starting fresh work.

When NOT To Use

  • Throwaway exploration where no commit will happen.
  • Single-turn read-only questions ("what does file X do?").
  • Inside subagents — only the orchestrator (main implement loop) writes artifacts. Subagents return structured output; the orchestrator decides what to persist.

Workflow

  1. Resolve helper path once into $WFA. The script ships at scripts/workflow-artifact.sh in this repo and at the same path in target installs, but a plugin install has it only under the plugin root — written ${CLAUDE_PLUGIN_ROOT} (braces), which Claude Code substitutes into this text at load time; it is never set in the Bash environment. Resolve it once with the same three-tier idiom spec-driven-development uses for learnings.sh — MTK_HELPER_ROOT first (a checkout you pin; see CLAUDE.md), then the project copy, then the plugin copy — and call "$WFA" everywhere below instead of a bare path:
    WFA="$([ -n "${MTK_HELPER_ROOT:-}" ] && echo "$MTK_HELPER_ROOT/scripts/workflow-artifact.sh" || ([ -f scripts/workflow-artifact.sh ] && echo scripts/workflow-artifact.sh || echo "${CLAUDE_PLUGIN_ROOT}/scripts/workflow-artifact.sh"))"
    
    Set MTK_HELPER_ROOT=<toolkit checkout> to force the scripts from that clone — the reliable path when dogfooding MTK from a separate checkout, or to pin one version out of a multi-version plugin cache. State is project-anchored: the script writes .mtk/workflows/ under $CLAUDE_PROJECT_DIR (falling back to the git top-level, then cwd), so when MTK skills live outside the target project (plugin/marketplace install), export CLAUDE_PROJECT_DIR=<project root> or run from the project root — otherwise state lands in the wrong tree.
  2. Init at workflow start. Prune expired workflows, capture the returned uuid into a session variable MTK_WF_UUID, and emit the first phase marker, all in the same call:
    "$WFA" prune --older-than 30 >/dev/null; MTK_WF_UUID=$("$WFA" init BUILD --goal "<one-line user goal>") && "$WFA" event "$MTK_WF_UUID" phase_started --data '{"phase":"phase-0"}'
    
    prune deletes finished workflows (completed / abandoned) and any workflow not updated for 30 days, with their event logs; it never touches an active workflow updated within the window. Preview with --dry-run. Run it before init, never after, so it cannot touch the workflow being started. A prune failure must not block the init, hence ;. Bookkeeping rides along, never alone. Every artifact write below goes in the same Bash call as the action it records — appended with && to the checkpoint command, the lint, the sidecar write — or several writes go in one "$WFA" batch call. A standalone "$WFA" set … turn costs a full model round-trip for one line of JSON; a 65-call run spends a quarter of its turns on bookkeeping. The batch form takes ordinary subcommand argv without the uuid, separated by a bare --:
    dotnet build --nologo -v q && "$WFA" batch "$MTK_WF_UUID" \
      gate phase_exit_gate pass --reason "batch B2 green" -- \
      set results.batches_completed=2 -- \
      event agent_returned --data '{"agent":"batch:B2"}'
    
    event … --ts <iso8601> replays a timestamp captured elsewhere (a dynamic workflow's per-batch dispatch/return times); tag such events "source":"workflow-replay" in --data.
  3. Persist anchors as soon as they exist. When the spec, plan, and todo files are written, record their paths — in the same call as the next command that runs anyway (the context-pack build, the manifest pre-flight, the EARS lint in extended mode):
    bash scripts/build-context-pack.sh "$MTK_WF_UUID" docs/specs/2026-05-07-foo.json && "$WFA" set "$MTK_WF_UUID" \
      results.spec_path=docs/specs/2026-05-07-foo.md \
      results.plan_path=docs/plans/2026-05-07-foo.md \
      results.todo_path=tasks/todo.md
    
  4. Emit phase events. At the start and end of every phase, in one call with the gate that closes it:
    "$WFA" batch "$MTK_WF_UUID" \
      gate phase_exit_gate pass --reason "all batch tests green" -- \
      event phase_completed --data '{"phase":"phase-3"}' -- \
      event phase_started   --data '{"phase":"phase-3.5"}'
    
    A phase_started event carrying a phase auto-advances the artifact's phase_cursor to that phase — no separate set phase_cursor= call is needed, and the resume protocol (step 7) can trust phase_cursor rather than replaying the event log.
  5. Record gate decisions. Every named gate (plan_trust_gate, phase_exit_gate, failure_stop_gate, memory_sync_gate) must be persisted via:
    "$WFA" gate "$MTK_WF_UUID" phase_exit_gate pass --reason "all batch tests green"
    
    fail on any gate is a hard stop — see failure_stop_gate semantics.
  6. Carry a trap list across phases. A trap is a written, specific gotcha a phase learned the hard way (a stale generated contract, an analyzer that fires only under format, a fixture that silently seeds the wrong state). A 2026-09 six-phase field run found this hand-carried list was the one mechanism that demonstrably worked — the final phase had zero repair cycles — and that it survived only because the driver remembered to paste it. Persist each trap the moment it is learned, riding along in the call that runs anyway (trap is batchable):
    "$WFA" batch "$MTK_WF_UUID" trap add --title "OpenAPI spec goes stale between phases" \
      --body "Regenerate the contract from a running API each phase — build/tests miss uncallable routes." \
      --phase phase-1 --severity high -- event phase_completed --data '{"phase":"phase-1"}'
    
    At the start of every phase, and in every implementer brief the orchestrator builds, inject the accumulated list:
    "$WFA" trap list "$MTK_WF_UUID"   # paste into the brief's "Known traps" block
    
    Adding a trap whose title already exists refreshes it in place. Traps are orchestrator-owned like every other artifact write: an implementer reports candidate traps in its result (traps[], see .claude/references/subagent-implementer-prompt.md) and the orchestrator records them (S5.2).
  7. Resume protocol. On entry to a workflow with no explicit uuid:
    • Run "$WFA" list.
    • If a single active workflow matches the requested type, offer resume.
    • If multiple, ask via AskUserQuestion which uuid to resume.
    • If none, init a new one (init TASK for a lightweight one with no other workflow).
    • To continue a checkpointed workflow, "$WFA" resume <uuid> prints a read-only RESUME block (drift since the checkpoint, next_command, open questions).
    • "$WFA" checkpoint <uuid> --next … --decision … --verify … re-renders the one canonical note and snapshots the tree; it is batchable as the LAST op (exit 3 = --next names a finished unit). Schema: .claude/references/workflow-artifact-schema.md.
  8. Close the workflow. At end of phase 7, one call:
    "$WFA" batch "$MTK_WF_UUID" gate memory_sync_gate pass --reason "lessons captured" -- \
      set status=completed -- event workflow_completed --data '{"summary":"<short>"}'
    
    On unrecoverable failure, close with the failure pair instead:
    "$WFA" batch "$MTK_WF_UUID" set status=failed -- event workflow_failed --data '{"reason":"<short>"}'
    

Read the full file on GitHub · 129 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. 8d ago Changed · +2 lines 46cba3a9eaf8
  2. 16d ago Changed · -16 lines 4363dde104db
  3. 1mo ago Changed · +13 lines 072e67905c91
  4. 1mo ago Changed · +10 lines 2e80a833b1f6
  5. 2mo ago First seen · 120 lines · 36 tokens per session scan A 23d9ebe8f7c8

Subscribe to this mod's changes

workflow-artifacts is a skill published in the GitHub repository moberghr/mtk-agent-toolkit (9 stars, last pushed 8d ago), licensed MIT. It adds 36 tokens to every session and 2,810 once invoked, about $0.0001 per session on Opus 5.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-31.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens