@igorlau/dotagents 1.0.18 → 1.0.19
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/dist/build-info.json +1 -1
- package/dist/commands.js +14 -2
- package/dist/targets.js +14 -3
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commit":"
|
|
1
|
+
{"commit":"6f88dc2"}
|
package/dist/commands.js
CHANGED
|
@@ -7,7 +7,7 @@ import { loadCatalog, loadScaffold } from "./catalog.js";
|
|
|
7
7
|
import { repoRoot } from "./git.js";
|
|
8
8
|
import { fromStored, globalManifestPath, hash, projectManifestPath, readManifest, toStored, writeManifest, } from "./manifest.js";
|
|
9
9
|
import { claudeHome, codexHome, configDir, packageRoot } from "./paths.js";
|
|
10
|
-
import { planInstall, planScaffold } from "./targets.js";
|
|
10
|
+
import { planInstall, planScaffold, projectClaudeRulesFile } from "./targets.js";
|
|
11
11
|
export const DEFAULT_SOURCE = "@igorlau/dotagents@latest";
|
|
12
12
|
export const UP_TO_DATE = "Already up to date.";
|
|
13
13
|
export const NOTHING_TO_UNINSTALL = "Nothing to uninstall.";
|
|
@@ -88,6 +88,10 @@ function run(scope, agents, options, uninstall = false) {
|
|
|
88
88
|
report(result, options.dryRun);
|
|
89
89
|
if (options.dryRun)
|
|
90
90
|
return result.problems.length === 0;
|
|
91
|
+
const claudeRulesFile = scope.root === undefined ? undefined : projectClaudeRulesFile(scope.root);
|
|
92
|
+
if (!uninstall && result.changes.some((change) => change.action === "remove" && change.path === claudeRulesFile)) {
|
|
93
|
+
log("Claude Code now reads the rules from AGENTS.md.");
|
|
94
|
+
}
|
|
91
95
|
if (result.entries.length === 0) {
|
|
92
96
|
fs.rmSync(scope.manifestPath, { force: true });
|
|
93
97
|
}
|
|
@@ -196,7 +200,15 @@ export function doctor(cwd) {
|
|
|
196
200
|
for (const scope of scopes) {
|
|
197
201
|
const manifest = readManifest(scope.manifestPath);
|
|
198
202
|
log(`Checking ${describe(scope)} (dotagents ${manifest.version}, agents: ${manifest.agents.join(", ")})`);
|
|
199
|
-
|
|
203
|
+
const entries = fromStored(manifest.entries, scope.root);
|
|
204
|
+
if (version() === manifest.version) {
|
|
205
|
+
const installed = new Set(entries.map((entry) => entry.path));
|
|
206
|
+
for (const op of planInstall(loadCatalog(), scope.mode, manifest.agents, scope.root)) {
|
|
207
|
+
if (!installed.has(op.path))
|
|
208
|
+
issues.push(`${op.path}: not installed. Run \`dotagents update\`.`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
for (const entry of entries) {
|
|
200
212
|
if (!fs.existsSync(entry.path)) {
|
|
201
213
|
issues.push(`${entry.path}: missing. Run \`dotagents update\`.`);
|
|
202
214
|
continue;
|
package/dist/targets.js
CHANGED
|
@@ -22,15 +22,14 @@ function layout(mode, root, pending) {
|
|
|
22
22
|
}
|
|
23
23
|
// Copilot reads AGENTS.md too, so both agents share one block.
|
|
24
24
|
const agentsMd = path.join(root, "AGENTS.md");
|
|
25
|
-
const
|
|
26
|
-
const claudeRulesInAgentsMd = importsAgentsMd(pending.find((op) => op.path === claudeMd)?.content ?? readIfExists(claudeMd));
|
|
25
|
+
const claudeRulesInAgentsMd = claudeReadsAgentsMd(root, pending);
|
|
27
26
|
return {
|
|
28
27
|
skillDirs: {
|
|
29
28
|
claude: path.join(root, ".claude", "skills"),
|
|
30
29
|
codex: path.join(root, ".agents", "skills"),
|
|
31
30
|
copilot: path.join(root, ".agents", "skills"),
|
|
32
31
|
},
|
|
33
|
-
claudeRules: claudeRulesInAgentsMd ? agentsMd :
|
|
32
|
+
claudeRules: claudeRulesInAgentsMd ? agentsMd : projectClaudeRulesFile(root),
|
|
34
33
|
claudeRulesInAgentsMd,
|
|
35
34
|
codexRules: agentsMd,
|
|
36
35
|
copilotRules: agentsMd,
|
|
@@ -68,6 +67,18 @@ export function planInstall(catalog, mode, agents, root = "", pending = []) {
|
|
|
68
67
|
add({ kind: "block", path: target.copilotRules, content: rules });
|
|
69
68
|
return [...ops.values()];
|
|
70
69
|
}
|
|
70
|
+
/** The rules file for Claude Code in a project install, when Claude Code does not read AGENTS.md. */
|
|
71
|
+
export function projectClaudeRulesFile(root) {
|
|
72
|
+
return path.join(root, ".claude", "rules", RULES_FILE);
|
|
73
|
+
}
|
|
74
|
+
// Claude Code reads AGENTS.md when the project has no CLAUDE.md or CLAUDE.local.md: https://code.claude.com/docs/en/memory#agents-md
|
|
75
|
+
function claudeReadsAgentsMd(root, pending) {
|
|
76
|
+
const claudeMdPath = path.join(root, "CLAUDE.md");
|
|
77
|
+
const claudeMd = pending.find((op) => op.path === claudeMdPath)?.content ?? readIfExists(claudeMdPath);
|
|
78
|
+
if (claudeMd !== undefined)
|
|
79
|
+
return importsAgentsMd(claudeMd);
|
|
80
|
+
return !["CLAUDE.local.md", path.join(".claude", "CLAUDE.md")].some((rel) => fs.existsSync(path.join(root, rel)));
|
|
81
|
+
}
|
|
71
82
|
/** Reports whether the repository at `root` has a CLAUDE.md that does not import AGENTS.md. */
|
|
72
83
|
export function claudeMdSkipsAgentsMd(root) {
|
|
73
84
|
const claudeMd = readIfExists(path.join(root, "CLAUDE.md"));
|