jhste-skills 0.3.6 → 0.4.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.
- package/CHANGELOG.md +40 -0
- package/README.ja.md +20 -3
- package/README.ko.md +19 -2
- package/README.md +22 -5
- package/README.zh.md +20 -3
- package/cli/global.mjs +169 -0
- package/cli/index.mjs +2 -1
- package/cli/install-actions/bridge-writer.mjs +38 -1
- package/cli/install-actions/skills.mjs +85 -4
- package/cli/postinstall-global-refresh.mjs +57 -0
- package/cli/shared/files.mjs +16 -0
- package/cli/shared/templates.mjs +21 -0
- package/cli/sync-core.mjs +2 -1
- package/cli/uninstall.mjs +1 -40
- package/docs/ACCEPTANCE_CHECK.md +1 -1
- package/docs/CLI.md +20 -0
- package/docs/CONFLICT_RESOLUTION.md +1 -1
- package/package.json +2 -1
- package/scripts/docs-check-data.mjs +13 -7
- package/scripts/docs-check.mjs +3 -3
- package/scripts/smoke/connect-scenarios.mjs +2 -2
- package/scripts/smoke/global-scenarios.mjs +127 -0
- package/scripts/smoke/helpers.mjs +40 -0
- package/scripts/smoke/install-scenarios.mjs +8 -17
- package/scripts/smoke/mode-scenarios.mjs +2 -2
- package/scripts/smoke-test.mjs +3 -1
- package/scripts/vendor-check.mjs +4 -3
- package/skills/_shared/evidence-discipline.md +30 -0
- package/skills/_shared/issue-candidate.md +23 -0
- package/skills/_shared/scope-discipline.md +13 -0
- package/skills/_shared/solid-lens.md +38 -0
- package/skills/ask-jhste/SKILL.md +37 -0
- package/skills/grill-me/SKILL.md +4 -6
- package/skills/grill-with-docs/ADR-FORMAT.md +2 -44
- package/skills/grill-with-docs/CONTEXT-FORMAT.md +2 -57
- package/skills/grill-with-docs/SKILL.md +10 -82
- package/skills/implement/SKILL.md +30 -0
- package/skills/improve-codebase-architecture/DEEPENING.md +2 -34
- package/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +2 -41
- package/skills/improve-codebase-architecture/LANGUAGE.md +3 -51
- package/skills/improve-codebase-architecture/SKILL.md +26 -62
- package/skills/jhste-architecture-review/SKILL.md +3 -5
- package/skills/jhste-architecture-review/references/architecture-review.md +3 -33
- package/skills/jhste-code-quality/SKILL.md +3 -2
- package/skills/jhste-code-quality/references/code-quality.md +1 -1
- package/skills/jhste-crawler-automation/SKILL.md +1 -1
- package/skills/jhste-db-api-boundary/SKILL.md +1 -1
- package/skills/jhste-engineering-groundwork/SKILL.md +24 -95
- package/skills/jhste-long-running-work-loop/SKILL.md +25 -113
- package/skills/jhste-red-team-review/SKILL.md +23 -82
- package/skills/jhste-red-team-review/references/red-team-review.md +2 -21
- package/skills/to-issues/SKILL.md +12 -12
- package/skills/to-prd/SKILL.md +1 -1
- package/skills/triage/AGENT-BRIEF.md +40 -1
- package/skills/triage/OUT-OF-SCOPE.md +5 -1
- package/skills/triage/SKILL.md +36 -27
- package/skills/writing-great-skills/GLOSSARY.md +195 -0
- package/skills/writing-great-skills/SKILL.md +90 -0
- package/vendor/matt-pocock/NOTICE.md +1 -1
- package/vendor/matt-pocock/allowlist.json +2 -1
- package/vendor/matt-pocock/source-lock.json +38 -30
- package/skills/write-a-skill/SKILL.md +0 -125
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 - 2026-07-01
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Added `skills/_shared/` shared companion resources (`solid-lens`, `evidence-discipline`, `issue-candidate`, `scope-discipline`) as the single source for cross-cutting doctrine, cited by the jhste skills instead of restating it per skill.
|
|
7
|
+
- Added a first-class shared-resource install concept: directories under `skills/` starting with `_` are not skills (excluded from listing, selection, and missing-skill checks) but are copied alongside skills so installed `../_shared/...` references never dangle.
|
|
8
|
+
- Added `jhste-skills global` — advisory-only, user-level setup for Codex, Claude Code, and OpenCode that installs skills to `~/.jhste/skills` and writes marker-managed bridges into `~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, and `~/.config/opencode/AGENTS.md`, with no git hooks or per-repo files; `--uninstall` reverses it.
|
|
9
|
+
- Added `ask-jhste`, a user-invoked router for choosing the right jhste skill/workflow without adding always-on model context.
|
|
10
|
+
- Added OpenCode support to global setup via `~/.config/opencode/AGENTS.md`.
|
|
11
|
+
- Added a safe global-only npm postinstall refresh: after a user has opted into `jhste-skills global`, later `npm update -g jhste-skills` refreshes managed global skill copies and existing managed global bridges without creating a new setup.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Trimmed jhste skill descriptions and SKILL bodies for lower operating-context cost while preserving behavior; SKILL files now own the decision procedure and cite `_shared` doctrine, and reference files are examples/lookup only.
|
|
15
|
+
- Reduced `docs-check` to load-bearing behavior anchors (pinned once at their source) instead of exact prose/section titles; de-duplicated the triplicated issue-candidate pin to the shared doctrine.
|
|
16
|
+
- Deduplicated the `## Workflow` section in `AGENTS.md` against the managed bridge block.
|
|
17
|
+
- Extracted shared `removeManagedSkills`/manifest loading into `install-actions/skills.mjs` for reuse by `uninstall` and `global`.
|
|
18
|
+
- Made `grill-me` a user-invoked alias for `grilling` to reduce duplicate invocation surface while preserving the personal pressure-test entrypoint.
|
|
19
|
+
- Made `global` skip bridge writes when skill installation is blocked, and preflight `_shared` unmanaged conflicts before copying selected skills.
|
|
20
|
+
- Synced README translations (ko/zh/ja) with global setup, `ask-jhste`, and `_shared` companion-resource docs.
|
|
21
|
+
- Hardened `global` option validation, refused vendor-only global installs, reported invalid-manifest uninstall failures, and rejected unsafe manifest entry names before managed skill removal.
|
|
22
|
+
|
|
23
|
+
### Validation
|
|
24
|
+
- `npm test` passed (12 stages, including new `_shared` install integrity and `global` command smoke coverage).
|
|
25
|
+
|
|
26
|
+
## 0.3.7 - 2026-06-30
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- Added `implement`, a jhste-compatible implementation workflow skill for scoped PRD/issue/spec work.
|
|
30
|
+
- Added `writing-great-skills`, replacing the legacy `write-a-skill` skill with upstream skill-writing guidance.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- Refreshed Matt Pocock vendored workflow skills against upstream `43ea088`, excluding `tdd` and `resolving-merge-conflicts`.
|
|
34
|
+
- Updated `triage` to cover external PRs as a triage surface, including PR diff verification and PR-specific agent briefs.
|
|
35
|
+
- Slimmed duplicated architecture/grilling docs by routing shared vocabulary through `codebase-design`, `grilling`, and `domain-modeling`.
|
|
36
|
+
- Updated issue slicing to prefer prefactoring slices where they make later implementation easier and to represent human decisions as blockers rather than a separate HITL/AFK field.
|
|
37
|
+
- Removed managed legacy `write-a-skill` installs during sync/update; `writing-great-skills` is the replacement skill going forward.
|
|
38
|
+
|
|
39
|
+
### Validation
|
|
40
|
+
- `npm test` passed.
|
|
41
|
+
- `jhste-skills guard --scope changed --format text --fail-on error` passed with 0 warnings/errors.
|
|
42
|
+
- `git diff --check` passed.
|
|
3
43
|
## 0.3.6 - 2026-06-28
|
|
4
44
|
|
|
5
45
|
### Changed
|
package/README.ja.md
CHANGED
|
@@ -81,6 +81,19 @@ jhste-skills install
|
|
|
81
81
|
|
|
82
82
|
一度だけ試すなら `npx`、普段使う CLI として置いておきたいなら `npm install -g` を使ってください。
|
|
83
83
|
|
|
84
|
+
### Global setup(Codex + Claude Code + OpenCode、advisory-only)
|
|
85
|
+
|
|
86
|
+
リポジトリごとのファイルや git hooks を作らず、すべてのリポジトリで skills を使いたい場合は、ユーザーレベルで一度だけ設定します。
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install -g jhste-skills
|
|
90
|
+
jhste-skills global
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
このコマンドは skills と shared companion resources を `~/.jhste/skills` にコピーし、各 agent の global instruction file(`~/.claude/CLAUDE.md`、`~/.codex/AGENTS.md`、`~/.config/opencode/AGENTS.md`)に marker-managed bridge block を書き込みます。ファイルがなければ作成します。git hooks やリポジトリごとのファイルは書き込まず、guard は advisory のままです(`jhste-skills guard --scope changed`)。対象 agent は `--agents codex,claude,opencode` で選択でき、`jhste-skills global --uninstall` で削除できます。
|
|
94
|
+
|
|
95
|
+
この一度の global setup 後は、以降の `npm update -g jhste-skills` で managed skill copies と既存の managed global bridge blocks が安全に更新されます。agent やオプションを変更したい場合だけ `jhste-skills global` を再実行してください。
|
|
96
|
+
|
|
84
97
|
デフォルトインストールは Normal mode を使います。
|
|
85
98
|
|
|
86
99
|
- bundled skills 全体をインストールします: jhste core skills + vendored workflow skills。
|
|
@@ -162,6 +175,7 @@ Custom - 効果ベースの質問でセットアップ範囲を選択
|
|
|
162
175
|
| Skill | いつ使うか | 何を減らすか |
|
|
163
176
|
|---|---|---|
|
|
164
177
|
| [`setup`](skills/setup/SKILL.md)<br>install/connect/update が既存プロジェクト指示を上書きしないようにする安全セットアップ skill | kit をインストール、またはリポジトリに接続するとき | Unsafe overwrite, unmanaged hook conflict, repo instruction replacement |
|
|
178
|
+
| [`ask-jhste`](skills/ask-jhste/SKILL.md)<br>適切な jhste skill や workflow を選ぶ user-invoked router | 次にどの jhste skill/workflow を使うべきか迷うとき | Wrong workflow selection, unnecessary always-on context, accidental side effects from routing |
|
|
165
179
|
| [`jhste-engineering-groundwork`](skills/jhste-engineering-groundwork/SKILL.md)<br>コード変更前に goal、premise、scope、boundary、failure path を検証する pre-change groundwork skill | non-trivial code change の前 | Blind agreement, scope creep, unverified assumption, unclear boundary |
|
|
166
180
|
| [`jhste-code-quality`](skills/jhste-code-quality/SKILL.md)<br>input validation、observable failure handling、secret-safe logging、oversized-file review の skill | external input、failure handling、logging、env/config、code-quality review path を触るとき | Unvalidated input, silent failure, secret logging, oversized file |
|
|
167
181
|
| [`jhste-architecture-review`](skills/jhste-architecture-review/SKILL.md)<br>module boundary、side-effect placement、SOLID-informed design risk を確認する architecture review skill | module boundary、app structure、side-effect placement、responsibility split を変更するとき | Pass-through abstraction, mixed responsibility, side-effect leakage |
|
|
@@ -172,7 +186,7 @@ Custom - 効果ベースの質問でセットアップ範囲を選択
|
|
|
172
186
|
|
|
173
187
|
## Bundled workflow skills
|
|
174
188
|
|
|
175
|
-
Normal install では、Matt Pocock の [`mattpocock/skills`](https://github.com/mattpocock/skills) から vendoring した
|
|
189
|
+
Normal install では、Matt Pocock の [`mattpocock/skills`](https://github.com/mattpocock/skills) から vendoring した 14 個の workflow skills もインストールします。これらは implementation、debugging、planning、architecture、issue workflow、prototyping、handoff、skill-writing guidance に役立ちます。インストールしたくない場合は `--skill-set core` を使ってください。
|
|
176
190
|
|
|
177
191
|
| Skill | いつ使うか |
|
|
178
192
|
|---|---|
|
|
@@ -188,11 +202,12 @@ Normal install では、Matt Pocock の [`mattpocock/skills`](https://github.com
|
|
|
188
202
|
| [`to-issues`](skills/to-issues/SKILL.md)<br>計画を issue-ready vertical slices に分解する skill | implementation tickets/work breakdown が必要なとき; tracker creation は直接依頼または repo approval がある場合 |
|
|
189
203
|
| [`triage`](skills/triage/SKILL.md)<br>issue を分類し次の action を計画する triage skill | issue classification、next-action planning、repo-approved triage writes が必要なとき |
|
|
190
204
|
| [`handoff`](skills/handoff/SKILL.md)<br>次の agent や session が続けられるよう context を圧縮する handoff skill | handoff、session summary、continuation brief、next-agent context の依頼時 |
|
|
191
|
-
| [`
|
|
205
|
+
| [`implement`](skills/implement/SKILL.md)<br>jhste groundwork、verification、guard、review を使う scoped PRD/issue/spec implementation workflow skill | PRD、issue、spec、handoff から focused work を実装したいとき |
|
|
206
|
+
| [`writing-great-skills`](skills/writing-great-skills/SKILL.md)<br>predictable invocation、progressive disclosure、context load control、pruning の skill-writing reference | agent skill を作成、置換、改善したいとき |
|
|
192
207
|
|
|
193
208
|
## Attribution: Matt Pocock skills
|
|
194
209
|
|
|
195
|
-
このリポジトリは、上記
|
|
210
|
+
このリポジトリは、上記 14 個の skills を Matt Pocock の [`mattpocock/skills`](https://github.com/mattpocock/skills) から vendoring しています。
|
|
196
211
|
|
|
197
212
|
これらの skills は upstream MIT License に基づいて vendoring されています。このリポジトリは必要な copyright/license notice を保持し、インポート元を記録しています。
|
|
198
213
|
|
|
@@ -269,3 +284,5 @@ Release acceptance notes は [`docs/ACCEPTANCE_CHECK.md`](docs/ACCEPTANCE_CHECK.
|
|
|
269
284
|
- non-trivial work を完了と呼ぶ前に red-team code review を行う。
|
|
270
285
|
|
|
271
286
|
高速な agent には guardrail が必要です。`jhste-skills` は agent に repo-respecting engineering workflow を提供します。
|
|
287
|
+
|
|
288
|
+
Skills は `skills/_shared/` の cross-cutting doctrine(SOLID lens、evidence discipline、issue-candidate protocol、scope discipline)を共有します。`skills/` 配下で名前が `_` から始まるディレクトリは skill ではなく shared companion resource です。skill listing、selection、missing-skill checks からは除外されますが、どの skill をインストールしても一緒にコピーされるため、インストール済み artifact 内の cross-skill `../_shared/...` references が dangling になりません。
|
package/README.ko.md
CHANGED
|
@@ -82,6 +82,19 @@ jhste-skills install
|
|
|
82
82
|
|
|
83
83
|
한 번만 실행해보고 싶다면 `npx`를 쓰면 되고, 평소에 계속 사용할 CLI로 두고 싶다면 `npm install -g`를 쓰면 됩니다.
|
|
84
84
|
|
|
85
|
+
### Global setup (Codex + Claude Code + OpenCode, advisory-only)
|
|
86
|
+
|
|
87
|
+
레포별 파일이나 git hook 없이 모든 레포에서 skills를 쓰고 싶다면, 사용자 수준에서 한 번 설정하세요.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm install -g jhste-skills
|
|
91
|
+
jhste-skills global
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
이 명령은 skills와 shared companion resources를 `~/.jhste/skills`에 복사하고, 각 agent의 global instruction file(`~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, `~/.config/opencode/AGENTS.md`)에 marker-managed bridge block을 씁니다. 파일이 없으면 생성합니다. Git hook이나 레포별 파일은 쓰지 않으며, guard는 advisory 상태로 남습니다(`jhste-skills guard --scope changed`). Agent는 `--agents codex,claude,opencode`로 선택하고, `jhste-skills global --uninstall`로 제거할 수 있습니다.
|
|
95
|
+
|
|
96
|
+
이 최초 global setup 이후에는 `npm update -g jhste-skills`만으로 managed skill copy와 기존 managed global bridge block이 안전하게 새로고침됩니다. Agent나 옵션을 바꾸고 싶을 때만 `jhste-skills global`을 다시 실행하세요.
|
|
97
|
+
|
|
85
98
|
기본 설치는 Normal mode를 사용합니다.
|
|
86
99
|
|
|
87
100
|
- bundled skills 전체를 설치합니다: jhste core skills + vendored workflow skills.
|
|
@@ -165,6 +178,7 @@ Custom - 효과 중심 질문을 통해 설치 범위를 직접 선택
|
|
|
165
178
|
| Skill | 언제 쓰나 | 무엇을 줄여주나 |
|
|
166
179
|
|---|---|---|
|
|
167
180
|
| [`setup`](skills/setup/SKILL.md)<br>설치, 연결, 업데이트가 기존 프로젝트 지침을 덮어쓰지 않도록 하는 안전 설치 스킬 | kit를 설치하거나 레포에 연결할 때 | unsafe overwrite, unmanaged hook conflict, repo instruction replacement |
|
|
181
|
+
| [`ask-jhste`](skills/ask-jhste/SKILL.md)<br>적절한 jhste skill이나 workflow를 고르는 user-invoked router | 다음에 어떤 jhste skill/workflow를 써야 할지 확실하지 않을 때 | wrong workflow selection, unnecessary always-on context, accidental side effects from routing |
|
|
168
182
|
| [`jhste-engineering-groundwork`](skills/jhste-engineering-groundwork/SKILL.md)<br>코드 변경 전 목표, 전제, scope, boundary, failure path, final behavior predicate를 검증하는 pre-change groundwork 스킬 | non-trivial code change 전 | blind agreement, scope creep, unverified assumption, unclear boundary |
|
|
169
183
|
| [`jhste-code-quality`](skills/jhste-code-quality/SKILL.md)<br>입력 검증, 관측 가능한 실패 처리, secret-safe logging, oversized-file review 스킬 | external input, failure handling, logging, env/config, cleanup/search-replace, code-quality review path를 만질 때 | unvalidated input, silent failure, secret logging, unsafe broad cleanup, oversized file |
|
|
170
184
|
| [`jhste-architecture-review`](skills/jhste-architecture-review/SKILL.md)<br>모듈 경계, side effect 위치, SOLID-informed design risk를 검토하는 아키텍처 리뷰 스킬 | module boundary, app structure, side-effect placement, responsibility split 변경 시 | pass-through abstraction, mixed responsibility, side-effect leakage |
|
|
@@ -175,7 +189,7 @@ Custom - 효과 중심 질문을 통해 설치 범위를 직접 선택
|
|
|
175
189
|
|
|
176
190
|
## Bundled workflow skills
|
|
177
191
|
|
|
178
|
-
Normal install은 Matt Pocock의 [`mattpocock/skills`](https://github.com/mattpocock/skills)에서 vendoring한 workflow skills
|
|
192
|
+
Normal install은 Matt Pocock의 [`mattpocock/skills`](https://github.com/mattpocock/skills)에서 vendoring한 workflow skills 14개도 함께 설치합니다. 이 스킬들은 implementation, debugging, planning, architecture, issue workflow, prototyping, handoff, skill-writing guidance 작업에 유용합니다. 설치하고 싶지 않다면 `--skill-set core`를 사용하세요.
|
|
179
193
|
|
|
180
194
|
| Skill | 언제 쓰나 |
|
|
181
195
|
|---|---|
|
|
@@ -191,7 +205,8 @@ Normal install은 Matt Pocock의 [`mattpocock/skills`](https://github.com/mattpo
|
|
|
191
205
|
| [`to-issues`](skills/to-issues/SKILL.md)<br>계획을 issue-ready vertical slice로 나누는 스킬 | implementation ticket/work breakdown이 필요할 때; tracker creation은 직접 요청이나 repo approval이 있을 때 |
|
|
192
206
|
| [`triage`](skills/triage/SKILL.md)<br>issue를 분류하고 다음 행동을 계획하는 triage 스킬 | issue classification, next-action planning, repo-approved triage write가 필요할 때 |
|
|
193
207
|
| [`handoff`](skills/handoff/SKILL.md)<br>다음 agent나 session이 이어받을 수 있도록 context를 압축하는 handoff 스킬 | handoff, session summary, continuation brief, next-agent context 요청 시 |
|
|
194
|
-
| [`
|
|
208
|
+
| [`implement`](skills/implement/SKILL.md)<br>jhste groundwork, verification, guard, review를 사용하는 scoped PRD/issue/spec 구현 workflow 스킬 | PRD, issue, spec, handoff에서 focused work를 구현하고 싶을 때 |
|
|
209
|
+
| [`writing-great-skills`](skills/writing-great-skills/SKILL.md)<br>predictable invocation, progressive disclosure, context load control, pruning을 다루는 skill-writing reference | agent skill을 만들거나, 교체하거나, 다듬고 싶을 때 |
|
|
195
210
|
|
|
196
211
|
## Attribution: Matt Pocock skills
|
|
197
212
|
|
|
@@ -272,3 +287,5 @@ Release acceptance notes는 [`docs/ACCEPTANCE_CHECK.md`](docs/ACCEPTANCE_CHECK.m
|
|
|
272
287
|
- non-trivial work를 완료라고 말하기 전에 red-team code review를 수행합니다.
|
|
273
288
|
|
|
274
289
|
빠른 agent에는 guardrail이 필요합니다. `jhste-skills`는 agent에게 repo-respecting engineering workflow를 제공합니다.
|
|
290
|
+
|
|
291
|
+
Skills는 `skills/_shared/`의 cross-cutting doctrine(SOLID lens, evidence discipline, issue-candidate protocol, scope discipline)을 공유합니다. `skills/` 아래에서 이름이 `_`로 시작하는 디렉터리는 skill이 아니라 shared companion resource입니다. skill listing, selection, missing-skill check에서는 제외되지만, 어떤 skill을 설치하든 함께 복사되어 설치된 artifact 안에서 cross-skill `../_shared/...` reference가 끊어지지 않습니다.
|
package/README.md
CHANGED
|
@@ -82,7 +82,20 @@ jhste-skills install
|
|
|
82
82
|
|
|
83
83
|
Use `npx` when you want a one-off run without a global install. Use `npm install -g` when you want `jhste-skills` available as a normal shell command.
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
### Global setup (Codex + Claude Code + OpenCode, advisory-only)
|
|
86
|
+
|
|
87
|
+
If you want the skills available in every repository without per-repo files or git hooks, set up once at the user level:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm install -g jhste-skills
|
|
91
|
+
jhste-skills global
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This copies the skills (and shared companion resources) to `~/.jhste/skills` and writes a marker-managed bridge block into each agent's global instruction file (`~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, `~/.config/opencode/AGENTS.md`), creating them if needed. No git hooks and no per-repo files are written; guard stays advisory (`jhste-skills guard --scope changed`). Choose agents with `--agents codex,claude,opencode`, and remove everything with `jhste-skills global --uninstall`.
|
|
95
|
+
|
|
96
|
+
After this one-time global setup, later `npm update -g jhste-skills` runs a safe global-only refresh of the managed skill copies and existing managed global bridge blocks. Re-run `jhste-skills global` when you want to change agents or options.
|
|
97
|
+
|
|
98
|
+
The default (per-repo) install uses Normal mode.
|
|
86
99
|
|
|
87
100
|
- Installs all bundled skills: jhste core skills + vendored workflow skills.
|
|
88
101
|
- Creates `.jhste/profile.yaml` when missing; `--force` refreshes generated/managed profiles, while modified profiles require `--force --allow-profile-overwrite`.
|
|
@@ -165,6 +178,7 @@ These are the jhste-authored guardrail skills. They are installed by default as
|
|
|
165
178
|
| Skill | Use it when | What it helps reduce |
|
|
166
179
|
|---|---|---|
|
|
167
180
|
| [`setup`](skills/setup/SKILL.md)<br>A safe setup skill that prevents install/connect/update flows from overwriting existing project instructions | Installing or connecting the kit to a repository | Unsafe overwrite, unmanaged hook conflict, repo instruction replacement |
|
|
181
|
+
| [`ask-jhste`](skills/ask-jhste/SKILL.md)<br>A user-invoked router for choosing the right jhste skill or workflow | You are not sure which jhste skill or workflow to use next | Wrong workflow selection, unnecessary always-on context, accidental side effects from routing |
|
|
168
182
|
| [`jhste-engineering-groundwork`](skills/jhste-engineering-groundwork/SKILL.md)<br>A pre-change groundwork skill that verifies goal, premise, scope, boundary, failure path, and final behavior predicates before code edits | Before non-trivial code changes | Blind agreement, scope creep, unverified assumptions, unclear boundaries |
|
|
169
183
|
| [`jhste-code-quality`](skills/jhste-code-quality/SKILL.md)<br>A code-quality skill for input validation, observable failure handling, secret-safe logging, and oversized-file review | Touching external input, failure handling, logging, env/config, cleanup/search-replace, or code-quality review paths | Unvalidated input, silent failure, secret logging, unsafe broad cleanup, oversized files |
|
|
170
184
|
| [`jhste-architecture-review`](skills/jhste-architecture-review/SKILL.md)<br>An architecture review skill for module boundaries, side-effect placement, and SOLID-informed design risks | Changing module boundaries, app structure, side-effect placement, or responsibility splits | Pass-through abstraction, mixed responsibility, side-effect leakage |
|
|
@@ -175,7 +189,7 @@ These are the jhste-authored guardrail skills. They are installed by default as
|
|
|
175
189
|
|
|
176
190
|
## Bundled workflow skills
|
|
177
191
|
|
|
178
|
-
Normal install also includes
|
|
192
|
+
Normal install also includes 14 workflow skills vendored from Matt Pocock's [`mattpocock/skills`](https://github.com/mattpocock/skills). These are useful for implementation, debugging, planning, architecture, issue workflows, prototyping, handoffs, and skill-writing guidance. Use `--skill-set core` if you do not want them installed.
|
|
179
193
|
|
|
180
194
|
| Skill | Use it when |
|
|
181
195
|
|---|---|
|
|
@@ -191,11 +205,12 @@ Normal install also includes 13 workflow skills vendored from Matt Pocock's [`ma
|
|
|
191
205
|
| [`to-issues`](skills/to-issues/SKILL.md)<br>A skill that breaks a plan into issue-ready vertical slices | You want implementation tickets or work breakdown; tracker creation follows direct request or repo approval |
|
|
192
206
|
| [`triage`](skills/triage/SKILL.md)<br>An issue triage skill that classifies issues and plans next actions through a structured workflow | You want issue classification, next-action planning, or repo-approved triage writes |
|
|
193
207
|
| [`handoff`](skills/handoff/SKILL.md)<br>A handoff skill that compresses context so the next agent or session can continue | You ask for a handoff, session summary, continuation brief, or next-agent context |
|
|
194
|
-
| [`
|
|
208
|
+
| [`implement`](skills/implement/SKILL.md)<br>An implementation workflow skill for scoped PRD/issue/spec work using jhste groundwork, verification, guard, and review | You want an agent to implement focused work from a PRD, issue, spec, or handoff |
|
|
209
|
+
| [`writing-great-skills`](skills/writing-great-skills/SKILL.md)<br>A skill-writing reference for predictable invocation, progressive disclosure, context load control, and pruning | You want to create, replace, or refine an agent skill |
|
|
195
210
|
|
|
196
211
|
## Attribution: Matt Pocock skills
|
|
197
212
|
|
|
198
|
-
This repository vendors the
|
|
213
|
+
This repository vendors the 14 skills listed above from Matt Pocock's [`mattpocock/skills`](https://github.com/mattpocock/skills).
|
|
199
214
|
|
|
200
215
|
Those skills are vendored under the upstream MIT License. This repository preserves the required copyright/license notice and records the imported sources.
|
|
201
216
|
|
|
@@ -273,4 +288,6 @@ See [`docs/ACCEPTANCE_CHECK.md`](docs/ACCEPTANCE_CHECK.md) for release acceptanc
|
|
|
273
288
|
|
|
274
289
|
Fast agents need guardrails. `jhste-skills` gives them a repo-respecting engineering workflow.
|
|
275
290
|
|
|
276
|
-
|
|
291
|
+
Skills share cross-cutting doctrine (SOLID lens, evidence discipline, issue-candidate protocol, scope discipline) from `skills/_shared/`. Directories under `skills/` whose name starts with `_` are shared companion resources, not skills: they are excluded from skill listing, selection, and missing-skill checks, but are copied alongside the skills whenever any skill is installed so cross-skill `../_shared/...` references never dangle in the installed artifact.
|
|
292
|
+
|
|
293
|
+
Installed skill directories are tracked with `.jhste-skills-manifest.json`. `--force` refreshes manifest-managed skill copies and generated/managed profiles; modified profiles need `--force --allow-profile-overwrite`; overwriting unmanaged differing skill directories still requires the separate `--allow-unmanaged-skill-overwrite` flag after review. `sync` and `update` can also adopt additional known jhste skills into an already managed skills directory so older mixed installs can be reconciled without a manual overwrite flag. Legacy managed renames are also reconciled during `sync` and `update`, so older managed installs that still have `diagnose` or `jhste-engineering-judgment` are migrated to `diagnosing-bugs` or `jhste-engineering-groundwork`. Managed copies of retired `write-a-skill` are removed rather than kept as a compatibility fallback.
|
package/README.zh.md
CHANGED
|
@@ -81,6 +81,19 @@ jhste-skills install
|
|
|
81
81
|
|
|
82
82
|
如果只想临时运行一次,请使用 `npx`。如果希望把 `jhste-skills` 作为常用 shell 命令,请使用 `npm install -g`。
|
|
83
83
|
|
|
84
|
+
### Global setup(Codex + Claude Code + OpenCode,advisory-only)
|
|
85
|
+
|
|
86
|
+
如果你希望在所有仓库中使用 skills,但不写入每个仓库的文件或 git hooks,可以在用户级别设置一次:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install -g jhste-skills
|
|
90
|
+
jhste-skills global
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
该命令会把 skills 和 shared companion resources 复制到 `~/.jhste/skills`,并在每个 agent 的 global instruction file(`~/.claude/CLAUDE.md`、`~/.codex/AGENTS.md`、`~/.config/opencode/AGENTS.md`)中写入 marker-managed bridge block;文件不存在时会创建。它不会写入 git hooks 或每仓库文件;guard 保持 advisory(`jhste-skills guard --scope changed`)。可用 `--agents codex,claude,opencode` 选择 agent,用 `jhste-skills global --uninstall` 移除。
|
|
94
|
+
|
|
95
|
+
完成这一次 global setup 后,之后运行 `npm update -g jhste-skills` 会安全刷新 managed skill copies 和已有 managed global bridge blocks。只有在需要更改 agent 或选项时才重新运行 `jhste-skills global`。
|
|
96
|
+
|
|
84
97
|
默认安装使用 Normal mode。
|
|
85
98
|
|
|
86
99
|
- 安装全部 bundled skills:jhste core skills + vendored workflow skills。
|
|
@@ -162,6 +175,7 @@ Custom - 通过面向效果的问题自定义安装范围
|
|
|
162
175
|
| Skill | 何时使用 | 帮助减少什么 |
|
|
163
176
|
|---|---|---|
|
|
164
177
|
| [`setup`](skills/setup/SKILL.md)<br>安全安装 skill,避免 install/connect/update 覆盖现有项目说明 | 安装 kit 或连接仓库时 | Unsafe overwrite, unmanaged hook conflict, repo instruction replacement |
|
|
178
|
+
| [`ask-jhste`](skills/ask-jhste/SKILL.md)<br>用于选择正确 jhste skill 或 workflow 的 user-invoked router | 不确定下一步该用哪个 jhste skill/workflow 时 | Wrong workflow selection, unnecessary always-on context, accidental side effects from routing |
|
|
165
179
|
| [`jhste-engineering-groundwork`](skills/jhste-engineering-groundwork/SKILL.md)<br>pre-change groundwork skill,在改代码前验证目标、前提、scope、boundary 和 failure path | non-trivial code change 前 | Blind agreement, scope creep, unverified assumption, unclear boundary |
|
|
166
180
|
| [`jhste-code-quality`](skills/jhste-code-quality/SKILL.md)<br>检查 input validation、observable failure handling、secret-safe logging 和 oversized-file review 的 skill | 触及 external input、failure handling、logging、env/config 或 code-quality review path 时 | Unvalidated input, silent failure, secret logging, oversized file |
|
|
167
181
|
| [`jhste-architecture-review`](skills/jhste-architecture-review/SKILL.md)<br>检查 module boundary、side-effect placement 和 SOLID-informed design risk 的架构 review skill | 修改 module boundary、app structure、side-effect placement 或 responsibility split 时 | Pass-through abstraction, mixed responsibility, side-effect leakage |
|
|
@@ -172,7 +186,7 @@ Custom - 通过面向效果的问题自定义安装范围
|
|
|
172
186
|
|
|
173
187
|
## Bundled workflow skills
|
|
174
188
|
|
|
175
|
-
Normal install 还会安装
|
|
189
|
+
Normal install 还会安装 14 个从 Matt Pocock 的 [`mattpocock/skills`](https://github.com/mattpocock/skills) vendoring 的 workflow skills。它们适用于 implementation、debugging、planning、architecture、issue workflow、prototyping、handoff 和 skill-writing guidance。若不想安装它们,请使用 `--skill-set core`。
|
|
176
190
|
|
|
177
191
|
| Skill | 何时使用 |
|
|
178
192
|
|---|---|
|
|
@@ -188,11 +202,12 @@ Normal install 还会安装 13 个从 Matt Pocock 的 [`mattpocock/skills`](http
|
|
|
188
202
|
| [`to-issues`](skills/to-issues/SKILL.md)<br>把计划拆成 issue-ready vertical slices 的 skill | 需要 implementation tickets/work breakdown;tracker creation 需直接请求或 repo approval |
|
|
189
203
|
| [`triage`](skills/triage/SKILL.md)<br>分类 issue 并规划下一步行动的 triage skill | 需要 issue classification、next-action planning 或 repo-approved triage writes 时 |
|
|
190
204
|
| [`handoff`](skills/handoff/SKILL.md)<br>压缩 context,让下一个 agent 或 session 能继续工作的 handoff skill | 请求 handoff、session summary、continuation brief 或 next-agent context 时 |
|
|
191
|
-
| [`
|
|
205
|
+
| [`implement`](skills/implement/SKILL.md)<br>使用 jhste groundwork、verification、guard、review 的 scoped PRD/issue/spec implementation workflow skill | 想从 PRD、issue、spec 或 handoff 实现 focused work 时 |
|
|
206
|
+
| [`writing-great-skills`](skills/writing-great-skills/SKILL.md)<br>关于 predictable invocation、progressive disclosure、context load control、pruning 的 skill-writing reference | 想创建、替换或改进 agent skill 时 |
|
|
192
207
|
|
|
193
208
|
## Attribution: Matt Pocock skills
|
|
194
209
|
|
|
195
|
-
本仓库从 Matt Pocock 的 [`mattpocock/skills`](https://github.com/mattpocock/skills) vendoring 了上面列出的
|
|
210
|
+
本仓库从 Matt Pocock 的 [`mattpocock/skills`](https://github.com/mattpocock/skills) vendoring 了上面列出的 14 个 skills。
|
|
196
211
|
|
|
197
212
|
这些 skills 按 upstream MIT License vendoring。本仓库保留所需 copyright/license notice,并记录导入来源。
|
|
198
213
|
|
|
@@ -269,3 +284,5 @@ Release acceptance notes 请参考 [`docs/ACCEPTANCE_CHECK.md`](docs/ACCEPTANCE_
|
|
|
269
284
|
- 在称 non-trivial work 完成前执行 red-team code review。
|
|
270
285
|
|
|
271
286
|
快速的 agent 需要 guardrail。`jhste-skills` 为它们提供 repo-respecting engineering workflow。
|
|
287
|
+
|
|
288
|
+
Skills 共享来自 `skills/_shared/` 的 cross-cutting doctrine(SOLID lens、evidence discipline、issue-candidate protocol、scope discipline)。`skills/` 下名称以 `_` 开头的目录是 shared companion resources,不是 skills:它们会从 skill listing、selection 和 missing-skill checks 中排除,但安装任何 skill 时都会一起复制,确保已安装 artifact 中的 cross-skill `../_shared/...` references 不会悬空。
|
package/cli/global.mjs
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { ask, parseArgs } from './shared.mjs';
|
|
5
|
+
import { installSkills, removeManagedSkills } from './install-actions/skills.mjs';
|
|
6
|
+
import { removeManagedGlobalBridge, writeManagedGlobalBridge } from './install-actions/bridge-writer.mjs';
|
|
7
|
+
|
|
8
|
+
// Agent-neutral global setup: one canonical skills dir + a marker-managed bridge in
|
|
9
|
+
// each agent's global instruction file. Advisory only — no per-repo files, no git hooks.
|
|
10
|
+
const AGENT_TARGETS = {
|
|
11
|
+
claude: path.join(os.homedir(), '.claude', 'CLAUDE.md'),
|
|
12
|
+
codex: path.join(os.homedir(), '.codex', 'AGENTS.md'),
|
|
13
|
+
opencode: path.join(os.homedir(), '.config', 'opencode', 'AGENTS.md'),
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function usage() {
|
|
17
|
+
console.log(`jhste-skills global
|
|
18
|
+
Install jhste skills once at the user level for Codex and Claude Code. Advisory only.
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
jhste-skills global [--agents codex,claude,opencode] [--skill-set core|all] [--skills-dir <path>] [--force] [--yes]
|
|
22
|
+
jhste-skills global --uninstall [--agents codex,claude,opencode] [--skills-dir <path>] [--keep-skills] [--yes]
|
|
23
|
+
|
|
24
|
+
Notes:
|
|
25
|
+
Skills (and shared companion resources) are copied to --skills-dir (default ~/.jhste/skills).
|
|
26
|
+
A marker-managed bridge block is written to each agent's global instruction file:
|
|
27
|
+
claude -> ~/.claude/CLAUDE.md
|
|
28
|
+
codex -> ~/.codex/AGENTS.md
|
|
29
|
+
opencode -> ~/.config/opencode/AGENTS.md
|
|
30
|
+
Manifest-managed skills are refreshed automatically; --force also overwrites
|
|
31
|
+
unmanaged differing directories after review.
|
|
32
|
+
No git hooks and no per-repo files are written; guard stays advisory.
|
|
33
|
+
Use --claude-file / --codex-file / --opencode-file to override a target path.
|
|
34
|
+
--yes skips the confirmation prompt.
|
|
35
|
+
`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function fail(message) {
|
|
39
|
+
console.error(`jhste-skills global: ${message}`);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function parseAgents(value, errors) {
|
|
44
|
+
if (value === undefined) return ['codex', 'claude', 'opencode'];
|
|
45
|
+
if (typeof value !== 'string') {
|
|
46
|
+
errors.push('--agents requires a comma-separated value.');
|
|
47
|
+
return ['codex', 'claude', 'opencode'];
|
|
48
|
+
}
|
|
49
|
+
const list = String(value).split(',').map((item) => item.trim().toLowerCase()).filter(Boolean);
|
|
50
|
+
const unknown = list.filter((name) => !Object.prototype.hasOwnProperty.call(AGENT_TARGETS, name));
|
|
51
|
+
if (unknown.length) errors.push(`--agents supports only codex,claude,opencode; unknown: ${unknown.join(', ')}`);
|
|
52
|
+
return list.length ? [...new Set(list)] : ['codex', 'claude', 'opencode'];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function agentTargets(agents, args) {
|
|
56
|
+
const overrides = { claude: args['claude-file'], codex: args['codex-file'], opencode: args['opencode-file'] };
|
|
57
|
+
return agents.map((agent) => ({
|
|
58
|
+
agent,
|
|
59
|
+
file: typeof overrides[agent] === 'string' ? path.resolve(overrides[agent]) : AGENT_TARGETS[agent],
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function readBoolean(args, key, errors) {
|
|
64
|
+
if (!Object.prototype.hasOwnProperty.call(args, key)) return false;
|
|
65
|
+
if (args[key] !== true) errors.push(`--${key} does not take a value.`);
|
|
66
|
+
return args[key] === true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function readString(args, key, errors) {
|
|
70
|
+
if (!Object.prototype.hasOwnProperty.call(args, key)) return undefined;
|
|
71
|
+
if (typeof args[key] !== 'string') {
|
|
72
|
+
errors.push(`--${key} requires a value.`);
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
return args[key];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function confirmGlobalWrite(args, action, targets, skillsDir) {
|
|
79
|
+
if (args.yes === true || args.y === true) return true;
|
|
80
|
+
console.log(`jhste-skills global ${action}:`);
|
|
81
|
+
console.log(` skills: ${skillsDir}`);
|
|
82
|
+
for (const { agent, file } of targets) console.log(` ${agent}: ${file}`);
|
|
83
|
+
if (!process.stdin.isTTY) {
|
|
84
|
+
console.error(`Non-interactive global ${action} requires explicit --yes or -y; refusing to change files.`);
|
|
85
|
+
process.exit(3);
|
|
86
|
+
}
|
|
87
|
+
const answer = await ask(`Continue global ${action}? [y/N] `);
|
|
88
|
+
if (answer.toLowerCase() === 'y') return true;
|
|
89
|
+
console.log(`Global ${action} cancelled. No changes made.`);
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function main(argv) {
|
|
94
|
+
const args = parseArgs(argv);
|
|
95
|
+
if (args.help || args.h) return usage();
|
|
96
|
+
const errors = [];
|
|
97
|
+
const supported = new Set(['agents', 'skill-set', 'skills-dir', 'claude-file', 'codex-file', 'opencode-file', 'force', 'yes', 'y', 'uninstall', 'keep-skills', 'help', 'h', '_']);
|
|
98
|
+
for (const key of Object.keys(args)) {
|
|
99
|
+
if (!supported.has(key)) errors.push(`unknown option --${key}.`);
|
|
100
|
+
}
|
|
101
|
+
if (Array.isArray(args._) && args._.length) errors.push(`unexpected positional argument: ${args._[0]}`);
|
|
102
|
+
|
|
103
|
+
const uninstall = readBoolean(args, 'uninstall', errors);
|
|
104
|
+
const keepSkills = readBoolean(args, 'keep-skills', errors);
|
|
105
|
+
const force = readBoolean(args, 'force', errors);
|
|
106
|
+
readBoolean(args, 'yes', errors);
|
|
107
|
+
readBoolean(args, 'y', errors);
|
|
108
|
+
const skillSetRaw = readString(args, 'skill-set', errors);
|
|
109
|
+
const skillSet = skillSetRaw ? skillSetRaw.toLowerCase() : 'all';
|
|
110
|
+
if (!['core', 'all'].includes(skillSet)) errors.push('global --skill-set must be core or all because the global bridge requires core workflow skills.');
|
|
111
|
+
const skillsDirInput = readString(args, 'skills-dir', errors);
|
|
112
|
+
readString(args, 'claude-file', errors);
|
|
113
|
+
readString(args, 'codex-file', errors);
|
|
114
|
+
readString(args, 'opencode-file', errors);
|
|
115
|
+
const skillsDir = path.resolve(skillsDirInput || path.join(os.homedir(), '.jhste', 'skills'));
|
|
116
|
+
const agents = parseAgents(args.agents, errors);
|
|
117
|
+
if (errors.length) return fail(errors.join('\n'));
|
|
118
|
+
|
|
119
|
+
const targets = agentTargets(agents, args);
|
|
120
|
+
if (!(await confirmGlobalWrite(args, uninstall ? 'uninstall' : 'install', targets, skillsDir))) return;
|
|
121
|
+
|
|
122
|
+
if (uninstall) {
|
|
123
|
+
console.log('jhste-skills global uninstall:');
|
|
124
|
+
if (!keepSkills) {
|
|
125
|
+
const result = removeManagedSkills(skillsDir);
|
|
126
|
+
const removed = result.skills?.filter((item) => item.status === 'removed').length ?? 0;
|
|
127
|
+
console.log(` skills: ${result.status}${result.status === 'removed-managed' ? ` (${removed} removed from ${skillsDir})` : ''}`);
|
|
128
|
+
if (result.status === 'invalid-manifest') {
|
|
129
|
+
console.log(` blocked: ${result.reason || result.status} (${result.path})`);
|
|
130
|
+
console.log(' bridges: skipped because skills uninstall did not complete');
|
|
131
|
+
process.exitCode = 3;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
console.log(` skills: kept (${skillsDir})`);
|
|
136
|
+
}
|
|
137
|
+
for (const { agent, file } of targets) {
|
|
138
|
+
const result = removeManagedGlobalBridge(file);
|
|
139
|
+
console.log(` ${agent}: ${result.status} (${file})`);
|
|
140
|
+
}
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// `global` owns the canonical skills dir, so it refreshes manifest-managed skills
|
|
145
|
+
// automatically (idempotent: unchanged when identical) and adopts known jhste skills,
|
|
146
|
+
// while still protecting unmanaged differing directories unless --force is given.
|
|
147
|
+
const skillResults = installSkills(skillsDir, { force: true, adoptKnownSkills: true, allowUnmanagedOverwrite: force, skillSet });
|
|
148
|
+
const blocked = skillResults.filter((item) => ['skipped-unmanaged-different', 'invalid-manifest'].includes(item.status));
|
|
149
|
+
const copied = skillResults.filter((item) => ['created', 'overwritten-managed', 'adopted-managed', 'unchanged'].includes(item.status)).length;
|
|
150
|
+
|
|
151
|
+
console.log('jhste-skills global install:');
|
|
152
|
+
console.log(` skills: ${copied} managed under ${skillsDir}${blocked.length ? ` (${blocked.length} skipped; rerun with --force after review)` : ''}`);
|
|
153
|
+
if (blocked.length) {
|
|
154
|
+
for (const item of blocked) {
|
|
155
|
+
console.log(` blocked: ${item.reason || item.status} (${item.destination || item.source})`);
|
|
156
|
+
}
|
|
157
|
+
console.log(' bridges: skipped because skills install did not complete');
|
|
158
|
+
process.exitCode = 3;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
for (const { agent, file } of targets) {
|
|
162
|
+
const result = writeManagedGlobalBridge(file);
|
|
163
|
+
console.log(` ${agent}: ${result.status} (${file})`);
|
|
164
|
+
}
|
|
165
|
+
console.log('\nAdvisory only: no git hooks and no per-repo files were written.');
|
|
166
|
+
console.log('Run guard manually anytime: jhste-skills guard --scope changed');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
main(process.argv.slice(2));
|
package/cli/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
|
|
6
6
|
const cliDir = path.dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const [command, ...rest] = process.argv.slice(2);
|
|
8
|
-
const commands = new Set(['install', 'connect', 'sync', 'update', 'deep-scan', 'guard', 'hooks', 'tune', 'baseline', 'uninstall']);
|
|
8
|
+
const commands = new Set(['install', 'connect', 'global', 'sync', 'update', 'deep-scan', 'guard', 'hooks', 'tune', 'baseline', 'uninstall']);
|
|
9
9
|
|
|
10
10
|
if (!command || command === '--help' || command === '-h') {
|
|
11
11
|
console.log(`jhste-skills
|
|
@@ -13,6 +13,7 @@ if (!command || command === '--help' || command === '-h') {
|
|
|
13
13
|
Usage:
|
|
14
14
|
jhste-skills install [--mode minimal|normal|full|custom] [--yes] [--repo <path>]
|
|
15
15
|
jhste-skills connect [--mode normal|full|custom] [--repo <path>]
|
|
16
|
+
jhste-skills global [--agents codex,claude,opencode] [--skill-set core|all] [--uninstall]
|
|
16
17
|
jhste-skills sync [--repo <path>] [--skills-dir <path>] [--yes]
|
|
17
18
|
jhste-skills update [--repo <path>] [--skills-dir <path>] [--yes]
|
|
18
19
|
jhste-skills deep-scan [--repo <path>]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { BRIDGE_BLOCK, BRIDGE_END, BRIDGE_START, MANAGED_BRIDGE_BLOCK, readIfExists } from '../shared.mjs';
|
|
3
|
+
import { BRIDGE_BLOCK, BRIDGE_END, BRIDGE_START, MANAGED_BRIDGE_BLOCK, MANAGED_GLOBAL_BRIDGE_BLOCK, ensureDir, readIfExists } from '../shared.mjs';
|
|
4
4
|
|
|
5
5
|
function escapeRegExp(value) {
|
|
6
6
|
return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
@@ -27,6 +27,43 @@ export function bridgeStatus(repoRoot, fileName) {
|
|
|
27
27
|
return { fileName, path: target, status: 'will-append-managed' };
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
// Write/refresh the agent-neutral global bridge in an absolute instruction file,
|
|
31
|
+
// creating parent directories and the file when absent. Marker-managed and idempotent.
|
|
32
|
+
export function writeManagedGlobalBridge(targetPath) {
|
|
33
|
+
ensureDir(path.dirname(targetPath));
|
|
34
|
+
const existing = readIfExists(targetPath);
|
|
35
|
+
if (existing === null) {
|
|
36
|
+
fs.writeFileSync(targetPath, `${MANAGED_GLOBAL_BRIDGE_BLOCK}\n`);
|
|
37
|
+
return { status: 'created', path: targetPath };
|
|
38
|
+
}
|
|
39
|
+
if (existing.includes(BRIDGE_START) && existing.includes(BRIDGE_END)) {
|
|
40
|
+
const pattern = new RegExp(`${escapeRegExp(BRIDGE_START)}[\\s\\S]*?${escapeRegExp(BRIDGE_END)}`);
|
|
41
|
+
const updated = existing.replace(pattern, MANAGED_GLOBAL_BRIDGE_BLOCK);
|
|
42
|
+
if (updated === existing) return { status: 'unchanged', path: targetPath };
|
|
43
|
+
fs.writeFileSync(targetPath, updated);
|
|
44
|
+
return { status: 'updated-managed', path: targetPath };
|
|
45
|
+
}
|
|
46
|
+
const prefix = existing.endsWith('\n') ? existing : `${existing}\n`;
|
|
47
|
+
fs.writeFileSync(targetPath, `${prefix}\n${MANAGED_GLOBAL_BRIDGE_BLOCK}\n`);
|
|
48
|
+
return { status: 'appended-managed', path: targetPath };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Remove a marker-managed bridge block from an absolute instruction file. Deletes the
|
|
52
|
+
// file only if it becomes empty and was created solely for the bridge.
|
|
53
|
+
export function removeManagedGlobalBridge(targetPath) {
|
|
54
|
+
const existing = readIfExists(targetPath);
|
|
55
|
+
if (existing === null) return { status: 'absent', path: targetPath };
|
|
56
|
+
if (!(existing.includes(BRIDGE_START) && existing.includes(BRIDGE_END))) return { status: 'no-managed-block', path: targetPath };
|
|
57
|
+
const pattern = new RegExp(`\\n?${escapeRegExp(BRIDGE_START)}[\\s\\S]*?${escapeRegExp(BRIDGE_END)}\\n?`);
|
|
58
|
+
const updated = existing.replace(pattern, '\n').replace(/^\n+/, '').replace(/\n{3,}/g, '\n\n');
|
|
59
|
+
if (updated.trim() === '') {
|
|
60
|
+
fs.rmSync(targetPath, { force: true });
|
|
61
|
+
return { status: 'removed-empty-file', path: targetPath };
|
|
62
|
+
}
|
|
63
|
+
fs.writeFileSync(targetPath, updated);
|
|
64
|
+
return { status: 'removed-managed-block', path: targetPath };
|
|
65
|
+
}
|
|
66
|
+
|
|
30
67
|
export function writeManagedBridge(repoRoot, fileName) {
|
|
31
68
|
const target = path.join(repoRoot, fileName);
|
|
32
69
|
const existing = readIfExists(target);
|