skillcaddy 0.27.0

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +497 -0
  2. package/CONTEXT.md +149 -0
  3. package/LICENSE +21 -0
  4. package/README.md +499 -0
  5. package/README_CN.md +482 -0
  6. package/collection-metadata/github/mattpocock.json +16 -0
  7. package/lib/canonicalJson.js +11 -0
  8. package/lib/claudeStore.js +135 -0
  9. package/lib/collectionEnablement.js +115 -0
  10. package/lib/collectionSetup.js +199 -0
  11. package/lib/enablePlan.js +116 -0
  12. package/lib/enablementScope.js +8 -0
  13. package/lib/hermesStore.js +21 -0
  14. package/lib/libraryImage.js +1785 -0
  15. package/lib/managerInstall.js +109 -0
  16. package/lib/managerSourceWorkflow.js +234 -0
  17. package/lib/projectActions.js +24 -0
  18. package/lib/projectPath.js +51 -0
  19. package/lib/roots.js +99 -0
  20. package/lib/skillLinkStore.js +68 -0
  21. package/lib/skillMetadata.js +191 -0
  22. package/lib/skillStore.js +541 -0
  23. package/lib/sourceAcquisition.js +475 -0
  24. package/lib/sourceAcquisitionAdapter.js +47 -0
  25. package/lib/sourceAcquisitionError.js +18 -0
  26. package/lib/sourceAcquisitionPolicy.js +139 -0
  27. package/lib/sourceArchive.js +363 -0
  28. package/lib/sourceArchiveWorkspace.js +36 -0
  29. package/lib/sourceGit.js +95 -0
  30. package/lib/sourceGitAcquisitionAdapter.js +145 -0
  31. package/lib/sourceGitBatchUpdate.js +168 -0
  32. package/lib/sourceGitRepair.js +227 -0
  33. package/lib/sourceGitStaging.js +139 -0
  34. package/lib/sourceGitUpgradeAdapter.js +583 -0
  35. package/lib/sourceGitUrl.js +170 -0
  36. package/lib/sourceHttp.js +302 -0
  37. package/lib/sourceLocal.js +200 -0
  38. package/lib/sourceLocalAcquisitionAdapter.js +107 -0
  39. package/lib/sourceManager.js +242 -0
  40. package/lib/sourceMigration.js +172 -0
  41. package/lib/sourceMigrationIssue.js +6 -0
  42. package/lib/sourcePath.js +6 -0
  43. package/lib/sourcePolicy.js +53 -0
  44. package/lib/sourceRecord.js +295 -0
  45. package/lib/sourceRegistry.js +155 -0
  46. package/lib/sourceRemoteArchiveAcquisitionAdapter.js +147 -0
  47. package/lib/sourceRemoteFileAcquisitionAdapter.js +95 -0
  48. package/lib/sourceRemoteFilePolicy.js +62 -0
  49. package/lib/sourceRemoteFileWorkspace.js +55 -0
  50. package/lib/sourceSkillDiscovery.js +117 -0
  51. package/lib/sourceTree.js +185 -0
  52. package/lib/sourceUpgrade.js +596 -0
  53. package/lib/sourceUpgradeAdapter.js +41 -0
  54. package/lib/sourceUpgradePolicy.js +170 -0
  55. package/lib/sourceUpgradeTransaction.js +202 -0
  56. package/lib/sourceValidation.js +120 -0
  57. package/lib/sourceWorkspace.js +37 -0
  58. package/lib/specGate.js +235 -0
  59. package/lib/tuiActions.js +169 -0
  60. package/lib/tuiInstall.js +133 -0
  61. package/lib/tuiLayout.js +94 -0
  62. package/lib/version.js +17 -0
  63. package/lib/webManager.js +370 -0
  64. package/package.json +74 -0
  65. package/public/agentsUi.js +138 -0
  66. package/public/app.js +1431 -0
  67. package/public/claude.css +2 -0
  68. package/public/claudeUi.js +119 -0
  69. package/public/emptyState.js +12 -0
  70. package/public/enabled.css +303 -0
  71. package/public/favicon.svg +5 -0
  72. package/public/index.html +199 -0
  73. package/public/skillcaddy_CN.png +0 -0
  74. package/public/skillcaddy_EN.png +0 -0
  75. package/public/styles.css +1611 -0
  76. package/scripts/cli.js +647 -0
  77. package/scripts/cron-sync-update-git.sh +128 -0
  78. package/scripts/pull-github.sh +22 -0
  79. package/scripts/source.js +638 -0
  80. package/scripts/tui.js +1058 -0
  81. package/server.js +196 -0
  82. package/skills/skillcaddy-manager/SKILL.md +93 -0
  83. package/skills/skillcaddy-manager/agents/openai.yaml +7 -0
  84. package/skills/skillcaddy-manager/references/METADATA.md +75 -0
  85. package/skills/skillcaddy-manager/references/OPERATIONS.md +315 -0
  86. package/skills/skillcaddy-manager/references/RECOMMENDATION_GUIDE.md +51 -0
  87. package/skills/skillcaddy-manager/references/featured-skills.json +564 -0
  88. package/skills/skillcaddy-manager/references/skill-platforms.json +48 -0
  89. package/skills/skillcaddy-manager/scripts/check-conflicts.cjs +117 -0
  90. package/skills/skillcaddy-manager/scripts/check-global-skills.cjs +169 -0
  91. package/skills/skillcaddy-manager/scripts/translate-skill-notes.cjs +297 -0
  92. package/skills/skillcaddy-manager/scripts/version-manager.cjs +146 -0
  93. package/skills/skillcaddy-manager/scripts/view-recommendations.cjs +279 -0
  94. package/skills/skillcaddy-manager/skillcaddy.json +9 -0
  95. package/skills/spec-pipeline/spec-direction-gate/SKILL.md +119 -0
  96. package/skills/spec-pipeline/spec-direction-gate/check-approval.py +110 -0
  97. package/skills/spec-pipeline/spec-draft-intake/SKILL.md +116 -0
  98. package/skills/spec-pipeline/spec-role-contract/SKILL.md +113 -0
  99. package/skills/spec-pipeline/spec-role-contract/check-roles.py +108 -0
@@ -0,0 +1,128 @@
1
+ #!/bin/bash
2
+ # Hermes cron entrypoint for skillcaddy source update-git.
3
+ # Runs the unified Git source updater against all registered Git sources,
4
+ # auto-repairs source-collision failures, and prints a compact
5
+ # diff-style summary suitable for Telegram delivery.
6
+
7
+ set -uo pipefail
8
+
9
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ REPO_ROOT="${SKILLCADDY_ROOT:-$(cd "${SCRIPT_DIR}/.." && pwd)}"
11
+ PROJECT="${SKILLCADDY_PROJECT:-${HOME}/playground/hermes}"
12
+
13
+ cd "${REPO_ROOT}" || {
14
+ echo "ERROR: cannot cd to ${REPO_ROOT}"
15
+ exit 1
16
+ }
17
+
18
+ ts="$(date '+%Y-%m-%d %H:%M:%S %Z')"
19
+
20
+ echo "=== skillcaddy sync ==="
21
+ echo "时间: ${ts}"
22
+ echo "项目: ${PROJECT}"
23
+ echo
24
+
25
+ run_update() {
26
+ raw="$(npm run --silent source -- update-git --project "${PROJECT}" 2>&1)"
27
+ update_exit=$?
28
+ }
29
+
30
+ run_update
31
+
32
+ # Pull the bracketed repo paths into one list per category.
33
+ collect() {
34
+ printf '%s\n' "${raw}" \
35
+ | grep -oE '^\[(updated|failed|dirty|current|breaking)\] [^ ]+' \
36
+ | awk -v cat="$1" '$1=="["cat"]" {sub(/^\[[^]]+\] /, ""); print}' \
37
+ | sort -u
38
+ }
39
+
40
+ updated=( $(collect updated) )
41
+ failed=( $(collect failed) )
42
+ dirty=( $(collect dirty) )
43
+ current=( $(collect current) )
44
+ breaking=( $(collect breaking) )
45
+
46
+ collect_failed_category() {
47
+ printf '%s\n' "${raw}" \
48
+ | awk -v category="$1" '
49
+ /^\[failed\]/ {
50
+ actual=$3
51
+ gsub(/[()]/, "", actual)
52
+ if (actual == category) print $2
53
+ }
54
+ ' \
55
+ | sort -u
56
+ }
57
+
58
+ # Auto-repair source-collision failures (commit record out of sync with local repo).
59
+ repair_results=()
60
+ collision_failed=( $(collect_failed_category source-collision) )
61
+ repaired_count=0
62
+ if [[ ${#collision_failed[@]} -gt 0 ]]; then
63
+ while IFS= read -r sid; do
64
+ [[ -z "${sid}" ]] && continue
65
+ repair_out="$(npm run --silent source -- repair "${sid}" --yes --project "${PROJECT}" 2>&1)"
66
+ if printf '%s' "${repair_out}" | grep -q "Outcome: repaired"; then
67
+ new_commit="$(printf '%s' "${repair_out}" | awk '/^commit:/ {print $2; exit}')"
68
+ repair_results+=("repaired ${sid} -> ${new_commit}")
69
+ repaired_count=$((repaired_count + 1))
70
+ else
71
+ repair_outcome="$(printf '%s' "${repair_out}" | awk '/^Outcome:/ {print $2; exit}')"
72
+ repair_results+=("repair-blocked ${sid}${repair_outcome:+ (${repair_outcome})}")
73
+ fi
74
+ done < <(printf '%s\n' "${collision_failed[@]}")
75
+ fi
76
+
77
+ # Re-run update-git to refresh counters after repairs (collisions should be gone).
78
+ if [[ ${repaired_count} -gt 0 ]]; then
79
+ echo "--- 修复后复核 ---"
80
+ run_update
81
+ updated=( $(collect updated) )
82
+ failed=( $(collect failed) )
83
+ dirty=( $(collect dirty) )
84
+ current=( $(collect current) )
85
+ breaking=( $(collect breaking) )
86
+ fi
87
+
88
+ summary=$(printf '%s' "${raw}" | grep -E '^Git source summary:' | tail -n 1 | sed 's/^Git source summary: //')
89
+
90
+ echo "结果: ${summary:-unknown}"
91
+
92
+ if [[ ${#updated[@]} -gt 0 ]]; then
93
+ echo "更新 updated (${#updated[@]}):"
94
+ printf ' - %s\n' "${updated[@]}"
95
+ fi
96
+ if [[ ${#failed[@]} -gt 0 ]]; then
97
+ echo "失败 failed (${#failed[@]}):"
98
+ printf ' - %s\n' "${failed[@]}"
99
+ fi
100
+ if [[ ${#dirty[@]} -gt 0 ]]; then
101
+ echo "阻塞 dirty (${#dirty[@]}):"
102
+ printf ' - %s\n' "${dirty[@]}"
103
+ fi
104
+ if [[ ${#breaking[@]} -gt 0 ]]; then
105
+ echo "breaking (${#breaking[@]}):"
106
+ printf ' - %s\n' "${breaking[@]}"
107
+ fi
108
+ if [[ ${#current[@]} -gt 0 ]]; then
109
+ echo "已最新 current: ${#current[@]} 个"
110
+ fi
111
+ if [[ ${#repair_results[@]} -gt 0 ]]; then
112
+ echo
113
+ echo "自动修复 (${#repair_results[@]}):"
114
+ printf ' - %s\n' "${repair_results[@]}"
115
+ fi
116
+ if [[ ${#failed[@]} -gt 0 ]]; then
117
+ echo
118
+ echo "--- failed 详情 ---"
119
+ printf '%s\n' "${raw}" | awk '
120
+ /^\[failed\]/ {cur=$0; getline reason; if (reason ~ /^ reason:/) print cur "\n" reason; cur=""}
121
+ '
122
+ fi
123
+
124
+ if [[ ${update_exit} -ne 0 || ${#failed[@]} -gt 0 ]]; then
125
+ exit 1
126
+ fi
127
+
128
+ exit 0
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+ # Compatibility adapter for registered Git source updates.
3
+ #
4
+ # Override the target dir with $SKILLCADDY_GITHUB or the first positional arg.
5
+ # The optional second positional arg identifies the current project.
6
+
7
+ set -eu
8
+
9
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
10
+ GITHUB_ROOT="${SKILLCADDY_GITHUB:-${1:-$SCRIPT_DIR/../github}}"
11
+ PROJECT_ROOT="${SKILLCADDY_PROJECT:-${2:-$PWD}}"
12
+
13
+ if [ ! -d "$GITHUB_ROOT" ]; then
14
+ echo "github/ directory not found: $GITHUB_ROOT" >&2
15
+ echo "Set SKILLCADDY_GITHUB or pass it as the first arg." >&2
16
+ exit 1
17
+ fi
18
+
19
+ GITHUB_ROOT="$(cd "$GITHUB_ROOT" && pwd)"
20
+ LIBRARY_ROOT="$(dirname "$GITHUB_ROOT")"
21
+ SKILLCADDY_ROOT="$LIBRARY_ROOT" SKILLCADDY_PROJECT="$PROJECT_ROOT" \
22
+ node "$SCRIPT_DIR/source.js" update-git