agentleFS
GuiMoraesDevGuiMoraesDev/taskflow/skills/init-workflow/SKILL.md

init-workflow

Skill1 starsChanged 24 days agoMITView on GitHub

Set up the plan-and-task workflow in a repo that does not have it yet - writes .claude/workflow.json from the repo's real scripts and layout, asks which model takes each difficulty tier and the pull-request conventions (branch and title prefixes, labels, assignee, stacking, parallel runs), and adds the workflow section to CLAUDE.md. Use when installing this plugin into a new project, or when the gate commands, the model tiers or the docs checklist have drifted. Safe to re-run - an existing config is reconciled, never overwritten.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. nils-fl/AgenticCodingInit★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Every other skill in this plugin reads .claude/workflow.json.

    line 8
  2. Very specific:

    Read .claude/workflow.json and .claude/workflow.env before anything else.

    line 12
  3. Distinctive:

    Run the detection in step 1 anyway, then report both files' current values beside what you found, and ask a single question: keep the …

    line 16
  4. Very specific:

    Ask with its own AskUserQuestion call, one option each:

    line 76
  5. Distinctive:

    Every task in a plan declares a difficulty tier, and the tier binds the runner: whoever takes the task switches to that model first.

    line 97
  6. Distinctive:

    If the owner dismisses either ask, take the recommended options, say in your report that you did, and name the file to edit.

    line 142
  7. Distinctive:

    Ask, recommending by what you found in step 1:

    line 151
  8. Distinctive:

    When they are kept, two more values follow from the format rather than from another question - state which you inferred:

    line 159
  9. Very specific:

    If they choose None, say plainly what turns off: docs-sync skips its diagram section, and the docs-diagram-auditor agent checks prose only.

    line 167
  10. Distinctive:

    Every pull request this workflow opens carries a branch name, a title, labels and an assignee, and a repo that already has a house style …

    line 172
  11. Very specific:

    Leave projectsDir as step 1 found it, whatever the plan source.

    line 242
  12. Very specific:

    Write "aiSignature": false unless the owner asked for AI attribution in commits.

    line 252
  13. Very specific:

    Dependency direction: - if the repo has directional layers, add the lint rule that fails the import (no-restricted-imports or the …

    line 302

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

init-workflow

Every other skill in this plugin reads .claude/workflow.json. This skill writes it.

0. If the config already exists, this is a re-run

Read .claude/workflow.json and .claude/workflow.env before anything else. When either is there, the owner has already answered - never re-ask from scratch and never silently overwrite.

Run the detection in step 1 anyway, then report both files' current values beside what you found, and ask a single question: keep the config as it stands, or change it.

What you foundWhat to do
Detection agrees with the fileSay so and stop. A re-run that changes nothing is the expected outcome
Detection found drift - a renamed script, a doc that no longer exists, a new diagram folderList each difference as current -> found and ask which to keep, per field
The owner wants a tier, the diagram decision, the plan source or a pull-request convention changedRe-ask only those questions, carrying the current value as the first option, labelled (current)

Preserve every field you were not asked to change, including any the owner hand edited after the last run. Write the file only once the answers are in.

1. Detect, do not assume

FieldHow to fill it
projectsDirAn existing plan folder if the repo has one (docs/projects, .planning, or wherever plans already live); otherwise docs/projects. Whether plans live there or in an Obsidian vault is asked - see below
gatesRead package.json scripts, or the Makefile, justfile, Cargo.toml, pyproject.toml. Map lint / types / unit / e2e to the script names that exist. Omit a gate the repo has no script for - never invent one
e2eTriggerPathsThe paths whose changes need the slow suite. Ask if it is not obvious
docsChecklistOne row per doc that must stay true, each with what it owns. Read the repo's docs before writing rows
decisionsWhere the repo keeps decision records and its glossary, if it keeps either. Detect, do not create - see below
diagramsNot yours to decide. Ask - step 3. Find the candidates first, excluding copies: see the command below
pullRequestsThe conventions - prefixes, labels, assignee, stack, parallel runs - are asked in step 4, from what the history shows. maxLines 400 (the code budget) and maxTotalLines 600 (code plus codeExcludes) unless the owner names others. codeExcludes: the repo's real test globs (read the test runner's config) and its doc paths - listed paths, never all *.md, since a plugin's skills are markdown and count as code; default **/*.test.*, **/*.spec.*. excludeFromCount: its lockfile and any snapshot or generated folder, counted toward neither budget - so the code budget measures what a reviewer reasons about
commitTypesConventional-commit types the repo already uses - check git log --format=%s -n 40
modelsNot detectable. Ask - step 2.

Find diagram candidates with git ls-files, not find - it already excludes build output, dependencies and the untracked worktree copies that otherwise triple the count:

git ls-files '*.excalidraw' '*.drawio' '*.mmd' '*.d2' '*.puml'

decisions - detect only

decisions.adrDir is where a hard decision goes when it is worth keeping past the plan folder, and decisions.glossary is the doc whose vocabulary the plan should use. Both are pointers to places the repo already has:

git ls-files | grep -iE '(^|/)(adr|decisions)/|(^|/)(CONTEXT|GLOSSARY)\.md$'

Record what you find and omit what you do not. Creating an ADR folder for a repo that does not keep one is a practice decision, and it belongs to the owner - say in your report that the key is unset and what that costs: a hard decision made during a plan lives only in the gitignored plan folder and is lost with it.

Where plans live - ask

The rule is in plan-start's Where plans live. The repo folder stays the default source of truth; a vault is the owner's choice. List the vaults this machine knows:

jq -r '.vaults[].path' "$HOME/Library/Application Support/obsidian/obsidian.json"

Ask with its own AskUserQuestion call, one option each:

  • the repo folder - projectsDir from above - labelled (Recommended);
  • each vault found - label the folder basename, description the path. With no obsidian.json, offer none;
  • an absolute vault path, typed through Other.

On a vault, a follow-up asks the path inside it, default taskflow/<repo-name>.

Then tell the owner how the Obsidian setup works, in a few lines:

  • .claude/workflow.env holds the machine-specific keys and is never committed; projectsDir in workflow.json keeps the repo folder.
  • TASKFLOW_PLANS_SOURCE picks the source of truth - repo unless it says obsidian. Only that source is read.
  • Plan files in the vault are written by absolute path, which prompts every time. Adding the vault to permissions.additionalDirectories in .claude/settings.local.json stops that - offer to do it.

2. Ask which model takes each tier

Every task in a plan declares a difficulty tier, and the tier binds the runner: whoever takes the task switches to that model first. So the mapping has to be the repo owner's decision, not yours - it is their cost and latency budget.

Ask before writing the config. One AskUserQuestion call carries all four questions - these three plus step 3's - so the owner answers once. Put the recommended option first and label it (Recommended). On a re-run (step 0), ask only the questions being changed, and make the current value the first option labelled (current).

TierWhat lands hereRecommendAlso offer
🧠 deepCrosses module boundaries; touches the subsystem where a mistake is expensive. Plans, sequencing, PR splits and findings also run hereopusfable, sonnet
⚙️ surfaceOne layer, one view, one service, one spec. The bulk of a plansonnetopus, haiku
🔧 mechanicalProven by the gates alone: rename, copy fix, version bump, dependency bumphaikusonnet, a Codex model

Say what each choice costs in the option description, so the answer is informed:

  • deep → opus - the default. Reach for sonnet here only in a small or low-risk repo where nothing crosses module boundaries.
  • surface → sonnet - moving this to opus is the common upgrade for a repo with strict standards; moving it to haiku reliably produces work that fails the standards review.
  • mechanical → haiku - safe precisely because the gates, not the model, decide whether the task is done. If the repo has no unit suite, there are no gates to lean on: recommend sonnet instead and say why. Offer a Codex model, such as gpt-6-luna, only when the Codex plugin is installed: the tier then runs through codex:codex-rescue, gate-runner included.

The 🙋 human tier is fixed and takes no model - a merge, a login, a credential. It exists so those steps are tracked rather than assumed.

The mapping drives this plugin's agents too, not just task rows: plan-architect and standards-reviewer run on deep, docs-diagram-auditor on surface, gate-runner on mechanical. So an answer here is a standing cost decision, not a per-task one.

Four questions is the cap on one AskUserQuestion call, and the three tiers plus step 3 fill it. So one thing you cannot infer needs a second, separate ask: which subsystem makes a task deep in this repo. Propose the answer from what you read (the module with the most cross-cutting state, the one the tests mock everywhere) and let the owner correct it - a plain question in your reply is enough, it does not need its own tool call. It goes into the CLAUDE.md section as the 🧠 row's scope.

If the owner dismisses either ask, take the recommended options, say in your report that you did, and name the file to edit. Do not stall the setup on it.

3. Ask whether this repo keeps diagrams

A diagram is a real maintenance cost, and a repo that will not pay it is better off with none than with a stale one. So the owner decides - not you, and not the mere presence of a file.

Ask, recommending by what you found in step 1:

AnswerRecommend it whenConfig
Maintain themDiagram files already exist and look current{ "maintain": true, "glob": "...", "format": "...", "editedBy": "..." }
Adopt themNo diagram files, but the owner wants the practice from now on. Agree the folder and format before writing the globsame, with the agreed glob
NoneNo diagram files, or the ones you found are stale and unloved{ "maintain": false }

When they are kept, two more values follow from the format rather than from another question - state which you inferred:

  • format: excalidraw, drawio, mermaid, d2, plantuml.
  • editedBy: human for canvas formats (excalidraw, drawio) - an agent can read labels but a text edit changes no layout, so it overflows the box. agent for text formats (mermaid, d2, plantuml), which diff and render like source.

If they choose None, say plainly what turns off: docs-sync skips its diagram section, and the docs-diagram-auditor agent checks prose only.

4. Ask the pull-request conventions

Every pull request this workflow opens carries a branch name, a title, labels and an assignee, and a repo that already has a house style rejects one that ignores it. Those conventions are the owner's, so ask - but read the history first, so each question carries the answer the repo already gives:

gh pr list --state merged -L 30 --json title,headRefName,labels,assignees
gh label list -L 100 --json name
git branch -r --format='%(refname:short)' | head -40

Without gh or a GitHub remote, read the branch names alone and say the rest went undetected.

Then look for a stacking tool. A stack is a chain of pull requests, each based on the one below it, that the tool rebases and submits together:

ToolDetected byOpens a branch on the stackSubmits
Graphitegt on PATH and .git/.graphite_repo_configgt create <branch> -m "<message>"gt submit --stack --draft
git-towngit config --get-regexp '^git-town\.' prints a linegit town append <branch>git town propose

Another stacking tool in use - spr, ghstack, Sapling - is recorded by name with the commands the owner gives you. A tool installed but never configured for this repo is not in use.

A second AskUserQuestion call carries the first four questions, and a third carries what follows from them - the cap is four per call. Recommend what the history shows; when it shows nothing, recommend the plain option.

#QuestionOptionsConfig
1Does a branch name carry a prefix?None - <type>/<slug> · the prefix the history shows, such as gm/ or {ticket}/ · OtherbranchPrefix
2Does a pull-request title carry a prefix?None - the conventional title as is · the prefix the history shows, such as [{ticket}] · OthertitlePrefix
3Which labels does a pull request get?By commit type, mapped to the labels that exist (fix → bug) · one fixed set on every pull request · Nonelabels.byType, labels.always
4Is the owner assigned to every pull request?Yes - --assignee @me · NoassignOwner

The third call:

#Asked whenQuestionOptionsConfig
5Question 3 chose labelsA label is not in the repo when a pull request opens. Create it, or ask which existing one to use instead?Ask (Recommended) - a label created by an agent is noise every other pull request inherits · Createlabels.onMissing: ask, create
6A stacking tool was detectedIs the stack the standard?Stack the pull requests that depend on each other (Recommended) · stack every pull request in a plan, one chain · Do not use the stack - plain branches with a basestack: { "tool": "graphite", "scope": "dependent" }, "scope": "all", or null
7AlwaysWhen a plan has pull requests that do not depend on each other - outside any stack - may their tasks run in parallel subagents?No (Recommended) - one task at a time, the owner's attention on one diff · Yes - one subagent per pull request, each in its own worktreeparallel: false, true

{ticket} in a prefix is a placeholder: the plan records each pull request's ticket, and a pull request without one gets a question at its first task. A prefix that is the same on every pull request is written literally.

Say what the parallel answer costs in its option. The subagents' work runs at once, but every owner stop - the sitting and the hard stops after it - stays in the main session, one pull request at a time. It saves wall time on the writing and the gates, not attention.

On a re-run, ask only the conventions being changed, the current value first and labelled (current). If the owner dismisses an ask, take the recommended options and say so in the report.

5. Write .claude/workflow.json

examples/workflow.example.json is the shape. Every value in it is a placeholder - replace all of them with what steps 1 to 4 found. On a re-run, start from the file that is already there and change only the fields step 0 settled. Record the model answers as the aliases the harness accepts, or as the Codex model id when a tier runs on Codex:

"models": { "deep": "opus", "surface": "sonnet", "mechanical": "haiku" }

Leave projectsDir as step 1 found it, whatever the plan source.

On a vault choice, write .claude/workflow.env with only the keys plan-start allows: TASKFLOW_PLANS_SOURCE=obsidian, TASKFLOW_OBSIDIAN_VAULT=<basename> for a listed vault whose basename no other vault shares, or TASKFLOW_OBSIDIAN_VAULT_PATH=<path> for a typed one or a shared basename, and TASKFLOW_OBSIDIAN_PATH=<inner path>. On a re-run, change only the keys asked about; moving back to the repo sets TASKFLOW_PLANS_SOURCE=repo and keeps the vault keys. Make sure .claude/.gitignore exists and lists workflow.env.

Write "aiSignature": false unless the owner asked for AI attribution in commits. It is the switch for every Co-Authored-By trailer and "Generated with" line the workflow writes, and a missing key means false.

Gitignore the per-project plan folders - skip this for a vault source, which is outside the repo. Plans are working documents: committing them invites code and commit messages to cite them, and a citation to a gitignored file points at nothing.

The negation is per file, not per folder, so list every committed file that lives under projectsDir - the templates, and any flow or convention doc kept there. Check with git ls-files <projectsDir> before writing the rule, and verify it after with git check-ignore -v <a committed doc>, which must print nothing.

<projectsDir>/
!<projectsDir>/examples/
!<projectsDir>/examples/SCOPE.md
!<projectsDir>/examples/TASKS.md
!<projectsDir>/examples/QUESTIONS.md
!<projectsDir>/examples/PROGRESS.md
!<projectsDir>/<any other committed doc>

Skip the whole step when projectsDir is already ignored - re-running this skill must not append a second copy of the rule.

6. Put the workflow section in CLAUDE.md

Read CLAUDE.md first. A repo that already describes a workflow gets reconciled, not appended to - a second, subtly different account of the cycle is worse than none, because a reader has no way to tell which one binds.

What you findWhat to do
No workflow sectionAppend templates/CLAUDE-workflow-section.md, filled in
A workflow section that matches the pluginLeave it. Add only what is missing - typically the tier table and the .claude/workflow.json pointer
A workflow section that contradicts the pluginChange nothing. Report each conflict as a question: which one is meant to bind. The repo's own text wins until the owner says otherwise
The workflow lives in its own docDo not copy it into CLAUDE.md. Point at that doc, and say so in your report

Fill in the detected commands, the answers from steps 2 and 3, and the docs the repo actually has. Drop the diagram line when diagrams are off. Do not restate the plugin's skill bodies - CLAUDE.md carries the repo's rules, the plugin carries the procedure.

7. Enforce what prose cannot

A prose invariant rots the first time someone edits without reading it.

  • Dependency direction - if the repo has directional layers, add the lint rule that fails the import (no-restricted-imports or the equivalent), rather than a paragraph asking for it.
  • Commit and command discipline - the plugin's hooks stop and ask the owner before --no-verify, git add -A, bare npx-style invocations of the gate binaries, branch deletes/renames, force pushes and any other git force flag. A git force flag is refused outright unless the call's description says why force is needed. Confirm they are active with /hooks.

Report the tier mapping, the diagram decision and the pull-request conventions that were chosen, which gates were detected, which were missing, where plans live, and what you gitignored.

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.