cliewen-openspec 0.1.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.
@@ -1,278 +1,317 @@
1
- ---
2
- type: reference
3
- ---
4
- # Project configuration
5
-
6
- Cliewen reads project settings from `.cliewen-openspec/config.yaml`.
7
-
8
- This reference describes version `0.1.0`. The earlier published `0.1.0-alpha.1` does not accept the `quality`, `lifecycle`, `learnings`, or `writing` settings below. Use that package's bundled reference when working with the alpha; its installation manifest is unsupported by 0.1.0.
9
-
10
- ## Full defaults
11
-
12
- This is the complete configuration written by `init`. Omitted fields use these values; unknown settings and invalid values fail validation. Changes apply when the next operation reads the config. They do not rewrite existing proposals or task lists.
13
-
14
- <!-- defaults -->
15
- ```yaml
16
- docsRoot: docs
17
- learnings:
18
- enabled: false
19
- directory: learnings
20
- writing:
21
- humanizer: auto
22
- features:
23
- documentation: true
24
- decisions: true
25
- mermaid: true
26
- planning: true
27
- review: true
28
- evidence: true
29
- evidence:
30
- report: .cliewen-openspec/evidence.json
31
- ac:
32
- capabilities: {}
33
- padding: 3
34
- testing:
35
- placement: per-task
36
- quality:
37
- coverage:
38
- mode: review
39
- minimumCases:
40
- positive: 1
41
- negative: 1
42
- boundary: 0
43
- effectiveness:
44
- mode: review
45
- lifecycle:
46
- mode: review
47
- types:
48
- Unit:
49
- description: Isolated behavior without external dependencies
50
- Integration:
51
- description: Interaction between components or dependencies
52
- E2E:
53
- description: Complete user or system workflow
54
- ```
55
-
56
- ## Test quality and lifecycle
57
-
58
- Each of `testing.quality.coverage.mode`, `testing.quality.effectiveness.mode`, and `testing.lifecycle.mode` accepts `off`, `review`, or `enforce`. The default is `review`: incomplete assessments produce warnings. `enforce` makes missing or invalid records blocking and requires `features.evidence: true`. `off` disables that policy's checks and guidance. Evidence opt-out leaves review guidance available but reports that execution-backed assessment is unavailable.
59
-
60
- Coverage counts distinct passed cases by scenario and category. Configure nonnegative safe-integer minima under `testing.quality.coverage.minimumCases`; omitted categories retain their defaults. One positive and one negative case are required by default, with relevant boundary cases assessed during review. A reviewed exception can waive a category minimum for a particular scenario.
61
-
62
- For example, to enforce coverage while leaving other policies advisory:
63
-
64
- ```yaml
65
- testing:
66
- quality:
67
- coverage:
68
- mode: enforce
69
- minimumCases:
70
- positive: 2
71
- ```
72
-
73
- This requires two positive and one negative case per scenario. It does not count retries or prove cases are meaningfully different. See [test quality and lifecycle](testing/test-quality.md) for tagging tests, writing review records, and handling exceptions.
74
-
75
- ## Documentation and features
76
-
77
- | Setting | Default | Effect |
78
- |---|---|---|
79
- | `docsRoot` | `docs` | Root for durable explanations; init creates an entry README if absent |
80
- | `features.documentation` | `true` | Guidance to assess and maintain affected documentation |
81
- | `features.decisions` | `true` | Guidance for considering and recording durable decisions |
82
- | `features.mermaid` | `true` | Guidance to use embedded Mermaid where useful |
83
- | `features.planning` | `true` | Makes optional planning guidance available; does not require a plan |
84
- | `features.review` | `true` | Makes review guidance available; a separate reviewer remains optional |
85
- | `features.evidence` | `true` | Scenario-ID and execution-report checks |
86
- | `evidence.report` | `.cliewen-openspec/evidence.json` | Repository-local path to the execution report |
87
-
88
- All paths must stay inside the project; absolute paths, parent traversal, and symlink components are rejected. A custom evidence report path must be Git-ignored and untracked before the reference adapter can write it. New installations ignore the default `evidence.json` report, `transaction.json`, and local `tdd/` history in `.cliewen-openspec/.gitignore`. Existing ignore files are preserved.
89
-
90
- ## Project learnings
91
-
92
- Set `learnings.enabled: true` to ask the coding agent to retrieve and maintain reusable project lessons. `learnings.directory` is relative to `docsRoot`. For example:
93
-
94
- ```yaml
95
- docsRoot: notes
96
- learnings:
97
- enabled: true
98
- directory: lessons
99
- ```
100
-
101
- This selects `notes/lessons/`. The installer does not create that directory or an empty index. When a useful lesson exists, the agent follows the existing collection's conventions or uses `.cliewen-openspec/templates/learning.md` and a short `README.md` index. The index lists titles, scope, status, and links. The agent reads the index first, then opens selected relevant notes in a later tool call. Broad content searches exclude unselected notes. Missing or unclear index information is a limitation to report, rather than a reason to load the whole collection.
102
-
103
- New notes distinguish `tentative`, `verified`, and `retired` guidance and record the situation, observation, evidence, correction, scope, and limits. Verified notes include a `lastVerified` date. Recheck applicability: a lesson never overrides current specs or accepted decisions. At closure, merge duplicates through links, retire stale notes in place, and promote recurring guidance into tests or durable rules where useful. Explicit maintenance may read affected historical notes selected from the index; ordinary work skips retired and unrelated contents. Routine work need not produce a lesson.
104
-
105
- Disabling learnings stops retrieval and maintenance guidance while preserving authored content. `features.documentation: false` also suppresses this workflow, even if learnings are enabled. Update and uninstall preserve authored notes and indexes; the installed template remains an owned resource. Existing knowledge outside the selected directory can be referenced without copying or moving it. Absolute, escaping, and empty directory settings are rejected; symlinks in the collection path are rejected when learnings are active. Disabled learnings do not inspect an unused collection path.
106
-
107
- ### Instructions before context collection
108
-
109
- Some agents gather project context before requesting OpenSpec instructions. Schema guidance becomes available when those instructions are read; it cannot prevent earlier reads. To request the intended order from the start, add this rule to the project's existing agent instruction file, such as `AGENTS.md` or the host's equivalent:
110
-
111
- ```text
112
- For Cliewen operations, read .cliewen-openspec/config.yaml and obtain the selected OpenSpec artifact or apply instructions before broad project-content reads or searches. Resolve the learning policy first: when enabled and documentation guidance is active, read only the configured collection's index in one tool call, then select relevant notes before opening them in a later call. Exclude unselected, unrelated, and retired notes from ordinary context reads and content searches. Explicit maintenance may select affected historical notes. When disabled, skip the collection. Report limitations rather than loading everything.
113
- ```
114
-
115
- The installer does not add or replace this project-owned rule. It requests an order; agent behavior still needs review. A trace that shows an unwanted read takes precedence over an agent's claim that it skipped the file.
116
-
117
- These are agent instructions, not a content validator. `check` cannot establish that a lesson is true, relevant, or actually retrieved. Changing settings requires no reinstall, but upgrading from an older package requires [updating its installed instructions](guide/updating.md).
118
-
119
- ## Humanizer and writing
120
-
121
- Baseline writing guidance applies in every mode. Agents should distinguish the accepted contract from runtime observations, describe the output representation actually checked, and name what each verification command establishes. These requests need review; neither Humanizer nor `check` validates every factual claim.
122
-
123
- `writing.humanizer` controls the coding agent's use of an external skill:
124
-
125
- | Value | Behavior |
126
- |---|---|
127
- | `auto` (default) | Inspect the host's exposed inventory and use a usable Humanizer skill when available |
128
- | `"on"` | Explicitly request use, with the same nonblocking fallback when unavailable |
129
- | `"off"` | Skip Cliewen's discovery, use, status messages, and installation suggestions |
130
-
131
- For example, to disable this integration independently of learnings:
132
-
133
- ```yaml
134
- writing:
135
- humanizer: "off"
136
- ```
137
-
138
- In auto/on mode, the agent gives one short status per session: used, detected but inaccessible, confirmed absent, or availability unknown. It claims use only after reading and applying the skill's instructions. It does not repeat the status in each artifact or PR description. If absence is confirmed, it may combine the status with one installation suggestion, respecting a refusal. An unavailable inventory is reported as unknown, not as a missing skill.
139
-
140
- Cliewen does not scan global skill directories, install software, enable plugins, or cache availability across sessions. Installation is a deliberate user action using [Humanizer's current host-specific instructions](https://github.com/blader/humanizer#installation). Availability depends on the host's inventory and permissions; finding a file does not prove the agent can invoke it. No universal detection command or cross-host success guarantee is provided.
141
-
142
- A failed attempt to load a skill by name does not establish that the host detected it. When inventory is unavailable, report availability as unknown and describe the failed invocation separately. Reserve "detected but inaccessible" for a skill the host actually identifies.
143
-
144
- The skill applies to prose across proposals, specs, tasks, guides, comments, docstrings, commits, PR descriptions, messages, and replies. Preserve technical meaning, code behavior, commands, identifiers, and structured data; verify factual claims after rewriting. Baseline clear-writing rules apply in every mode and when the skill is absent. Disabling documentation guidance does not disable these writing rules or Humanizer. Independent repository or host requirements still apply.
145
-
146
- Shared writing guidance also asks the agent to check local document links before handoff, using each containing file's directory as the base. For example, a proposal at `openspec/changes/example/proposal.md` reaches `docs/` through `../../../docs/`. Verify targets and fragments with the project's available link or rendering checks. Describe future files as planned paths until they exist. This is agent guidance; Cliewen's `check` command does not validate every Markdown link or authenticate the agent's validation claims.
147
-
148
- ## Test types
149
-
150
- `testing.types` defaults to `Unit`, `Integration`, and `E2E`, with the descriptions shown above. A project-defined mapping replaces the entire default set. Names are case-sensitive, may contain spaces, and must be nonempty, single-line names without surrounding whitespace or square brackets. Each entry requires a nonempty `description`; an empty mapping is invalid.
151
-
152
- For example, a project that calls its tests Component and System can use:
153
-
154
- ```yaml
155
- testing:
156
- types:
157
- Component:
158
- description: One component tested in process with controlled dependencies
159
- System:
160
- description: A complete workflow against a deployed system
161
- ```
162
-
163
- Each scenario needs exactly one `Test-type: Component` line beneath its heading. With the Node adapter, give each mapped test a title such as `exports rows [EXPORT-001] [Test-type: Component]`. Tasks should name the concrete test, type, and verification boundary. The checker requires evidence `testType` to match the scenario's declared type exactly; it does not assume one type substitutes for another. Task descriptions and the actual quality of the test boundary still require review.
164
-
165
- For existing projects, add types to scenarios and test titles, commit the inputs, then regenerate evidence. Older reports without `testType` fail the check and are not automatically upgraded. Evidence opt-out skips these checks. Testing types do not change per-task placement or verification quality.
166
-
167
- The candidate supplies guidance for documentation, decisions, Mermaid, planning, and review. It does not structurally validate those documents or independently enforce agent behavior. Disabling a facility preserves authored files. Evidence opt-out skips product evidence checks; installation and registry checks still run.
168
-
169
- For example, to use a different documentation root and turn off Mermaid guidance:
170
-
171
- ```yaml
172
- docsRoot: project-docs
173
- features:
174
- mermaid: false
175
- ```
176
-
177
- Other fields retain their defaults. The YAML objects `features`, `ac`, and `testing` support partial settings. If you provide `evidence`, include its `report` string. Changing `docsRoot` does not move existing files. The schema artifact graph is selected by the OpenSpec schema and is not rewritten by feature flags.
178
-
179
- ## Testing and IDs at a glance
180
-
181
- ```yaml
182
- ac:
183
- padding: 3
184
- capabilities: {}
185
- testing:
186
- placement: per-task
187
- types:
188
- Unit:
189
- description: Isolated behavior without external dependencies
190
- Integration:
191
- description: Interaction between components or dependencies
192
- E2E:
193
- description: Complete user or system workflow
194
- ```
195
-
196
- ## Acceptance criterion IDs
197
-
198
- An ID consists of an uppercase prefix, a hyphen, and a positive sequence number. Register a prefix for each capability before allocating IDs:
199
-
200
- ```yaml
201
- ac:
202
- padding: 3
203
- capabilities:
204
- csv-export: EXP
205
- account-management: ACC
206
- support: SUP
207
- ```
208
-
209
- Capability names match their directories under `openspec/specs/` or the change's `specs/`. A new capability can be registered before its spec directory exists. There is no global prefix or automatic prefix selection.
210
-
211
- Choose a short, recognizable capability or domain name with your team. `EXPORT` and `EXP` are equally valid; Cliewen does not infer either from the change title. Reuse the chosen prefix for that capability across changes. The prefix must start with an uppercase letter and contain only uppercase letters and digits.
212
-
213
- ```sh
214
- cliewen-openspec ac next --capability csv-export # EXP-001 initially
215
- cliewen-openspec ac next --capability support # SUP-001 initially
216
- cliewen-openspec ac next EXP # Same registered sequence as csv-export
217
- ```
218
-
219
- `padding` is the minimum number of digits, from 1 to 12. For example, 1 produces `EXP-1`, 3 produces `EXP-001`, and 4 produces `EXP-0001`. Numbers grow beyond the minimum width without truncation. The separator is always a hyphen; arbitrary ID templates are not supported.
220
-
221
- Each capability owns one numeric sequence. The allocator consults the committed `.cliewen-openspec/ac-registry.json` and existing OpenSpec Markdown, including active and archived changes. It never reclaims allocated numbers. Changing padding continues the same sequence and does not rewrite existing IDs. Commit the registry together with config and specs. Parallel branches still need collision resolution; this allocator supports sequential work rather than distributed allocation.
222
-
223
- ### Renaming a prefix
224
-
225
- Use the command rather than editing an established mapping directly:
226
-
227
- ```sh
228
- cliewen-openspec ac rename-prefix csv-export EXPORT
229
- cliewen-openspec ac next --capability csv-export
230
- ```
231
-
232
- If the highest allocated number was `EXP-017`, the next ID is `EXPORT-018`. Existing scenarios and tests keep their `EXP-...` references. The command updates config and registry in one recoverable transaction, preserving YAML comments. Config and registry mismatches block allocation and are reported by `check`, including when evidence is disabled. Restore the registered prefix in config before running the rename command if you edited it manually.
233
-
234
- Current and historical prefixes remain reserved to their original capability, even if its config mapping is removed. Allocation using a retired prefix is rejected with guidance to use the current capability. Previously used prefixes cannot be reassigned, including renaming back to a historical prefix. The command also rejects target prefixes already appearing in OpenSpec documents.
235
-
236
- The registry records each capability's current prefix, previous prefixes, and highest allocated number. `check` validates this state without writing it. Removing the registry loses allocation history, so retain it in version control. Do not use the native registry as a second authority for IDs allocated by another tool.
237
-
238
- The earlier experimental `ac.prefix` setting is no longer supported. Replace it with `ac.capabilities` before using this version. Existing bracketed IDs remain valid evidence references regardless of prefix history.
239
-
240
- ## Test placement
241
-
242
- `testing.placement` controls the schema's planning and implementation guidance:
243
-
244
- - `per-task` (default): Each implementation task includes its relevant tests, a test command, and a completion check. Implement a small slice, run its tests, fix failures, and then continue to the next task. Documentation-only tasks can use an appropriate validation check. This provides fast feedback throughout implementation.
245
- - `end-of-change`: Plan tests in a final verification section, with explicit links to the implementation tasks they cover.
246
-
247
- Both modes retain final regression testing and revision-bound evidence collection. Per-task test runs provide immediate feedback; the evidence adapter records results for the final committed inputs. Disabling evidence does not disable ordinary task-level testing.
248
-
249
- Placement is guidance supplied by the installed schema and task template. Configuration changes do not rewrite existing task lists; revise the task plan when changing this setting.
250
-
251
- <a id="test-driven-development"></a>
252
-
253
- ## Evidence-first verification
254
-
255
- Use **spec-driven development with evidence-first verification**: define expected behavior and how to verify it before implementation. Develop code and tests in small steps, check that tests detect relevant faults, and maintain them as requirements change.
256
-
257
- 1. Describe acceptance criteria and positive, negative, and boundary cases before implementation. Consider [interactions between inputs and options](testing/test-quality.md#plan-interacting-cases), especially when existing content must be preserved. Executable tests can develop alongside the code.
258
- 2. Verify each task before continuing, using concrete commands and actual results. With end-of-change placement, plan the final automated suite while retaining a suitable check for each task.
259
- 3. Assess assertion effectiveness through relevant failures and review. A setup or syntax failure does not show that a test detects the intended defect.
260
- 4. Keep tests aligned with accepted requirements, preserving active assertions and explicitly reviewing retirement.
261
-
262
- This approach is close to [Specification by Example](https://martinfowler.com/bliki/SpecificationByExample.html), which uses concrete examples to clarify specifications, and [ATDD](https://agilealliance.org/glossary/atdd/), which agrees acceptance tests before implementation. Evidence-first verification is our descriptive wording; it does not require a particular order of test and production edits.
263
-
264
- ### Earlier formats
265
-
266
- The first non-prerelease release supports fresh configuration and its own `0.1.0` installation manifests. It does not migrate earlier alpha installations. Retired `testing.approach` values and effectiveness records using `method: tdd` remain invalid; do not copy them into a new project.
267
-
268
- Existing authored history remains project-owned. Recorder commands and task-method metadata from earlier development builds do not establish completion under evidence-first verification. General format migration is outside this release's scope.
269
-
270
- ## Decision filenames
271
-
272
- New projects use `NNN-short-title.md`, such as `001-use-a-shared-base.md`, for new Decision Records. The sequence starts at 1, padded to a minimum of three digits for filename sorting. Numbers above 999 grow naturally. This is a naming convention in the schema guidance, not a configurable setting or an implemented decision allocator.
273
-
274
- Existing filenames and paths are stable public addresses: never rename, move, or renumber documents to normalize naming, titles, categories, or padding. External systems such as GitHub may link to them. Edit content and metadata in place, even when a title or category changes. Existing projects retain conventions such as `ADR-059-title.md` and `PDR-074-title.md`; read their allocation rules and use their existing ID authority rather than starting a competing counter. These conventions are not configurable in `0.1.0`. This repository's earlier owner-approved filename normalization does not authorize renaming documents in other projects.
275
-
276
- ## Installed resource versions
277
-
278
- The `0.1.0` candidate's `init`, `update`, and `uninstall` accept only `0.1.0` installation manifests. `check` reports other manifest versions as unsupported; changing the recorded version by hand does not migrate an installation. Use a fresh project for candidate evaluation. [Update](guide/updating.md) refreshes or repairs owned resources within the supported version while preserving configuration, registry, authored artifacts, and document paths. Adding config settings alone does not replace installed instructions. General version/config/registry migrations are outside this release's scope.
1
+ ---
2
+ type: reference
3
+ ---
4
+ # Project configuration
5
+
6
+ Cliewen reads project settings from `.cliewen-openspec/config.yaml`.
7
+
8
+ This reference describes version `0.2.0`. The earlier published `0.1.0-alpha.1` does not accept the `quality`, `lifecycle`, `learnings`, or `writing` settings below. Use that package's bundled reference when working with the alpha; its installation manifest is unsupported by 0.2.0.
9
+
10
+ ## Version compatibility
11
+
12
+ Cliewen requires **OpenSpec 1.15.0 or newer**, **Node.js 20.19 or newer**, and Git. Current development pins OpenSpec 1.17.0. The published 0.1.0 release was checked with OpenSpec 1.15.0; 0.2.0 checks cover OpenSpec 1.15.0 and 1.17.0.
13
+
14
+ OpenSpec has its own installation requirements:
15
+
16
+ | Installation | Node requirement |
17
+ |---|---|
18
+ | Cliewen CLI | Node 20.19+ |
19
+ | OpenSpec 1.15.0 via npm | Compatible with the Cliewen Node 20.19 minimum |
20
+ | OpenSpec 1.17.0 via npm | Node 22.12+ |
21
+ | OpenSpec standalone binary | No Node runtime for OpenSpec itself; Cliewen still needs Node |
22
+
23
+ On Node 20.19, pin `@fission-ai/openspec@1.15.0` or use a compatible OpenSpec standalone installation. The current worked npm guide uses OpenSpec 1.17.0 and therefore requires Node 22.12+. See [OpenSpec's release notes](https://github.com/Fission-AI/OpenSpec/blob/main/CHANGELOG.md) for its own runtime requirements.
24
+
25
+ The minimum is a compatibility floor, not proof that every newer release has been tested. A future Cliewen release may raise its OpenSpec or Node minimum. Review that release's requirements before upgrading.
26
+
27
+ Version 0.2.0 checks these minimums at every `init` and `update`, including previews, before recovery or installation writes. Published 0.1.0 does not perform these checks. No persistent success cache is used. Other commands keep their existing requirements; explicit `recover` remains available to restore an interrupted transaction.
28
+
29
+ The check uses the project's resolvable OpenSpec npm installation first, otherwise the CLI on PATH, including a standalone executable. It runs that installation's public `--version`; an incompatible or broken selected local installation does not fall back to a global version. Output identifies the source and detected versions. Missing tools, invalid/prerelease versions, execution failure, or a probe exceeding five seconds stop init/update with an actionable error. Cliewen neither downloads nor upgrades OpenSpec during this check.
30
+
31
+ The 0.2.0 upgrade route accepts published 0.1.0 ownership manifests and the running target version. Further source versions require explicit support; alpha installations, unknown formats, and downgrades remain unsupported. See [updating an installation](guide/updating.md) for package/resource boundaries and preview output; never relabel a manifest to bypass validation.
32
+
33
+ ## Optional product context in development
34
+
35
+ Version 0.2.0 installs `.cliewen-openspec/product-context.md` for product intent, useful cross-capability journeys, and detection of drift or scope creep. Published 0.1.0 does not contain this reference. There is no new configuration field or required artifact. `features.documentation` controls optional records under `docsRoot` or existing project paths; `features.planning` independently controls planning authority and ticket access. Disabled facilities add no corresponding work and preserve authored content. Existing supplied context still informs normal scoping. See [product intent and journeys](guide/workflow.md#keep-the-users-outcome-in-view) for an illustrative example and limits.
36
+
37
+ ## Full defaults
38
+
39
+ This is the complete configuration written by `init`. Omitted fields use these values; unknown settings and invalid values fail validation. Changes apply when the next operation reads the config. They do not rewrite existing proposals or task lists.
40
+
41
+ <!-- defaults -->
42
+ ```yaml
43
+ docsRoot: docs
44
+ learnings:
45
+ enabled: false
46
+ directory: learnings
47
+ writing:
48
+ humanizer: auto
49
+ features:
50
+ documentation: true
51
+ decisions: true
52
+ mermaid: true
53
+ planning: true
54
+ review: true
55
+ evidence: true
56
+ evidence:
57
+ report: .cliewen-openspec/evidence.json
58
+ ac:
59
+ capabilities: {}
60
+ padding: 3
61
+ testing:
62
+ placement: per-task
63
+ quality:
64
+ coverage:
65
+ mode: review
66
+ minimumCases:
67
+ positive: 1
68
+ negative: 1
69
+ boundary: 0
70
+ effectiveness:
71
+ mode: review
72
+ lifecycle:
73
+ mode: review
74
+ types:
75
+ Unit:
76
+ description: Isolated behavior without external dependencies
77
+ Integration:
78
+ description: Interaction between components or dependencies
79
+ E2E:
80
+ description: Complete user or system workflow
81
+ ```
82
+
83
+ ## Test quality and lifecycle
84
+
85
+ Each of `testing.quality.coverage.mode`, `testing.quality.effectiveness.mode`, and `testing.lifecycle.mode` accepts `off`, `review`, or `enforce`. The default is `review`: incomplete assessments produce warnings. `enforce` makes missing or invalid records blocking and requires `features.evidence: true`. `off` disables that policy's checks and guidance. Evidence opt-out leaves review guidance available but reports that execution-backed assessment is unavailable.
86
+
87
+ Coverage counts distinct passed cases by scenario and category. Configure nonnegative safe-integer minima under `testing.quality.coverage.minimumCases`; omitted categories retain their defaults. One positive and one negative case are required by default, with relevant boundary cases assessed during review. A reviewed exception can waive a category minimum for a particular scenario.
88
+
89
+ For example, to enforce coverage while leaving other policies advisory:
90
+
91
+ ```yaml
92
+ testing:
93
+ quality:
94
+ coverage:
95
+ mode: enforce
96
+ minimumCases:
97
+ positive: 2
98
+ ```
99
+
100
+ This requires two positive and one negative case per scenario. It does not count retries or prove cases are meaningfully different. See [test quality and lifecycle](testing/test-quality.md) for tagging tests, writing review records, and handling exceptions.
101
+
102
+ ## Documentation and features
103
+
104
+ | Setting | Default | Effect |
105
+ |---|---|---|
106
+ | `docsRoot` | `docs` | Root for durable explanations; init creates an entry README if absent |
107
+ | `features.documentation` | `true` | Guidance to assess and maintain affected documentation |
108
+ | `features.decisions` | `true` | Guidance for considering and recording durable decisions |
109
+ | `features.mermaid` | `true` | Guidance to use embedded Mermaid where useful |
110
+ | `features.planning` | `true` | Enables planning-authority discovery, ticket access guidance, and plan maintenance; does not require a plan |
111
+ | `features.review` | `true` | Makes review guidance available; a separate reviewer remains optional |
112
+ | `features.evidence` | `true` | Scenario-ID and execution-report checks |
113
+ | `evidence.report` | `.cliewen-openspec/evidence.json` | Repository-local path to the execution report |
114
+
115
+ All paths must stay inside the project; absolute paths, parent traversal, and symlink components are rejected. A custom evidence report path must be Git-ignored and untracked before the reference adapter can write it. New installations ignore the default `evidence.json` report, `transaction.json`, and local `tdd/` history in `.cliewen-openspec/.gitignore`. Existing ignore files are preserved.
116
+
117
+ ## Project learnings
118
+
119
+ Set `learnings.enabled: true` to ask the coding agent to retrieve and maintain reusable project lessons. `learnings.directory` is relative to `docsRoot`. For example:
120
+
121
+ ```yaml
122
+ docsRoot: notes
123
+ learnings:
124
+ enabled: true
125
+ directory: lessons
126
+ ```
127
+
128
+ This selects `notes/lessons/`. The installer does not create that directory or an empty index. When a useful lesson exists, the agent follows the existing collection's conventions or uses `.cliewen-openspec/templates/learning.md` and a short `README.md` index. The index lists titles, scope, status, and links. The agent reads the index first, then opens selected relevant notes in a later tool call. Broad content searches exclude unselected notes. Missing or unclear index information is a limitation to report, rather than a reason to load the whole collection.
129
+
130
+ New notes distinguish `tentative`, `verified`, and `retired` guidance and record the situation, observation, evidence, correction, scope, and limits. Verified notes include a `lastVerified` date. Recheck applicability: a lesson never overrides current specs or accepted decisions. At closure, merge duplicates through links, retire stale notes in place, and promote recurring guidance into tests or durable rules where useful. Explicit maintenance may read affected historical notes selected from the index; ordinary work skips retired and unrelated contents. Routine work need not produce a lesson.
131
+
132
+ Disabling learnings stops retrieval and maintenance guidance while preserving authored content. `features.documentation: false` also suppresses this workflow, even if learnings are enabled. Update and uninstall preserve authored notes and indexes; the installed template remains an owned resource. Existing knowledge outside the selected directory can be referenced without copying or moving it. Absolute, escaping, and empty directory settings are rejected; symlinks in the collection path are rejected when learnings are active. Disabled learnings do not inspect an unused collection path.
133
+
134
+ ### Instructions before context collection
135
+
136
+ Some agents gather project context before requesting OpenSpec instructions. Schema guidance becomes available when those instructions are read; it cannot prevent earlier reads. For development-source installations containing `.cliewen-openspec/planning.md`, add this rule to the project's existing agent instruction file, such as `AGENTS.md` or the host's equivalent:
137
+
138
+ ```text
139
+ Before creating or resuming an OpenSpec change, first read only .cliewen-openspec/config.yaml and .cliewen-openspec/planning.md, without batching project documents or lesson contents into that tool call. Follow the reference's learning-policy and index-first instructions before broad reads or searches, independently of features.planning. Apply its work-scoping guidance and enable planning-specific requests only when features.planning is enabled. Retrieve the selected native OpenSpec artifact or apply instructions before executing the workflow.
140
+ ```
141
+
142
+ The installer does not add or replace this project-owned rule. It requests an order; agent behavior still needs review. A trace that shows an unwanted read takes precedence over an agent's claim that it skipped the file.
143
+
144
+ Published 0.1.0 does not contain the planning reference. For that installation, request native OpenSpec artifact or apply instructions first and follow their learning-policy and index-first rules before broad context collection. Updating package code alone does not refresh installed references; use the supported installation lifecycle and review local ownership conflicts.
145
+
146
+ These are agent instructions, not a content validator. `check` cannot establish that a lesson is true, relevant, or actually retrieved. Changing settings requires no reinstall, but upgrading from an older package requires [updating its installed instructions](guide/updating.md).
147
+
148
+ ## Humanizer and writing
149
+
150
+ Baseline writing guidance applies in every mode. Agents should distinguish the accepted contract from runtime observations, describe the output representation actually checked, and name what each verification command establishes. These requests need review; neither Humanizer nor `check` validates every factual claim.
151
+
152
+ `writing.humanizer` controls the coding agent's use of an external skill:
153
+
154
+ | Value | Behavior |
155
+ |---|---|
156
+ | `auto` (default) | Inspect the host's exposed inventory and use a usable Humanizer skill when available |
157
+ | `"on"` | Explicitly request use, with the same nonblocking fallback when unavailable |
158
+ | `"off"` | Skip Cliewen's discovery, use, status messages, and installation suggestions |
159
+
160
+ For example, to disable this integration independently of learnings:
161
+
162
+ ```yaml
163
+ writing:
164
+ humanizer: "off"
165
+ ```
166
+
167
+ In auto/on mode, the agent gives one short status per session: used, detected but inaccessible, confirmed absent, or availability unknown. It claims use only after reading and applying the skill's instructions. It does not repeat the status in each artifact or PR description. If absence is confirmed, it may combine the status with one installation suggestion, respecting a refusal. An unavailable inventory is reported as unknown, not as a missing skill.
168
+
169
+ Cliewen does not scan global skill directories, install software, enable plugins, or cache availability across sessions. Installation is a deliberate user action using [Humanizer's current host-specific instructions](https://github.com/blader/humanizer#installation). Availability depends on the host's inventory and permissions; finding a file does not prove the agent can invoke it. No universal detection command or cross-host success guarantee is provided.
170
+
171
+ A failed attempt to load a skill by name does not establish that the host detected it. When inventory is unavailable, report availability as unknown and describe the failed invocation separately. Reserve "detected but inaccessible" for a skill the host actually identifies.
172
+
173
+ The skill applies to prose across proposals, specs, tasks, guides, comments, docstrings, commits, PR descriptions, messages, and replies. Preserve technical meaning, code behavior, commands, identifiers, and structured data; verify factual claims after rewriting. Baseline clear-writing rules apply in every mode and when the skill is absent. Disabling documentation guidance does not disable these writing rules or Humanizer. Independent repository or host requirements still apply.
174
+
175
+ Shared writing guidance also asks the agent to check local document links before handoff, using each containing file's directory as the base. For example, a proposal at `openspec/changes/example/proposal.md` reaches `docs/` through `../../../docs/`. Verify targets and fragments with the project's available link or rendering checks. Describe future files as planned paths until they exist. This is agent guidance; Cliewen's `check` command does not validate every Markdown link or authenticate the agent's validation claims.
176
+
177
+ ## Test types
178
+
179
+ `testing.types` defaults to `Unit`, `Integration`, and `E2E`, with the descriptions shown above. A project-defined mapping replaces the entire default set. Names are case-sensitive, may contain spaces, and must be nonempty, single-line names without surrounding whitespace or square brackets. Each entry requires a nonempty `description`; an empty mapping is invalid.
180
+
181
+ For example, a project that calls its tests Component and System can use:
182
+
183
+ ```yaml
184
+ testing:
185
+ types:
186
+ Component:
187
+ description: One component tested in process with controlled dependencies
188
+ System:
189
+ description: A complete workflow against a deployed system
190
+ ```
191
+
192
+ Each scenario needs exactly one `Test-type: Component` line beneath its heading. With the Node adapter, give each mapped test a title such as `exports rows [EXPORT-001] [Test-type: Component]`. Tasks should name the concrete test, type, and verification boundary. The checker requires evidence `testType` to match the scenario's declared type exactly; it does not assume one type substitutes for another. Task descriptions and the actual quality of the test boundary still require review.
193
+
194
+ For existing projects, add types to scenarios and test titles, commit the inputs, then regenerate evidence. Older reports without `testType` fail the check and are not automatically upgraded. Evidence opt-out skips these checks. Testing types do not change per-task placement or verification quality.
195
+
196
+ Development source extends planning with single-authority backlog guidance and an installed `.cliewen-openspec/planning.md` reference. These additions are not in published 0.1.0. See [change scoping and optional pre-change setup](guide/workflow.md#choose-the-next-delivery).
197
+
198
+ The candidate supplies guidance for documentation, decisions, Mermaid, planning, and review. It does not structurally validate those documents or independently enforce agent behavior. Disabling a facility preserves authored files. Evidence opt-out skips product evidence checks; installation and registry checks still run.
199
+
200
+ For example, to use a different documentation root and turn off Mermaid guidance:
201
+
202
+ ```yaml
203
+ docsRoot: project-docs
204
+ features:
205
+ mermaid: false
206
+ ```
207
+
208
+ Other fields retain their defaults. The YAML objects `features`, `ac`, and `testing` support partial settings. If you provide `evidence`, include its `report` string. Changing `docsRoot` does not move existing files. The schema artifact graph is selected by the OpenSpec schema and is not rewritten by feature flags.
209
+
210
+ ## Testing and IDs at a glance
211
+
212
+ ```yaml
213
+ ac:
214
+ padding: 3
215
+ capabilities: {}
216
+ testing:
217
+ placement: per-task
218
+ types:
219
+ Unit:
220
+ description: Isolated behavior without external dependencies
221
+ Integration:
222
+ description: Interaction between components or dependencies
223
+ E2E:
224
+ description: Complete user or system workflow
225
+ ```
226
+
227
+ ## Acceptance criterion IDs
228
+
229
+ An ID consists of an uppercase prefix, a hyphen, and a positive sequence number. Register a prefix for each capability before allocating IDs:
230
+
231
+ ```yaml
232
+ ac:
233
+ padding: 3
234
+ capabilities:
235
+ csv-export: EXP
236
+ account-management: ACC
237
+ support: SUP
238
+ ```
239
+
240
+ Capability names match their directories under `openspec/specs/` or the change's `specs/`. A new capability can be registered before its spec directory exists. There is no global prefix or automatic prefix selection.
241
+
242
+ Choose a short, recognizable capability or domain name with your team. `EXPORT` and `EXP` are equally valid; Cliewen does not infer either from the change title. Reuse the chosen prefix for that capability across changes. The prefix must start with an uppercase letter and contain only uppercase letters and digits.
243
+
244
+ ```sh
245
+ cliewen-openspec ac next --capability csv-export # EXP-001 initially
246
+ cliewen-openspec ac next --capability support # SUP-001 initially
247
+ cliewen-openspec ac next EXP # Same registered sequence as csv-export
248
+ ```
249
+
250
+ `padding` is the minimum number of digits, from 1 to 12. For example, 1 produces `EXP-1`, 3 produces `EXP-001`, and 4 produces `EXP-0001`. Numbers grow beyond the minimum width without truncation. The separator is always a hyphen; arbitrary ID templates are not supported.
251
+
252
+ Each capability owns one numeric sequence. The allocator consults the committed `.cliewen-openspec/ac-registry.json` and existing OpenSpec Markdown, including active and archived changes. It never reclaims allocated numbers. Changing padding continues the same sequence and does not rewrite existing IDs. Commit the registry together with config and specs. Parallel branches still need collision resolution; this allocator supports sequential work rather than distributed allocation.
253
+
254
+ ### Renaming a prefix
255
+
256
+ Use the command rather than editing an established mapping directly:
257
+
258
+ ```sh
259
+ cliewen-openspec ac rename-prefix csv-export EXPORT
260
+ cliewen-openspec ac next --capability csv-export
261
+ ```
262
+
263
+ If the highest allocated number was `EXP-017`, the next ID is `EXPORT-018`. Existing scenarios and tests keep their `EXP-...` references. The command updates config and registry in one recoverable transaction, preserving YAML comments. Config and registry mismatches block allocation and are reported by `check`, including when evidence is disabled. Restore the registered prefix in config before running the rename command if you edited it manually.
264
+
265
+ Current and historical prefixes remain reserved to their original capability, even if its config mapping is removed. Allocation using a retired prefix is rejected with guidance to use the current capability. Previously used prefixes cannot be reassigned, including renaming back to a historical prefix. The command also rejects target prefixes already appearing in OpenSpec documents.
266
+
267
+ The registry records each capability's current prefix, previous prefixes, and highest allocated number. `check` validates this state without writing it. Removing the registry loses allocation history, so retain it in version control. Do not use the native registry as a second authority for IDs allocated by another tool.
268
+
269
+ The earlier experimental `ac.prefix` setting is no longer supported. Replace it with `ac.capabilities` before using this version. Existing bracketed IDs remain valid evidence references regardless of prefix history.
270
+
271
+ ## Test placement
272
+
273
+ `testing.placement` controls the schema's planning and implementation guidance:
274
+
275
+ - `per-task` (default): Each implementation task includes its relevant tests, a test command, and a completion check. Implement a small slice, run its tests, fix failures, and then continue to the next task. Documentation-only tasks can use an appropriate validation check. This provides fast feedback throughout implementation.
276
+ - `end-of-change`: Plan tests in a final verification section, with explicit links to the implementation tasks they cover.
277
+
278
+ Both modes retain final regression testing and revision-bound evidence collection. Per-task test runs provide immediate feedback; the evidence adapter records results for the final committed inputs. Disabling evidence does not disable ordinary task-level testing.
279
+
280
+ Placement is guidance supplied by the installed schema and task template. Configuration changes do not rewrite existing task lists; revise the task plan when changing this setting.
281
+
282
+ <a id="test-driven-development"></a>
283
+
284
+ ## Evidence-first verification
285
+
286
+ Use **spec-driven development with evidence-first verification**: define expected behavior and how to verify it before implementation. Develop code and tests in small steps, check that tests detect relevant faults, and maintain them as requirements change.
287
+
288
+ 1. Describe acceptance criteria and positive, negative, and boundary cases before implementation. Consider [interactions between inputs and options](testing/test-quality.md#plan-interacting-cases), especially when existing content must be preserved. Executable tests can develop alongside the code.
289
+ 2. Verify each task before continuing, using concrete commands and actual results. With end-of-change placement, plan the final automated suite while retaining a suitable check for each task.
290
+ 3. Assess assertion effectiveness through relevant failures and review. A setup or syntax failure does not show that a test detects the intended defect.
291
+ 4. Keep tests aligned with accepted requirements, preserving active assertions and explicitly reviewing retirement.
292
+
293
+ This approach is close to [Specification by Example](https://martinfowler.com/bliki/SpecificationByExample.html), which uses concrete examples to clarify specifications, and [ATDD](https://agilealliance.org/glossary/atdd/), which agrees acceptance tests before implementation. Evidence-first verification is our descriptive wording; it does not require a particular order of test and production edits.
294
+
295
+ ### Earlier formats
296
+
297
+ The first non-prerelease release supports fresh configuration and its own `0.1.0` installation manifests. It does not migrate earlier alpha installations. Retired `testing.approach` values and effectiveness records using `method: tdd` remain invalid; do not copy them into a new project.
298
+
299
+ Existing authored history remains project-owned. Recorder commands and task-method metadata from earlier development builds do not establish completion under evidence-first verification. General format migration is outside this release's scope.
300
+
301
+ ## Decision filenames
302
+
303
+ New projects use `NNN-short-title.md`, such as `001-use-a-shared-base.md`, for new Decision Records. The sequence starts at 1, padded to a minimum of three digits for filename sorting. Numbers above 999 grow naturally. This is a naming convention in the schema guidance, not a configurable setting or an implemented decision allocator.
304
+
305
+ Existing filenames and paths are stable public addresses: never rename, move, or renumber documents to normalize naming, titles, categories, or padding. External systems such as GitHub may link to them. Edit content and metadata in place, even when a title or category changes. Existing projects retain conventions such as `ADR-059-title.md` and `PDR-074-title.md`; read their allocation rules and use their existing ID authority rather than starting a competing counter. These conventions are not configurable in `0.1.0`. This repository's earlier owner-approved filename normalization does not authorize renaming documents in other projects.
306
+
307
+ ## Installed resource versions
308
+
309
+ The `0.1.0` candidate's `init`, `update`, and `uninstall` accept only `0.1.0` installation manifests. `check` reports other manifest versions as unsupported; changing the recorded version by hand does not migrate an installation. Use a fresh project for candidate evaluation. [Update](guide/updating.md) refreshes or repairs owned resources within the supported version while preserving configuration, registry, authored artifacts, and document paths. Adding config settings alone does not replace installed instructions. General version/config/registry migrations are outside this release's scope.
310
+
311
+ ## Optional archive-session guidance
312
+
313
+ Version 0.2.0 installs `.cliewen-openspec/closure.md`. For repository-local projects, OpenSpec's project-owned `operations.archive.guidance` can point an archive session to that reference. See [closure setup and limits](guide/workflow.md#use-the-reference-from-a-separate-archive-session), including direct CLI use and removal of the optional entry after uninstall. Existing Cliewen feature and test-policy settings control the matching review responsibilities; there is no new configuration flag or automatic archive hook.
314
+
315
+ ## Optional prototype guidance
316
+
317
+ Version 0.2.0 installs `.cliewen-openspec/prototyping.md` for [bounded user-selected experiments](guide/workflow.md#try-a-prototype-when-it-can-answer-a-question). Prototype selection is per task and adds no configuration flag. Planning controls ticket/plan maintenance; learnings and documentation settings control optional lesson maintenance. Native investigation artifacts retain actual findings even when those facilities are disabled. The existing installation lifecycle owns only the reference, not prototype files or user records.