@alessandroraffa/tangyr 0.21.6 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +51 -0
  2. package/dist/index.js +2712 -1690
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -324,6 +324,45 @@ declared via `.option()`. Commander delivers the positional argument's
324
324
  value as the `.action()` callback's first parameter, ahead of any options
325
325
  object — the reverse of every option-only command's callback signature.
326
326
 
327
+ ## The kit's instructions file
328
+
329
+ One resolution, used by `install`, `sync`, every adapter and `verify` alike:
330
+
331
+ 1. `source.instructions` in `tangyr.config.yaml`, when set to something other than the `./AGENTS.md` default. An explicit declaration naming a file the kit does not carry is an error, reported before anything is written.
332
+ 2. `entrypoint` in `tangyr-kit.yaml`.
333
+ 3. `ORIENTATION.md`, then `AGENTS.md`, then the legacy `CLAUDE.md` (which installs, with a notice naming the rename).
334
+
335
+ A kit whose entrypoint is `ORIENTATION.md` therefore needs no `source.instructions`, and `verify` recognises it.
336
+
337
+ ## Configuration file
338
+
339
+ `tangyr.config.yaml` declares `schema: 1`. A key this schema does not define is rejected, naming the key it was probably meant to be — an unrecognized key is never read, so whatever it was meant to set stays at its default, and `target:` for `targets:` silently reduced an install to one tool. Prefix a key with `x-` to keep it as an annotation.
340
+
341
+ In `tangyr-kit.yaml`, `discipline` is optional: declare it to opt into the corpus-version check, omit it for a kit that is not derived from the shared corpus.
342
+
343
+ ## Conflict policy
344
+
345
+ Before writing, each destination is classified and resolved according to `onConflict` in `tangyr.config.yaml`: `ask` (default; prompts, and resolves to backup-and-replace in a non-interactive run), `skip`, `backup`, or `overwrite`.
346
+
347
+ `--yes` supplies the confirmation a non-interactive run needs; it does **not** override the posture. Under `--yes`, `skip` leaves conflicting destinations unchanged and says which, `overwrite` replaces without a backup, and `backup` copies the existing file — or the existing directory, recursively — into `.tangyr/backups/<timestamp>/` and records it in the manifest so `uninstall` can put it back. A symlink is replaced without a backup: what it points at is untouched.
348
+
349
+ One decision is taken per destination, not per target, so a file several targets write — `AGENTS.md` is claimed by four — is backed up once.
350
+
351
+ ## Accepted loss
352
+
353
+ Some losses are structural: OpenCode expresses hooks only as plugin code, Cline has no committable persona file. A kit with hooks installed for OpenCode therefore exits `3` on every run, however correct the kit is.
354
+
355
+ `acceptedLoss` names those, so that a genuinely new error entry is still loud:
356
+
357
+ ```yaml
358
+ acceptedLoss:
359
+ - opencode/hook-as-plugin # <target>/<entry-type>
360
+ - cline/* # every error entry for one target
361
+ - persona-not-representable # this entry type on any target
362
+ ```
363
+
364
+ `--ignore-errors` remains the blunt instrument: it suppresses the exit code for every error entry, including ones nobody has looked at yet.
365
+
327
366
  ## Exit codes
328
367
 
329
368
  The full exit-code taxonomy, in numeric order. Every code below `5`
@@ -353,6 +392,7 @@ reaches them).
353
392
  | ---------------------------- | ----------------------------------------------------------------------------------------------------- |
354
393
  | `--config <path>` | Use an explicit configuration file |
355
394
  | `--kit-path <path>` | Use an explicit operating kit root |
395
+ | `--project-root <path>` | Directory a project-scope operation writes into (see [Scope](#scope)) |
356
396
  | `--dry-run` | Report actions without modifying files |
357
397
  | `--yes` | Skip confirmation prompts |
358
398
  | `--non-interactive` | Never prompt; fail closed when a required input is missing (`auth login`) |
@@ -394,6 +434,17 @@ Every write command accepts `--scope global` or `--scope project`. The CLI flag
394
434
  | `global` | `~/.tangyr/manifest.json` | `~/.claude/` |
395
435
  | `project` | `.tangyr/manifest.json` | repo root (`AGENTS.md`, `.claude/`) |
396
436
 
437
+ ### Which directory is the project
438
+
439
+ A project-scope operation resolves its root in this order:
440
+
441
+ 1. `--project-root <path>`, when given.
442
+ 2. The directory of the `tangyr.config.yaml` this run **discovered** — one found in the working directory or an ancestor. That file sits at the project root by construction, and `kitPath` is already resolved against it.
443
+ 3. The working directory, when the config was named explicitly with `-c`. An explicit path may name a shared or CI config outside the tree and says nothing about where the project is.
444
+ 4. The nearest enclosing directory carrying `tangyr.config.yaml` or `.tangyr/`, for the commands that run without a config at all; failing that, the working directory.
445
+
446
+ Running from a subdirectory therefore installs at the project root rather than in the subdirectory. Deliberately only Tangyr's own markers are searched in step 4: a `package.json` or `.git` above the working directory says where some project starts, not that this installation belongs there.
447
+
397
448
  ## Multiple Claude Code global roots
398
449
 
399
450
  If you maintain more than one Claude Code account (e.g. `~/.claude` and `~/.claude-work`), you can keep them identical with a single sync operation.