phase: Skill for Claude Code

.claude/skills/add-ai-feature-policy/SKILL.md

add-ai-feature-policy is a skill for Claude Code from phase-rs/phase. It costs 81 tokens per session (9,514 once invoked), scanned A, original, Apache-2.0.

A development checklist for adding a new deck-aware AI feature to phase-ai, a card-game decision system. It explains how to connect feature detection, planning, tactical policies, and optional mulligan decisions.

In plain words
What is it for?
Use it when adding a new deck feature, connecting it to the feature registry and AI session, writing its policies, and checking Magic rules references.
Why use it?
It reduces the chance that a new feature is added in only one layer or uses incorrect game-rule references. It directs developers to trace existing features and verify rule numbers in the project's source document.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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

Reuse

Borrowing it

Nothing to install: this file belongs to phase-rs/phase. 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/phase-rs/phase/main/.claude/skills/add-ai-feature-policy/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/phase-rs/phase

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 add-ai-feature-policy

README.md
[![agentmods](https://agentmods.dev/badge/skills/phase-rs/phase/add-ai-feature-policy/github.svg)](https://agentmods.dev/skills/phase-rs/phase/add-ai-feature-policy)
Your own site
<a href="https://agentmods.dev/skills/phase-rs/phase/add-ai-feature-policy"><img src="https://agentmods.dev/badge/skills/phase-rs/phase/add-ai-feature-policy/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 add-ai-feature-policy

Your own site · 80×15
<a href="https://agentmods.dev/skills/phase-rs/phase/add-ai-feature-policy"><img src="https://agentmods.dev/badge/skills/phase-rs/phase/add-ai-feature-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,514 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00081 $0.09514
Opus 5 $0.00041 $0.04757
Sonnet 5 $0.00016 $0.01903
Haiku 4.5 $0.00008 $0.00951

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

Security

Grade A, and why

add-ai-feature-policy 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 9d 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/add-ai-feature-policy/SKILL.md · 388 lines

How it starts

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

Adding a Deck-Aware AI Feature + Policy

This is the authoritative checklist for adding a new feature to the three-layer AI architecture (Features → Plan → Policies). Nine features exist as reference: landfall, mana_ramp, tribal, control, aristocrats, aggro_pressure, tokens_wide, plus_one_counters, spellslinger_prowess. Each follows the same pattern; mirror it.

Before you start: Read landfall.rs (simplest), then aristocrats.rs (geometric-mean commitment with identity lookup), then one feature similar in shape to yours. Trace from features/<name>.rs::detect() through DeckFeatures::analyze and AiSession::from_game through policies/<name>.rs::verdict so the data flow is concrete.

CR Verification Rule. Every CR number in annotations MUST be verified by grepping docs/MagicCompRules.txt BEFORE you write it. Do NOT rely on memory or prior prompts. The 701.x and 702.x sections are arbitrary sequential assignments that hallucinate consistently. Run grep -n "^701.34" docs/MagicCompRules.txt for every number. CR 122.1d is Stun (NOT +1/+1 — that's CR 122.1a). CR 701.27 is Transform (NOT Proliferate — that's CR 701.34). Two real catches from the existing batch — you will have similar misses unless you grep.


1. Architecture (memorize this)

AiSession (per-game cache; built once in AiSession::from_game)
  ├─ features: HashMap<PlayerId, DeckFeatures>    ← Layer 1: structural detection
  ├─ plan:     HashMap<PlayerId, PlanSnapshot>    ← Layer 2: bottoming + curve schedule
  ├─ deck_profile / strategy: per-player strategic profiles
  ├─ synergy:  HashMap<PlayerId, SynergyGraph>
  └─ memory:   PolicyMemory

DeckFeatures
  ├─ landfall:       LandfallFeature
  ├─ mana_ramp:      ManaRampFeature
  ├─ tribal:         TribalFeature
  ├─ control:        ControlFeature
  ├─ aristocrats:    AristocratsFeature
  ├─ aggro_pressure: AggroPressureFeature
  ├─ tokens_wide:    TokensWideFeature
  ├─ plus_one_counters: PlusOneCountersFeature
  ├─ spellslinger_prowess: SpellslingerProwessFeature
  └─ <your new feature>

Policies (Layer 3)
  ├─ TacticalPolicy — in-game decisions (CastSpell, ActivateAbility, DeclareAttackers, ...)
  └─ MulliganPolicy — pre-game hand evaluation (sibling trait)

Both run inside their respective registries (`PolicyRegistry::default`,
`MulliganRegistry::default`). Activation is the single multiplicative knob.

Read the full file on GitHub · 388 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. 9d ago First seen · 388 lines · 81 tokens per session scan A daa0278e52bf

Subscribe to this mod's changes

add-ai-feature-policy is a skill published in the GitHub repository phase-rs/phase (269 stars, last pushed today), licensed Apache-2.0. It adds 81 tokens to every session and 9,514 once invoked, about $0.0004 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

critic-contract

Shared read-side contract every read-only CRITIC imports — adversarial stance, empirical verification of runtime-behavior claims, the mandatory self-red-team before APPROVE, how a finding is stated (quote the span, take the UNKNOWN escape hatch) and held (only new evidence moves a severity, never pushback), spec-UB…

saeedkolivand/ai-job-hunter-app · 97 tokens

code-quality

Shared clean-code / DRY / KISS / YAGNI standards and stack-specific smells for the React 19 + TypeScript + Rust (Tauri 2) monorepo. Library consumed by the code-quality-reviewer and code-quality-author agents.

saeedkolivand/ai-job-hunter-app · 55 tokens

review-workflow

The implement→review flow under the ≤3-reviewer budget with the conditional test stage. Use for /implement-feature, /fix-bug, /refactor-module and any change that needs structured review.

saeedkolivand/ai-job-hunter-app · 45 tokens

anarlog

Query Anarlog meetings, notes, summaries, transcripts, participants, action items, and recurring history. Use when a user asks about their Anarlog meeting data or needs meeting context for another task.

fastrepl/anarlog · 44 tokens

graphify-windows

Turn any folder of files into a navigable knowledge graph with community detection, an honest audit trail, and three outputs: interactive HTML, GraphRAG-ready JSON, and a plain-language GRAPHREPORT.md.

saeedkolivand/ai-job-hunter-app · 75 tokens

lessons

How to propose and query distilled lessons (the experiential memory). Only project-steward persists; every other agent proposes/queries. Use when you discover a durable lesson or need prior experience for the current task.

saeedkolivand/ai-job-hunter-app · 45 tokens