@cocorograph/hub-agent 0.6.68 → 0.6.69
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/package.json +1 -1
- package/src/claude-md.mjs +29 -4
package/package.json
CHANGED
package/src/claude-md.mjs
CHANGED
|
@@ -82,7 +82,7 @@ async function fetchRepositories({ hubUrl, accessToken, dirName, fetchImpl }) {
|
|
|
82
82
|
*
|
|
83
83
|
* リポジトリが 1 件もない場合は空文字列を返し、CLAUDE.md には何も追記しない。
|
|
84
84
|
*/
|
|
85
|
-
function renderRepositorySection(repositories) {
|
|
85
|
+
function renderRepositorySection(repositories, dirName = "") {
|
|
86
86
|
if (!Array.isArray(repositories) || repositories.length === 0) return ""
|
|
87
87
|
|
|
88
88
|
const lines = ["## Cockpit クローンレス開発フロー", ""]
|
|
@@ -136,11 +136,36 @@ function renderRepositorySection(repositories) {
|
|
|
136
136
|
lines.push("```")
|
|
137
137
|
lines.push("")
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
// デプロイ接続情報の安全な取得手順(秘匿値を会話に出さない)。
|
|
141
|
+
if (stagingName || productionName) {
|
|
142
|
+
const envExample = productionName ? "production" : "staging"
|
|
143
|
+
lines.push("**デプロイ接続情報の取得(秘匿値を会話に出さない)**:")
|
|
144
|
+
lines.push("")
|
|
145
|
+
lines.push("```bash")
|
|
146
|
+
lines.push(
|
|
147
|
+
"# 秘密鍵を ~/.ssh/hub_deploy/ に書き出し、ssh コマンドだけ受け取る",
|
|
148
|
+
)
|
|
149
|
+
lines.push(
|
|
150
|
+
`python3 ~/.claude/scripts/hub_helper.py deploy_creds ${dirName || "<dir_name>"} --env ${envExample}`,
|
|
151
|
+
)
|
|
152
|
+
lines.push("```")
|
|
153
|
+
lines.push("")
|
|
154
|
+
lines.push(
|
|
155
|
+
"返り値の `ssh_command` をそのまま使って接続します。`key_file` は",
|
|
156
|
+
"chmod 600 で書き出されます。パスワード認証のサーバーは `password_set: true`",
|
|
157
|
+
"だけ返るので、その場合は Hub の「サーバー情報」タブから人手で取得します。",
|
|
158
|
+
"",
|
|
159
|
+
)
|
|
160
|
+
}
|
|
139
161
|
}
|
|
140
162
|
|
|
163
|
+
lines.push("### デプロイ前の必須ガード", "")
|
|
141
164
|
lines.push(
|
|
142
|
-
"
|
|
143
|
-
"
|
|
165
|
+
"- **本番反映の前に必ず現状バックアップを取る**(DB ダンプ / 対象ディレクトリの退避)。",
|
|
166
|
+
"- ステージングで動作確認してから本番へ。",
|
|
167
|
+
"- 破壊的操作(`reset --hard` / `rm -rf` / DB 操作)の前に対象を確認する。",
|
|
168
|
+
"- Git 認証はローカルの `gh` CLI / SSH 鍵を使用します。",
|
|
144
169
|
"",
|
|
145
170
|
)
|
|
146
171
|
return lines.join("\n")
|
|
@@ -280,7 +305,7 @@ export async function ensureClaudeMd({
|
|
|
280
305
|
])
|
|
281
306
|
: [null, []]
|
|
282
307
|
|
|
283
|
-
const repositorySection = renderRepositorySection(repositories)
|
|
308
|
+
const repositorySection = renderRepositorySection(repositories, dirName)
|
|
284
309
|
const body = director
|
|
285
310
|
? renderWithDirector(dirName, director, repositorySection)
|
|
286
311
|
: renderPlaceholder(dirName, repositorySection)
|