Skip to content

improve(v3.2.69): templates/claude 全ファイル整合修正 — /loop 除去・Token配分・STABLE定義統一 - #235

Merged
Kensan196948G merged 2 commits into
mainfrom
improve/template-claude-cleanup-v3.2.69
Apr 22, 2026
Merged

Kensan196948G merged 2 commits into
mainfrom
improve/template-claude-cleanup-v3.2.69

Conversation

@Kensan196948G

@Kensan196948G Kensan196948G commented Apr 22, 2026 •

Copy link
Copy Markdown
Owner

変更内容

背景

Linux cron(月〜土・プロジェクト別・300分制限)が自律実行を担うことが確定したため、
テンプレートファイルから /loop / /schedule への参照を一括除去し、
各ファイル間の不整合を解消する。

修正一覧

ファイル 変更内容
_header.md /loop 登録ステップ削除 → Linux cron 運用の明記 / 指示確認プロトコル文言修正
01-session-startup.md LOOP_COMMANDS セクション削除 → セッション開始処理に変更
CLAUDE.md(テンプレート) Step 1 を「実行環境確認」に変更。/loop・/schedule 参照を除去
08-operations.md Token配分統一(Verify 20%→25%・Improvement 10%→15%・Debug 15%→10%・IssueFactory統廃合)。STABLE条件に lint success 追加
START_PROMPT.md Build-StartPrompt.ps1 で全ソースから再ビルド(895行)

Token配分の変更

フェーズ 変更前 変更後
Verify 20% 25%
Improvement 10% 15%
Debug 15% 10%
IssueFactory 5% 廃止(Release/Report に統合)

STABLE条件の変更

- test success
+ lint success  ← 追加
- build success
- CI success

影響範囲

  • Linux cron で起動された Claude が正しく Codex セットアップから開始できる
  • 不要な /loop 実行試行がなくなりトークンを節約できる
  • 全プロジェクトのテンプレートが次回 Sync-LauncherClaudeGlobalConfig 実行時に反映される

残課題

なし

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • セッション開始時の手動ループ登録ワークフローを削除し、Linux cron(平日中心・プロジェクト単位スケジュール)による自律実行に統一
    • セッション起動時にCodexセットアップ手順を統合
    • 安定性判定に lint 成功を追加
    • フェーズ別トークン配分を再調整し、Verify/Improvementの比率を増加、Debug関連を再編成

- _header.md / 01-session-startup.md: /loop 登録ステップを削除。
  Linux cron(月〜土・300分)が自律実行を担うため不要と明記。
- CLAUDE.md (template): Step 1 を「実行環境確認」に変更。
  /loop・/schedule コマンドの参照を除去。
- 08-operations.md: Token配分を CLAUDE.md と統一。
  Verify 20%→25% / Improvement 10%→15% / Debug 15%→10% / IssueFactory削除。
  STABLE条件に lint success を追加(build前の必須条件として明示)。
- START_PROMPT.md: Build-StartPrompt.ps1 で全ソースから再ビルド。

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 22, 2026 03:39
@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9f7f055e-577c-4ac6-8eaa-347647336332

📥 Commits

Reviewing files that changed from the base of the PR and between afb7ad3 and fe942da.

📒 Files selected for processing (1)
  • scripts/main/Start-ClaudeCode.ps1
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: PSScriptAnalyzer
  • GitHub Check: test-and-validate
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-22T02:58:51.028Z
Learning: Applies to Claude/templates/claude/**/*.md : Update README.md end-of-session with summary of development content, CI results, review results, rescue results, remaining tasks, and next actions
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-22T02:58:51.028Z
Learning: Applies to Claude/templates/claude/**/*.md : Update README.md with clear formatting using tables, icons, diagrams whenever functionality, setup, architecture, or quality gates change
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-22T02:58:51.028Z
Learning: Applies to Claude/templates/claude/**/*.{js,ts,tsx,jsx,py,java,go,rb,php,cs,cpp,c,h} : Use English for code comments (Japanese for project documentation and team communication)
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-22T02:58:51.028Z
Learning: Execute automatic session initialization (loop registration, Codex setup, autonomous development start) immediately upon reading this file, regardless of user message
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: All development work must be driven by GitHub Issues; work without an associated Issue is prohibited
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Direct push to main branch is prohibited; all changes must go through feature branches or WorkTrees with PR review before merge
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: CI must pass successfully before any merge is permitted; merging code with CI failures is prohibited
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Codex code review must be completed and approved before any merge; skipping or bypassing review is prohibited
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Maximum session duration is strictly 5 hours; work must be safely concluded with commit, push, PR creation, and state/progress saved before timeout
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Use Goal-Driven development model where development priorities are determined by state.json KPI achievement; issues are generated automatically when KPIs are unmet
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Development must follow the Monitor → Build → Verify → Improve loop cycle; each phase has specific responsibilities and prohibited actions to maintain workflow integrity
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Agent Teams framework must be used for complex tasks with clearly defined roles (CTO, ProductManager, Architect, Developer, Reviewer, Debugger, QA, Security, DevOps, Analyst, EvolutionManager, ReleaseManager); Agent log output must include icon, English name, and Japanese name
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Token allocation must follow the prescribed distribution (Monitor: 10%, Development: 35%, Verify: 25%, Improvement: 15%, Debug/Repair: 10%, Release/Report: 5%); adjust operations based on consumption thresholds (70%=stop Improvement, 85%=prioritize Verify, 95%=safe shutdown)
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Stability (STABLE) is achieved only when all criteria are met: test success, lint success, build success, CI success, review OK, security OK, zero errors; required consecutive success counts vary by change magnitude (small=2, normal=3, critical=5)
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: GitHub Projects status must be kept current through state transitions (Inbox → Backlog → Ready → Design → Development → Verify → Deploy Gate → Done/Blocked); update at session start/end and after each loop completion
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Code review must address all Critical and High severity findings from both Codex and CodeRabbit before merge; Medium findings should be fixed unless technical justification is documented; Low findings are optional
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Require design-first approach: establish requirements, target users, regulatory constraints, and acceptance criteria before implementation; ensure requirements flow through to testing without disconnection
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Auto Repair must be constrained: maximum 15 retries, block on same error after 3 occurrences, stop if no modification delta, stop if test improvements are absent, and halt on security blocker detection
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New

Timestamp: 2026-04-22T03:49:07.091Z
Learning: Codex rescue (debug) must follow minimal hypothesis-driven approach: one rescue = one hypothesis, apply minimal fixes only, avoid deep investigation, and limit same-cause rescues to maximum 3 attempts
🔇 Additional comments (2)
scripts/main/Start-ClaudeCode.ps1 (2)

85-100: LOOP任意化とフォールバック実装は適切です。

LOOP_COMMANDS欠落時の安全動作、PROMPT_BODY欠落時の全体フォールバック、FullTextの条件付き連結まで一貫しており、今回の目的に合っています。


419-423: 空の[LOOP_COMMANDS]表示を抑止できていて良いです。

非空時のみ出力する分岐で、SSH起動サマリーのノイズ削減と実態との整合が取れています。


📝 Walkthrough

Walkthrough

セッション開始テンプレート群と起動スクリプトを変更し、起動時の/loop//schedule登録ワークフローを削除してLinux cronによる自律実行を前提化、Codexセットアップ命令を起動直前に挿入、トークン配分とSTABLE判定条件を調整しました。

Changes

Cohort / File(s) Summary
セッション起動テンプレート
Claude/templates/claude/CLAUDE.md, Claude/templates/claude/START_PROMPT.md, Claude/templates/claude/instructions/01-session-startup.md, Claude/templates/claude/instructions/_header.md
/cron listによる登録判定および/loop//schedule登録フローを削除し、Linux cron(Mon–Sat・プロジェクト別・300分制限)による自律実行説明に置換。Codex起動コマンド(/codex:setup, /codex:status)をセッション開始直前に挿入。ステップ1をスキップして直接次へ遷移する制御へ変更。
運用ポリシー・配分更新
Claude/templates/claude/instructions/08-operations.md
トークン配分を再配分(Verify 20%→25%、Improvement 10%→15%、Debug→Debug/Repair 10%、IssueFactory→Release/Report 5%)。STABLE 判定に lint success を追加。
起動スクリプト
scripts/main/Start-ClaudeCode.ps1
Get-StartPromptSectionの堅牢化:## LOOP_COMMANDS が無い場合は例外を投げず空文字として扱う。## PROMPT_BODY が無い場合はファイル全体を PromptBody と扱う。FullText 組み立てを LoopCommands の存在に応じて条件付け、SSHモード出力で空の [LOOP_COMMANDS] 表示を抑制。

Sequence Diagram(s)

sequenceDiagram
  participant User as User/Starter
  participant Script as Start-ClaudeCode.ps1
  participant Codex as Codex (/codex:setup)
  participant Cron as Linux cron (system)

  User->>Script: セッション起動要求
  Script->>Codex: /codex:setup → /codex:status
  Codex-->>Script: セットアップ完了
  Script-->>User: セッション開始(/loop登録なし)
  note right of Cron: Linux cron が定期実行を担当\n(Mon–Sat・プロジェクト別・300分制限)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 ループはもう要らぬと知り
cron が静かに時を刻むよ
Codex は門を整え待ち構え
配分を正し、縫い直す夜
小さな足で祝杯を跳ねる 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、主な変更内容である「/loop 除去」「Token配分修正」「STABLE定義統一」を適切に要約しており、templates/claude の包括的な整合修正という全体の目的を明確に表現している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve/template-claude-cleanup-v3.2.69

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Claude templates under Claude/templates/claude to remove /loop and /schedule registration instructions (now handled by Linux cron), and to unify token allocation and STABLE criteria across the template docs.

Changes:

  • Remove /loop//schedule registration steps from template entrypoints and session startup instructions.
  • Update token allocation table (Verify/Improvement/Debug/Release buckets) for consistency.
  • Add lint success to STABLE criteria in the operations guidance.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Claude/templates/claude/instructions/_header.md Replaces LOOP_COMMANDS instructions with cron-based session start + Codex setup snippet.
Claude/templates/claude/instructions/01-session-startup.md Removes loop registration content; describes cron-based session start.
Claude/templates/claude/CLAUDE.md Removes loop/schedule registration step and replaces with cron assumption.
Claude/templates/claude/instructions/08-operations.md Updates token allocation and adds lint success to STABLE criteria.
Claude/templates/claude/START_PROMPT.md Regenerated prompt content reflecting the above removals/updates.

/codex:setup
/codex:status
```

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build-StartPrompt.ps1 は instructions/_header.md を先頭に結合して START_PROMPT.md を生成しますが、ここで ## LOOP_COMMANDS 見出しを削除すると生成物側も Get-StartPromptSection の前提(## LOOP_COMMANDS → ## PROMPT_BODY)を満たさず起動失敗になります。/loop を廃止する場合でも、互換のために ## LOOP_COMMANDS 見出し自体(内容は空/説明のみ)を ## PROMPT_BODY の直前に残してください。

Suggested change
## LOOP_COMMANDS
`/loop` は現在使用しないが、この見出しは START_PROMPT 生成時の互換性維持のために残す。
`/schedule` の追加登録も不要であり、Codex セットアップ完了後にそのまま自律開発へ進むこと。

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +22
### ステップ 1: 実行環境確認

1. /cron list を実行してスケジュール一覧を取得すること
2. 「ClaudeOS Monitor」が一覧に存在すれば登録済みと判断し、このステップをスキップしてステップ 2 へ進むこと(ユーザーへの確認・報告不要)
3. 未登録の場合のみ以下を順に実行すること(ユーザー確認禁止)

```
/loop 30m ClaudeOS Monitor
/loop 2h ClaudeOS Development
/loop 1h  ClaudeOS Verify
/loop 1h ClaudeOS Improvement
```
自律実行は Linux cron(月〜土、プロジェクト別スケジュール・300分制限)が担う。
`/loop` および `/schedule` によるクラウドスケジュール登録は不要。
このステップはスキップしてステップ 2 へ直ちに進むこと。

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ステップ名が「実行環境確認」になっていますが、本文で「このステップはスキップしてステップ 2 へ直ちに進むこと」と指示しており文言が矛盾しています。さらに、この変更でループ登録を廃止したにもかかわらず後段に「ループ登録完了後、ユーザーのメッセージに応じて…」という記述が残っているため、起動時の手順が混乱します。ステップ 1 の見出し/本文を「前提(確認不要)」等に合わせて整理し、ループ登録完了に言及する文を Codex セットアップ完了後の表現へ置き換えてください。

Copilot uses AI. Check for mistakes.
/codex:setup
/codex:status
```

Copilot AI Apr 22, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

START_PROMPT.md から ## LOOP_COMMANDS セクションが削除されていますが、起動スクリプトの Get-StartPromptSection(scripts/main/Start-ClaudeCode.ps1)が ## LOOP_COMMANDS と ## PROMPT_BODY の両方を必須としており、存在しないと例外で起動に失敗します。/loop 行自体は不要でも、互換のために ## LOOP_COMMANDS 見出し(中身は空 or スラッシュコマンドを含まない説明文)を ## PROMPT_BODY の直前に残すか、同PRでパーサ側を "LOOP_COMMANDS なし" を許容する実装に更新してください。

Suggested change
## LOOP_COMMANDS
セッション開始時に `/loop` や `/schedule` の登録は不要。
このセクションは起動スクリプト互換のために保持する。

Copilot uses AI. Check for mistakes.
LOOP_COMMANDS セクションが存在しない場合(Linux cron 運用など)に
Start-ClaudeCode.ps1 が exit 1 で落ちるバグを修正。

- LOOP_COMMANDS: 任意。なければ空文字列として扱う
- PROMPT_BODY: なければファイル全体を PromptBody として扱う
- LoopCommands が空のとき DryRun 表示から [LOOP_COMMANDS] を省略
- 統合テスト 17/17 pass 確認済み

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants