create-einja-app 0.1.1
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 +307 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1041 -0
- package/dist/cli.js.map +1 -0
- package/package.json +62 -0
- package/templates/turborepo-pandacss/.biomeignore +15 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/biome-format.sh +49 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/design-doc-check.sh +61 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/detect-secrets.sh +62 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/large-file-warning.sh +42 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/playwright-resize.sh +36 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/typecheck.sh +37 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/unset-volta-recursion.sh +32 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/validate-git-commit.sh +239 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/warn-index-ts.sh +34 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/warn-relative-import.sh +48 -0
- package/templates/turborepo-pandacss/.claude/settings.json +174 -0
- package/templates/turborepo-pandacss/.claude/skills/create-einja-app-release/SKILL.md +186 -0
- package/templates/turborepo-pandacss/.claude/skills/dev-cli-release/SKILL.md +173 -0
- package/templates/turborepo-pandacss/.cursor/commands/spec-create.md +227 -0
- package/templates/turborepo-pandacss/.cursor/commands/start-dev.md +98 -0
- package/templates/turborepo-pandacss/.cursor/commands/task-exec.md +287 -0
- package/templates/turborepo-pandacss/.cursor/commands/task-vibe-kanban-loop.md +532 -0
- package/templates/turborepo-pandacss/.cursor/commands/update-docs-by-task-specs.md +448 -0
- package/templates/turborepo-pandacss/.cursor/mcp.json +45 -0
- package/templates/turborepo-pandacss/.cursor/rules/api-rules.mdc +171 -0
- package/templates/turborepo-pandacss/.cursor/rules/api-test-rules.mdc +181 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-code.mdc +70 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-commit-rules.mdc +174 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-design.mdc +12 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-rules.mdc +231 -0
- package/templates/turborepo-pandacss/.cursor/rules/error-handling-rules.mdc +188 -0
- package/templates/turborepo-pandacss/.cursor/rules/refactor-rules.mdc +93 -0
- package/templates/turborepo-pandacss/.dockerignore +126 -0
- package/templates/turborepo-pandacss/.einja-sync.json +35 -0
- package/templates/turborepo-pandacss/.env.ci +25 -0
- package/templates/turborepo-pandacss/.env.example +35 -0
- package/templates/turborepo-pandacss/.env.personal.example +27 -0
- package/templates/turborepo-pandacss/.envrc +4 -0
- package/templates/turborepo-pandacss/.gitattributes +5 -0
- package/templates/turborepo-pandacss/.husky/pre-commit +1 -0
- package/templates/turborepo-pandacss/.lintstagedrc.js +24 -0
- package/templates/turborepo-pandacss/.mcp.json +45 -0
- package/templates/turborepo-pandacss/.node-version +1 -0
- package/templates/turborepo-pandacss/.templateignore +60 -0
- package/templates/turborepo-pandacss/.vscode/extensions.json +3 -0
- package/templates/turborepo-pandacss/CLAUDE.md +415 -0
- package/templates/turborepo-pandacss/README.md +322 -0
- package/templates/turborepo-pandacss/apps/web/middleware.ts +28 -0
- package/templates/turborepo-pandacss/apps/web/next.config.ts +10 -0
- package/templates/turborepo-pandacss/apps/web/package.json +80 -0
- package/templates/turborepo-pandacss/apps/web/panda.config.ts +114 -0
- package/templates/turborepo-pandacss/apps/web/postcss.config.cjs +6 -0
- package/templates/turborepo-pandacss/apps/web/public/file.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/globe.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/next.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/vercel.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/window.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/dashboard/page.tsx +79 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/data/_components/UserTable.tsx +203 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/data/page.tsx +57 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/layout-client.tsx +31 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/layout.tsx +17 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/profile/page.tsx +59 -0
- package/templates/turborepo-pandacss/apps/web/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/turborepo-pandacss/apps/web/src/app/api/auth/signup/route.ts +70 -0
- package/templates/turborepo-pandacss/apps/web/src/app/error.tsx +106 -0
- package/templates/turborepo-pandacss/apps/web/src/app/favicon.ico +0 -0
- package/templates/turborepo-pandacss/apps/web/src/app/global-error.tsx +110 -0
- package/templates/turborepo-pandacss/apps/web/src/app/globals.css +121 -0
- package/templates/turborepo-pandacss/apps/web/src/app/layout.tsx +28 -0
- package/templates/turborepo-pandacss/apps/web/src/app/not-found.tsx +54 -0
- package/templates/turborepo-pandacss/apps/web/src/app/page.module.css +165 -0
- package/templates/turborepo-pandacss/apps/web/src/app/page.test.tsx +52 -0
- package/templates/turborepo-pandacss/apps/web/src/app/page.tsx +284 -0
- package/templates/turborepo-pandacss/apps/web/src/app/signin/page.tsx +296 -0
- package/templates/turborepo-pandacss/apps/web/src/app/signup/page.tsx +395 -0
- package/templates/turborepo-pandacss/apps/web/src/application/use-cases/UserUseCases.test.ts +229 -0
- package/templates/turborepo-pandacss/apps/web/src/application/use-cases/UserUseCases.ts +115 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/login-button.tsx +35 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/logout-button.tsx +24 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/user-avatar.test.tsx +68 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/user-avatar.tsx +43 -0
- package/templates/turborepo-pandacss/apps/web/src/components/dashboard/dashboard-stats.tsx +128 -0
- package/templates/turborepo-pandacss/apps/web/src/components/providers/query-provider.tsx +30 -0
- package/templates/turborepo-pandacss/apps/web/src/components/providers/session-provider.tsx +12 -0
- package/templates/turborepo-pandacss/apps/web/src/components/shared/Sidebar.tsx +175 -0
- package/templates/turborepo-pandacss/apps/web/src/components/shared/header.tsx +166 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/accordion.tsx +64 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/alert-dialog.tsx +135 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/alert.tsx +60 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/aspect-ratio.tsx +9 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/avatar.tsx +41 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/badge.tsx +39 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/breadcrumb.tsx +101 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/button.tsx +56 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/card.tsx +75 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/checkbox.tsx +29 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/data-table.tsx +189 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/dialog-hook.tsx +210 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/dialog.tsx +129 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/drawer.tsx +124 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/dropdown-menu.tsx +228 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/form.tsx +152 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/hover-card.tsx +38 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/input.tsx +21 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/label.tsx +21 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/pagination.tsx +105 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/popover.tsx +42 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/progress.tsx +28 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/select.tsx +170 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/separator.tsx +28 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/skeleton.tsx +13 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/sonner.tsx +25 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/table.tsx +92 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/tabs.tsx +54 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/textarea.tsx +18 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/tooltip.tsx +57 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/typography.tsx +158 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/auth/guard.ts +36 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/auth/index.ts +22 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/prisma.ts +3 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/utils.ts +6 -0
- package/templates/turborepo-pandacss/apps/web/test/globals.d.ts +1 -0
- package/templates/turborepo-pandacss/apps/web/test/matchers.d.ts +1 -0
- package/templates/turborepo-pandacss/apps/web/test/setup.ts +22 -0
- package/templates/turborepo-pandacss/apps/web/tsconfig.json +37 -0
- package/templates/turborepo-pandacss/apps/web/vitest.config.ts +20 -0
- package/templates/turborepo-pandacss/apps/web/vitest.d.ts +2 -0
- package/templates/turborepo-pandacss/biome.json +60 -0
- package/templates/turborepo-pandacss/components.json +21 -0
- package/templates/turborepo-pandacss/docker-compose.yml +27 -0
- package/templates/turborepo-pandacss/middleware.ts +32 -0
- package/templates/turborepo-pandacss/next.config.ts +10 -0
- package/templates/turborepo-pandacss/package-lock.json +9346 -0
- package/templates/turborepo-pandacss/package.json +64 -0
- package/templates/turborepo-pandacss/packages/config/package.json +41 -0
- package/templates/turborepo-pandacss/packages/config/panda.config.ts +114 -0
- package/templates/turborepo-pandacss/packages/config/src/index.ts +24 -0
- package/templates/turborepo-pandacss/packages/config/src/worktree-config-loader.ts +129 -0
- package/templates/turborepo-pandacss/packages/config/src/worktree-config.ts +75 -0
- package/templates/turborepo-pandacss/packages/config/tsconfig.build.json +19 -0
- package/templates/turborepo-pandacss/packages/config/tsconfig.json +24 -0
- package/templates/turborepo-pandacss/packages/config/typescript/base.json +19 -0
- package/templates/turborepo-pandacss/packages/front-core/package.json +24 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/config.ts +84 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/index.ts +5 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/types/next-auth.d.ts +20 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/utils.ts +29 -0
- package/templates/turborepo-pandacss/packages/front-core/src/context/index.ts +2 -0
- package/templates/turborepo-pandacss/packages/front-core/src/hooks/index.ts +2 -0
- package/templates/turborepo-pandacss/packages/front-core/src/index.ts +4 -0
- package/templates/turborepo-pandacss/packages/front-core/src/utils/index.ts +2 -0
- package/templates/turborepo-pandacss/packages/front-core/tsconfig.json +14 -0
- package/templates/turborepo-pandacss/packages/server-core/package.json +32 -0
- package/templates/turborepo-pandacss/packages/server-core/prisma/schema.prisma +102 -0
- package/templates/turborepo-pandacss/packages/server-core/prisma/seed.ts +67 -0
- package/templates/turborepo-pandacss/packages/server-core/prisma.config.ts +8 -0
- package/templates/turborepo-pandacss/packages/server-core/src/__generated__/fabbrica/index.d.ts +270 -0
- package/templates/turborepo-pandacss/packages/server-core/src/__generated__/fabbrica/index.js +484 -0
- package/templates/turborepo-pandacss/packages/server-core/src/core/result.test.ts +78 -0
- package/templates/turborepo-pandacss/packages/server-core/src/core/result.ts +53 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/.gitkeep +0 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/entities/User.test.ts +232 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/entities/User.ts +105 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/repository-interfaces/IUserRepository.ts +101 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/client.ts +15 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/mappers/UserMapper.test.ts +278 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/mappers/UserMapper.ts +103 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/repositories/UserRepository.test.ts +317 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/repositories/UserRepository.ts +169 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/factories/index.ts +22 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/factories/user.factory.ts +123 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/fixtures/users.ts +92 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/helpers/date.ts +49 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/helpers/password.ts +50 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/index.ts +26 -0
- package/templates/turborepo-pandacss/packages/server-core/tsconfig.json +14 -0
- package/templates/turborepo-pandacss/packages/server-core/vitest.config.ts +15 -0
- package/templates/turborepo-pandacss/packages/ui/package.json +37 -0
- package/templates/turborepo-pandacss/packages/ui/src/accordion.tsx +66 -0
- package/templates/turborepo-pandacss/packages/ui/src/alert-dialog.tsx +157 -0
- package/templates/turborepo-pandacss/packages/ui/src/alert.tsx +66 -0
- package/templates/turborepo-pandacss/packages/ui/src/aspect-ratio.tsx +11 -0
- package/templates/turborepo-pandacss/packages/ui/src/avatar.tsx +53 -0
- package/templates/turborepo-pandacss/packages/ui/src/badge.tsx +46 -0
- package/templates/turborepo-pandacss/packages/ui/src/breadcrumb.tsx +108 -0
- package/templates/turborepo-pandacss/packages/ui/src/button.tsx +59 -0
- package/templates/turborepo-pandacss/packages/ui/src/card.tsx +92 -0
- package/templates/turborepo-pandacss/packages/ui/src/checkbox.tsx +32 -0
- package/templates/turborepo-pandacss/packages/ui/src/data-table.tsx +216 -0
- package/templates/turborepo-pandacss/packages/ui/src/dialog-hook.tsx +226 -0
- package/templates/turborepo-pandacss/packages/ui/src/dialog.tsx +143 -0
- package/templates/turborepo-pandacss/packages/ui/src/drawer.tsx +135 -0
- package/templates/turborepo-pandacss/packages/ui/src/dropdown-menu.tsx +257 -0
- package/templates/turborepo-pandacss/packages/ui/src/form.tsx +168 -0
- package/templates/turborepo-pandacss/packages/ui/src/hover-card.tsx +44 -0
- package/templates/turborepo-pandacss/packages/ui/src/input.tsx +21 -0
- package/templates/turborepo-pandacss/packages/ui/src/label.tsx +24 -0
- package/templates/turborepo-pandacss/packages/ui/src/lib/utils.ts +6 -0
- package/templates/turborepo-pandacss/packages/ui/src/pagination.tsx +126 -0
- package/templates/turborepo-pandacss/packages/ui/src/popover.tsx +48 -0
- package/templates/turborepo-pandacss/packages/ui/src/progress.tsx +31 -0
- package/templates/turborepo-pandacss/packages/ui/src/select.tsx +185 -0
- package/templates/turborepo-pandacss/packages/ui/src/separator.tsx +28 -0
- package/templates/turborepo-pandacss/packages/ui/src/skeleton.tsx +13 -0
- package/templates/turborepo-pandacss/packages/ui/src/sonner.tsx +25 -0
- package/templates/turborepo-pandacss/packages/ui/src/table.tsx +116 -0
- package/templates/turborepo-pandacss/packages/ui/src/tabs.tsx +66 -0
- package/templates/turborepo-pandacss/packages/ui/src/textarea.tsx +18 -0
- package/templates/turborepo-pandacss/packages/ui/src/tooltip.tsx +61 -0
- package/templates/turborepo-pandacss/packages/ui/src/typography.tsx +187 -0
- package/templates/turborepo-pandacss/packages/ui/tsconfig.json +20 -0
- package/templates/turborepo-pandacss/panda.config.ts +114 -0
- package/templates/turborepo-pandacss/pnpm-lock.yaml +9032 -0
- package/templates/turborepo-pandacss/pnpm-workspace.yaml +11 -0
- package/templates/turborepo-pandacss/postcss.config.cjs +6 -0
- package/templates/turborepo-pandacss/prisma/schema.prisma +82 -0
- package/templates/turborepo-pandacss/public/file.svg +1 -0
- package/templates/turborepo-pandacss/public/globe.svg +1 -0
- package/templates/turborepo-pandacss/public/next.svg +1 -0
- package/templates/turborepo-pandacss/public/vercel.svg +1 -0
- package/templates/turborepo-pandacss/public/window.svg +1 -0
- package/templates/turborepo-pandacss/scripts/cli-template-update.ts +387 -0
- package/templates/turborepo-pandacss/scripts/env-show.ts +129 -0
- package/templates/turborepo-pandacss/scripts/env.ts +555 -0
- package/templates/turborepo-pandacss/scripts/init.sh +92 -0
- package/templates/turborepo-pandacss/scripts/setup-dev.ts +640 -0
- package/templates/turborepo-pandacss/scripts/template-update.ts +277 -0
- package/templates/turborepo-pandacss/scripts/worktree/dev.ts +872 -0
- package/templates/turborepo-pandacss/test/globals.d.ts +1 -0
- package/templates/turborepo-pandacss/test/setup.ts +22 -0
- package/templates/turborepo-pandacss/tsconfig.json +46 -0
- package/templates/turborepo-pandacss/turbo.json +57 -0
- package/templates/turborepo-pandacss/vitest.config.ts +20 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# validate-git-commit.sh - git commitコマンドのメッセージ形式を検証
|
|
3
|
+
#
|
|
4
|
+
# 目的:
|
|
5
|
+
# - git commit実行前にコミットメッセージの形式を検証
|
|
6
|
+
# - 不適切なメッセージ(---、Markdown形式等)をブロック
|
|
7
|
+
# - コミットルール(docs/einja/steering/commit-rules.md)に準拠を強制
|
|
8
|
+
#
|
|
9
|
+
# 使用方法:
|
|
10
|
+
# - PreToolUse hookとして設定
|
|
11
|
+
# - exit code 0: 許可
|
|
12
|
+
# - exit code 2: ブロック(stderrがClaudeに送信される)
|
|
13
|
+
|
|
14
|
+
set -uo pipefail
|
|
15
|
+
|
|
16
|
+
# 標準入力からJSON入力を読み取る
|
|
17
|
+
input=$(cat)
|
|
18
|
+
|
|
19
|
+
# ツール名を取得
|
|
20
|
+
tool_name=$(echo "$input" | jq -r '.tool_name // empty')
|
|
21
|
+
|
|
22
|
+
# Bashツール以外は無視
|
|
23
|
+
if [[ "$tool_name" != "Bash" ]]; then
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# コマンドを取得
|
|
28
|
+
command=$(echo "$input" | jq -r '.tool_input.command // empty')
|
|
29
|
+
|
|
30
|
+
# git commitコマンドでない場合はスキップ(volta unset対応で部分マッチ)
|
|
31
|
+
if [[ ! "$command" =~ git[[:space:]]+commit ]]; then
|
|
32
|
+
exit 0
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# --amend のみの場合はスキップ(メッセージ変更なし)
|
|
36
|
+
# -m / --message がない場合のみスキップ
|
|
37
|
+
if [[ "$command" =~ --amend ]]; then
|
|
38
|
+
if [[ ! "$command" =~ -m ]] && [[ ! "$command" =~ --message ]]; then
|
|
39
|
+
exit 0
|
|
40
|
+
fi
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# -m / --message オプションがない場合はスキップ(インタラクティブエディタ使用)
|
|
44
|
+
if [[ ! "$command" =~ -m ]] && [[ ! "$command" =~ --message ]]; then
|
|
45
|
+
exit 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# コミットメッセージを抽出
|
|
49
|
+
commit_message=""
|
|
50
|
+
|
|
51
|
+
# パターン1: -m "message" / -m 'message' (スペースあり)
|
|
52
|
+
if [[ "$command" =~ -m[[:space:]]+\"([^\"]+)\" ]]; then
|
|
53
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
54
|
+
elif [[ "$command" =~ -m[[:space:]]+\'([^\']+)\' ]]; then
|
|
55
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
56
|
+
# パターン2: -m"message" / -m'message' (スペースなし)
|
|
57
|
+
elif [[ "$command" =~ -m\"([^\"]+)\" ]]; then
|
|
58
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
59
|
+
elif [[ "$command" =~ -m\'([^\']+)\' ]]; then
|
|
60
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
61
|
+
# パターン3: --message="message" / --message='message'
|
|
62
|
+
elif [[ "$command" =~ --message=\"([^\"]+)\" ]]; then
|
|
63
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
64
|
+
elif [[ "$command" =~ --message=\'([^\']+)\' ]]; then
|
|
65
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
66
|
+
# パターン4: --message "message" / --message 'message' (スペースあり)
|
|
67
|
+
elif [[ "$command" =~ --message[[:space:]]+\"([^\"]+)\" ]]; then
|
|
68
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
69
|
+
elif [[ "$command" =~ --message[[:space:]]+\'([^\']+)\' ]]; then
|
|
70
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
71
|
+
# パターン5: -m="message" / -m='message'
|
|
72
|
+
elif [[ "$command" =~ -m=\"([^\"]+)\" ]]; then
|
|
73
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
74
|
+
elif [[ "$command" =~ -m=\'([^\']+)\' ]]; then
|
|
75
|
+
commit_message="${BASH_REMATCH[1]}"
|
|
76
|
+
# パターン6: HEREDOC形式 -m "$(cat <<'EOF'...EOF)"
|
|
77
|
+
elif [[ "$command" =~ -m[[:space:]]*\"\$\(cat ]]; then
|
|
78
|
+
# HEREDOCからメッセージの最初の行を抽出
|
|
79
|
+
commit_message=$(echo "$command" | sed -n "/<<.*EOF/,/^EOF/p" | sed '1d;$d' | head -1)
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
# メッセージが取得できない場合は許可(予期しないパターン)
|
|
83
|
+
if [[ -z "$commit_message" ]]; then
|
|
84
|
+
exit 0
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# 変数参照の場合はスキップ(実行時まで値が確定しない)
|
|
88
|
+
if [[ "$commit_message" =~ ^\$ ]]; then
|
|
89
|
+
exit 0
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
# 最初の行(概要行)を取得
|
|
93
|
+
first_line=$(echo "$commit_message" | head -1)
|
|
94
|
+
|
|
95
|
+
# === 検証ルール ===
|
|
96
|
+
|
|
97
|
+
# 有効なプレフィックス一覧
|
|
98
|
+
VALID_PREFIXES="^(feat|fix|docs|style|refactor|test|chore):"
|
|
99
|
+
|
|
100
|
+
# ルール1: プレフィックスの存在確認
|
|
101
|
+
if ! echo "$first_line" | grep -qE "$VALID_PREFIXES"; then
|
|
102
|
+
cat >&2 <<ERRMSG
|
|
103
|
+
|
|
104
|
+
❌ コミットメッセージ形式エラー
|
|
105
|
+
|
|
106
|
+
検出されたメッセージ:
|
|
107
|
+
"$first_line"
|
|
108
|
+
|
|
109
|
+
問題:
|
|
110
|
+
有効なプレフィックスがありません。
|
|
111
|
+
|
|
112
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
113
|
+
⚡ 対処方法: /task-commit Skillを使用してください
|
|
114
|
+
|
|
115
|
+
このSkillはコミットルールに従って:
|
|
116
|
+
- 適切なプレフィックス(feat/fix/docs等)を付与
|
|
117
|
+
- 変更内容に応じたコミット分割を提案
|
|
118
|
+
- 日本語で明確なメッセージを生成
|
|
119
|
+
|
|
120
|
+
実行: Skill("task-commit") を呼び出す
|
|
121
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
122
|
+
|
|
123
|
+
参照: docs/einja/steering/commit-rules.md
|
|
124
|
+
|
|
125
|
+
ERRMSG
|
|
126
|
+
exit 2
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
# プレフィックス後の説明部分を抽出(禁止パターン検出に使用)
|
|
130
|
+
description=$(echo "$first_line" | sed -E 's/^(feat|fix|docs|style|refactor|test|chore):[[:space:]]*//')
|
|
131
|
+
|
|
132
|
+
# ルール2: プレフィックス後のメッセージが空でないか(3文字以上)
|
|
133
|
+
if [[ -z "$description" ]] || [[ ${#description} -lt 3 ]]; then
|
|
134
|
+
cat >&2 <<ERRMSG
|
|
135
|
+
|
|
136
|
+
❌ コミットメッセージ形式エラー
|
|
137
|
+
|
|
138
|
+
検出されたメッセージ:
|
|
139
|
+
"$first_line"
|
|
140
|
+
|
|
141
|
+
問題:
|
|
142
|
+
プレフィックス後の説明が不足しています。
|
|
143
|
+
具体的な変更内容を記述してください(3文字以上)。
|
|
144
|
+
|
|
145
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
|
+
⚡ 対処方法: /task-commit Skillを使用してください
|
|
147
|
+
|
|
148
|
+
このSkillはコミットルールに従って:
|
|
149
|
+
- 適切なプレフィックス(feat/fix/docs等)を付与
|
|
150
|
+
- 変更内容に応じたコミット分割を提案
|
|
151
|
+
- 日本語で明確なメッセージを生成
|
|
152
|
+
|
|
153
|
+
実行: Skill("task-commit") を呼び出す
|
|
154
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
155
|
+
|
|
156
|
+
参照: docs/einja/steering/commit-rules.md
|
|
157
|
+
|
|
158
|
+
ERRMSG
|
|
159
|
+
exit 2
|
|
160
|
+
fi
|
|
161
|
+
|
|
162
|
+
# ルール3: 明らかに不適切なメッセージのパターン検出(説明部分に対して適用)
|
|
163
|
+
INVALID_PATTERNS=(
|
|
164
|
+
"^---$"
|
|
165
|
+
"^\*\*.*\*\*$"
|
|
166
|
+
"^完了しました"
|
|
167
|
+
"^実装完了"
|
|
168
|
+
"^修正完了"
|
|
169
|
+
"^update$"
|
|
170
|
+
"^fix$"
|
|
171
|
+
"^changes$"
|
|
172
|
+
"^wip$"
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
for pattern in "${INVALID_PATTERNS[@]}"; do
|
|
176
|
+
if echo "$description" | grep -qiE "$pattern"; then
|
|
177
|
+
cat >&2 <<ERRMSG
|
|
178
|
+
|
|
179
|
+
❌ コミットメッセージ形式エラー
|
|
180
|
+
|
|
181
|
+
検出されたメッセージ:
|
|
182
|
+
"$first_line"
|
|
183
|
+
|
|
184
|
+
問題:
|
|
185
|
+
コミットメッセージの説明部分が不適切な形式です。
|
|
186
|
+
具体的な変更内容を記述してください。
|
|
187
|
+
|
|
188
|
+
禁止されたパターン: $pattern
|
|
189
|
+
|
|
190
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
191
|
+
⚡ 対処方法: /task-commit Skillを使用してください
|
|
192
|
+
|
|
193
|
+
このSkillはコミットルールに従って:
|
|
194
|
+
- 適切なプレフィックス(feat/fix/docs等)を付与
|
|
195
|
+
- 変更内容に応じたコミット分割を提案
|
|
196
|
+
- 日本語で明確なメッセージを生成
|
|
197
|
+
|
|
198
|
+
実行: Skill("task-commit") を呼び出す
|
|
199
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
200
|
+
|
|
201
|
+
参照: docs/einja/steering/commit-rules.md
|
|
202
|
+
|
|
203
|
+
ERRMSG
|
|
204
|
+
exit 2
|
|
205
|
+
fi
|
|
206
|
+
done
|
|
207
|
+
|
|
208
|
+
# ルール4: メッセージがMarkdown見出し形式でないか
|
|
209
|
+
if echo "$first_line" | grep -qE "^#{1,6}[[:space:]]"; then
|
|
210
|
+
cat >&2 <<ERRMSG
|
|
211
|
+
|
|
212
|
+
❌ コミットメッセージ形式エラー
|
|
213
|
+
|
|
214
|
+
検出されたメッセージ:
|
|
215
|
+
"$first_line"
|
|
216
|
+
|
|
217
|
+
問題:
|
|
218
|
+
Markdownの見出し形式(#)は使用できません。
|
|
219
|
+
プレフィックス形式で記述してください。
|
|
220
|
+
|
|
221
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
222
|
+
⚡ 対処方法: /task-commit Skillを使用してください
|
|
223
|
+
|
|
224
|
+
このSkillはコミットルールに従って:
|
|
225
|
+
- 適切なプレフィックス(feat/fix/docs等)を付与
|
|
226
|
+
- 変更内容に応じたコミット分割を提案
|
|
227
|
+
- 日本語で明確なメッセージを生成
|
|
228
|
+
|
|
229
|
+
実行: Skill("task-commit") を呼び出す
|
|
230
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
231
|
+
|
|
232
|
+
参照: docs/einja/steering/commit-rules.md
|
|
233
|
+
|
|
234
|
+
ERRMSG
|
|
235
|
+
exit 2
|
|
236
|
+
fi
|
|
237
|
+
|
|
238
|
+
# 全ての検証をパス
|
|
239
|
+
exit 0
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# warn-index-ts.sh - index.tsファイル作成時に警告を出すhook
|
|
3
|
+
|
|
4
|
+
# stdinからJSON入力を読み取る
|
|
5
|
+
input=$(cat)
|
|
6
|
+
|
|
7
|
+
# ツール名とファイルパスを抽出
|
|
8
|
+
tool_name=$(echo "$input" | jq -r '.tool_name // empty')
|
|
9
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty')
|
|
10
|
+
|
|
11
|
+
# Writeツールでindex.tsが作成された場合のみ警告
|
|
12
|
+
if [ "$tool_name" = "Write" ]; then
|
|
13
|
+
filename=$(basename "$file_path" 2>/dev/null)
|
|
14
|
+
|
|
15
|
+
if [ "$filename" = "index.ts" ]; then
|
|
16
|
+
# 警告メッセージを出力(stderrに出力してClaude Codeに表示)
|
|
17
|
+
echo "" >&2
|
|
18
|
+
echo "⚠️ 警告: index.ts ファイルが作成されました" >&2
|
|
19
|
+
echo " ファイル: $file_path" >&2
|
|
20
|
+
echo "" >&2
|
|
21
|
+
echo " index.ts は原則作成禁止です。" >&2
|
|
22
|
+
echo " 以下の理由から、明示的なファイル名の使用を推奨します:" >&2
|
|
23
|
+
echo " - import文の可読性向上" >&2
|
|
24
|
+
echo " - ファイル検索の容易さ" >&2
|
|
25
|
+
echo " - 循環参照の回避" >&2
|
|
26
|
+
echo "" >&2
|
|
27
|
+
|
|
28
|
+
# JSON出力で警告をClaudeに伝える(ブロックはしない)
|
|
29
|
+
echo '{"decision":"approve","systemMessage":"⚠️ index.ts ファイルが作成されました。index.ts は原則作成禁止です。明示的なファイル名に変更することを検討してください。"}'
|
|
30
|
+
exit 0
|
|
31
|
+
fi
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
exit 0
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# warn-relative-import.sh - 相対パスimportを検出して警告するhook
|
|
3
|
+
|
|
4
|
+
# stdinからJSON入力を読み取る
|
|
5
|
+
input=$(cat)
|
|
6
|
+
|
|
7
|
+
# ファイルパスを抽出
|
|
8
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty')
|
|
9
|
+
|
|
10
|
+
# ファイルが存在しない場合は終了
|
|
11
|
+
if [ -z "$file_path" ] || [ ! -f "$file_path" ]; then
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# TypeScript/JavaScript/TSX/JSXファイルのみチェック
|
|
16
|
+
if [[ ! "$file_path" =~ \.(ts|tsx|js|jsx)$ ]]; then
|
|
17
|
+
exit 0
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# テストファイルは除外(テストでは相対パスが許容される場合がある)
|
|
21
|
+
if [[ "$file_path" =~ \.(test|spec)\.(ts|tsx|js|jsx)$ ]]; then
|
|
22
|
+
exit 0
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# 相対パスimportを検出(from './...' または from '../...')
|
|
26
|
+
relative_imports=$(grep -nE "from ['\"]\.\.?/" "$file_path" 2>/dev/null || true)
|
|
27
|
+
|
|
28
|
+
if [ -n "$relative_imports" ]; then
|
|
29
|
+
# 警告メッセージを出力
|
|
30
|
+
echo "" >&2
|
|
31
|
+
echo "Warning: Relative path import detected" >&2
|
|
32
|
+
echo " File: $file_path" >&2
|
|
33
|
+
echo "" >&2
|
|
34
|
+
echo " Detected imports:" >&2
|
|
35
|
+
echo "$relative_imports" | while read -r line; do
|
|
36
|
+
echo " $line" >&2
|
|
37
|
+
done
|
|
38
|
+
echo "" >&2
|
|
39
|
+
echo " Use alias paths (@/, @repo/) instead of relative paths (./,../)." >&2
|
|
40
|
+
echo " Example: import { Button } from \"@repo/ui/components/button\"" >&2
|
|
41
|
+
echo "" >&2
|
|
42
|
+
|
|
43
|
+
# JSON出力で警告をClaudeに伝える(ブロックはしない)
|
|
44
|
+
echo '{"decision":"approve","systemMessage":"Warning: Relative path import detected. Use alias paths (@/, @repo/) instead of relative paths (./,../)."}'
|
|
45
|
+
exit 0
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
exit 0
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"includeCoAuthoredBy": false,
|
|
3
|
+
"permissions": {
|
|
4
|
+
"allow": [
|
|
5
|
+
"Bash(npm:*)",
|
|
6
|
+
"Bash(git:*)",
|
|
7
|
+
"Bash(ls:*)",
|
|
8
|
+
"Bash(cd:*)",
|
|
9
|
+
"Bash(pwd:*)",
|
|
10
|
+
"Bash(cat:*)",
|
|
11
|
+
"Bash(grep:*)",
|
|
12
|
+
"Bash(find:*)",
|
|
13
|
+
"Bash(yarn:*)",
|
|
14
|
+
"Bash(pnpm:*)",
|
|
15
|
+
"Bash(bun:*)",
|
|
16
|
+
"Bash(npx:*)",
|
|
17
|
+
"Bash(node:*)",
|
|
18
|
+
"Bash(python3:*)",
|
|
19
|
+
"Bash(echo:*)",
|
|
20
|
+
"Bash(mkdir:*)",
|
|
21
|
+
"Bash(cp:*)",
|
|
22
|
+
"Bash(mv:*)",
|
|
23
|
+
"Bash(touch:*)",
|
|
24
|
+
"Bash(curl:*)",
|
|
25
|
+
"Bash(wget:*)",
|
|
26
|
+
"Bash(unzip:*)",
|
|
27
|
+
"Bash(docker-compose :*)",
|
|
28
|
+
"Bash(jq:*)",
|
|
29
|
+
"WebFetch",
|
|
30
|
+
"WebFetch(domain:*)",
|
|
31
|
+
"WebSearch",
|
|
32
|
+
"LS(*)",
|
|
33
|
+
"Read(**)",
|
|
34
|
+
"Read(//private/tmp/**)",
|
|
35
|
+
"Glob(*)",
|
|
36
|
+
"Grep(*)",
|
|
37
|
+
"Edit(**)",
|
|
38
|
+
"MultiEdit(**)",
|
|
39
|
+
"Write",
|
|
40
|
+
"Task(*)",
|
|
41
|
+
"TodoRead(*)",
|
|
42
|
+
"TodoWrite(*)",
|
|
43
|
+
"NotebookRead(*)",
|
|
44
|
+
"NotebookEdit(*)",
|
|
45
|
+
"mcp__codex__codex",
|
|
46
|
+
"mcp__github__get_pull_request",
|
|
47
|
+
"mcp__github__get_pull_request_files",
|
|
48
|
+
"mcp__github__update_pull_request",
|
|
49
|
+
"mcp__github__list_commits",
|
|
50
|
+
"mcp__github__get_commit",
|
|
51
|
+
"mcp__github__get_file_contents",
|
|
52
|
+
"mcp__github__search_code",
|
|
53
|
+
"mcp__playwright",
|
|
54
|
+
"mcp__playwright__browser_navigate",
|
|
55
|
+
"mcp__playwright__browser_click",
|
|
56
|
+
"mcp__playwright__browser_wait_for",
|
|
57
|
+
"mcp__playwright__browser_evaluate",
|
|
58
|
+
"mcp__playwright__browser_snapshot",
|
|
59
|
+
"mcp__playwright__browser_console_messages",
|
|
60
|
+
"mcp__playwright__browser_handle_dialog",
|
|
61
|
+
"mcp__playwright__browser_type",
|
|
62
|
+
"mcp__serena",
|
|
63
|
+
"mcp__serena__activate_project",
|
|
64
|
+
"mcp__serena__check_onboarding_performed",
|
|
65
|
+
"mcp__serena__find_file",
|
|
66
|
+
"mcp__serena__find_referencing_symbols",
|
|
67
|
+
"mcp__serena__find_symbol",
|
|
68
|
+
"mcp__serena__get_symbols_overview",
|
|
69
|
+
"mcp__serena__insert_before_symbol",
|
|
70
|
+
"mcp__serena__list_dir",
|
|
71
|
+
"mcp__serena__replace_symbol_body",
|
|
72
|
+
"mcp__serena__search_for_pattern",
|
|
73
|
+
"mcp__serena__think_about_collected_information",
|
|
74
|
+
"mcp__serena__think_about_whether_you_are_done",
|
|
75
|
+
"Bash(test:*)",
|
|
76
|
+
"mcp__context7__resolve-library-id",
|
|
77
|
+
"mcp__context7__get-library-docs",
|
|
78
|
+
"mcp__n8n-mcp__search_nodes",
|
|
79
|
+
"mcp__n8n-mcp__get_node_documentation",
|
|
80
|
+
"mcp__n8n-mcp__search_templates",
|
|
81
|
+
"mcp__n8n-mcp__get_node",
|
|
82
|
+
"mcp__n8n-mcp__n8n_get_workflow",
|
|
83
|
+
"mcp__vibe_kanban__list_projects",
|
|
84
|
+
"mcp__vibe_kanban__list_tasks",
|
|
85
|
+
"mcp__vibe_kanban__get_task",
|
|
86
|
+
"mcp__vibe_kanban__create_task",
|
|
87
|
+
"mcp__vibe_kanban__update_task",
|
|
88
|
+
"mcp__vibe_kanban__delete_task",
|
|
89
|
+
"mcp__vibe_kanban__start_task_attempt"
|
|
90
|
+
],
|
|
91
|
+
"ask": [
|
|
92
|
+
"Bash(rm -rf:*)",
|
|
93
|
+
"Bash(rm -r -f:*)",
|
|
94
|
+
"Bash(rm -f -r:*)",
|
|
95
|
+
"Bash(rm:*)",
|
|
96
|
+
"Bash(sudo:*)",
|
|
97
|
+
"Bash(chmod:*)",
|
|
98
|
+
"Bash(chown:*)",
|
|
99
|
+
"Bash(kill:*)",
|
|
100
|
+
"Bash(pkill:*)",
|
|
101
|
+
"Bash(killall:*)"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"hooks": {
|
|
105
|
+
"PreToolUse": [
|
|
106
|
+
{
|
|
107
|
+
"matcher": "^Bash",
|
|
108
|
+
"hooks": [
|
|
109
|
+
{
|
|
110
|
+
"type": "command",
|
|
111
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/unset-volta-recursion.sh"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "command",
|
|
115
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/validate-git-commit.sh"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"matcher": "mcp__playwright__.*",
|
|
121
|
+
"hooks": [
|
|
122
|
+
{
|
|
123
|
+
"type": "command",
|
|
124
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/playwright-resize.sh"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"PostToolUse": [
|
|
130
|
+
{
|
|
131
|
+
"matcher": "Edit|Write",
|
|
132
|
+
"hooks": [
|
|
133
|
+
{
|
|
134
|
+
"type": "command",
|
|
135
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/biome-format.sh"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "command",
|
|
139
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/detect-secrets.sh"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"type": "command",
|
|
143
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/large-file-warning.sh"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"type": "command",
|
|
147
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/design-doc-check.sh"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"matcher": "Edit|Write",
|
|
153
|
+
"hooks": [
|
|
154
|
+
{
|
|
155
|
+
"type": "command",
|
|
156
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/typecheck.sh"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"matcher": "Write",
|
|
162
|
+
"hooks": [
|
|
163
|
+
{
|
|
164
|
+
"type": "command",
|
|
165
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/einja/warn-index-ts.sh"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"enabledPlugins": {
|
|
172
|
+
"code-simplifier@claude-plugins-official": true
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-einja-app-release
|
|
3
|
+
description: "create-einja-app パッケージをビルド・テストし、NPMに公開するSkill。create-einja-appの公開、リリース、publishが必要な場合に使用。"
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
- AskUserQuestion
|
|
11
|
+
- TodoWrite
|
|
12
|
+
- TodoRead
|
|
13
|
+
- Task
|
|
14
|
+
- MCPSearch
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# create-einja-app-release Skill: create-einja-app パッケージ公開エンジン
|
|
18
|
+
|
|
19
|
+
## 役割
|
|
20
|
+
|
|
21
|
+
`create-einja-app` パッケージをビルド・テストし、NPMに公開します。
|
|
22
|
+
|
|
23
|
+
## 参照ドキュメント
|
|
24
|
+
|
|
25
|
+
- `packages/create-einja-app/RELEASING.md` - 詳細なリリース手順、トラブルシューティング、NPM_TOKEN設定方法
|
|
26
|
+
|
|
27
|
+
## 実行手順
|
|
28
|
+
|
|
29
|
+
### 1. 前提条件の確認
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git branch --show-current # mainブランチであること
|
|
33
|
+
git status --porcelain # 未コミット変更の確認
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### 未コミット変更がある場合
|
|
37
|
+
|
|
38
|
+
**AskUserQuestion**で対処方法を確認:
|
|
39
|
+
|
|
40
|
+
- **コミットしてからリリース**: 全ての変更をコミット・プッシュ後にリリース
|
|
41
|
+
- **スタッシュしてリリース**: 変更を一時退避してリリース後に復元
|
|
42
|
+
- **そのままリリース**: 未コミット変更は放置し、**package.jsonのバージョン更新のみ**コミットしてリリース
|
|
43
|
+
|
|
44
|
+
### 2. バージョン種別の決定
|
|
45
|
+
|
|
46
|
+
現在のバージョンと最近の変更を表示後、**AskUserQuestion**で確認:
|
|
47
|
+
|
|
48
|
+
- patch(推奨): バグ修正・軽微な改善
|
|
49
|
+
- minor: 後方互換性のある機能追加
|
|
50
|
+
- major: 破壊的変更
|
|
51
|
+
|
|
52
|
+
### 3. ビルド・テスト
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pnpm -F create-einja-app build
|
|
56
|
+
pnpm -F create-einja-app test
|
|
57
|
+
pnpm -F create-einja-app typecheck
|
|
58
|
+
pnpm -F create-einja-app lint
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 4. バージョン更新・コミット・プッシュ
|
|
62
|
+
|
|
63
|
+
**注意**: `npm version` はデフォルトで `v{version}` タグを生成しますが、このワークフローでは `create-einja-app-v{version}` タグが必要です。そのため、タグは手動で作成します。
|
|
64
|
+
|
|
65
|
+
#### 通常パターン(未コミット変更なし)
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# 1. バージョンのみ更新(タグは作成しない)
|
|
69
|
+
npm version {patch|minor|major} --no-git-tag-version --prefix packages/create-einja-app
|
|
70
|
+
|
|
71
|
+
# 2. package.jsonの変更をコミット
|
|
72
|
+
git add packages/create-einja-app/package.json
|
|
73
|
+
git commit -m "chore(create-einja-app): v{version}にバージョンアップ"
|
|
74
|
+
|
|
75
|
+
# 3. 正しい形式のタグを手動作成
|
|
76
|
+
git tag create-einja-app-v{version}
|
|
77
|
+
|
|
78
|
+
# 4. プッシュ
|
|
79
|
+
git push origin main
|
|
80
|
+
git push origin create-einja-app-v{version}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### 未コミット変更ありでそのままリリースする場合
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm version {patch|minor|major} --no-git-tag-version --prefix packages/create-einja-app
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**重要**: 未コミット変更は放置し、**package.jsonのみ**をコミット:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# package.jsonのみステージング
|
|
93
|
+
git add packages/create-einja-app/package.json
|
|
94
|
+
|
|
95
|
+
# バージョン更新のみコミット
|
|
96
|
+
git commit -m "chore(create-einja-app): v{version}にバージョンアップ"
|
|
97
|
+
|
|
98
|
+
# タグ作成(create-einja-app-v形式)
|
|
99
|
+
git tag create-einja-app-v{version}
|
|
100
|
+
|
|
101
|
+
# プッシュ
|
|
102
|
+
git push origin main
|
|
103
|
+
git push origin create-einja-app-v{version}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
task-committer には委託しない(全変更をコミットしてしまうため)。
|
|
107
|
+
|
|
108
|
+
### 5. GitHub Actions 監視・自律修正
|
|
109
|
+
|
|
110
|
+
タグプッシュ後、GitHub Actions の完了を監視する。
|
|
111
|
+
|
|
112
|
+
#### 5.1 監視ループ
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# 最新のワークフロー実行を取得
|
|
116
|
+
gh run list --workflow=create-einja-app.yml --limit=1 --json databaseId,status,conclusion
|
|
117
|
+
|
|
118
|
+
# 出力例: [{"databaseId":123,"status":"in_progress","conclusion":null}]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- `status: in_progress` → 30秒待機して再確認
|
|
122
|
+
- `status: completed, conclusion: success` → 成功、ステップ6へ
|
|
123
|
+
- `status: completed, conclusion: failure` → 失敗、5.2へ
|
|
124
|
+
|
|
125
|
+
#### 5.2 失敗時の原因特定
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
gh run view {run_id} --log-failed
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### 5.3 原因別の自律修正
|
|
132
|
+
|
|
133
|
+
| 原因 | 対処 |
|
|
134
|
+
|------|------|
|
|
135
|
+
| ビルドエラー | コードを修正 |
|
|
136
|
+
| テストエラー | テストを修正 |
|
|
137
|
+
| NPM_TOKEN エラー | ユーザーに設定確認を依頼して終了 |
|
|
138
|
+
| バージョン重複 | 次のpatchバージョンで再実行 |
|
|
139
|
+
|
|
140
|
+
#### 5.4 修正後の再リリース
|
|
141
|
+
|
|
142
|
+
**重要**: 同じタグ名は使えないため、バージョンを上げて再リリース
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# 1. 修正をコミット
|
|
146
|
+
git add -A
|
|
147
|
+
git commit -m "fix(create-einja-app): CIエラーを修正"
|
|
148
|
+
|
|
149
|
+
# 2. 新しいバージョンに更新
|
|
150
|
+
npm version patch --no-git-tag-version --prefix packages/create-einja-app
|
|
151
|
+
|
|
152
|
+
# 3. バージョン更新をコミット
|
|
153
|
+
git add packages/create-einja-app/package.json
|
|
154
|
+
git commit -m "chore(create-einja-app): v{new_version}にバージョンアップ"
|
|
155
|
+
|
|
156
|
+
# 4. 新しいタグを作成・プッシュ
|
|
157
|
+
git tag create-einja-app-v{new_version}
|
|
158
|
+
git push origin main
|
|
159
|
+
git push origin create-einja-app-v{new_version}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### 5.5 リトライ制限
|
|
163
|
+
|
|
164
|
+
最大3回まで自動リトライ。3回失敗したらユーザーに報告して終了。
|
|
165
|
+
|
|
166
|
+
### 6. 完了報告
|
|
167
|
+
|
|
168
|
+
```markdown
|
|
169
|
+
## 📦 create-einja-app リリース完了
|
|
170
|
+
|
|
171
|
+
### リリース情報
|
|
172
|
+
- **バージョン**: {old} → {new}
|
|
173
|
+
- **タグ**: create-einja-app-v{version}
|
|
174
|
+
|
|
175
|
+
### GitHub Actions
|
|
176
|
+
- **ステータス**: ✅ SUCCESS
|
|
177
|
+
- **URL**: https://github.com/einja-inc/einja-management-template/actions/runs/{run_id}
|
|
178
|
+
|
|
179
|
+
### 確認コマンド
|
|
180
|
+
npm view create-einja-app
|
|
181
|
+
npx create-einja-app --version
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
**最終更新**: 2025-01-10
|