@ryusenkei/conventions 0.4.0 → 0.5.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/README.md +1 -1
- package/files/pre-push +8 -3
- package/package.json +2 -2
- package/rules.md +10 -0
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ The PreToolUse hook blocks the call and tells Claude why, so Claude can fix it a
|
|
|
59
59
|
| Secrets | `permissions.deny` blocks reading `.env` and `.dev.vars` with Claude's file tools (not Bash) |
|
|
60
60
|
| Definition of done (`--stop`) | The Stop hook runs `pnpm lint` and `pnpm test` when the working tree has changes, and sends Claude back once on failure |
|
|
61
61
|
|
|
62
|
-
Commit messages are checked by `.githooks/commit-msg`, and edited files by prose-lint's PostToolUse hook. `.githooks/pre-push` runs `pnpm run --if-present check`, so a repository that defines a `check` script cannot push until it passes. It applies to people as well as Claude. When [
|
|
62
|
+
Commit messages are checked by `.githooks/commit-msg`, and edited files by prose-lint's PostToolUse hook. `.githooks/pre-push` runs `pnpm run --if-present check`, so a repository that defines a `check` script cannot push until it passes. It applies to people as well as Claude. When [loadslot](https://github.com/ryusenkei-inc/loadslot) (or `jobgate`, its former name) is on the `PATH` and the repository has a `check` script, the check runs through `loadslot run`, so pushes from parallel agents and repositories wait for free memory instead of exhausting it.
|
|
63
63
|
|
|
64
64
|
### Epic flow
|
|
65
65
|
|
package/files/pre-push
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# push の前の検査(`check` のスクリプトを持つリポのみ。CI の失敗・Actions の消費を手元で防止)
|
|
3
|
-
#
|
|
3
|
+
# loadslot があれば資源の空きを待って実行(並行するエージェント・リポの重い検査によるメモリの枯渇を防止)
|
|
4
4
|
# `check` のないリポは枠を待たない
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
# jobgate: loadslot の旧名(改名の前の版を入れたマシン向け)
|
|
6
|
+
if grep -q '"check":' package.json 2>/dev/null; then
|
|
7
|
+
for gate in loadslot jobgate; do
|
|
8
|
+
if command -v "$gate" >/dev/null 2>&1; then
|
|
9
|
+
exec "$gate" run --weight 2 -- pnpm run check
|
|
10
|
+
fi
|
|
11
|
+
done
|
|
7
12
|
fi
|
|
8
13
|
exec pnpm run --if-present check
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryusenkei/conventions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "RYUSENKEI のモノリポの共通の規約(Claude Code の規約・hook、共通ファイルの同期)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RYUSENKEI",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"provenance": true
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@ryusenkei/prose-lint": "^0.1.
|
|
37
|
+
"@ryusenkei/prose-lint": "^0.1.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^26.6.1",
|
package/rules.md
CHANGED
|
@@ -42,6 +42,16 @@
|
|
|
42
42
|
- dev のブランチへのマージは CI なし、pre-push の `pnpm check` が関門(チェックがある場合は成功が必要)
|
|
43
43
|
- `main` へのマージはデプロイのときだけ dev のブランチから
|
|
44
44
|
|
|
45
|
+
## CI(GitHub Actions)
|
|
46
|
+
|
|
47
|
+
- 非公開のリポ: GitHub Free の時間を節約(組織の合計で月2,000分、ジョブごとに分単位の切り上げ)
|
|
48
|
+
- 実行: `main` 行きの PR だけ。`main` への push では実行しない(マージの結果の ref を PR で検査済み)
|
|
49
|
+
- ジョブ: 1つに検査を順に並べる(並列の分割は切り上げと準備の時間を増加)
|
|
50
|
+
- 同じ PR の新しい実行で古い実行を中止(`concurrency` の `cancel-in-progress`)
|
|
51
|
+
- PR のタイトルの変更 `edited`: タイトルだけを検査する別のワークフロー(依存の導入なし)
|
|
52
|
+
- キャッシュ: キーにコミットの ID `github.sha` を含めない(保存が毎回走り、復元が効かない)
|
|
53
|
+
- Windows・macOS のランナー: 公開のリポだけ(非公開では2倍・10倍で計上)
|
|
54
|
+
|
|
45
55
|
## 完了の条件
|
|
46
56
|
|
|
47
57
|
- `pnpm lint`(型検査・prose-lint・共通ファイルの検査)と `pnpm test` が通過
|