agentleFS
sanzhardanybayevsanzhardanybayev/synergy/skills/create-spec/SKILL.md

create-spec

Skill2 starsChanged 4 months agoMITView on GitHub

Use when the user wants to plan a new feature, refactor, or project. Generates a Synergy MDX spec session in .synergy/sessions/, auto-starts the preview server, and opens the browser. Triggers on phrases like "create a spec for X", "let's plan Y", "scaffold a refactor for Z", "/synergy-spec".

  • Sends data out

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use review-spec, create-plan and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dekozaSkill

    review-spec

    Use when a diff must be reviewed against the spec, ticket, or issue that originated it — missing requirements, scope creep, and requirements implemented wrongly — producing cited findings and nothing else. One axis of a two-axis review, independently invocable. Triggers on: "spec review", "does this match the ticket", "review the PR against the spec", "did we build what was asked", "spec axis". Does not judge code style — that is review-standards.

    Also in 3 projects that use this

  • JetBrainsSkill

    create-plan

    Research the codebase and create an implementation plan with architecture notes, design document, and track decomposition. Use when starting a new feature or large change.

    Also in 3 projects that use this

  • MicrosoftSkill

    pr-review

    Verify the technical accuracy of a vscode-docs pull request against the VS Code source code in microsoft/vscode. Use when reviewing a docs PR for factual correctness: setting names, command IDs, default values, API shapes, keybindings, versioned availability, and described behavior.

    Also in 3 projects that use this

  • VercelSkill

    vercel-react-best-practices

    React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 4 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If it prints a warning, surface that line to the user verbatim before continuing.

    line 24
  2. Distinctive:

    Before scaffolding anything, decide the shape of the spec from the user's request.

    line 33
  3. Distinctive:

    When in doubt, ask one clarifying question rather than over-scaffolding.

    line 41
  4. Very specific:

    Init if needed: If .synergy/ does not exist in the project root, run node "$CLAUDE_PLUGIN_ROOT/packages/cli/dist/cli.js" init once.

    line 94
  5. Very specific:

    Scaffold the session in one call: Read each template from $CLAUDE_PLUGIN_ROOT/skills/create-spec/templates/ with the Read tool, substitute …

    line 96
  6. Distinctive:

    Validate: Prefer the daemon endpoint.

    line 120
  7. Very specific:

    All from @synergy/spec-kit.

    line 134
  8. Very specific:

    NO model/effort here; those live in the tree).

    line 171
  9. Distinctive:

    Orchestrator stays plain markdown: No MDX components, no JSX.

    line 195

“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- synergy-version: 0.22.0 -->

Step 0 — Freshness check (run before anything else)

This skill loads at session start, so it can be stale if the plugin was updated mid-session. Before doing any work, confirm you are the newest installed version. Set MINE to the version in the synergy-version marker just above, then run:

MINE="0.22.0"  # ← the synergy-version marker above
CACHE="${CLAUDE_PLUGINS_DIR:-$HOME/.claude/plugins}/cache/synergy/synergy"
NEWEST="$(ls "$CACHE" 2>/dev/null | sort -V | tail -1)"
if [ -n "$NEWEST" ] && [ "$NEWEST" != "$MINE" ] && \
   [ "$(printf '%s\n%s\n' "$MINE" "$NEWEST" | sort -V | tail -1)" = "$NEWEST" ]; then
  printf '⚠ synergy: this session loaded v%s, but v%s is installed. Restart Claude Code to load the latest skills/templates.\n' "$MINE" "$NEWEST"
fi

If it prints a warning, surface that line to the user verbatim before continuing. Then proceed — staleness is a warning, not a block.

create-spec

You are scaffolding a new Synergy MDX spec session. There is no synergy spec CLI command — this skill is the authoring path. You read templates from disk, fill in placeholders, and write the result into .synergy/sessions/<name>/.

Scope reasoning

Before scaffolding anything, decide the shape of the spec from the user's request. Phase count is a judgment call, not a default.

SignalShape
One-paragraph ask, no architecture concerns, < 1 day of workTiny — 00-overview.mdx (minimal) + orchestrator.md. Nothing else.
Single coherent change, clear path, 1–3 days, no parallelismSingle-phase — overview (full) + architecture + implementation + one phases/01-<slug>/.
Multiple independent or sequenced chunks, > 3 days, parallelizable work, multiple agentsMulti-phase — overview (full) + architecture + implementation + phases/01-…/, phases/02-…/, etc.

When in doubt, ask one clarifying question rather than over-scaffolding.

Layout rules

Session directory: .synergy/sessions/<YYYY-MM-DD>-<slug>/.

Slug rules (for both session and phase slugs):

  • lowercase, kebab-case (a-z0-9-), max 40 chars,
  • derived from the title,
  • on collision with an existing directory, append -<6-char-hash> (sha1 of title-now, sliced to 6).

Required vs optional files:

FileRequired?
orchestrator.mdalways
00-overview.mdxalways (Summary + Goals headings required by the validator)
01-architecture.mdxoptional
02-implementation.mdxoptional — include when there are phases
_components/optional
assets/optional
phases/<NN>-<slug>/spec.mdxrequired if the phase folder exists
phases/<NN>-<slug>/orchestrator.mdoptional but warned-on-miss

Phase folder format: <NN>-<slug> where NN is zero-padded (01, 02, …). NN sequence must be gap-free starting at 01. The slug is the stable identifier; renumbering is safe because CrossRefs use slugs.

CrossRefs to phases use the slug, not the number: <CrossRef to="phases/core" /> resolves to whichever folder has slug core, regardless of its numeric prefix. Use phases/<slug>, never phases/02-core or 02-implementation#phase-2.

Templates

Templates live at $CLAUDE_PLUGIN_ROOT/skills/create-spec/templates/. Read them with the Read tool, substitute placeholders, write into the session. Do not paste template bodies back into the conversation.

ScopeTemplates to copy
Tinyoverview-minimal.mdx → 00-overview.mdx; orchestrator-root.md → orchestrator.md.
Single-phaseoverview-full.mdx → 00-overview.mdx; architecture.mdx → 01-architecture.mdx; implementation.mdx → 02-implementation.mdx; orchestrator-root.md → orchestrator.md; phase/spec.mdx → phases/01-<slug>/spec.mdx; phase/orchestrator.md → phases/01-<slug>/orchestrator.md.
Multi-phaseSame as single-phase, but copy the phase/* templates once per phase into phases/<NN>-<slug>/.

Placeholders to substitute at write time:

PlaceholderValue
{{TITLE}}Session title (human-readable).
{{TYPE}}feature, refactor, or project.
{{TODAY}}ISO date (YYYY-MM-DD).
{{PHASE_NUMBER}}Phase ordinal (1, 2, …) — no zero-padding inside templates.
{{PHASE_TITLE}}Phase title (human-readable).

CrossRef placeholders like <first-phase-slug>, <prev-phase-slug> are hints to you — replace them with the real phase slugs the user agreed on. Don't leave angle-bracket placeholders in the written session.

Scaffolding procedure

  1. Confirm intent. Restate the user's ask in one sentence. Decide tiny / single-phase / multi-phase per the scope table. Ask one clarifying question only if the shape is ambiguous.
  2. Init if needed. If .synergy/ does not exist in the project root, run node "$CLAUDE_PLUGIN_ROOT/packages/cli/dist/cli.js" init once. If .synergy/ already exists, skip this — the scaffold call in step 4 creates the session directory automatically.
  3. Pick the session slug (YYYY-MM-DD-<slug>, max 40 chars in the slug part, -<6-char-hash> suffix on collision).
  4. Scaffold the session in one call. Read each template from $CLAUDE_PLUGIN_ROOT/skills/create-spec/templates/ with the Read tool, substitute all placeholders in-memory, then write the entire session with a single daemon call (prefer the fast path; fall back to per-file writes when the preview is not running):

    # Fast path (daemon running): assign PREVIEW_ORIGIN from `preview status --json`.
    curl -sS -X POST "${PREVIEW_ORIGIN}/api/scaffold" \
      -H 'content-type: application/json' \
      -d '{"session":"<YYYY-MM-DD-slug>",
           "dirs":["_components","assets","phases/01-<slug>"],
           "files":[
             {"path":"orchestrator.md","content":"<filled>"},
             {"path":"00-overview.mdx","content":"<filled>"},
             {"path":"phases/01-<slug>/spec.mdx","content":"<filled>"}
           ]}'
    
    # Fallback (preview not yet running — use init + per-file writes as before):
    node "$CLAUDE_PLUGIN_ROOT/packages/cli/dist/cli.js" init   # only if .synergy/ absent
    # then Write each file individually

    Template reading is always local (the Read tool against $CLAUDE_PLUGIN_ROOT/skills/create-spec/templates/). Replace <…-slug> hint placeholders with the real slugs before sending.

  5. Start the preview by running node "$CLAUDE_PLUGIN_ROOT/packages/cli/dist/cli.js" preview start. It is idempotent — safe to call when already running.
  6. Print the URL for the user. Run preview status --json, read its non-null origin, and resolve /s/<session-name>/overview against it. The complete runtime-discovered URL is the contract. Browser auto-open is best-effort and OS-dependent — try it but don't fail the flow on it.
  7. Fill the templates. Open the written files and replace the placeholder body text (_..._ blocks, example phases, sample components) with content derived from the conversation.
  8. Validate. Prefer the daemon endpoint; fall back to the CLI when the preview is not running:

    # Fast path (daemon running):
    curl -sS "${PREVIEW_ORIGIN}/api/validate?session=<session-name>"
    
    # Fallback:
    node "$CLAUDE_PLUGIN_ROOT/packages/cli/dist/cli.js" validate <session-name>

    Parse the JSON issues array from the daemon response: any item with severity: "error" must be fixed. Fix every error before declaring done.

Component cheat sheet

All from @synergy/spec-kit. Keep this short — the canonical list is in the package itself.

ComponentUse for
<Status value="…" />Lifecycle badge (draft/proposed/in-progress/blocked/done/shipped).
<Phase number title status estimate>Phase summary card inside 02-implementation.mdx. Phase content itself lives in phases/<NN>-<slug>/spec.mdx.
<Timeline milestones={[…]} />Ordered milestones with optional when / status.
<SubSpec slug title summary />Pointer to a sibling MDX file from 00-overview.mdx.
<CrossRef to="…" />Validator-enforced spec-to-spec link. Use phases/<slug> for phases.
<AgentAllocation entries={[…]} />Maps agents to phases by name (no model/effort here — those live in <AgentTree>).
<AgentTree nodes={[…]} />Agent hierarchy with model/effort per node. Source of truth for fan-out.
<OpenQuestion id question />Unresolved decision.
<Risk id title severity />Known hazard + mitigation.
<Mockup src alt caption />Image from assets/.
<Chart kind="flow|sequence|state|er|gantt|mindmap">{mermaid src}</Chart>Diagrams. Default to Mermaid; build a session-local component if Mermaid is insufficient.

Agent structure: <AgentTree> + <AgentAllocation>

Author the agent roster as a tree — the single source of truth for the hierarchy and for each agent's model/effort:

<AgentTree
  context="Orchestrator coordinates; implementors and teams hang beneath it."
  nodes={[
    { name: 'orchestrator', type: 'orchestrator', model: 'opus', effort: 'high', subAgents: [
      { name: 'storage-impl', type: 'sub-agent', responsibility: 'Implement TokenStore', model: 'sonnet', effort: 'medium' },
      { name: 'migration', type: 'agent-team', teamName: 'Migration', model: 'opus', effort: 'max', subAgents: [
        { name: 'scout', type: 'sub-agent', model: 'haiku', effort: 'low' },
        { name: 'verifier', type: 'sub-agent', model: 'opus' },
      ] },
    ] },
  ]}
/>

Then map agents to phases with the slimmed <AgentAllocation> (name + phases only — NO model/effort here; those live in the tree). <Phase> references agents by name.

Quality-first model/effort rubric — quality is the invariant, cost flexes underneath:

Start at opus. Drop a tier only when the task is provably bounded AND a verification gate downstream would catch a miss. When unsure, don't drop.

ConditionModel / Effort
Any judgment, design, ambiguity, or risk (the default)opus / high–max
Fully-specified implementation against a clear interface, verified downstreamsonnet / medium
Purely mechanical, zero-judgment, fully bounded, verified downstreamhaiku / low
A verification / review nodenever below the tier of the riskiest thing it checks

Effort inherits down the tree (omit it to inherit the parent's); model is per-node (does not inherit). Every executable node must resolve to a model + effort or the validator warns.

Hard rules

  • Prefer components over markdown for structured content (status, phases, risks, allocations, timelines, charts).
  • No raw markdown links between specs ([link](other.mdx)). Use <CrossRef> so the validator can catch breakage.
  • <Phase> in 02-implementation.mdx is a summary card only. The real phase content lives in phases/<NN>-<slug>/spec.mdx. The card's job is to summarize and cross-ref the phase folder.
  • CrossRef phase references use the slug, not the numeric prefix. phases/core, never phases/02-core or 02-implementation#phase-2. Slugs are stable across renumbering; numbers are not.
  • Orchestrator stays plain markdown. No MDX components, no JSX.

Stop conditions

Done when all of these are true:

  • The session directory exists under .synergy/sessions/<YYYY-MM-DD-slug>/.
  • All {{PLACEHOLDER}} substitutions are complete and all <…-slug> hints are replaced with real slugs.
  • curl -sS "${PREVIEW_ORIGIN}/api/validate?session=<session-name>" (or the CLI fallback) returns zero errors, where PREVIEW_ORIGIN came from preview status --json.
  • orchestrator.md describes the actual execution strategy (dependency graph, parallel chunks, agent strategy, verification gates) — not template boilerplate.
  • The user confirms the session reflects their intent.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.