agentleFS
keefarkeefar/ticket-flow/skills/init/SKILL.md

init

Skill4 starsChanged 3 months agoMITView on GitHub

Scaffold a ticket-flow project — one-time setup; trigger on "setz ticket-flow auf", "richte das Projekt für ticket-flow ein", "set up ticket-flow here". Runs `bd init` with tf's agents template (keeps Claude Code's own memory system), scaffolds spec dirs and worktree settings, migrates an existing KANBAN.md into beads. Idempotent. Invoke as `/ticket-flow:init` (accepts `--skip-agents` plus other `bd init` pass-throughs).

  • Reads credentials

89 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use migrate, survey and 8 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.
  • genomewalkerSkill

    migrate

    Import soul data from SQLite or shared chitta files

    Also in 8 projects that use this

  • SNL-UCSBSkill

    survey

    Literature survey assistant with four modes: /survey intent (capture student goals, expertise, and success criteria), /survey triage (landscape mapping via NotebookLM), /survey deepen (structured reading with craft and visualization extraction), /survey synthesize (cross-paper analysis for related work, area exams, gap identification). Also: /survey expand (corpus growth proposals). Use when students mention reading papers, literature review, related work, area exam prep, paper corpus, or any systematic reading task.

    Also in 3 projects that use this

  • pvnarpSkill

    bug

    Investigates and resolves bugs using structured diagnosis. Categorizes by system, traces root cause, proposes minimal fix, and suggests prevention. Use when debugging issues or investigating unexpected behavior.

    Also in 3 projects that use this

  • AnthropicSkill

    uninstall

    Uninstall a community skill that was installed via the hub. Confirms before deleting files, refuses to touch first-party plugin skills, and logs every action. Use when the user wants to fully remove a community skill ("uninstall [skill]", "remove this skill") rather than just disable it.

    Also in 3 projects that use this

  • Eipi-TongSkill

    adopt

    Onboard an existing codebase into the starter kit. Use when the user says "adopt this project", "add the kit to my existing repo", or "set up the kit on existing code".

    Also in 3 projects that use this

  • mlz11Skill

    reset

    Completely reset ClaudeNotifier installation, removing all components and permissions

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 80 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If an existing KANBAN.md with items is present, every row is imported into bd via skills/kanban/kanban-import.sh, then the file is archived …

    line 35
  2. Very specific:

    If .claude/rules/beads-workflow.md exists and references the stock .worktrees/ convention, init patches every standalone occurrence to …

    line 36
  3. Very specific:

    If either check fails, warn the user — the flag wasn't honored by bd init.

    line 189
  4. Very specific:

    Hand-maintained .worktreeinclude / symlinkDirectories: only missing entries are appended.

    line 277
  5. Distinctive:

    Hand-edited routing rule: never overwritten — the rule file's existence is the idempotency guard.

    line 286
  6. Very specific:

    Add a git remote (project may or may not be on GitHub — use /ticket-flow:publish for that)

    line 290
  7. Distinctive:

    Create a sample item

    line 292

“Common” is measured: kept by at least 6 in 10 of the 80 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

/ticket-flow:init — Scaffold ticket-flow project files

Args:

  • (none) — scaffold the project (beads is the only backend). --mode=beads / --beads are accepted as no-op legacy spellings; --mode=kanban is refused with a pointer to the removed mode.
  • Pass-throughs (forwarded to bd init): --skip-agents, --stealth, --non-interactive, --prefix, --role, etc.

What it does

Sets up a project for ticket-flow on beads — the only backend since the mode=kanban removal (the dual-mode code is preserved at refs/archive/mode-kanban). No .ticket-flow flag is written anymore; a leftover mode=kanban flag marks an unmigrated project and this skill is the migration path.

Scaffolding:

  • docs/specs/SPEC-TEMPLATE.md — template that /ticket-flow:spec copies from
  • docs/superpowers/plans/.gitkeep — directory for implementation plans (used by superpowers:writing-plans)
  • .claude/worktrees/ — directory where /ticket-flow:pickup creates branch worktrees
  • .worktreeinclude — gitignored local config (.env, *.local, …) that must follow a ticket into its worktree; seeded from what the repo actually has, skipped when there is nothing (via skills/init/install-worktree-include.sh)
  • .claude/settings.json → worktree.symlinkDirectories — dependency directories (node_modules, vendor, …) linked back to the main checkout instead of reinstalled per worktree; build outputs deliberately excluded (via skills/init/set-worktree-symlinks.sh)
  • .claude/rules/ticket-flow-routing.md — the Ticket-Flow Routing rule (via skills/init/install-routing-rule.sh) so planning/ideation prompts route through tf instead of superpowers:brainstorming or superpowers:writing-plans. A rule without a paths: frontmatter key loads at launch with the same priority as .claude/CLAUDE.md (memory docs) — same effect, without writing into the consumer project's own CLAUDE.md. Idempotent (the file's existence is the guard); a routing block left in CLAUDE.md by an older init is removed.

Beads scaffolding:

  • .beads/PRIME.md — override for bd prime's built-in output (via skills/bd-detox/install-prime.sh); without it bd re-injects its anti-MEMORY.md guidance on every SessionStart and PreCompact. Never overwrites an existing file.
  • .beads/ — bd's Dolt database, created by bd init --agents-template <tf custom template>. The custom template drops vanilla bd init's anti-MEMORY.md clause so Claude Code's Auto-Memory keeps working alongside bd remember. With --skip-agents, no AGENTS.md is written and the BEADS INTEGRATION block is skipped from CLAUDE.md too.
  • If an existing KANBAN.md with items is present, every row is imported into bd via skills/kanban/kanban-import.sh, then the file is archived to KANBAN.archived.md. The archived board can be regenerated on demand from bd state with /ticket-flow:board — it is no longer a workflow input.
  • If .claude/rules/beads-workflow.md exists and references the stock .worktrees/ convention, init patches every standalone occurrence to .claude/worktrees/ (via skills/init/unify-worktree-path.sh). This eliminates the dualism where bd worktree create and /ticket-flow:pickup would otherwise write to different directories. Idempotent.
  • git config beads.role maintainer — set once so bd calls stop printing the warning: beads.role not configured (GH#2950) noise.

Idempotent re-runs: re-running is a no-op — existing scaffold files are kept, only missing scaffold targets get added.

KANBAN.md migration: a project with a legacy KANBAN.md (with or without an old mode=kanban flag) gets every row imported into bd and the file archived — the one supported way in. There is no reverse migration.

Steps

0. Reject the removed mode, detect a legacy flag

for arg in "$@"; do
  [[ "$arg" == "--mode=kanban" ]] && {
    echo "ERROR: mode=kanban was removed — tf is beads-only. Run /ticket-flow:init (imports an existing KANBAN.md into bd); the old dual-mode code is at refs/archive/mode-kanban." >&2
    exit 1; }
done
# A leftover flag from the dual-mode era: the migration below handles it;
# it is deleted in step 2b. `mode=beads` flags are simply removed too — the
# flag has no reader anymore.

1. Shared scaffolding

For every target in the shared list, check existence in cwd → either copy from $CLAUDE_PLUGIN_ROOT/skills/init/templates/<file> or log [exists, skipped]. Same for empty dirs (mkdir -p, plus .gitkeep in docs/superpowers/plans/).

PLUGIN="${CLAUDE_PLUGIN_ROOT:?CLAUDE_PLUGIN_ROOT is not set — re-run from a Claude Code session with the ticket-flow plugin installed.}"
TEMPLATES="$PLUGIN/skills/init/templates"

declare -a CREATED=()
declare -a SKIPPED=()

scaffold_file() {
  local src="$1" dst="$2"
  if [[ -e "$dst" ]]; then
    SKIPPED+=("$dst")
  else
    mkdir -p "$(dirname "$dst")"
    cp "$src" "$dst"
    CREATED+=("$dst")
  fi
}

scaffold_dir() {
  local dst="$1"
  if [[ -d "$dst" ]]; then
    SKIPPED+=("$dst/")
  else
    mkdir -p "$dst"
    CREATED+=("$dst/")
  fi
}

scaffold_file "$TEMPLATES/SPEC-TEMPLATE.md" "./docs/specs/SPEC-TEMPLATE.md"
scaffold_dir  "./docs/superpowers/plans"
if [[ ! -f "./docs/superpowers/plans/.gitkeep" ]]; then
  touch "./docs/superpowers/plans/.gitkeep"
  CREATED+=("./docs/superpowers/plans/.gitkeep")
fi
scaffold_dir  "./.claude/worktrees"

1b. Routing rule

Install .claude/rules/ticket-flow-routing.md so any planning, ideation, bug, or change-request prompt routes through tf (bd create + /ticket-flow:spec) instead of falling back to superpowers:brainstorming or superpowers:writing-plans. Runs for both modes. Delegates to skills/init/install-routing-rule.sh.

Why a rule and not the project's CLAUDE.md: .claude/rules/ is the documented place for this. Every .md below it is discovered recursively, and a rule without a paths: frontmatter key is loaded at launch with the same priority as .claude/CLAUDE.md — so the routing instruction carries the same weight it did before, while the consumer's own CLAUDE.md stays untouched. It is also the less invasive shape: one file that belongs to tf, trivially overridden or deleted by the user, and no merge conflict with whatever the project already keeps in CLAUDE.md.

No TodoWrite / TaskCreate ban: the old block forbade both. Dead rule — the native task tools are switched off on the current models since CC 2.1.233, so the prohibition protected against nothing while costing context on every launch.

case "$("$PLUGIN/skills/init/install-routing-rule.sh")" in
  created)  CREATED+=(".claude/rules/ticket-flow-routing.md") ;;
  migrated) CREATED+=(".claude/rules/ticket-flow-routing.md (moved out of CLAUDE.md)") ;;
  no-op) ;;  # rule already present — silent
esac

1c. Worktree readiness

Both modes create a worktree per ticket, and a worktree is a fresh checkout: nothing gitignored comes along. Without this step the implementing session gets a tree with no .env and no node_modules, the app refuses to start, and the failure reads like a code problem. Claude Code has two mechanisms for it; init wires up both, from what the repo actually contains rather than from a guess.

Copy local config into every worktree — .worktreeinclude at the repository root, gitignore syntax, one pattern per line. Only files that match a pattern and are gitignored are copied, so tracked files are never duplicated (worktree docs). skills/init/install-worktree-include.sh seeds it with the local-config files that exist here and that git check-ignore confirms are ignored (.env*, *.local, .npmrc, credentials.json, .claude/settings.local.json, …); a project with none of them gets no file. Existing lines are never reordered or dropped.

Caveat: a project with a custom WorktreeCreate hook (non-git VCS) does not get .worktreeinclude processing — that hook has to copy the files itself.

Share dependency directories instead of reinstalling them — worktree.symlinkDirectories in .claude/settings.json links each worktree's directory back to the main checkout's copy (large-codebases docs). skills/init/set-worktree-symlinks.sh records the dependency dirs that exist and are gitignored (node_modules, vendor, Pods, .venv, …). Build outputs are deliberately excluded (target/, .next/, build/): build tools lock and rewrite those, and one shared build cache across two parallel worktree agents is a corrupted build cache.

ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"

case "$("$PLUGIN/skills/init/install-worktree-include.sh" "$ROOT")" in
  created) CREATED+=(".worktreeinclude (local config copied into worktrees)") ;;
  patched) CREATED+=(".worktreeinclude (patched: new local config files)") ;;
  no-op|none-detected|no-git) ;;  # nothing gitignored worth copying — silent
esac

case "$("$PLUGIN/skills/init/set-worktree-symlinks.sh" "$ROOT")" in
  created) CREATED+=(".claude/settings.json (worktree.symlinkDirectories)") ;;
  patched) CREATED+=(".claude/settings.json (patched: worktree.symlinkDirectories)") ;;
  no-op|none-detected|no-git) ;;  # no shared dependency dirs — silent
esac

$ROOT is the git root.

2b. Beads path

Prerequisite: current directory is a git repo (git rev-parse --git-dir exits 0). If not, abort with hint to git init first. .beads/ must not already exist; if it does, abort with hint to remove it first (don't silently re-init).

Pick agents-template mode — scan "$@" for --skip-agents:

  • Present → skip-agents mode. Pass --skip-agents straight to bd init (no AGENTS.md, no BEADS INTEGRATION block in CLAUDE.md).
  • Absent → custom-template mode. Verify $CLAUDE_PLUGIN_ROOT/templates/beads-agents-no-anti-memory.md exists. Missing → warn and fall back to vanilla bd init (the cherry-pick isn't complete).
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
TEMPLATE="$PLUGIN/templates/beads-agents-no-anti-memory.md"

# Strip --mode / --beads from the passthrough so we don't pass them to bd init.
declare -a BD_ARGS=()
SKIP_AGENTS=0
for arg in "$@"; do
  case "$arg" in
    --mode=*|--beads) ;;                         # consumed by step 0
    --skip-agents)    SKIP_AGENTS=1; BD_ARGS+=("$arg") ;;
    *)                BD_ARGS+=("$arg") ;;
  esac
done

# Build the bd init command.
if (( SKIP_AGENTS )); then
  bd init "${BD_ARGS[@]}"
elif [[ -f "$TEMPLATE" ]]; then
  bd init --agents-template "$TEMPLATE" "${BD_ARGS[@]}"
else
  echo "⚠ custom template missing at $TEMPLATE — falling back to vanilla bd init (anti-MEMORY clause will be injected)" >&2
  bd init "${BD_ARGS[@]}"
fi

Set the beads role (right after bd init) — without it, every subsequent bd call prints warning: beads.role not configured (GH#2950): two noise lines per call that cost context and pollute grep/jq parsing in skill scripts. Setting is idempotent:

git config beads.role maintainer

Verify after init:

  • Skip-agents mode → no AGENTS.md in cwd; CLAUDE.md does not contain a BEADS INTEGRATION block.
  • Custom-template mode → AGENTS.md does NOT contain the string do NOT use MEMORY.md.

If either check fails, warn the user — the flag wasn't honored by bd init.

One-time KANBAN.md → beads migration (when KANBAN.md exists):

if [[ -f "$ROOT/KANBAN.md" ]]; then
  # a. Import every row into bd. kanban-import.sh is idempotent
  #    (skips kanban-N labels already in bd).
  ( cd "$ROOT" && "$PLUGIN/skills/kanban/kanban-import.sh" )
  # b. Archive the old board — the workflow never reads KANBAN.md again.
  mv "$ROOT/KANBAN.md" "$ROOT/KANBAN.archived.md"
fi

# c. Remove a legacy mode flag — nothing reads it anymore.
if [[ -e "$ROOT/.ticket-flow" ]]; then
  rm "$ROOT/.ticket-flow"
  CREATED+=("(removed legacy .ticket-flow flag)")
fi

The archived board can be regenerated on demand from bd state with /ticket-flow:board.

Install the bd prime override — vanilla bd re-emits its own guidance (including the anti-MEMORY.md clause) at runtime through the SessionStart and PreCompact hooks, where no generated file can reach it. Since bd 0.44.0 a .beads/PRIME.md replaces that output wholesale. init installs tf's template; an existing PRIME.md is never overwritten. Two consequences worth knowing: the file is also what a session sees after a compaction, so it must carry the state-recovery commands, and on bd < 1.2.2 the override hides bd remember entries from prime (confirmed on 1.0.4, fixed in 1.2.2).

case "$("$PLUGIN/skills/bd-detox/install-prime.sh" "$ROOT")" in
  created) CREATED+=(".beads/PRIME.md (bd prime override)") ;;
  no-op|no-beads|no-template) ;;  # present, or nothing to install into — silent
esac

Unify worktree convention — bd has no hard default for bd worktree create; the .worktrees/ location is just a convention documented in stock beads rules files. tf's convention is .claude/worktrees/. To prevent a dualism where manual bd worktree create and /ticket-flow:pickup write to different directories, init delegates to skills/init/unify-worktree-path.sh to patch every standalone .worktrees/ reference in .claude/rules/beads-workflow.md. The helper is idempotent — repeat runs on already-patched (or absent) files are no-ops.

case "$("$PLUGIN/skills/init/unify-worktree-path.sh" "$ROOT")" in
  patched) CREATED+=(".claude/rules/beads-workflow.md (patched: .worktrees/ → .claude/worktrees/)") ;;
  no-op|no-file) ;;  # nothing to change or file absent — silent
esac

Pin the worktree base ref — Claude Code resolves worktree.baseRef to origin/<default-branch> unless the project says otherwise. ticket-flow never pushes (finish and flow leave commits local, /ticket-flow:push is the user's separate step), so with the default every dispatched worktree agent forks from a base that is behind local HEAD by each merge since the last push — the merge succeeds, the earlier work is just missing. init pins it to head. Every other key in .claude/settings.json is preserved; repeat runs are no-ops. skills/flow/check-worktree-base.sh enforces the same invariant at dispatch time.

case "$("$PLUGIN/skills/init/set-worktree-baseref.sh" "$ROOT")" in
  created) CREATED+=(".claude/settings.json (worktree.baseRef=head)") ;;
  patched) CREATED+=(".claude/settings.json (patched: worktree.baseRef=head)") ;;
  no-op) ;;  # already pinned — silent
esac

Report

Fresh:

✓ ticket-flow + beads initialized in <cwd>:
  [created] .beads/ (bd init …)
  [set] git config beads.role maintainer
  [created] docs/specs/SPEC-TEMPLATE.md
  [created] docs/superpowers/plans/
  [created] .claude/rules/ticket-flow-routing.md

bd initialized with tf custom template — Auto-Memory + bd remember coexist.
(Or, with --skip-agents: no AGENTS.md, no BEADS INTEGRATION block in CLAUDE.md.)
.beads/PRIME.md installed — bd prime emits that file instead of its built-in text.

Next steps:
1. bd create --title="…" --description="…" --type=feature
2. /ticket-flow:spec <id> for the spec
3. /ticket-flow:pickup <id> for worktree + branch

Migration (legacy KANBAN.md found):

✓ ticket-flow migrated to beads in <cwd>:
  Migrated <N> item(s) from KANBAN.md into bd.
  [renamed] KANBAN.md → KANBAN.archived.md
  [removed] legacy .ticket-flow flag
  [created] .beads/
  [created] .claude/rules/ticket-flow-routing.md (moved out of CLAUDE.md)

Use /ticket-flow:board to regenerate a static KANBAN.md snapshot from bd on demand.

Edge cases

  • Nothing gitignored worth copying: install-worktree-include.sh writes no .worktreeinclude at all rather than an empty stub, and set-worktree-symlinks.sh leaves worktree.symlinkDirectories unset. Re-run init after adding a .env and it is picked up then.
  • Hand-maintained .worktreeinclude / symlinkDirectories: only missing entries are appended; existing lines and manual entries are never reordered or removed.
  • Not in a git repo: abort with hint — bd init requires a git repo. Run git init first.
  • Existing .beads/ (beads mode): abort with hint — bd reinit or remove first; don't silently re-init.
  • Existing .ticket-flow flag (legacy dual-mode artifact): removed in step 2b — nothing reads it anymore. A mode=kanban flag together with a KANBAN.md marks an unmigrated project; the migration in step 2b handles it.
  • Cwd is not project root: init runs in cwd unconditionally. Caller is responsible for cd into the right directory first.
  • Plugin root not resolvable: ${CLAUDE_PLUGIN_ROOT} is set by Claude Code when the skill is loaded. The ${VAR:?} guard fails fast with an explanatory message if it isn't set.
  • Custom template missing (beads mode, no --skip-agents): warn and fall back to vanilla bd init. User can run /ticket-flow:bd-detox afterward to clean up the anti-MEMORY clause.
  • .claude/rules/beads-workflow.md references .worktrees/ (beads mode): init patches every standalone occurrence to .claude/worktrees/ so bd worktree create and /ticket-flow:pickup end up in the same directory. Embedded paths like /some/other/.worktrees/foo (preceded by / or an alphanumeric) are left untouched. Idempotent — no change if the file is missing or already on the tf convention.
  • Existing CLAUDE.md (both modes): untouched — the routing instruction lives in .claude/rules/ticket-flow-routing.md. The one exception is a legacy routing block written by an older init: init removes it (marker-delimited, surrounding content preserved) so the instruction does not exist twice, and reports migrated.
  • Hand-edited routing rule: never overwritten — the rule file's existence is the idempotency guard. Delete the file to get tf's version back on the next init; that is also the intended opt-out.

What it doesn't do

  • Add a git remote (project may or may not be on GitHub — use /ticket-flow:publish for that)
  • Configure plugin settings (those live in .claude-plugin/plugin.json, not in the user project)
  • Create a sample item
  • Provide a KANBAN.md-backed mode — mode=kanban was removed (refs/archive/mode-kanban); the only KANBAN.md tf still writes is the on-demand /ticket-flow:board snapshot

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.