M3E: Skill for Claude Code

.claude/skills/setrole/SKILL.md

setrole is a skill for Claude Code from akaghef/M3E. It costs 198 tokens per session (1,762 once invoked), scanned A, original, MIT.

A role-initialisation tool for agents working in separate Git workspaces. It confirms the agent’s role, branch, file scope, and assigned task before work begins.

In plain words
What is it for?
Use it when starting an agent in a worktree, assigning a role, or checking what that agent should work on.
Why use it?
It prevents an agent from editing the wrong area or working on an unknown branch. It also makes the expected responsibilities explicit.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

This is akaghef/M3E's own configuration. It tells Claude Code how to work on M3E 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 M3E configures →

View source ↗ akaghef/M3E
Reuse

Borrowing it

Nothing to install: this file belongs to akaghef/M3E. 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/akaghef/M3E/main/.claude/skills/setrole/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/akaghef/M3E

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 setrole

README.md
[![agentmods](https://agentmods.dev/badge/skills/akaghef/m3e/setrole/github.svg)](https://agentmods.dev/skills/akaghef/m3e/setrole)
Your own site
<a href="https://agentmods.dev/skills/akaghef/m3e/setrole"><img src="https://agentmods.dev/badge/skills/akaghef/m3e/setrole/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 setrole

Your own site · 80×15
<a href="https://agentmods.dev/skills/akaghef/m3e/setrole"><img src="https://agentmods.dev/badge/skills/akaghef/m3e/setrole.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 198 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,762 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00198 $0.01762
Opus 5.5 $0.00079 $0.00705
Sonnet 5.5 $0.00040 $0.00352
Haiku 4.5 $0.00020 $0.00176

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

Security

Grade A, and why

setrole scanned grade A with 1 finding 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 5d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sf http://localhost:4173/api/maps
.claude/skills/setrole/SKILL.md · 175 lines

How it starts

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

setrole — Agent Role Initialization

ワークツリーで起動したエージェントが自分の役割を確定し、割り当てタスクを拾うためのスキル。

Usage

/setrole {role}

role を省略した場合は、現在のブランチ名から自動判定する。

ロール定義

ロール ブランチ 担当領域 ファイルスコープ
visual dev-visual UI・描画・CSS・SVG・UX beta/src/browser/, beta/viewer.css, beta/viewer.html
data dev-data model・controller・API・永続化 beta/src/node/, beta/src/shared/
data2 dev-data2 data の並列ワーカー beta/src/node/, beta/src/shared/
team dev-team Collaboration・Cloud Sync beta/src/node/collab.ts, beta/src/node/cloud_sync.ts, beta/src/node/start_viewer.ts (collab部分)
manage dev-beta CI・運用・文書・統合 docs/, .claude/, scripts/, AGENTS.md

実行フロー

Step 1: ロール確定

引数があればそのロールを採用。なければブランチ名からマッピング:

dev-visual            → visual
dev-data              → data
dev-data2             → data2
dev-team              → team
dev-beta              → manage
worktree-agent-*      → (ブランチ名では判定不可。引数必須)

Worktree 環境での注意: isolation: worktree で起動されたエージェントは worktree-agent-* ブランチにいる場合がある。この場合はロール引数が必須。 引数なし + 不明ブランチ → エラー停止。

マッピングできなければエラーで停止する(不明なブランチでは作業しない)。

Step 2: ブランチ検証

git branch --show-current

現在のブランチがロールの期待ブランチと一致することを確認する。

Worktree 環境: worktree-agent-* ブランチにいる場合は、ロールの期待ブランチに チェックアウトし、origin/dev-beta で rebase する:

git fetch origin
git checkout dev-visual 2>/dev/null || git checkout -b dev-visual origin/dev-beta
git rebase origin/dev-beta

通常環境: 一致しない場合はチェックアウトを提案する:

⚠ 現在 dev-beta にいますが、ロール visual のブランチは dev-visual です。
切り替えますか?

Step 3: タスク収集

以下の2箇所からタスクを収集する:

3a. マップの strategy ボードを読む

M3E サーバーが起動中なら:

curl -sf http://localhost:4173/api/maps

Final 確認時だけポートを 38482 に切り替える。

M:(開発)> SYSTEM > DEV >> strategy 配下のノードを走査し、attributes.agent が自分のロール名を含むノードを抽出する。 attributes.status が ready または doing のものを優先表示。

サーバー未起動なら: スキップして Step 3b のみ。

3b. ハンドオフファイルをスキャン
ls docs/tasks/handoff_*.md

Read the full file on GitHub · 175 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. 5d ago First seen · 175 lines · 198 tokens per session scan A 5b3819c0b982

Subscribe to this mod's changes

setrole is a skill published in the GitHub repository akaghef/M3E (11 stars, last pushed 5d ago), licensed MIT. It adds 198 tokens to every session and 1,762 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.