@xynogen/pix-skills 0.7.14 → 0.7.16
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/package.json +2 -2
- package/skills/commit.md +4 -39
- package/src/index.test.ts +28 -0
- package/src/index.ts +25 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-skills",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.16",
|
|
4
4
|
"description": "Pi extension — agent skill loader (skill tool + skills bundle)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"@xynogen/pix-data": "^0.4.3",
|
|
50
50
|
"@xynogen/pix-gate": "^0.2.6",
|
|
51
51
|
"@xynogen/pix-pretty": "^1.11.2",
|
|
52
|
-
"@xynogen/pix-runtime": "^0.
|
|
52
|
+
"@xynogen/pix-runtime": "^0.7.0"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/skills/commit.md
CHANGED
|
@@ -36,41 +36,7 @@ time via `\!`cmd`` directives — read them before composing the commit.
|
|
|
36
36
|
- **GROUP**: Cluster changes by path/module and by functionality. Each cluster → one self-contained commit.
|
|
37
37
|
- **GUARD**: Scan diff for secrets, binaries, debug logs, unrelated edits. Halt and report if found.
|
|
38
38
|
|
|
39
|
-
### Phase 2:
|
|
40
|
-
|
|
41
|
-
#### 2a. Detect runner
|
|
42
|
-
|
|
43
|
-
Scan project root for a task runner file in this priority order:
|
|
44
|
-
|
|
45
|
-
1. `justfile` — run `just lint check`, `just format check`, `just test unit`
|
|
46
|
-
2. `mise.toml` / `.mise.toml` — run `mise run lint check`, `mise run format check`, `mise run test unit`
|
|
47
|
-
3. `Makefile` — run `make lint-check`, `make format-check`, `make test-unit`
|
|
48
|
-
4. `Taskfile.yml` — run `task lint:check`, `task format:check`, `task test:unit`
|
|
49
|
-
5. `package.json` — run `npm run lint:check`, `npm run format:check`, `npm run test:unit`
|
|
50
|
-
6. `run.sh` — run `./run.sh lint check`, `./run.sh format check`, `./run.sh test unit`
|
|
51
|
-
|
|
52
|
-
#### 2b. Runner or tasks missing
|
|
53
|
-
|
|
54
|
-
If **no runner file exists** OR the runner exists but **lacks `lint`, `format`, or `test` tasks**:
|
|
55
|
-
|
|
56
|
-
- Ask user:
|
|
57
|
-
> Runner / task(s) not found. Options:
|
|
58
|
-
> A) **Create runner + tasks now** — invoke the `runner` skill to generate missing tasks, then run them before committing.
|
|
59
|
-
> B) **Skip validation** — commit without lint/format/test (risky; recorded in commit body).
|
|
60
|
-
> C) **Abort** — stop here; user will set up runner manually.
|
|
61
|
-
- If user picks A: invoke runner skill, generate the missing tasks, re-detect, then proceed with 2c.
|
|
62
|
-
- If user picks B: proceed to Phase 3. Append `skip-validation: lint format test` to commit body as a reminder.
|
|
63
|
-
- If user picks C: halt. Report what's missing and suggest running the `runner` skill manually.
|
|
64
|
-
|
|
65
|
-
#### 2c. Run checks (in order)
|
|
66
|
-
|
|
67
|
-
1. **Lint** (`lint check`) — static analysis. Failure → STOP, report issues, do not commit.
|
|
68
|
-
2. **Format** (`format check`) — style check (dry-run). Failure → auto-run `format fix`, show diff, then re-run `format check` to confirm clean. Still failing → STOP.
|
|
69
|
-
3. **Unit tests** (`test unit`) — correctness. Failure → STOP, report failing tests, do not commit.
|
|
70
|
-
|
|
71
|
-
All three must be green before proceeding to Phase 3.
|
|
72
|
-
|
|
73
|
-
### Phase 3: Compose
|
|
39
|
+
### Phase 2: Compose
|
|
74
40
|
|
|
75
41
|
Format: `<type>(<scope>): <subject>`
|
|
76
42
|
|
|
@@ -84,17 +50,17 @@ fix(parser): handle empty CUDA frame without panic
|
|
|
84
50
|
refactor(api): extract response builder from handler
|
|
85
51
|
```
|
|
86
52
|
|
|
87
|
-
### Phase
|
|
53
|
+
### Phase 3: Split & Stage
|
|
88
54
|
|
|
89
55
|
- Stage per cluster: `git add <paths>` (or `-p` for partial hunks).
|
|
90
56
|
- One commit per logical change. Never mix `feat` + unrelated `fix` in one commit.
|
|
91
57
|
|
|
92
|
-
### Phase
|
|
58
|
+
### Phase 4: Maintain (when asked)
|
|
93
59
|
|
|
94
60
|
- Squash/amend/reorder to keep history clean. Remove WIP commits.
|
|
95
61
|
- Never rewrite pushed history without explicit confirmation (irreversible for collaborators).
|
|
96
62
|
|
|
97
|
-
### Phase
|
|
63
|
+
### Phase 5: Offer push
|
|
98
64
|
|
|
99
65
|
- After successful commit, ask whether to push now so interaction stays short.
|
|
100
66
|
- Do **not** push automatically. `git push` is irreversible/shared-state; require explicit confirmation for that exact push.
|
|
@@ -110,5 +76,4 @@ refactor(api): extract response builder from handler
|
|
|
110
76
|
- Asking "should I commit?" after skill invoked — invocation already answered that.
|
|
111
77
|
- Secrets, binaries, or `console.log`/`print` debug lines in diff.
|
|
112
78
|
- One commit bundling unrelated changes.
|
|
113
|
-
- Tests/lints not run, or failing.
|
|
114
79
|
- Rewriting pushed history without confirmation.
|
package/src/index.test.ts
CHANGED
|
@@ -264,6 +264,34 @@ describe("skill renderer", () => {
|
|
|
264
264
|
expect(rendered).not.toContain("search results");
|
|
265
265
|
});
|
|
266
266
|
|
|
267
|
+
it("keeps the call action and target in the collapsed result", () => {
|
|
268
|
+
let registered: Record<string, unknown> = {};
|
|
269
|
+
registerSkills({
|
|
270
|
+
registerTool(tool: unknown) {
|
|
271
|
+
registered = tool as Record<string, unknown>;
|
|
272
|
+
},
|
|
273
|
+
on() {},
|
|
274
|
+
} as never);
|
|
275
|
+
const renderResult = registered.renderResult as (...args: unknown[]) => {
|
|
276
|
+
render: (width: number) => string[];
|
|
277
|
+
};
|
|
278
|
+
const rendered = renderResult(
|
|
279
|
+
{
|
|
280
|
+
content: [{ type: "text", text: "portable guidance" }],
|
|
281
|
+
details: { mode: "instructions", name: "tdd", lines: 84 },
|
|
282
|
+
},
|
|
283
|
+
{},
|
|
284
|
+
tagTheme,
|
|
285
|
+
{ expanded: false, isError: false, state: { collapsed: true }, invalidate: () => {} },
|
|
286
|
+
)
|
|
287
|
+
.render(120)
|
|
288
|
+
.join("\n");
|
|
289
|
+
|
|
290
|
+
expect(rendered).toContain("<b>read_skills</b>");
|
|
291
|
+
expect(rendered).toContain("instructions · tdd");
|
|
292
|
+
expect(rendered).toContain("84 lines");
|
|
293
|
+
});
|
|
294
|
+
|
|
267
295
|
it("restores the normal result when an elapsed card is expanded", () => {
|
|
268
296
|
let registered: Record<string, unknown> = {};
|
|
269
297
|
registerSkills({
|
package/src/index.ts
CHANGED
|
@@ -344,6 +344,28 @@ export function formatSkillCallLabel(args: SkillCallArgs): string {
|
|
|
344
344
|
return dotJoin(["description", args.name]);
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
+
/** Collapsed row target/meta for a skill result, in the same action-first order
|
|
348
|
+
* the call label uses (e.g. `instructions tdd · 84 lines`). */
|
|
349
|
+
export function collapsedSkillRow(details: SkillResultDetails): {
|
|
350
|
+
target: string;
|
|
351
|
+
meta: string;
|
|
352
|
+
} {
|
|
353
|
+
switch (details.mode) {
|
|
354
|
+
case "list":
|
|
355
|
+
return { target: "list", meta: `${details.count} skills` };
|
|
356
|
+
case "search":
|
|
357
|
+
return { target: `search “${details.query}”`, meta: `${details.count} matches` };
|
|
358
|
+
case "description":
|
|
359
|
+
return { target: `description · ${details.name}`, meta: "" };
|
|
360
|
+
case "instructions":
|
|
361
|
+
return { target: `instructions · ${details.name}`, meta: `${details.lines} lines` };
|
|
362
|
+
case "reference":
|
|
363
|
+
return { target: `reference · ${details.name}`, meta: humanSize(details.bytes) };
|
|
364
|
+
case "copy":
|
|
365
|
+
return { target: `copy · ${details.output}`, meta: humanSize(details.bytes) };
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
347
369
|
export function formatCollapsedSkillResult(details: SkillResultDetails): string {
|
|
348
370
|
switch (details.mode) {
|
|
349
371
|
case "list":
|
|
@@ -654,9 +676,9 @@ function registerSkillLoader(pi: ExtensionAPI): void {
|
|
|
654
676
|
if (!renderCtx.isError && details) {
|
|
655
677
|
const state = renderCtx.state as CollapseState;
|
|
656
678
|
if (tickCollapse("read_skills", state, renderCtx.invalidate, renderCtx.expanded)) {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
const
|
|
679
|
+
// Collapsed row mirrors the call label: `<action> <target> · <meta>` so
|
|
680
|
+
// the summary reads the same way the call did (no action/target reorder).
|
|
681
|
+
const { target, meta } = collapsedSkillRow(details);
|
|
660
682
|
component.setText(formatCollapsedToolRow(theme, "read_skills", target, meta));
|
|
661
683
|
return component;
|
|
662
684
|
}
|