janissary 0.5.5 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +2 -2
  2. package/ai/tasks/build-a-feature.md +12 -12
  3. package/ai/tasks/fix-a-bug.md +191 -0
  4. package/ai/tasks/fix-a-small-issue.md +34 -21
  5. package/ai/tasks/improve-codebase.md +3 -5
  6. package/ai/tasks/improve-modularity.md +0 -2
  7. package/ai/tasks/improve-namespacing.md +0 -2
  8. package/ai/tasks/improve-plan.md +8 -8
  9. package/ai/tasks/improve-security.md +0 -2
  10. package/ai/tasks/improve-style.md +0 -2
  11. package/ai/tasks/improve-test-coverage.md +0 -2
  12. package/ai/tasks/merge-change-to-master.md +0 -2
  13. package/ai/tasks/open-feature-pull-request.md +0 -2
  14. package/ai/tasks/plan-ready-features.md +17 -17
  15. package/ai/tasks/prepare-workspace.md +0 -2
  16. package/ai/tasks/quick-commit.md +0 -2
  17. package/ai/tasks/reduce-complexity.md +0 -2
  18. package/ai/tasks/remove-deadcode.md +0 -2
  19. package/ai/tasks/remove-duplication.md +0 -2
  20. package/ai/tasks/update-package.md +0 -2
  21. package/dist/agent/commands.js +1 -1
  22. package/dist/agent-names.js +21 -0
  23. package/dist/buffer.js +2 -2
  24. package/dist/cli-args.js +8 -2
  25. package/dist/command-manager.js +6 -0
  26. package/dist/commands/index.js +2 -0
  27. package/dist/commands/schedules.js +17 -0
  28. package/dist/commands.js +1 -1
  29. package/dist/controller.js +12 -2
  30. package/dist/database/index.js +1 -30
  31. package/dist/database/primer.js +30 -0
  32. package/dist/file-tree/args.js +36 -0
  33. package/dist/file-tree/git-refresh.js +33 -0
  34. package/dist/file-tree/index.js +82 -0
  35. package/dist/file-tree/manager.js +252 -0
  36. package/dist/file-tree/moves.js +26 -0
  37. package/dist/file-tree/open.js +56 -0
  38. package/dist/file-tree/rebuild.js +22 -0
  39. package/dist/file-tree/watch.js +27 -0
  40. package/dist/harness/auto-approve.js +1 -1
  41. package/dist/harness/index.js +23 -3
  42. package/dist/harness/manager.js +44 -6
  43. package/dist/harness/models.js +20 -1
  44. package/dist/harness/scratch-dir.js +10 -0
  45. package/dist/main.js +4 -0
  46. package/dist/message-handler.js +8 -0
  47. package/dist/notifications.js +2 -2
  48. package/dist/profile/agent-opener.js +1 -36
  49. package/dist/profile/harness-schedule.js +42 -0
  50. package/dist/profile/manager.js +27 -6
  51. package/dist/profile-reserved-files.js +69 -0
  52. package/dist/profiles.js +4 -61
  53. package/dist/pseudoterminal-manager.js +4 -2
  54. package/dist/pty.js +2 -2
  55. package/dist/sandbox/paths.js +1 -0
  56. package/dist/schedule/manager.js +17 -0
  57. package/dist/schedules-tab.js +23 -0
  58. package/dist/state-event.js +7 -4
  59. package/dist/tab/creators.js +13 -28
  60. package/dist/tab/file-registry.js +20 -0
  61. package/dist/tab/index.js +8 -0
  62. package/dist/tab/manager.js +26 -41
  63. package/dist/tab/openers.js +4 -1
  64. package/dist/tab/queue-commands.js +25 -0
  65. package/dist/tab/rehydrate-state.js +13 -0
  66. package/dist/tab/transcript-ops.js +15 -0
  67. package/dist/tab/unique-labels.js +27 -0
  68. package/dist/tab/view.js +2 -1
  69. package/dist/tasks.js +29 -9
  70. package/package.json +6 -1
  71. package/scripts/release.mjs +1 -1
  72. package/web/dist/assets/index-CwBP-03m.js +2145 -0
  73. package/web/dist/assets/index-DxzfdL9V.css +1 -0
  74. package/web/dist/index.html +2 -2
  75. package/web/dist/assets/index-DKEtQh6C.css +0 -1
  76. package/web/dist/assets/index-Dz5j8yq-.js +0 -1066
package/README.md CHANGED
@@ -4,7 +4,7 @@ Janissary is an **Agentic Working Environment**. In other words, it is an applic
4
4
 
5
5
  A [Janissary](https://en.wikipedia.org/wiki/Janissary) was an elite infantry soldier in the Ottoman Empire — a servant of the gate, loyal, and ever-ready.
6
6
 
7
- See the [User Docs](https://thirtysixthspan.github.io/janissary/user-documentation/getting-started/application) for the full command reference, tab types, and automation/advanced-agent guides.
7
+ See the [Documentation](https://thirtysixthspan.github.io/janissary/) for the full command reference, tab types, and automation/advanced-agent guides.
8
8
 
9
- See the [Developer Docs](https://thirtysixthspan.github.io/janissary/developer-documentation/) for advanced usage, coding, linting and testing practices.
9
+ See the [Developer Documentation](https://thirtysixthspan.github.io/janissary/developer-documentation/) for advanced usage, coding, linting and testing practices.
10
10
 
@@ -1,6 +1,8 @@
1
1
  # Build a Feature
2
2
 
3
- Your job: pick the simplest available plan from `product/plans/ready/`, implement it end to end, update the functional specs, promote the plan to `product/plans/complete/`, and open a pull request. You change source code, tests, spec files, and the plan file's location — nothing else.
3
+ Your job: pick the simplest available plan from `./product/plans/ready/`, implement it end to end, update the functional specs, promote the plan to `./product/plans/complete/`, and open a pull request. You change source code, tests, spec files, and the plan file's location — nothing else.
4
+
5
+ **Project `./product/` directory.** Every `./product/...` path in this task refers to the product directory in the current working directory — the project being worked on — never to the Janissary codebase's own `product/` directory, even when this task file was launched from an absolute path inside the Janissary installation.
4
6
 
5
7
  **No AI attribution — anywhere.** Never credit an AI agent as an author or contributor in anything this task produces. That means: no `Co-Authored-By:` trailers naming Claude or any other AI, no “Generated with Claude Code” (or similar) lines or badges, and no AI authorship notes in code, comments, docs, spec files, plan files, commit messages, or PR titles and bodies. This overrides any default convention that appends such attribution. The commit's configured git author is the only authorship ever recorded.
6
8
 
@@ -8,8 +10,6 @@ Your job: pick the simplest available plan from `product/plans/ready/`, implemen
8
10
 
9
11
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
10
12
 
11
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
12
-
13
13
  **Run autonomously.** This task runs unattended — do not ask the user questions or wait for feedback at any step. Make the best judgment call yourself, using the rules in this document, and keep going. Only stop early for the conditions explicitly listed under "Forbidden" below (e.g. no plans available, only 7+ complexity plans, discovering out-of-scope file edits).
14
14
 
15
15
  **Stay within the project directory.** The current working directory is the project directory for this session. Do not read or write any file outside it — no absolute paths escaping the project root, no `..` traversal above it, no touching files elsewhere on the machine (home directory config, other repos, system paths).
@@ -18,14 +18,14 @@ Your job: pick the simplest available plan from `product/plans/ready/`, implemen
18
18
 
19
19
  ### Allowed — do it automatically, never ask
20
20
 
21
- Read any file in the repo. Edit source, tests, CSS, and spec files as the plan directs. Move the chosen plan file from `product/plans/ready/` to `product/plans/complete/`. Run `./scripts/run.mjs check-diff` after each change. Run the full PR workflow via `ai/tasks/open-feature-pull-request.md` when implementation is done.
21
+ Read any file in the repo. Edit source, tests, CSS, and spec files as the plan directs. Move the chosen plan file from `./product/plans/ready/` to `./product/plans/complete/`. Run `./scripts/run.mjs check-diff` after each change. Run the full PR workflow via `ai/tasks/open-feature-pull-request.md` when implementation is done.
22
22
 
23
23
  ### Forbidden — no exceptions
24
24
 
25
25
  1. **Editing files the plan does not touch.** Stay inside the plan's scope. If you discover the plan missed a file, stop and report — do not silently expand scope.
26
26
  2. **Running `npm run check`.** That is the human's end-of-work gate. Use `./scripts/run.mjs check-diff` during development.
27
27
  3. **Skipping tests.** If the plan specifies tests, write them. If it does not, still verify with `./scripts/run.mjs check-diff`.
28
- 4. **Choosing a plan at complexity 7 or above.** If every plan in `product/plans/ready/` is rated 7+, stop and report — do not pick one anyway.
28
+ 4. **Choosing a plan at complexity 7 or above.** If every plan in `./product/plans/ready/` is rated 7+, stop and report — do not pick one anyway.
29
29
  5. **Merging the PR.** `ai/tasks/open-feature-pull-request.md` opens it; merging is the human's decision.
30
30
 
31
31
  ---
@@ -38,9 +38,9 @@ Execute `ai/tasks/prepare-workspace.md` in full before doing anything else.
38
38
 
39
39
  ## Step 1 — List ready plans and pick the simplest
40
40
 
41
- 1. List every `.md` file in `product/plans/ready/`.
41
+ 1. List every `.md` file in `./product/plans/ready/`.
42
42
  2. For each file, use the `Read` tool to read the first few lines and find the complexity rating line: `**Complexity: N/10**`. Do not use a shell loop to do this.
43
- 3. If no plans exist, report "No plans in `product/plans/ready/`" and stop.
43
+ 3. If no plans exist, report "No plans in `./product/plans/ready/`" and stop.
44
44
  4. If the lowest complexity found is **7 or above**, report the list with ratings and stop — do not pick one.
45
45
  5. Otherwise, pick the plan with the **lowest** complexity number. On a tie, pick whichever plan name comes first alphabetically.
46
46
 
@@ -83,10 +83,10 @@ Run `./scripts/run.mjs check-diff` after writing tests. All tests must pass.
83
83
 
84
84
  ## Step 5 — Update or create spec files
85
85
 
86
- Every feature must be reflected in the functional specs under `product/specs/`. After implementation and tests:
86
+ Every feature must be reflected in the functional specs under `./product/specs/`. After implementation and tests:
87
87
 
88
88
  1. **Check the plan.** If the plan names specific spec files to update or create, do exactly that.
89
- 2. **Otherwise, find the right spec.** Read the existing specs in `product/specs/` and identify which one(s) the feature belongs to. Most features extend an existing spec (e.g. a new keyboard shortcut belongs in `product/specs/keyboard-navigation.md`, a new tab behavior belongs in `product/specs/tabs.md`). If no existing spec covers the area, create a new one.
89
+ 2. **Otherwise, find the right spec.** Read the existing specs in `./product/specs/` and identify which one(s) the feature belongs to. Most features extend an existing spec (e.g. a new keyboard shortcut belongs in `./product/specs/keyboard-navigation.md`, a new tab behavior belongs in `./product/specs/tabs.md`). If no existing spec covers the area, create a new one.
90
90
  3. **Write or update the spec.** Follow the existing conventions: `# Title` at the top, `### Subsection` for each aspect, prose describing user-visible behavior only — no code, no implementation details, no file paths. The spec is what the feature *does*, not how it is built. Keep additions concise and factual.
91
91
 
92
92
  Spec files are markdown and do not affect `check-diff`, so no verification run is needed after this step.
@@ -102,10 +102,10 @@ Spec files are markdown and do not affect `check-diff`, so no verification run i
102
102
 
103
103
  ## Step 7 — Promote the plan
104
104
 
105
- Move the plan file from `product/plans/ready/` to `product/plans/complete/`:
105
+ Move the plan file from `./product/plans/ready/` to `./product/plans/complete/`:
106
106
 
107
107
  ```bash
108
- git mv product/plans/ready/<plan-file> product/plans/complete/<plan-file>
108
+ git mv ./product/plans/ready/<plan-file> ./product/plans/complete/<plan-file>
109
109
  ```
110
110
 
111
111
  ---
@@ -121,7 +121,7 @@ Execute `ai/tasks/open-feature-pull-request.md` in full. That document owns the
121
121
  Give the user a short report in this exact shape:
122
122
 
123
123
  ```
124
- Plan: product/plans/ready/<file> → product/plans/complete/<file>
124
+ Plan: ./product/plans/ready/<file> → ./product/plans/complete/<file>
125
125
  Complexity: N/10
126
126
  Implementation: <one-line summary of what was built>
127
127
  Tests: <count> new tests across <files>
@@ -0,0 +1,191 @@
1
+ # Fix a Bug
2
+
3
+ Your job: take a reported bug from `./product/backlog/bugs.md` — the first one listed under `## ready`, or the specific bug the user names when running this task — **replicate it** to confirm the faulty behavior, determine the **correct** behavior from the bug report together with the functional specs and the code, implement a fix, **verify** the fix resolves the replicated failure, add a **regression test** that would fail without the fix and passes with it, update functional specs and public documentation where the fix changes behavior they already document, record the plan in `./product/plans/complete/`, remove the bug from the bugs file, and open a pull request that documents the replication steps and leaves the fix for a human to merge. You change source code, tests, spec files, `help.md`, `documentation/user-documentation/`, the bugs file, and the plan file's location — nothing else.
4
+
5
+ **Project `./product/` directory.** Every `./product/...` path in this task refers to the product directory in the current working directory — the project being worked on — never to the Janissary codebase's own `product/` directory, even when this task file was launched from an absolute path inside the Janissary installation.
6
+
7
+ **No AI attribution — anywhere.** Never credit an AI agent as an author or contributor in anything this task produces. That means: no `Co-Authored-By:` trailers naming Claude or any other AI, no “Generated with Claude Code” (or similar) lines or badges, and no AI authorship notes in code, comments, docs, spec files, plan files, commit messages, or PR titles and bodies. This overrides any default convention that appends such attribution. The commit's configured git author is the only authorship ever recorded.
8
+
9
+ **Shell hygiene:** run every command on its own line — no `&&` chaining, no `; echo "Exit code: $?"` suffixes, no subshell captures, no `for`/`while` loops, no variable expansion (`$var`, `$(...)`), no redirects (`2>/dev/null`, `>file`, `>>file`), no pipes (`|`). Commands with control-flow, expansion, redirects, or pipes require manual approval and will stall an unattended run. To run a project script, always use `./scripts/run.mjs <name>` — never call `node scripts/<name>.mjs` directly.
10
+
11
+ **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
12
+
13
+ This overrides CLAUDE.md's "Capturing command output" guidance (write the output to a file under `./temp/`, then `grep` it repeatedly) for this task: the follow-up `grep`/`tail` filter commands stall an unattended run. Instead, run the command plain and read the full tool output directly — filter it yourself while reading, don't shell out to `grep`.
14
+
15
+ **Run autonomously.** This task runs unattended — do not ask the user questions or wait for feedback at any step. Make the best judgment call yourself, using the rules in this document, and keep going. Only stop early for the conditions explicitly listed under "Forbidden" below.
16
+
17
+ **Stay within the project directory.** The current working directory is the project directory for this session. Do not read or write any file outside it — no absolute paths escaping the project root, no `..` traversal above it, no touching files elsewhere on the machine (home directory config, other repos, system paths).
18
+
19
+ ## What you may and may not do
20
+
21
+ ### Allowed — do it automatically, never ask
22
+
23
+ Read any file in the repo. Run read-only commands to replicate the reported bug. Edit source, tests, CSS, and spec files as the fix requires. Update `help.md` and files under `documentation/user-documentation/` when the fix changes behavior they already document. Write a plan file under `./product/plans/` and move it through `draft/` → `ready/` → `complete/`. Remove the fixed bug from `./product/backlog/bugs.md`. Run `./scripts/run.mjs check-diff` after each change. Run the full PR workflow via `ai/tasks/open-feature-pull-request.md` when implementation is done.
24
+
25
+ ### Forbidden — no exceptions
26
+
27
+ 1. **Fabricating a fix, a symptom, or a reproduction.** Never invent a failure you did not observe or a fix for a bug you could not reproduce. If the selected bug cannot be reproduced, stop and report (Step 1). If the specs and code leave the intended behavior genuinely ambiguous, stop and report (Step 2).
28
+ 2. **Editing files the fix does not touch.** Stay in scope. If you discover a fix requires changes beyond what you planned, update the plan first — do not silently expand scope.
29
+ 3. **Running `npm run check`.** That is the human's end-of-work gate. Use `./scripts/run.mjs check-diff` during development.
30
+ 4. **Skipping the regression test.** Every fix needs a test that fails without the fix and passes with it. Verify with `./scripts/run.mjs check-diff`.
31
+ 5. **Editing `./product/backlog/bugs.md` beyond removing the fixed entry.** Only remove the line for the bug you fixed — do not reorder, rephrase, or otherwise modify the remaining entries.
32
+ 6. **Merging the PR.** `ai/tasks/open-feature-pull-request.md` opens it; merging is the human's decision.
33
+
34
+ ---
35
+
36
+ ## Step 0 — Prepare the workspace
37
+
38
+ Execute `ai/tasks/prepare-workspace.md` in full before doing anything else.
39
+
40
+ ---
41
+
42
+ ## Step 1 — Pick a bug and replicate it
43
+
44
+ 1. Read `./product/backlog/bugs.md`. Bugs are grouped under `## ready`, `## development`, and `## deferred`. Only consider bugs under `## ready`.
45
+ 2. If there are no bugs under `## ready`, report "No ready bugs in `./product/backlog/bugs.md`" and stop.
46
+ 3. Pick the bug to fix. Do **not** evaluate, rank, or compare the bugs for scope, tractability, or any other quality — the human who filed them decided they belong here:
47
+ - **If a specific bug is named in the task invocation** (e.g. `execute ai/tasks/fix-a-bug.md "<bug text>"`), fix that one. Find the entry in `./product/backlog/bugs.md` it refers to — the argument may be quoted text, a paraphrase, or a position such as "the second one". If no entry matches, report that no matching bug was found and stop.
48
+ - **Otherwise**, take the **first** bug listed under `## ready` (top of the list).
49
+
50
+ State which bug you selected in one sentence.
51
+ 4. **Replicate the reported failure** before writing any fix, so you can watch it fail:
52
+ - Prefer writing a failing automated test that exercises the reported scenario — this becomes the regression test in Step 4. Colocate it per the test conventions (`src/**/*.test.ts`, `web/src/**/*.test.tsx`).
53
+ - If a test cannot capture it, exercise the affected code path directly (a focused test, a `janus` CLI invocation, or a short throwaway script under `./temp/`) and observe the wrong behavior.
54
+ - Record exactly what you ran and the faulty behavior you saw — the wrong output, the error, or the missing result. You will reuse this in the plan (Step 3) and the PR (Step 10).
55
+ 5. Keep reproduction bounded: try at most two or three distinct approaches. If you still cannot reproduce the failure, do **not** fabricate a fix or invent a symptom, and do **not** switch to a different bug — report the selected bug, everything you tried, and stop.
56
+
57
+ ---
58
+
59
+ ## Step 2 — Determine the correct behavior
60
+
61
+ Decide what the code *should* do, drawing on three sources in order:
62
+
63
+ 1. **The bug report** — what outcome does the reporter expect? Take it as the primary signal of intended behavior.
64
+ 2. **The functional specs** in `./product/specs/` — find the spec covering this area. If a spec describes the correct behavior, it is authoritative; the bug is the code diverging from the spec.
65
+ 3. **The code and its tests** — surrounding conventions, related passing tests, and adjacent behavior show what "correct" looks like when the spec is silent.
66
+
67
+ State the correct behavior in one or two sentences before planning the fix. If the bug report, specs, and code genuinely conflict or leave the intended behavior ambiguous, stop and report the ambiguity rather than guessing.
68
+
69
+ ---
70
+
71
+ ## Step 3 — Develop a plan
72
+
73
+ 1. Read the project constraints in [`CLAUDE.md`](../../CLAUDE.md): ESLint rules (200-line `max-lines`, `.js` import extensions in `src/`, type-aware rules), test conventions (`src/**/*.test.ts`, `web/src/**/*.test.tsx`).
74
+ 2. Read every file relevant to the fix to understand the code involved and the root cause of the bug — fix the cause, not just the symptom.
75
+ 3. Choose a short, descriptive `kebab-case` name for the fix — call it `<bug-name>` (for example `orientation-reset-on-load`). Use this exact same name for the plan file at every stage below.
76
+ 4. Write a plan file following the format of existing plans in `./product/plans/complete/` — include a complexity rating, the root cause, the correct behavior (from Step 2), the reproduction (from Step 1), the approach, implementation steps, the regression test, and out-of-scope items. Write it to `./product/plans/draft/<bug-name>.md`.
77
+ 5. After the plan is written, move it from `./product/plans/draft/` to `./product/plans/ready/`. Use plain `mv` (not `git mv`) — the new plan file is not tracked by git yet, and `git mv` fails on an untracked file:
78
+ ```bash
79
+ mv ./product/plans/draft/<bug-name>.md ./product/plans/ready/<bug-name>.md
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Step 4 — Implement the fix and its regression test
85
+
86
+ Follow the plan's implementation steps **in order**. After each step:
87
+
88
+ 1. Run `./scripts/run.mjs check-diff` to catch lint, typecheck, and test failures immediately.
89
+ 2. Fix any failures before moving to the next step.
90
+ 3. If a step produces a file over the 200-line limit, extract into a new module per `ai/guidelines/code-guidelines.md` — do not compact code, strip comments, or delete spacing.
91
+
92
+ The regression test is mandatory:
93
+
94
+ - It must exercise the reported scenario from Step 1 and assert the correct behavior from Step 2.
95
+ - **Prove it actually catches the bug.** The reliable path is the failing test you wrote in Step 1: you already watched it fail against the buggy code, so once the fix is in place, run it and confirm it now passes. If you did not write it test-first, add it now, confirm it passes with the fix, then prove it depends on the fix — either revert the fix, run the test to watch it fail, and re-apply the fix, or explain concretely why the assertion cannot hold without the fix.
96
+ - Mirror the test style of the referenced test files (imports, helper patterns, assertion style).
97
+
98
+ Key rules during implementation:
99
+
100
+ - **Match existing conventions.** Use the same libraries, patterns, and naming the surrounding code uses. Check `package.json` or the file's existing imports before assuming a library is available.
101
+ - **Import extensions.** Relative imports in `src/` must carry `.js` (NodeNext). Relative imports in `web/src/` stay extensionless.
102
+ - **No comments unless the plan specifies them.** Write clean code; let it speak for itself.
103
+
104
+ ---
105
+
106
+ ## Step 5 — Verify the fix
107
+
108
+ 1. Run `./scripts/run.mjs check-diff`. It must pass clean, including the new regression test.
109
+ 2. Re-run the reproduction from Step 1 and confirm the faulty behavior is gone — the scenario that used to fail now behaves correctly.
110
+ 3. If the plan's Verification section describes manual steps, perform them. If manual verification is not possible in this environment, note that in the report.
111
+
112
+ ---
113
+
114
+ ## Step 6 — Update or create spec files
115
+
116
+ Every fix must be reflected in the functional specs under `./product/specs/`. After implementation and verification:
117
+
118
+ 1. **Check the plan.** If the plan names specific spec files to update or create, do exactly that.
119
+ 2. **Otherwise, find the right spec.** Read the existing specs in `./product/specs/` and identify which one(s) the fix relates to. Most fixes correct behavior an existing spec already describes — align the spec with the now-correct behavior. If no existing spec covers the area, create a new one.
120
+ 3. **Write or update the spec.** Follow the existing conventions: `# Title` at the top, `### Subsection` for each aspect, prose describing user-visible behavior only — no code, no implementation details, no file paths. The spec is what the fix *does*, not how it is built. Keep additions concise and factual.
121
+
122
+ Spec files are markdown and do not affect `check-diff`, so no verification run is needed after this step.
123
+
124
+ ---
125
+
126
+ ## Step 7 — Update help and public documentation if affected
127
+
128
+ The fix only needs a documentation update if it changes behavior that `help.md` or `documentation/user-documentation/` already describes — a changed flag, a renamed command, a corrected default, a behavior that no longer matches what's written. Do not add new documentation for behavior that wasn't previously documented; that is out of scope for this task.
129
+
130
+ 1. Check `help.md` for any command, flag, or behavior description the fix changes. Update it in place if found.
131
+ 2. Check `documentation/user-documentation/` for any page describing the changed behavior. Update it in place if found.
132
+ 3. If neither documents the changed behavior, do nothing here — do not create new documentation.
133
+
134
+ These files are markdown and do not affect `check-diff`, so no verification run is needed after this step.
135
+
136
+ ---
137
+
138
+ ## Step 8 — Promote the plan and remove the bug
139
+
140
+ 1. Move the plan file from `./product/plans/ready/` to `./product/plans/complete/`. Use plain `mv` (not `git mv`) — the plan file is still untracked until the PR workflow stages it:
141
+ ```bash
142
+ mv ./product/plans/ready/<bug-name>.md ./product/plans/complete/<bug-name>.md
143
+ ```
144
+ 2. Remove **only** the fixed bug's line from the `## ready` group in `./product/backlog/bugs.md`. Do not touch the `## development` or `## deferred` groups, the group headings, or any other bug entry.
145
+
146
+ ---
147
+
148
+ ## Step 9 — Final verification
149
+
150
+ 1. Run `./scripts/run.mjs check-diff` one last time. It must pass clean, including the regression test.
151
+ 2. Manually verify the behavior if the plan's Verification section describes manual steps. If manual verification is not possible in this environment, note that in the report.
152
+
153
+ ---
154
+
155
+ ## Step 10 — Open the pull request
156
+
157
+ Execute `ai/tasks/open-feature-pull-request.md` in full — it owns the branch, commit, push, and PR-open workflow. Follow its steps as written, and additionally satisfy the two bug-specific requirements below.
158
+
159
+ **Requirement 1 — use the `fix:` type.** The commit subject and PR title must use the `fix:` Conventional Commits type (that workflow's Step 3 and Step 6), for example `fix(web): reset image orientation on reload`.
160
+
161
+ **Requirement 2 — document the replication in the PR body.** When you write the body (that workflow's "Behavior examples" and "How to verify" sections), include an explicit **Replication steps** account drawn from Step 1 and Step 2 of this task:
162
+
163
+ - The exact steps to reproduce the original faulty behavior (commands, inputs, or user flow).
164
+ - What the buggy behavior was — the wrong output, error, or missing result a reviewer would see without the fix.
165
+ - What the correct behavior is now — what the same steps produce with the fix applied.
166
+ - The name of the regression test that encodes this scenario and the file it lives in.
167
+
168
+ Do not merge the PR — leave it open for a human.
169
+
170
+ ---
171
+
172
+ ## Step 11 — Report
173
+
174
+ Give the user a short report in this exact shape:
175
+
176
+ ```
177
+ Bug: <the bug text from ./product/backlog/bugs.md>
178
+ Reproduction: <one-line summary of how you replicated the faulty behavior>
179
+ Correct: <one-line statement of the correct behavior>
180
+ Root cause: <one-line summary of the underlying cause>
181
+ Plan: ./product/plans/ready/<file> → ./product/plans/complete/<file>
182
+ Complexity: N/10
183
+ Implementation: <one-line summary of the fix>
184
+ Regression: <the test that now guards this bug, and the file it lives in>
185
+ Spec: <spec file(s) created or updated, with one-line description of change>
186
+ Docs: <help.md/user-documentation file(s) updated, or "none needed">
187
+ PR: <url> (#<number>)
188
+ Status: open
189
+ ```
190
+
191
+ Keep it brief. Done.
@@ -1,6 +1,8 @@
1
1
  # Fix a Small Issue
2
2
 
3
- Your job: pick the simplest issue from `product/backlog/issues.md`, develop a plan to resolve it, implement the fix, update functional specs, record the plan in `product/plans/complete/`, remove the issue from the issues file, and merge the change to master. You change source code, tests, spec files, the issues file, and the plan file's location — nothing else.
3
+ Your job: pick the simplest issue from `./product/backlog/issues.md`, develop a plan to resolve it, implement the fix, update functional specs, update `help.md` and public documentation where the fix changes behavior they already document, record the plan in `./product/plans/complete/`, remove the issue from the issues file, and merge the change to master. You change source code, tests, spec files, `help.md`, `documentation/user-documentation/`, the issues file, and the plan file's location — nothing else.
4
+
5
+ **Project `./product/` directory.** Every `./product/...` path in this task refers to the product directory in the current working directory — the project being worked on — never to the Janissary codebase's own `product/` directory, even when this task file was launched from an absolute path inside the Janissary installation.
4
6
 
5
7
  **No AI attribution — anywhere.** Never credit an AI agent as an author or contributor in anything this task produces. That means: no `Co-Authored-By:` trailers naming Claude or any other AI, no “Generated with Claude Code” (or similar) lines or badges, and no AI authorship notes in code, comments, docs, spec files, plan files, commit messages, or PR titles and bodies. This overrides any default convention that appends such attribution. The commit's configured git author is the only authorship ever recorded.
6
8
 
@@ -8,8 +10,6 @@ Your job: pick the simplest issue from `product/backlog/issues.md`, develop a pl
8
10
 
9
11
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
10
12
 
11
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
12
-
13
13
  This overrides CLAUDE.md's "Capturing command output" guidance (write the output to a file under `./temp/`, then `grep` it repeatedly) for this task: the follow-up `grep`/`tail` filter commands stall an unattended run. Instead, run the command plain and read the full tool output directly — filter it yourself while reading, don't shell out to `grep`.
14
14
 
15
15
  **Run autonomously.** This task runs unattended — do not ask the user questions or wait for feedback at any step. Make the best judgment call yourself, using the rules in this document, and keep going. Only stop early for the conditions explicitly listed under "Forbidden" below.
@@ -20,7 +20,7 @@ This overrides CLAUDE.md's "Capturing command output" guidance (write the output
20
20
 
21
21
  ### Allowed — do it automatically, never ask
22
22
 
23
- Read any file in the repo. Edit source, tests, CSS, and spec files as the fix requires. Write a plan file to `product/plans/complete/`. Remove the fixed issue from `product/backlog/issues.md`. Run `./scripts/run.mjs check-diff` after each change. Execute the full merge workflow via `ai/tasks/merge-change-to-master.md` when implementation is done.
23
+ Read any file in the repo. Edit source, tests, CSS, and spec files as the fix requires. Update `help.md` and files under `documentation/user-documentation/` when the fix changes behavior they already document. Write a plan file to `./product/plans/complete/`. Remove the fixed issue from `./product/backlog/issues.md`. Run `./scripts/run.mjs check-diff` after each change. Execute the full merge workflow via `ai/tasks/merge-change-to-master.md` when implementation is done.
24
24
 
25
25
  ### Forbidden — no exceptions
26
26
 
@@ -28,7 +28,7 @@ Read any file in the repo. Edit source, tests, CSS, and spec files as the fix re
28
28
  2. **Running `npm run check`.** That is the human's end-of-work gate. Use `./scripts/run.mjs check-diff` during development.
29
29
  3. **Skipping tests.** Every fix needs tests that cover the changed behavior. Verify with `./scripts/run.mjs check-diff`.
30
30
  4. **Choosing an issue that requires significant new architecture.** If an issue would require high complexity error or prone work, pick a simpler issue instead and report why.
31
- 5. **Editing `product/backlog/issues.md` beyond removing the fixed entry.** Only remove the line for the issue you fixed — do not reorder, rephrase, or otherwise modify the remaining entries.
31
+ 5. **Editing `./product/backlog/issues.md` beyond removing the fixed entry.** Only remove the line for the issue you fixed — do not reorder, rephrase, or otherwise modify the remaining entries.
32
32
  6. **Merging before all checks pass.** The `ai/tasks/merge-change-to-master.md` workflow handles merge; do not bypass it.
33
33
 
34
34
  ---
@@ -41,9 +41,9 @@ Execute `ai/tasks/prepare-workspace.md` in full before doing anything else.
41
41
 
42
42
  ## Step 1 — List small fixes and pick the first available
43
43
 
44
- 1. Read `product/backlog/issues.md` and list every issue.
44
+ 1. Read `./product/backlog/issues.md` and list every issue.
45
45
  2. For each issue, assess the complexity by reviewing the codebase to understand what areas it touches. Do not use a shell loop for this.
46
- 3. If no issues exist, report "No issues in `product/backlog/issues.md`" and stop.
46
+ 3. If no issues exist, report "No issues in `./product/backlog/issues.md`" and stop.
47
47
  4. If every issue requires significant new architecture (rating 7+), report the list with assessments and stop — do not pick one.
48
48
  5. Otherwise, pick the **first** issue listed in the file (top of the list). State your pick and why.
49
49
 
@@ -53,10 +53,10 @@ Execute `ai/tasks/prepare-workspace.md` in full before doing anything else.
53
53
 
54
54
  1. Read the project constraints in [`CLAUDE.md`](../../CLAUDE.md): ESLint rules (200-line `max-lines`, `.js` import extensions in `src/`, type-aware rules), test conventions (`src/**/*.test.ts`, `web/src/**/*.test.tsx`).
55
55
  2. Read every file relevant to the fix to understand the code involved.
56
- 3. Write a plan file following the format of existing plans in `product/plans/complete/` — include a complexity rating, goal, approach, implementation steps, tests, and out-of-scope items. Write it to `product/plans/draft/<fix-name>.md`.
57
- 4. After the plan is written, move it from `product/plans/draft/` to `product/plans/ready/`:
56
+ 3. Write a plan file following the format of existing plans in `./product/plans/complete/` — include a complexity rating, goal, approach, implementation steps, tests, and out-of-scope items. Write it to `./product/plans/draft/<fix-name>.md`.
57
+ 4. After the plan is written, move it from `./product/plans/draft/` to `./product/plans/ready/`:
58
58
  ```bash
59
- git mv product/plans/draft/<fix-name>.md product/plans/ready/<fix-name>.md
59
+ git mv ./product/plans/draft/<fix-name>.md ./product/plans/ready/<fix-name>.md
60
60
  ```
61
61
 
62
62
  ---
@@ -87,50 +87,63 @@ Run `./scripts/run.mjs check-diff` after writing tests. All tests must pass.
87
87
 
88
88
  ## Step 5 — Update or create spec files
89
89
 
90
- Every fix must be reflected in the functional specs under `product/specs/`. After implementation and tests:
90
+ Every fix must be reflected in the functional specs under `./product/specs/`. After implementation and tests:
91
91
 
92
92
  1. **Check the plan.** If the plan names specific spec files to update or create, do exactly that.
93
- 2. **Otherwise, find the right spec.** Read the existing specs in `product/specs/` and identify which one(s) the fix relates to. Most fixes extend an existing spec. If no existing spec covers the area, create a new one.
93
+ 2. **Otherwise, find the right spec.** Read the existing specs in `./product/specs/` and identify which one(s) the fix relates to. Most fixes extend an existing spec. If no existing spec covers the area, create a new one.
94
94
  3. **Write or update the spec.** Follow the existing conventions: `# Title` at the top, `### Subsection` for each aspect, prose describing user-visible behavior only — no code, no implementation details, no file paths. The spec is what the fix *does*, not how it is built. Keep additions concise and factual.
95
95
 
96
96
  Spec files are markdown and do not affect `check-diff`, so no verification run is needed after this step.
97
97
 
98
98
  ---
99
99
 
100
- ## Step 6 — Promote the plan and remove the issue
100
+ ## Step 6 — Update help and public documentation if affected
101
+
102
+ The fix only needs a documentation update if it changes behavior that `help.md` or `documentation/user-documentation/` already describes — a changed flag, a renamed command, a corrected default, a behavior that no longer matches what's written. Do not add new documentation for behavior that wasn't previously documented; that is out of scope for this task.
103
+
104
+ 1. Check `help.md` for any command, flag, or behavior description the fix changes. Update it in place if found.
105
+ 2. Check `documentation/user-documentation/` for any page describing the changed behavior. Update it in place if found.
106
+ 3. If neither documents the changed behavior, do nothing here — do not create new documentation.
107
+
108
+ These files are markdown and do not affect `check-diff`, so no verification run is needed after this step.
109
+
110
+ ---
111
+
112
+ ## Step 7 — Promote the plan and remove the issue
101
113
 
102
- 1. Move the plan file from `product/plans/ready/` to `product/plans/complete/`:
114
+ 1. Move the plan file from `./product/plans/ready/` to `./product/plans/complete/`:
103
115
  ```bash
104
- git mv product/plans/ready/<fix-name>.md product/plans/complete/<fix-name>.md
116
+ git mv ./product/plans/ready/<fix-name>.md ./product/plans/complete/<fix-name>.md
105
117
  ```
106
- 2. Remove the fixed issue's line from `product/backlog/issues.md`. Only remove that single line — do not modify any other content in the file.
118
+ 2. Remove the fixed issue's line from `./product/backlog/issues.md`. Only remove that single line — do not modify any other content in the file.
107
119
 
108
120
  ---
109
121
 
110
- ## Step 7 — Final verification
122
+ ## Step 8 — Final verification
111
123
 
112
124
  1. Run `./scripts/run.mjs check-diff` one last time. It must pass clean.
113
125
  2. Manually verify the behavior if the plan's Verification section describes manual steps. If manual verification is not possible in this environment, note that in the report.
114
126
 
115
127
  ---
116
128
 
117
- ## Step 8 — Merge the change to master
129
+ ## Step 9 — Merge the change to master
118
130
 
119
131
  Execute `ai/tasks/merge-change-to-master.md` in full. That document owns the merge workflow — follow its steps without deviation.
120
132
 
121
133
  ---
122
134
 
123
- ## Step 9 — Report
135
+ ## Step 10 — Report
124
136
 
125
137
  Give the user a short report in this exact shape:
126
138
 
127
139
  ```
128
- Issue: <the issue text from product/backlog/issues.md>
129
- Plan: product/plans/ready/<file> → product/plans/complete/<file>
140
+ Issue: <the issue text from ./product/backlog/issues.md>
141
+ Plan: ./product/plans/ready/<file> → ./product/plans/complete/<file>
130
142
  Complexity: N/10
131
143
  Implementation: <one-line summary of the fix>
132
144
  Tests: <count> new tests across <files>
133
145
  Spec: <spec file(s) created or updated, with one-line description of change>
146
+ Docs: <help.md/user-documentation file(s) updated, or "none needed">
134
147
  PR: <url> (#<number>)
135
148
  Status: merged
136
149
  ```
@@ -1,6 +1,6 @@
1
1
  # Improve code base
2
2
 
3
- Your job: act as a **supervisor** that continuously improves this codebase by running a loop, entirely by yourself — no subagents, no background agents. Each cycle you **inspect** the code, **select** the single most valuable improvement, **execute** the matching task playbook yourself, **verify** the result, **ship it to `master` through a full pull request**, and then **start the next cycle**. You own the judgment around it: what to work on, whether the result is genuinely good, and when to stop.
3
+ Your job: act as a **supervisor** that continuously improves this codebase by running a loop. Each cycle you **inspect** the code, **select** the single most valuable improvement, **execute** the matching task playbook, **verify** the result, **ship it to `master` through a full pull request**, and then **start the next cycle**. You own the judgment around it: what to work on, whether the result is genuinely good, and when to stop.
4
4
 
5
5
  The improvement work itself follows one of these existing single-purpose task playbooks — you pick the right one each cycle and execute it yourself, inline, in this same session:
6
6
 
@@ -20,8 +20,6 @@ The improvement work itself follows one of these existing single-purpose task pl
20
20
 
21
21
  **Run autonomously.** This task runs unattended — do not ask the user questions or wait for feedback at any step. Make the best judgment call yourself, using the rules in this document, and keep going. The only reasons to stop are the ones listed in "When to stop the loop" below.
22
22
 
23
- **No subagents, no background agents.** Do every step yourself, in this session — never launch a subagent (Task/Agent tool) to execute a playbook or any part of one, and never hand work off to a background agent. The playbooks referenced below are instructions for *you* to follow directly, not prompts to delegate.
24
-
25
23
  **Shell hygiene:** run every command on its own line — no `&&` chaining, no `; echo "Exit code: $?"` suffixes, no subshell captures. The exit code and output are visible in the tool result. To run a project script, always use `./scripts/run.mjs <name>` — never call `node scripts/<name>.mjs` directly.
26
24
 
27
25
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
@@ -82,7 +80,7 @@ State your pick in one sentence: the task playbook, the target file/function, an
82
80
 
83
81
  ### Step 3 — Execute the chosen playbook yourself
84
82
 
85
- Follow [`ai/tasks/<task>.md`](.) for the task you picked in Step 2, in full, in this same session — you are the one carrying out every step of it, not a subagent. A few adjustments to how you run it here:
83
+ Follow [`ai/tasks/<task>.md`](.) for the task you picked in Step 2, in full. A few adjustments to how you run it here:
86
84
 
87
85
  1. **Skip that playbook's "Step 0 — Prepare the workspace"** — the workspace is already prepared and synced to `master`, and you must not run `git checkout`/`git pull` here (that would discard the working-tree change you're about to make this cycle). Start at the playbook's Step 1.
88
86
  2. **Stop after that playbook's own verification step — do not commit, push, or open a PR from within it.** Leave the single change sitting in the working tree. Committing and shipping is Step 5 below, handled once for the whole cycle.
@@ -126,7 +124,7 @@ git clean -fd
126
124
 
127
125
  ### Step 5 — Ship this cycle to master
128
126
 
129
- The change is verified and sitting uncommitted in the working tree. **Ship it by executing [`merge-change-to-master.md`](merge-change-to-master.md) in full, yourself** — follow every step of that playbook in order, same as you did for the improvement playbook in Step 3; do not delegate this either. It commits the change as a single-author Conventional Commits commit — pick the type that fits the task (`refactor` for modularity/complexity/namespacing/duplication, `test` for coverage, `chore`/`fix` for deadcode, `fix`/`build` for security, `style` for CSS, `build` for a package update) — opens a PR against `master`, resolves any conflicts, waits for required checks, and squash-merges it. Do **not** hand-commit first: the merge task's own Step 0 picks up the working-tree change itself.
127
+ The change is verified and sitting uncommitted in the working tree. **Ship it by executing [`merge-change-to-master.md`](merge-change-to-master.md) in full** — follow every step of that playbook in order, same as you did for the improvement playbook in Step 3. It commits the change as a single-author Conventional Commits commit — pick the type that fits the task (`refactor` for modularity/complexity/namespacing/duplication, `test` for coverage, `chore`/`fix` for deadcode, `fix`/`build` for security, `style` for CSS, `build` for a package update) — opens a PR against `master`, resolves any conflicts, waits for required checks, and squash-merges it. Do **not** hand-commit first: the merge task's own Step 0 picks up the working-tree change itself.
130
128
 
131
129
  Keep honoring the **No AI attribution** rule as you go — the commit, PR title, and PR body must carry no AI authorship — and the **Run autonomously** rule (never pause to ask a question).
132
130
 
@@ -6,8 +6,6 @@ Your job: make **one** small, safe change that lowers the complexity of **one**
6
6
 
7
7
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
8
8
 
9
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
10
-
11
9
  This is the **only** way we reduce a file's size and complexity here: extract a cohesive group of related code into a new file and import it back. Never compact code, strip comments, or delete blank lines to shrink a file — that hurts readability without improving the design (see [`code-guidelines.md`](../guidelines/code-guidelines.md)).
12
10
 
13
11
  Refactoring edits real code, so the rule is simple: **the tests must pass before you start and still pass after. If you cannot keep them passing, put the code back the way it was.**
@@ -8,8 +8,6 @@ For example, the flat files `src/acp-loop.ts`, `src/acp-manager.ts`, `src/acp-ru
8
8
 
9
9
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
10
10
 
11
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
12
-
13
11
  **No AI attribution — anywhere.** Never credit an AI agent as an author or contributor in anything this task produces. That means: no `Co-Authored-By:` trailers naming Claude or any other AI, no “Generated with Claude Code” (or similar) lines or badges, and no AI authorship notes in code, comments, docs, spec files, plan files, commit messages, or PR titles and bodies. This overrides any default convention that appends such attribution. The commit's configured git author is the only authorship ever recorded.
14
12
 
15
13
  This is a **pure move-and-rewire refactor**: relocate whole files and fix the import paths that point at or out of them. Never change what any file *does* — no logic edits, no signature changes, no reformatting of code that only moved. The **only** edits you make inside any file are to the **strings in its import/export statements**. If you find yourself changing anything else, stop.
@@ -1,6 +1,8 @@
1
1
  # Improve a Draft Plan (one plan per run)
2
2
 
3
- Your job: take **one** plan from `product/plans/draft/`, check every claim it makes against the real codebase, and edit the plan so an implementer is less likely to go wrong — then assess its complexity and record it at the top of the plan. You improve the **plan document only**; you change no source code.
3
+ Your job: take **one** plan from `./product/plans/draft/`, check every claim it makes against the real codebase, and edit the plan so an implementer is less likely to go wrong — then assess its complexity and record it at the top of the plan. You improve the **plan document only**; you change no source code.
4
+
5
+ **Project `./product/` directory.** Every `./product/...` path in this task refers to the product directory in the current working directory — the project being worked on — never to the Janissary codebase's own `product/` directory, even when this task file was launched from an absolute path inside the Janissary installation.
4
6
 
5
7
  **No AI attribution — anywhere.** Never credit an AI agent as an author or contributor in anything this task produces. That means: no `Co-Authored-By:` trailers naming Claude or any other AI, no “Generated with Claude Code” (or similar) lines or badges, and no AI authorship notes in code, comments, docs, spec files, plan files, commit messages, or PR titles and bodies. This overrides any default convention that appends such attribution. The commit's configured git author is the only authorship ever recorded.
6
8
 
@@ -8,8 +10,6 @@ This is a **planning** task, not pre-implementation. A good plan decides *what*
8
10
 
9
11
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
10
12
 
11
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
12
-
13
13
  Do the steps below **in order**. Do not skip steps. Do not invent your own process.
14
14
 
15
15
  **Shell hygiene:** run every command on its own line — no `&&` chaining, no `; echo "Exit code: $?"` suffixes, no subshell captures. To run a project script, always use `./scripts/run.mjs <name>` — never call `node scripts/<name>.mjs` directly.
@@ -26,7 +26,7 @@ Edit the **one plan file** you picked: correct it, disambiguate it, restructure
26
26
 
27
27
  1. **Adding code to the plan.** Never add implementation code blocks — no function bodies, no method implementations, no JSX/CSS blocks, no "here's the code to write". Name the module, function, or type and describe its contract and behavior in prose instead. (Illustrative examples of *observable output* — a CLI transcript, an error message the user will see, an ASCII sketch of UI — are fine. A type or code the implementer would paste is not.) If the draft already contains implementation code, you may leave it, but do not extend it; if it contradicts what you verified in the repo, replace it with a prose description rather than corrected code.
28
28
  2. **Editing any file other than the chosen plan.** No source, no tests, no config, no other plans.
29
- 3. **Moving the plan out of `product/plans/draft/`.** Promotion to `ready/` is the human's status decision (see the plan-storage section in [`CLAUDE.md`](../../CLAUDE.md)).
29
+ 3. **Moving the plan out of `./product/plans/draft/`.** Promotion to `ready/` is the human's status decision (see the plan-storage section in [`CLAUDE.md`](../../CLAUDE.md)).
30
30
  4. **Deciding product scope.** If the plan's *goal* seems wrong or not worth doing, say so in your report — do not rewrite the goal.
31
31
 
32
32
  ---
@@ -40,7 +40,7 @@ Execute `ai/tasks/prepare-workspace.md` in full before doing anything else.
40
40
  ## Step 1 — Pick the plan
41
41
 
42
42
  - If you were pointed at a specific plan file, use that one.
43
- - Otherwise list `product/plans/draft/`. Exactly one plan there → that is your target. More than one → report the list and stop (the human picks). None → report that and stop.
43
+ - Otherwise list `./product/plans/draft/`. Exactly one plan there → that is your target. More than one → report the list and stop (the human picks). None → report that and stop.
44
44
 
45
45
  State your pick in one sentence.
46
46
 
@@ -51,7 +51,7 @@ State your pick in one sentence.
51
51
  1. Read the entire plan.
52
52
  2. For **every** file path, function, type, command, line anchor, and behavioral claim the plan makes, open the real thing and check it. Grep for symbols rather than trusting quoted line numbers — line anchors drift.
53
53
  3. Read the project constraints that shape any implementation here: the ESLint rules and file-size limit in [`CLAUDE.md`](../../CLAUDE.md) (200-line `max-lines`, `.js` import extensions in `src/`, type-aware rules), and the test conventions (`src/**/*.test.ts`, `web/src/**/*.test.tsx`).
54
- 4. Skim one or two plans in `product/plans/ready/` to match the house style — they follow a shape like: Goal, Design decisions, "What already exists (reuse, don't rebuild)" table, Implementation steps, Tests, Verification, Out of scope.
54
+ 4. Skim one or two plans in `./product/plans/ready/` to match the house style — they follow a shape like: Goal, Design decisions, "What already exists (reuse, don't rebuild)" table, Implementation steps, Tests, Verification, Out of scope.
55
55
 
56
56
  ---
57
57
 
@@ -86,7 +86,7 @@ Edit the plan file to remove everything you found. Rules of thumb:
86
86
 
87
87
  ## Step 5 — Assess and record complexity
88
88
 
89
- Rate the (now improved) plan **1–10** for implementation complexity. Calibration, consistent with the ratings on the plans in `product/plans/ready/`:
89
+ Rate the (now improved) plan **1–10** for implementation complexity. Calibration, consistent with the ratings on the plans in `./product/plans/ready/`:
90
90
 
91
91
  - **1–2** — one small module or pure wiring; no new protocol/persistence/UI surface. (`cli-help-version`, `prompt-click-prefill` are 2s.)
92
92
  - **3–4** — small feature, but correctness depends on catching several call sites or coordinating with other plans; or it spans server and web with a new RPC or persistence field. (`unread-badge` is a 3, `tab-name-alias` a 4.)
@@ -112,7 +112,7 @@ If the plan already has a complexity line, update it — after your improvements
112
112
  Then give the user a short report in this exact shape:
113
113
 
114
114
  ```
115
- Plan: product/plans/draft/<file>
115
+ Plan: ./product/plans/draft/<file>
116
116
  Complexity: N/10 — <rationale>
117
117
  Fixed: <short bullets — each wrong reference corrected, ambiguity resolved, decision made, gap filled>
118
118
  Open: <anything only the human can decide, e.g. scope doubts — or "nothing">
@@ -8,8 +8,6 @@ Your job: run the security tools, list **every** finding, automatically apply th
8
8
 
9
9
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
10
10
 
11
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
12
-
13
11
  **Why security is different from other cleanups:** a wrong security "fix" still passes the tests. If you silence a warning, weaken a check, or delete a guard, `tsc`, the linter, and the tests all stay green — so they **cannot** tell you that you made the code less safe. Because nothing will catch a bad call, you must not make security judgment calls. Detect and report; let a human decide.
14
12
 
15
13
  Do the steps below **in order**. Do not skip steps. Do not invent your own process.
@@ -6,8 +6,6 @@ Your job: run the CSS linter, pick the single most valuable fix, assess its risk
6
6
 
7
7
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
8
8
 
9
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
10
-
11
9
  Do the steps below **in order**. Do not skip steps. Do not invent your own process.
12
10
 
13
11
  **Shell hygiene:** run every command on its own line — no `&&` chaining, no `; echo "Exit code: $?"` suffixes, no subshell captures. The exit code and output are visible in the tool result. To run a project script, always use `./scripts/run.mjs <name>` — never call `node scripts/<name>.mjs` directly.
@@ -6,8 +6,6 @@ Your job: add tests that raise this project's test coverage. Do exactly **one fi
6
6
 
7
7
  **Run everything synchronously, in the foreground.** Never use `run_in_background`, `&`, or otherwise start a background process (dev servers, watchers, long-lived processes) — every command must finish and return its exit code before you move to the next step.
8
8
 
9
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to research, explore, or implement any part of this task on your behalf.
10
-
11
9
  Do the steps below **in order**. Do not skip steps. Do not invent your own process.
12
10
 
13
11
  **Shell hygiene:** run every command on its own line — no `&&` chaining, no `; echo "Exit code: $?"` suffixes, no subshell captures. The exit code and output are visible in the tool result. To run a project script, always use `./scripts/run.mjs <name>` — never call `node scripts/<name>.mjs` directly.
@@ -10,8 +10,6 @@ Every step is a script in `scripts/pr-*.sh`, invoked through the script runner.
10
10
 
11
11
  **Always run scripts in the foreground.** Never use `run_in_background` — each script must complete and return its exit code before the next step begins.
12
12
 
13
- **No subagents, no background agents.** Do every step yourself — never launch a subagent (Task/Agent tool, `fork`, or otherwise) to do any part of this task on your behalf.
14
-
15
13
  **Do not ask the user for input at any point.** Make all decisions autonomously — branch names, commit messages, PR titles and bodies. The only valid reason to stop is an unresolvable error.
16
14
 
17
15
  ---