@bastani/atomic 0.9.16-alpha.6 → 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.
@@ -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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.16-alpha.6",
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,14 @@ 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
+
9
17
  ## [0.9.16-alpha.6] - 2026-08-26
10
18
 
11
19
  ### Changed
@@ -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.6",
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": [
@@ -98572,6 +98572,19 @@ var E2E_VERIFICATION_GUIDANCE = [
98572
98572
  "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."
98573
98573
  ].join(`
98574
98574
  `);
98575
+ var CODE_QUALITY_VERIFICATION_GUIDANCE = [
98576
+ '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.',
98577
+ "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.",
98578
+ "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."
98579
+ ].join(`
98580
+ `);
98581
+ var REPO_INTENT_MINING_GUIDANCE = [
98582
+ "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.",
98583
+ "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.",
98584
+ "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.",
98585
+ "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."
98586
+ ].join(`
98587
+ `);
98575
98588
  function renderE2eQaVideoReviewGuidance(knownVideoPath) {
98576
98589
  const target = knownVideoPath === undefined || knownVideoPath.length === 0 ? "Look for QA E2E video references in the goal ledger, implementation receipt, implementation notes, orchestrator report, or other review context artifacts." : `Known QA E2E video path for this run: ${knownVideoPath}`;
98577
98590
  return [
@@ -101269,6 +101282,8 @@ function renderGoalContinuationPrompt(ledger, ledgerPath, blockerThreshold, late
101269
101282
  ["worktree_discipline", WORKTREE_DISCIPLINE_CONTRACT],
101270
101283
  ["pr_handoff_policy", INTERMEDIATE_PR_HANDOFF_GUARDRAIL],
101271
101284
  ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
101285
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
101286
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
101272
101287
  ["goal_guidelines", GOAL_CONTINUATION_REFERENCE],
101273
101288
  ["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(`
101274
101289
  `)]
@@ -101294,6 +101309,8 @@ function renderReviewerPrompt(args) {
101294
101309
  ["pr_handoff_policy", INTERMEDIATE_PR_HANDOFF_GUARDRAIL],
101295
101310
  ["auditability", RECEIPT_EXPECTATIONS],
101296
101311
  ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
101312
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
101313
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
101297
101314
  ["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."],
101298
101315
  ["project_guidance", [
101299
101316
  "Apply AGENTS.md/CLAUDE.md and nearby code, test, script, config, generated-artifact, and CI conventions; specific project guidance overrides general guidance.",
@@ -103490,6 +103507,8 @@ function renderRalphReviewerPrompt(args) {
103490
103507
  ["reviewer_coordination", REVIEWER_INTERCOM_COORDINATION_PROTOCOL],
103491
103508
  ["regression_evidence", REGRESSION_EVIDENCE_CONTRACT],
103492
103509
  ["e2e_verification", E2E_VERIFICATION_GUIDANCE],
103510
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
103511
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
103493
103512
  ["qa_e2e_video_review", renderE2eQaVideoReviewGuidance(args.qaVideoPath)],
103494
103513
  ["evidence_closure", EVIDENCE_CLOSURE_POLICY],
103495
103514
  [
@@ -103884,6 +103903,8 @@ Read it before implementation or delegation because it is the primary current im
103884
103903
  ["project_setup", WORKER_PREFLIGHT_CONTRACT],
103885
103904
  ["worktree_discipline", WORKTREE_DISCIPLINE_CONTRACT],
103886
103905
  ["qa_e2e_video", renderQaE2eVideoGuidance(qaVideoPath)],
103906
+ ["code_quality_verification", CODE_QUALITY_VERIFICATION_GUIDANCE],
103907
+ ["repository_intent", REPO_INTENT_MINING_GUIDANCE],
103887
103908
  [
103888
103909
  "delegation",
103889
103910
  [
@@ -123683,6 +123704,7 @@ var DEFAULT_PROMPT_GUIDANCE = [
123683
123704
  - Treat loop or stop-condition wording as a strong workflow signal, especially "do X until Y", "repeat until", "iterate until", "review/fix until passing", "run checks and fix until green", "keep going until done", or any prompt that names an approval gate or evidence requirement.
123684
123705
  - Do not force-fit an installed workflow. When another graph better matches the task, write a task-specific TypeScript workflow inline. Rich custom workflows may use deterministic branching, dynamic fan-out, child workflows, artifacts, structured outputs, human-in-the-loop prompts, gates, retries, and explicit stop conditions.
123685
123706
  - Before launching any workflow for a non-trivial task, perform a short workflow-architecture pass. Derive implementation lifecycle needs, whole-codebase research needs, independent slices, competing strategies, exact API/type/build contracts, schema or generated-artifact contracts, state transitions/lifecycle behavior, deterministic stop conditions, and required evidence. Enumerate implementation slices in this same pass, not a second planning ritual; give each slice its own objective, acceptance criteria, and gates, and require each to leave a buildable, testable repository state before the next slice. Use a compact internal coverage matrix: \`requirement/risk | required evidence | workflow/stage that produces it | gap\`. Add the topology row \`acyclic topology | node/edge sketch for branches and loops | architecture pass | unresolved back-edge\`. Unresolved material rows or back-edges must change the graph before launch.
123707
+ - In that same pass, for coding tasks, infer repository intent from repo-level behavior before freezing objectives and acceptance criteria: mine git history (including \`git log --show-signature\`), merged PRs, issues, commits, and review comments for unwritten conventions — commit signing, message style and issue linking, changelog discipline, PR size and review norms — weighing the requesting user's own activity highest, so authored workflow contracts capture norms no doc states. For non-coding tasks, mine the analogous available context sources (issue trackers, long-form docs, chat/comment threads, prior artifacts) the same way. Inferred conventions fill contract gaps; they never override the stated objective or explicit repository docs.
123686
123708
  - In that architecture pass, sketch each branch, loop, and nested workflow boundary. Identify which stages repeat, require distinct tracked work for every iteration, name the current frontier before each repeat, reject self-edges and ancestor edges, compose nested workflows through \`ctx.workflow(...)\` boundaries rather than recursive \`run\` invocation, and preserve stable per-iteration identity and call order for resume/replay.
123687
123709
  - Compare candidate workflows by guarantees, not broad objectives: run one named workflow only when it covers the lifecycle and produces evidence for every material requirement/risk. A generic implementation workflow may cover the lifecycle without covering exact API/type/build contracts, schemas/generated artifacts, state transitions, or domain-specific gates. Do not treat "has reviewers" as proof that a task-specific risk is covered.
123688
123710
  - Use these routing signals without adding decorative stages: broad repository uncertainty → Fan-out-and-synthesize with repository-focused branches; independent slices → Fan-out-and-synthesize; plausible-but-wrong contract risk → Adversarial verification or a task-specific verification stage; competing architectures or implementations → Generate-and-filter or Tournament; an explicit repeat-until condition → Loop until done; implementation lifecycle → a task-specific worker/reviewer loop; exact API/build/schema requirements → dedicated deterministic gates.
@@ -241,6 +241,7 @@ Skills are reusable expert instructions. Trigger one with `/skill:<name>` follow
241
241
  | `tdd` | Test-first feature or bug work. | `/skill:tdd` |
242
242
  | `impeccable` | Critique or refine web/native frontend and product UI; includes detector hooks, framework-aware live review, and mount-failure recovery. | `/skill:impeccable` |
243
243
  | `playwright-cli` | Drive a real browser for end-to-end UI checks, screenshots, and reviewable proof videos. | `/skill:playwright-cli` |
244
+ | `qlty` | Lint, auto-format, and measure code quality — complexity, duplication, and code smells — through one CLI across the repository's languages. | `/skill:qlty check this branch before I hand it off` |
244
245
  | `liteparse` | Pull text, tables, or values out of PDF, DOCX, PPTX, XLSX, and image files locally. | `/skill:liteparse` |
245
246
  | `show-me` | Explain a topic visually with concise diagrams, code-shape sketches, or focused HTML artifacts. HumanLayer, MIT licensed. | `/skill:show-me` |
246
247
 
package/docs/skills.md CHANGED
@@ -81,6 +81,10 @@ The skill no longer recommends response prefilling, which returns an error on Cl
81
81
 
82
82
  The bundled `/skill:show-me` from [HumanLayer](https://github.com/humanlayer/skills) helps explain the current topic visually with concise diagrams, code-shape sketches, and focused HTML artifacts. It is distributed under the MIT License.
83
83
 
84
+ ### Built-in code quality guidance
85
+
86
+ The bundled `/skill:qlty` runs code-quality verification through the [qlty](https://qlty.sh) CLI, which drives 70+ linters, auto-formatters, and security scanners across 40+ languages: `qlty check` for linting, `qlty fmt` for auto-formatting, `qlty metrics` for complexity, lines, and cohesion, and `qlty smells` for duplication, deep nesting, and overly complex code. It triggers on requests for verifiers or high code quality and prefers one CLI over ad-hoc per-tool linter invocations. The skill directs the agent to [docs.qlty.sh/llms.txt](https://docs.qlty.sh/llms.txt) as the authoritative documentation index, tells it to enable the qlty plugins and linter extensions that fit the codebase before checking, and ships source-attributed reference excerpts beside `SKILL.md`. The CLI is not bundled; install it with `curl https://qlty.sh | bash` (macOS and Linux) or `powershell -c "iwr https://qlty.sh | iex"` (Windows), and keep `~/.qlty/bin` on `PATH`. Note that `qlty init` writes `.qlty/qlty.toml` into the repository. Offline, `qlty metrics` and `qlty smells` still work (built-in static analysis); `qlty check` and `qlty fmt` download plugins and runtimes on first use per repository and need network then.
87
+
84
88
  ## Skill Commands
85
89
 
86
90
  Skills register as `/skill:name` commands:
package/docs/workflows.md CHANGED
@@ -231,6 +231,8 @@ The shapes, cheapest first:
231
231
 
232
232
  For every non-trivial workflow task, perform a short workflow-architecture pass before the first launch. Choose the execution shape before starting substantive work; reconnaissance already counts as inline execution. Derive the task's implementation lifecycle needs, whole-codebase research needs, independent work slices, competing strategies, exact API/type/build contracts, schema or generated-artifact contracts, state-transition/lifecycle behavior, deterministic stop conditions, and required evidence.
233
233
 
234
+ For coding tasks, that pass also infers repository intent from repo-level behavior before objectives and acceptance criteria freeze: mine git history (including `git log --show-signature`), merged PRs, issues, commits, and review comments for unwritten conventions — commit signing, message style and issue linking, changelog discipline, PR size and review norms — weighing the requesting user's own activity highest so the authored contract captures norms no doc states. Non-coding tasks mine their analogous available context sources (issue trackers, long-form docs, chat or comment threads, prior artifacts) the same way. Inferred conventions fill contract gaps; they never override the stated objective or explicit repository docs.
235
+
234
236
  Use this compact coverage matrix internally (it may stay concise for a straightforward task), and let every unresolved material row change the graph choice:
235
237
 
236
238
  ```text
@@ -782,6 +784,8 @@ All six can run by name or as nested definitions. Prefer composition over copyin
782
784
  Goal persists the literal objective and immutable acceptance criteria in a run ledger, delegates implementation through bounded orchestrator turns, records receipts, and asks independent reviewers to inspect the current delta. A TypeScript reducer returns `complete`, `blocked`, or `needs_human` rather than trusting free-form completion claims. The complete Goal artifact directory — both its owning run segment and unique `artifact-<id>` segment — is a durable checkpoint. A fresh-ID continuation therefore reuses the source ledger, receipts, and review paths without rerunning replayed producer stages; loading that ledger preserves its existing records without duplicating replayed receipts or reviews. The model-visible `goal-ledger.json` continues to omit internal turn numbers, while a sibling `goal-ledger-state.json` preserves the complete turn-bearing state for lossless continuation reloads. A live chain of continuations also protects that original owner from retention pruning.
783
785
 
784
786
  Goal reviewers derive checks from the literal objective before consulting implementation receipts, inspect the actual checkout delta, and report commands, observed output, and file:line evidence rather than internal reasoning. Shared contracts cover acceptance-matrix traceability, contract-fidelity risks, end-to-end and QA-video evidence, and independent verification. `stop_review_loop` is the authoritative convergence signal: it remains `false` for P0–P2 findings, any `required_by_objective` finding, or unproven implementation/validation requirements; it becomes `true` only when independent evidence proves the objective and only non-blocking or authorized post-approval work remains. The deterministic reducer consumes that signal without reinterpreting free-form prose.
787
+ Goal and Ralph stage prompts — orchestrator, implementation, and reviewer alike — also carry shared code-quality verification guidance that points at the `qlty` skill for linting, auto-formatting, complexity and duplication metrics, and code smells, weighted higher when the objective asks for verifiers or high code quality. Repository-defined checks in `AGENTS.md`/`CLAUDE.md`, package scripts, and CI stay authoritative.
788
+ Both workflows also share repository-intent mining guidance: implementers and reviewers infer maintainer and requesting-user conventions from 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 — covering norms written docs rarely state, such as commit signing, message style and issue linking, changelog discipline, and review etiquette. The dominant, recent, intentional pattern wins over accidental drift, the requesting user's own activity weighs highest, implementers match the inferred conventions (an unsigned commit in a signed history is a miss, not a preference), and reviewers report deviations as convention findings. Behavioral evidence fills contract gaps; it never overrides the literal objective, acceptance criteria, or explicit `AGENTS.md`/`CLAUDE.md` guidance.
785
789
  Goal and Ralph share the same low-confidence finding re-verification and per-round convergence evidence, documented under [`ralph`](#ralph).
786
790
 
787
791
  | Input | Type | Required | Default | Description |