jhste-skills 0.1.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 (168) hide show
  1. package/LICENSE +21 -0
  2. package/README.ja.md +254 -0
  3. package/README.ko.md +254 -0
  4. package/README.md +254 -0
  5. package/README.zh.md +254 -0
  6. package/adapters/claude/README.md +7 -0
  7. package/adapters/codex/README.md +25 -0
  8. package/adapters/generic/README.md +7 -0
  9. package/cli/baseline.mjs +32 -0
  10. package/cli/connect.mjs +84 -0
  11. package/cli/deep-scan/analyze.mjs +167 -0
  12. package/cli/deep-scan/collect.mjs +133 -0
  13. package/cli/deep-scan/report.mjs +197 -0
  14. package/cli/deep-scan.mjs +56 -0
  15. package/cli/guard/baseline.mjs +64 -0
  16. package/cli/guard/config.mjs +48 -0
  17. package/cli/guard/profile-commands.mjs +87 -0
  18. package/cli/guard/registry.mjs +47 -0
  19. package/cli/guard/reporting.mjs +165 -0
  20. package/cli/guard/scanners/code-health.mjs +213 -0
  21. package/cli/guard/scanners/data-boundary-locality.mjs +125 -0
  22. package/cli/guard/scanners/data-boundary.mjs +237 -0
  23. package/cli/guard/scanners/external-input.mjs +74 -0
  24. package/cli/guard/scanners/index.mjs +136 -0
  25. package/cli/guard/scanners/single-responsibility.mjs +205 -0
  26. package/cli/guard/scanners/ui-runtime.mjs +140 -0
  27. package/cli/guard/scanners/utils.mjs +167 -0
  28. package/cli/guard/scope.mjs +181 -0
  29. package/cli/guard.mjs +125 -0
  30. package/cli/hook-utils.mjs +127 -0
  31. package/cli/hooks.mjs +127 -0
  32. package/cli/index.mjs +35 -0
  33. package/cli/install-actions/apply-plan.mjs +39 -0
  34. package/cli/install-actions/bridge-writer.mjs +52 -0
  35. package/cli/install-actions/output.mjs +45 -0
  36. package/cli/install-actions/preflight.mjs +58 -0
  37. package/cli/install-actions/profile-writer.mjs +21 -0
  38. package/cli/install-actions/skills.mjs +148 -0
  39. package/cli/install-actions.mjs +4 -0
  40. package/cli/install-flow/options.mjs +234 -0
  41. package/cli/install-flow/output.mjs +106 -0
  42. package/cli/install-flow/plan-helpers.mjs +29 -0
  43. package/cli/install-flow/plan.mjs +200 -0
  44. package/cli/install-flow/prompts.mjs +210 -0
  45. package/cli/install-flow.mjs +16 -0
  46. package/cli/install.mjs +77 -0
  47. package/cli/json-file.mjs +39 -0
  48. package/cli/profile/loader.mjs +13 -0
  49. package/cli/profile/parser.mjs +226 -0
  50. package/cli/profile/schema.mjs +81 -0
  51. package/cli/profile/settings.mjs +45 -0
  52. package/cli/profile/validator.mjs +86 -0
  53. package/cli/profile.mjs +5 -0
  54. package/cli/shared/args.mjs +32 -0
  55. package/cli/shared/files.mjs +70 -0
  56. package/cli/shared/git.mjs +28 -0
  57. package/cli/shared/paths.mjs +27 -0
  58. package/cli/shared/prompt.mjs +32 -0
  59. package/cli/shared/templates.mjs +71 -0
  60. package/cli/shared/time.mjs +3 -0
  61. package/cli/shared.mjs +7 -0
  62. package/cli/sync-core.mjs +213 -0
  63. package/cli/sync.mjs +7 -0
  64. package/cli/tune.mjs +101 -0
  65. package/cli/uninstall.mjs +288 -0
  66. package/cli/update.mjs +7 -0
  67. package/docs/ACCEPTANCE_CHECK.md +54 -0
  68. package/docs/CLI.md +212 -0
  69. package/docs/CONFLICT_RESOLUTION.md +58 -0
  70. package/docs/PUBLIC_SAFETY.md +26 -0
  71. package/docs/RULES.md +94 -0
  72. package/docs/VENDORING.md +23 -0
  73. package/examples/profile.yaml +45 -0
  74. package/package.json +51 -0
  75. package/packs/api.yaml +13 -0
  76. package/packs/core.yaml +19 -0
  77. package/packs/crawler.yaml +8 -0
  78. package/packs/database.yaml +8 -0
  79. package/packs/web.yaml +10 -0
  80. package/rules/core/api_contract_compatibility.yaml +25 -0
  81. package/rules/core/authz_data_isolation.yaml +27 -0
  82. package/rules/core/build_runtime_env_safety.yaml +26 -0
  83. package/rules/core/external_input_validation.yaml +27 -0
  84. package/rules/core/file_size_advisory.yaml +28 -0
  85. package/rules/core/no_secret_logging.yaml +24 -0
  86. package/rules/core/no_silent_failure.yaml +30 -0
  87. package/rules/core/null_state_safety.yaml +25 -0
  88. package/rules/core/performance_duplicate_fetch.yaml +25 -0
  89. package/rules/core/public_safe_error.yaml +24 -0
  90. package/rules/core/responsibility_budget.yaml +44 -0
  91. package/rules/core/side_effect_boundary.yaml +24 -0
  92. package/rules/core/single_responsibility_advisory.yaml +35 -0
  93. package/rules/core/workflow_security.yaml +25 -0
  94. package/rules/core/write_safety_idempotency.yaml +25 -0
  95. package/rules/crawler/crawler_producer_boundary.yaml +24 -0
  96. package/rules/database/db_row_validation.yaml +24 -0
  97. package/rules/database/sql_parameter_binding.yaml +24 -0
  98. package/rules/nextjs/thin_api_route.yaml +24 -0
  99. package/rules/python/broad_exception_advisory.yaml +24 -0
  100. package/rules/react/component_responsibility.yaml +24 -0
  101. package/rules/typescript/type_escape_advisory.yaml +24 -0
  102. package/scripts/docs-check-data.mjs +71 -0
  103. package/scripts/docs-check.mjs +261 -0
  104. package/scripts/guard-fixtures/helpers.mjs +58 -0
  105. package/scripts/guard-fixtures-test.mjs +273 -0
  106. package/scripts/profile-fixtures-test.mjs +83 -0
  107. package/scripts/public-safety-check.mjs +88 -0
  108. package/scripts/public-safety-fixtures-test.mjs +60 -0
  109. package/scripts/release-gates-test.mjs +52 -0
  110. package/scripts/single-responsibility-fixtures-test.mjs +86 -0
  111. package/scripts/smoke/connect-scenarios.mjs +47 -0
  112. package/scripts/smoke/fixture.mjs +49 -0
  113. package/scripts/smoke/guard-and-hook-scenarios.mjs +211 -0
  114. package/scripts/smoke/helpers.mjs +51 -0
  115. package/scripts/smoke/install-scenarios.mjs +244 -0
  116. package/scripts/smoke/mode-scenarios.mjs +76 -0
  117. package/scripts/smoke-test.mjs +17 -0
  118. package/scripts/syntax-check.mjs +37 -0
  119. package/scripts/vendor-check.mjs +87 -0
  120. package/skills/codebase-design/DEEPENING.md +37 -0
  121. package/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  122. package/skills/codebase-design/SKILL.md +122 -0
  123. package/skills/diagnose/SKILL.md +125 -0
  124. package/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  125. package/skills/diagnosing-bugs/SKILL.md +142 -0
  126. package/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
  127. package/skills/domain-modeling/ADR-FORMAT.md +47 -0
  128. package/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  129. package/skills/domain-modeling/SKILL.md +82 -0
  130. package/skills/grill-me/SKILL.md +18 -0
  131. package/skills/grill-with-docs/ADR-FORMAT.md +47 -0
  132. package/skills/grill-with-docs/CONTEXT-FORMAT.md +60 -0
  133. package/skills/grill-with-docs/SKILL.md +96 -0
  134. package/skills/grilling/SKILL.md +18 -0
  135. package/skills/handoff/SKILL.md +23 -0
  136. package/skills/improve-codebase-architecture/DEEPENING.md +37 -0
  137. package/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  138. package/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
  139. package/skills/improve-codebase-architecture/LANGUAGE.md +53 -0
  140. package/skills/improve-codebase-architecture/SKILL.md +93 -0
  141. package/skills/jhste-architecture-review/SKILL.md +28 -0
  142. package/skills/jhste-architecture-review/references/architecture-review.md +41 -0
  143. package/skills/jhste-code-quality/SKILL.md +33 -0
  144. package/skills/jhste-code-quality/references/code-quality.md +45 -0
  145. package/skills/jhste-crawler-automation/SKILL.md +23 -0
  146. package/skills/jhste-crawler-automation/references/crawler-automation.md +11 -0
  147. package/skills/jhste-db-api-boundary/SKILL.md +28 -0
  148. package/skills/jhste-db-api-boundary/references/db-api-boundary.md +21 -0
  149. package/skills/jhste-engineering-judgment/SKILL.md +107 -0
  150. package/skills/jhste-engineering-judgment/references/structure-templates.md +41 -0
  151. package/skills/jhste-red-team-review/SKILL.md +101 -0
  152. package/skills/jhste-red-team-review/references/red-team-review.md +83 -0
  153. package/skills/prototype/LOGIC.md +79 -0
  154. package/skills/prototype/SKILL.md +38 -0
  155. package/skills/prototype/UI.md +112 -0
  156. package/skills/setup/SKILL.md +21 -0
  157. package/skills/setup/references/conflict-policy.md +11 -0
  158. package/skills/setup/references/setup-flow.md +18 -0
  159. package/skills/to-issues/SKILL.md +91 -0
  160. package/skills/to-prd/SKILL.md +82 -0
  161. package/skills/triage/AGENT-BRIEF.md +168 -0
  162. package/skills/triage/OUT-OF-SCOPE.md +101 -0
  163. package/skills/triage/SKILL.md +111 -0
  164. package/skills/write-a-skill/SKILL.md +125 -0
  165. package/vendor/matt-pocock/LICENSE +21 -0
  166. package/vendor/matt-pocock/NOTICE.md +10 -0
  167. package/vendor/matt-pocock/allowlist.json +16 -0
  168. package/vendor/matt-pocock/source-lock.json +119 -0
package/README.md ADDED
@@ -0,0 +1,254 @@
1
+ # jhste-skills
2
+
3
+ Languages: [English](README.md) · [한국어](README.ko.md) · [中文](README.zh.md) · [日本語](README.ja.md)
4
+
5
+ An installable working-rules kit that helps AI coding agents consistently follow your engineering standards.
6
+
7
+ `jhste-skills` gives Codex, Claude Code, and other AI coding agents a shared engineering workflow. It helps agents verify assumptions before editing, respect repo-local instructions, keep API/database/automation boundaries clear, check whether each module has one clear responsibility under SRP (Single Responsibility Principle), run changed-file guards, and perform a red-team code review before claiming work is complete.
8
+
9
+ This tool does **not** take over your project. Repo-local `AGENTS.md`, `CLAUDE.md`, and docs remain authoritative. The default setup is advisory, marker-managed, and designed to be low-risk to try.
10
+
11
+ Skills are designed to be used automatically when the situation calls for them. For example, when an agent edits API code, it is guided to use the API/database boundary skill; before completion, it is guided to use the red-team review skill. You can also call a skill directly, for example: `use jhste-engineering-judgment to review this change premise`, or `run jhste-red-team-review on this diff`.
12
+
13
+ ## Why install this?
14
+
15
+ AI coding agents are fast, but they fail in predictable ways:
16
+
17
+ - They silently accept unclear requirements or incorrect premises.
18
+ - They expand the scope while trying to be helpful.
19
+ - They mix UI, route/controller, service, database, and side-effect responsibilities in one place, breaking the “one module, one responsibility” principle (SRP).
20
+ - They hide failures or produce unsafe logs.
21
+ - They say “done” before the changed code has been checked.
22
+ - They forget repo-specific rules when you switch machines or repositories.
23
+
24
+ `jhste-skills` gives agents a repeatable loop for reducing those failures:
25
+
26
+ ```text
27
+ Before a non-trivial code change:
28
+ check the goal, premise, ownership seam, data contract, failure path, and SRP responsibility
29
+
30
+ While editing:
31
+ treat repo-local instructions as the authority
32
+
33
+ After changing code:
34
+ run a fast changed-file guard when available
35
+
36
+ Before saying “done”:
37
+ run a read-only red-team code review
38
+
39
+ If warnings appear:
40
+ attempt a bounded fix, re-check, and stop instead of looping forever
41
+ ```
42
+
43
+ The expected result is smaller diffs, clearer SRP boundaries, safer API/database code, fewer silent assumptions, and more honest completion reports.
44
+
45
+ ## Who should install this?
46
+
47
+ Install `jhste-skills` if you:
48
+
49
+ - use Codex, Claude Code, or another coding agent across multiple repositories;
50
+ - want agents to verify assumptions before non-trivial code changes;
51
+ - want existing repo docs to remain the source of authority;
52
+ - want lightweight advisory checks before commit or before declaring work complete;
53
+ - care about SRP, API/database boundaries, safe logging, input validation, side effects, and automation reliability;
54
+ - want to restore the same AI coding workflow across machines and repositories.
55
+
56
+ You may not need this if you only want a single prompt file, want strict CI enforcement immediately after installation, do not want generated `.jhste/` files or bridge blocks, or expect this tool to automatically refactor code.
57
+
58
+ ## Quick start
59
+
60
+ ```bash
61
+ npx jhste-skills install
62
+ ```
63
+
64
+ Or install the CLI globally with npm and use it from any repository:
65
+
66
+ ```bash
67
+ npm install -g jhste-skills
68
+ jhste-skills install
69
+ ```
70
+
71
+ 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.
72
+
73
+ The default install uses Normal mode.
74
+
75
+ - Installs all bundled skills: jhste core skills + vendored workflow skills.
76
+ - Creates `.jhste/profile.yaml` when missing.
77
+ - Adds or refreshes a marker-managed bridge block in `AGENTS.md` or `CLAUDE.md` when project guidance is enabled.
78
+ - Installs an advisory pre-commit hook when safe.
79
+ - Does not modify CI, target `package.json`, lockfiles, or source code.
80
+
81
+ To connect another repository:
82
+
83
+ ```bash
84
+ cd /path/to/another-repo
85
+ jhste-skills connect
86
+ ```
87
+
88
+ To install only the jhste core guardrail skills:
89
+
90
+ ```bash
91
+ npx jhste-skills install --skill-set core
92
+ ```
93
+
94
+ To run the changed-file guard manually:
95
+
96
+ ```bash
97
+ jhste-skills guard --scope changed --format text --fail-on error
98
+ ```
99
+
100
+ To run an optional repo-wide advisory scan:
101
+
102
+ ```bash
103
+ jhste-skills deep-scan
104
+ ```
105
+
106
+ To remove managed outputs:
107
+
108
+ ```bash
109
+ jhste-skills uninstall --yes --repo /path/to/repo
110
+ ```
111
+
112
+ `uninstall` removes managed hooks, marker-managed bridge blocks, and manifest-managed skill directories. It does not touch non-managed files. `.jhste/profile.yaml` is removed only when it still matches the generated shape; use `--force-profile` only after reviewing a modified profile.
113
+
114
+ ## Install modes
115
+
116
+ ```text
117
+ Minimal - installs only jhste core skills; no project files or hooks
118
+ Normal - recommended default; all bundled skills + project profile/bridge + advisory pre-commit hook
119
+ Full - all bundled skills + profile/bridge + advisory pre-commit/pre-push hooks + deep scan
120
+ Custom - asks effect-oriented questions so you can choose the setup
121
+ ```
122
+
123
+ `Full` still follows the safety contract. It does not overwrite non-managed hooks, source files, CI, `package.json`, or lockfiles, and it does not enable strict mode. Interactive Full mode only asks how automatic checks should behave: warning-only, block at commit time, or block at commit and push time. `--yes` uses warning-only unless `--hooks blocking` is explicit.
124
+
125
+ ## Safety contract
126
+
127
+ `jhste-skills` is safe-by-default:
128
+
129
+ - repo-local `AGENTS.md`, `CLAUDE.md`, and docs remain authoritative;
130
+ - explicit user instructions set task scope, but do not silently override verified safety, privacy, data-loss, or repo-architecture constraints;
131
+ - default install does not modify CI;
132
+ - default install does not modify target `package.json` or lockfiles;
133
+ - default install does not automatically refactor source code;
134
+ - managed hooks are advisory by default;
135
+ - strict mode requires explicit opt-in;
136
+ - bridge blocks use `<!-- jhste-skills:start -->` / `<!-- jhste-skills:end -->` markers;
137
+ - guard output is review evidence, not proof by itself;
138
+ - guard runtime/config failures must be reported separately from rule violations;
139
+ - install/update/uninstall flows leave non-managed hooks, bridge text, and skill directories untouched.
140
+
141
+ ## Core jhste skills
142
+
143
+ These are the jhste-authored guardrail skills. They are installed by default as part of the bundled skill set. Use `--skill-set core` to install only these core skills.
144
+
145
+ | Skill | Use it when | What it helps reduce |
146
+ |---|---|---|
147
+ | [`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 |
148
+ | [`jhste-engineering-judgment`](skills/jhste-engineering-judgment/SKILL.md)<br>A pre-change judgment skill that verifies goal, premise, scope, seam, and failure path before code edits | Before non-trivial code changes | Blind agreement, scope creep, unverified assumptions, unclear seams |
149
+ | [`jhste-code-quality`](skills/jhste-code-quality/SKILL.md)<br>A code-quality skill for input validation, observable failure handling, and secret-safe logging | Writing or reviewing application code | Unvalidated input, silent failure, secret logging, oversized files |
150
+ | [`jhste-architecture-review`](skills/jhste-architecture-review/SKILL.md)<br>An architecture review skill for module boundaries, side-effect placement, and possible SRP violations | Changing module boundaries or app structure | Pass-through abstraction, mixed responsibility, side-effect leakage |
151
+ | [`jhste-db-api-boundary`](skills/jhste-db-api-boundary/SKILL.md)<br>A boundary skill that checks responsibility and data contracts across API routes, services, repositories, and SQL | Touching API, controller, service, repository, SQL, or persistence code | Fat routes, unsafe SQL, missing auth/data scoping, leaky DTOs |
152
+ | [`jhste-crawler-automation`](skills/jhste-crawler-automation/SKILL.md)<br>An automation skill for crawler/scraper/worker/scheduler producer-consumer seams and side effects | Touching crawlers, scrapers, workers, schedulers, or browser automation | Fragile automation, unclear producer/consumer boundaries, hidden side effects |
153
+ | [`jhste-red-team-review`](skills/jhste-red-team-review/SKILL.md)<br>A read-only red-team code review skill that aggressively re-checks changed code before completion | Before declaring non-trivial code work complete | Premature “done”, missed null/auth/env/write/API/performance risks |
154
+
155
+ ## Bundled workflow skills
156
+
157
+ Normal install also includes 14 workflow skills vendored from Matt Pocock's [`mattpocock/skills`](https://github.com/mattpocock/skills). These are useful for debugging, planning, architecture, issue workflows, prototyping, and handoffs. Use `--skill-set core` if you do not want them installed.
158
+
159
+ | Skill | Use it when |
160
+ |---|---|
161
+ | [`diagnose`](skills/diagnose/SKILL.md)<br>A diagnosis-loop skill that forces reproduce, minimize, hypothesize, instrument, fix, and regression-check steps | Diagnosing a hard bug or performance regression systematically |
162
+ | [`diagnosing-bugs`](skills/diagnosing-bugs/SKILL.md)<br>A debugging skill that narrows root cause around a fast pass/fail feedback loop | You need a reproduce → minimise → hypothesise → instrument → fix loop |
163
+ | [`grill-me`](skills/grill-me/SKILL.md)<br>A skill that asks persistent questions until a plan or design has no obvious gaps | You want the agent to question your plan or design until it becomes clear |
164
+ | [`grill-with-docs`](skills/grill-with-docs/SKILL.md)<br>A design-challenge skill that documents domain terms and decisions while questioning the plan | You want project vocabulary and docs/ADRs updated during the questioning process |
165
+ | [`grilling`](skills/grilling/SKILL.md)<br>A general grilling skill for pressure-testing plans and designs before implementation | You need a general plan/design stress-test questioning loop |
166
+ | [`domain-modeling`](skills/domain-modeling/SKILL.md)<br>A skill for sharpening project terminology, domain models, and architectural decisions | Refining domain terms, ubiquitous language, or architectural decisions |
167
+ | [`codebase-design`](skills/codebase-design/SKILL.md)<br>A codebase design skill for deep modules, small interfaces, and clear seams | You need better module interface, seam, and testability vocabulary |
168
+ | [`improve-codebase-architecture`](skills/improve-codebase-architecture/SKILL.md)<br>An architecture skill that finds shallow modules and coupling that can be improved into deeper modules | You want to find deepening opportunities and reduce architectural friction |
169
+ | [`prototype`](skills/prototype/SKILL.md)<br>A prototyping skill for validating logic or UI direction with throwaway code before implementation | You want a throwaway logic/UI prototype before committing to an approach |
170
+ | [`to-prd`](skills/to-prd/SKILL.md)<br>A PRD-writing skill that structures conversation context into product requirements | You want to turn conversation context into a PRD |
171
+ | [`to-issues`](skills/to-issues/SKILL.md)<br>A skill that breaks a plan into independently workable vertical-slice issues | You want to split a plan into implementation issues that can be worked independently |
172
+ | [`triage`](skills/triage/SKILL.md)<br>An issue triage skill that classifies issues and decides next actions through a structured workflow | You want issues handled through a structured triage workflow |
173
+ | [`handoff`](skills/handoff/SKILL.md)<br>A handoff skill that compresses context so the next agent or session can continue | You want to hand context to another agent or session |
174
+ | [`write-a-skill`](skills/write-a-skill/SKILL.md)<br>A skill-writing skill for creating agent skills with the right structure and progressive disclosure | You want to create or refine an agent skill |
175
+
176
+ ## Attribution: Matt Pocock skills
177
+
178
+ This repository vendors the 14 skills listed above from Matt Pocock's [`mattpocock/skills`](https://github.com/mattpocock/skills).
179
+
180
+ Those skills are vendored under the upstream MIT License. This repository preserves the required copyright/license notice and records the imported sources.
181
+
182
+ - Upstream: [`mattpocock/skills`](https://github.com/mattpocock/skills)
183
+ - License: MIT
184
+ - Attribution: [`vendor/matt-pocock/NOTICE.md`](vendor/matt-pocock/NOTICE.md)
185
+ - Upstream license copy: [`vendor/matt-pocock/LICENSE`](vendor/matt-pocock/LICENSE)
186
+ - Allowlist: [`vendor/matt-pocock/allowlist.json`](vendor/matt-pocock/allowlist.json)
187
+ - Source lock: [`vendor/matt-pocock/source-lock.json`](vendor/matt-pocock/source-lock.json)
188
+
189
+ Do not add vendored skills outside the allowlist without separate review. When updating vendored copies, refresh the source lock and review the diff.
190
+
191
+ ## CLI commands
192
+
193
+ ```bash
194
+ jhste-skills install
195
+ jhste-skills connect
196
+ jhste-skills guard
197
+ jhste-skills deep-scan
198
+ jhste-skills tune
199
+ jhste-skills baseline
200
+ jhste-skills sync
201
+ jhste-skills update
202
+ jhste-skills hooks
203
+ jhste-skills uninstall
204
+ ```
205
+
206
+ See [`docs/CLI.md`](docs/CLI.md) for detailed command behavior.
207
+
208
+ ## Recommended rollout
209
+
210
+ 1. Run the default install and dogfood the advisory workflow first.
211
+ 2. Keep advisory hooks at first. Use `--skip-hooks` if you do not want commit-time checks, and enable blocking mode only after reviewing noise and false positives.
212
+ 3. Start with the default 300-line advisory limit. Use `--line-limit-mode blocking` only when the team is ready for warning-level hook enforcement.
213
+ 4. During code changes, run `guard --scope changed --format text --fail-on error` manually.
214
+ 5. Before non-trivial code changes, use `jhste-engineering-judgment` to check scope, seam, failure path, data contract, assumptions, and each changed class/module/function's main responsibility.
215
+ 6. Before declaring non-trivial code work complete, use `jhste-red-team-review`. Skip docs-only, comment-only, formatting-only, and trivial rename-only changes.
216
+ 7. Limit fix + re-review loops to two cycles, then report remaining risks instead of looping indefinitely.
217
+ 8. Create a baseline only after reviewing existing debt. Treat the baseline as a known-issues ledger and use ratchet behavior to stop new debt, not to hide scanner failures.
218
+
219
+ ## Repository layout
220
+
221
+ ```text
222
+ skills/ AI-readable skill guidance
223
+ rules/ Stable rule metadata used by skills and scans
224
+ packs/ Core, web, API, database, and crawler rule bundles
225
+ adapters/ Codex, Claude, and generic adapter notes
226
+ cli/ install, uninstall, deep-scan, guard, hooks, tune, and baseline commands
227
+ vendor/matt-pocock/ Matt Pocock allowlist, source lock, license, and attribution
228
+ examples/profile.yaml Default advisory profile example
229
+ ```
230
+
231
+ ## Verification
232
+
233
+ ```bash
234
+ npm test
235
+ npm run public-safety:check
236
+ npm run vendor:check
237
+ npm run docs:check
238
+ ```
239
+
240
+ See [`docs/ACCEPTANCE_CHECK.md`](docs/ACCEPTANCE_CHECK.md) for release acceptance notes.
241
+
242
+ ## Philosophy
243
+
244
+ `jhste-skills` is not a tool for giving agents more authority. It is a tool for making fast agents more reliable.
245
+
246
+ - Do not agree blindly.
247
+ - Do not overwrite local project authority.
248
+ - Keep changes scoped.
249
+ - Name responsibility boundaries from an SRP perspective.
250
+ - Make failures observable.
251
+ - Treat automated guard output as evidence, not proof.
252
+ - Run a red-team code review before calling non-trivial work complete.
253
+
254
+ Fast agents need guardrails. `jhste-skills` gives them a repo-respecting engineering workflow.
package/README.zh.md ADDED
@@ -0,0 +1,254 @@
1
+ # jhste-skills
2
+
3
+ Languages: [English](README.md) · [한국어](README.ko.md) · [中文](README.zh.md) · [日本語](README.ja.md)
4
+
5
+ 一套可安装的工作规则工具包,帮助 AI 编程代理稳定遵循你设定的工程标准。
6
+
7
+ `jhste-skills` 为 Codex、Claude Code 等 AI 编程代理提供一套共享的工程工作流。它帮助代理在修改代码前验证前提,优先遵循仓库本地说明,保持 API/database/automation 边界清晰,从 SRP(Single Responsibility Principle,单一职责原则)的角度检查每个模块是否只有一个明确职责,运行 changed-file guard,并在声明完成前执行 red-team code review。
8
+
9
+ 这个工具不会接管你的项目。仓库内的 `AGENTS.md`、`CLAUDE.md` 和 docs 始终是权威来源。默认设置是 advisory 模式,使用 marker-managed 方式管理变更,设计目标是低风险、容易试用。
10
+
11
+ Skills 设计为在需要时由代理自动使用。例如,代理修改 API 代码时会被引导使用 API/database boundary skill;在完成前会被引导使用 red-team review skill。你也可以直接调用某个 skill,例如:`use jhste-engineering-judgment to review this change premise`,或 `run jhste-red-team-review on this diff`。
12
+
13
+ ## 为什么要安装?
14
+
15
+ AI 编程代理很快,但经常以可预测的方式失败:
16
+
17
+ - 默默接受不清晰的需求或错误前提。
18
+ - 为了“帮忙”而扩大修改范围。
19
+ - 把 UI、route/controller、service、database、side effect 职责混在一个地方,破坏“一个模块,一个职责”原则(SRP)。
20
+ - 隐藏失败,或产生不安全的日志。
21
+ - 在变更代码尚未检查前就说“完成”。
22
+ - 当你切换机器或仓库时,忘记仓库特定规则。
23
+
24
+ `jhste-skills` 为代理提供一个可重复的工作循环,减少这些失败:
25
+
26
+ ```text
27
+ 在 non-trivial code change 前:
28
+ 检查目标、前提、ownership seam、data contract、failure path、SRP 职责
29
+
30
+ 修改过程中:
31
+ 将 repo-local instructions 视为权威
32
+
33
+ 代码修改后:
34
+ 在可用时运行快速 changed-file guard
35
+
36
+ 在说“完成”前:
37
+ 运行 read-only red-team code review
38
+
39
+ 如果出现 warning:
40
+ 尝试 bounded fix,重新检查,然后停止,避免无限循环
41
+ ```
42
+
43
+ 预期结果是更小的 diff、更清晰的 SRP 边界、更安全的 API/database 代码、更少的 silent assumption,以及更诚实的完成报告。
44
+
45
+ ## 谁适合安装?
46
+
47
+ 如果你符合以下情况,`jhste-skills` 值得安装:
48
+
49
+ - 在多个仓库中使用 Codex、Claude Code 或其他 coding agent;
50
+ - 希望代理在 non-trivial code change 前验证前提;
51
+ - 希望现有 repo docs 继续作为权威来源;
52
+ - 希望在提交前或声明完成前加入轻量 advisory check;
53
+ - 重视 SRP、API/database boundary、safe logging、input validation、side effect、automation reliability;
54
+ - 希望在不同机器和仓库之间快速恢复相同的 AI 编程工作习惯。
55
+
56
+ 如果你只想要一个 prompt 文件,或希望安装后立即启用 strict CI enforcement,或不想生成 `.jhste/` 文件和 bridge block,或期待这个工具自动重构代码,那它可能不适合你。
57
+
58
+ ## 快速开始
59
+
60
+ ```bash
61
+ npx jhste-skills install
62
+ ```
63
+
64
+ 也可以用 npm 全局安装 CLI,然后在任意仓库中使用。
65
+
66
+ ```bash
67
+ npm install -g jhste-skills
68
+ jhste-skills install
69
+ ```
70
+
71
+ 如果只想临时运行一次,请使用 `npx`。如果希望把 `jhste-skills` 作为常用 shell 命令,请使用 `npm install -g`。
72
+
73
+ 默认安装使用 Normal mode。
74
+
75
+ - 安装全部 bundled skills:jhste core skills + vendored workflow skills。
76
+ - 如果缺失,则创建 `.jhste/profile.yaml`。
77
+ - 启用 project guidance 时,在 `AGENTS.md` 或 `CLAUDE.md` 中添加或刷新 marker-managed bridge block。
78
+ - 在安全时安装 advisory pre-commit hook。
79
+ - 不修改 CI、目标仓库的 `package.json`、lockfile 或 source code。
80
+
81
+ 连接另一个仓库:
82
+
83
+ ```bash
84
+ cd /path/to/another-repo
85
+ jhste-skills connect
86
+ ```
87
+
88
+ 只安装 jhste core guardrail skills:
89
+
90
+ ```bash
91
+ npx jhste-skills install --skill-set core
92
+ ```
93
+
94
+ 手动运行 changed-file guard:
95
+
96
+ ```bash
97
+ jhste-skills guard --scope changed --format text --fail-on error
98
+ ```
99
+
100
+ 选择性运行 repo-wide advisory scan:
101
+
102
+ ```bash
103
+ jhste-skills deep-scan
104
+ ```
105
+
106
+ 移除 managed outputs:
107
+
108
+ ```bash
109
+ jhste-skills uninstall --yes --repo /path/to/repo
110
+ ```
111
+
112
+ `uninstall` 会移除 managed hook、marker-managed bridge block 和 manifest-managed skill directory。它不会触碰 non-managed file。只有当 `.jhste/profile.yaml` 仍然匹配 generated shape 时才会删除;如果 profile 已被修改,请先审查内容,再显式使用 `--force-profile`。
113
+
114
+ ## 安装模式
115
+
116
+ ```text
117
+ Minimal - 只安装 jhste core skills;不创建 project file 或 hook
118
+ Normal - 推荐默认值;all bundled skills + project profile/bridge + advisory pre-commit hook
119
+ Full - all bundled skills + profile/bridge + advisory pre-commit/pre-push hooks + deep scan
120
+ Custom - 通过面向效果的问题自定义安装范围
121
+ ```
122
+
123
+ `Full` 也遵守 safety contract。它不会覆盖 non-managed hook、source file、CI、`package.json` 或 lockfile,也不会启用 strict mode。Interactive Full mode 只询问自动检查行为:warning only、commit-time block,或 commit/push-time block。除非显式传入 `--hooks blocking`,否则 `--yes` 使用 warning-only。
124
+
125
+ ## Safety contract
126
+
127
+ `jhste-skills` 默认安全:
128
+
129
+ - repo-local `AGENTS.md`、`CLAUDE.md` 和 docs 始终是权威;
130
+ - 用户的显式指令决定任务 scope,但不会悄悄绕过已经验证的 safety/privacy/data-loss/repo-architecture constraint;
131
+ - 默认安装不修改 CI;
132
+ - 默认安装不修改目标 `package.json` 或 lockfile;
133
+ - 默认安装不会自动重构 source code;
134
+ - managed hook 默认是 advisory;
135
+ - strict mode 需要显式 opt-in;
136
+ - bridge block 使用 `<!-- jhste-skills:start -->` / `<!-- jhste-skills:end -->` marker;
137
+ - guard output 是 review evidence,不是 proof;
138
+ - guard runtime/config failure 必须与 rule violation 分开报告;
139
+ - install/update/uninstall flow 不触碰 non-managed hook、bridge text 或 skill directory。
140
+
141
+ ## Core jhste skills
142
+
143
+ 以下是 jhste 编写的 guardrail skills。它们默认作为 bundled skill set 的一部分安装。使用 `--skill-set core` 可以只安装这些 core skills。
144
+
145
+ | Skill | 何时使用 | 帮助减少什么 |
146
+ |---|---|---|
147
+ | [`setup`](skills/setup/SKILL.md)<br>安全安装 skill,避免 install/connect/update 覆盖现有项目说明 | 安装 kit 或连接仓库时 | Unsafe overwrite, unmanaged hook conflict, repo instruction replacement |
148
+ | [`jhste-engineering-judgment`](skills/jhste-engineering-judgment/SKILL.md)<br>pre-change 判断 skill,在改代码前验证目标、前提、scope、seam 和 failure path | non-trivial code change 前 | Blind agreement, scope creep, unverified assumption, unclear seam |
149
+ | [`jhste-code-quality`](skills/jhste-code-quality/SKILL.md)<br>检查 input validation、observable failure handling、secret-safe logging 的代码质量 skill | 编写或 review application code 时 | Unvalidated input, silent failure, secret logging, oversized file |
150
+ | [`jhste-architecture-review`](skills/jhste-architecture-review/SKILL.md)<br>检查 module boundary、side-effect placement 和 SRP 风险的架构 review skill | 修改 module boundary 或 app structure 时 | Pass-through abstraction, mixed responsibility, side-effect leakage |
151
+ | [`jhste-db-api-boundary`](skills/jhste-db-api-boundary/SKILL.md)<br>检查 API route、service、repository、SQL 之间职责和 data contract 的 boundary skill | 修改 API、controller、service、repository、SQL、persistence code 时 | Fat route, unsafe SQL, missing auth/data scoping, leaky DTO |
152
+ | [`jhste-crawler-automation`](skills/jhste-crawler-automation/SKILL.md)<br>检查 crawler/scraper/worker/scheduler 的 producer-consumer seam 和 side effect 的 automation skill | 修改 crawler、scraper、worker、scheduler、browser automation 时 | Fragile automation, unclear producer/consumer boundary, hidden side effect |
153
+ | [`jhste-red-team-review`](skills/jhste-red-team-review/SKILL.md)<br>read-only red-team code review skill,在完成前主动攻击性复查变更代码 | non-trivial code work 完成声明前 | Premature “done”, missed null/auth/env/write/API/performance risk |
154
+
155
+ ## Bundled workflow skills
156
+
157
+ Normal install 还会安装 14 个从 Matt Pocock 的 [`mattpocock/skills`](https://github.com/mattpocock/skills) vendoring 的 workflow skills。它们适用于 debugging、planning、architecture、issue workflow、prototyping 和 handoff。若不想安装它们,请使用 `--skill-set core`。
158
+
159
+ | Skill | 何时使用 |
160
+ |---|---|
161
+ | [`diagnose`](skills/diagnose/SKILL.md)<br>强制执行 reproduce、minimize、hypothesize、instrument、fix、regression-check 的诊断循环 skill | 系统性诊断 hard bug 或 performance regression 时 |
162
+ | [`diagnosing-bugs`](skills/diagnosing-bugs/SKILL.md)<br>围绕快速 pass/fail feedback loop 缩小 root cause 的 debugging skill | 需要 reproduce → minimise → hypothesise → instrument → fix 循环时 |
163
+ | [`grill-me`](skills/grill-me/SKILL.md)<br>持续提问,直到计划或设计没有明显空洞的 skill | 希望 agent 持续追问计划或设计直到清晰时 |
164
+ | [`grill-with-docs`](skills/grill-with-docs/SKILL.md)<br>在提问过程中记录 domain terms 和 decisions 的设计验证 skill | 希望在提问过程中更新 project vocabulary 和 docs/ADR 时 |
165
+ | [`grilling`](skills/grilling/SKILL.md)<br>在实现前用压力问题验证计划和设计的通用 grilling skill | 需要通用 plan/design stress-test 问题循环时 |
166
+ | [`domain-modeling`](skills/domain-modeling/SKILL.md)<br>让项目术语、domain model、architectural decision 更清晰的 skill | 调整 domain term、ubiquitous language、architectural decision 时 |
167
+ | [`codebase-design`](skills/codebase-design/SKILL.md)<br>用于 deep module、小 interface、清晰 seam 的代码库设计 skill | 需要更好的 module interface、seam、testability vocabulary 时 |
168
+ | [`improve-codebase-architecture`](skills/improve-codebase-architecture/SKILL.md)<br>发现 shallow module 和 coupling,并寻找 deepening opportunity 的架构 skill | 想寻找 deepening opportunity 并减少 architectural friction 时 |
169
+ | [`prototype`](skills/prototype/SKILL.md)<br>在正式实现前用 throwaway code 验证 logic 或 UI 方向的 prototyping skill | 想在确定 approach 前做 throwaway logic/UI prototype 时 |
170
+ | [`to-prd`](skills/to-prd/SKILL.md)<br>把对话 context 组织成 product requirements 的 PRD 写作 skill | 想把对话 context 转成 PRD 时 |
171
+ | [`to-issues`](skills/to-issues/SKILL.md)<br>把计划拆成可独立处理的 vertical-slice issues 的 skill | 想把 plan 拆成可独立推进的 implementation issues 时 |
172
+ | [`triage`](skills/triage/SKILL.md)<br>通过结构化 workflow 分类 issue 并决定下一步行动的 triage skill | 想用 structured triage workflow 处理 issue 时 |
173
+ | [`handoff`](skills/handoff/SKILL.md)<br>压缩 context,让下一个 agent 或 session 能继续工作的 handoff skill | 想把 context 交给另一个 agent 或 session 时 |
174
+ | [`write-a-skill`](skills/write-a-skill/SKILL.md)<br>用正确结构和 progressive disclosure 创建 agent skill 的 skill-writing skill | 想创建或改进 agent skill 时 |
175
+
176
+ ## Attribution: Matt Pocock skills
177
+
178
+ 本仓库从 Matt Pocock 的 [`mattpocock/skills`](https://github.com/mattpocock/skills) vendoring 了上面列出的 14 个 skills。
179
+
180
+ 这些 skills 按 upstream MIT License vendoring。本仓库保留所需 copyright/license notice,并记录导入来源。
181
+
182
+ - Upstream: [`mattpocock/skills`](https://github.com/mattpocock/skills)
183
+ - License: MIT
184
+ - Attribution: [`vendor/matt-pocock/NOTICE.md`](vendor/matt-pocock/NOTICE.md)
185
+ - Upstream license copy: [`vendor/matt-pocock/LICENSE`](vendor/matt-pocock/LICENSE)
186
+ - Allowlist: [`vendor/matt-pocock/allowlist.json`](vendor/matt-pocock/allowlist.json)
187
+ - Source lock: [`vendor/matt-pocock/source-lock.json`](vendor/matt-pocock/source-lock.json)
188
+
189
+ 未经单独审查,不要添加 allowlist 外的 vendored skill。更新 vendored copy 时,必须刷新 source lock 并审查 diff。
190
+
191
+ ## CLI commands
192
+
193
+ ```bash
194
+ jhste-skills install
195
+ jhste-skills connect
196
+ jhste-skills guard
197
+ jhste-skills deep-scan
198
+ jhste-skills tune
199
+ jhste-skills baseline
200
+ jhste-skills sync
201
+ jhste-skills update
202
+ jhste-skills hooks
203
+ jhste-skills uninstall
204
+ ```
205
+
206
+ 详细 command behavior 请参考 [`docs/CLI.md`](docs/CLI.md)。
207
+
208
+ ## 推荐 rollout
209
+
210
+ 1. 先运行默认安装,并 dogfood advisory workflow。
211
+ 2. 一开始保留 advisory hook。如果不想要 commit-time check,使用 `--skip-hooks`;只有在充分检查 noise 和 false positive 后才启用 blocking mode。
212
+ 3. 先使用默认 300-line advisory limit。只有团队准备接受 warning-level hook enforcement 时,才使用 `--line-limit-mode blocking`。
213
+ 4. 修改代码时,手动运行 `guard --scope changed --format text --fail-on error`。
214
+ 5. non-trivial code change 前,用 `jhste-engineering-judgment` 检查 scope、seam、failure path、data contract、assumption,以及每个 changed class/module/function 的 main responsibility。
215
+ 6. non-trivial code work 完成声明前,使用 `jhste-red-team-review`。跳过 docs-only、comment-only、formatting-only、trivial rename-only 变更。
216
+ 7. fix + re-review 最多重复两轮,然后报告剩余 risk,避免无限循环。
217
+ 8. 只有在审查 existing debt 后才创建 baseline。将 baseline 视为 known-issues ledger,用 ratchet 阻止 new debt,而不是隐藏 scanner failure。
218
+
219
+ ## Repository layout
220
+
221
+ ```text
222
+ skills/ AI-readable skill guidance
223
+ rules/ skills 和 scan 使用的 stable rule metadata
224
+ packs/ core、web、API、database、crawler rule bundle
225
+ adapters/ Codex、Claude、generic adapter notes
226
+ cli/ install、uninstall、deep-scan、guard、hooks、tune、baseline commands
227
+ vendor/matt-pocock/ Matt Pocock allowlist、source lock、license、attribution
228
+ examples/profile.yaml default advisory profile example
229
+ ```
230
+
231
+ ## Verification
232
+
233
+ ```bash
234
+ npm test
235
+ npm run public-safety:check
236
+ npm run vendor:check
237
+ npm run docs:check
238
+ ```
239
+
240
+ Release acceptance notes 请参考 [`docs/ACCEPTANCE_CHECK.md`](docs/ACCEPTANCE_CHECK.md)。
241
+
242
+ ## 哲学
243
+
244
+ `jhste-skills` 不是为了给 agent 更多权限。它是为了让快速的 agent 更可靠。
245
+
246
+ - 不盲目同意。
247
+ - 不覆盖 local project authority。
248
+ - 保持变更范围受控。
249
+ - 从 SRP 角度命名 responsibility boundary。
250
+ - 让 failure observable。
251
+ - 将 automated guard output 视为 evidence,而不是 proof。
252
+ - 在称 non-trivial work 完成前执行 red-team code review。
253
+
254
+ 快速的 agent 需要 guardrail。`jhste-skills` 为它们提供 repo-respecting engineering workflow。
@@ -0,0 +1,7 @@
1
+ # Claude adapter
2
+
3
+ The Claude adapter uses the same safe profile and can append the bridge block to `CLAUDE.md` when that file already exists and no jhste bridge is present.
4
+
5
+ Default install does not overwrite existing Claude skills. If a skill name conflicts, keep the existing copy unless the user explicitly approves replacement.
6
+
7
+ Explicit user instructions set task scope but do not silently override verified safety, privacy, data-loss, or repo-architecture constraints.
@@ -0,0 +1,25 @@
1
+ # Codex adapter
2
+
3
+ The Codex adapter keeps repository instructions authoritative and uses a short bridge block in `AGENTS.md` when that file already exists.
4
+
5
+ Bridge block:
6
+
7
+ ```md
8
+ ## Agent skills
9
+ This repo uses jhste skills as shared guidance.
10
+ Repo-local instructions in this file remain authoritative.
11
+ See `.jhste/profile.yaml` for local skill preferences.
12
+ Before non-trivial code changes, use the `jhste-engineering-judgment` skill to check scope, seams, failure paths, and assumptions.
13
+ For changed code, name the one main responsibility of each changed class, module, and function, and reject adjacent responsibilities unless they are on the changed execution path and prevent a concrete failure.
14
+ After code changes, run `jhste-skills guard --scope changed --format text --fail-on error` when available.
15
+ Report guard warnings/errors; do not treat guard runtime/config failures as validation success.
16
+ Treat guard output as review evidence, not proof by itself.
17
+ If guard or red-team review reports new warnings on changed files, attempt a bounded fix before declaring completion, then rerun guard. Do not commit automatically.
18
+ Before declaring non-trivial code work complete, use the `jhste-red-team-review` skill.
19
+ Skip red-team review for docs-only, comment-only, formatting-only, or trivial rename-only changes.
20
+ Do not enter an unbounded fix/review loop; stop after at most two fix + re-review cycles and report remaining risks.
21
+ ```
22
+
23
+ Default install copies skills to a kit-managed skill directory and does not delete or rewrite existing Codex skills.
24
+
25
+ Explicit user instructions set task scope but do not silently override verified safety, privacy, data-loss, or repo-architecture constraints.
@@ -0,0 +1,7 @@
1
+ # Generic adapter
2
+
3
+ Use the generic adapter when an AI coding tool has no first-class adapter yet. Point the tool at this kit's `skills/` directory or copy selected skills into a user-managed directory.
4
+
5
+ The same priority applies: explicit user instruction, repo-local instructions, profile, shared skills, then general principles.
6
+
7
+ Explicit user instructions set task scope but do not silently override verified safety, privacy, data-loss, or repo-architecture constraints.
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import path from 'node:path';
4
+ import { confirmWriteAction, findGitRoot, parseArgs, relativeDisplay, KIT_ROOT } from './shared.mjs';
5
+
6
+ async function main() {
7
+ const args = parseArgs(process.argv.slice(2));
8
+ const repoRoot = findGitRoot(args.repo || process.cwd());
9
+ const baselinePath = path.join(repoRoot, '.jhste', 'baseline.json');
10
+ console.log('Baseline is optional and does not enable strict mode by itself.');
11
+ console.log('Think of it as a known-issues ledger: matched findings remain visible until fixed or explicitly tracked.');
12
+ const shouldWrite = await confirmWriteAction(args, {
13
+ action: 'baseline',
14
+ repoRoot,
15
+ changedFiles: [baselinePath],
16
+ prompt: `Create/update ${relativeDisplay(repoRoot, baselinePath)} from guard --scope all? [y/N] `,
17
+ });
18
+ if (!shouldWrite) {
19
+ console.log('No baseline created.');
20
+ return;
21
+ }
22
+ const result = spawnSync(process.execPath, [path.join(KIT_ROOT, 'cli', 'guard.mjs'), '--repo', repoRoot, '--scope', 'all', '--baseline', 'update', '--format', 'text', '--fail-on', 'none'], {
23
+ cwd: repoRoot,
24
+ stdio: 'inherit',
25
+ });
26
+ process.exit(result.status ?? 1);
27
+ }
28
+
29
+ main().catch((error) => {
30
+ console.error(error instanceof Error ? error.message : String(error));
31
+ process.exit(1);
32
+ });