skillwiki 0.2.1-beta.22 → 0.2.1-beta.24
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
CHANGED
|
@@ -947,7 +947,7 @@ import { dirname as dirname3, resolve as resolve2, join as join5 } from "path";
|
|
|
947
947
|
|
|
948
948
|
// src/parsers/citations.ts
|
|
949
949
|
var FENCE2 = /```[\s\S]*?```/g;
|
|
950
|
-
var INLINE_CODE =
|
|
950
|
+
var INLINE_CODE = /``[^`\n]+``|`[^`\n]+`/g;
|
|
951
951
|
var MARKER_RE = /\^\[(raw\/[^\]]+)\]/g;
|
|
952
952
|
function stripFences(body) {
|
|
953
953
|
return body.replace(FENCE2, "").replace(INLINE_CODE, "");
|
|
@@ -979,15 +979,15 @@ function isLegacyCitationStyle(body) {
|
|
|
979
979
|
continue;
|
|
980
980
|
}
|
|
981
981
|
if (inSources) continue;
|
|
982
|
+
const matches = [...line.matchAll(MARKER_RE)];
|
|
983
|
+
if (matches.length === 0) continue;
|
|
982
984
|
const markerOnly = line.replace(MARKER_RE, "").trim();
|
|
983
|
-
if (markerOnly.length === 0
|
|
984
|
-
const
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
if (beforeFirst.length > 0 && !/[.!?]\s*$/.test(beforeFirst)) return true;
|
|
990
|
-
}
|
|
985
|
+
if (markerOnly.length === 0) return true;
|
|
986
|
+
const lastMatch = matches[matches.length - 1];
|
|
987
|
+
const afterLast = line.slice(lastMatch.index + lastMatch[0].length).replace(MARKER_RE, "").trim();
|
|
988
|
+
if (afterLast.length > 0) return true;
|
|
989
|
+
const beforeFirst = line.slice(0, matches[0].index).trim();
|
|
990
|
+
if (beforeFirst.length > 0 && !/[.!?]\s*$/.test(beforeFirst)) return true;
|
|
991
991
|
}
|
|
992
992
|
return false;
|
|
993
993
|
}
|
|
@@ -1212,7 +1212,7 @@ async function createSymlink(src, dst) {
|
|
|
1212
1212
|
async function runInstall(input) {
|
|
1213
1213
|
let entries;
|
|
1214
1214
|
try {
|
|
1215
|
-
entries = (await readdir2(input.skillsRoot, { withFileTypes: true })).filter((d) => d.isDirectory() && (d.name.startsWith("wiki-") || d.name.startsWith("proj-"))).map((d) => d.name);
|
|
1215
|
+
entries = (await readdir2(input.skillsRoot, { withFileTypes: true })).filter((d) => d.isDirectory() && (d.name.startsWith("wiki-") || d.name.startsWith("proj-") || d.name === "dev-loop-research" || d.name === "using-skillwiki")).map((d) => d.name);
|
|
1216
1216
|
} catch (e) {
|
|
1217
1217
|
return { exitCode: ExitCode.PREFLIGHT_FAILED, result: err("PREFLIGHT_FAILED", { message: String(e) }) };
|
|
1218
1218
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.24",
|
|
4
4
|
"skills": "./",
|
|
5
|
-
"description": "Project-aware Karpathy-style knowledge base for Claude Code:
|
|
5
|
+
"description": "Project-aware Karpathy-style knowledge base for Claude Code: 19 prompt-only skills (wiki-*, proj-*, dev-loop-research, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "karlorz",
|
|
8
8
|
"url": "https://github.com/karlorz"
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: 0.2.1
|
|
3
|
+
name: dev-loop-research
|
|
4
|
+
description: Standalone research agent — scans repo health and vault health, outputs prioritized work-item recommendations. Pass "high" for aggressive mode.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# dev-loop-research
|
|
8
|
+
|
|
9
|
+
Standalone invocable research agent. Scans two parallel tracks — code health
|
|
10
|
+
and vault health — cross-references findings, and outputs a prioritized
|
|
11
|
+
work-item recommendation list.
|
|
12
|
+
|
|
13
|
+
## When This Skill Activates
|
|
14
|
+
|
|
15
|
+
- User runs `/dev-loop-research` or `/dev-loop-research high`
|
|
16
|
+
- User wants a one-shot research scan of repo and vault health
|
|
17
|
+
- User schedules recurring background scans: `/loop 1h dev-loop-research`
|
|
18
|
+
- Dev-loop idle path delegates here (same logic, different trigger)
|
|
19
|
+
|
|
20
|
+
## Intensity
|
|
21
|
+
|
|
22
|
+
Parse arguments for `high` (case-insensitive). If present,
|
|
23
|
+
**intensity = high**; otherwise **intensity = normal**.
|
|
24
|
+
|
|
25
|
+
- **normal**: Output top-3 items. Suppress recurring findings that haven't
|
|
26
|
+
changed since last pass. Respect priority gates.
|
|
27
|
+
- **high**: Output top-5 items. Never suppress recurring findings. Every
|
|
28
|
+
finding is actionable regardless of priority tier. P4+ items are
|
|
29
|
+
first-class.
|
|
30
|
+
|
|
31
|
+
## Prerequisites
|
|
32
|
+
|
|
33
|
+
1. **Project config** — load `./.claude/dev-loop.config.md`. Required
|
|
34
|
+
fields: `slug`. Optional: `vault`, `cli_src`, `cli_test`,
|
|
35
|
+
`skills_glob`. If missing, prompt user to bootstrap via dev-loop.
|
|
36
|
+
2. **Resolve BACKEND_CAPS** from `knowledge_layer` config field (default:
|
|
37
|
+
`skillwiki` if vault exists, `none` otherwise).
|
|
38
|
+
3. **Resolve VAULT_TYPES** from `{vault}/SCHEMA.md` `## Layers` section —
|
|
39
|
+
extract backtick-wrapped directory names ending in `/`, exclude `raw`
|
|
40
|
+
and `project`. Store for Track B.
|
|
41
|
+
4. Read `CLAUDE.md` and user `MEMORY.md` fresh.
|
|
42
|
+
|
|
43
|
+
## Single-Pass Cycle
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
┌───────────────────────────────────────────────────────────┐
|
|
47
|
+
│ 0. REFRESH │
|
|
48
|
+
│ Load project config + read CLAUDE.md/MEMORY.md fresh │
|
|
49
|
+
├─────────────────────────┬─────────────────────────────────┤
|
|
50
|
+
│ TRACK A: CODE HEALTH │ TRACK B: VAULT HEALTH │
|
|
51
|
+
│ │ │
|
|
52
|
+
│ A1. CLI COVERAGE GAPS │ B1. RAW-TO-PAGE COVERAGE │
|
|
53
|
+
│ A2. SKILLS AUDIT │ B2. CROSS-LINK DENSITY │
|
|
54
|
+
│ A3. SPEC DRIFT │ B3. PAGE QUALITY │
|
|
55
|
+
│ A4. UNPUSHED COMMITS │ B4. TYPE COVERAGE │
|
|
56
|
+
├─────────────────────────┴─────────────────────────────────┤
|
|
57
|
+
│ 1. VAULT RETROS (cross-cutting) │
|
|
58
|
+
│ 2. SYNTHESIZE — merge + score (P0–P3, +P4 in high) │
|
|
59
|
+
│ 3. SAVE & EXIT │
|
|
60
|
+
└───────────────────────────────────────────────────────────┘
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Skip Track B entirely when `query_vault` not in BACKEND_CAPS or vault
|
|
64
|
+
is empty. Skip Track A when `cli_src` is empty.
|
|
65
|
+
|
|
66
|
+
## Track A: Code Health
|
|
67
|
+
|
|
68
|
+
### A1. CLI Coverage Gaps
|
|
69
|
+
- List `{cli_src}/*.ts`. For each: test file in `{cli_test}/`? `--human`
|
|
70
|
+
flag? Stable exit codes? `TODO/FIXME/HACK` markers?
|
|
71
|
+
- Compare counts against CLAUDE.md documented counts. Flag drift.
|
|
72
|
+
|
|
73
|
+
### A2. Skills Audit
|
|
74
|
+
- List SKILL.md files from `skills_glob`. Check: CLI subcommand
|
|
75
|
+
references exist? Description matches current behavior? Skill maps
|
|
76
|
+
list all skills correctly?
|
|
77
|
+
|
|
78
|
+
### A3. Spec Drift
|
|
79
|
+
- If canonical spec is declared, verify scope fields against current
|
|
80
|
+
code. New commands not in spec? Changed counts? New schema changes?
|
|
81
|
+
|
|
82
|
+
### A4. Unpushed Commits
|
|
83
|
+
- `git log origin/$RELEASE_BRANCH..HEAD --oneline`. Priority:
|
|
84
|
+
≥10→P1, 5-9→P2, 1-4→P4+.
|
|
85
|
+
|
|
86
|
+
## Track B: Vault Health
|
|
87
|
+
|
|
88
|
+
### B1. Raw-to-Page Coverage
|
|
89
|
+
- Run `skillwiki lint` for `wikilink_citation` warnings.
|
|
90
|
+
- Count raw files vs typed pages vs cited sources. Flag:
|
|
91
|
+
normal: uncited >50%→P1; high: uncited >20%→P1.
|
|
92
|
+
- Single-source pages: normal→P2, high→P2 always.
|
|
93
|
+
|
|
94
|
+
### B2. Cross-Link Density
|
|
95
|
+
- Count outbound `[[wikilink]]` in body region per page.
|
|
96
|
+
- normal: <2 links→P2; high: <3 links→P2.
|
|
97
|
+
- Orphan and overlap detection via `skillwiki orphans`/`overlap`.
|
|
98
|
+
|
|
99
|
+
### B3. Page Quality
|
|
100
|
+
- Count non-blank body lines (exclude headings and `---`).
|
|
101
|
+
- normal: <40 lines→thin; high: <60 lines→thin.
|
|
102
|
+
- Flag missing Overview or Related sections.
|
|
103
|
+
|
|
104
|
+
### B4. Type Coverage
|
|
105
|
+
- Page counts per type directory. Flag: entities <3, empty comparisons,
|
|
106
|
+
empty queries when >30 pages exist, empty meta when 2+ projects active.
|
|
107
|
+
- High: flag any empty type dir.
|
|
108
|
+
|
|
109
|
+
## Vault Retros (Track 1)
|
|
110
|
+
|
|
111
|
+
Scan `{vault}/log.md` for recent `Improve:` and `Generalize?: yes` entries.
|
|
112
|
+
Check `{vault}/projects/{slug}/compound/` for pending distillation work.
|
|
113
|
+
A retro's `Improve:` field that names a concrete action is a direct
|
|
114
|
+
work-item candidate.
|
|
115
|
+
|
|
116
|
+
## Synthesize (Track 2)
|
|
117
|
+
|
|
118
|
+
Score each finding:
|
|
119
|
+
|
|
120
|
+
| Score | Impact | Effort |
|
|
121
|
+
|-------|--------|--------|
|
|
122
|
+
| P0 | Spec violation or regression | Any |
|
|
123
|
+
| P1 | High — untested command, raw-to-page gap >50%, isolated pages | S/M |
|
|
124
|
+
| P2 | Medium — thin pages, skill map drift, single-source, empty type dirs | S/M |
|
|
125
|
+
| P3 | Low — code quality, cross-link improvement, section completeness | Any |
|
|
126
|
+
| P4+ | Speculative — proactive improvements, future-proofing, polish | Any |
|
|
127
|
+
|
|
128
|
+
**normal**: top-3, P0–P3 only, suppress unchanged recurring.
|
|
129
|
+
**high**: top-5, P0–P4+, never suppress recurring.
|
|
130
|
+
|
|
131
|
+
Output format per item:
|
|
132
|
+
|
|
133
|
+
```markdown
|
|
134
|
+
### #N: [title] (Px)
|
|
135
|
+
|
|
136
|
+
**Source**: [track source]
|
|
137
|
+
**What**: One-paragraph spec.
|
|
138
|
+
**Acceptance**: Bullet list of verifiable outcomes.
|
|
139
|
+
**Files**: Likely files to touch (omit for vault-only items).
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Save & Exit (Track 3)
|
|
143
|
+
|
|
144
|
+
1. Append research observation to `{vault}/log.md`:
|
|
145
|
+
```
|
|
146
|
+
## [YYYY-MM-DD HH:MM] research | dev-loop-research cycle [normal|high]
|
|
147
|
+
- Findings: [N] new, [N] recurring
|
|
148
|
+
- Vault health: raw=[N] pages=[N] cited=[N]% isolated=[N] thin=[N]
|
|
149
|
+
- Top-N: [titles]
|
|
150
|
+
```
|
|
151
|
+
2. If ranked list changed since last cycle, update user MEMORY.md with
|
|
152
|
+
research-backlog entry.
|
|
153
|
+
3. Exit with one-line summary.
|
|
154
|
+
|
|
155
|
+
## Idle Fast-Path
|
|
156
|
+
|
|
157
|
+
**Pre-idle gate (mandatory):** Before declaring idle, collect actual vault
|
|
158
|
+
health metrics from B1–B4. If any metric exceeds thresholds below, do NOT
|
|
159
|
+
report idle:
|
|
160
|
+
|
|
161
|
+
| Metric | normal | high |
|
|
162
|
+
|--------|--------|------|
|
|
163
|
+
| Uncited raw | >50% | >20% |
|
|
164
|
+
| Isolated pages | any | any (<3 links) |
|
|
165
|
+
| Thin pages | any (<40L) | any (<60L) |
|
|
166
|
+
| Empty type dirs | any (entities, comparisons) | any |
|
|
167
|
+
|
|
168
|
+
Three exit states:
|
|
169
|
+
1. **Truly idle** — zero new findings, all metrics healthy. Exit:
|
|
170
|
+
`"Research idle — no new findings."`
|
|
171
|
+
2. **Steady backlog** — no new findings, but known gaps persist. Exit:
|
|
172
|
+
`"Research steady — [N] recurring: [titles]"`
|
|
173
|
+
3. **High mode never idle** — always produce recommendations. If standard
|
|
174
|
+
checks find nothing, generate proactive suggestions.
|
|
175
|
+
|
|
176
|
+
**NEVER report idle when vault health metrics show actionable gaps.**
|
package/skills/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
version: 0.2.1
|
|
3
3
|
name: using-skillwiki
|
|
4
|
-
description: Invoke at session start or when knowledge-base tasks arise — maps all
|
|
4
|
+
description: Invoke at session start or when knowledge-base tasks arise — maps all skillwiki skills and teaches the skillwiki CLI workflow
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<SUBAGENT-STOP>
|
|
@@ -28,6 +28,7 @@ Invoke a skillwiki skill when the user:
|
|
|
28
28
|
- Asks about their skillwiki configuration or setup health
|
|
29
29
|
- Wants to sync vault changes to/from a git remote
|
|
30
30
|
- Wants to visualize the vault graph as an Obsidian Canvas
|
|
31
|
+
- Wants to run a research scan of repo and vault health
|
|
31
32
|
|
|
32
33
|
## Vault Structure
|
|
33
34
|
|
|
@@ -87,6 +88,7 @@ sha256: # computed by skillwiki hash over body bytes after closing ---
|
|
|
87
88
|
| `wiki-canvas` | Generate Obsidian Canvas visualization from vault graph data |
|
|
88
89
|
| `proj-decide` | Write an Architectural Decision Record (ADR) |
|
|
89
90
|
| `wiki-gate-plan-mode` | Toggle EnterPlanMode gating — force superpowers planning instead of built-in plan mode |
|
|
91
|
+
| `dev-loop-research` | Standalone research agent — scans repo + vault health, outputs prioritized work-item recommendations |
|
|
90
92
|
|
|
91
93
|
## CLI Backbone
|
|
92
94
|
|