Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions global/claude-md-section.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Rules:
- run state: `runs/iss-N.json`

Give subagents absolute paths, never pasted content.
- **Working directory:** workflows run from the main checkout and reach a worktree with `git -C` or a subshell `(cd … && …)`, never a bare `cd`.
- **Repo conventions** (tracker, domain docs): `<repo>/.devflow/agents/`.
- **Domain docs:** the glossary is `docs/GLOSSARY.md` and ADRs are in `docs/adr/`. Any skill that mentions `GLOSSARY.md` means `docs/GLOSSARY.md`.
- **Test reporting:** name every failure, and separate new failures from pre-existing ones.
Expand Down
10 changes: 5 additions & 5 deletions owned/dev-multi/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Arguments: `$ARGUMENTS`
- **Allowed flags:** `--fast`, `--rigor`, `--auto`. `--fast` and `--rigor` are mutually exclusive.
- Any other token starting with `-` → reply `Unknown flag <token>. /dev-multi accepts --fast, --rigor, --auto.` and **stop**.
- Both `--fast` and `--rigor` → say so and stop.
- A token matching `#<digits>` means **resume or upgrade issue N**. Everything else is the feature description.
- **Resume or upgrade issue N** only when the sole non-flag argument is `#N`; otherwise the non-flag text is the description, and issue numbers in it are references.
- No description and no `#N` → ask for a one-line feature description and stop.
- **Mode:**
- `--fast` → FAST: every ticket's lane is pre-filled `fast`.
- `--rigor` → RIGOR: every ticket's lane is pre-filled `rigor`.
- Neither → MIXED: lanes are proposed per ticket.
- Neither → MIXED (lanes proposed per ticket) for a new run or upgrade; a `#N` resume keeps its recorded mode (MIXED if none).
- **`--auto`:** the user's permission for this run to make the calls it would otherwise stop for. Follow `align`'s [AUTO.md](../align/AUTO.md).
- State the mode in one line before doing anything else, adding `, AUTO` when auto mode is on.
- State the mode in one line first (on `#N`, once the state file is read), adding `, AUTO` when auto mode is on.

**Resuming (`#N`):** follow the Resume section of the `align` skill, whose report states the changes below; then make them and continue from the recorded stage. If the mode differs from the state file's, update it. A mode change only re-labels tickets that are still `open`. `--auto` turns auto mode on from the current stage. If the state has `auto: true` and this invocation lacks `--auto`, reset it to `false`.
**Resuming (`#N`):** follow the Resume section of the `align` skill, whose report states the changes below; then make them and continue from the recorded stage. Only `--fast` or `--rigor` changes the mode, re-labelling only tickets still `open`. `--auto` turns auto mode on from the current stage. If the state has `auto: true` and this invocation lacks `--auto`, reset it to `false`.

**Upgrading from `/dev-single`:** if the state file says `dev-single` and no build has started, switch it to `dev-multi` and continue at step 3.
**Upgrading from `/dev-single`:** if the state file says `dev-single` and no build has started, switch it to `dev-multi` (MIXED with no flag) and continue at step 3.

## 2. Align

Expand Down
8 changes: 4 additions & 4 deletions owned/dev-single/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Arguments: `$ARGUMENTS`

## 1. Parse arguments (strictly)

- **Allowed flags:** `--fast` (the default mode, accepted for symmetry with `/dev-multi`), `--rigor`, `--auto`. `--fast` and `--rigor` are mutually exclusive.
- **Allowed flags:** `--fast` (the default for a new run, accepted for symmetry with `/dev-multi`), `--rigor`, `--auto`. `--fast` and `--rigor` are mutually exclusive.
- Any other token starting with `-` (for example `--rigour`) → reply `Unknown flag <token>. /dev-single accepts --fast, --rigor, --auto.` and **stop**.
- Both `--fast` and `--rigor` → say so and stop.
- **`--auto`:** the user's permission for this run to make the calls it would otherwise stop for. Follow `align`'s [AUTO.md](../align/AUTO.md).
- A token matching `#<digits>` means **resume or upgrade issue N**. Everything else is the feature description.
- **Resume or upgrade issue N** only when the sole non-flag argument is `#N`; otherwise the non-flag text is the description, and issue numbers in it are references.
- No description and no `#N` → ask for a one-line feature description and stop.
- Before doing anything else, state the mode in one line, for example: `/dev-single, FAST mode, new feature: "<description>"`, `/dev-single, FAST mode, AUTO, new feature: "<description>"` or `/dev-single, RIGOR mode, resuming #42`.
- State the mode in one line first (on `#N`, once the state file is read), for example: `/dev-single, FAST mode, new feature: "<description>"`, `/dev-single, FAST mode, AUTO, new feature: "<description>"` or `/dev-single, RIGOR mode, resuming #42`.

**Resuming (`#N`):** follow the Resume section of the `align` skill, whose report states the changes below; then make them and continue from the recorded stage.
- If the state file's `mode` differs from this invocation's mode, update it.
- A flagless resume keeps the recorded mode (FAST if none or MIXED); only `--fast` or `--rigor` changes it.
- `--auto` turns auto mode on from the current stage. If the state has `auto: true` and this invocation lacks `--auto`, reset it to `false`.
- If the run already has tickets (it was a `/dev-multi` run), stop and tell the user to continue with `/dev-multi #N`.

Expand Down
14 changes: 7 additions & 7 deletions patches/domain-modeling.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff -ruN a/ADR-FORMAT.md b/ADR-FORMAT.md
--- a/ADR-FORMAT.md 2026-10-21 14:32:12
+++ b/ADR-FORMAT.md 2026-10-21 16:51:15
--- a/ADR-FORMAT.md 2026-10-24 03:21:40
+++ b/ADR-FORMAT.md 2026-11-04 01:16:47
@@ -1,6 +1,6 @@
# ADR Format

Expand All @@ -19,14 +19,14 @@ diff -ruN a/ADR-FORMAT.md b/ADR-FORMAT.md
## When to offer an ADR

diff -ruN a/GLOSSARY-FORMAT.md b/GLOSSARY-FORMAT.md
--- a/GLOSSARY-FORMAT.md 2026-10-21 14:32:12
+++ b/GLOSSARY-FORMAT.md 2026-10-21 16:51:15
--- a/GLOSSARY-FORMAT.md 2026-10-24 03:21:40
+++ b/GLOSSARY-FORMAT.md 2026-11-04 01:16:50
@@ -31,7 +31,7 @@

## Single vs multi-context repos

-**Single context (most repos):** One `GLOSSARY.md` at the repo root.
+**Single context (most repos):** One `docs/GLOSSARY.md` (devflow layout). Its top heading is the repo name, never a feature-specific context name.
+**Single context (most repos):** One `docs/GLOSSARY.md` (devflow layout). When creating it, make its top heading the GitHub repo name (`gh repo view --json name -q .name`), never a feature-specific context name. Never rename an existing heading.

**Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:

Expand All @@ -41,8 +41,8 @@ diff -ruN a/GLOSSARY-FORMAT.md b/GLOSSARY-FORMAT.md

When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
diff -ruN a/SKILL.md b/SKILL.md
--- a/SKILL.md 2026-10-21 14:32:12
+++ b/SKILL.md 2026-10-21 16:52:24
--- a/SKILL.md 2026-10-24 03:21:40
+++ b/SKILL.md 2026-11-04 01:16:47
@@ -13,11 +13,11 @@

```
Expand Down
19 changes: 14 additions & 5 deletions patches/finishing-a-development-branch.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
diff -ruN a/SKILL.md b/SKILL.md
--- a/SKILL.md 2026-10-19 13:08:29
+++ b/SKILL.md 2026-10-19 15:15:10
@@ -48,10 +48,14 @@
--- a/SKILL.md 2026-10-24 03:21:39
+++ b/SKILL.md 2026-11-04 01:33:20
@@ -35,6 +35,8 @@
WORKTREE_PATH=$(git rev-parse --show-toplevel)
```

+Devflow callers run Steps 1–2 in a subshell, `(cd <feature-worktree> && … && echo "$GIT_DIR $GIT_COMMON $WORKTREE_PATH")`, keep the printed values, and stay in the main checkout.
+
This determines which menu to show and how cleanup works:

| State | Menu | Cleanup |
@@ -48,10 +50,14 @@
The base branch is whatever this work forked from — usually named in the
plan, the conversation, or the branch's upstream. If it is not already
known, ask: "This branch split from <your best guess> - is that correct?"
Expand All @@ -17,7 +26,7 @@ diff -ruN a/SKILL.md b/SKILL.md
**Normal repo and named-branch worktree — present exactly these 3 options:**

```
@@ -85,6 +89,8 @@
@@ -85,6 +91,8 @@

### Option 1: Merge Locally

Expand All @@ -26,7 +35,7 @@ diff -ruN a/SKILL.md b/SKILL.md
```bash
# Get main repo root for CWD safety
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
@@ -119,7 +125,7 @@
@@ -119,7 +127,7 @@
```

Then create the pull/merge request against <base-branch> with the forge's
Expand Down
18 changes: 9 additions & 9 deletions patches/subagent-driven-development.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff -ruN a/SKILL.md b/SKILL.md
--- a/SKILL.md 2026-10-21 21:16:54
+++ b/SKILL.md 2026-10-24 01:24:35
--- a/SKILL.md 2026-10-24 03:21:39
+++ b/SKILL.md 2026-11-04 01:33:20
@@ -32,30 +32,8 @@

## When to Use
Expand Down Expand Up @@ -72,7 +72,7 @@ diff -ruN a/SKILL.md b/SKILL.md
Implementer subagents report one of four statuses. Handle each appropriately:

-**DONE:** Generate the review package (`bash scripts/review-package PLAN_FILE BASE HEAD`, from this skill's directory — it prints the unique file path it wrote; BASE is the commit you recorded before dispatching the implementer — never `HEAD~1`, which silently drops all but the last commit of a multi-commit task), then dispatch the task reviewer with the printed path.
+**DONE:** Generate the review package (`bash scripts/review-package PLAN_FILE BASE HEAD "" TEST_COMMIT`, from this skill's directory — it prints the unique file path it wrote; BASE is the commit you recorded before dispatching the implementer — never `HEAD~1`, which silently drops all but the last commit of a multi-commit task), then dispatch the task reviewer with the printed path.
+**DONE:** Generate the review package in a subshell, never a bare `cd` (`(cd <worktree> && bash <this skill's dir>/scripts/review-package PLAN_FILE BASE HEAD "" TEST_COMMIT)` — it prints the unique file path it wrote; BASE is the commit you recorded before dispatching the implementer — never `HEAD~1`, which silently drops all but the last commit of a multi-commit task), then dispatch the task reviewer with the printed path.

**DONE_WITH_CONCERNS:** The implementer completed the work but flagged doubts. Read the concerns before proceeding. If the concerns are about correctness or scope, address them before review. If they're observations (e.g., "this file is getting large"), note them and proceed to review.

Expand Down Expand Up @@ -128,8 +128,8 @@ diff -ruN a/SKILL.md b/SKILL.md
## Common Rationalizations

diff -ruN a/implementer-prompt.md b/implementer-prompt.md
--- a/implementer-prompt.md 2026-10-21 21:16:54
+++ b/implementer-prompt.md 2026-10-24 01:24:35
--- a/implementer-prompt.md 2026-10-24 03:21:39
+++ b/implementer-prompt.md 2026-11-04 01:32:46
@@ -33,11 +33,14 @@

Once you're clear on requirements:
Expand Down Expand Up @@ -169,8 +169,8 @@ diff -ruN a/implementer-prompt.md b/implementer-prompt.md
If BLOCKED or NEEDS_CONTEXT, put the specifics in the final message
itself — the controller acts on it directly.
diff -ruN a/scripts/review-package b/scripts/review-package
--- a/scripts/review-package 2026-10-21 21:16:54
+++ b/scripts/review-package 2026-10-24 01:24:35
--- a/scripts/review-package 2026-10-24 03:21:39
+++ b/scripts/review-package 2026-11-04 01:32:46
@@ -4,30 +4,37 @@
# call. Using the recorded per-task BASE (not HEAD~1) keeps multi-commit
# tasks intact.
Expand Down Expand Up @@ -252,8 +252,8 @@ diff -ruN a/scripts/review-package b/scripts/review-package
git diff -U10 "${base}..${head}"
} > "$out"
diff -ruN a/scripts/task-brief b/scripts/task-brief
--- a/scripts/task-brief 2026-10-21 21:16:54
+++ b/scripts/task-brief 2026-10-24 01:24:35
--- a/scripts/task-brief 2026-10-24 03:21:39
+++ b/scripts/task-brief 2026-11-04 01:32:46
@@ -3,6 +3,9 @@
# implementer reads in one call, so the task text never has to be pasted
# through the controller's context.
Expand Down
3 changes: 3 additions & 0 deletions smoke/CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ What each scenario of a [smoke run](README.md) should show. Re-run after changin
## 5. Resume `/dev-multi #N --rigor` in a fresh session (new label)
- [ ] Resume report: parent #N, stage, mode, ticket table, next step, before any state change
- [ ] Mode switch re-labels open tickets only; pending plan reused
- [ ] Flagless `/dev-multi #N` resume keeps the recorded mode
- [ ] Flagless `/dev-multi #N` on a `/dev-single` run (no build yet) upgrades it as MIXED
- [ ] "Go auto from here" at the plan pause sets `auto` (`auto_source: chat`); the rest runs unattended
- [ ] Opened outside the repo: asks for the repo path, doesn't search the disk

## 6. Flags
- [ ] `/dev-single --rigour <desc>` refused with `Unknown flag --rigour. /dev-single accepts --fast, --rigor, --auto.`; nothing created
- [ ] `/dev-single <desc> --fast --rigor` refused; `--auto-approve-plans` is an unknown flag
- [ ] `/dev-single <desc citing #12>` starts a new run; `#12` is a reference

## 7. `--auto`
- [ ] `/dev-single <desc> --fast --auto`: mode line says AUTO; no questions until the PR opens
Expand Down
86 changes: 86 additions & 0 deletions tests/test_glossary_heading.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""Acceptance tests for #58, ticket #61: a new glossary's top heading is the GitHub repo name.

Black-box, via the sync CLI: build the skills in a SyncSandbox and read the installed
domain-modeling skill. The single-context line ships in the skill's GLOSSARY-FORMAT.md
(next to SKILL.md), so every installed .md file of the skill is searched for it. Every
assertion is scoped to the single-context paragraph (the one starting `**Single context`),
so a phrase elsewhere in the skill can't satisfy it.
"""
import os
import re
import unittest

from tests.harness import SyncSandbox

SKILL_DIR = "~/.claude/skills/domain-modeling"


def _single_context_paragraph(text):
"""The paragraph starting with `**Single context`, up to the next blank line."""
lines = text.splitlines()
for i, line in enumerate(lines):
if line.lstrip().startswith("**Single context"):
para = []
for l in lines[i:]:
if not l.strip():
break
para.append(l)
return "\n".join(para)
return ""


class GlossaryHeadingTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.sb = SyncSandbox()
try:
cls.result = cls.sb.run()
d = cls.sb.home_path(SKILL_DIR)
paras = []
for name in sorted(os.listdir(d)) if os.path.isdir(d) else []:
path = os.path.join(d, name)
if name.endswith(".md") and os.path.isfile(path):
with open(path, encoding="utf-8") as f:
paras.append(_single_context_paragraph(f.read()))
cls.para = "\n\n".join(p for p in paras if p)
except Exception:
cls.sb.close()
raise

@classmethod
def tearDownClass(cls):
cls.sb.close()

def test_sync_succeeds_and_installs_the_single_context_line(self):
# characterization: the sync and the line exist today; this guards the scoping
r = self.result
self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
self.assertNotEqual(self.para, "", "no **Single context line in the installed skill")

def test_top_heading_is_the_github_repo_name(self):
# #58, ticket #61: the top heading is the GitHub repo name
self.assertRegex(
self.para,
re.compile(r"top heading.*GitHub repo(sitory)? name"
r"|GitHub repo(sitory)? name.*top heading", re.I | re.S))

def test_gives_the_gh_command_that_reads_the_repo_name(self):
# #58, ticket #61: read the name with `gh repo view --json name -q .name`
self.assertRegex(
self.para,
re.compile(r"gh\s+repo\s+view\s+--json\s+name\s+-q\s+['\"]?\.name", re.I))

def test_heading_rule_applies_when_creating_the_glossary(self):
# #58, ticket #61: the rule applies when creating docs/GLOSSARY.md
self.assertRegex(self.para, re.compile(r"creat", re.I))

def test_existing_heading_is_never_renamed(self):
# #58, ticket #61: never rename an existing heading
self.assertRegex(
self.para,
re.compile(r"never\W+(\w+\W+){0,3}renam\w*\W+(\w+\W+){0,3}existing"
r"|existing\W+(\w+\W+){0,4}never\W+(\w+\W+){0,2}renam", re.I))


if __name__ == "__main__":
unittest.main()
Loading
Loading