@bastani/atomic 0.9.16-alpha.5 → 0.9.16-alpha.7

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 (32) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/builtin/intercom/index.bundle.mjs +4 -1
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/index.bundle.mjs +4 -1
  5. package/dist/builtin/mcp/package.json +1 -1
  6. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  7. package/dist/builtin/subagents/package.json +1 -1
  8. package/dist/builtin/subagents/skills/qlty/SKILL.md +123 -0
  9. package/dist/builtin/subagents/skills/qlty/references/coding-with-ai-agents.md +64 -0
  10. package/dist/builtin/subagents/skills/qlty/references/commands.md +291 -0
  11. package/dist/builtin/subagents/skills/qlty/references/plugins-and-extensions.md +228 -0
  12. package/dist/builtin/subagents/skills/qlty/references/quickstart.md +110 -0
  13. package/dist/builtin/subagents/src/extension/index.bundle.mjs +4 -1
  14. package/dist/builtin/web-access/index.bundle.mjs +4 -1
  15. package/dist/builtin/web-access/package.json +1 -1
  16. package/dist/builtin/workflows/CHANGELOG.md +16 -0
  17. package/dist/builtin/workflows/README.md +3 -1
  18. package/dist/builtin/workflows/builtin/goal-prompts.ts +6 -0
  19. package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +4 -0
  20. package/dist/builtin/workflows/builtin/ralph-runner.ts +4 -0
  21. package/dist/builtin/workflows/builtin/shared-prompts.ts +25 -0
  22. package/dist/builtin/workflows/package.json +1 -1
  23. package/dist/builtin/workflows/src/extension/index.bundle.mjs +47 -4
  24. package/dist/builtin/workflows/src/index.bundle.mjs +7 -2
  25. package/dist/core/system-prompt.d.ts.map +1 -1
  26. package/dist/core/system-prompt.js +4 -1
  27. package/dist/core/system-prompt.js.map +1 -1
  28. package/docs/quickstart.md +1 -0
  29. package/docs/skills.md +4 -0
  30. package/docs/workflows.md +6 -0
  31. package/npm-shrinkwrap.json +32 -32
  32. package/package.json +3 -3
@@ -0,0 +1,228 @@
1
+ # Plugins and Linter Extensions
2
+
3
+ > **Sources** (retrieved 2026-08-26): <https://docs.qlty.sh/cli/concepts/plugins.md> and
4
+ > <https://docs.qlty.sh/cli/linter-extensions.md>.
5
+ > Copied from those pages. Text and TOML examples are unchanged; MDX `<Note>`, `<Warning>`, and
6
+ > `<CodeGroup>` wrappers are rendered as Markdown blockquotes and separate code blocks, and
7
+ > relative links are expanded to absolute URLs. Full `qlty.toml` reference:
8
+ > <https://docs.qlty.sh/cli/qlty-toml.md>.
9
+
10
+ ---
11
+
12
+ ## Plugins
13
+
14
+ Qlty integrates with linters, auto-formatters, security scanners, and other static analysis tools as plugins.
15
+
16
+ > **Note:** Looking for plugin-specific configuration options, supported versions, or invocation
17
+ > details? Each plugin lives in its own folder under
18
+ > [qltysh/qlty/qlty-plugins](https://github.com/qltysh/qlty/tree/main/qlty-plugins) on GitHub —
19
+ > check the plugin's `plugin.toml` and `README.md` for specifics.
20
+
21
+ Each plugin consists of two components:
22
+
23
+ 1. A plugin definition in a TOML configuration file
24
+ 2. A results parser implemented in Rust
25
+
26
+ Here is a simplified example plugin definition for [Ruff](https://github.com/astral-sh/ruff):
27
+
28
+ ```toml
29
+ # plugin.toml for ruff
30
+ config_version = "0"
31
+
32
+ [plugins.definitions.ruff]
33
+ runtime = "python"
34
+ package = "ruff"
35
+ file_types = ["python"]
36
+ version_command = "ruff version"
37
+ config_files = ["ruff.toml"]
38
+ issue_url_format = "https://docs.astral.sh/ruff/rules/${rule}"
39
+
40
+ [plugins.definitions.ruff.drivers.lint]
41
+ script = "ruff check --exit-zero --output-format sarif --output-file ${tmpfile} ${target}"
42
+ success_codes = [0]
43
+ output = "tmpfile"
44
+ output_format = "sarif"
45
+ batch = true
46
+ ```
47
+
48
+ Gitleaks supports outputting results in the [SARIF](https://sarifweb.azurewebsites.net/) standard format, so a custom results parser is not needed. For tools which do not support SARIF, a results parser is implemented within the Qlty CLI and referenced by name.
49
+
50
+ ### Auto-Formatters
51
+
52
+ Auto-formatters are a special type of plugin because they *rewrite* files rather than outputting findings. Therefore, they do not require results parsers.
53
+
54
+ Here is an example of a plugin definition for the [shfmt](https://github.com/mvdan/sh) auto-formatter:
55
+
56
+ ```toml
57
+ # plugin.toml for shfmt
58
+ config_version = "0"
59
+
60
+ [plugins.definitions.shfmt]
61
+ package = "mvdan.cc/sh/v${major_version}/cmd/shfmt"
62
+ runtime = "go"
63
+ file_types = ["shell"]
64
+ version_command = "shfmt --version"
65
+ affects_cache = [".editorconfig"]
66
+
67
+ [plugins.definitions.shfmt.drivers.format]
68
+ script = "shfmt -w -s ${target}"
69
+ success_codes = [0, 1]
70
+ output = "rewrite"
71
+ cache_results = true
72
+ batch = true
73
+ driver_type = "formatter"
74
+ ```
75
+
76
+ Note the specification of `output = "rewrite"` and `driver_type = "formatter"`.
77
+
78
+ ---
79
+
80
+ ## Linter Extensions
81
+
82
+ Linter extensions are additional packages or plugins that extend the functionality of base linter tools that Qlty uses. Depending on the linter, extensions can add:
83
+
84
+ * Additional rule sets
85
+ * Custom rules
86
+ * Language support
87
+ * Framework-specific checks
88
+ * Additional parsers
89
+
90
+ For example, ESLint has numerous plugins like `eslint-plugin-react`, `eslint-plugin-security`, and `eslint-plugin-jest` that add specialized rules for React development, security checks, and Jest testing, respectively.
91
+
92
+ ### Supported Package Managers
93
+
94
+ Qlty supports linter extensions through the following package managers:
95
+
96
+ * **NPM** (Node.js) - For JavaScript/TypeScript tools like ESLint, Stylelint, etc.
97
+ * **RubyGems** (Ruby) - For Ruby tools like RuboCop, Standard, etc.
98
+ * **PIP** (Python) - For Python tools like Ruff, Pylint, Bandit, etc.
99
+ * **Composer** (PHP) - For PHP tools like PHP\_CodeSniffer, PHPStan, etc.
100
+
101
+ ### Managing linter extensions
102
+
103
+ Qlty provides two mutually exclusive ways to configure linter extensions in your `qlty.toml` file: `extra_packages` and `package_file`.
104
+
105
+ #### `extra_packages`
106
+
107
+ The `extra_packages` property allows you to explicitly list additional packages that should be installed alongside the main linter package (including their versions).
108
+
109
+ ```toml
110
+ # qlty.toml
111
+ [[plugin]]
112
+ name = "eslint"
113
+ version = "8.57.0"
114
+ extra_packages = [
115
+ "eslint-plugin-react@7.33.2",
116
+ "eslint-plugin-jest@27.6.0"
117
+ ]
118
+ ```
119
+
120
+ This works best when your project contains a very limited set of extra packages (1-2), but does not scale well for moderate to complex projects.
121
+
122
+ **Pros:**
123
+
124
+ * Simple, direct specification
125
+ * Version pinning
126
+ * Works without existing package files
127
+
128
+ **Cons:**
129
+
130
+ * Duplicates existing dependency management (e.g. package.json)
131
+ * May diverge from project dependencies
132
+ * Supports external packages only (not, e.g. in Project packages)
133
+
134
+ #### `package_file`
135
+
136
+ The `package_file` property allows you to reference a package manager file (like `package.json` or `Gemfile`) to manage dependencies. Depending on your use case, you can point the `package_file` either at your project's main package file or at a specific file that contains the linter-related packages.
137
+
138
+ ```toml
139
+ # Project package file
140
+ [[plugin]]
141
+ name = "eslint"
142
+ version = "8.57.0"
143
+ package_file = "package.json"
144
+ ```
145
+
146
+ ```toml
147
+ # Linter package file
148
+ [[plugin]]
149
+ name = "eslint"
150
+ version = "8.57.0"
151
+ package_file = ".qlty/configs/package.json"
152
+ ```
153
+
154
+ **Pros:**
155
+
156
+ * Take advantage of package manager's dependency resolution
157
+ * Consistent with project dependencies (if pointing to the main package file)
158
+
159
+ **Cons:**
160
+
161
+ * Project's main package file contains many dependencies
162
+
163
+ ##### `package_filters`
164
+
165
+ When using `package_file`, you can use `package_filters` to selectively include only specific packages from the package file. This will cause Qlty to *filter* the packages in the package file and only install the ones that match the filters.
166
+
167
+ This is most useful when you are pointing the `package_file` directive to your project's main package file, and you want to install only the linter-related packages. This can be used to speed up the installation of linters.
168
+
169
+ > **Warning:** You can achieve the same goal as package\_filters by using a separate package file
170
+ > which only contains linter dependencies. Because a separate package file's dependencies can be
171
+ > fully resolved using a lock file, we prefer this option.
172
+
173
+ ```toml
174
+ # qlty.toml
175
+ [[plugin]]
176
+ name = "eslint"
177
+ version = "8.57.0"
178
+ package_file = "package.json"
179
+ package_filters = ["eslint"]
180
+ ```
181
+
182
+ The `package_filters` option can offer a performance speed up or workaround issues installing the app dependencies at the tradeoff of additional complexity.
183
+
184
+ ### Lock files
185
+
186
+ Package lock files (like `package-lock.json`, `Gemfile.lock`, `yarn.lock`) can impact how Qlty installs and manages linter extensions:
187
+
188
+ * When using `package_file`, Qlty respects the locked versions for reliability
189
+ * When using `package_file` with `package_filters`, the lock files are ignored
190
+ * For `extra_packages`, lock files are not used and specific versions are installed directly
191
+
192
+ ### Limitations
193
+
194
+ Qlty currently does not support:
195
+
196
+ * **Private linter extensions** - Extensions from private Git repositories or private package registries that require authentication
197
+ * **Git-based dependencies** - Extensions referenced directly as Git repositories
198
+ * **Local file dependencies outside the repository** - Extensions referenced from paths outside the repository
199
+
200
+ ### Troubleshooting
201
+
202
+ 1. **Version conflicts**
203
+
204
+ If you see errors like "Dependency conflict" or "Incompatible versions", try:
205
+
206
+ * Aligning versions between your package file and extra\_packages
207
+ * Using `package_filters` to selectively include compatible packages
208
+
209
+ 2. **Missing extensions**
210
+
211
+ If a linter reports missing plugins or rules:
212
+
213
+ * Verify the extension is correctly specified in `extra_packages` or `package_file`.
214
+ * Check for typos in package names.
215
+ * Ensure compatible versions are specified.
216
+
217
+ 3. **Slow performance**
218
+
219
+ If linter installation becomes slow with extensions:
220
+
221
+ * Use either `package_filters` to filter installations, or create a separate package file for linter-related packages.
222
+
223
+ 4. **Configuration issues**
224
+
225
+ If the linter can't find the extension configuration:
226
+
227
+ * Ensure your configuration file correctly references the extensions.
228
+ * Check that the extension is properly installed.
@@ -0,0 +1,110 @@
1
+ # Getting Started with the Qlty CLI
2
+
3
+ > **Source:** <https://docs.qlty.sh/cli/quickstart.md> (retrieved 2026-08-26).
4
+ > Copied from the upstream page. Text is unchanged; the page's MDX wrappers (`<Steps>`,
5
+ > `<CodeGroup>`, `<Accordion>`) and its embedded video iframes are rendered as plain Markdown
6
+ > headings and code blocks. Fetch the live page via <https://docs.qlty.sh/llms.txt> when in doubt.
7
+
8
+ ## 1. Install the CLI
9
+
10
+ First, install our CLI onto your local machine:
11
+
12
+ ```shell
13
+ # macOS & Linux
14
+ curl https://qlty.sh | sh
15
+ ```
16
+
17
+ ```shell
18
+ # Windows
19
+ powershell -c "iwr https://qlty.sh | iex"
20
+ ```
21
+
22
+ Qlty CLI supports macOS and Linux on X64 and ARM64, with Windows support in development.
23
+
24
+ ### Alternative: Installing with verification
25
+
26
+ We provide GitHub attestations powered by Sigstore that allow you to verify the authenticity of the Qlty CLI before installing it.
27
+
28
+ **Prerequisites:** [GitHub CLI (`gh`)](https://cli.github.com/manual/installation) must be installed.
29
+
30
+ **Example (macOS Apple Silicon):**
31
+
32
+ ```shell
33
+ # Download the archive from https://github.com/qltysh/qlty/releases
34
+ curl -LO https://github.com/qltysh/qlty/releases/latest/download/qlty-aarch64-apple-darwin.tar.xz
35
+
36
+ # Verify the attestation
37
+ gh attestation verify --owner qltysh qlty-aarch64-apple-darwin.tar.xz
38
+
39
+ # Unpack and install
40
+ tar -xJf qlty-aarch64-apple-darwin.tar.xz
41
+ sudo mv qlty-aarch64-apple-darwin/qlty /usr/local/bin/
42
+ ```
43
+
44
+ For other platforms, download the appropriate archive from [GitHub releases](https://github.com/qltysh/qlty/releases).
45
+
46
+ Learn more: [GitHub artifact attestations documentation](https://docs.github.com/en/actions/concepts/security/artifact-attestations)
47
+
48
+ ## 2. Initialize your repository
49
+
50
+ From your Git repository, run:
51
+
52
+ ```shell
53
+ qlty init
54
+ ```
55
+
56
+ This will generate a baseline configuration based on the file types within your project and store it as `.qlty/qlty.toml` in your repository.
57
+
58
+ You can find more plugins with `qlty plugins list` and enable them with `qlty plugins enable [plugin]`.
59
+
60
+ ## 3. Identify code smells and review quality metrics
61
+
62
+ Check the code quality (for [supported programming languages](https://docs.qlty.sh/languages.md)):
63
+
64
+ ```bash
65
+ # Scan for code smells like duplication
66
+ qlty smells --all
67
+ ```
68
+
69
+ ```bash
70
+ # Review a summary of quality metrics
71
+ qlty metrics --all --max-depth=2 --sort complexity --limit 10
72
+ ```
73
+
74
+ ## 4. Lint your project
75
+
76
+ ```bash
77
+ # Run linters on changed files on your current branch
78
+ qlty check
79
+ ```
80
+
81
+ ```bash
82
+ # Run linters on all files
83
+ qlty check --all
84
+ ```
85
+
86
+ ```bash
87
+ # Run only the shellcheck linter on all files
88
+ qlty check --all --filter=shellcheck
89
+ ```
90
+
91
+ ```bash
92
+ # Run linters on the web/ folder
93
+ qlty check web/
94
+ ```
95
+
96
+ ## 5. Auto-format your code
97
+
98
+ ```bash
99
+ # Auto-format changed files on your current branch
100
+ qlty fmt
101
+ ```
102
+
103
+ ## System requirements
104
+
105
+ > **Source:** <https://docs.qlty.sh/cli/system-requirements.md> (retrieved 2026-08-26).
106
+
107
+ The Qlty CLI runs on macOS and Linux on X64 and ARM64. Note that the quickstart page and the
108
+ system-requirements page disagree about Windows: the quickstart says "Windows support is in
109
+ development" while the system-requirements table lists Windows 11+ on X86 as supported. Verify
110
+ Windows behavior against the live docs rather than relying on either statement.
@@ -17434,7 +17434,10 @@ Current working directory: ${promptCwd}
17434
17434
  }
17435
17435
  }
17436
17436
  if (shouldIncludeAskUserFallbackGuidance) {
17437
- addGuideline("Clarify ambiguous requirements using the ask_user_question tool if available.");
17437
+ addGuideline("Clarify ambiguous requirements using the ask_user_question tool if available. When it is unavailable and no human input channel exists, do not stall on a question: choose the interpretation best supported by the repository and the stated objective — mine git history, commits, PRs, issues, and the user's own comments to infer how they would decide — state the assumption in your response, and continue fully autonomously on best judgment.");
17438
+ }
17439
+ if (hasBash || hasPowerShell) {
17440
+ addGuideline("**Repository intent**: When working in a repository, infer how its maintainers actually work before imposing defaults: review recent commits, open and merged PRs, issues and their comments, and project/board status when tooling allows (for example `git log` and the `gh` CLI) to learn conventions, priorities, and scope norms. Better, identify the requesting user (`git config user.name`/`user.email`, `gh api user`) and study their own commits, PRs, reviews, and issue comments so you interpret ambiguous requests the way they would, aligning style, scope, and process with their patterns.");
17438
17441
  }
17439
17442
  for (const guideline of promptGuidelines ?? []) {
17440
17443
  const normalized = guideline.trim();
@@ -16013,7 +16013,10 @@ Current working directory: ${promptCwd}
16013
16013
  }
16014
16014
  }
16015
16015
  if (shouldIncludeAskUserFallbackGuidance) {
16016
- addGuideline("Clarify ambiguous requirements using the ask_user_question tool if available.");
16016
+ addGuideline("Clarify ambiguous requirements using the ask_user_question tool if available. When it is unavailable and no human input channel exists, do not stall on a question: choose the interpretation best supported by the repository and the stated objective — mine git history, commits, PRs, issues, and the user's own comments to infer how they would decide — state the assumption in your response, and continue fully autonomously on best judgment.");
16017
+ }
16018
+ if (hasBash || hasPowerShell) {
16019
+ addGuideline("**Repository intent**: When working in a repository, infer how its maintainers actually work before imposing defaults: review recent commits, open and merged PRs, issues and their comments, and project/board status when tooling allows (for example `git log` and the `gh` CLI) to learn conventions, priorities, and scope norms. Better, identify the requesting user (`git config user.name`/`user.email`, `gh api user`) and study their own commits, PRs, reviews, and issue comments so you interpret ambiguous requests the way they would, aligning style, scope, and process with their patterns.");
16017
16020
  }
16018
16021
  for (const guideline of promptGuidelines ?? []) {
16019
16022
  const normalized = guideline.trim();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.16-alpha.5",
3
+ "version": "0.9.16-alpha.7",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.16-alpha.7] - 2026-08-26
10
+
11
+ ### Changed
12
+
13
+ - Builtin `goal` and `ralph` stage prompts now carry a shared `code_quality_verification` section pointing stages at the `qlty` skill (or `skill: "qlty"` delegation) for linting, auto-formatting, complexity and duplication metrics, and code smells — weighted higher when the objective asks for verifiers or high code quality. It reaches the goal controller, goal orchestrator, goal reviewer, ralph orchestrator, and both ralph reviewers, alongside the existing end-to-end verification guidance. Repository-defined checks in AGENTS.md/CLAUDE.md, package scripts, and CI remain authoritative.
14
+ - Builtin `goal` and `ralph` stage prompts now carry a shared `repository_intent` section instructing implementers and reviewers to infer maintainer and requesting-user conventions by mining repository behavior — git history (including `git log --show-signature`), merged PRs, issues and their comments, review comments, commit subjects and trailers, and CI/branch-protection config — for unwritten norms such as commit signing, message style and issue linking, changelog discipline, PR size and review etiquette. The dominant, recent, intentional pattern wins over accidental drift, the requesting user's own activity weighs highest, implementers match inferred conventions in delivered work, and reviewers report deviations as evidence-backed convention findings. Behavioral evidence fills contract gaps and never overrides the literal objective, acceptance criteria, or explicit AGENTS.md/CLAUDE.md guidance. It reaches the same call sites as the code-quality guidance: goal controller, goal orchestrator, goal reviewer, ralph orchestrator, and both ralph reviewers.
15
+ - The `workflow` tool's routing guidance adds a repository-intent clause to the pre-launch architecture pass: for coding tasks, mine git history, merged PRs, issues, commits, and review comments before freezing authored workflow objectives and acceptance criteria so they capture unwritten conventions, weighing the requesting user's own activity highest; non-coding tasks mine their analogous available context sources (issue trackers, long-form docs, chat/comment threads, prior artifacts) the same way.
16
+
17
+ ## [0.9.16-alpha.6] - 2026-08-26
18
+
19
+ ### Changed
20
+
21
+ - The `workflow` tool description, agent routing guidance, and workflow docs now treat a blocked run as continuable by default: resume resumable blocks, answer pending prompts, steer past the obstacle, or start a follow-up workflow past a terminal block (inline only when the remaining work is minimal), stopping for user input only when the task is so ambiguous that judgment cannot infer intent from the objective and repository evidence — git history, commits, PRs, issues, and the user's own comments. When `ask_user_question` or human input is unavailable, the agent is instructed to continue fully autonomously on the interpretation best supported by that evidence and to record the assumption.
22
+ - `WORKFLOW BLOCKED` lifecycle notices now carry that continuation instruction in their text: resume or steer the run, or continue with a follow-up workflow (inline only if what remains is minimal), and ask the user only when intent cannot be inferred from repository evidence.
23
+ - A budget-exceeded stop is now reported as its own blocked-notice variant (`stopped at its <dimension> budget limit`, with `budgetExceeded`/`budgetDimension` details and a `/workflow resume` hint) whose text instructs the agent to summarize progress and estimated next steps, ask the user whether to proceed — preferring the `ask_user_question` tool when available — and resume with a raised `budget` only after approval. Matching guidance was added to the routing prompts and docs.
24
+
9
25
  ## [0.9.16-alpha.5] - 2026-08-26
10
26
 
11
27
  ### Changed
@@ -58,6 +58,8 @@ Workflow lifecycle notices are enabled by default. They send steer prompts into
58
58
 
59
59
  Set `enabled` to `false` to disable all lifecycle notices, or narrow `notifyOn` to a non-empty list of selected events. Completion, failure, and blocked lifecycle notices are emitted for top-level workflow runs, use steer delivery, and wake an idle model so the lifecycle update enters the model context when it happens. When a fulfilled workflow body leaves admitted tool failures, the engine promotes the first admission and persists that exact tool origin for the failed notice. Ordinary body rejections retain their original error and failed graph nodes without claiming a tool origin because transparent native promises do not expose the source promise; this prevents a caught tool rejection from being misattributed when body code later throws the same object or primitive. Nested child workflow completion/failure is reflected inside the expanded parent graph instead of producing separate top-level completion cards. Awaiting-input states are tracked for dedupe/restore, but workflows do not enqueue main-chat `/workflow connect` cards for them; prompt state remains visible through workflow status/connect surfaces, avoiding stale actionable cards if a prompt resolves while the main chat is streaming.
60
60
 
61
+ Treat a blocked run as continuable by default; the blocked notice text itself carries this instruction. On a `WORKFLOW BLOCKED` notice or a blocked status, keep the work moving: resume a resumable block, answer the pending prompt, steer the stage past the obstacle, or start a follow-up workflow that carries the remaining tracked work past a terminal block — continue inline only if the remaining work is minimal. Stop for user input only when the task is so ambiguous that competing interpretations lead to materially different outcomes and judgment cannot infer intent from the stated objective and repository evidence; mine git history, commits, PRs, issues, and the user's own comments before asking. When `ask_user_question` or another human input channel is unavailable, continue fully autonomously on the interpretation best supported by that evidence, and record the assumption in the result or an artifact. A budget-exceeded stop (the resumable `budget_exceeded` blocked rail) is the exception, and its notice says so: the exhausted budget is a boundary someone chose, so summarize progress and the estimated next steps, ask the user whether to proceed — prefer the `ask_user_question` tool when it is available — and resume with a raised `budget` only after approval.
62
+
61
63
  Control notices report deliberate actions on a top-level run: `/workflow <name>` produces a `WORKFLOW STARTED` card (`▶`), `/workflow pause` a `WORKFLOW PAUSED` card (`⏸`, warning tone), `/workflow quit` a `WORKFLOW QUIT` card (`⏹`, warning tone, plus a `resumable` field), and `/workflow resume` a `WORKFLOW RESUMED` card (`▶`). All four travel the same steer delivery, capped-backoff retry, and card path as the failure notice. The paused and quit text says the stop was deliberate and user-requested and instructs the model not to resume the run or take the work over unless asked, hinting `/workflow resume <run-id>`; the resumed text does not, since the run is progressing again.
62
64
 
63
65
  Only user actions notify. The matching `workflow({ action: "run" | "pause" | "quit" | "resume" })` tool calls stay silent, because the tool result already reports them to the agent, and `/workflow interrupt` raises nothing. Engine-internal transitions stay silent too — a notice exists only when a control path named an actor — which is what keeps answering a human-in-the-loop prompt, per-stage control, and the resume-acknowledgement pass from flooding the chat.
@@ -677,7 +679,7 @@ Raw stage-chat prompt answer replay is live-memory only. `StageSnapshot.promptAn
677
679
  ```json
678
680
  {
679
681
  "name": "workflow",
680
- "description": "Run named builtin, project, user, or package workflows; custom definitions may import reusable project/package workflows or builtin definitions from @bastani/workflows/builtin and nest them with ctx.workflow(...), including deeper composition within the configured maxDepth; when workflow execution fits but another shape would better achieve the task, author a custom TypeScript workflow({...}) inline with normal coding tools, reload it, and run it; after successfully creating and reloading a newly authored custom workflow, report the folder containing its generated code as 'Custom workflow created. You can inspect its code at: <workflow-folder-path>'; do this only for newly created custom workflows, never builtin or pre-existing workflows; discover with list/get/inputs/models, list session runs with status (no runId; statusFilter narrows the list), inspect status/stages/stage details, send prompt answers or steering only while the root workflow is nonterminal, pause/resume/interrupt/quit runs, and reload workflow resources. For action 'run' and 'resume', budget accepts per-field duration, token, cost, and warning overrides; fields resolve over the workflow declaration and config, and 0 disables a field. Pass budget only when the user asked for a limit; otherwise omit it entirely and inherit the declaration and config rather than inventing a cap. For primitive prompt answers, use booleans or the documented confirm labels, exact case-insensitive select labels or 1-based indexes, and text strings for input/editor; an invalid answer remains pending and returns guidance instead of choosing a default. For large stage handoffs, write context to files/artifacts, pass paths via reads, and prompt downstream agents to 'Read the file at <path>...' instead of injecting large previous text. Wrap critical parts of run inputs and steering messages in <keepContext>...</keepContext> so compaction preserves them verbatim in the stages that inherit them; tag role constraints, prohibitions, must-hold criteria, and identifiers, not background or bulk reference material. For transcripts, prefer status/stages/stage to get sessionFile/transcriptPath, quote the exact path without rewriting separators (Windows backslashes are valid), then search it with rg/grep and read small ranges; transcript is path-only by default when sessionFile/transcriptPath exists, explicit tail/limit returns bounded previews, and missing transcript paths fall back to a small preview. Use action 'models' to inspect models in the configured catalog; the result is a configured-auth snapshot showing what's present in the registry with configured authentication, not proof of credentials, entitlements, OAuth freshness, or live provider access. When authoring a workflow that should dynamically select a model, first call workflow({ action: 'models' }) to inspect the configured catalog, then select from the returned provider/id entries considering the isCurrent marker and available thinking levels.",
682
+ "description": "Run named builtin, project, user, or package workflows; custom definitions may import reusable project/package workflows or builtin definitions from @bastani/workflows/builtin and nest them with ctx.workflow(...), including deeper composition within the configured maxDepth; when workflow execution fits but another shape would better achieve the task, author a custom TypeScript workflow({...}) inline with normal coding tools, reload it, and run it; after successfully creating and reloading a newly authored custom workflow, report the folder containing its generated code as 'Custom workflow created. You can inspect its code at: <workflow-folder-path>'; do this only for newly created custom workflows, never builtin or pre-existing workflows; discover with list/get/inputs/models, list session runs with status (no runId; statusFilter narrows the list), inspect status/stages/stage details, send prompt answers or steering only while the root workflow is nonterminal, pause/resume/interrupt/quit runs, and reload workflow resources. Treat a blocked run as continuable by default: resume resumable blocks, answer pending prompts, steer past the obstacle, or start a follow-up workflow past a terminal block, and escalate to the user only when the blocked result is so ambiguous that human input or steering must settle it; when ask_user_question or human input is unavailable, continue fully autonomously on the interpretation best supported by the objective and repository evidence, and record the assumption. For action 'run' and 'resume', budget accepts per-field duration, token, cost, and warning overrides; fields resolve over the workflow declaration and config, and 0 disables a field. Pass budget only when the user asked for a limit; otherwise omit it entirely and inherit the declaration and config rather than inventing a cap. For primitive prompt answers, use booleans or the documented confirm labels, exact case-insensitive select labels or 1-based indexes, and text strings for input/editor; an invalid answer remains pending and returns guidance instead of choosing a default. For large stage handoffs, write context to files/artifacts, pass paths via reads, and prompt downstream agents to 'Read the file at <path>...' instead of injecting large previous text. Wrap critical parts of run inputs and steering messages in <keepContext>...</keepContext> so compaction preserves them verbatim in the stages that inherit them; tag role constraints, prohibitions, must-hold criteria, and identifiers, not background or bulk reference material. For transcripts, prefer status/stages/stage to get sessionFile/transcriptPath, quote the exact path without rewriting separators (Windows backslashes are valid), then search it with rg/grep and read small ranges; transcript is path-only by default when sessionFile/transcriptPath exists, explicit tail/limit returns bounded previews, and missing transcript paths fall back to a small preview. Use action 'models' to inspect models in the configured catalog; the result is a configured-auth snapshot showing what's present in the registry with configured authentication, not proof of credentials, entitlements, OAuth freshness, or live provider access. When authoring a workflow that should dynamically select a model, first call workflow({ action: 'models' }) to inspect the configured catalog, then select from the returned provider/id entries considering the isCurrent marker and available thinking levels.",
681
683
  "parameters": {
682
684
  "workflow": "string (optional) — workflow ID or normalized name",
683
685
  "inputs": "object (optional) — key/value map of workflow inputs",
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  ACCEPTANCE_MATRIX_CONTRACT,
3
+ CODE_QUALITY_VERIFICATION_GUIDANCE,
3
4
  CONTRACT_FIDELITY_AUDIT,
4
5
  E2E_VERIFICATION_GUIDANCE,
5
6
  EVIDENCE_CLOSURE_POLICY,
6
7
  FINDINGS_CONSOLIDATION_CONTRACT,
7
8
  LITERAL_OBJECTIVE_CONTRACT,
8
9
  REGRESSION_EVIDENCE_CONTRACT,
10
+ REPO_INTENT_MINING_GUIDANCE,
9
11
  REVIEW_CODE_DELTA_CONTRACT,
10
12
  REVIEWER_INDEPENDENT_VERIFICATION_CONTRACT,
11
13
  REVIEWER_INTERCOM_COORDINATION_PROTOCOL,
@@ -137,6 +139,8 @@ export function renderGoalContinuationPrompt(
137
139
  ["worktree_discipline", WORKTREE_DISCIPLINE_CONTRACT],
138
140
  ["pr_handoff_policy", INTERMEDIATE_PR_HANDOFF_GUARDRAIL],
139
141
  ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
142
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
143
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
140
144
  ["goal_guidelines", GOAL_CONTINUATION_REFERENCE],
141
145
  ["objective", ["Continue working toward the active goal using the ledger as authoritative state for status, receipts, reviews, blockers, reducer decisions, and lifecycle events.", `The same blocker must repeat for at least ${blockerThreshold} controller observations before blocked status is available.`, "Reviewer quorum plus the reducer decides completion from reviewers' authoritative stop_review_loop signals."].join("\n")],
142
146
  ]);
@@ -170,6 +174,8 @@ export function renderReviewerPrompt(args: {
170
174
  ["pr_handoff_policy", INTERMEDIATE_PR_HANDOFF_GUARDRAIL],
171
175
  ["auditability", RECEIPT_EXPECTATIONS],
172
176
  ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
177
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
178
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
173
179
  ["final_action_policy", args.createPr ? "PR/MR/review creation is an authorized post-approval final action. If implementation and validation are proven and only that action remains, set goal_oracle_satisfied=true and stop_review_loop=true with no blocking findings, and record it as the remaining final action." : "PR/MR/review creation is not enabled; do not require or attempt it during review."],
174
180
  ["project_guidance", [
175
181
  "Apply AGENTS.md/CLAUDE.md and nearby code, test, script, config, generated-artifact, and CI conventions; specific project guidance overrides general guidance.",
@@ -1,9 +1,11 @@
1
1
  import {
2
2
  ACCEPTANCE_MATRIX_CONTRACT,
3
+ CODE_QUALITY_VERIFICATION_GUIDANCE,
3
4
  E2E_VERIFICATION_GUIDANCE,
4
5
  EVIDENCE_CLOSURE_POLICY,
5
6
  LITERAL_OBJECTIVE_CONTRACT,
6
7
  REGRESSION_EVIDENCE_CONTRACT,
8
+ REPO_INTENT_MINING_GUIDANCE,
7
9
  REVIEW_CODE_DELTA_CONTRACT,
8
10
  REVIEWER_INDEPENDENT_VERIFICATION_CONTRACT,
9
11
  REVIEWER_INTERCOM_COORDINATION_PROTOCOL,
@@ -49,6 +51,8 @@ export function renderRalphReviewerPrompt(args: {
49
51
  ["reviewer_coordination", REVIEWER_INTERCOM_COORDINATION_PROTOCOL],
50
52
  ["regression_evidence", REGRESSION_EVIDENCE_CONTRACT],
51
53
  ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
54
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
55
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
52
56
  ["qa_e2e_video_review", renderE2eQaVideoReviewGuidance(args.qaVideoPath)],
53
57
  ["evidence_closure", EVIDENCE_CLOSURE_POLICY],
54
58
  [
@@ -10,10 +10,12 @@ import {
10
10
  import { createWorkflowArtifactDirectory } from "../src/shared/workflow-artifacts.js";
11
11
  import {
12
12
  ACCEPTANCE_MATRIX_CONTRACT,
13
+ CODE_QUALITY_VERIFICATION_GUIDANCE,
13
14
  CONTRACT_FIDELITY_AUDIT,
14
15
  FINDINGS_CONSOLIDATION_CONTRACT,
15
16
  LITERAL_OBJECTIVE_CONTRACT,
16
17
  REGRESSION_EVIDENCE_CONTRACT,
18
+ REPO_INTENT_MINING_GUIDANCE,
17
19
  SCOPE_DISCIPLINE_CONTRACT,
18
20
  WORKER_PREFLIGHT_CONTRACT,
19
21
  WORKTREE_DISCIPLINE_CONTRACT,
@@ -148,6 +150,8 @@ export async function runRalphWorkflow(
148
150
  ["project_setup", WORKER_PREFLIGHT_CONTRACT],
149
151
  ["worktree_discipline", WORKTREE_DISCIPLINE_CONTRACT],
150
152
  ["qa_e2e_video", renderQaE2eVideoGuidance(qaVideoPath)],
153
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
154
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
151
155
  [
152
156
  "delegation",
153
157
  [
@@ -69,6 +69,31 @@ export const E2E_VERIFICATION_GUIDANCE = [
69
69
  "If E2E remains impractical, record the commands attempted, observed failure output, smallest missing prerequisite, and narrower validation run; an unattempted assumption is never valid grounds to skip.",
70
70
  ].join("\n");
71
71
 
72
+ /**
73
+ * Code-quality verification is the lint/format/metrics/smells counterpart to
74
+ * E2E_VERIFICATION_GUIDANCE, and is included at the same call sites so goal and
75
+ * ralph stages — implementation, orchestrator, and reviewer alike — receive it.
76
+ */
77
+ export const CODE_QUALITY_VERIFICATION_GUIDANCE = [
78
+ "For code-quality verification — linting, auto-formatting, complexity and duplication metrics, and code smells — use the qlty skill or delegate with `skill: \"qlty\"`; it drives one CLI across the repository's languages instead of ad-hoc per-tool linter invocations.",
79
+ "Weight this higher when the objective asks for verifiers or high code quality: enable the qlty plugins that fit this codebase, then run the check/format/metrics/smells loop and act on what it reports.",
80
+ "Repository-defined checks in AGENTS.md/CLAUDE.md, package scripts, and CI stay authoritative; qlty supplements them rather than replacing them, and its findings count as evidence only with the command and observed output recorded.",
81
+ ].join("\n");
82
+
83
+ /**
84
+ * Repositories carry behavioral norms written docs never state — commit
85
+ * signing, message style, changelog discipline, review etiquette — and they
86
+ * are inferable from history. Included at the same goal/ralph call sites as
87
+ * the E2E and code-quality guidance so implementers match inferred
88
+ * conventions and reviewers check delivered work against them.
89
+ */
90
+ export const REPO_INTENT_MINING_GUIDANCE = [
91
+ "Infer maintainer and requesting-user intent from repository behavior, not only written docs: mine git history (`git log`, `git log --show-signature`), merged PRs, issues and their comments, review comments, commit subjects and trailers, and CI/branch-protection config for unwritten conventions.",
92
+ "Read for commit-signing habits, commit-message style and issue linking, changelog discipline, PR size and stacking norms, review etiquette, formatting and lint norms, and branch naming. Prefer the dominant, recent, intentional pattern over accidental drift; when signals conflict, the requesting user's own commits, PRs, and comments weigh highest — different users of one repository keep different preferences.",
93
+ "Match inferred conventions in delivered work (for example, sign commits when the surrounding history is signed rather than skipping signing because no doc required it); in review, report deviations as convention findings backed by the mined evidence.",
94
+ "Behavioral evidence fills gaps where the contract is silent; it never overrides the literal objective, acceptance criteria, or explicit AGENTS.md/CLAUDE.md guidance, and it does not license new contract requirements.",
95
+ ].join("\n");
96
+
72
97
  export function renderE2eQaVideoReviewGuidance(
73
98
  knownVideoPath?: string,
74
99
  ): string {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.16-alpha.5",
3
+ "version": "0.9.16-alpha.7",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [