skillwiki 0.8.1-beta.8 → 0.8.1
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 +380 -257
- package/package.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/skills/.codex-plugin/plugin.json +2 -1
- package/skills/README.md +10 -0
- package/skills/hooks/hooks-codex.json +16 -0
- package/skills/hooks/session-context +112 -0
- package/skills/hooks/session-start +6 -20
- package/skills/hooks/session-start-codex +15 -0
- package/skills/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.8.1
|
|
3
|
+
"version": "0.8.1",
|
|
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": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillwiki",
|
|
3
|
-
"version": "0.8.1
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Project-aware Karpathy-style knowledge base for Codex with 18 prompt-only skills backed by the deterministic skillwiki CLI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "karlorz",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"karpathy"
|
|
19
19
|
],
|
|
20
20
|
"skills": "./skills/",
|
|
21
|
+
"hooks": "./hooks/hooks-codex.json",
|
|
21
22
|
"interface": {
|
|
22
23
|
"displayName": "SkillWiki",
|
|
23
24
|
"shortDescription": "Project-aware wiki skills for Codex agents",
|
package/skills/README.md
CHANGED
|
@@ -10,3 +10,13 @@ Prompt-only Markdown skills for Claude Code. Installed via `skillwiki install`.
|
|
|
10
10
|
Each top-level skill subdirectory holds one canonical `SKILL.md`. The nested
|
|
11
11
|
`skills/<skill>/SKILL.md` tree mirrors those files for Codex plugin discovery;
|
|
12
12
|
keep it byte-for-byte in sync with the canonical top-level files.
|
|
13
|
+
|
|
14
|
+
Codex installs through `packages/codex-skills`, a materialized plugin root that
|
|
15
|
+
copies this package's `.codex-plugin/` manifest, `skills/` mirror, and
|
|
16
|
+
Codex-specific hook files. That root exposes `hooks/hooks-codex.json` and
|
|
17
|
+
`hooks/session-start-codex` without exposing the Claude default
|
|
18
|
+
`hooks/hooks.json`.
|
|
19
|
+
|
|
20
|
+
Run `npm run materialize:plugins` from the repository root after changing
|
|
21
|
+
canonical skill, agent, or hook assets. Run
|
|
22
|
+
`npm run materialize:plugins:check` for read-only drift detection.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Shared SessionStart context helpers for skillwiki hook entrypoints.
|
|
3
|
+
|
|
4
|
+
read_config_value() {
|
|
5
|
+
local file="$1"
|
|
6
|
+
local key="$2"
|
|
7
|
+
local line
|
|
8
|
+
|
|
9
|
+
line=$(grep -E "^[[:space:]]*${key}:" "$file" 2>/dev/null | head -n 1 || true)
|
|
10
|
+
[[ -n "$line" ]] || return 0
|
|
11
|
+
|
|
12
|
+
printf '%s' "$line" \
|
|
13
|
+
| sed -E "s/^[[:space:]]*${key}:[[:space:]]*//; s/[[:space:]]+#.*$//; s/[[:space:]]+$//; s/^['\"]//; s/['\"]$//"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
find_dev_loop_config() {
|
|
17
|
+
local dir="${PWD}"
|
|
18
|
+
|
|
19
|
+
while [[ -n "$dir" && "$dir" != "/" ]]; do
|
|
20
|
+
if [[ -f "${dir}/.claude/dev-loop.config.md" ]]; then
|
|
21
|
+
printf '%s' "${dir}/.claude/dev-loop.config.md"
|
|
22
|
+
return 0
|
|
23
|
+
fi
|
|
24
|
+
dir=$(dirname "$dir")
|
|
25
|
+
done
|
|
26
|
+
|
|
27
|
+
return 0
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
build_project_prd_context() {
|
|
31
|
+
local config_path
|
|
32
|
+
config_path=$(find_dev_loop_config)
|
|
33
|
+
[[ -n "$config_path" ]] || return 0
|
|
34
|
+
|
|
35
|
+
local prd_layer
|
|
36
|
+
local prd_pipeline
|
|
37
|
+
prd_layer=$(read_config_value "$config_path" "prd_layer")
|
|
38
|
+
prd_pipeline=$(read_config_value "$config_path" "prd_pipeline")
|
|
39
|
+
|
|
40
|
+
[[ -n "$prd_layer" || -n "$prd_pipeline" ]] || return 0
|
|
41
|
+
|
|
42
|
+
prd_layer="${prd_layer:-unspecified}"
|
|
43
|
+
prd_pipeline="${prd_pipeline:-unspecified}"
|
|
44
|
+
|
|
45
|
+
cat <<EOF
|
|
46
|
+
## Project PRD Mode
|
|
47
|
+
|
|
48
|
+
Detected \`.claude/dev-loop.config.md\` for this workspace:
|
|
49
|
+
- \`prd_layer\`: \`${prd_layer}\`
|
|
50
|
+
- \`prd_pipeline\`: \`${prd_pipeline}\`
|
|
51
|
+
|
|
52
|
+
Use this detected PRD mode as the source of truth. Route generated spec/plan artifacts through \`proj-work\`, and do not write them under \`docs/superpowers/\`. If \`prd_layer\` is \`superpowers\` or \`tdd\`, ensure \`EnterPlanMode\` is gated with \`wiki-gate-plan-mode\`. Do not assume \`superpowers/full\` unless the config says so.
|
|
53
|
+
EOF
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
escape_for_json() {
|
|
57
|
+
local s="$1"
|
|
58
|
+
s="${s//\\/\\\\}"
|
|
59
|
+
s="${s//\"/\\\"}"
|
|
60
|
+
s="${s//$'\n'/\\n}"
|
|
61
|
+
s="${s//$'\r'/\\r}"
|
|
62
|
+
s="${s//$'\t'/\\t}"
|
|
63
|
+
printf '%s' "$s"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
read_skill_content() {
|
|
67
|
+
local skill_path="$1"
|
|
68
|
+
cat "$skill_path" 2>/dev/null || echo "Error reading using-skillwiki skill"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
resolve_skill_path() {
|
|
72
|
+
local plugin_root="$1"
|
|
73
|
+
local skill_name="$2"
|
|
74
|
+
local candidate
|
|
75
|
+
|
|
76
|
+
for candidate in \
|
|
77
|
+
"${plugin_root}/${skill_name}/SKILL.md" \
|
|
78
|
+
"${plugin_root}/skills/${skill_name}/SKILL.md"; do
|
|
79
|
+
if [[ -f "$candidate" ]]; then
|
|
80
|
+
printf '%s' "$candidate"
|
|
81
|
+
return 0
|
|
82
|
+
fi
|
|
83
|
+
done
|
|
84
|
+
|
|
85
|
+
printf '%s' "${plugin_root}/${skill_name}/SKILL.md"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
build_skillwiki_session_context() {
|
|
89
|
+
local skill_content="$1"
|
|
90
|
+
local project_prd_context
|
|
91
|
+
local session_context
|
|
92
|
+
|
|
93
|
+
project_prd_context=$(build_project_prd_context)
|
|
94
|
+
|
|
95
|
+
session_context=$'### Skillwiki Activation\n\nSkillwiki is active for this workspace. Below are the capability guidelines for local reference:'
|
|
96
|
+
if [[ -n "$project_prd_context" ]]; then
|
|
97
|
+
session_context+=$'\n\n'
|
|
98
|
+
session_context+="$project_prd_context"
|
|
99
|
+
fi
|
|
100
|
+
session_context+=$'\n\n'
|
|
101
|
+
session_context+="$skill_content"
|
|
102
|
+
|
|
103
|
+
printf '%s' "$session_context"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
print_session_start_json() {
|
|
107
|
+
local session_context
|
|
108
|
+
session_context=$(escape_for_json "$1")
|
|
109
|
+
|
|
110
|
+
# Uses printf instead of heredoc to work around bash 5.3+ heredoc hang.
|
|
111
|
+
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
|
|
112
|
+
}
|
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# SessionStart hook for skillwiki plugin
|
|
3
|
-
# Injects using-skillwiki SKILL.md content into every conversation.
|
|
4
3
|
|
|
5
4
|
set -euo pipefail
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(cd "${SCRIPT_DIR}/.." && pwd)}"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
source "${SCRIPT_DIR}/session-context"
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
local s="$1"
|
|
15
|
-
s="${s//\\/\\\\}"
|
|
16
|
-
s="${s//\"/\\\"}"
|
|
17
|
-
s="${s//$'\n'/\\n}"
|
|
18
|
-
s="${s//$'\r'/\\r}"
|
|
19
|
-
s="${s//$'\t'/\\t}"
|
|
20
|
-
printf '%s' "$s"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
skill_escaped=$(escape_for_json "$skill_content")
|
|
24
|
-
session_context="### Skillwiki Activation\n\nSkillwiki is active for this workspace. Below are the capability guidelines for local reference:\n\n${skill_escaped}"
|
|
25
|
-
|
|
26
|
-
# Uses printf instead of heredoc to work around bash 5.3+ heredoc hang.
|
|
27
|
-
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
|
|
11
|
+
skill_content=$(read_skill_content "$(resolve_skill_path "$PLUGIN_ROOT" "using-skillwiki")")
|
|
12
|
+
session_context=$(build_skillwiki_session_context "$skill_content")
|
|
13
|
+
print_session_start_json "$session_context"
|
|
28
14
|
|
|
29
15
|
exit 0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Codex SessionStart hook for skillwiki plugin.
|
|
3
|
+
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
PLUGIN_ROOT="${PLUGIN_ROOT:-$(cd "${SCRIPT_DIR}/.." && pwd)}"
|
|
8
|
+
|
|
9
|
+
source "${SCRIPT_DIR}/session-context"
|
|
10
|
+
|
|
11
|
+
skill_content=$(read_skill_content "$(resolve_skill_path "$PLUGIN_ROOT" "using-skillwiki")")
|
|
12
|
+
session_context=$(build_skillwiki_session_context "$skill_content")
|
|
13
|
+
print_session_start_json "$session_context"
|
|
14
|
+
|
|
15
|
+
exit 0
|