Cm Refactor
kingxiaozhe/cm-workflow
用户明确要求“只整理结构,不改变行为”时使用。执行边界分流、行为判官、分批重构和独立审查;缺陷修复转交 cm-fix,新增或变化的业务行为转交 cm-prd。
Create a detailed execution plan/spec/PRD for implementing features or refactors in a codebase, designed around the program's entrypoints, the doors that carry domain intent, by leveraging existing…
$ npx skills add bastani-inc/atomic --skill create-spec -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install bastani-inc/atomic create-spec --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/bastani-inc/atomic.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/workflows/skills/create-spec .claude/skills/create-spec && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "create-spec" agent skill from https://github.com/bastani-inc/atomic/tree/main/packages/workflows/skills/create-spec into .claude/skills/create-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "create-spec", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/bastani-inc/atomic/tree/main/packages/workflows/skills/create-specType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add bastani-inc/atomic --skill create-spec -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install bastani-inc/atomic create-spec --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bastani-inc/atomic.git skills-src && mkdir -p .agents/skills && cp -r skills-src/packages/workflows/skills/create-spec .agents/skills/create-spec && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "create-spec" agent skill from https://github.com/bastani-inc/atomic/tree/main/packages/workflows/skills/create-spec into .agents/skills/create-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "create-spec", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bastani-inc/atomic --skill create-spec -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install bastani-inc/atomic create-spec --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bastani-inc/atomic.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/packages/workflows/skills/create-spec .cursor/skills/create-spec && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "create-spec" agent skill from https://github.com/bastani-inc/atomic/tree/main/packages/workflows/skills/create-spec into .cursor/skills/create-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "create-spec", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/bastani-inc/atomic.git --path packages/workflows/skills/create-spec--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add bastani-inc/atomic --skill create-spec -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install bastani-inc/atomic create-spec --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bastani-inc/atomic.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/packages/workflows/skills/create-spec .gemini/skills/create-spec && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "create-spec" agent skill from https://github.com/bastani-inc/atomic/tree/main/packages/workflows/skills/create-spec into .gemini/skills/create-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "create-spec", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install bastani-inc/atomic create-specInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add bastani-inc/atomic --skill create-spec -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/bastani-inc/atomic.git skills-src && mkdir -p .github/skills && cp -r skills-src/packages/workflows/skills/create-spec .github/skills/create-spec && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "create-spec" agent skill from https://github.com/bastani-inc/atomic/tree/main/packages/workflows/skills/create-spec into .github/skills/create-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "create-spec", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bastani-inc/atomic --skill create-spec -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install bastani-inc/atomic create-spec --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bastani-inc/atomic.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/packages/workflows/skills/create-spec .opencode/skills/create-spec && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "create-spec" agent skill from https://github.com/bastani-inc/atomic/tree/main/packages/workflows/skills/create-spec into .opencode/skills/create-spec/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "create-spec", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
create-specCreate a detailed execution plan/spec/PRD for implementing features or refactors in a codebase, designed around the program's entrypoints, the doors that carry domain intent, by leveraging existing…
Create Spec is an agent skill from bastani-inc/atomic. Create a detailed execution plan/spec/PRD for implementing features or refactors in a codebase, designed around the program's entrypoints, the doors that carry domain intent, by leveraging existing research in the codebase.
Its SKILL.md is about 9.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Product & Project Management, covering Refactoring and PRD writing. The repository describes itself as: The verifiable coding agent runtime. Define your coding agent's process in natural language with stages, checks, and approval gates instead of hoping it follows your… The licence is MIT.
9 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 1ec2fe8. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Create Spec loads about 9.5k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 4,769 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from bastani-inc/atomic at commit 1ec2fe8, republished under its MIT licence (© bastani-inc). 4,769 words, ~9,475 tokens.
.claude/skills/create-spec/SKILL.md (or your agent's skills folder).You are tasked with creating a spec for implementing a new feature or system change in the codebase by leveraging existing research in the $ARGUMENTS path. If no research path is specified, use the entire research/ directory. IMPORTANT: Research documents are located in the research/ directory — do NOT look in the specs/ directory for research. Follow the template below to produce a comprehensive specification as output in the specs/ folder using the findings from RELEVANT research documents found in research/. The spec file MUST be named using the format YYYY-MM-DD-topic.md (e.g., specs/2026-03-26-my-feature.md), where the date is the current date and the topic is a kebab-case summary. Tip: It's good practice to use the codebase-research-locator and codebase-research-analyzer agents to help you find and analyze the research documents in the research/ directory. It is also HIGHLY recommended to cite relevant research throughout the spec for additional context.
## Backwards Compatibility section in the final spec.First inspect the context already available: the conversation, the requested research path, the research/ documents, local docs, and the codebase. Choose the path that matches what is actually known:
If the codebase can answer a question, inspect it instead of asking the user. For Path B, do not write a full spec yet: state what context is missing, then use the existing ask_user_question and contrastive-clarification rules below (one question at a time or a logical group, with a recommended answer and concrete trade-offs). Once the answers and repository evidence provide enough context, run Path A.
When Path A is selected, work in this order and map the results into the numbered document headings below:
specs/YYYY-MM-DD-topic.md; do not implement the change in this skill.The entrypoints of a program, read together, are the program's theory of its own purpose. Everything inside the boundary is mechanism — the how. Only at the boundary does the code speak in terms of meaning — the what and the why. So the single most important thing this spec defines is not the mechanism inside the system, but the set of doors the system keeps: the functions, routes, and RPC methods through which untrusted input arrives and irreversible effects happen.
Two acts hide inside that claim, and a good spec performs both. One is finding the doors — discovering where the domain is already jointed, using the research in research/ to learn what actually matters in the world the software serves. The other is crafting them — naming and shaping each door so it tells the truth about what lies behind it. Treat entrypoint design as the spine of the spec: a reviewer should be able to read the door set alone and reconstruct what the system is for before reading a single implementation detail.
Apply the five principles below to every entrypoint the spec introduces or changes, and run the rubric on each.
Name a joint, not a tool. A domain has seams — places reality is already divided into meaningful units (authenticate a user, settle a payment, revoke access, publish a draft). These exist before your code does. Name each door after such a joint, never after the mechanism behind it (run the query, call the service, update the row). A door named for a tool lets a reader learn how it works without ever learning what it is for — an ontological mismatch no clean mechanism repairs. Listen to the domain (and to the research), not to the code.
Compress honestly, or not at all. A door's value is roughly the ratio of mechanism hidden to surface exposed — but only when the name promises exactly what the body delivers. No less (so it hides no danger or incompleteness), no more (so it implies no guarantee it does not keep). A save() that sometimes silently doesn't, a delete() that soft-deletes, a validate() that mutates, a getUser() that creates one — each is a lie at the boundary, and lies at the boundary compound across every caller who reasons from the name. Encode cost and risk in the vocabulary (cheap-borrow vs allocate vs consume; read vs read_exact; panic-risk in the name).
Intent lives in what the door refuses. A boundary communicates as much by what it forbids as by what it allows. The shape of the door set — what it makes easy, what it makes impossible — is a direct statement of what the designers held sacred. Prefer making the illegal unrepresentable (in types and structure) over merely checked at runtime: a door that checks a rule trusts the caller; a door that makes the rule structurally necessary need trust no one. Use newtypes (AccountId, OrderId) over primitives, sum types over independent booleans, and capability-carrying types (an AdminSession, an AuthorizedCharge) that can only be produced by the door that earns them.
Write for the stranger across time. You craft the door not for the machine but for a competent stranger who arrives years from now, never meets you, and must understand the system's purpose before they dare change it. The governing test: could they reconstruct the purpose of the system from the entrypoints alone, without reading a single body? If they would have to read implementations to learn what the system means, intent has leaked out of the doors into the mechanism.
Keep the dangerous doors few and honest. The maturity of a system is visible in how few doors guard its irreversible effects — and how truthfully those doors are named. Every place money moves, access is granted, data is destroyed, a key is minted, a message is broadcast: funnel each effect through one honestly-named chokepoint, so the promise that guards it has exactly one home. Scatter danger across many small unnamed paths (every handler that can chargeCard, broad DB grants reaching DROP TABLE, ad-hoc os.system(...), default-public storage) and no one — not even the authors — can say where the weight is carried.
For each non-trivial entrypoint the spec introduces or changes, walk these in order. Stop at the first one you cannot answer cleanly — that is a finding, and it belongs in the spec (often in §5 as a constraint, or in §9 as an open question). Run it forward to audit a door you've drafted, and backward — asking what door each obligation deserves — to find the doors the system is still missing.
settle_payment in process, POST /v1/payment_intents/{id}/capture over REST, and Billing.SettlePayment over gRPC are one door, three transports, one name. When the function, the route, and the RPC method disagree about what the joints are, at least one of them is naming a tool — flag it. On the wire, the HTTP verb is honesty the protocol gives you for free (GET is safe, PUT/DELETE are idempotent, POST is neither — which is exactly why money doors carry an Idempotency-Key), and the status code is the door's honest exit (201 created, 204 done, 202 accepted; 409/412 are real refusals). The cardinal lie is 200 OK wrapping {"error": ...}. Authentication is one gate at the edge so every handler behind it may trust it speaks to a known caller.
<EXTREMELY_IMPORTANT>
specs/ directory.</EXTREMELY_IMPORTANT>
Specs stay in Markdown, but their visuals should use the smallest view that makes the key point clear. Skip a preamble, keep prose brief, and place each visual next to the short text it supports. Use one or several of these as needed; do not use all of them every time:
text pseudocode, not prose alone.tsx component tree, including the state and module boundaries that matter.text file tree.diff when the surrounding shape already exists and the point is what changes. Match the diff to the topic: component tree, file tree, call tree, or state/control flow.For a visual UI, layout, state comparison, or concept too dense for Mermaid, allow one focused show-me-{description}.html artifact (diagram, infographic, or short slide deck). Match the product's colors, type, spacing, components, labels, and data; support desktop and mobile. Specs remain Markdown in specs/; HTML is an optional extra only when the page is the point. Open it with Atomic's bash tool and a portable opener:
if [ "$(uname -s)" = "Darwin" ] && command -v open >/dev/null 2>&1; then
open "path/to/show-me-{description}.html"
elif [ "$(uname -s)" = "Linux" ] && command -v xdg-open >/dev/null 2>&1; then
xdg-open "path/to/show-me-{description}.html"
else
printf 'Open this file: %s\n' "path/to/show-me-{description}.html"
fi| Document Metadata | Details |
|---|---|
| Author(s) | !git config user.name |
| Status | Draft (WIP) / In Review (RFC) / Approved / Implemented / Deprecated / Rejected |
| Team / Owner | |
| Created / Last Updated |
Instruction: A "TL;DR" of the document. Assume the reader is a VP or an engineer from another team who has 2 minutes. Summarize the Context (Problem), the Solution (Proposal), and the Impact (Value). Name the one or two doors at the heart of the change. Keep it under 200 words.
Example: This RFC proposes replacing our current nightly batch billing system with an event-driven architecture. Currently, billing delays cause a 5% increase in customer support tickets. The proposed solution introduces two money doors —
authorize_charge(reversible hold) andsettle_payment(irreversible capture) — as the single chokepoint for outbound money, reducing billing latency from 24 hours to <5 minutes while making double-charges structurally impossible.
Instruction: Why are we doing this? Why now? Link to the Product Requirement Document (PRD) and cite the relevant research/ documents.
Instruction: Describe the existing architecture and be honest about the flaws — including which existing doors leak (named for tools, dishonest compression, scattered danger). Pick the smallest view that makes the current state clear: a shallow file tree for ownership, a call tree for runtime flow, a component tree for UI structure, or Mermaid for interaction/data flow. Place the visual next to the short explanation and do not force a diagram when prose is clearer.
chargeCard(token, cents) is reachable from checkout, the retry job, and the admin panel — no one owns "charge exactly once." processPayment(...) -> bool collapses a declined card, a network failure, and a duplicate submission into the same false.Instruction: What is the specific pain point?
Instruction: This is the contract / Definition of Success. Be precise.
Instruction: Explicitly state what you are NOT doing. Remember: intent lives in what the door refuses — the doors you deliberately do not build are as much a statement of purpose as the ones you do. This prevents scope creep.
settle_payment remains the only chokepoint.Instruction: The "Big Picture." Choose the smallest fitting view from the shape-first visual language above; use one or several only when each answers a different question. Types, trees, diffs, or Mermaid should define the shape, while brief prose explains why. Do not use a heavy styled diagram when a simpler view communicates the boundary.
Instruction: Show the system boundary and mark the airlock (the single edge where untrusted input becomes a trusted request). Use Mermaid for component interaction or data flow, a shallow file tree for module responsibility, a call tree for runtime control flow, or a component tree for UI structure. Show the whole block when most of it is new or omitted context would hide ownership or order.
flowchart TB
User((User)) -->|untrusted request| Gateway["Gateway<br/>auth · validate · authorize<br/>airlock"]
Gateway -->|trusted request| API["Core service<br/>trusts its invariants"]
API --> DB[(Primary DB)]
API -.-> Worker[Worker]
Worker -.-> Ext["External provider<br/>irreversible effect"]Instruction: Name the pattern (e.g., "Event Sourcing", "BFF — Backend for Frontend", "Publisher-Subscriber").
OrderCreated events, and the Billing Service consumes them asynchronously.| Component | Responsibility | Technology Stack | Justification |
|---|---|---|---|
| Ingestion Service | Validates incoming webhooks | Go, Gin Framework | High concurrency performance needed. |
| Event Bus | Decouples services | Kafka | Durable log, replay capability. |
| Projections DB | Read-optimized views | MongoDB | Flexible schema for diverse receipt formats. |
Instruction: Map the files and modules that implement the design. List every add, change, delete, test, and configuration file, and state the responsibility each owns. Use a shallow file tree when layout is the key point; otherwise use this compact map.
| Path | Action | Owns |
|---|---|---|
src/feature/door.ts | change | Public door and boundary contract |
test/feature/door.test.ts | add | Vertical behavior slice through the door |
Instruction: List the entrypoint names alone — no signatures, no bodies. A competent stranger should reconstruct the system's purpose from this list. If they cannot, intent has leaked into the mechanism; return to §5 and rename until they can. Mark every door that guards an irreversible effect with ⚠.
Example:
register_account,authenticate,authorize_charge,settle_payment⚠,grant_access⚠,revoke_access,publish_draft. Reading these alone tells you who the system lets in, that money moves in exactly two steps and only those two, who may hand out access, and what it means for work to go live.
Instruction: The "Meat" of the document. Sufficient detail for an engineer to start coding. Lead with the doors — they are the load-bearing part of the spec — then describe the mechanism behind them.
Instruction: For each non-trivial entrypoint, give a typed signature (typed pseudocode is fine — read the types, not the syntax), the one-sentence guarantee (no "and"), the named failure set, and the refusals it enforces in the type system. Then record the rubric result. Make illegal states unrepresentable, not merely checked. Cite the research/ doc that establishes each joint. Use a whole block when the door is mostly new or the reader needs a copyable target shape; use a topic-matched diff when an existing door is changing. Show the runtime path to and from the door as a call tree, and include UI/module boundaries as a component tree when they matter.
// — Money. Two doors, and there is no third way to move a cent. —
authorize_charge(
account: AccountId, // newtype: cannot be confused with any other id
amount: Money, // currency-typed: USD and JPY will not add
idempotency_key: IdempotencyKey,
): Result<AuthorizedCharge, ChargeError>
// Guarantee: places a reversible hold and returns proof an authorization exists.
// ChargeError = InsufficientFunds | CardDeclined | NetworkError | DuplicateKey
settle_payment(
authorized: AuthorizedCharge, // ← can ONLY be produced by authorize_charge
idempotency_key: IdempotencyKey,
): Result<Settlement, SettlementError>
// Guarantee: captures the held funds. IRREVERSIBLE. The single chokepoint for outbound money.
// You cannot settle a charge you did not authorize — not because a check forbids it,
// but because there is no way to CONSTRUCT an AuthorizedCharge except by calling
// authorize_charge. The illegal state is unrepresentable. The idempotency key makes
// the retry, the double-click, and the at-least-once queue converge on ONE settlement.Per-door audit (run the rubric):
| Door | (1) Joint | (2) One sentence, no "and" | (3) Honest name | (5) Every exit | (6) Refusals real | (7) Trust transition | (8) One chokepoint |
|---|---|---|---|---|---|---|---|
authorize_charge | ✅ business verb | ✅ "places a reversible hold" | ✅ | retry → DuplicateKey; timeout → NetworkError | currency mismatch unrepresentable | n/a | reversible, not the chokepoint |
settle_payment ⚠ | ✅ business verb | ✅ "captures held funds" | ✅ irreversibility in doc + type | replay converges via key | cannot settle un-authorized charge (type) | n/a | ✅ the sole outbound-money door |
Instruction: A web service's real boundary is its transport surface. The URL names the joint, the HTTP verb declares its safety class, the status code is the door's honest exit. Never 200 OK wrapping an error. The wire door MUST carry the same name as its in-process twin (§5.1).
# Identity — the one trust transition, at the edge
POST /v1/sessions 201 Created # = authenticate; 401 on bad credentials
DELETE /v1/sessions/current 204 No Content # = log out
# Money — two doors, one chokepoint, idempotent under retry
POST /v1/payment_intents 201 Idempotency-Key: <key> # = authorize_charge (reversible)
POST /v1/payment_intents/{id}/capture 200 Idempotency-Key: <key> # = settle_payment (IRREVERSIBLE)
# 409 Conflict if the key is replayed with a different body
# 422 Unprocessable if the intent was never authorized
# Access — authority demanded by the route, destructive door made idempotent
POST /v1/accounts/{id}/grants 201 (admin scope required) # = grant_access
DELETE /v1/grants/{id} 204 (204 even if already revoked) # = revoke_access
# Publishing — the domain's own verb, refusing to clobber a concurrent edit
POST /v1/drafts/{id}/publish 200 If-Match: <etag> # = publish_draft
# 412 Precondition Failed if the draft moved under you — the wire's --force-with-leaseIf using gRPC, define the same joints in the .proto; the typed request message is the airlock by construction. Use honest status codes (INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND, ALREADY_EXISTS, FAILED_PRECONDITION, retryable ABORTED/UNAVAILABLE) — never a lone OK carrying an error field.
Instruction: Provide ERDs or JSON schemas. Discuss normalization vs. denormalization. Prefer schemas that make illegal states unrepresentable (sum-type status columns over independent boolean flags).
Table: invoices (PostgreSQL)
| Column | Type | Constraints | Description |
|---|---|---|---|
id | UUID | PK | |
user_id | UUID | FK -> Users | Partition Key |
status | ENUM | 'DRAFT','LOCKED','PROCESSING','PAID' | A sum type, not three booleans |
Instruction: Describe complex logic, state machines, or consistency models. Tie each state transition to the door that performs it and choose the smallest view that makes the behavior clear. Use indented text pseudocode for algorithms, a call tree for runtime control flow, Mermaid for interaction or data flow, and a topic-matched diff for changes to an existing state or control-flow shape. Include failure, retry, cancellation, idempotency, and concurrency behavior whenever reachable; keep unknowns for §9 rather than inventing them.
on(settle_payment)
if request is a replay
return the recorded settlement
validate the authorized charge
if provider call fails
return named retryable error
persist settlement
return settlementpublishDraft
authenticate
loadDraft
checkVersion
persistPublication
notifySubscribersDRAFT → LOCKED → PROCESSING → PAID; the PROCESSING → PAID transition happens only through settle_payment.version column; on the wire this surfaces as If-Match/412.Instruction: Prove you thought about trade-offs — including alternative door sets (e.g., one god endpoint vs. distinct joints). Explore materially different alternatives before locking the recommendation, then record why the selected boundary is better. Compare interface shape, seam placement, ownership, call stack, runtime topology, and module boundaries — not just names.
| Option | Pros | Cons | Reason for Rejection |
|---|---|---|---|
Option A: Single POST /execute {action} | One route, flexible | God door; intent hidden in payload; danger un-funneled | Fails "joint, not tool" and "few dangerous doors." |
Option B: One-step chargeCard() | Fewest calls | No reversible hold; retries double-charge | Cannot make double-charge unrepresentable. |
Option C: authorize + settle (Selected) | Reversible hold; one chokepoint; idempotent | Two calls instead of one | Selected: the two real joints, with the irreversible effect funneled once. |
Instruction: This is where "keep the dangerous doors few and honest" and "the airlock at the boundary" become concrete.
POST /v1/sessions / the gateway. No other door promotes an anonymous caller. (Rubric #7.)AdminSession) that only authenticate can mint — the permission check cannot be forgotten at a call site because there is no call site where it is absent. (Rubric #6.)settle_payment, deletion via the single guarded door; the catastrophic version must be asked for explicitly. (Rubric #8.)Password is a newtype that cannot be logged, printed, or compared by accident.Instruction: Test the doors at their promises and their refusals — not just the happy path. Every exit in rubric #5 deserves a test. Plan vertical red-green-refactor (RGR) slices through public doors and seams: each slice starts with one failing behavior test, adds the smallest implementation that turns it green, then refactors without changing the behavior. Do not write all tests first as a horizontal batch. The interactive verification is what lets a human or another agent confirm the feature is correct without reading the bodies — the stranger-across-time test, made executable.
settle_payment cannot accept anything but an AuthorizedCharge).412; trust transition (no door promotes an anonymous caller except authenticate).settle_payment converges on one settlement under any interleaving of retries; no input sequence reaches a money move except through the chokepoint).Instruction: List known unknowns. These must be resolved before the doc is marked "Approved." Include any door whose rubric could not be answered cleanly — especially undefined guarantees (rubric #2, the most dangerous case) and any irreversible effect not yet funneled to a single chokepoint (rubric #8). Resolve these with the user via contrastive clarification.
publish_draft the only door that moves a draft to live, or can the admin panel also publish? (If the latter, the effect is not yet funneled — rubric #8.)authorize_charge promise on a partial provider outage — is the guarantee defined? (rubric #2.)© bastani-inc, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in packages/workflows/skills/create-spec of bastani-inc/atomic.
Open the folder on GitHubat commit 1ec2fe8
Create Spec next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Create Spec this skillbastani-inc/atomic | 846 | — | ~9.5k | Automated safety check: Pass | MIT | |
| Cm Refactorkingxiaozhe/cm-workflow | 104 | 1 repos | ~2.7k | Automated safety check: Pass | MIT | |
| Securability EngineeringOWASP/secure-agent-playbook | 187 | — | ~5.8k | Automated safety check: Pass | CC-BY-4.0 | |
| Grilling Ideasopsmill/infrahub | 531 | — | ~3.8k | Automated safety check: Pass | Apache-2.0 | |
| Avoid Feature Creepwaynesutton/builder-skills | 404 | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Experience Lwc Design Generateforcedotcom/sf-skills | 1.1k | — | ~4k | Automated safety check: Pass | Apache-2.0 |
kingxiaozhe/cm-workflow
用户明确要求“只整理结构,不改变行为”时使用。执行边界分流、行为判官、分批重构和独立审查;缺陷修复转交 cm-fix,新增或变化的业务行为转交 cm-prd。
OWASP/secure-agent-playbook
Generate, scaffold, or refactor code so it embodies FIASSE v1.0.4 SSEM qualities by default — 10 attributes, Transparency and Least-Astonishment principles, ASVS-aligned controls, defensive boundary…
opsmill/infrahub
Stress-tests a fuzzy or vague feature idea before any PRD, spec, or ticket is written.
waynesutton/builder-skills
Keeps a change scoped to what was asked. An agent skill from waynesutton/builder-skills.
forcedotcom/sf-skills
A skill your agent uses when you need to create a brand new Lightning Web Component from a Figma design, a Product Requirements Document, or another design artifact — orchestrating the five-phase…
forcedotcom/sf-skills
A skill your agent uses to analyze a Salesforce Aura component bundle (.cmp, .app, .evt, .intf, Controller.js, Helper.js, Renderer.js) and produce a framework-agnostic migration blueprint (PRD.yaml…
bastani-inc/atomic
A skill your agent uses for "how does X work", code walkthroughs before changing something, and placement / ownership / layering questions ("where should this live", "which package owns this", "is…
bastani-inc/atomic
A skill your agent uses whenever a task involves a document file (PDF, DOCX, PPTX, XLSX, or image) and you need to read it or pull text, tables, or specific values out of it — to answer a question…
bastani-inc/atomic
A skill your agent uses when building, testing, and deploying JavaScript/TypeScript applications.
bastani-inc/atomic
Draft, revise and post privacy-scrubbed Atomic bug reports or enhancements through ordinary conversation.
bastani-inc/atomic
A skill your agent uses when setting up or running hooks with prek in any repository.
bastani-inc/atomic
Test-driven development with red-green-refactor loop, plus a value gate and audit workflow for tests.
Categories
Create a detailed execution plan/spec/PRD for implementing features or refactors in a codebase, designed around the program's entrypoints, the doors that carry domain intent, by leveraging existing…. Create Spec is an agent skill from bastani-inc/atomic. Create a detailed execution plan/spec/PRD for implementing features or refactors in a codebase, designed around the program's entrypoints, the doors that carry domain intent, by leveraging existing research in the codebase.
Create Spec fits situations like: tasks that involve Refactoring; tasks that involve PRD writing.
Run `npx skills add bastani-inc/atomic --skill create-spec -a claude-code`. Or copy the skill folder (packages/workflows/skills/create-spec in bastani-inc/atomic) into .claude/skills/create-spec in your project. Claude Code loads it when a task matches its description.
Run `npx skills add bastani-inc/atomic --skill create-spec -a codex`. Or copy the skill folder (packages/workflows/skills/create-spec in bastani-inc/atomic) into .agents/skills/create-spec in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bastani-inc/atomic --skill create-spec -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/create-spec, .gemini/skills/create-spec, .github/skills/create-spec and .opencode/skills/create-spec in your project.
Going by SKILL.md and its folder, Create Spec needs the command-line tools its instructions call (git).
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Create Spec is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 9.5k tokens (SKILL.md is roughly 38k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Create Spec: Cm Refactor (kingxiaozhe/cm-workflow, 104 stars), Securability Engineering (OWASP/secure-agent-playbook, 187 stars), Grilling Ideas (opsmill/infrahub, 531 stars) and Avoid Feature Creep (waynesutton/builder-skills, 404 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
bastani-inc (a GitHub organization) maintains it in bastani-inc/atomic, which has 846 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 8, 2026.
Source: bastani-inc/atomic on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.