@igorlau/dotagents 1.0.20 → 1.0.21
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/README.md +1 -1
- package/dist/build-info.json +1 -1
- package/dist/commands.js +45 -10
- package/package.json +1 -1
- package/plugin/rules/ponytail.md +1 -1
- package/plugin/rules/ponytail.upstream.json +1 -1
- package/plugin/rules/writing.md +5 -1
- package/plugin/skills/dot-code-review/references/maintainability.md +1 -0
- package/plugin/skills/dot-implement/references/typescript.md +2 -1
package/README.md
CHANGED
|
@@ -150,7 +150,7 @@ The following table gives a summary of the commands. For the options, run
|
|
|
150
150
|
| `uninstall` | Remove everything that dotagents installed. |
|
|
151
151
|
| `doctor` | Find missing or changed files in the installs. |
|
|
152
152
|
| `list` | List the skills. |
|
|
153
|
-
| `self-update` | Run `update` with the latest release. |
|
|
153
|
+
| `self-update` | Run `update` with the latest release. A CLI installed with `npm install -g` updates itself first. |
|
|
154
154
|
| `check enable`, `check disable` | Start or stop the plugin `check` hook in the current repository. |
|
|
155
155
|
|
|
156
156
|
dotagents does not overwrite a file that you changed or that it did not
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commit":"
|
|
1
|
+
{"commit":"c4705cf"}
|
package/dist/commands.js
CHANGED
|
@@ -22,6 +22,13 @@ export function version() {
|
|
|
22
22
|
const { commit } = JSON.parse(fs.readFileSync(buildInfo, "utf8"));
|
|
23
23
|
return commit ? `${base}+${commit}` : base;
|
|
24
24
|
}
|
|
25
|
+
const RELEASE = /^\d+\.\d+\.\d+$/;
|
|
26
|
+
/** Reports whether release `cli` is older than release `installed`. A build from a branch is never older. */
|
|
27
|
+
export function isOlderRelease(cli, installed) {
|
|
28
|
+
if (!RELEASE.test(cli) || !RELEASE.test(installed))
|
|
29
|
+
return false;
|
|
30
|
+
return cli.localeCompare(installed, "en", { numeric: true }) < 0;
|
|
31
|
+
}
|
|
25
32
|
function log(message = "") {
|
|
26
33
|
console.log(message);
|
|
27
34
|
}
|
|
@@ -168,6 +175,11 @@ export function update(cwd, which, options) {
|
|
|
168
175
|
let ok = true;
|
|
169
176
|
for (const scope of scopes) {
|
|
170
177
|
const manifest = readManifest(scope.manifestPath);
|
|
178
|
+
if (isOlderRelease(version(), manifest.version) && !options.force) {
|
|
179
|
+
log(`Skipping ${describe(scope)}: it has dotagents ${manifest.version}, and this CLI is older (${version()}). Run \`dotagents self-update\`, or pass --force to downgrade.`);
|
|
180
|
+
ok = false;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
171
183
|
log(`Updating ${describe(scope)} to dotagents ${version()}:`);
|
|
172
184
|
ok = run(scope, manifest.agents, { ...options, agents: manifest.agents }) && ok;
|
|
173
185
|
if (scope.mode === "global")
|
|
@@ -226,8 +238,12 @@ export function doctor(cwd) {
|
|
|
226
238
|
if (scope.mode === "global" && manifest.agents.includes("claude")) {
|
|
227
239
|
issues.push(...(dotagentsPluginInstalled() ? duplicateClaudeSkills() : [PLUGIN_HINT]));
|
|
228
240
|
}
|
|
229
|
-
if (version()
|
|
241
|
+
if (isOlderRelease(version(), manifest.version)) {
|
|
242
|
+
log(` This CLI (${version()}) is older than the install (${manifest.version}). Run \`dotagents self-update\`.`);
|
|
243
|
+
}
|
|
244
|
+
else if (version() !== manifest.version) {
|
|
230
245
|
log(` Installed version ${manifest.version} differs from this CLI (${version()}). Run \`dotagents update\`.`);
|
|
246
|
+
}
|
|
231
247
|
}
|
|
232
248
|
const checkRepos = readConfig().checkRepos ?? [];
|
|
233
249
|
log(checkRepos.length > 0 ? ` The check hook runs in: ${checkRepos.join(", ")}` : " The check hook runs in no repository. Run `dotagents check enable` in one.");
|
|
@@ -307,20 +323,39 @@ export function setCheckHook(cwd, enabled, dryRun) {
|
|
|
307
323
|
}
|
|
308
324
|
export function selfUpdate(args) {
|
|
309
325
|
const source = readSource();
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
326
|
+
if (!isInside(packageRoot, npmGlobalRoot())) {
|
|
327
|
+
log(`Running the latest dotagents from ${source}:`);
|
|
328
|
+
return runInherited(packageManagerCommand("npx", ["--yes", "--prefer-online", source, "update", ...args]));
|
|
329
|
+
}
|
|
330
|
+
log(`Installing the latest dotagents from ${source} with npm:`);
|
|
331
|
+
if (!runInherited(packageManagerCommand("npm", ["install", "--global", "--prefer-online", source])))
|
|
332
|
+
return false;
|
|
333
|
+
return runInherited({ args: [path.join(packageRoot, "dist", "cli.js"), "update", ...args], command: process.execPath, shell: false });
|
|
334
|
+
}
|
|
335
|
+
function runInherited({ args, command, shell }) {
|
|
336
|
+
return spawnSync(command, args, { shell, stdio: "inherit" }).status === 0;
|
|
337
|
+
}
|
|
338
|
+
function npmGlobalRoot() {
|
|
339
|
+
const { args, command, shell } = packageManagerCommand("npm", ["root", "--global"]);
|
|
340
|
+
const result = spawnSync(command, args, { encoding: "utf8", shell });
|
|
341
|
+
return result.status === 0 ? result.stdout.trim() : undefined;
|
|
342
|
+
}
|
|
343
|
+
/** Reports whether `dir` is inside `parent`. */
|
|
344
|
+
export function isInside(dir, parent) {
|
|
345
|
+
if (parent === undefined)
|
|
346
|
+
return false;
|
|
347
|
+
const relative = path.relative(parent, dir);
|
|
348
|
+
return relative !== "" && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
314
349
|
}
|
|
315
350
|
/**
|
|
316
|
-
* Builds the command that starts `npx`. On Windows,
|
|
351
|
+
* Builds the command that starts `npm` or `npx`. On Windows, both are `.cmd` files, which Node starts only through a shell,
|
|
317
352
|
* so the arguments go into one quoted command line. `cmd.exe` still reads `"` and `%` inside quotes, so those throw.
|
|
318
353
|
*/
|
|
319
|
-
export function
|
|
354
|
+
export function packageManagerCommand(name, args, platform = process.platform) {
|
|
320
355
|
if (platform !== "win32")
|
|
321
|
-
return { args, command:
|
|
356
|
+
return { args, command: name, shell: false };
|
|
322
357
|
const unsafe = args.find((arg) => /["%]/.test(arg));
|
|
323
358
|
if (unsafe !== undefined)
|
|
324
|
-
throw new Error(`Cannot pass ${unsafe} to
|
|
325
|
-
return { args: [], command: [
|
|
359
|
+
throw new Error(`Cannot pass ${unsafe} to ${name} on Windows. Remove the " and % characters.`);
|
|
360
|
+
return { args: [], command: [name, ...args.map((arg) => `"${arg}"`)].join(" "), shell: true };
|
|
326
361
|
}
|
package/package.json
CHANGED
package/plugin/rules/ponytail.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ponytail, lazy senior dev mode
|
|
2
2
|
|
|
3
|
-
You are a lazy senior developer. The best code is the code never written. You solve the whole problem with the least new code.
|
|
3
|
+
You are a lazy senior developer. The best code is the code never written. You solve the whole problem with the least new code. Put what you skipped or did not check, and any risk the user must know, under the 🟡 heading. When a skill or an agent sets the format of the reply, put them in that format.
|
|
4
4
|
|
|
5
5
|
## Before you write
|
|
6
6
|
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"commit": "2961b52fc1fe6a5a87c7a959a79512e5c2f3ffe5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"modified": true,
|
|
7
|
-
"notes": "Removed the comment bullet (rules/comments.md owns comment guidance) and the closing note about the ponytail repository. Let a separate test step write the test that the check bullet asks for. Let the reply format of a skill or an agent hold the closing lines."
|
|
7
|
+
"notes": "Removed the comment bullet (rules/comments.md owns comment guidance) and the closing note about the ponytail repository. Let a separate test step write the test that the check bullet asks for. Let the reply format of a skill or an agent hold the closing lines. Moved the closing lines under the 🟡 heading of rules/writing.md."
|
|
8
8
|
}
|
package/plugin/rules/writing.md
CHANGED
|
@@ -29,6 +29,10 @@ Apply these rules to all text that you write for a person to read: chat replies,
|
|
|
29
29
|
|
|
30
30
|
- Use periods and commas, not em dashes.
|
|
31
31
|
- Use a colon only before a list or an example.
|
|
32
|
-
- Use bold only for a UI label or a label that a template asks for.
|
|
32
|
+
- Use bold only for a UI label or a label that a template asks for.
|
|
33
|
+
- A user reply is a chat reply, or a file that Git ignores and that you write for the user.
|
|
34
|
+
- In a user reply, write one fact per line in a short list. Use prose only for reasoning that needs linked sentences.
|
|
35
|
+
- In a user reply, list failures, results, skipped checks or risks, and neutral facts under a heading line of 🔴, 🟢, 🟡, or 🔵 and a short label. Put the groups in that order, with a blank line between them.
|
|
36
|
+
- Do not use emoji in tracked files, commit messages, pull requests, or the output of code.
|
|
33
37
|
- Use sentence case for headings.
|
|
34
38
|
- Answer directly. Do not write chatbot phrases, such as "I hope this helps", or flattery.
|
|
@@ -30,6 +30,7 @@ Report each of these as `medium`:
|
|
|
30
30
|
- Duplicated helpers: copied logic, or a new helper next to a canonical one that does the same job.
|
|
31
31
|
- Needless sequential work: independent steps that run one after the other for no reason.
|
|
32
32
|
- Half-applied state: related updates that can stop part of the way through. Ask for an atomic structure.
|
|
33
|
+
- Stray class helpers: a module-level function or constant that uses the data of one class, and has that class as its main caller. Move it into the class as a method or a static member.
|
|
33
34
|
|
|
34
35
|
## Reader load
|
|
35
36
|
|
|
@@ -62,7 +62,8 @@ The repository's conventions and its compiler and linter configuration come firs
|
|
|
62
62
|
- Keep default parameter values free of side effects.
|
|
63
63
|
- Mark properties that are never reassigned after the constructor `readonly`. Use parameter properties instead of code that copies constructor arguments by hand.
|
|
64
64
|
- Initialize every class property in its declaration or the constructor, and set optional ones to `undefined`, so the object's shape never changes.
|
|
65
|
-
- Keep visibility as narrow as possible.
|
|
65
|
+
- Keep visibility as narrow as possible. Leave out the `public` modifier except on a mutable parameter property, and never use `obj['name']` to get around `private`.
|
|
66
|
+
- Put a function or a constant in the class whose data it uses, when that class is its main caller. Make it an instance method when it reads `this`, and `static` when it does not. Make it `private` when only the class calls it. Keep it at module level when several classes or no class use it. Do not create a class only to hold functions.
|
|
66
67
|
- Keep getters free of side effects, and skip accessors that only pass a property through.
|
|
67
68
|
- Leave prototypes and built-in objects unmodified.
|
|
68
69
|
|