djournal 0.12.0 → 0.12.1
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/docs/installation.md +28 -0
- package/lib/installer/index.js +12 -5
- package/package.json +1 -1
package/docs/installation.md
CHANGED
|
@@ -267,6 +267,34 @@ Install only the portable instructions and journal skills:
|
|
|
267
267
|
djournal install --instructions-only
|
|
268
268
|
```
|
|
269
269
|
|
|
270
|
+
### Claude skills and separate accounts
|
|
271
|
+
|
|
272
|
+
The Claude Code integration installs project skills under `.claude/skills/`,
|
|
273
|
+
using the canonical definitions and supporting files from `.agents/skills/`.
|
|
274
|
+
Claude discovers these project skills regardless of which account you use or
|
|
275
|
+
whether your launcher sets `CLAUDE_CONFIG_DIR` to another personal configuration
|
|
276
|
+
directory. No copying into each account's home directory is required.
|
|
277
|
+
See [Claude Code's skill locations](https://code.claude.com/docs/en/skills#choose-where-skills-load).
|
|
278
|
+
|
|
279
|
+
Run `djournal install --harness claude-code` to add the integration, or
|
|
280
|
+
`djournal upgrade` to add project skills to an existing Claude installation.
|
|
281
|
+
Restart Claude in the project directory after installation. Removing only the
|
|
282
|
+
Claude integration removes its unchanged installed skills while retaining
|
|
283
|
+
`.agents/skills/`. Existing or locally modified skill files are preserved;
|
|
284
|
+
different content at an installation destination produces an `ASSET_CONFLICT`.
|
|
285
|
+
|
|
286
|
+
### Missing instruction blocks
|
|
287
|
+
|
|
288
|
+
Reinstall and upgrade restore a completely missing djournal block in `AGENTS.md`
|
|
289
|
+
or `CLAUDE.md`, including when the file was deleted or restored from Git.
|
|
290
|
+
All existing unmarked text is preserved. If only the markers were removed,
|
|
291
|
+
the old unmarked instructions remain alongside the newly inserted block;
|
|
292
|
+
review that text manually before removing any duplication.
|
|
293
|
+
|
|
294
|
+
Incomplete, reversed, or duplicate block markers still produce an
|
|
295
|
+
`ASSET_CONFLICT`. Repair those boundaries before retrying; the installer will
|
|
296
|
+
not guess which surrounding instructions it owns.
|
|
297
|
+
|
|
270
298
|
## Useful checks
|
|
271
299
|
|
|
272
300
|
```bash
|
package/lib/installer/index.js
CHANGED
|
@@ -410,12 +410,12 @@ function markdownRecord(target, relative, body, oldRecord, harness) {
|
|
|
410
410
|
const original = readOptional(absolute);
|
|
411
411
|
const current = original?.toString("utf8") || "";
|
|
412
412
|
if (oldRecord) {
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
// A wholly missing block can be reinserted without claiming any current
|
|
414
|
+
// text. Partial or duplicate boundaries still require manual repair.
|
|
415
|
+
try { hasManagedBlock(current); }
|
|
415
416
|
catch (error) {
|
|
416
417
|
throw new InstallerError(`managed block is invalid: ${relative}: ${error.message}`, "ASSET_CONFLICT");
|
|
417
418
|
}
|
|
418
|
-
if (!present) throw new InstallerError(`managed block is missing: ${relative}`, "ASSET_CONFLICT");
|
|
419
419
|
}
|
|
420
420
|
const next = Buffer.from(upsertManagedBlock(current, body));
|
|
421
421
|
return {
|
|
@@ -474,8 +474,8 @@ function jsonRecord(target, relative, fragment, oldRecord, harness) {
|
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
function copyRecord(sourceRoot, target, relative, oldRecord, harness) {
|
|
478
|
-
const source = fs.readFileSync(path.join(sourceRoot,
|
|
477
|
+
function copyRecord(sourceRoot, target, relative, oldRecord, harness, sourceRelative = relative) {
|
|
478
|
+
const source = fs.readFileSync(path.join(sourceRoot, sourceRelative));
|
|
479
479
|
const absolute = resolveWithin(target, relative);
|
|
480
480
|
const current = readOptional(absolute);
|
|
481
481
|
if (oldRecord) {
|
|
@@ -530,6 +530,13 @@ function planInstall(sourceRoot, target, harnesses, oldManifest, store) {
|
|
|
530
530
|
records.push(result.record); operations.push(result.op);
|
|
531
531
|
}
|
|
532
532
|
if (harnesses.includes("claude-code")) {
|
|
533
|
+
// Claude discovers project skills here, independently of the account's
|
|
534
|
+
// personal configuration. Keep the portable .agents files authoritative.
|
|
535
|
+
for (const relative of listFiles(path.join(sourceRoot, ".agents/skills"))) {
|
|
536
|
+
const destination = `.claude/skills/${relative}`;
|
|
537
|
+
const skill = copyRecord(sourceRoot, target, destination, old.get(destination), "claude-code", `.agents/skills/${relative}`);
|
|
538
|
+
records.push(skill.record); operations.push(skill.op);
|
|
539
|
+
}
|
|
533
540
|
const bridge = markdownRecord(target, "CLAUDE.md", "@AGENTS.md", old.get("CLAUDE.md"), "claude-code");
|
|
534
541
|
records.push(bridge.record); operations.push(bridge.op);
|
|
535
542
|
const hooks = jsonRecord(
|