ghostrail 0.0.0 → 0.2.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 (163) hide show
  1. package/README.md +49 -3
  2. package/dist/agent/claude-code.d.ts +10 -0
  3. package/dist/agent/claude-code.d.ts.map +1 -1
  4. package/dist/agent/claude-code.js +20 -0
  5. package/dist/agent/claude-code.js.map +1 -1
  6. package/dist/agent/result.d.ts.map +1 -1
  7. package/dist/agent/result.js +13 -2
  8. package/dist/agent/result.js.map +1 -1
  9. package/dist/backend/container.d.ts +18 -0
  10. package/dist/backend/container.d.ts.map +1 -1
  11. package/dist/backend/container.js +33 -10
  12. package/dist/backend/container.js.map +1 -1
  13. package/dist/backend/git-credentials.d.ts +18 -0
  14. package/dist/backend/git-credentials.d.ts.map +1 -0
  15. package/dist/backend/git-credentials.js +30 -0
  16. package/dist/backend/git-credentials.js.map +1 -0
  17. package/dist/backend/local-worktree.d.ts.map +1 -1
  18. package/dist/backend/local-worktree.js +21 -0
  19. package/dist/backend/local-worktree.js.map +1 -1
  20. package/dist/backend/types.d.ts +12 -1
  21. package/dist/backend/types.d.ts.map +1 -1
  22. package/dist/claude-profile/classify.d.ts +41 -0
  23. package/dist/claude-profile/classify.d.ts.map +1 -0
  24. package/dist/claude-profile/classify.js +103 -0
  25. package/dist/claude-profile/classify.js.map +1 -0
  26. package/dist/claude-profile/index.d.ts +3 -0
  27. package/dist/claude-profile/index.d.ts.map +1 -0
  28. package/dist/claude-profile/index.js +3 -0
  29. package/dist/claude-profile/index.js.map +1 -0
  30. package/dist/claude-profile/setup.d.ts +33 -0
  31. package/dist/claude-profile/setup.d.ts.map +1 -0
  32. package/dist/claude-profile/setup.js +81 -0
  33. package/dist/claude-profile/setup.js.map +1 -0
  34. package/dist/cli/commands.d.ts +67 -2
  35. package/dist/cli/commands.d.ts.map +1 -1
  36. package/dist/cli/commands.js +420 -17
  37. package/dist/cli/commands.js.map +1 -1
  38. package/dist/cli.d.ts.map +1 -1
  39. package/dist/cli.js +13 -1
  40. package/dist/cli.js.map +1 -1
  41. package/dist/commands/help.d.ts.map +1 -1
  42. package/dist/commands/help.js +20 -2
  43. package/dist/commands/help.js.map +1 -1
  44. package/dist/config/load.d.ts.map +1 -1
  45. package/dist/config/load.js +61 -9
  46. package/dist/config/load.js.map +1 -1
  47. package/dist/config/schema.d.ts +51 -3
  48. package/dist/config/schema.d.ts.map +1 -1
  49. package/dist/config/schema.js +4 -0
  50. package/dist/config/schema.js.map +1 -1
  51. package/dist/factory/build.d.ts +24 -0
  52. package/dist/factory/build.d.ts.map +1 -1
  53. package/dist/factory/build.js +80 -11
  54. package/dist/factory/build.js.map +1 -1
  55. package/dist/loop/concurrency.d.ts +13 -0
  56. package/dist/loop/concurrency.d.ts.map +1 -0
  57. package/dist/loop/concurrency.js +27 -0
  58. package/dist/loop/concurrency.js.map +1 -0
  59. package/dist/loop/engine.d.ts.map +1 -1
  60. package/dist/loop/engine.js +19 -14
  61. package/dist/loop/engine.js.map +1 -1
  62. package/dist/loop/index.d.ts +2 -0
  63. package/dist/loop/index.d.ts.map +1 -1
  64. package/dist/loop/index.js +2 -0
  65. package/dist/loop/index.js.map +1 -1
  66. package/dist/loop/ports.d.ts +37 -1
  67. package/dist/loop/ports.d.ts.map +1 -1
  68. package/dist/loop/watch.d.ts +25 -0
  69. package/dist/loop/watch.d.ts.map +1 -0
  70. package/dist/loop/watch.js +45 -0
  71. package/dist/loop/watch.js.map +1 -0
  72. package/dist/publish/gh.d.ts +20 -1
  73. package/dist/publish/gh.d.ts.map +1 -1
  74. package/dist/publish/gh.js +37 -3
  75. package/dist/publish/gh.js.map +1 -1
  76. package/dist/publish/githost.d.ts +12 -0
  77. package/dist/publish/githost.d.ts.map +1 -1
  78. package/dist/publish/githost.js +14 -0
  79. package/dist/publish/githost.js.map +1 -1
  80. package/dist/publish/github-publisher.d.ts +1 -1
  81. package/dist/publish/github-publisher.d.ts.map +1 -1
  82. package/dist/publish/github-publisher.js +6 -5
  83. package/dist/publish/github-publisher.js.map +1 -1
  84. package/dist/respond/respond.d.ts +10 -1
  85. package/dist/respond/respond.d.ts.map +1 -1
  86. package/dist/respond/respond.js +37 -3
  87. package/dist/respond/respond.js.map +1 -1
  88. package/dist/secrets/env-file.d.ts +23 -0
  89. package/dist/secrets/env-file.d.ts.map +1 -0
  90. package/dist/secrets/env-file.js +70 -0
  91. package/dist/secrets/env-file.js.map +1 -0
  92. package/dist/secrets/index.d.ts +4 -0
  93. package/dist/secrets/index.d.ts.map +1 -0
  94. package/dist/secrets/index.js +4 -0
  95. package/dist/secrets/index.js.map +1 -0
  96. package/dist/secrets/load.d.ts +24 -0
  97. package/dist/secrets/load.d.ts.map +1 -0
  98. package/dist/secrets/load.js +43 -0
  99. package/dist/secrets/load.js.map +1 -0
  100. package/dist/skill/install.d.ts +56 -0
  101. package/dist/skill/install.d.ts.map +1 -0
  102. package/dist/skill/install.js +93 -0
  103. package/dist/skill/install.js.map +1 -0
  104. package/dist/source/linear.d.ts +51 -8
  105. package/dist/source/linear.d.ts.map +1 -1
  106. package/dist/source/linear.js +213 -23
  107. package/dist/source/linear.js.map +1 -1
  108. package/dist/triage/apply.d.ts +28 -0
  109. package/dist/triage/apply.d.ts.map +1 -0
  110. package/dist/triage/apply.js +68 -0
  111. package/dist/triage/apply.js.map +1 -0
  112. package/dist/triage/engine.d.ts +31 -0
  113. package/dist/triage/engine.d.ts.map +1 -0
  114. package/dist/triage/engine.js +122 -0
  115. package/dist/triage/engine.js.map +1 -0
  116. package/dist/triage/index.d.ts +4 -0
  117. package/dist/triage/index.d.ts.map +1 -0
  118. package/dist/triage/index.js +4 -0
  119. package/dist/triage/index.js.map +1 -0
  120. package/dist/triage/plan.d.ts +37 -0
  121. package/dist/triage/plan.d.ts.map +1 -0
  122. package/dist/triage/plan.js +75 -0
  123. package/dist/triage/plan.js.map +1 -0
  124. package/dist/vendor/skilltend/apply.d.ts +25 -0
  125. package/dist/vendor/skilltend/apply.d.ts.map +1 -0
  126. package/dist/vendor/skilltend/apply.js +85 -0
  127. package/dist/vendor/skilltend/apply.js.map +1 -0
  128. package/dist/vendor/skilltend/detect.d.ts +35 -0
  129. package/dist/vendor/skilltend/detect.d.ts.map +1 -0
  130. package/dist/vendor/skilltend/detect.js +187 -0
  131. package/dist/vendor/skilltend/detect.js.map +1 -0
  132. package/dist/vendor/skilltend/frontmatter.d.ts +5 -0
  133. package/dist/vendor/skilltend/frontmatter.d.ts.map +1 -0
  134. package/dist/vendor/skilltend/frontmatter.js +59 -0
  135. package/dist/vendor/skilltend/frontmatter.js.map +1 -0
  136. package/dist/vendor/skilltend/fsFacade.d.ts +24 -0
  137. package/dist/vendor/skilltend/fsFacade.d.ts.map +1 -0
  138. package/dist/vendor/skilltend/fsFacade.js +68 -0
  139. package/dist/vendor/skilltend/fsFacade.js.map +1 -0
  140. package/dist/vendor/skilltend/paths.d.ts +28 -0
  141. package/dist/vendor/skilltend/paths.d.ts.map +1 -0
  142. package/dist/vendor/skilltend/paths.js +24 -0
  143. package/dist/vendor/skilltend/paths.js.map +1 -0
  144. package/dist/vendor/skilltend/plan.d.ts +46 -0
  145. package/dist/vendor/skilltend/plan.d.ts.map +1 -0
  146. package/dist/vendor/skilltend/plan.js +79 -0
  147. package/dist/vendor/skilltend/plan.js.map +1 -0
  148. package/dist/vendor/skilltend/registry.d.ts +56 -0
  149. package/dist/vendor/skilltend/registry.d.ts.map +1 -0
  150. package/dist/vendor/skilltend/registry.js +129 -0
  151. package/dist/vendor/skilltend/registry.js.map +1 -0
  152. package/docker/factory.Dockerfile +39 -0
  153. package/package.json +4 -3
  154. package/skill/ghostrail/SKILL.md +145 -0
  155. package/templates/{fix-bugs-local → code-local}/README.md +3 -3
  156. package/templates/code-local/ghostrail.toml +44 -0
  157. package/templates/code-local/prompts/resolve-issue.md +31 -0
  158. package/templates/code-local/prompts/respond.md +27 -0
  159. package/templates/code-local/prompts/triage.md +51 -0
  160. package/templates/content-loop/ghostrail.toml +5 -2
  161. package/templates/content-loop/prompts/respond.md +25 -0
  162. package/templates/fix-bugs-local/ghostrail.toml +0 -37
  163. package/templates/fix-bugs-local/prompts/fix-bug.md +0 -27
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: ghostrail
3
+ description: Drive ghostrail (the software factory) from inside this repo. Use when the user types /ghostrail, or asks to set up, customize, check, or run a ghostrail factory — scaffolding ghostrail.toml and prompts, tailoring the scaffolded prompts and gate commands to this codebase, diagnosing a broken setup, or kicking off a run/respond/triage tick.
4
+ user-invocable: true
5
+ argument-hint: "[customize | init | doctor | status | run | respond | triage]"
6
+ license: Apache-2.0
7
+ metadata:
8
+ version: 0.1.0
9
+ allowed-tools:
10
+ - Read
11
+ - Write
12
+ - Edit
13
+ - Grep
14
+ - Glob
15
+ - Bash(npx ghostrail *)
16
+ - Bash(ghostrail *)
17
+ - Bash(git *)
18
+ - Bash(ls *)
19
+ - Bash(cat *)
20
+ - Bash(docker images *)
21
+ - Bash(gh auth status *)
22
+ ---
23
+
24
+ # /ghostrail — drive the factory from the repo
25
+
26
+ Ghostrail turns this repo into a software factory: it finds eligible tracker
27
+ work, isolates it, runs a sandboxed coding agent that only writes files, gates
28
+ the result against a mirror of CI, and opens a pull request. It never merges.
29
+
30
+ Dispatch on the argument. With no argument, run **doctor** and then say what the
31
+ useful next step is.
32
+
33
+ ## Resolving the CLI (do this first, every time)
34
+
35
+ Pick the first that works and reuse it for the whole session:
36
+
37
+ 1. `ghostrail --help` (a global install)
38
+ 2. `npx ghostrail --help` (published package)
39
+ 3. A local dev checkout, if this *is* the ghostrail repo: `node dist/bin.js --help`
40
+
41
+ Refer to the chosen form as `<GR>` below. If none work, say so and stop; do not
42
+ hand-roll the factory's behavior.
43
+
44
+ ---
45
+
46
+ ## customize
47
+
48
+ The headline command. `ghostrail init` scaffolds deliberately generic prompts;
49
+ this tailors them to *this* repo. Never guess: read before proposing.
50
+
51
+ 1. **Confirm the setup exists.** If there is no `ghostrail.toml`, say so and
52
+ offer to run **init** first.
53
+ 2. **Survey the repo.** Gather evidence, don't assume:
54
+ - Language and layout: manifest files, workspace/monorepo config, `src/` shape.
55
+ - **Real CI commands** — read the CI workflow (e.g. `.github/workflows/*.yml`)
56
+ and the package scripts. The gate must mirror CI, in CI's order, including
57
+ any env vars a build step needs.
58
+ - Test conventions: framework, where tests live, naming.
59
+ - House style: a `CONTRIBUTING.md`, `AGENTS.md`, `CLAUDE.md`, or lint config.
60
+ 3. **Propose edits, then apply on approval.** Show a concrete diff for:
61
+ - `prompts/resolve-issue.md` — the stack, the layout, where code and tests
62
+ live, the project's conventions, and the exact lint/typecheck/test commands
63
+ the agent should run. Keep the `.ghostrail/result.json` contract intact.
64
+ - `prompts/respond.md` — same context; keep it reading `.ghostrail/feedback.md`.
65
+ - `prompts/triage.md` — what a right-sized issue looks like in this codebase.
66
+ - `[gate].commands` — mirroring CI exactly.
67
+ - `[source]` — the team/project/label/assignee filters, if you can tell what
68
+ they should be. Ask rather than invent tracker identifiers.
69
+ 4. **Do not touch** `[output].auto_merge` (it must stay `false`) or invent
70
+ credentials.
71
+
72
+ State plainly what you changed and what still needs a human (tracker IDs, tokens).
73
+
74
+ ---
75
+
76
+ ## init
77
+
78
+ Scaffold the factory into this repo, then hand off to **customize**.
79
+
80
+ 1. Choose the template from the repo's nature, and say why:
81
+ - `code-local` — a code repo (gated by CI, opens PRs).
82
+ - `content-loop` — a writing/content repo (no code gate, draft PRs).
83
+ 2. Run `<GR> init <template>`. It is non-clobbering: existing files are kept
84
+ unless `--force`. Report what was written vs kept.
85
+ 3. Tell the user the two things the scaffold can't know (repo-specific prompt
86
+ detail and the tracker filters), and offer to run **customize** now.
87
+
88
+ ---
89
+
90
+ ## doctor
91
+
92
+ Diagnose a setup without changing anything. Check and report each, with the fix:
93
+
94
+ - **CLI** — which form resolved, and its `<GR> version`.
95
+ - **Config** — `ghostrail.toml` present, and it parses. Any ghostrail command
96
+ prints config errors with a dotted path; use that to point at the exact key.
97
+ - **Prompts** — every path referenced by `[agent].prompt`, `[respond].prompt`,
98
+ and `[triage].prompt` exists.
99
+ - **Gate** — `[gate].commands` is non-empty for a code factory, and the commands
100
+ actually exist in the project's scripts.
101
+ - **Credentials** — report which of `LINEAR_API_KEY`, `GH_TOKEN`/`GITHUB_TOKEN`,
102
+ and `ANTHROPIC_API_KEY` **or** `CLAUDE_CODE_OAUTH_TOKEN` are set. Report only
103
+ set/unset, **never print a value**. Note that `ANTHROPIC_API_KEY` wins over the
104
+ OAuth token, so it must be unset to bill a Pro/Max subscription.
105
+ - **GitHub** — `gh auth status` succeeds.
106
+ - **Container backend**, if `[backend].kind = "container"` — the configured
107
+ `image` exists locally (`docker images`). If not, it must be built.
108
+
109
+ Finish with a short ordered list of what to fix first.
110
+
111
+ ---
112
+
113
+ ## status
114
+
115
+ Read-only picture of the factory: the configured queues (source/triage
116
+ eligibility filters), and recent runs from the local store under `.factory/`
117
+ (`events.ndjson`). Summarize the last few runs and their outcomes. For a live
118
+ view, suggest `<GR> board`.
119
+
120
+ ---
121
+
122
+ ## run · respond · triage
123
+
124
+ Passthroughs. Before executing, state what will happen and confirm, because these
125
+ act on real tracker items and can open real pull requests.
126
+
127
+ - `run` — one tick over the fix queue. **If `[output].open_pr` is true, this opens
128
+ a real PR.** Suggest a dry run first (`open_pr = false`) for a new setup.
129
+ - `respond` — folds new PR and tracker comments into existing factory branches.
130
+ - `triage` — decomposes large issues into sub-issues (creates real tracker items).
131
+
132
+ Run `<GR> <command>` and summarize the resulting JSON: per item, the state
133
+ (`done` / `blocked` / `failed` / `noop` / `skipped`), the gate steps if present,
134
+ and any PR URL. On failure, quote the actual error rather than paraphrasing.
135
+
136
+ ---
137
+
138
+ ## Rules
139
+
140
+ - **Never** set `auto_merge = true` or merge a factory PR. A human owns merges.
141
+ - **Never** print or commit a secret. Report credentials as set/unset only.
142
+ - Prefer editing the scaffolded prompts over rewriting them; they already encode
143
+ the `.ghostrail/result.json` and `.ghostrail/triage.json` contracts the factory
144
+ depends on, and breaking those breaks the loop.
145
+ - When you don't know a tracker identifier (team key, project, labels), ask.
@@ -1,12 +1,12 @@
1
- # fix-bugs-local
1
+ # code-local
2
2
 
3
3
  A code factory that runs on your own hardware with zero infrastructure. It drains
4
4
  eligible tracker issues, fixes each in an isolated git worktree, gates the result
5
5
  against your CI, and opens a pull request. It never merges.
6
6
 
7
7
  ## Setup
8
- 1. `ghostrail init fix-bugs-local` in your repo (or copy this folder in).
9
- 2. Edit `ghostrail.toml`: set `source.project` to your Linear team key and the
8
+ 1. `ghostrail init code-local` in your repo (or copy this folder in).
9
+ 2. Edit `ghostrail.toml`: set `source.team` to your Linear team key and the
10
10
  `eligible` filter, and set `gate.commands` to your CI steps.
11
11
  3. Export `LINEAR_API_KEY` (a Linear personal API key) and make sure `gh` is
12
12
  authenticated for your repo.
@@ -0,0 +1,44 @@
1
+ # code-local: a code factory on your own hardware, zero infrastructure.
2
+ # Point it at a repo and a tracker queue; it resolves issues and opens PRs you merge.
3
+
4
+ [factory]
5
+ name = "code-local"
6
+ base_branch = "main"
7
+
8
+ [source]
9
+ kind = "linear" # linear | github-issues (Phase 2)
10
+ team = "TJ" # your Linear team key
11
+ eligible = { state = "Todo", label = "factory", assignee = "unassigned" }
12
+
13
+ [agent]
14
+ kind = "claude-code"
15
+ prompt = "prompts/resolve-issue.md"
16
+ # default allowed_tools = ["Read", "Edit", "Write", "Bash", "Grep", "Glob"]
17
+
18
+ [backend]
19
+ kind = "local-worktree" # zero infrastructure; git worktree in place
20
+
21
+ [gate] # the oracle: mirror your CI
22
+ commands = [
23
+ "pnpm install --frozen-lockfile",
24
+ "pnpm lint",
25
+ "pnpm typecheck",
26
+ "pnpm test:unit",
27
+ "pnpm build",
28
+ ]
29
+
30
+ [guardrails]
31
+ max_items_per_run = 3
32
+ budget_usd_per_item = 3
33
+ timeout = "30m"
34
+
35
+ [output]
36
+ open_pr = true
37
+ auto_merge = false # a human owns every merge
38
+
39
+ [respond] # `ghostrail respond` folds PR + tracker comments back in
40
+ prompt = "prompts/respond.md"
41
+
42
+ [triage] # `ghostrail triage` splits large issues into sub-issues
43
+ prompt = "prompts/triage.md"
44
+ eligible = { state = "Todo", label = "triage", assignee = "unassigned" }
@@ -0,0 +1,31 @@
1
+ # Resolve an issue
2
+
3
+ You are a coding agent working in an isolated checkout of this repository. Resolve
4
+ the issue described below, whatever kind it is: a bug fix, a new feature, a
5
+ refactor, or a docs change. You may only read and write files and run shell
6
+ commands in this workspace. Do not use git: the factory owns commits, branches,
7
+ and PRs.
8
+
9
+ Match the surrounding code: its style, patterns, and test conventions.
10
+
11
+ ## The issue
12
+ - ID: {{id}}
13
+ - Title: {{title}}
14
+ - Link: {{url}}
15
+
16
+ ## What to do
17
+ 1. Locate the relevant code and understand how it is structured.
18
+ 2. Make the smallest correct change that resolves the issue.
19
+ 3. Add or update tests (author them from the intent, not the implementation).
20
+ 4. Run the project's lint, typecheck, and unit-test commands and fix what you touched.
21
+
22
+ ## Reporting your result (required, do this last)
23
+ Write a JSON file at `.ghostrail/result.json` with exactly one of:
24
+
25
+ - `{"status":"done","summary":"<what you changed>","type":"<feat|fix|docs|refactor|chore|...>"}`
26
+ - `{"status":"blocked","questions":"<a real product/design decision you need>"}`
27
+ - `{"status":"failed","error":"<why>"}`
28
+ - `{"status":"noop"}`
29
+
30
+ `type` is the conventional-commit type for the change; it sets the commit and PR
31
+ title. If you omit it, the factory's configured default is used.
@@ -0,0 +1,27 @@
1
+ # Respond to review feedback
2
+
3
+ You are a coding agent in an isolated checkout of this repository, on the branch
4
+ of an open pull request. New human feedback has been left on the PR or its tracker
5
+ issue. Address it. You may only read and write files and run shell commands in
6
+ this workspace. Do not use git: the factory owns commits and pushes.
7
+
8
+ ## The feedback
9
+ Read `.ghostrail/feedback.md`. It contains the new comments (author and time),
10
+ newest work last. Treat it as the review to act on.
11
+
12
+ ## What to do
13
+ 1. Read the feedback and the current state of the branch.
14
+ 2. Make the changes it asks for, matching the surrounding code and tests.
15
+ 3. Run the project's lint, typecheck, and unit-test commands and fix what you touched.
16
+ 4. If a comment is a question rather than a change request, answer it in your result
17
+ (see `blocked`) instead of guessing.
18
+
19
+ ## Reporting your result (required, do this last)
20
+ Write a JSON file at `.ghostrail/result.json` with exactly one of:
21
+
22
+ - `{"status":"done","summary":"<what you changed in response>"}`
23
+ - `{"status":"blocked","questions":"<what you need answered>"}`
24
+ - `{"status":"failed","error":"<why>"}`
25
+ - `{"status":"noop"}`
26
+
27
+ On `done` the factory commits and pushes to the PR branch and posts a summary.
@@ -0,0 +1,51 @@
1
+ # Triage an issue
2
+
3
+ You are triaging an issue in an isolated checkout of this repository. Your job is
4
+ NOT to fix it: it is to decide whether the issue is too large to fix in one pass
5
+ and, if so, propose how to break it into smaller, ordered sub-issues. Do not use
6
+ git and do not change any source files except the two output files below.
7
+
8
+ ## The issue
9
+ - ID: {{id}}
10
+ - Title: {{title}}
11
+ - Link: {{url}}
12
+
13
+ ## What to do
14
+ 1. Read the issue and enough of the codebase to judge its scope.
15
+ 2. Decide:
16
+ - **Atomic** — a single, focused change a coding agent can do in one pass.
17
+ - **Too large** — spans several independent changes, or mixes unrelated
18
+ concerns. Propose 2 to 6 sub-issues, each independently shippable, ordered so
19
+ that dependencies come first.
20
+ 3. Write the plan to `.ghostrail/triage.json` (schema below).
21
+ 4. Write `.ghostrail/result.json` with `{"status":"done","summary":"<one line>"}`
22
+ when you produced a plan, or `{"status":"blocked","questions":"<what you need>"}`
23
+ if you genuinely cannot decide without a human.
24
+
25
+ ## `.ghostrail/triage.json` schema
26
+
27
+ Atomic (no split):
28
+
29
+ ```json
30
+ { "status": "noop", "reason": "<why it is already the right size>" }
31
+ ```
32
+
33
+ Split into sub-issues:
34
+
35
+ ```json
36
+ {
37
+ "status": "split",
38
+ "reason": "<why it needs splitting>",
39
+ "subIssues": [
40
+ { "title": "First, self-contained step", "description": "<what and why>" },
41
+ { "title": "Second step", "description": "<...>", "dependsOn": [0] }
42
+ ]
43
+ }
44
+ ```
45
+
46
+ - `dependsOn` lists the indices of earlier sub-issues (0-based, all strictly
47
+ less than the current one) that must be done first.
48
+ - Keep titles imperative and specific. Each sub-issue should stand on its own.
49
+
50
+ The factory creates the sub-issues (unassigned) and a human assigns each to the
51
+ bot to start work; the parent leaves the triage queue.
@@ -13,8 +13,8 @@ base_branch = "main"
13
13
 
14
14
  [source]
15
15
  kind = "linear"
16
- project = "TJ" # your Linear team key
17
- eligible = { state = "Todo", label = "draft", unassigned = true }
16
+ team = "TJ" # your Linear team key
17
+ eligible = { state = "Todo", label = "draft", assignee = "unassigned" }
18
18
 
19
19
  [agent]
20
20
  kind = "claude-code"
@@ -34,3 +34,6 @@ timeout = "30m"
34
34
  open_pr = true
35
35
  draft = true # content PRs open as drafts
36
36
  auto_merge = false
37
+
38
+ [respond] # fold PR + tracker feedback back into the draft
39
+ prompt = "prompts/respond.md"
@@ -0,0 +1,25 @@
1
+ # Respond to feedback on a draft
2
+
3
+ You are a writing agent in an isolated checkout of this repository, on the branch
4
+ of an open draft pull request. New human feedback has been left on the PR or its
5
+ tracker issue. Revise the draft to address it. You may only read and write files
6
+ and run shell commands in this workspace. Do not use git: the factory owns commits
7
+ and pushes.
8
+
9
+ ## The feedback
10
+ Read `.ghostrail/feedback.md`. It contains the new comments (author and time),
11
+ newest work last. Treat it as the editorial review to act on.
12
+
13
+ ## What to do
14
+ 1. Read the feedback and the current draft on this branch.
15
+ 2. Revise the draft accordingly, keeping the established voice and format.
16
+ 3. If a comment is a question rather than a change, answer it in your result
17
+ (`blocked`) instead of guessing.
18
+
19
+ ## Reporting your result (required, do this last)
20
+ Write a JSON file at `.ghostrail/result.json` with exactly one of:
21
+
22
+ - `{"status":"done","summary":"<what you revised>"}`
23
+ - `{"status":"blocked","questions":"<what you need answered>"}`
24
+ - `{"status":"failed","error":"<why>"}`
25
+ - `{"status":"noop"}`
@@ -1,37 +0,0 @@
1
- # fix-bugs-local: a code factory on your own hardware, zero infrastructure.
2
- # Point it at a repo and a tracker label; it fixes bugs and opens PRs you merge.
3
-
4
- [factory]
5
- name = "fix-bugs"
6
- base_branch = "main"
7
-
8
- [source]
9
- kind = "linear" # linear | github-issues (Phase 2)
10
- project = "TJ" # your Linear team key
11
- eligible = { state = "Todo", label = "factory", unassigned = true }
12
-
13
- [agent]
14
- kind = "claude-code"
15
- prompt = "prompts/fix-bug.md"
16
- # default allowed_tools = ["Read", "Edit", "Write", "Bash", "Grep", "Glob"]
17
-
18
- [backend]
19
- kind = "local-worktree" # zero infrastructure; git worktree in place
20
-
21
- [gate] # the oracle: mirror your CI
22
- commands = [
23
- "pnpm install --frozen-lockfile",
24
- "pnpm lint",
25
- "pnpm typecheck",
26
- "pnpm test:unit",
27
- "pnpm build",
28
- ]
29
-
30
- [guardrails]
31
- max_items_per_run = 3
32
- budget_usd_per_item = 3
33
- timeout = "30m"
34
-
35
- [output]
36
- open_pr = true
37
- auto_merge = false # a human owns every merge
@@ -1,27 +0,0 @@
1
- # Fix a bug
2
-
3
- You are a coding agent working in an isolated checkout of a repository. Fix the
4
- issue described below. You may only read and write files and run shell commands
5
- in this workspace. Do not use git: the factory owns commits, branches, and PRs.
6
-
7
- ## The issue
8
- - ID: {{id}}
9
- - Title: {{title}}
10
- - Link: {{url}}
11
-
12
- ## What to do
13
- 1. Reproduce and locate the bug.
14
- 2. Make the smallest correct fix.
15
- 3. Add or update unit tests that cover it.
16
- 4. Keep the change focused; do not refactor unrelated code.
17
-
18
- ## Reporting your result (required, do this last)
19
- Write a JSON file at `.ghostrail/result.json` with exactly one of these shapes:
20
-
21
- - Success: `{"status":"done","summary":"<what you changed, one paragraph>"}`
22
- - Needs a human decision: `{"status":"blocked","questions":"<the decision you need>"}`
23
- - Could not fix it: `{"status":"failed","error":"<why>"}`
24
- - No change needed: `{"status":"noop"}`
25
-
26
- The factory reads this file to decide what to do, then runs your CI gate and, if
27
- it passes, opens a pull request for a human to review and merge.