@laitszkin/apollo-toolkit 2.0.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 (204) hide show
  1. package/AGENTS.md +62 -0
  2. package/CHANGELOG.md +100 -0
  3. package/LICENSE +21 -0
  4. package/README.md +144 -0
  5. package/align-project-documents/SKILL.md +94 -0
  6. package/align-project-documents/agents/openai.yaml +4 -0
  7. package/analyse-app-logs/LICENSE +21 -0
  8. package/analyse-app-logs/README.md +126 -0
  9. package/analyse-app-logs/SKILL.md +121 -0
  10. package/analyse-app-logs/agents/openai.yaml +4 -0
  11. package/analyse-app-logs/references/investigation-checklist.md +58 -0
  12. package/analyse-app-logs/references/log-signal-patterns.md +52 -0
  13. package/answering-questions-with-research/SKILL.md +46 -0
  14. package/answering-questions-with-research/agents/openai.yaml +4 -0
  15. package/bin/apollo-toolkit.js +7 -0
  16. package/commit-and-push/LICENSE +21 -0
  17. package/commit-and-push/README.md +26 -0
  18. package/commit-and-push/SKILL.md +70 -0
  19. package/commit-and-push/agents/openai.yaml +4 -0
  20. package/commit-and-push/references/branch-naming.md +15 -0
  21. package/commit-and-push/references/commit-messages.md +19 -0
  22. package/deep-research-topics/LICENSE +21 -0
  23. package/deep-research-topics/README.md +43 -0
  24. package/deep-research-topics/SKILL.md +84 -0
  25. package/deep-research-topics/agents/openai.yaml +4 -0
  26. package/develop-new-features/LICENSE +21 -0
  27. package/develop-new-features/README.md +52 -0
  28. package/develop-new-features/SKILL.md +105 -0
  29. package/develop-new-features/agents/openai.yaml +4 -0
  30. package/develop-new-features/references/testing-e2e.md +35 -0
  31. package/develop-new-features/references/testing-integration.md +42 -0
  32. package/develop-new-features/references/testing-property-based.md +44 -0
  33. package/develop-new-features/references/testing-unit.md +37 -0
  34. package/discover-edge-cases/CHANGELOG.md +19 -0
  35. package/discover-edge-cases/LICENSE +21 -0
  36. package/discover-edge-cases/README.md +87 -0
  37. package/discover-edge-cases/SKILL.md +124 -0
  38. package/discover-edge-cases/agents/openai.yaml +4 -0
  39. package/discover-edge-cases/references/architecture-edge-cases.md +41 -0
  40. package/discover-edge-cases/references/code-edge-cases.md +46 -0
  41. package/docs-to-voice/.env.example +106 -0
  42. package/docs-to-voice/CHANGELOG.md +71 -0
  43. package/docs-to-voice/LICENSE +21 -0
  44. package/docs-to-voice/README.md +118 -0
  45. package/docs-to-voice/SKILL.md +107 -0
  46. package/docs-to-voice/agents/openai.yaml +4 -0
  47. package/docs-to-voice/scripts/docs_to_voice.py +1385 -0
  48. package/docs-to-voice/scripts/docs_to_voice.sh +11 -0
  49. package/docs-to-voice/tests/test_docs_to_voice_api_max_chars.py +210 -0
  50. package/docs-to-voice/tests/test_docs_to_voice_sentence_timeline.py +115 -0
  51. package/docs-to-voice/tests/test_docs_to_voice_settings.py +43 -0
  52. package/docs-to-voice/tests/test_docs_to_voice_speech_rate.py +57 -0
  53. package/enhance-existing-features/CHANGELOG.md +35 -0
  54. package/enhance-existing-features/LICENSE +21 -0
  55. package/enhance-existing-features/README.md +54 -0
  56. package/enhance-existing-features/SKILL.md +120 -0
  57. package/enhance-existing-features/agents/openai.yaml +4 -0
  58. package/enhance-existing-features/references/e2e-tests.md +25 -0
  59. package/enhance-existing-features/references/integration-tests.md +30 -0
  60. package/enhance-existing-features/references/property-based-tests.md +33 -0
  61. package/enhance-existing-features/references/unit-tests.md +29 -0
  62. package/feature-propose/LICENSE +21 -0
  63. package/feature-propose/README.md +23 -0
  64. package/feature-propose/SKILL.md +107 -0
  65. package/feature-propose/agents/openai.yaml +4 -0
  66. package/feature-propose/references/enhancement-features.md +25 -0
  67. package/feature-propose/references/important-features.md +25 -0
  68. package/feature-propose/references/mvp-features.md +25 -0
  69. package/feature-propose/references/performance-features.md +25 -0
  70. package/financial-research/SKILL.md +208 -0
  71. package/financial-research/agents/openai.yaml +4 -0
  72. package/financial-research/assets/weekly_market_report_template.md +45 -0
  73. package/fix-github-issues/SKILL.md +98 -0
  74. package/fix-github-issues/agents/openai.yaml +4 -0
  75. package/fix-github-issues/scripts/list_issues.py +148 -0
  76. package/fix-github-issues/tests/test_list_issues.py +127 -0
  77. package/generate-spec/LICENSE +21 -0
  78. package/generate-spec/README.md +61 -0
  79. package/generate-spec/SKILL.md +96 -0
  80. package/generate-spec/agents/openai.yaml +4 -0
  81. package/generate-spec/references/templates/checklist.md +78 -0
  82. package/generate-spec/references/templates/spec.md +55 -0
  83. package/generate-spec/references/templates/tasks.md +35 -0
  84. package/generate-spec/scripts/create-specs +123 -0
  85. package/harden-app-security/CHANGELOG.md +27 -0
  86. package/harden-app-security/LICENSE +21 -0
  87. package/harden-app-security/README.md +46 -0
  88. package/harden-app-security/SKILL.md +127 -0
  89. package/harden-app-security/agents/openai.yaml +4 -0
  90. package/harden-app-security/references/agent-attack-catalog.md +117 -0
  91. package/harden-app-security/references/common-software-attack-catalog.md +168 -0
  92. package/harden-app-security/references/red-team-extreme-scenarios.md +81 -0
  93. package/harden-app-security/references/risk-checklist.md +78 -0
  94. package/harden-app-security/references/security-test-patterns-agent.md +101 -0
  95. package/harden-app-security/references/security-test-patterns-finance.md +88 -0
  96. package/harden-app-security/references/test-snippets.md +73 -0
  97. package/improve-observability/SKILL.md +114 -0
  98. package/improve-observability/agents/openai.yaml +4 -0
  99. package/learn-skill-from-conversations/CHANGELOG.md +15 -0
  100. package/learn-skill-from-conversations/LICENSE +22 -0
  101. package/learn-skill-from-conversations/README.md +47 -0
  102. package/learn-skill-from-conversations/SKILL.md +85 -0
  103. package/learn-skill-from-conversations/agents/openai.yaml +4 -0
  104. package/learn-skill-from-conversations/scripts/extract_recent_conversations.py +369 -0
  105. package/learn-skill-from-conversations/tests/test_extract_recent_conversations.py +176 -0
  106. package/learning-error-book/SKILL.md +112 -0
  107. package/learning-error-book/agents/openai.yaml +4 -0
  108. package/learning-error-book/assets/error_book_template.md +66 -0
  109. package/learning-error-book/scripts/render_markdown_to_pdf.py +367 -0
  110. package/lib/cli.js +338 -0
  111. package/lib/installer.js +225 -0
  112. package/maintain-project-constraints/SKILL.md +109 -0
  113. package/maintain-project-constraints/agents/openai.yaml +4 -0
  114. package/maintain-skill-catalog/README.md +18 -0
  115. package/maintain-skill-catalog/SKILL.md +66 -0
  116. package/maintain-skill-catalog/agents/openai.yaml +4 -0
  117. package/novel-to-short-video/CHANGELOG.md +53 -0
  118. package/novel-to-short-video/LICENSE +21 -0
  119. package/novel-to-short-video/README.md +63 -0
  120. package/novel-to-short-video/SKILL.md +233 -0
  121. package/novel-to-short-video/agents/openai.yaml +4 -0
  122. package/novel-to-short-video/references/plan-template.md +71 -0
  123. package/novel-to-short-video/references/roles-json.md +41 -0
  124. package/open-github-issue/LICENSE +21 -0
  125. package/open-github-issue/README.md +97 -0
  126. package/open-github-issue/SKILL.md +119 -0
  127. package/open-github-issue/agents/openai.yaml +4 -0
  128. package/open-github-issue/scripts/open_github_issue.py +380 -0
  129. package/open-github-issue/tests/test_open_github_issue.py +159 -0
  130. package/open-source-pr-workflow/CHANGELOG.md +32 -0
  131. package/open-source-pr-workflow/LICENSE +21 -0
  132. package/open-source-pr-workflow/README.md +23 -0
  133. package/open-source-pr-workflow/SKILL.md +123 -0
  134. package/open-source-pr-workflow/agents/openai.yaml +4 -0
  135. package/openai-text-to-image-storyboard/.env.example +10 -0
  136. package/openai-text-to-image-storyboard/CHANGELOG.md +49 -0
  137. package/openai-text-to-image-storyboard/LICENSE +21 -0
  138. package/openai-text-to-image-storyboard/README.md +99 -0
  139. package/openai-text-to-image-storyboard/SKILL.md +107 -0
  140. package/openai-text-to-image-storyboard/agents/openai.yaml +4 -0
  141. package/openai-text-to-image-storyboard/scripts/generate_storyboard_images.py +763 -0
  142. package/package.json +36 -0
  143. package/record-spending/SKILL.md +113 -0
  144. package/record-spending/agents/openai.yaml +4 -0
  145. package/record-spending/references/account-format.md +33 -0
  146. package/record-spending/references/workbook-layout.md +84 -0
  147. package/resolve-review-comments/SKILL.md +122 -0
  148. package/resolve-review-comments/agents/openai.yaml +4 -0
  149. package/resolve-review-comments/references/adoption-criteria.md +23 -0
  150. package/resolve-review-comments/scripts/review_threads.py +425 -0
  151. package/resolve-review-comments/tests/test_review_threads.py +74 -0
  152. package/review-change-set/LICENSE +21 -0
  153. package/review-change-set/README.md +55 -0
  154. package/review-change-set/SKILL.md +103 -0
  155. package/review-change-set/agents/openai.yaml +4 -0
  156. package/review-codebases/LICENSE +21 -0
  157. package/review-codebases/README.md +67 -0
  158. package/review-codebases/SKILL.md +109 -0
  159. package/review-codebases/agents/openai.yaml +4 -0
  160. package/scripts/install_skills.ps1 +283 -0
  161. package/scripts/install_skills.sh +262 -0
  162. package/scripts/validate_openai_agent_config.py +194 -0
  163. package/scripts/validate_skill_frontmatter.py +110 -0
  164. package/specs-to-project-docs/LICENSE +21 -0
  165. package/specs-to-project-docs/README.md +57 -0
  166. package/specs-to-project-docs/SKILL.md +111 -0
  167. package/specs-to-project-docs/agents/openai.yaml +4 -0
  168. package/specs-to-project-docs/references/templates/architecture.md +29 -0
  169. package/specs-to-project-docs/references/templates/configuration.md +29 -0
  170. package/specs-to-project-docs/references/templates/developer-guide.md +33 -0
  171. package/specs-to-project-docs/references/templates/docs-index.md +39 -0
  172. package/specs-to-project-docs/references/templates/features.md +25 -0
  173. package/specs-to-project-docs/references/templates/getting-started.md +38 -0
  174. package/specs-to-project-docs/references/templates/readme.md +49 -0
  175. package/systematic-debug/LICENSE +21 -0
  176. package/systematic-debug/README.md +81 -0
  177. package/systematic-debug/SKILL.md +59 -0
  178. package/systematic-debug/agents/openai.yaml +4 -0
  179. package/text-to-short-video/.env.example +36 -0
  180. package/text-to-short-video/LICENSE +21 -0
  181. package/text-to-short-video/README.md +82 -0
  182. package/text-to-short-video/SKILL.md +221 -0
  183. package/text-to-short-video/agents/openai.yaml +4 -0
  184. package/text-to-short-video/scripts/enforce_video_aspect_ratio.py +350 -0
  185. package/version-release/CHANGELOG.md +53 -0
  186. package/version-release/LICENSE +21 -0
  187. package/version-release/README.md +28 -0
  188. package/version-release/SKILL.md +94 -0
  189. package/version-release/agents/openai.yaml +4 -0
  190. package/version-release/references/branch-naming.md +15 -0
  191. package/version-release/references/changelog-writing.md +8 -0
  192. package/version-release/references/commit-messages.md +19 -0
  193. package/version-release/references/readme-writing.md +12 -0
  194. package/version-release/references/semantic-versioning.md +12 -0
  195. package/video-production/CHANGELOG.md +104 -0
  196. package/video-production/LICENSE +18 -0
  197. package/video-production/README.md +68 -0
  198. package/video-production/SKILL.md +213 -0
  199. package/video-production/agents/openai.yaml +4 -0
  200. package/video-production/references/plan-template.md +54 -0
  201. package/video-production/references/roles-json.md +41 -0
  202. package/weekly-financial-event-report/SKILL.md +195 -0
  203. package/weekly-financial-event-report/agents/openai.yaml +4 -0
  204. package/weekly-financial-event-report/assets/financial_event_report_template.md +53 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yamiyorunoshura
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,67 @@
1
+ # Review Codebases
2
+
3
+ A repository-wide code review skill that reads the whole codebase, prioritizes architecture findings ahead of lower-level issues, and publishes one GitHub issue per confirmed finding.
4
+
5
+ ## What this skill provides
6
+
7
+ - Full-repository review guidance instead of patch-level review only.
8
+ - A strict review ladder: architecture first, code quality second, edge cases last.
9
+ - A clear evidence bar so only confirmed findings are escalated.
10
+ - Deterministic issue publication through the `open-github-issue` dependency skill.
11
+
12
+ ## Repository structure
13
+
14
+ - `SKILL.md`: Main review workflow, prioritization rules, and output contract.
15
+ - `agents/openai.yaml`: Agent interface metadata and default prompt.
16
+ - Dependency skill: `open-github-issue` for publishing one GitHub issue per confirmed finding.
17
+
18
+ ## Installation
19
+
20
+ 1. Clone this repository.
21
+ 2. Copy this folder to your Codex skills directory:
22
+
23
+ ```bash
24
+ mkdir -p "$CODEX_HOME/skills"
25
+ cp -R review-codebases "$CODEX_HOME/skills/review-codebases"
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ Invoke the skill in your prompt:
31
+
32
+ ```text
33
+ Use $review-codebases to read this repository end to end, prioritize architecture problems first, and publish one GitHub issue per confirmed finding.
34
+ ```
35
+
36
+ ## Review order
37
+
38
+ 1. Architecture and system design
39
+ 2. Code quality and maintainability
40
+ 3. Edge cases and robustness
41
+
42
+ The skill only advances to the next tier when the previous tier has no confirmed findings.
43
+
44
+ ## GitHub issue handoff
45
+
46
+ For each confirmed finding, delegate publication to `$open-github-issue` with:
47
+
48
+ - a tier-specific title prefix
49
+ - repository evidence and impact in `problem-description`
50
+ - file references and causal reasoning in `suspected-cause`
51
+ - reproduction conditions when known
52
+
53
+ If issue publication is unavailable, return draft issue content instead of switching to an ad-hoc publishing path.
54
+
55
+ ## Output expectations
56
+
57
+ The skill is designed to return:
58
+
59
+ 1. Codebase coverage and explicit exclusions
60
+ 2. Review tier reached and why lower tiers were skipped
61
+ 3. Confirmed findings with evidence, impact, and confidence
62
+ 4. GitHub issue publication status for each finding
63
+ 5. Deferred follow-up when higher-tier issues stop deeper review
64
+
65
+ ## License
66
+
67
+ MIT. See `LICENSE`.
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: review-codebases
3
+ description: Repository-wide code review workflow that requires reading the full codebase before judging, prioritizes architecture findings over implementation details, and publishes one GitHub issue per confirmed finding through open-github-issue. Use when users ask for a code review, repository audit, architecture review, maintainability review, or complete codebase inspection.
4
+ ---
5
+
6
+ # Review Codebases
7
+
8
+ ## Dependencies
9
+
10
+ - Required: none.
11
+ - Conditional: `open-github-issue` when confirmed findings should be tracked as GitHub issues.
12
+ - Optional: none.
13
+ - Fallback: If publication is needed and `open-github-issue` is unavailable, return draft issue bodies instead of inventing another publisher.
14
+
15
+ ## Standards
16
+
17
+ - Evidence: Read the full human-authored repository before judging and cite concrete files for every finding.
18
+ - Execution: Review architecture first, code quality second, and edge cases last, stopping when a higher-priority tier has confirmed findings.
19
+ - Quality: Prefer root-cause findings over scattered symptoms, merge duplicates, and keep hypotheses out of published results.
20
+ - Output: Return coverage, review tier reached, confirmed findings, publication status, and deferred lower-tier follow-up.
21
+
22
+ ## Overview
23
+
24
+ Use this skill to review an entire repository before making judgments.
25
+
26
+ The review order is strict:
27
+
28
+ 1. Architecture and system design
29
+ 2. Code quality and maintainability
30
+ 3. Edge cases and robustness gaps
31
+
32
+ Only continue to the next level when the current level has no confirmed findings.
33
+
34
+ ## Core rules
35
+
36
+ - Read the full repository before judging any design or implementation choice.
37
+ - Inspect every human-authored file that affects behavior: source code, tests, build scripts, configuration, migrations, and key docs.
38
+ - For generated, vendored, or snapshot files, verify what they are first; exclude them from deep review only when that status is clear, and list those exclusions explicitly.
39
+ - Do not speculate. Every finding must cite concrete files and causal reasoning.
40
+ - Prefer root-cause findings over scattered symptoms or style nits.
41
+ - Merge duplicate symptoms into one finding when they come from the same underlying issue.
42
+
43
+ ## Workflow
44
+
45
+ 1. Map the repository
46
+ - List top-level directories and identify entrypoints, domain modules, test suites, configuration, scripts, and generated/vendor areas.
47
+ - Record any files or folders excluded from deep review and why.
48
+ 2. Read the whole codebase
49
+ - Read all relevant human-authored files end to end.
50
+ - Build a repository-wide model of boundaries, data flow, ownership, invariants, and failure handling.
51
+ 3. Review architecture first
52
+ - Check module boundaries, layering, hidden coupling, circular dependencies, duplicated workflows, leaky abstractions, ownership confusion, and inconsistent domain models.
53
+ - If any confirmed architecture findings exist, stop the lower-level review and report only architecture findings.
54
+ 4. Review code quality second
55
+ - Run this step only when there are no architecture findings.
56
+ - Check readability, duplication, dead code, error handling, unsafe state changes, unclear contracts, missing tests around critical logic, and maintainability risks.
57
+ - If any confirmed code-quality findings exist, stop before edge-case review and report only these findings.
58
+ 5. Review edge cases last
59
+ - Run this step only when there are no architecture or code-quality findings.
60
+ - Check null or empty inputs, boundary values, partial failures, retries, concurrency, ordering assumptions, idempotency, and invalid state transitions.
61
+ 6. Publish each confirmed finding
62
+ - Invoke `open-github-issue` once per finding.
63
+ - Use a tier-specific title prefix:
64
+ - `[Architecture] <short finding>`
65
+ - `[Code Quality] <short finding>`
66
+ - `[Edge Case] <short finding>`
67
+ - Pass these fields to the dependency skill:
68
+ - `title`
69
+ - `problem-description`: symptom, impact, and repository evidence
70
+ - `suspected-cause`: file references, causal chain, and confidence
71
+ - `reproduction`: concrete trigger or conditions when known; otherwise leave empty
72
+ - `repo`: target repository in `owner/repo` format when known
73
+
74
+ ## Evidence standard
75
+
76
+ Each finding must include:
77
+
78
+ - affected files or modules
79
+ - why the current design or code is problematic
80
+ - impact on correctness, maintenance, performance, or future change safety
81
+ - confidence level with a short reason
82
+
83
+ If evidence is incomplete, keep it as a hypothesis and do not publish a GitHub issue for it.
84
+
85
+ ## Output format
86
+
87
+ Use this structure in responses:
88
+
89
+ 1. Codebase coverage
90
+ - reviewed areas
91
+ - explicit exclusions
92
+ 2. Review tier reached
93
+ - architecture / code quality / edge cases
94
+ - why lower tiers were skipped, if applicable
95
+ 3. Confirmed findings
96
+ - title
97
+ - affected files
98
+ - evidence and reasoning
99
+ - impact
100
+ - confidence
101
+ 4. GitHub issue publication status
102
+ - publication mode (`gh-cli` / `github-token` / `draft-only`)
103
+ - created issue URL or draft output per finding
104
+ 5. Deferred follow-up
105
+ - list lower-tier checks that were intentionally not performed because a higher-tier issue already exists
106
+
107
+ ## Resources
108
+
109
+ - Dependency skill: `open-github-issue` for deterministic GitHub issue publication with auth fallback and README language detection.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Review Codebases"
3
+ short_description: "Review a whole repository and publish findings"
4
+ default_prompt: "Use $review-codebases to read the full repository, prioritize architecture findings before lower-level issues, and publish one GitHub issue per confirmed finding through $open-github-issue."
@@ -0,0 +1,283 @@
1
+ param(
2
+ [Parameter(ValueFromRemainingArguments = $true)]
3
+ [string[]]$Modes
4
+ )
5
+
6
+ Set-StrictMode -Version Latest
7
+ $ErrorActionPreference = "Stop"
8
+
9
+ function Show-Usage {
10
+ @"
11
+ Usage:
12
+ ./scripts/install_skills.ps1 [codex|openclaw|trae|all]...
13
+
14
+ Modes:
15
+ codex Install links into ~/.codex/skills
16
+ openclaw Install links into ~/.openclaw/workspace*/skills
17
+ trae Install links into ~/.trae/skills
18
+ all Install all supported targets
19
+
20
+ Optional environment overrides:
21
+ CODEX_SKILLS_DIR Override codex skills destination path
22
+ OPENCLAW_HOME Override openclaw home path
23
+ TRAE_SKILLS_DIR Override trae skills destination path
24
+ APOLLO_TOOLKIT_HOME Override local install path used when repo root is unavailable
25
+ APOLLO_TOOLKIT_REPO_URL Override git repository URL used when repo root is unavailable
26
+ "@
27
+ }
28
+
29
+ $ToolkitRepoUrl = if ($env:APOLLO_TOOLKIT_REPO_URL) { $env:APOLLO_TOOLKIT_REPO_URL } else { "https://github.com/LaiTszKin/apollo-toolkit.git" }
30
+ $ToolkitHome = if ($env:APOLLO_TOOLKIT_HOME) { $env:APOLLO_TOOLKIT_HOME } else { Join-Path $HOME ".apollo-toolkit" }
31
+
32
+ function Show-Banner {
33
+ @"
34
+ +------------------------------------------+
35
+ | Apollo Toolkit |
36
+ | npm installer and skill linker |
37
+ +------------------------------------------+
38
+ "@
39
+ }
40
+
41
+ function Test-RepoRoot {
42
+ param([string]$Path)
43
+
44
+ if ([string]::IsNullOrWhiteSpace($Path) -or -not (Test-Path -LiteralPath $Path -PathType Container)) {
45
+ return $false
46
+ }
47
+
48
+ $dirs = Get-ChildItem -Path $Path -Directory -ErrorAction SilentlyContinue
49
+ foreach ($dir in $dirs) {
50
+ if (Test-Path -LiteralPath (Join-Path $dir.FullName "SKILL.md") -PathType Leaf) {
51
+ return $true
52
+ }
53
+ }
54
+
55
+ return $false
56
+ }
57
+
58
+ function Bootstrap-RepoIfNeeded {
59
+ if (Test-Path -LiteralPath (Join-Path $ToolkitHome ".git") -PathType Container) {
60
+ git -C $ToolkitHome pull --ff-only | Out-Null
61
+ }
62
+ else {
63
+ if (Test-Path -LiteralPath $ToolkitHome) {
64
+ Remove-Item -LiteralPath $ToolkitHome -Force -Recurse
65
+ }
66
+ git clone --depth 1 $ToolkitRepoUrl $ToolkitHome | Out-Null
67
+ }
68
+ }
69
+
70
+ $scriptPath = $MyInvocation.MyCommand.Path
71
+ $candidateRepoRoot = $null
72
+
73
+ if (-not [string]::IsNullOrWhiteSpace($scriptPath)) {
74
+ $scriptDir = Split-Path -Parent $scriptPath
75
+ $candidateRepoRoot = Split-Path -Parent $scriptDir
76
+ }
77
+
78
+ if (Test-RepoRoot -Path $candidateRepoRoot) {
79
+ $RepoRoot = $candidateRepoRoot
80
+ }
81
+ elseif (Test-RepoRoot -Path (Get-Location).Path) {
82
+ $RepoRoot = (Get-Location).Path
83
+ }
84
+ else {
85
+ Bootstrap-RepoIfNeeded
86
+ $RepoRoot = $ToolkitHome
87
+ }
88
+
89
+ function Get-SkillPaths {
90
+ $dirs = Get-ChildItem -Path $RepoRoot -Directory | Sort-Object Name
91
+ $skills = @()
92
+
93
+ foreach ($dir in $dirs) {
94
+ if (Test-Path -LiteralPath (Join-Path $dir.FullName "SKILL.md") -PathType Leaf) {
95
+ $skills += $dir.FullName
96
+ }
97
+ }
98
+
99
+ if ($skills.Count -eq 0) {
100
+ throw "No skill folders found in: $RepoRoot"
101
+ }
102
+
103
+ return $skills
104
+ }
105
+
106
+ function Add-ModeOnce {
107
+ param(
108
+ [System.Collections.Generic.List[string]]$Selected,
109
+ [string]$Mode
110
+ )
111
+
112
+ if (-not $Selected.Contains($Mode)) {
113
+ $Selected.Add($Mode)
114
+ }
115
+ }
116
+
117
+ function Resolve-Modes {
118
+ param([string[]]$Requested)
119
+
120
+ $selected = [System.Collections.Generic.List[string]]::new()
121
+
122
+ if ($Requested.Count -eq 0) {
123
+ Show-Banner
124
+ Write-Host ""
125
+ Write-Host "Select install options (comma-separated):"
126
+ Write-Host "1) codex (~/.codex/skills)"
127
+ Write-Host "2) openclaw (~/.openclaw/workspace*/skills)"
128
+ Write-Host "3) trae (~/.trae/skills)"
129
+ Write-Host "4) all"
130
+ $inputValue = Read-Host "Enter choice(s) [1-4]"
131
+
132
+ foreach ($rawChoice in ($inputValue -split ",")) {
133
+ $choice = $rawChoice.Trim()
134
+ switch ($choice) {
135
+ "1" { Add-ModeOnce -Selected $selected -Mode "codex" }
136
+ "2" { Add-ModeOnce -Selected $selected -Mode "openclaw" }
137
+ "3" { Add-ModeOnce -Selected $selected -Mode "trae" }
138
+ "4" {
139
+ Add-ModeOnce -Selected $selected -Mode "codex"
140
+ Add-ModeOnce -Selected $selected -Mode "openclaw"
141
+ Add-ModeOnce -Selected $selected -Mode "trae"
142
+ }
143
+ default {
144
+ throw "Invalid choice: $choice"
145
+ }
146
+ }
147
+ }
148
+ }
149
+ else {
150
+ foreach ($mode in $Requested) {
151
+ switch ($mode.ToLowerInvariant()) {
152
+ "codex" { Add-ModeOnce -Selected $selected -Mode "codex" }
153
+ "openclaw" { Add-ModeOnce -Selected $selected -Mode "openclaw" }
154
+ "trae" { Add-ModeOnce -Selected $selected -Mode "trae" }
155
+ "all" {
156
+ Add-ModeOnce -Selected $selected -Mode "codex"
157
+ Add-ModeOnce -Selected $selected -Mode "openclaw"
158
+ Add-ModeOnce -Selected $selected -Mode "trae"
159
+ }
160
+ default {
161
+ Show-Usage
162
+ throw "Invalid mode: $mode"
163
+ }
164
+ }
165
+ }
166
+ }
167
+
168
+ if ($selected.Count -eq 0) {
169
+ throw "No install option selected."
170
+ }
171
+
172
+ return $selected
173
+ }
174
+
175
+ function Remove-PathForce {
176
+ param([string]$Target)
177
+
178
+ if (Test-Path -LiteralPath $Target) {
179
+ Remove-Item -LiteralPath $Target -Force -Recurse
180
+ }
181
+ }
182
+
183
+ function Link-Skill {
184
+ param(
185
+ [string]$Source,
186
+ [string]$TargetRoot
187
+ )
188
+
189
+ $name = Split-Path -Path $Source -Leaf
190
+ $target = Join-Path $TargetRoot $name
191
+
192
+ New-Item -ItemType Directory -Path $TargetRoot -Force | Out-Null
193
+ Remove-PathForce -Target $target
194
+
195
+ try {
196
+ New-Item -Path $target -ItemType SymbolicLink -Target $Source -Force | Out-Null
197
+ Write-Host "[linked] $target -> $Source"
198
+ }
199
+ catch {
200
+ # Fallback for environments where symlink permission is restricted.
201
+ New-Item -Path $target -ItemType Junction -Target $Source -Force | Out-Null
202
+ Write-Host "[linked-junction] $target -> $Source"
203
+ }
204
+ }
205
+
206
+ function Install-Codex {
207
+ param([string[]]$SkillPaths)
208
+
209
+ $target = if ($env:CODEX_SKILLS_DIR) {
210
+ $env:CODEX_SKILLS_DIR
211
+ }
212
+ else {
213
+ Join-Path $HOME ".codex/skills"
214
+ }
215
+
216
+ Write-Host "Installing to codex: $target"
217
+ foreach ($src in $SkillPaths) {
218
+ Link-Skill -Source $src -TargetRoot $target
219
+ }
220
+ }
221
+
222
+ function Install-OpenClaw {
223
+ param([string[]]$SkillPaths)
224
+
225
+ $openclawHome = if ($env:OPENCLAW_HOME) {
226
+ $env:OPENCLAW_HOME
227
+ }
228
+ else {
229
+ Join-Path $HOME ".openclaw"
230
+ }
231
+
232
+ if (-not (Test-Path -LiteralPath $openclawHome -PathType Container)) {
233
+ throw "OpenClaw home not found: $openclawHome"
234
+ }
235
+
236
+ $workspaces = Get-ChildItem -Path $openclawHome -Directory -Filter "workspace*" | Sort-Object Name
237
+ if ($workspaces.Count -eq 0) {
238
+ throw "No workspace directories found under: $openclawHome"
239
+ }
240
+
241
+ foreach ($workspace in $workspaces) {
242
+ $skillsDir = Join-Path $workspace.FullName "skills"
243
+ Write-Host "Installing to openclaw workspace: $skillsDir"
244
+ foreach ($src in $SkillPaths) {
245
+ Link-Skill -Source $src -TargetRoot $skillsDir
246
+ }
247
+ }
248
+ }
249
+
250
+ function Install-Trae {
251
+ param([string[]]$SkillPaths)
252
+
253
+ $target = if ($env:TRAE_SKILLS_DIR) {
254
+ $env:TRAE_SKILLS_DIR
255
+ }
256
+ else {
257
+ Join-Path $HOME ".trae/skills"
258
+ }
259
+
260
+ Write-Host "Installing to trae: $target"
261
+ foreach ($src in $SkillPaths) {
262
+ Link-Skill -Source $src -TargetRoot $target
263
+ }
264
+ }
265
+
266
+ if ($Modes.Count -gt 0 -and ($Modes[0] -eq "-h" -or $Modes[0] -eq "--help")) {
267
+ Show-Usage
268
+ exit 0
269
+ }
270
+
271
+ $selectedModes = Resolve-Modes -Requested $Modes
272
+ $skillPaths = Get-SkillPaths
273
+
274
+ foreach ($mode in $selectedModes) {
275
+ switch ($mode) {
276
+ "codex" { Install-Codex -SkillPaths $skillPaths }
277
+ "openclaw" { Install-OpenClaw -SkillPaths $skillPaths }
278
+ "trae" { Install-Trae -SkillPaths $skillPaths }
279
+ default { throw "Unknown mode: $mode" }
280
+ }
281
+ }
282
+
283
+ Write-Host "Done."