waypoint-skills 1.3.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 (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +348 -0
  3. package/README.npm.md +56 -0
  4. package/cli/bin/cli.js +127 -0
  5. package/cli/bin/lib/paths.mjs +31 -0
  6. package/cli/bin/postinstall.mjs +25 -0
  7. package/manifest.json +107 -0
  8. package/package.json +44 -0
  9. package/packages/agents/inspiration-scout.md +105 -0
  10. package/packages/agents/orchestrator.md +186 -0
  11. package/packages/agents/scrutiny-validator.md +136 -0
  12. package/packages/agents/user-testing-validator.md +171 -0
  13. package/packages/agents/validator.md +102 -0
  14. package/packages/agents/worker.md +116 -0
  15. package/packages/agents/wp-router.md +69 -0
  16. package/packages/hooks/hooks.json.example +12 -0
  17. package/packages/hooks/templates/mission-worktree-bootstrap.sh +88 -0
  18. package/packages/hooks/templates/run-assertions.sh +48 -0
  19. package/packages/rules/adversarial-context-isolation.mdc +57 -0
  20. package/packages/rules/serial-git-enforcement.mdc +77 -0
  21. package/packages/skills/caveman/SKILL.md +78 -0
  22. package/packages/skills/design-taste-frontend/SKILL.md +1206 -0
  23. package/packages/skills/gpt-taste/SKILL.md +74 -0
  24. package/packages/skills/impeccable/SKILL.md +164 -0
  25. package/packages/skills/impeccable/reference/adapt.md +311 -0
  26. package/packages/skills/impeccable/reference/animate.md +201 -0
  27. package/packages/skills/impeccable/reference/audit.md +133 -0
  28. package/packages/skills/impeccable/reference/bolder.md +120 -0
  29. package/packages/skills/impeccable/reference/brand.md +108 -0
  30. package/packages/skills/impeccable/reference/clarify.md +288 -0
  31. package/packages/skills/impeccable/reference/codex.md +105 -0
  32. package/packages/skills/impeccable/reference/colorize.md +257 -0
  33. package/packages/skills/impeccable/reference/craft.md +123 -0
  34. package/packages/skills/impeccable/reference/critique.md +780 -0
  35. package/packages/skills/impeccable/reference/delight.md +302 -0
  36. package/packages/skills/impeccable/reference/distill.md +111 -0
  37. package/packages/skills/impeccable/reference/document.md +429 -0
  38. package/packages/skills/impeccable/reference/extract.md +69 -0
  39. package/packages/skills/impeccable/reference/harden.md +347 -0
  40. package/packages/skills/impeccable/reference/hooks.md +90 -0
  41. package/packages/skills/impeccable/reference/init.md +172 -0
  42. package/packages/skills/impeccable/reference/interaction-design.md +189 -0
  43. package/packages/skills/impeccable/reference/layout.md +161 -0
  44. package/packages/skills/impeccable/reference/live.md +718 -0
  45. package/packages/skills/impeccable/reference/onboard.md +234 -0
  46. package/packages/skills/impeccable/reference/optimize.md +258 -0
  47. package/packages/skills/impeccable/reference/overdrive.md +130 -0
  48. package/packages/skills/impeccable/reference/polish.md +241 -0
  49. package/packages/skills/impeccable/reference/product.md +60 -0
  50. package/packages/skills/impeccable/reference/quieter.md +99 -0
  51. package/packages/skills/impeccable/reference/shape.md +165 -0
  52. package/packages/skills/impeccable/reference/typeset.md +279 -0
  53. package/packages/skills/impeccable/scripts/command-metadata.json +94 -0
  54. package/packages/skills/impeccable/scripts/context-signals.mjs +225 -0
  55. package/packages/skills/impeccable/scripts/context.mjs +961 -0
  56. package/packages/skills/impeccable/scripts/critique-storage.mjs +242 -0
  57. package/packages/skills/impeccable/scripts/detect-csp.mjs +198 -0
  58. package/packages/skills/impeccable/scripts/detect.mjs +21 -0
  59. package/packages/skills/impeccable/scripts/detector/browser/injected/index.mjs +1937 -0
  60. package/packages/skills/impeccable/scripts/detector/cli/main.mjs +290 -0
  61. package/packages/skills/impeccable/scripts/detector/design-system.mjs +750 -0
  62. package/packages/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +5185 -0
  63. package/packages/skills/impeccable/scripts/detector/detect-antipatterns.mjs +50 -0
  64. package/packages/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +277 -0
  65. package/packages/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +568 -0
  66. package/packages/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1015 -0
  67. package/packages/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +234 -0
  68. package/packages/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
  69. package/packages/skills/impeccable/scripts/detector/findings.mjs +12 -0
  70. package/packages/skills/impeccable/scripts/detector/node/file-system.mjs +198 -0
  71. package/packages/skills/impeccable/scripts/detector/profile/profiler.mjs +166 -0
  72. package/packages/skills/impeccable/scripts/detector/registry/antipatterns.mjs +459 -0
  73. package/packages/skills/impeccable/scripts/detector/rules/checks.mjs +2707 -0
  74. package/packages/skills/impeccable/scripts/detector/shared/color.mjs +124 -0
  75. package/packages/skills/impeccable/scripts/detector/shared/constants.mjs +101 -0
  76. package/packages/skills/impeccable/scripts/detector/shared/inline-ignores.mjs +148 -0
  77. package/packages/skills/impeccable/scripts/detector/shared/page.mjs +7 -0
  78. package/packages/skills/impeccable/scripts/hook-admin.mjs +660 -0
  79. package/packages/skills/impeccable/scripts/hook-before-edit.mjs +476 -0
  80. package/packages/skills/impeccable/scripts/hook-lib.mjs +1632 -0
  81. package/packages/skills/impeccable/scripts/hook.mjs +61 -0
  82. package/packages/skills/impeccable/scripts/lib/design-parser.mjs +842 -0
  83. package/packages/skills/impeccable/scripts/lib/impeccable-config.mjs +638 -0
  84. package/packages/skills/impeccable/scripts/lib/impeccable-paths.mjs +128 -0
  85. package/packages/skills/impeccable/scripts/lib/is-generated.mjs +69 -0
  86. package/packages/skills/impeccable/scripts/lib/target-args.mjs +42 -0
  87. package/packages/skills/impeccable/scripts/live/browser-script-parts.mjs +49 -0
  88. package/packages/skills/impeccable/scripts/live/completion.mjs +19 -0
  89. package/packages/skills/impeccable/scripts/live/event-validation.mjs +137 -0
  90. package/packages/skills/impeccable/scripts/live/insert-ui.mjs +458 -0
  91. package/packages/skills/impeccable/scripts/live/manual-apply.mjs +939 -0
  92. package/packages/skills/impeccable/scripts/live/manual-edit-routes.mjs +357 -0
  93. package/packages/skills/impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
  94. package/packages/skills/impeccable/scripts/live/session-store.mjs +289 -0
  95. package/packages/skills/impeccable/scripts/live/svelte-component.mjs +826 -0
  96. package/packages/skills/impeccable/scripts/live/sveltekit-adapter.mjs +274 -0
  97. package/packages/skills/impeccable/scripts/live/ui-core.mjs +180 -0
  98. package/packages/skills/impeccable/scripts/live/vocabulary.mjs +36 -0
  99. package/packages/skills/impeccable/scripts/live-accept.mjs +812 -0
  100. package/packages/skills/impeccable/scripts/live-browser-dom.js +146 -0
  101. package/packages/skills/impeccable/scripts/live-browser-session.js +123 -0
  102. package/packages/skills/impeccable/scripts/live-browser.js +11173 -0
  103. package/packages/skills/impeccable/scripts/live-commit-manual-edits.mjs +1241 -0
  104. package/packages/skills/impeccable/scripts/live-complete.mjs +75 -0
  105. package/packages/skills/impeccable/scripts/live-copy-edit-agent.mjs +683 -0
  106. package/packages/skills/impeccable/scripts/live-discard-manual-edits.mjs +51 -0
  107. package/packages/skills/impeccable/scripts/live-inject.mjs +583 -0
  108. package/packages/skills/impeccable/scripts/live-insert.mjs +272 -0
  109. package/packages/skills/impeccable/scripts/live-manual-edit-evidence.mjs +363 -0
  110. package/packages/skills/impeccable/scripts/live-poll.mjs +384 -0
  111. package/packages/skills/impeccable/scripts/live-resume.mjs +94 -0
  112. package/packages/skills/impeccable/scripts/live-server.mjs +1135 -0
  113. package/packages/skills/impeccable/scripts/live-status.mjs +61 -0
  114. package/packages/skills/impeccable/scripts/live-target.mjs +30 -0
  115. package/packages/skills/impeccable/scripts/live-wrap.mjs +894 -0
  116. package/packages/skills/impeccable/scripts/live.mjs +297 -0
  117. package/packages/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  118. package/packages/skills/impeccable/scripts/palette.mjs +633 -0
  119. package/packages/skills/impeccable/scripts/pin.mjs +214 -0
  120. package/packages/skills/ponytail/SKILL.md +117 -0
  121. package/packages/skills/stitch-design-taste/DESIGN.md +121 -0
  122. package/packages/skills/stitch-design-taste/SKILL.md +184 -0
  123. package/packages/skills/waypoint/SKILL.md +67 -0
  124. package/packages/skills/wp/SKILL.md +330 -0
  125. package/packages/skills/wp/caveman-wire.md +148 -0
  126. package/packages/skills/wp/reference.md +411 -0
  127. package/scripts/detect-platform.sh +32 -0
  128. package/scripts/install.sh +123 -0
  129. package/scripts/lib/common.sh +215 -0
  130. package/scripts/sync-skills.sh +21 -0
  131. package/scripts/uninstall.sh +38 -0
  132. package/scripts/waypoint +281 -0
@@ -0,0 +1,215 @@
1
+ #!/usr/bin/env bash
2
+ # Waypoint Skills — shared install helpers
3
+ set -euo pipefail
4
+
5
+ WAYPOINT_REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
6
+
7
+ expand_path() {
8
+ local p="$1"
9
+ if [[ "$p" == "~/"* ]]; then
10
+ echo "${HOME}${p#\~}"
11
+ elif [[ "$p" == "~" ]]; then
12
+ echo "${HOME}"
13
+ else
14
+ echo "$p"
15
+ fi
16
+ }
17
+
18
+ log() { printf 'waypoint: %s\n' "$*"; }
19
+ warn() { printf 'waypoint: WARN: %s\n' "$*" >&2; }
20
+ die() { printf 'waypoint: ERROR: %s\n' "$*" >&2; exit 1; }
21
+
22
+ platform_config() {
23
+ local platform="$1" key="$2"
24
+ jq -r --arg p "$platform" --arg k "$key" '.platforms[$p][$k] // empty' "${WAYPOINT_REPO_ROOT}/manifest.json"
25
+ }
26
+
27
+ list_platforms() {
28
+ jq -r '.platforms | keys[]' "${WAYPOINT_REPO_ROOT}/manifest.json"
29
+ }
30
+
31
+ detect_installed_platforms() {
32
+ local p detected=()
33
+ for p in $(list_platforms); do
34
+ local gb lb
35
+ gb="$(platform_config "$p" global_base)"
36
+ lb="$(platform_config "$p" local_base)"
37
+ if [[ -n "$gb" && "$gb" != "null" ]]; then
38
+ gb="$(expand_path "$gb")"
39
+ [[ -d "$gb" ]] && detected+=("$p") && continue
40
+ fi
41
+ if [[ -n "$lb" && "$lb" != "null" && -d "$(expand_path "$lb")" ]]; then
42
+ detected+=("$p")
43
+ fi
44
+ done
45
+ printf '%s\n' "${detected[@]}"
46
+ }
47
+
48
+ resolve_install_base() {
49
+ local platform="$1" scope="${2:-global}"
50
+ local base
51
+ case "$scope" in
52
+ global)
53
+ base="$(platform_config "$platform" global_base)"
54
+ [[ -n "$base" && "$base" != "null" ]] || die "Platform $platform has no global install path"
55
+ ;;
56
+ local)
57
+ base="$(platform_config "$platform" local_base)"
58
+ [[ -n "$base" && "$base" != "null" ]] || die "Platform $platform has no local install path"
59
+ if [[ "$base" != .* ]]; then
60
+ die "local base must be relative: $base"
61
+ fi
62
+ base="$(pwd)/${base#./}"
63
+ ;;
64
+ *)
65
+ die "Unknown scope: $scope (use global or local)"
66
+ ;;
67
+ esac
68
+ expand_path "$base"
69
+ }
70
+
71
+ link_or_copy() {
72
+ local src="$1" dest="$2" mode="${3:-symlink}"
73
+ mkdir -p "$(dirname "$dest")"
74
+ if [[ -e "$dest" || -L "$dest" ]]; then
75
+ local src_real dest_real
76
+ src_real="$(readlink -f "$src" 2>/dev/null || realpath "$src" 2>/dev/null || echo "$src")"
77
+ dest_real="$(readlink -f "$dest" 2>/dev/null || realpath "$dest" 2>/dev/null || echo "$dest")"
78
+ if [[ "$dest_real" == "$src_real" ]]; then
79
+ return 0
80
+ fi
81
+ warn "exists, skipping: $dest"
82
+ return 0
83
+ fi
84
+ case "$mode" in
85
+ symlink) ln -s "$src" "$dest" ;;
86
+ copy) cp -R "$src" "$dest" ;;
87
+ *) die "unknown mode: $mode" ;;
88
+ esac
89
+ }
90
+
91
+ install_file() {
92
+ local src="$1" dest="$2"
93
+ mkdir -p "$(dirname "$dest")"
94
+ if [[ -f "$dest" ]]; then
95
+ warn "exists, skipping: $dest"
96
+ else
97
+ cp "$src" "$dest"
98
+ fi
99
+ }
100
+
101
+ read_manifest_skills() {
102
+ jq -r '.packages.skills[]' "${WAYPOINT_REPO_ROOT}/manifest.json"
103
+ }
104
+
105
+ read_manifest_agents() {
106
+ jq -r '.packages.agents[]' "${WAYPOINT_REPO_ROOT}/manifest.json"
107
+ }
108
+
109
+ read_manifest_rules() {
110
+ jq -r '.packages.rules[]' "${WAYPOINT_REPO_ROOT}/manifest.json"
111
+ }
112
+
113
+ read_manifest_hooks() {
114
+ jq -r '.packages.hook_templates[]' "${WAYPOINT_REPO_ROOT}/manifest.json"
115
+ }
116
+
117
+ install_platform() {
118
+ local platform="$1" scope="$2" mode="$3" repo_root="$4"
119
+ local base skills_dir agents_dir rules_dir hooks_dir rules_ext
120
+
121
+ base="$(resolve_install_base "$platform" "$scope")"
122
+ skills_dir="$(platform_config "$platform" skills)"
123
+ agents_dir="$(platform_config "$platform" agents)"
124
+ rules_dir="$(platform_config "$platform" rules)"
125
+ hooks_dir="$(platform_config "$platform" hook_templates)"
126
+ rules_ext="$(platform_config "$platform" rules_ext)"
127
+ [[ -z "$rules_ext" || "$rules_ext" == "null" ]] && rules_ext=".mdc"
128
+
129
+ local label
130
+ label="$(platform_config "$platform" label)"
131
+ log "install platform=$platform ($label) scope=$scope base=$base mode=$mode"
132
+
133
+ if [[ -n "$skills_dir" && "$skills_dir" != "null" ]]; then
134
+ mkdir -p "${base}/${skills_dir}"
135
+ for skill in $(read_manifest_skills); do
136
+ link_or_copy "${repo_root}/packages/skills/${skill}" "${base}/${skills_dir}/${skill}" "$mode"
137
+ log " skill: ${skill}"
138
+ done
139
+ fi
140
+
141
+ if [[ -n "$agents_dir" && "$agents_dir" != "null" ]]; then
142
+ mkdir -p "${base}/${agents_dir}"
143
+ for agent in $(read_manifest_agents); do
144
+ link_or_copy "${repo_root}/packages/agents/${agent}.md" "${base}/${agents_dir}/${agent}.md" "$mode"
145
+ log " agent: ${agent}"
146
+ done
147
+ fi
148
+
149
+ if [[ -n "$rules_dir" && "$rules_dir" != "null" ]]; then
150
+ mkdir -p "${base}/${rules_dir}"
151
+ for rule in $(read_manifest_rules); do
152
+ local src_ext=".mdc" dest_ext="$rules_ext"
153
+ if [[ "$platform" == "antigravity" ]]; then
154
+ install_file "${repo_root}/packages/rules/${rule}.mdc" "${base}/${rules_dir}/${rule}${dest_ext}"
155
+ else
156
+ link_or_copy "${repo_root}/packages/rules/${rule}${src_ext}" "${base}/${rules_dir}/${rule}${dest_ext}" "$mode"
157
+ fi
158
+ log " rule: ${rule}"
159
+ done
160
+ fi
161
+
162
+ if [[ -n "$hooks_dir" && "$hooks_dir" != "null" ]]; then
163
+ mkdir -p "${base}/${hooks_dir}"
164
+ for hook in $(read_manifest_hooks); do
165
+ install_file "${repo_root}/packages/hooks/templates/${hook}" "${base}/${hooks_dir}/${hook}"
166
+ chmod +x "${base}/${hooks_dir}/${hook}" 2>/dev/null || true
167
+ log " hook: ${hook}"
168
+ done
169
+ fi
170
+
171
+ echo "$base"
172
+ }
173
+
174
+ uninstall_platform() {
175
+ local platform="$1" scope="$2"
176
+ local base skills_dir agents_dir rules_dir hooks_dir rules_ext
177
+
178
+ base="$(resolve_install_base "$platform" "$scope")"
179
+ skills_dir="$(platform_config "$platform" skills)"
180
+ agents_dir="$(platform_config "$platform" agents)"
181
+ rules_dir="$(platform_config "$platform" rules)"
182
+ hooks_dir="$(platform_config "$platform" hook_templates)"
183
+ rules_ext="$(platform_config "$platform" rules_ext)"
184
+ [[ -z "$rules_ext" || "$rules_ext" == "null" ]] && rules_ext=".mdc"
185
+
186
+ log "uninstall platform=$platform scope=$scope base=$base"
187
+
188
+ remove_target() {
189
+ local path="$1"
190
+ if [[ -L "$path" ]]; then
191
+ rm -f "$path"
192
+ log " removed: $path"
193
+ elif [[ -e "$path" ]]; then
194
+ warn " not a symlink, manual remove: $path"
195
+ fi
196
+ }
197
+
198
+ if [[ -n "$skills_dir" && "$skills_dir" != "null" ]]; then
199
+ for skill in $(read_manifest_skills); do
200
+ remove_target "${base}/${skills_dir}/${skill}"
201
+ done
202
+ fi
203
+
204
+ if [[ -n "$agents_dir" && "$agents_dir" != "null" ]]; then
205
+ for agent in $(read_manifest_agents); do
206
+ remove_target "${base}/${agents_dir}/${agent}.md"
207
+ done
208
+ fi
209
+
210
+ if [[ -n "$rules_dir" && "$rules_dir" != "null" ]]; then
211
+ for rule in $(read_manifest_rules); do
212
+ remove_target "${base}/${rules_dir}/${rule}${rules_ext}"
213
+ done
214
+ fi
215
+ }
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+ # Keep skills/ in sync with packages/skills/ for npx skills add discovery.
3
+ set -euo pipefail
4
+
5
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
6
+ mkdir -p "${ROOT}/skills"
7
+
8
+ for dir in "${ROOT}/packages/skills"/*; do
9
+ [[ -d "$dir" ]] || continue
10
+ name="$(basename "$dir")"
11
+ target="../packages/skills/${name}"
12
+ link="${ROOT}/skills/${name}"
13
+ if [[ -L "$link" ]]; then
14
+ rm -f "$link"
15
+ elif [[ -e "$link" ]]; then
16
+ echo "skills/sync: skip non-symlink ${link}" >&2
17
+ continue
18
+ fi
19
+ ln -sf "$target" "$link"
20
+ echo "skills/sync: ${name}"
21
+ done
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ # Remove Waypoint Skills symlinks from AI assistant config.
3
+ set -euo pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ # shellcheck source=lib/common.sh
7
+ source "${SCRIPT_DIR}/lib/common.sh"
8
+
9
+ SCOPE="global"
10
+ PLATFORM="auto"
11
+
12
+ while [[ $# -gt 0 ]]; do
13
+ case "$1" in
14
+ --platform) PLATFORM="$2"; shift 2 ;;
15
+ --global) SCOPE="global"; shift ;;
16
+ --local) SCOPE="local"; shift ;;
17
+ -h|--help)
18
+ echo "Usage: uninstall.sh [--platform NAME|auto|all] [--global|--local]"
19
+ exit 0
20
+ ;;
21
+ *) die "Unknown option: $1" ;;
22
+ esac
23
+ done
24
+
25
+ command -v jq >/dev/null 2>&1 || die "jq required"
26
+
27
+ case "$PLATFORM" in
28
+ auto) PLATFORMS="$(detect_installed_platforms)" ;;
29
+ all) PLATFORMS="$(list_platforms)" ;;
30
+ *) PLATFORMS="$PLATFORM" ;;
31
+ esac
32
+
33
+ while IFS= read -r p; do
34
+ [[ -z "$p" ]] && continue
35
+ uninstall_platform "$p" "$SCOPE" || warn "skip $p (not installed?)"
36
+ done <<< "$PLATFORMS"
37
+
38
+ log "done"
@@ -0,0 +1,281 @@
1
+ #!/usr/bin/env bash
2
+ # waypoint — Waypoint Skills CLI (agent-callable)
3
+ #
4
+ # Usage:
5
+ # waypoint install [--platform auto|NAME] [--global|--local]
6
+ # waypoint uninstall [--platform auto] [--global|--local]
7
+ # waypoint status [--platform cursor] [--global|--local]
8
+ # waypoint doctor
9
+ # waypoint detect
10
+ # waypoint bootstrap [--mid ID] [--project-root PATH]
11
+ # waypoint instances
12
+ # waypoint instance [--mid ID]
13
+ #
14
+ set -euo pipefail
15
+
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
18
+ # shellcheck source=lib/common.sh
19
+ source "${SCRIPT_DIR}/lib/common.sh"
20
+ WAYPOINT_REPO_ROOT="$REPO_ROOT"
21
+
22
+ cmd="${1:-help}"
23
+ shift || true
24
+
25
+ case "$cmd" in
26
+ install)
27
+ exec "${SCRIPT_DIR}/install.sh" "$@"
28
+ ;;
29
+ uninstall)
30
+ exec "${SCRIPT_DIR}/uninstall.sh" "$@"
31
+ ;;
32
+ detect)
33
+ exec "${SCRIPT_DIR}/detect-platform.sh" "$@"
34
+ ;;
35
+ status)
36
+ SCOPE="global"
37
+ PLATFORM="cursor"
38
+ while [[ $# -gt 0 ]]; do
39
+ case "$1" in
40
+ --global) SCOPE="global"; shift ;;
41
+ --local) SCOPE="local"; shift ;;
42
+ --platform) PLATFORM="$2"; shift 2 ;;
43
+ *) break ;;
44
+ esac
45
+ done
46
+ BASE="$(resolve_install_base "$PLATFORM" "$SCOPE")"
47
+ skills_dir="$(platform_config "$PLATFORM" skills)"
48
+ agents_dir="$(platform_config "$PLATFORM" agents)"
49
+ rules_dir="$(platform_config "$PLATFORM" rules)"
50
+ rules_ext="$(platform_config "$PLATFORM" rules_ext)"
51
+ [[ -z "$rules_ext" || "$rules_ext" == "null" ]] && rules_ext=".mdc"
52
+ echo "Waypoint Skills status (platform=$PLATFORM scope=$SCOPE)"
53
+ echo "base: $BASE"
54
+ echo ""
55
+ printf "%-10s %-8s %s\n" "TYPE" "OK?" "PATH"
56
+ if [[ -n "$skills_dir" && "$skills_dir" != "null" ]]; then
57
+ for skill in $(read_manifest_skills); do
58
+ p="${BASE}/${skills_dir}/${skill}/SKILL.md"
59
+ [[ -f "$p" ]] && ok="yes" || ok="no"
60
+ printf "%-10s %-8s %s\n" "skill" "$ok" "$p"
61
+ done
62
+ fi
63
+ if [[ -n "$agents_dir" && "$agents_dir" != "null" ]]; then
64
+ for agent in $(read_manifest_agents); do
65
+ p="${BASE}/${agents_dir}/${agent}.md"
66
+ [[ -f "$p" ]] && ok="yes" || ok="no"
67
+ printf "%-10s %-8s %s\n" "agent" "$ok" "$p"
68
+ done
69
+ fi
70
+ if [[ -n "$rules_dir" && "$rules_dir" != "null" ]]; then
71
+ for rule in $(read_manifest_rules); do
72
+ p="${BASE}/${rules_dir}/${rule}${rules_ext}"
73
+ [[ -f "$p" ]] && ok="yes" || ok="no"
74
+ printf "%-10s %-8s %s\n" "rule" "$ok" "$p"
75
+ done
76
+ fi
77
+ ;;
78
+ doctor)
79
+ echo "Waypoint Skills doctor"
80
+ command -v jq >/dev/null 2>&1 && echo "jq: ok" || echo "jq: MISSING (required for install)"
81
+ command -v git >/dev/null 2>&1 && echo "git: ok" || echo "git: MISSING (required for worktrees)"
82
+ [[ -f "${REPO_ROOT}/manifest.json" ]] && echo "manifest: ok" || echo "manifest: MISSING"
83
+ echo ""
84
+ echo "Platforms:"
85
+ for p in $(list_platforms); do
86
+ gb="$(platform_config "$p" global_base)"
87
+ found="no"
88
+ [[ -n "$gb" && "$gb" != "null" && -d "$(expand_path "$gb")" ]] && found="yes"
89
+ echo " $(platform_config "$p" label) ($p): $found"
90
+ done
91
+ ;;
92
+ bootstrap|mission-bootstrap)
93
+ MID="default"
94
+ PROJECT_ROOT="$(pwd)"
95
+ while [[ $# -gt 0 ]]; do
96
+ case "$1" in
97
+ --mid) MID="$2"; shift 2 ;;
98
+ --project-root) PROJECT_ROOT="$2"; shift 2 ;;
99
+ *) die "unknown arg: $1" ;;
100
+ esac
101
+ done
102
+ if [[ ! "$MID" =~ ^[a-z0-9][a-z0-9-]*$ ]]; then
103
+ die "invalid mid: $MID"
104
+ fi
105
+ INST=".wp/instances/${MID}"
106
+ mkdir -p .wp/{agents,skills,hooks,instances/${MID}/handoffs}
107
+ grep -qxF '.wp/' .gitignore 2>/dev/null || echo '.wp/' >> .gitignore
108
+
109
+ ORCH_SRC="${REPO_ROOT}/packages/agents/orchestrator.md"
110
+ cp -n "$ORCH_SRC" .wp/agents/orchestrator.md 2>/dev/null || true
111
+ cp -n "${REPO_ROOT}/packages/skills/wp/caveman-wire.md" .wp/skills/ 2>/dev/null || true
112
+ cp -n "${REPO_ROOT}/packages/hooks/templates/"*.sh .wp/hooks/ 2>/dev/null || true
113
+ chmod +x .wp/hooks/*.sh 2>/dev/null || true
114
+
115
+ ISO="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
116
+
117
+ [[ -f .wp/registry.md ]] || cat >.wp/registry.md <<EOF
118
+ # Instance Registry
119
+
120
+ | mid | objective | phase | pause | worktree_root | updated |
121
+ |-----|-----------|-------|-------|---------------|---------|
122
+ EOF
123
+
124
+ if [[ ! -f "${INST}/instance_meta.md" ]]; then
125
+ WORKTREE_ROOT="$PROJECT_ROOT"
126
+ if [[ "$MID" != "default" ]] && [[ -x .wp/hooks/mission-worktree-bootstrap.sh ]]; then
127
+ .wp/hooks/mission-worktree-bootstrap.sh \
128
+ --project-root "$PROJECT_ROOT" \
129
+ --mid "$MID" \
130
+ --meta-out "${INST}/instance_meta.md" || true
131
+ if [[ -f "${INST}/instance_meta.md" ]]; then
132
+ WORKTREE_ROOT="$(grep '^\*\*worktree_root:\*\*' "${INST}/instance_meta.md" | sed 's/.*\*\* //')"
133
+ fi
134
+ else
135
+ cat >"${INST}/instance_meta.md" <<EOF
136
+ # Instance Meta
137
+
138
+ **mid:** ${MID}
139
+ **framework_version:** 1.3.0
140
+ **project_root:** ${PROJECT_ROOT}
141
+ **worktree_root:** ${PROJECT_ROOT}
142
+ **branch:** —
143
+ **worktree_parent:** —
144
+ **provisioned_at:** ${ISO}
145
+ EOF
146
+ fi
147
+ for tmpl in mission_profile validation_contract active_plan mission_control; do
148
+ [[ -f "${INST}/${tmpl}.md" ]] && continue
149
+ case "$tmpl" in
150
+ mission_profile) cat >"${INST}/${tmpl}.md" <<EOF
151
+ # Instance Profile
152
+
153
+ **mid:** ${MID}
154
+ **Objective:**
155
+
156
+ **Success definition:**
157
+
158
+ ## In scope
159
+
160
+ -
161
+
162
+ ## Out of scope
163
+
164
+ -
165
+
166
+ ## Technical boundaries
167
+ - **Allowed paths:**
168
+ - **Forbidden paths:**
169
+
170
+ ## Constraints
171
+
172
+ - **Implementation:** ponytail full
173
+ - **Inter-agent comms:** caveman wire
174
+ - **Code root:** ${WORKTREE_ROOT}
175
+
176
+ ## Open questions
177
+
178
+ -
179
+ EOF
180
+ ;;
181
+ validation_contract) cat >"${INST}/${tmpl}.md" <<EOF
182
+ # Validation Contract
183
+
184
+ **mid:** ${MID}
185
+ **Status:** draft
186
+ **Approved:** no
187
+
188
+ ## Assertions
189
+
190
+ | ID | Behavior | Verification method |
191
+ |----|----------|---------------------|
192
+ | A-01 | | |
193
+
194
+ ## Approval
195
+
196
+ Set \`Approved: yes\` after user confirms contract.
197
+ EOF
198
+ ;;
199
+ active_plan) cat >"${INST}/${tmpl}.md" <<EOF
200
+ # Active Plan
201
+
202
+ **mid:** ${MID}
203
+ **Status:** current task — | blocked — no
204
+
205
+ ## Tasks
206
+
207
+ ## Plan Changelog
208
+
209
+ | Date | Change | Reason |
210
+ |------|--------|--------|
211
+ EOF
212
+ ;;
213
+ mission_control) cat >"${INST}/${tmpl}.md" <<EOF
214
+ # Instance Control
215
+
216
+ **framework_version:** 1.3.0
217
+ **mid:** ${MID}
218
+ **bootstrapped_at:** ${ISO}
219
+ **worktree_root:** ${WORKTREE_ROOT}
220
+ **Pause:** inactive
221
+
222
+ ## Dashboard
223
+
224
+ | Metric | Value |
225
+ |--------|-------|
226
+ | Tasks complete | 0 / 0 |
227
+ | Current task | — |
228
+ | Blocked | no |
229
+
230
+ ## Ledger
231
+ EOF
232
+ ;;
233
+ esac
234
+ done
235
+ log "instance bootstrapped: ${INST}"
236
+ else
237
+ log "instance exists: ${INST}"
238
+ fi
239
+ echo "🚀 Waypoint Skills v1.3. Instance \`${MID}\` at \`${INST}/\`."
240
+ ;;
241
+ instances|mission-list)
242
+ REG=".wp/registry.md"
243
+ [[ -f "$REG" ]] && cat "$REG" || echo "No registry. Run: waypoint bootstrap"
244
+ ;;
245
+ instance|mission-status)
246
+ MID=""
247
+ while [[ $# -gt 0 ]]; do
248
+ case "$1" in
249
+ --mid) MID="$2"; shift 2 ;;
250
+ *) die "unknown arg: $1" ;;
251
+ esac
252
+ done
253
+ if [[ -z "$MID" ]]; then
254
+ "$0" instances
255
+ exit 0
256
+ fi
257
+ INST=".wp/instances/${MID}"
258
+ for f in instance_meta.md mission_profile.md validation_contract.md active_plan.md mission_control.md; do
259
+ echo "=== $f ==="
260
+ [[ -f "${INST}/${f}" ]] && cat "${INST}/${f}" || echo "(missing)"
261
+ echo ""
262
+ done
263
+ ;;
264
+ help|--help|-h)
265
+ cat <<'EOF'
266
+ Waypoint Skills CLI
267
+
268
+ waypoint install [--platform auto] [--global|--local]
269
+ waypoint uninstall [--platform auto] [--global|--local]
270
+ waypoint detect
271
+ waypoint doctor
272
+ waypoint status [--platform NAME] [--global|--local]
273
+ waypoint bootstrap [--mid ID]
274
+ waypoint instances
275
+ waypoint instance --mid ID
276
+ EOF
277
+ ;;
278
+ *)
279
+ die "unknown command: $cmd (try: waypoint help)"
280
+ ;;
281
+ esac