Commit 5d8e3c6
fix(workspace): preserve existing CLAUDE.md and AGENTS.md on init (#63)
* fix(workspace): preserve existing CLAUDE.md and AGENTS.md on init
When running `workspace init`, skip copying agent files from the
template source if they already exist in the target directory. Existing
files still receive WORKSPACE-RULES injection (append) without losing
user content.
Closes #62
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(test): run non-workspace e2e tests from temp cwd
Tests asserting "non-workspace dir" behavior were inheriting the test
runner's cwd which may contain .allagents/workspace.yaml, causing the
"No plugins configured" path to be skipped. Set cwd to the temp
directory so tests are isolated from the project's own workspace config.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test(e2e): verify workspace init preserves existing CLAUDE.md and AGENTS.md
Runs the built CLI binary with `workspace init --from` against a
directory that already has CLAUDE.md/AGENTS.md and asserts the
original content is preserved while WORKSPACE-RULES are appended.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* revert: remove redundant e2e test for workspace init
The unit test in workspace-init-preserve.test.ts already calls
initWorkspace() directly and covers the same code path without
requiring a pre-built binary.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore(test): remove e2e tests that require pre-built binary
These tests spawned `node dist/index.js` and required a build step
before running. They were also brittle (cwd leaked project state into
"non-workspace" assertions). Remove them; the enriched-help and
metadata tests in tests/unit/ and tests/e2e/cli-enriched-help.test.ts
cover the same logic by importing source directly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test(unit): add unit tests for agent-help and json-output modules
Replace removed e2e binary-spawning tests with unit tests that import
source directly:
- agent-help: flag extraction, command metadata completeness, options/positionals
- json-output: flag extraction and position flexibility
The --help output tests are not replaced since they tested cmd-ts
framework behavior, not our code. cli-enriched-help.test.ts already
covers our metadata structure.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 0e7c62b commit 5d8e3c6
7 files changed
Lines changed: 238 additions & 568 deletions
File tree
- src/core
- tests
- e2e
- unit
- cli
- core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
185 | 191 | | |
186 | 192 | | |
187 | 193 | | |
| |||
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
193 | | - | |
| 199 | + | |
194 | 200 | | |
195 | 201 | | |
196 | 202 | | |
| |||
199 | 205 | | |
200 | 206 | | |
201 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
202 | 214 | | |
203 | 215 | | |
204 | 216 | | |
205 | | - | |
| 217 | + | |
206 | 218 | | |
207 | 219 | | |
208 | 220 | | |
| |||
This file was deleted.
0 commit comments