next-issue 17.0.1 → 17.0.2
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/cli/skills.mjs +11 -6
- package/package.json +1 -1
package/dist/cli/skills.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { createInterface } from 'node:readline/promises';
|
|
6
6
|
import { OWN_SKILLS } from '../shared/agents.mjs';
|
|
7
7
|
import { hasCode } from '../shared/errors.mjs';
|
|
8
|
-
import { repoRoot } from '../shared/git.mjs';
|
|
8
|
+
import { git, repoRoot } from '../shared/git.mjs';
|
|
9
9
|
const SKILLS = join(import.meta.dirname, '..', '..', 'skills');
|
|
10
10
|
const QUESTION = 'Install the skills for the user, in ~/.claude/skills, or for the project, in .claude/skills of the main worktree? (user/project) ';
|
|
11
11
|
const ANSWERS = new Map([
|
|
@@ -103,10 +103,12 @@ async function isOwnSkill(folder) {
|
|
|
103
103
|
.split(/\r?\n/)
|
|
104
104
|
.some((line) => line.startsWith('description:') && line.includes('next-issue'));
|
|
105
105
|
}
|
|
106
|
+
async function isTracked(root, folder) {
|
|
107
|
+
return (await git(root, ['ls-files', '--', folder])) !== '';
|
|
108
|
+
}
|
|
106
109
|
export async function refreshSkills(root) {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
];
|
|
110
|
+
const project = join(root, '.claude', 'skills');
|
|
111
|
+
const folders = [...new Set([join(homedir(), '.claude', 'skills'), project])];
|
|
110
112
|
const notes = [];
|
|
111
113
|
for (const name of OWN_SKILLS) {
|
|
112
114
|
const shipped = await skillHash(join(SKILLS, name));
|
|
@@ -120,7 +122,10 @@ export async function refreshSkills(root) {
|
|
|
120
122
|
if (hash === shipped) {
|
|
121
123
|
continue;
|
|
122
124
|
}
|
|
123
|
-
if (await
|
|
125
|
+
if (folder === project && (await isTracked(root, join(folder, name)))) {
|
|
126
|
+
notes.push(`kept ${join(folder, name)}: tracked by git`);
|
|
127
|
+
}
|
|
128
|
+
else if (await isOwnSkill(join(folder, name))) {
|
|
124
129
|
notes.push(`updated ${await replaceSkill(folder, name)}`);
|
|
125
130
|
}
|
|
126
131
|
else {
|
|
@@ -128,7 +133,7 @@ export async function refreshSkills(root) {
|
|
|
128
133
|
}
|
|
129
134
|
}
|
|
130
135
|
if (!installed) {
|
|
131
|
-
notes.push(`wrote ${await replaceSkill(
|
|
136
|
+
notes.push(`wrote ${await replaceSkill(project, name)}`);
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
139
|
return notes;
|