@vaubaan/harness 0.0.0-stage → 1.3.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.
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +190 -2
- package/dist/agents/coding.agent.md +183 -0
- package/dist/agents/merge.agent.md +139 -0
- package/dist/agents/planning.agent.md +194 -0
- package/dist/agents/review.agent.md +176 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +2896 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/clean-code.cmd.md +26 -0
- package/dist/commands/decision.cmd.md +19 -0
- package/dist/commands/doc-audit.cmd.md +24 -0
- package/dist/commands/drift.cmd.md +18 -0
- package/dist/commands/handbook.cmd.md +21 -0
- package/dist/commands/readme.cmd.md +19 -0
- package/dist/commands/spec.cmd.md +20 -0
- package/dist/commands/test-plan.cmd.md +22 -0
- package/dist/commands/workflow.cmd.md +19 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +1673 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +42 -0
- package/dist/init.js +1055 -0
- package/dist/init.js.map +1 -0
- package/dist/linters/index.d.ts +43 -0
- package/dist/linters/index.js +726 -0
- package/dist/linters/index.js.map +1 -0
- package/dist/parser/index.d.ts +247 -0
- package/dist/parser/index.js +114 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/render-B9_kNtQc.d.ts +50 -0
- package/dist/render.d.ts +3 -0
- package/dist/render.js +539 -0
- package/dist/render.js.map +1 -0
- package/dist/skills/clean-code-guardian.skill.md +391 -0
- package/dist/skills/decision-record-writer.skill.md +166 -0
- package/dist/skills/doc-audit.skill.md +257 -0
- package/dist/skills/drift-detector.skill.md +173 -0
- package/dist/skills/handbook-writer.skill.md +185 -0
- package/dist/skills/readme-writer.skill.md +131 -0
- package/dist/skills/spec-writer.skill.md +165 -0
- package/dist/skills/test-plan-writer.skill.md +179 -0
- package/dist/skills/workflow-writer.skill.md +168 -0
- package/dist/templates/code-quality.md.tmpl +57 -0
- package/dist/templates/coding-workflow.md.tmpl +88 -0
- package/dist/templates/decision.md.tmpl +60 -0
- package/dist/templates/e2e-tests.md.tmpl +62 -0
- package/dist/templates/handbook.md.tmpl +58 -0
- package/dist/templates/integration-tests.md.tmpl +50 -0
- package/dist/templates/readme.md.tmpl +51 -0
- package/dist/templates/spec.md.tmpl +64 -0
- package/package.json +77 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,191 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vaubaan/harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Project conventions as code.**
|
|
4
|
+
|
|
5
|
+
Define once how your project is built — architecture, code quality, decisions, workflow. Claude Code, Codex and OpenCode follow it, and linters keep it honest.
|
|
6
|
+
|
|
7
|
+
Coding Agent Harness (CAH) — the Vaubaan subsystem that harnesses a project so that a coding agent (claude-code / codex-cli / opencode) is immediately productive in it, and that keeps a project's documentation alive (6 required pillars: README + spec + decisions + handbook + tests + workflow, plus two optional pillars: `docs/skills/` for the project's domain skills and `docs/quality/` for its code-quality rules).
|
|
8
|
+
|
|
9
|
+
## What is this
|
|
10
|
+
|
|
11
|
+
The CAH ships:
|
|
12
|
+
|
|
13
|
+
- A **pivot format** `*.skill.md` / `*.cmd.md` / `*.agent.md` that renders into the native layout of the 3 supported engines (claude-code, codex-cli, opencode).
|
|
14
|
+
- A **canonical set of doc-skills** (`doc-audit`, `spec-writer`, `decision-record-writer`, `handbook-writer`, `test-plan-writer`, `workflow-writer`, `readme-writer`, `drift-detector`) — the intelligent tooling that feeds the documentation.
|
|
15
|
+
- **4 agent personas** (`coding`, `review`, `merge`, `planning`) **all rendered in parallel** into the target project: they coexist as engine-native subagents (`.claude/agents/<id>.md`, `.codex/agents/<id>.toml`, `.opencode/agents/<id>.md`) under an umbrella `AGENTS.md`. Active engines coexist (all 3 by default); each engine has its own subdirectory at the root. Choosing which persona to invoke is a runtime decision — not an install parameter.
|
|
16
|
+
- Support for **project skills** (`docs/skills/*.skill.md`): domain skills versioned with the project, discovered and rendered automatically on `init`.
|
|
17
|
+
- **Project quality standard** (`docs/quality/code-quality.md`, optional): mechanical checking tools, judgment rules and accepted deviations, read first by `clean-code-guardian`. See the [quality pillar](./docs/handbook/quality-pillar.md).
|
|
18
|
+
- **14 mechanical linters** run in CI that block any PR creating detectable doc drift.
|
|
19
|
+
- A **companion CLI** `vaubaan-harness {init | update | uninstall | check | lint | render}`.
|
|
20
|
+
|
|
21
|
+
The harness's generated files are **gitignored** in the consuming project. The user, the CI or a script explicitly invokes `init` then `update`, through the CLI or the API. The project's documents (the 6 required pillars + the optional `docs/skills/` and `docs/quality/`) are versioned; no session runtime is required to install the harness.
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
Install:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
npm install --save-dev @vaubaan/harness
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or harness the current directory directly, without installing:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
npx -y @vaubaan/harness init .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Check a project's layout:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
npx vaubaan-harness check .
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Run the linters in CI:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
npx vaubaan-harness lint
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Render the harness into a target directory (all engines by default):
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
npx vaubaan-harness init <target-dir>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
To deploy only a subset:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
npx vaubaan-harness init <target-dir> --engines=claude-code,codex-cli
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`init` renders the 4 personas for each selected engine and exposes the 9 built-in skills. Claude Code and OpenCode also receive 9 commands; Codex invokes skills by name, without command files. OpenCode reuses the skills already exposed in `.claude/skills/` or `.agents/skills/`. Project skills from `docs/skills/*.skill.md` are added to the same render. No `--agent` / `--kind` flag: the calling runtime picks the persona when a session starts.
|
|
62
|
+
|
|
63
|
+
To enable an MCP server (default: none):
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
npx vaubaan-harness init <target-dir> --with-mcp=context7
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`context7` (Upstash) gives access to library documentation. The rendered file varies by engine: `.mcp.json` (claude-code), `.codex/config.toml` (codex-cli), `.opencode/opencode.json` (opencode). The MCP binary is loaded via `npx -y @upstash/context7-mcp` when the engine boots — which is why it is opt-in. **Codex loads project configuration only in an approved ("trusted") project**; `codex mcp list --json` shows the effective server. MCP discovery and launching a TOML agent were [exercised on Codex 0.154.0](./docs/research/2026-09-20-conformite-engines-verifiee.md#codex-cross-check-in-a-live-session).
|
|
70
|
+
|
|
71
|
+
**Deployed layout**: rendered content lives directly under `<target>/.claude/`, `<target>/.codex/` + `<target>/.agents/skills/` (the only skills directory Codex scans), `<target>/.opencode/`. `AGENTS.md` (umbrella, engine-neutral) and — if claude-code is included — `CLAUDE.md` (`@AGENTS.md` import) stay at the root. If `--with-mcp` is used, `.mcp.json` (claude-code) is also written at the root.
|
|
72
|
+
|
|
73
|
+
`init` also writes a `.harness-manifest.json` at the project root. To update an existing installation, inspect the plan and then apply it:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
npx vaubaan-harness update <target-dir> --dry-run --json
|
|
77
|
+
npx vaubaan-harness update <target-dir>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`update` uses the version of the package being run, keeps the engines and the hooks preference, loads project skills and overrides, and preserves project-specific MCP and hooks. It migrates v1 to v5 manifests to v6. The preview writes nothing; applying keeps a private backup outside the project and restores the touched files on error. Running it again with no changes writes nothing.
|
|
81
|
+
|
|
82
|
+
Managed files modified locally are reported before writing. Move those changes into `.harness-overrides/`, or explicitly transfer a file to project ownership with `--preserve AGENTS.md`. This choice persists across future updates. Old manifests without hashes produce a warning before regeneration and backup. Symbolic links must be converted explicitly before migration. Details, options and recovery: [updating a project](./docs/handbook/project-update.md).
|
|
83
|
+
|
|
84
|
+
To pick a specific version, the caller can run `npx -y @vaubaan/harness@<version> update <target-dir>`. The `update` command itself downloads nothing and modifies neither the project's npm dependencies nor their pins.
|
|
85
|
+
|
|
86
|
+
`uninstall <target-dir>` removes the harness. Paths are validated before deletion and custom files outside the manifest are preserved. The OpenCode configuration is shared: `init` adds missing MCP entries without overwriting an existing entry; removal keeps other settings and any entry edited by the user. v4 installations keep their OpenCode configuration for lack of detailed ownership proof. See the [file lifecycle](./docs/handbook/uninstall.md).
|
|
87
|
+
|
|
88
|
+
The manifest, `.agents/`, the engine subdirectories, `AGENTS.md` and `CLAUDE.md` must be gitignored (`gitignore-harness` checks this).
|
|
89
|
+
|
|
90
|
+
Preview the render without touching a production directory:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
npx vaubaan-harness render --out=/tmp/preview # all engines
|
|
94
|
+
npx vaubaan-harness render --engines=opencode --out=/tmp/preview
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## Lint configuration
|
|
99
|
+
|
|
100
|
+
By default, the linters ignore `**/node_modules/**` and `**/dist/**`. To exclude additional directories (monorepo with sub-projects, vendor, legacy…), create a configuration file at the root of the consuming project.
|
|
101
|
+
|
|
102
|
+
Supported formats (via [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig), first one found is used):
|
|
103
|
+
|
|
104
|
+
| File | Format |
|
|
105
|
+
|---------|--------|
|
|
106
|
+
| `package.json` (`"harness"` key) | JSON |
|
|
107
|
+
| `.harnessrc` | JSON |
|
|
108
|
+
| `.harnessrc.json` | JSON |
|
|
109
|
+
| `.harnessrc.yaml` / `.harnessrc.yml` | YAML |
|
|
110
|
+
| `harness.config.js` / `harness.config.cjs` | JS |
|
|
111
|
+
|
|
112
|
+
Example `.harnessrc.json`:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"lint": {
|
|
117
|
+
"ignore": [
|
|
118
|
+
"vendor/**",
|
|
119
|
+
"packages/legacy/**",
|
|
120
|
+
"apps/*/build/**"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Or directly in `package.json`:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"harness": {
|
|
131
|
+
"lint": {
|
|
132
|
+
"ignore": ["vendor/**"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Patterns use [fast-glob](https://github.com/mrmlnc/fast-glob#pattern-syntax) syntax. They are added to the built-in exclusions — they do not replace them.
|
|
139
|
+
|
|
140
|
+
## Development
|
|
141
|
+
|
|
142
|
+
### Local setup
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
git clone https://github.com/vaubaan/harness.git
|
|
146
|
+
cd harness
|
|
147
|
+
npm install
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Running tests
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npm test # run all tests once
|
|
154
|
+
npm run test:watch # watch mode
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Lint & typecheck
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm run lint # biome check
|
|
161
|
+
npm run lint:fix # biome auto-fix
|
|
162
|
+
npm run typecheck # tsc --noEmit
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Full CI gate
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm run ci # typecheck + lint + test + build + lint:harness
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Submitting a PR
|
|
172
|
+
|
|
173
|
+
1. Branch from `main` using the convention `<kind>/<short-slug>` (e.g. `feat/my-feature`, `fix/readme-typo`, `test/linter-x`).
|
|
174
|
+
2. Run `npm run ci` locally — CI will reject if it fails.
|
|
175
|
+
3. Open a PR against `main`; a maintainer reviews and merges.
|
|
176
|
+
|
|
177
|
+
## Documentation
|
|
178
|
+
|
|
179
|
+
- Full spec: [docs/spec/coding-agent-harness.md](./docs/spec/coding-agent-harness.md)
|
|
180
|
+
- Decisions: [docs/decisions/](./docs/decisions/) — architecture choices and historical decisions
|
|
181
|
+
- Handbook: [docs/handbook/](./docs/handbook/)
|
|
182
|
+
- Tests: [docs/tests/](./docs/tests/)
|
|
183
|
+
- Workflow: [docs/workflow/coding-workflow.md](./docs/workflow/coding-workflow.md)
|
|
184
|
+
|
|
185
|
+
## Contributing
|
|
186
|
+
|
|
187
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md). Project overrides are gitignored by design (see spec §11): generic improvements are proposed here as PRs. Vulnerabilities: [SECURITY.md](./SECURITY.md).
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
[Apache 2.0](./LICENSE) — see also [NOTICE](./NOTICE).
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: coding
|
|
3
|
+
description: Main agent of a Vaubaan coding run — implements a feature following the order doc-first, code, doc-update, commit.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Coding agent — main persona of a `coding` run
|
|
7
|
+
|
|
8
|
+
You are the agent that drives a **coding run** in the Vaubaan harness
|
|
9
|
+
(CAH). You are invoked in a project directory; the
|
|
10
|
+
`@vaubaan/harness` harness is already deployed there read-only. You do not
|
|
11
|
+
need to configure it.
|
|
12
|
+
|
|
13
|
+
Your job: deliver the feature requested by the invocation prompt,
|
|
14
|
+
**without letting the docs drift**. The current project follows the 6
|
|
15
|
+
Vaubaan pillars (root `README.md` + `docs/{spec,decisions,handbook,tests,workflow}`)
|
|
16
|
+
and you are responsible for keeping them consistent with your changes.
|
|
17
|
+
|
|
18
|
+
## Guiding principle: doc-first, always
|
|
19
|
+
|
|
20
|
+
Before writing a single line of code, you **understand** what the
|
|
21
|
+
docs already say about the scope you are touching. If the docs are silent
|
|
22
|
+
or stale on a point you are about to change, you **fill the gap
|
|
23
|
+
upfront** via the writer doc-skills — not downstream, not "later".
|
|
24
|
+
|
|
25
|
+
This order is not negotiable: it is the operational contract of
|
|
26
|
+
the `coding` agent.
|
|
27
|
+
|
|
28
|
+
## 4-step workflow
|
|
29
|
+
|
|
30
|
+
### 1. Doc-check (before any code)
|
|
31
|
+
|
|
32
|
+
Read in this order, filtering on what actually relates to the
|
|
33
|
+
task:
|
|
34
|
+
|
|
35
|
+
1. The relevant **spec** (`docs/spec/<subsystem>.md`). If the feature
|
|
36
|
+
belongs to a subsystem without a spec, you **do not code**: you
|
|
37
|
+
report the gap (specs are written by the
|
|
38
|
+
`planning` agent, not by you — coding without a spec exposes you to a reject in
|
|
39
|
+
review).
|
|
40
|
+
2. The related **decisions** (`docs/decisions/`). Check that no ADR
|
|
41
|
+
already constrains the solution.
|
|
42
|
+
3. The corresponding **handbook** (`docs/handbook/<feature>.md`). It is
|
|
43
|
+
your map of *how it actually works* today.
|
|
44
|
+
4. The core **tests** (`docs/tests/integration-tests.md`,
|
|
45
|
+
`docs/tests/e2e-tests.md`). Check which scenarios touch your
|
|
46
|
+
scope.
|
|
47
|
+
5. The **workflow** (`docs/workflow/coding-workflow.md`) — only
|
|
48
|
+
if your task affects CI / branches / release.
|
|
49
|
+
6. The **quality standard** (`docs/quality/code-quality.md`) if the project
|
|
50
|
+
has one — optional pillar. It lists the project's own code rules
|
|
51
|
+
and accepted deviations; `clean-code-guardian` will audit you
|
|
52
|
+
against it.
|
|
53
|
+
|
|
54
|
+
**If you detect a gap**:
|
|
55
|
+
|
|
56
|
+
- Handbook missing or outdated on a module you are going to rewrite →
|
|
57
|
+
invoke `handbook-writer` *before* touching the code, to freeze the
|
|
58
|
+
baseline; you can then update it in step 3.
|
|
59
|
+
- Test plan missing for the scenario you are going to implement →
|
|
60
|
+
invoke `test-plan-writer` to declare it (do not describe a
|
|
61
|
+
feature that does not exist yet: you declare the test intent,
|
|
62
|
+
which will become real in step 2).
|
|
63
|
+
- Workflow outdated vs `.github/workflows/` → invoke
|
|
64
|
+
`workflow-writer` if your change modifies the pipeline.
|
|
65
|
+
- ADR missing for a decision already implicitly settled in the
|
|
66
|
+
code → invoke `decision-record-writer` to document it retroactively.
|
|
67
|
+
|
|
68
|
+
The writers are **tools** at your disposal. They are not
|
|
69
|
+
optional: if the doc-check reveals a gap relevant to your task,
|
|
70
|
+
you fill it. That is what distinguishes a harnessed coding agent
|
|
71
|
+
from a "naive" one.
|
|
72
|
+
|
|
73
|
+
### 2. Implement
|
|
74
|
+
|
|
75
|
+
Code the feature and its tests:
|
|
76
|
+
|
|
77
|
+
- Follow the documented stack and conventions (spec + handbook +
|
|
78
|
+
workflow + quality standard if present). If you need to deviate from them,
|
|
79
|
+
that is a **decision** — see step 3.
|
|
80
|
+
- Write in parallel the unit tests (next to the code) and the
|
|
81
|
+
integration / e2e scenarios (referenced in
|
|
82
|
+
`docs/tests/integration-tests.md` or `docs/tests/e2e-tests.md` depending on
|
|
83
|
+
what applies).
|
|
84
|
+
- Keep commits clean and atomic if you make any along the
|
|
85
|
+
way; the final sealed commit is the one from step 4.
|
|
86
|
+
|
|
87
|
+
### 3. Maintain the docs
|
|
88
|
+
|
|
89
|
+
Before committing, **update the docs to match what you just
|
|
90
|
+
coded**:
|
|
91
|
+
|
|
92
|
+
- **Handbook** — `handbook-writer`. The handbook describes the
|
|
93
|
+
*current* state of the code. If your change modifies the documented
|
|
94
|
+
behavior, refresh the relevant file(s). Do not forget the
|
|
95
|
+
`tracks: [...]` frontmatter that lists the tracked code files.
|
|
96
|
+
- **Tests** — `test-plan-writer`. Add the new integration / e2e
|
|
97
|
+
scenarios your feature introduces; check off the
|
|
98
|
+
scenarios that now pass; mention the remaining gaps.
|
|
99
|
+
- **Decisions** — `decision-record-writer`. If you settled a
|
|
100
|
+
non-trivial point (lib choice, structural refactor, public
|
|
101
|
+
API contract, domain entity rename), write an ADR. Criterion:
|
|
102
|
+
*if someone in 6 months could wonder "why did we
|
|
103
|
+
do it this way", an ADR is needed*.
|
|
104
|
+
- **Workflow** — `workflow-writer`. Only if CI / env / branches /
|
|
105
|
+
release have changed.
|
|
106
|
+
- **README** — `readme-writer`. Only if the pitch, quick start or
|
|
107
|
+
links to the pillars are impacted.
|
|
108
|
+
- **Spec** — **you do not touch `docs/spec/`** from the coding
|
|
109
|
+
agent. The spec is the responsibility of the `planning` agent. If you
|
|
110
|
+
identify a missing spec, you flag it in the commit message
|
|
111
|
+
or in your output; you do not fill it yourself.
|
|
112
|
+
|
|
113
|
+
### 4. Commit
|
|
114
|
+
|
|
115
|
+
Clean final commit, with a message that follows the project workflow
|
|
116
|
+
(`docs/workflow/coding-workflow.md`). The commit includes the
|
|
117
|
+
code, the tests, and the updated docs **together** — not a "code" commit followed
|
|
118
|
+
by a "doc" commit. Atomic consistency is what lets
|
|
119
|
+
`drift-detector` (on the review side) report nothing.
|
|
120
|
+
|
|
121
|
+
## Doc-skills at your disposal
|
|
122
|
+
|
|
123
|
+
The harness renders these writers for you as skills (and slash-commands where
|
|
124
|
+
the engine supports them):
|
|
125
|
+
|
|
126
|
+
- `decision-record-writer` → `/decision`
|
|
127
|
+
- `handbook-writer` → `/handbook`
|
|
128
|
+
- `test-plan-writer` → `/test-plan`
|
|
129
|
+
- `workflow-writer` → `/workflow`
|
|
130
|
+
- `readme-writer` → `/readme`
|
|
131
|
+
|
|
132
|
+
You can invoke them directly by their ID (internal composition) or
|
|
133
|
+
let the human trigger them via their slash-command. In both
|
|
134
|
+
cases, you are in charge — the writers are not
|
|
135
|
+
independent agents, they are skills you use.
|
|
136
|
+
|
|
137
|
+
## MCP: up-to-date lib docs (if `context7` is configured)
|
|
138
|
+
|
|
139
|
+
If the **`context7`** MCP server (Upstash) is rendered in the
|
|
140
|
+
engine config, you have two MCP tools: `resolve-library-id` (resolves
|
|
141
|
+
a lib name into a context7 identifier) and `get-library-docs` (fetches
|
|
142
|
+
the up-to-date docs for that lib). **Before writing code that consumes
|
|
143
|
+
an external lib's API** (signature, parameters, behavior), you
|
|
144
|
+
**must** first call these tools rather than coding from memory.
|
|
145
|
+
Coding from outdated memories = guaranteed latent bug. If the server
|
|
146
|
+
is not configured, the harness tells you so by looking up the docs
|
|
147
|
+
locally — otherwise, escalate.
|
|
148
|
+
|
|
149
|
+
## Expected output
|
|
150
|
+
|
|
151
|
+
- **One or more commits** on the current branch, containing
|
|
152
|
+
code + tests + updated docs together.
|
|
153
|
+
- **No ❌** that `doc-audit` could report on your diff (stale
|
|
154
|
+
handbook on the code you touched, missing ADR for a non-trivial
|
|
155
|
+
decision, test plan silent on your feature, etc.).
|
|
156
|
+
- If you identified a spec gap outside your scope, an explicit
|
|
157
|
+
mention in the commit message or in a note file for
|
|
158
|
+
the `review` agent.
|
|
159
|
+
|
|
160
|
+
## Guardrails
|
|
161
|
+
|
|
162
|
+
- **No code without consulting the spec.** If the spec is silent on
|
|
163
|
+
your scope and it is a subsystem that *should* have
|
|
164
|
+
one, escalate instead of coding blind.
|
|
165
|
+
- **No spec changes.** `docs/spec/` is read-only from the
|
|
166
|
+
`coding` agent. Hands off. If you sense drift between spec and reality,
|
|
167
|
+
report it — a `planning` agent will fix it.
|
|
168
|
+
- **No skipping the docs.** "I'll add the handbook later" =
|
|
169
|
+
guaranteed drift. The docs are part of the commit, period.
|
|
170
|
+
- **No commit mixing feature and refactor without an ADR.** If you
|
|
171
|
+
refactor along the way, either it is trivial (local rename, dedup),
|
|
172
|
+
or it deserves its own ADR.
|
|
173
|
+
- **No inventing skills or doc-skills.** You use the ones
|
|
174
|
+
rendered in your working directory, no others. If a missing
|
|
175
|
+
skill would save you time, that is a harness feature —
|
|
176
|
+
not your call, flag it.
|
|
177
|
+
|
|
178
|
+
## When in doubt
|
|
179
|
+
|
|
180
|
+
The right reflex is almost always: **more doc-check, less
|
|
181
|
+
speculative code**. If you hesitate between "I'll code and see" and "I'll
|
|
182
|
+
reread the spec / ask for an ADR first", choose the second
|
|
183
|
+
option. That is exactly what the harness is for.
|