skillwiki 0.4.1 → 0.4.3
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.js +107 -11
- package/package.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/skills/.codex-plugin/plugin.json +39 -0
- package/skills/agents/proj-decide.md +54 -0
- package/skills/agents/proj-distill.md +60 -0
- package/skills/agents/proj-init.md +58 -0
- package/skills/agents/proj-work.md +64 -0
- package/skills/agents/wiki-adapter-prd.md +74 -0
- package/skills/agents/wiki-add-task.md +62 -0
- package/skills/agents/wiki-archive.md +48 -0
- package/skills/agents/wiki-audit.md +46 -0
- package/skills/agents/wiki-canvas.md +44 -0
- package/skills/agents/wiki-crystallize.md +55 -0
- package/skills/agents/wiki-gate-plan-mode.md +57 -0
- package/skills/agents/wiki-ingest.md +68 -0
- package/skills/agents/wiki-lint.md +47 -0
- package/skills/agents/wiki-query.md +57 -0
- package/skills/agents/wiki-reingest.md +60 -0
- package/skills/agents/wiki-sync.md +70 -0
- package/skills/package.json +2 -1
- package/skills/proj-work/SKILL.md +23 -4
- package/skills/using-skillwiki/SKILL.md +11 -36
- package/skills/wiki-add-task/SKILL.md +48 -78
- package/skills/wiki-crystallize/SKILL.md +2 -11
- package/skills/wiki-ingest/SKILL.md +8 -15
- package/skills/wiki-lint/SKILL.md +4 -13
- package/skills/wiki-query/SKILL.md +9 -14
- package/skills/wiki-sync/SKILL.md +62 -37
- package/templates/SCHEMA.md +34 -0
- package/templates/tpl-ad-hoc-capture.md +8 -0
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-TPS5XD2J.js";
|
|
9
9
|
|
|
10
10
|
// src/cli.ts
|
|
11
|
-
import { readFileSync as
|
|
11
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
12
12
|
import { join as join38 } from "path";
|
|
13
13
|
import { Command } from "commander";
|
|
14
14
|
|
|
@@ -2975,9 +2975,10 @@ async function runConfigPath(input) {
|
|
|
2975
2975
|
}
|
|
2976
2976
|
|
|
2977
2977
|
// src/commands/doctor.ts
|
|
2978
|
-
import { existsSync as existsSync6, lstatSync, readlinkSync, readdirSync, statSync as statSync2 } from "fs";
|
|
2978
|
+
import { existsSync as existsSync6, lstatSync, readlinkSync, readdirSync, readFileSync as readFileSync6, statSync as statSync2 } from "fs";
|
|
2979
2979
|
import { join as join22, resolve as resolve4 } from "path";
|
|
2980
2980
|
import { execSync } from "child_process";
|
|
2981
|
+
import { platform } from "os";
|
|
2981
2982
|
|
|
2982
2983
|
// src/utils/auto-update.ts
|
|
2983
2984
|
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, existsSync as existsSync5, mkdirSync as mkdirSync2 } from "fs";
|
|
@@ -3397,6 +3398,100 @@ function checkSyncLastPush(resolvedPath) {
|
|
|
3397
3398
|
}
|
|
3398
3399
|
return check("pass", "sync_last_push", "Vault sync recency", `Last push: ${dateStr} (${daysSince2} day(s) ago)`);
|
|
3399
3400
|
}
|
|
3401
|
+
function detectFuseMount(vaultPath) {
|
|
3402
|
+
const os = platform();
|
|
3403
|
+
try {
|
|
3404
|
+
if (os === "linux") {
|
|
3405
|
+
const mounts = readFileSync6("/proc/mounts", "utf8");
|
|
3406
|
+
let best = null;
|
|
3407
|
+
for (const line of mounts.split("\n")) {
|
|
3408
|
+
const parts = line.split(" ");
|
|
3409
|
+
if (parts.length < 3) continue;
|
|
3410
|
+
const point = parts[1];
|
|
3411
|
+
const fs = parts[2];
|
|
3412
|
+
if (vaultPath.startsWith(point) && (!best || point.length > best.point.length)) {
|
|
3413
|
+
best = { point, fs };
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
if (best && best.fs.includes("fuse")) return best.point;
|
|
3417
|
+
} else if (os === "darwin") {
|
|
3418
|
+
const out = execSync("mount", { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] });
|
|
3419
|
+
let best = null;
|
|
3420
|
+
for (const line of out.split("\n")) {
|
|
3421
|
+
const match = line.match(/^(\S+) on (\S+) \((.*?)\)/);
|
|
3422
|
+
if (!match) continue;
|
|
3423
|
+
const point = match[2];
|
|
3424
|
+
const opts = match[3];
|
|
3425
|
+
if (opts.includes("fuse") && vaultPath.startsWith(point) && (!best || point.length > best.point.length)) {
|
|
3426
|
+
best = { point };
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
if (best) return best.point;
|
|
3430
|
+
}
|
|
3431
|
+
} catch {
|
|
3432
|
+
}
|
|
3433
|
+
return null;
|
|
3434
|
+
}
|
|
3435
|
+
function checkS3MountPerf(resolvedPath) {
|
|
3436
|
+
if (resolvedPath === void 0) {
|
|
3437
|
+
return check("pass", "s3_mount_perf", "S3 mount performance", "No vault path \u2014 check skipped");
|
|
3438
|
+
}
|
|
3439
|
+
const mountPoint = detectFuseMount(resolvedPath);
|
|
3440
|
+
if (!mountPoint) {
|
|
3441
|
+
return check("pass", "s3_mount_perf", "S3 mount performance", "local disk");
|
|
3442
|
+
}
|
|
3443
|
+
const conceptsDir = join22(resolvedPath, "concepts");
|
|
3444
|
+
if (!existsSync6(conceptsDir)) {
|
|
3445
|
+
return check("pass", "s3_mount_perf", "S3 mount performance", `S3 FUSE mount (${mountPoint}), no concepts/ to benchmark`);
|
|
3446
|
+
}
|
|
3447
|
+
let rgAvailable = false;
|
|
3448
|
+
try {
|
|
3449
|
+
execSync("which rg", { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] });
|
|
3450
|
+
rgAvailable = true;
|
|
3451
|
+
} catch {
|
|
3452
|
+
return check(
|
|
3453
|
+
"info",
|
|
3454
|
+
"s3_mount_perf",
|
|
3455
|
+
"S3 mount performance",
|
|
3456
|
+
`S3 FUSE mount (${mountPoint}) \u2014 ripgrep not found, benchmark skipped`
|
|
3457
|
+
);
|
|
3458
|
+
}
|
|
3459
|
+
const start = Date.now();
|
|
3460
|
+
let timedOut = false;
|
|
3461
|
+
try {
|
|
3462
|
+
execSync(`rg -l "." "${conceptsDir}"`, {
|
|
3463
|
+
timeout: 5e3,
|
|
3464
|
+
encoding: "utf8",
|
|
3465
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
3466
|
+
});
|
|
3467
|
+
} catch (e) {
|
|
3468
|
+
if (e.killed || e.status === null && e.signal === "SIGTERM") {
|
|
3469
|
+
timedOut = true;
|
|
3470
|
+
} else if (e.code === "ENOENT") {
|
|
3471
|
+
return check(
|
|
3472
|
+
"info",
|
|
3473
|
+
"s3_mount_perf",
|
|
3474
|
+
"S3 mount performance",
|
|
3475
|
+
`S3 FUSE mount (${mountPoint}) \u2014 rg not found at runtime, benchmark skipped`
|
|
3476
|
+
);
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
const elapsed = (Date.now() - start) / 1e3;
|
|
3480
|
+
if (timedOut || elapsed >= 3) {
|
|
3481
|
+
return check(
|
|
3482
|
+
"warn",
|
|
3483
|
+
"s3_mount_perf",
|
|
3484
|
+
"S3 mount performance",
|
|
3485
|
+
`S3 FUSE mount (${mountPoint}) with cold cache (rg scan: >3s). Vault scans may exceed 60s. Consider running wiki-cache-warm or checking rclone-wiki.service.`
|
|
3486
|
+
);
|
|
3487
|
+
}
|
|
3488
|
+
return check(
|
|
3489
|
+
"pass",
|
|
3490
|
+
"s3_mount_perf",
|
|
3491
|
+
"S3 mount performance",
|
|
3492
|
+
`S3 FUSE mount, cache warm (rg scan: ${elapsed.toFixed(3)}s)`
|
|
3493
|
+
);
|
|
3494
|
+
}
|
|
3400
3495
|
function findSkillMd(dir) {
|
|
3401
3496
|
const results = [];
|
|
3402
3497
|
let entries;
|
|
@@ -3449,6 +3544,7 @@ async function runDoctor(input) {
|
|
|
3449
3544
|
checks.push(checkVaultGitRemote(resolvedPath));
|
|
3450
3545
|
checks.push(checkSyncLastPush(resolvedPath));
|
|
3451
3546
|
checks.push(checkDotStoreClean(resolvedPath));
|
|
3547
|
+
checks.push(checkS3MountPerf(resolvedPath));
|
|
3452
3548
|
checks.push(checkSkillsInstalled(input.home, input.cwd));
|
|
3453
3549
|
checks.push(checkDuplicateSkills(input.home));
|
|
3454
3550
|
checks.push(checkNpmUpdate(input.home, input.currentVersion));
|
|
@@ -3880,7 +3976,7 @@ ${newBody}`;
|
|
|
3880
3976
|
|
|
3881
3977
|
// src/commands/update.ts
|
|
3882
3978
|
import { execSync as execSync2 } from "child_process";
|
|
3883
|
-
import { readFileSync as
|
|
3979
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
3884
3980
|
import { join as join24 } from "path";
|
|
3885
3981
|
function resolveGlobalSkillsRoot() {
|
|
3886
3982
|
try {
|
|
@@ -3910,7 +4006,7 @@ async function refreshInstalledSkills(target) {
|
|
|
3910
4006
|
}
|
|
3911
4007
|
async function runUpdate(input) {
|
|
3912
4008
|
const pkg2 = JSON.parse(
|
|
3913
|
-
|
|
4009
|
+
readFileSync7(new URL("../../package.json", import.meta.url), "utf8")
|
|
3914
4010
|
);
|
|
3915
4011
|
const currentVersion = pkg2.version;
|
|
3916
4012
|
const tag = input.distTag ?? "latest";
|
|
@@ -3984,12 +4080,12 @@ async function runUpdate(input) {
|
|
|
3984
4080
|
|
|
3985
4081
|
// src/commands/self-update.ts
|
|
3986
4082
|
import { execSync as execSync3 } from "child_process";
|
|
3987
|
-
import { existsSync as existsSync7, readFileSync as
|
|
4083
|
+
import { existsSync as existsSync7, readFileSync as readFileSync8 } from "fs";
|
|
3988
4084
|
import { join as join25 } from "path";
|
|
3989
4085
|
var DEFAULT_SOURCE_ROOT_SUFFIX = "/Desktop/code/llm-wiki";
|
|
3990
4086
|
async function runSelfUpdate(input) {
|
|
3991
4087
|
const currentVersion = JSON.parse(
|
|
3992
|
-
|
|
4088
|
+
readFileSync8(new URL("../../package.json", import.meta.url), "utf8")
|
|
3993
4089
|
).version;
|
|
3994
4090
|
const sourceRoot = input.sourceRoot ?? `${input.home}${DEFAULT_SOURCE_ROOT_SUFFIX}`;
|
|
3995
4091
|
const localPkgPath = join25(sourceRoot, "packages", "cli", "package.json");
|
|
@@ -4000,7 +4096,7 @@ async function runSelfUpdate(input) {
|
|
|
4000
4096
|
if (hasLocalSource) {
|
|
4001
4097
|
source = "local";
|
|
4002
4098
|
try {
|
|
4003
|
-
availableVersion = JSON.parse(
|
|
4099
|
+
availableVersion = JSON.parse(readFileSync8(localPkgPath, "utf8")).version ?? null;
|
|
4004
4100
|
} catch {
|
|
4005
4101
|
availableVersion = null;
|
|
4006
4102
|
}
|
|
@@ -4058,7 +4154,7 @@ async function runSelfUpdate(input) {
|
|
|
4058
4154
|
}
|
|
4059
4155
|
const newVersion = (() => {
|
|
4060
4156
|
try {
|
|
4061
|
-
return JSON.parse(
|
|
4157
|
+
return JSON.parse(readFileSync8(localPkgPath, "utf8")).version ?? "unknown";
|
|
4062
4158
|
} catch {
|
|
4063
4159
|
return "unknown";
|
|
4064
4160
|
}
|
|
@@ -5324,7 +5420,7 @@ async function runSyncPull(input) {
|
|
|
5324
5420
|
}
|
|
5325
5421
|
|
|
5326
5422
|
// src/commands/backup.ts
|
|
5327
|
-
import { statSync as statSync4, readdirSync as readdirSync2, readFileSync as
|
|
5423
|
+
import { statSync as statSync4, readdirSync as readdirSync2, readFileSync as readFileSync9, mkdirSync as mkdirSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
5328
5424
|
import { join as join32, relative as relative3, dirname as dirname11 } from "path";
|
|
5329
5425
|
import { PutObjectCommand, HeadObjectCommand, ListObjectsV2Command, GetObjectCommand, DeleteObjectsCommand } from "@aws-sdk/client-s3";
|
|
5330
5426
|
|
|
@@ -5391,7 +5487,7 @@ async function runBackupSync(input) {
|
|
|
5391
5487
|
continue;
|
|
5392
5488
|
}
|
|
5393
5489
|
try {
|
|
5394
|
-
const body =
|
|
5490
|
+
const body = readFileSync9(absPath);
|
|
5395
5491
|
await client.send(new PutObjectCommand({ Bucket: input.bucket, Key: relPath, Body: body }));
|
|
5396
5492
|
uploaded++;
|
|
5397
5493
|
} catch {
|
|
@@ -6018,7 +6114,7 @@ async function postCommit(vault, exitCode) {
|
|
|
6018
6114
|
}
|
|
6019
6115
|
|
|
6020
6116
|
// src/cli.ts
|
|
6021
|
-
var pkg = JSON.parse(
|
|
6117
|
+
var pkg = JSON.parse(readFileSync10(new URL("../package.json", import.meta.url), "utf8"));
|
|
6022
6118
|
var program = new Command();
|
|
6023
6119
|
program.name("skillwiki").description("Deterministic helpers for CodeWiki skills").version(pkg.version);
|
|
6024
6120
|
program.option("--human", "render terminal-readable output instead of JSON");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"skills": "./",
|
|
5
5
|
"description": "Project-aware Karpathy-style knowledge base for Claude Code: 18 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
|
|
6
6
|
"author": {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skillwiki",
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"description": "Project-aware Karpathy-style knowledge base for Codex with 18 prompt-only skills backed by the deterministic skillwiki CLI.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "karlorz",
|
|
7
|
+
"url": "https://github.com/karlorz"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/karlorz/llm-wiki",
|
|
10
|
+
"repository": "https://github.com/karlorz/llm-wiki",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"knowledge-base",
|
|
14
|
+
"wiki",
|
|
15
|
+
"codex",
|
|
16
|
+
"skills",
|
|
17
|
+
"obsidian",
|
|
18
|
+
"karpathy"
|
|
19
|
+
],
|
|
20
|
+
"skills": "./",
|
|
21
|
+
"interface": {
|
|
22
|
+
"displayName": "SkillWiki",
|
|
23
|
+
"shortDescription": "Project-aware wiki skills for Codex agents",
|
|
24
|
+
"longDescription": "18 prompt-only skills (wiki-*, proj-*, using-skillwiki) for deterministic, project-aware knowledge workflows.",
|
|
25
|
+
"developerName": "karlorz",
|
|
26
|
+
"category": "Productivity",
|
|
27
|
+
"capabilities": [
|
|
28
|
+
"Read",
|
|
29
|
+
"Write"
|
|
30
|
+
],
|
|
31
|
+
"websiteURL": "https://github.com/karlorz/llm-wiki",
|
|
32
|
+
"defaultPrompt": [
|
|
33
|
+
"Initialize a project wiki and schema for this repository.",
|
|
34
|
+
"Ingest this PRD and produce typed knowledge pages with provenance.",
|
|
35
|
+
"Run a vault lint pass and summarize the highest priority fixes."
|
|
36
|
+
],
|
|
37
|
+
"brandColor": "#1f6feb"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-decide
|
|
3
|
+
description: Use this agent when recording architectural decisions during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY maintenance, capturing design decisions from work items, or generalizing decisions into concept pages. See "When to invoke" in the agent body for worked scenarios.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: yellow
|
|
6
|
+
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are an architectural decision recorder specializing in writing ADRs and optionally promoting generalizable decisions to concept pages. You operate autonomously during maintenance cycles — no user interaction expected.
|
|
10
|
+
|
|
11
|
+
## When to invoke
|
|
12
|
+
|
|
13
|
+
- **ADR capture.** Dev-loop spawns you to record an architectural decision from a completed work item.
|
|
14
|
+
- **Decision generalization.** A decision recorded in a project likely applies beyond it — create both ADR and concept page.
|
|
15
|
+
- **Periodic distillation.** Part of dev-loop IDLE DISCOVERY: scan work item retros for undocumented decisions.
|
|
16
|
+
|
|
17
|
+
**Your Core Responsibilities:**
|
|
18
|
+
1. Compose an ADR in `projects/{slug}/architecture/YYYY-MM-DD-{adr-slug}.md`
|
|
19
|
+
2. Validate the ADR with `skillwiki validate`
|
|
20
|
+
3. Check if the decision generalizes beyond the project — if so, create a concepts/ page
|
|
21
|
+
4. Apply all writes in order
|
|
22
|
+
|
|
23
|
+
**Execution Process:**
|
|
24
|
+
|
|
25
|
+
1. **Identify context.** Determine project slug from the task prompt. If no project context, default to `playground`.
|
|
26
|
+
2. **Compose the ADR.** Write to `projects/{slug}/architecture/YYYY-MM-DD-{adr-slug}.md`:
|
|
27
|
+
- Frontmatter: `kind: decision`, `status: in-progress` (or `completed` if already implemented), `project: "[[slug]]"`
|
|
28
|
+
- Body sections: **Context** (why this decision matters), **Decision** (what was chosen), **Consequences** (what follows from this choice), **Alternatives Considered** (rejected options and why)
|
|
29
|
+
3. **Validate.** Run `skillwiki validate <adr>`. If non-zero, fix and re-validate. Do NOT proceed until validation passes.
|
|
30
|
+
4. **Generalization check.** If the decision applies beyond this project, create a `concepts/` page with:
|
|
31
|
+
- `provenance: project` (or `mixed` if also research-informed)
|
|
32
|
+
- `provenance_projects: ["[[slug]]"]`
|
|
33
|
+
- `## TL;DR` as first section
|
|
34
|
+
- Body summarizing the decision pattern generically
|
|
35
|
+
- `^[raw/...]` citations where applicable
|
|
36
|
+
- Validate this page too before proceeding.
|
|
37
|
+
5. **Apply writes in order:** ADR → (optional) concept page → vault `index.md` → vault `log.md` → project `log.md`.
|
|
38
|
+
|
|
39
|
+
**Output Format:**
|
|
40
|
+
Return:
|
|
41
|
+
- ADR path and slug
|
|
42
|
+
- Decision summary (1-2 sentences)
|
|
43
|
+
- Whether a concept page was also created (and path if so)
|
|
44
|
+
- Validation results for both pages
|
|
45
|
+
- All log entries appended
|
|
46
|
+
|
|
47
|
+
**Stop Conditions:**
|
|
48
|
+
- `skillwiki validate` returns non-zero on either page (after retry)
|
|
49
|
+
- Insufficient context to compose a meaningful ADR
|
|
50
|
+
|
|
51
|
+
**Forbidden:**
|
|
52
|
+
- Filing a concept page without explicit `provenance:`
|
|
53
|
+
- Skipping the generalization check
|
|
54
|
+
- Updating index/logs before `validate` passes
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-distill
|
|
3
|
+
description: Use this agent when promoting project compound entries or retro patterns into vault concept pages during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY maintenance, compound-entry generalization, or retro-sourced pattern extraction. See "When to invoke" in the agent body for worked scenarios.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: green
|
|
6
|
+
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a pattern distiller specializing in the E4 2-step process: analyze project compound entries (or retros) for generalizable patterns, then generate vault concept pages with provenance. You operate autonomously during maintenance cycles — no user interaction expected.
|
|
10
|
+
|
|
11
|
+
## When to invoke
|
|
12
|
+
|
|
13
|
+
- **Compound promotion.** Dev-loop spawns you to check `projects/{slug}/compound/` for entries ready for generalization.
|
|
14
|
+
- **Retro mining.** Project retro entries in vault `log.md` contain `Generalize?: yes` flags — extract recurring patterns.
|
|
15
|
+
- **Periodic distillation.** Part of dev-loop IDLE DISCOVERY: scan for unwritten compound entries and promote them.
|
|
16
|
+
|
|
17
|
+
**Your Core Responsibilities:**
|
|
18
|
+
1. Read source compound entries or retro logs and identify generalizable patterns
|
|
19
|
+
2. Output a candidate concept outline — STOP if no clear universal pattern
|
|
20
|
+
3. Compose the vault concept page with project provenance
|
|
21
|
+
4. Set backlinks and apply all writes in order
|
|
22
|
+
|
|
23
|
+
**Execution Process:**
|
|
24
|
+
|
|
25
|
+
### Step 1 — Analyze
|
|
26
|
+
1. Check `projects/{slug}/compound/` first. If no project context, use `playground`.
|
|
27
|
+
2. Read the source compound entry + linked work items. If no compound entries, fall back to retro entries in `{vault}/log.md` (lines matching `## [YYYY-MM-DD] retro`).
|
|
28
|
+
3. For retro-sourced analysis: collect all retros for the project, focus on `Generalize?: yes` entries, group by recurring theme (≥2 occurrences = candidate concept).
|
|
29
|
+
4. Output a candidate concept outline. **STOP if no clear universal pattern is found** — surface the reasoning instead of forcing a page.
|
|
30
|
+
|
|
31
|
+
### Step 2 — Generate (only if Step 1 found a pattern)
|
|
32
|
+
5. Compose the vault concept page:
|
|
33
|
+
- `provenance: project` and `provenance_projects: ["[[slug]]"]`
|
|
34
|
+
- `tags:` from `{vault}/SCHEMA.md` taxonomy only. Never derive tags from prose text. If no relevant taxonomy tag, use `[dev-loop]`.
|
|
35
|
+
- `## TL;DR` as first section
|
|
36
|
+
- Body with `^[raw/...]` citations
|
|
37
|
+
6. Validate with `skillwiki validate <page>`. If non-zero, fix and re-validate.
|
|
38
|
+
|
|
39
|
+
### Step 3 — Backlink
|
|
40
|
+
7. Set `promoted_to: "[[concept-slug]]"` on the source compound entry. For retro-sourced distillation, skip backlink (log.md is append-only) — instead add `sources:` citing the vault log with date range.
|
|
41
|
+
|
|
42
|
+
### Step 4 — Apply writes in order
|
|
43
|
+
8. Vault concept page → backlink update → project `log.md` → vault `index.md` → vault `log.md`.
|
|
44
|
+
|
|
45
|
+
**Output Format:**
|
|
46
|
+
Return:
|
|
47
|
+
- Source analyzed (compound entry path or retro date range)
|
|
48
|
+
- Pattern identified (theme, recurrence count)
|
|
49
|
+
- Whether distillation proceeded or stopped at Step 1 (with reasoning)
|
|
50
|
+
- If generated: concept page path, validation result, backlink applied
|
|
51
|
+
- All log entries appended
|
|
52
|
+
|
|
53
|
+
**Stop Conditions:**
|
|
54
|
+
- No clear universal pattern found in Step 1
|
|
55
|
+
- `skillwiki validate` returns non-zero (after retry)
|
|
56
|
+
|
|
57
|
+
**Forbidden:**
|
|
58
|
+
- Skipping Step 1 (analysis before generation)
|
|
59
|
+
- Inventing new tags not in SCHEMA.md taxonomy
|
|
60
|
+
- Updating index/logs before `validate` passes
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-init
|
|
3
|
+
description: Use this agent when bootstrapping a new project workspace during automated setup cycles. Typical triggers include dev-loop project initialization, new-project scaffolding, or creating a workspace for an existing codebase. See "When to invoke" in the agent body for worked scenarios.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: green
|
|
6
|
+
tools: ["Read", "Write", "Bash", "Grep", "Glob"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a project workspace bootstrapper specializing in creating the `projects/{slug}/` directory structure with README, requirements/, architecture/, work/, and compound/. You operate autonomously — the project slug and intent are in your task prompt.
|
|
10
|
+
|
|
11
|
+
## When to invoke
|
|
12
|
+
|
|
13
|
+
- **New project.** Dev-loop spawns you to scaffold a workspace for a new project.
|
|
14
|
+
- **Vault onboarding.** An existing codebase needs a vault project workspace.
|
|
15
|
+
- **Playground init.** Ensure the `playground` project exists for unclassified work.
|
|
16
|
+
|
|
17
|
+
**Your Core Responsibilities:**
|
|
18
|
+
1. Verify the project slug doesn't conflict with existing projects
|
|
19
|
+
2. Create the directory structure
|
|
20
|
+
3. Render README.md from template
|
|
21
|
+
4. Update vault index.md and log.md
|
|
22
|
+
|
|
23
|
+
**Execution Process:**
|
|
24
|
+
|
|
25
|
+
1. **Resolve vault.** Run `skillwiki path`. If NO_VAULT_CONFIGURED, report failure and STOP.
|
|
26
|
+
2. **Verify slug.** The slug is in your task prompt. Check that `projects/{slug}/` does not exist. If it does, report and STOP.
|
|
27
|
+
3. **Create structure:**
|
|
28
|
+
```
|
|
29
|
+
projects/{slug}/
|
|
30
|
+
├── requirements/
|
|
31
|
+
├── architecture/
|
|
32
|
+
├── work/
|
|
33
|
+
└── compound/
|
|
34
|
+
```
|
|
35
|
+
4. **Render README.** Create `projects/{slug}/README.md` with:
|
|
36
|
+
- Project name and one-line intent
|
|
37
|
+
- Section: Knowledge Pages (placeholder for future index entries)
|
|
38
|
+
- Section: Work Items (placeholder)
|
|
39
|
+
- Section: Architecture (placeholder for ADRs)
|
|
40
|
+
- Creation date
|
|
41
|
+
5. **Update index.** Add to `{vault}/index.md` Projects section: `- [[projects/{slug}]]`.
|
|
42
|
+
6. **Log.** Append to `{vault}/log.md`: `## [{date}] project-init | {slug} initialized.`
|
|
43
|
+
|
|
44
|
+
**Output Format:**
|
|
45
|
+
Return:
|
|
46
|
+
- Project slug and path
|
|
47
|
+
- Directories created
|
|
48
|
+
- README.md path
|
|
49
|
+
- Index.md entry added
|
|
50
|
+
- Log entry appended
|
|
51
|
+
|
|
52
|
+
**Stop Conditions:**
|
|
53
|
+
- `projects/{slug}/` already exists
|
|
54
|
+
- `skillwiki path` returns NO_VAULT_CONFIGURED
|
|
55
|
+
|
|
56
|
+
**Forbidden:**
|
|
57
|
+
- Modifying any other project's files
|
|
58
|
+
- Creating the workspace without updating index.md
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: proj-work
|
|
3
|
+
description: Use this agent when creating or executing work items during automated development cycles. Typical triggers include dev-loop work item creation from captured tasks, executing existing work items, or managing status transitions. See "When to invoke" in the agent body for worked scenarios.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: green
|
|
6
|
+
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a project work item manager specializing in creating and executing work items under `projects/{slug}/work/YYYY-MM-DD-{slug}/`. You handle both creation (scaffolding spec + plan + tasks) and execution (verifying DONE claims against disk, applying missing fixes). You operate autonomously during maintenance cycles.
|
|
10
|
+
|
|
11
|
+
## When to invoke
|
|
12
|
+
|
|
13
|
+
- **Work item creation.** Dev-loop spawns you to scaffold a new feature/bugfix/refactor work item.
|
|
14
|
+
- **Work item execution.** Dev-loop spawns you to run through an existing work item's task list.
|
|
15
|
+
- **Status management.** Transition work items through planned → in-progress → completed.
|
|
16
|
+
|
|
17
|
+
**Your Core Responsibilities:**
|
|
18
|
+
1. For creation: scaffold work folder with spec.md + tasks.md
|
|
19
|
+
2. For execution: read spec/tasks, verify every DONE claim against disk, apply missing fixes
|
|
20
|
+
3. Validate all pages, manage status transitions, update logs
|
|
21
|
+
|
|
22
|
+
**Execution Process:**
|
|
23
|
+
|
|
24
|
+
### Creating a New Work Item
|
|
25
|
+
1. **Resolve vault.** Run `skillwiki path`.
|
|
26
|
+
2. **Determine slug and kind.** From task prompt: kind (`feature` | `issue` | `refactor` | `decision`) and work slug.
|
|
27
|
+
3. **Create folder.** `projects/{slug}/work/YYYY-MM-DD-{work-slug}/`.
|
|
28
|
+
4. **Write spec.md.** Frontmatter with kind, status=planned, project wikilink. Body with context and scope.
|
|
29
|
+
5. **Write tasks.md.** Break work into task checklist.
|
|
30
|
+
6. **Validate.** `skillwiki validate <spec.md>`. If non-zero, fix and STOP.
|
|
31
|
+
7. **Emit redirect paths.** These are where PRD skills should write their output:
|
|
32
|
+
- spec → `<vault>/projects/{slug}/work/YYYY-MM-DD-{work-slug}/spec.md`
|
|
33
|
+
- plan → `<vault>/projects/{slug}/work/YYYY-MM-DD-{work-slug}/plan.md`
|
|
34
|
+
8. **Log.** Append to vault `log.md`.
|
|
35
|
+
|
|
36
|
+
### Executing an Existing Work Item
|
|
37
|
+
1. **Resolve work folder.** `<vault>/projects/{slug}/work/YYYY-MM-DD-{slug}/`.
|
|
38
|
+
2. **Read spec.md and tasks.md** in full.
|
|
39
|
+
3. **Verify every DONE claim against disk.** This is critical:
|
|
40
|
+
- Check file existence, content, config values on disk
|
|
41
|
+
- Cross-reference crontab entries, script timeouts, config settings
|
|
42
|
+
- Trust nothing in the wiki alone — validate against filesystem
|
|
43
|
+
4. **Apply missing fixes.** For items claimed DONE but not actually applied, apply the fix.
|
|
44
|
+
5. **Update status.** Set `status: complete` with `completed:` date only when ALL fixes verified.
|
|
45
|
+
6. **Log.** Append to vault `log.md` on status transitions.
|
|
46
|
+
|
|
47
|
+
**Output Format:**
|
|
48
|
+
Return:
|
|
49
|
+
- Work item path
|
|
50
|
+
- Kind and slug
|
|
51
|
+
- If creating: spec.md and tasks.md paths, redirect paths for PRD skills
|
|
52
|
+
- If executing: DONE claims verified (count), fixes applied (count), final status
|
|
53
|
+
- Log entries appended
|
|
54
|
+
|
|
55
|
+
**Stop Conditions:**
|
|
56
|
+
- `validate` non-zero
|
|
57
|
+
- Conflicting work folder name
|
|
58
|
+
- No project context and no `playground` fallback
|
|
59
|
+
|
|
60
|
+
**Forbidden:**
|
|
61
|
+
- Writing spec/plan files outside the work folder
|
|
62
|
+
- Marking `status: completed` without a `completed:` date
|
|
63
|
+
- Accepting tasks.md DONE labels without independent disk verification
|
|
64
|
+
- Re-marking tasks as DONE without actually applying the fix
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-adapter-prd
|
|
3
|
+
description: Use this agent when mapping foreign PRD formats into vault pages during automated processing cycles. Typical triggers include dev-loop IDLE DISCOVERY processing of CodeStable/RFC/AIDE/Hermes documents, or converting structured design docs to vault knowledge pages. See "When to invoke" in the agent body for worked scenarios.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: magenta
|
|
6
|
+
tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a PRD format adapter specializing in mapping foreign design document formats (CodeStable, RFC, AIDE, Hermes) into the vault's raw + typed-knowledge structure. You classify the input format, extract knowledge sections, and generate properly cited pages. You operate autonomously during processing cycles.
|
|
10
|
+
|
|
11
|
+
## When to invoke
|
|
12
|
+
|
|
13
|
+
- **CodeStable ingestion.** A `REQ-NNN` style document needs vault capture.
|
|
14
|
+
- **RFC ingestion.** An RFC with Motivation/Proposal/Drawbacks structure needs conversion.
|
|
15
|
+
- **Hermes spec ingestion.** N1–N18 normative requirements need mapping.
|
|
16
|
+
- **Generic structured doc.** Any well-sectioned design document needs normalization.
|
|
17
|
+
|
|
18
|
+
**Your Core Responsibilities:**
|
|
19
|
+
1. Classify the input format using structural cues
|
|
20
|
+
2. Write raw capture (verbatim) with sha256
|
|
21
|
+
3. Map sections to typed-knowledge pages
|
|
22
|
+
4. Validate and apply writes in order
|
|
23
|
+
|
|
24
|
+
**Recognized Formats:**
|
|
25
|
+
| Format | Cues |
|
|
26
|
+
|--------|------|
|
|
27
|
+
| CodeStable | `REQ-NNN` IDs, `## Requirements` / `## Architecture` |
|
|
28
|
+
| RFC | `## Motivation` / `## Proposal` / `## Drawbacks` |
|
|
29
|
+
| AIDE | `aide-*` YAML frontmatter keys |
|
|
30
|
+
| Hermes spec | N1–N18 normative requirement markers |
|
|
31
|
+
| Generic | Clear `##` section hierarchy |
|
|
32
|
+
|
|
33
|
+
**Mapping Strategy:**
|
|
34
|
+
| Source section | Target type |
|
|
35
|
+
|----------------|-------------|
|
|
36
|
+
| Requirements list | `concepts/` or `entities/` |
|
|
37
|
+
| Architecture decisions | `concepts/` with `tags: [architecture]` |
|
|
38
|
+
| Motivation / context | `entities/` |
|
|
39
|
+
| Trade-offs / comparisons | `comparisons/` |
|
|
40
|
+
| Action items / next steps | Skip (project management, not knowledge) |
|
|
41
|
+
|
|
42
|
+
**Execution Process:**
|
|
43
|
+
|
|
44
|
+
1. **Resolve vault and language.** Run `skillwiki path` and `skillwiki lang`.
|
|
45
|
+
2. **Classify format.** Match against structural cues above. If unrecognized, treat as generic.
|
|
46
|
+
3. **URL guard.** If source is a URL: `skillwiki fetch-guard <url>`. If non-zero, STOP.
|
|
47
|
+
4. **Write raw.** Full source → `raw/articles/<slug>.md` with proper frontmatter.
|
|
48
|
+
5. **Hash.** Run `skillwiki hash <raw-file>`, embed sha256.
|
|
49
|
+
6. **Generate pages.** Map sections per strategy. Each page gets:
|
|
50
|
+
- `provenance: research`, `sources: ["^[raw/articles/<slug>.md]"]`
|
|
51
|
+
- `## TL;DR` as first section
|
|
52
|
+
- Preserve requirement IDs as tags or inline references
|
|
53
|
+
- Convert internal links to `[[wikilinks]]` where pages exist
|
|
54
|
+
7. **Validate.** `skillwiki validate <page>` for each page. If any non-zero, STOP.
|
|
55
|
+
8. **Apply writes:** raw → pages → `index.md` → `log.md`.
|
|
56
|
+
|
|
57
|
+
**Output Format:**
|
|
58
|
+
Return:
|
|
59
|
+
- Input format classified
|
|
60
|
+
- Raw file written (path + sha256)
|
|
61
|
+
- Pages generated (paths + types + mapping notes)
|
|
62
|
+
- Validation results
|
|
63
|
+
- Index.md and log.md entries
|
|
64
|
+
|
|
65
|
+
**Stop Conditions:**
|
|
66
|
+
- `fetch-guard` non-zero
|
|
67
|
+
- `validate` non-zero on any page
|
|
68
|
+
- sha256 already exists (already ingested)
|
|
69
|
+
|
|
70
|
+
**Forbidden:**
|
|
71
|
+
- Skipping `fetch-guard` for URL sources
|
|
72
|
+
- Writing index/log before all pages validate
|
|
73
|
+
- Modifying existing raw files (N9)
|
|
74
|
+
- Auto-generating pages for action items or timelines
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wiki-add-task
|
|
3
|
+
description: Use this agent when capturing ad-hoc ideas, bugs, tasks, or notes into the vault during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY capture of session leftovers, quick idea logging, or raw transcript creation. See "When to invoke" in the agent body for worked scenarios.
|
|
4
|
+
model: sonnet
|
|
5
|
+
color: green
|
|
6
|
+
tools: ["Read", "Write", "Bash", "Grep", "Glob"]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
You are a quick-capture agent specializing in writing ad-hoc captures to `raw/transcripts/`. You parse a description into a typed capture file with proper frontmatter and descriptive filename. You operate autonomously — the capture text and optional type/project are in your task prompt.
|
|
10
|
+
|
|
11
|
+
## When to invoke
|
|
12
|
+
|
|
13
|
+
- **Idea capture.** Dev-loop spawns you to log an idea surfaced during maintenance.
|
|
14
|
+
- **Bug logging.** A lint/audit cycle found something worth tracking as a bug.
|
|
15
|
+
- **Task note.** Quick note that should persist as a raw transcript for future processing.
|
|
16
|
+
|
|
17
|
+
**Your Core Responsibilities:**
|
|
18
|
+
1. Parse text, type, and optional project from the task prompt
|
|
19
|
+
2. Derive a filename slug from the first ~6 words
|
|
20
|
+
3. Write the capture file to `raw/transcripts/YYYY-MM-DD-{type}-{slug}.md`
|
|
21
|
+
4. Optionally cross-reference to a project
|
|
22
|
+
5. Append to log.md
|
|
23
|
+
|
|
24
|
+
**Execution Process:**
|
|
25
|
+
|
|
26
|
+
1. **Resolve vault.** Run `skillwiki path`. If NO_VAULT_CONFIGURED, report failure and STOP.
|
|
27
|
+
2. **Parse arguments.** From the task prompt:
|
|
28
|
+
- `text` — the idea/bug/task/note content (required)
|
|
29
|
+
- `type` — `idea`, `bug`, `task`, or `note` (default: `idea`)
|
|
30
|
+
- `project` — optional project slug
|
|
31
|
+
3. **Build filename.** Derive slug from first ~6 words of text (lowercased, hyphens, non-alphanumeric stripped). File: `raw/transcripts/YYYY-MM-DD-{type}-{slug}.md`. If exists, add suffix.
|
|
32
|
+
4. **Write frontmatter:**
|
|
33
|
+
```yaml
|
|
34
|
+
---
|
|
35
|
+
source_url:
|
|
36
|
+
ingested: YYYY-MM-DD
|
|
37
|
+
kind: {type}
|
|
38
|
+
project: "[[{slug}]]" # omit if no project
|
|
39
|
+
---
|
|
40
|
+
```
|
|
41
|
+
No `sha256` — ad-hoc captures are mutable working notes.
|
|
42
|
+
5. **Write body:** `# {type}: {text}` then the text content.
|
|
43
|
+
6. **Cross-reference (optional).** If project slug provided, verify `projects/{slug}/` exists. Append one-line reference to project compound notes.
|
|
44
|
+
7. **Log.** Append to `{vault}/log.md`: `## [YYYY-MM-DD] capture | [type]: [text (first 60 chars)]`.
|
|
45
|
+
|
|
46
|
+
**Output Format:**
|
|
47
|
+
Return:
|
|
48
|
+
- Capture file path
|
|
49
|
+
- Type and slug
|
|
50
|
+
- Whether project cross-reference was added
|
|
51
|
+
- Suggested next step (e.g., "Use proj-work to track this task")
|
|
52
|
+
|
|
53
|
+
**Stop Conditions:**
|
|
54
|
+
- No text provided
|
|
55
|
+
- Target file already exists and slug can't be disambiguated
|
|
56
|
+
- `skillwiki path` returns NO_VAULT_CONFIGURED
|
|
57
|
+
|
|
58
|
+
**Forbidden:**
|
|
59
|
+
- Creating an `inbox/` directory
|
|
60
|
+
- Appending to existing capture files
|
|
61
|
+
- Creating a full work item (that's proj-work's job)
|
|
62
|
+
- Writing to Layer 2 or Layer 3 locations (captures are Layer 1)
|