From 5a66cbcc6d5a044cd8387ad90f30ac01a75b1024 Mon Sep 17 00:00:00 2001 From: Jakob Heuser Date: Tue, 13 Oct 2026 23:06:55 -0700 Subject: [PATCH] fix(onboard): script the introduction to the one question The recipe scripted only the question, so the host agent wrote its own introduction from the consent sentence and the source list, naming a 90-day window and a specific tracker. Script the introduction word for word and tell the agent not to reword or extend it. --- openspec/specs/cli-onboard/spec.md | 3 ++- packages/cli/src/agent/onboard.md | 20 +++++++++++++------- packages/cli/test/onboard.test.ts | 3 ++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/openspec/specs/cli-onboard/spec.md b/openspec/specs/cli-onboard/spec.md index 900b462d..8a900a5b 100644 --- a/openspec/specs/cli-onboard/spec.md +++ b/openspec/specs/cli-onboard/spec.md @@ -172,7 +172,7 @@ The `onboard.md` file SHALL follow the canonical recipe template defined in the The recipe SHALL instruct the agent to: 1. Read `.taskless/taskless.json` and respect the `install.onboarded` field. -2. Ask the user exactly one question, "Do you want me to set up Taskless for you?", set apart from surrounding text by blank lines, and through the host's structured question tool when the host has one. The recipe SHALL state that a yes covers mining the repository, writing rules, publishing the report, and sending onboarding feedback. On anything but a yes the agent SHALL stop. +2. Ask the user exactly one question, "Do you want me to set up Taskless for you?", preceded by a scripted introduction the agent SHALL repeat word for word and SHALL NOT reword or extend, set apart from surrounding text by blank lines, and through the host's structured question tool when the host has one. The introduction SHALL name the sources in general terms (the repository, agent files, documentation, PRs, bug tracking), state that rules are written locally with no login, and state that a report is generated. The recipe SHALL state that a yes covers mining the repository, writing rules, publishing the report, and sending onboarding feedback. On anything but a yes the agent SHALL stop. 3. Establish the routing surface before proposing any candidate, by fetching the `route` topic for the destination criterion and running `taskless detect --json` for the repository's linters, languages, rule styles, host tools, and `agent` hints. 4. Mine every reachable source without asking which: codebase TODOs/FIXMEs, agent-memory files (CLAUDE.md, AGENTS.md, .cursorrules, and similar), review comments through whichever host tool `detect` reports present and applicable (pull requests through `gh`, merge requests through `glab`), and any MCP the agent has that reaches a bug tracker, an engineering-context tool, or architectural decisions. Whether to run a hinted command such as `gh auth status`, and which MCPs to use, SHALL be left to the agent. 5. Filter for high-signal candidates: repeated patterns across multiple PRs/files/comments, comments that cite a doc or style guide, and merge-blocking review feedback; drop one-off nits and pure formatting feedback. @@ -203,6 +203,7 @@ The recipe SHALL NOT restate the destination criterion itself; it SHALL referenc - **WHEN** the recipe `## Steps` section is read - **THEN** it SHALL contain the question "Do you want me to set up Taskless for you?" +- **AND** SHALL precede it with the scripted introduction, and direct the agent not to reword or extend it - **AND** SHALL direct the agent to use the host's structured question tool when one exists - **AND** no other step SHALL direct the agent to ask the user a question, except the step handling a refused report gate and the closing CI offer diff --git a/packages/cli/src/agent/onboard.md b/packages/cli/src/agent/onboard.md index 4c56c073..808eef66 100644 --- a/packages/cli/src/agent/onboard.md +++ b/packages/cli/src/agent/onboard.md @@ -30,16 +30,22 @@ making the case for running them in CI. you; if you reached this recipe another way and it is true, stop and tell the user onboarding already ran. -2. **Ask the one question.** Put exactly this to the user, set apart - from anything else you say by a blank line above and below: +2. **Ask the one question.** Put exactly this to the user, word for + word, set apart from anything else you say by a blank line above + and below: + + I'd look through your repo, your agent files such as CLAUDE.md, any documentation, relevant PRs if I have access, and any additional bug tracking that might help us build a set of rules. From this, I'll create starter rules in `.taskless/` (all local, no login) and then generate a report. Do you want me to set up Taskless for you? - If your host has a structured question tool, ask it through that - tool; otherwise ask it as plain text. A yes covers everything that - follows: mining the repository, writing rules, publishing an - unlisted report to tskl.es, and sending Taskless anonymous feedback - about how onboarding went. On anything other than a yes, stop. + Do not reword it, add to it, or describe the sources or steps in + your own words; this paragraph is the whole introduction. If your + host has a structured question tool, ask it through that tool, with + the paragraph before the question; otherwise ask it as plain text. + A yes covers everything that follows: mining the repository, + writing rules, publishing an unlisted report to tskl.es, and + sending Taskless anonymous feedback about how onboarding went. On + anything other than a yes, stop. This is the only question you script. Do not ask which sources to mine, whether to write each rule, or whether to mark onboarding diff --git a/packages/cli/test/onboard.test.ts b/packages/cli/test/onboard.test.ts index e5a104b4..bf2bc97a 100644 --- a/packages/cli/test/onboard.test.ts +++ b/packages/cli/test/onboard.test.ts @@ -349,8 +349,9 @@ describe("onboard recipe asks one question and finishes on its own", () => { it("asks the one question, set apart, through a question tool when there is one", () => { const ask = step("Ask the one question"); expect(ask).toContain( - "\n\n Do you want me to set up Taskless for you?\n\n" + "\n\n I'd look through your repo, your agent files such as CLAUDE.md, any documentation, relevant PRs if I have access, and any additional bug tracking that might help us build a set of rules. From this, I'll create starter rules in `.taskless/` (all local, no login) and then generate a report.\n\n Do you want me to set up Taskless for you?\n\n" ); + expect(ask).toContain("Do not reword it, add to it"); expect(ask).toContain("structured question tool"); expect(ask.replaceAll(/\s+/g, " ")).toContain( "This is the only question you script."