Skip to content
cccskills
FreePublished on GitHub

production-schedule-optimizer

製造施設(セントラルキッチン、食品工場、製造ライン)の週次生産スケジュールを最適化するスキル。製品の賞味期限、作業室の容量、人員配置、設備制約を考慮したタイムテーブル生成、 人員要件見積、シフト計画、カバレッジ検証を提供。

Use when: 「製造スケジュールを作成」「生産計画を最適化」「人員配置を見積もり」 「CK スケジュール」「週次製造計画」「シフト計画」

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (14)

  • SKILL.md17.3 KB
  • assets/sample_demand.csv156 B
  • assets/sample_products.csv497 B
  • assets/sample_rooms.csv118 B
  • assets/sample_staff.csv521 B
  • assets/schedule_template.md3.1 KB
  • references/food_production_guide.md6.2 KB
  • references/scheduling_methodology.md8.3 KB
  • references/staff_planning_guide.md7.1 KB
  • scripts/estimate_staff.py8.0 KB
  • scripts/generate_schedule.py23.1 KB
  • scripts/tests/__init__.py0 B
  • scripts/tests/test_estimate_staff.py4.1 KB
  • scripts/tests/test_generate_schedule.py19.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Production Schedule Optimizer

Overview

製造施設(セントラルキッチン、食品工場など)の週次生産スケジュールを自動生成・最適化するスキル。 4種類のCSV(製品マスタ、需要、作業室、人員)を入力とし、賞味期限に基づく製造頻度、作業室容量、人員制約を考慮した週次タイムテーブルを生成する。

Primary language: Japanese (default), English supported Frameworks: Greedy Bin-Packing (Largest-First Decreasing), FEFO, HACCP-aware room assignment Output format: Weekly schedule (Markdown table), staff reports, shift plans, alert summaries


When to Use

  • セントラルキッチンや食品工場の週次製造スケジュールを作成したい
  • 賞味期限ベースの製造頻度を自動計算したい
  • 作業室の容量と人員制約を考慮した最適タイムテーブルが必要
  • 人員要件を見積もり、シフト計画を立てたい
  • 既存スケジュールのボトルネック特定と改善をしたい
  • 複数作業室間の負荷バランスを最適化したい

Prerequisites

  • Python 3.9+
  • 外部依存なし(標準ライブラリのみ)
  • 入力CSVはUTF-8エンコーディング
  • 4種類のCSVファイル(products, demand, rooms, staff)を事前準備

Output

generate_schedule.py

  • 形式: Markdown テーブル(曜日別タイムテーブル + アラートセクション)
  • 内容: 曜日×作業室×製品ごとの開始時刻、終了時刻、数量、人員、所要時間

estimate_staff.py

  • 形式: Markdown テーブル(曜日別人員要件)
  • 内容: 作業室×曜日ごとの必要人時、ピーク人員、最小人員、推奨人員、タスク数

Input Specification

4種類のCSVファイルを入力として受け取る。

1. products.csv — 製品マスタ

ColumnTypeDescription
product_codestring製品コード(一意キー)
namestring製品名
prep_time_minint1ロット(base_qty分)の調理時間(分)
base_qtyint1ロットの基準数量
required_staffint1ロット製造に必要な人数
shelf_life_daysint賞味期限(日数)
room_codesstring割当可能な作業室コード(セミコロン区切り)
product_code,name,prep_time_min,base_qty,required_staff,shelf_life_days,room_codes
BREAD-001,Sandwich Bread,120,50,2,2,BAKERY
SAUCE-001,Tomato Sauce,90,80,2,5,SAUCE;BROTH

2. demand.csv — 週次需要

ColumnTypeDescription
product_codestring製品コード(products.csvと一致)
qtyint週次需要数量

3. rooms.csv — 作業室マスタ

ColumnTypeDescription
room_codestring作業室コード(一意キー)
namestring作業室名
max_staffint最大同時作業人数

4. staff.csv — 人員配置

ColumnTypeDescription
daystring曜日(MON/TUE/WED/THU/FRI/SAT/SUN)
room_codestring作業室コード(rooms.csvと一致)
staff_countint配置人数
shift_hoursfloatシフト時間(時間)

Sample files: assets/sample_products.csv, assets/sample_demand.csv, assets/sample_rooms.csv, assets/sample_staff.csv


Workflow 1: Product & Constraint Modeling

Purpose: 入力CSVを読み込み、バリデーションと派生フィールド計算を実施する。

Step 1: Load and Cross-Reference

  1. 4つのCSVファイルを読み込み、カラム名を正規化(小文字化、空白トリム)
  2. demand.csv の product_code が products.csv に存在するか確認
  3. staff.csv / products.csv の room_code が rooms.csv に存在するか確認
  4. 孤立レコードを警告出力

Step 2: Field-Level Validation

FieldConditionRuleAlert Code
shelf_life_days<= 0RejectPSO-E001
base_qty<= 0RejectPSO-E002
prep_time_min<= 0RejectPSO-E003
required_staff<= 0RejectPSO-E004
qty (demand)<= 0Skip + WarningPSO-W001
qty (demand)NaN/missingSkip + WarningPSO-W002
max_staff<= 0RejectPSO-E005
room_codesUnknown roomRejectPSO-E006
staff_countMissingClamp to 0 + WarningPSO-W003
  • Reject: 当該レコードを処理対象から除外、エラーログ出力
  • Skip + Warning: 当該製品をスキップ、警告ログ出力
  • Clamp: 欠損値を0に補完、警告ログ出力

Step 3: Compute Derived Fields

production_count = min(ceil(7 / shelf_life_days), 7)
qty_per_run      = ceil(qty / production_count)
lot_count        = ceil(qty_per_run / base_qty)
duration_minutes = lot_count * prep_time_min
staff_hours      = (duration_minutes * required_staff) / 60
total_staff_hours = staff_hours * production_count

production_count 早見表:

  • shelf_life=1 -> 7回/週, shelf_life=2 -> 4回, shelf_life=3 -> 3回, shelf_life=7 -> 1回

Detail: Load references/food_production_guide.md for FEFO integration and HACCP considerations.


Workflow 2: Weekly Schedule Generation

Purpose: Greedy Bin-Packing で作業室容量と人員制約を遵守した週次スケジュールを生成する。

Algorithm Overview

製造タスクを「大きい順」に並べ、残容量が最大の作業室・曜日に詰め込む近似アルゴリズム。

Step 1: Task Expansion

各製品について production_count 回のタスクエントリを生成する。

tasks = []
for product in validated_products:
    for i in range(product.production_count):
        tasks.append(Task(
            product_code=product.product_code, run_index=i,
            duration_minutes=product.duration_minutes,
            required_staff=product.required_staff,
            staff_hours=product.staff_hours,
            allowed_rooms=product.room_codes,
            shelf_life_days=product.shelf_life_days,
        ))

Step 2: Deterministic Sort

再現性保証のための3キーソート:

PriorityKeyOrderRationale
1total_staff_hoursDESC大タスク先行(bin-packing基本戦略)
2shelf_life_daysASC短賞味期限優先(FEFO原則)
3product_codeASC同一条件時の決定性保証
tasks.sort(key=lambda t: (-t.staff_hours, t.shelf_life_days, t.product_code))

Step 3: Day Assignment

製造間隔を考慮した曜日割当(MON=0, ..., SUN=6):

step = len(available_days) / production_count
assigned_days = [available_days[int(i * step)] for i in range(production_count)]

Examples: count=7 -> 毎日, count=3 -> 0,2,4, count=1 -> 0

Step 4: Room Selection

PriorityKeyOrderRationale
1remaining_capacityDESC負荷分散
2room_codeASC決定性保証
remaining_capacity = (staff_count * shift_hours * 60) - already_assigned_minutes

制約チェック:

  1. allowed_rooms に含まれる作業室のみ
  2. remaining_capacity >= duration_minutes
  3. staff_count >= required_staff

配置失敗時: PSO-W004 アラートを出力、タスクを「未配置」リストに追加

Step 5: Time Slot Assignment

start_time = room_day_next_available[room][day]  # default: 08:00 (480min)
end_time = start_time + duration_minutes
room_day_next_available[room][day] = end_time

Detail: Load references/scheduling_methodology.md for improvement techniques and constraint patterns. Template: Use assets/schedule_template.md for output formatting.


Workflow 3: Staff Requirement Estimation

Purpose: 作業室×曜日ごとの必要人員を算出し推奨人員を提案する。

Calculation Pipeline: staff-hours -> peak -> min -> recommended

Step 1: 作業室×曜日ごとの必要人時を集計

room_day_staff_hours[room][day] = sum(task.staff_hours for task in assigned_tasks[room][day])

Step 2: 時間帯別の同時必要人数からピーク値を算出

peak_staff[room][day] = max(concurrent_staff_at_time_t for t in all_time_slots)

Step 3: min_staff = peak_staff(削減不可の最低ライン)

Step 4: バッファ係数を適用

recommended_staff = ceil(min_staff * 1.1)
  • 10%バッファ: 急な欠勤、トラブル、清掃時間を吸収
  • max_staff 超過時は max_staff にクランプ + PSO-W005 アラート

Step 5: Gap分析

gap = recommended_staff - current_staff  # >0:不足, 0:適正, <0:余剰

Output Example

RoomDayCurrentPeakMinRecommendedGapStatus
BAKERYMON32230OK
BROTHMON2334+2SHORTAGE

Detail: Load references/staff_planning_guide.md for shift patterns and labor constraints.


Workflow 4: Shift Planning & Coverage Verification

Note: This workflow provides guidance for manual implementation. No automated script is provided. Use the output from Workflow 3 as input for shift design.

Purpose: 推奨人員に基づくシフト自動生成と時間帯別カバレッジ検証。

Shift Patterns

PatternStartEndBreakNet Hours
FULL_8H08:0017:0012:00-13:008.0h
EARLY_8H06:0015:0011:00-12:008.0h
LATE_8H10:0019:0014:00-15:008.0h
SHORT_6H08:0014:00None6.0h
HALF_4H08:0012:00None4.0h

Auto-Assignment

  1. 平日: FULL_8H 優先、土日: SHORT_6H 優先
  2. ピーク時間帯に HALF_4H を追加検討

Coverage Verification

時間帯別(1時間刻み)で assigned >= required を検証:

for hour in [06:00..19:00]:
    if assigned_staff(hour) < required_staff(hour):
        alert PSO-W006: Coverage gap at {room} {day} {hour}

Gap Resolution

  1. シフト追加: ギャップ時間帯をカバーするパターン追加
  2. シフト変更: 既存シフトの時刻調整
  3. 作業移動: タスクを別時間帯・曜日に移動

Detail: Load references/staff_planning_guide.md for detailed shift design and labor constraints.


Workflow 5: Validation, Alerts & Improvement

Purpose: スケジュール全体の品質検証、アラート集約、改善提案。

Alert System

Error (PSO-E): 処理停止

CodeTriggerDescription
PSO-E001shelf_life_days <= 0賞味期限が無効
PSO-E002base_qty <= 0基準数量が無効
PSO-E003prep_time_min <= 0調理時間が無効
PSO-E004required_staff <= 0必要人員が無効
PSO-E005max_staff <= 0作業室最大人員が無効
PSO-E006Unknown room_code作業室コード不在

Warning (PSO-W): 処理継続

CodeTriggerDescription
PSO-W001qty <= 0需要0以下(スキップ)
PSO-W002qty NaN/missing需要欠損(スキップ)
PSO-W003staff_count missing人員欠損(0に補完)
PSO-W004Capacity overflow全作業室で容量不足(未配置)
PSO-W005recommended > max_staff推奨人員超過(クランプ)
PSO-W006Coverage gapカバレッジ不足

Quality Metrics

MetricFormulaTarget
Room Utilizationused_hours / available_hours (per room/day)70-85%
Staff Efficiencyrequired_staff_hours / assigned_staff_hours80-90%
Completenessassigned_demand / total_demand100%
Balance Score1 - std_dev(utilizations) / mean(utilizations)>= 0.8

Bottleneck Identification

  1. 容量ボトルネック: utilization > 90% の作業室×曜日
  2. 人員ボトルネック: gap > 0(Workflow 3結果)
  3. カバレッジボトルネック: PSO-W006 発生時間帯
  4. 未配置タスク: PSO-W004 で未配置のタスク

Improvement Suggestions

Bottleneck TypeSuggestion
容量タスク別曜日移動、稼働時間延長、別作業室振替
人員シフト追加、パートタイム活用、時間帯分散
カバレッジシフト時間帯変更、タスク開始時刻調整
未配置作業室追加、休日製造検討、外部委託

Inline Formulas

Production Frequency

production_count = min(ceil(7 / shelf_life_days), 7)

前提: shelf_life_days > 0(PSO-E001でバリデーション済み)

Manufacturing Duration

duration_minutes = ceil(qty_per_run / base_qty) * prep_time_min

前提: base_qty > 0(PSO-E002でバリデーション済み)。端数ロットも1ロット分の時間。

Staff-Hours

staff_hours = (duration_minutes * required_staff) / 60

Recommended Staff

recommended_staff = ceil(min_staff * 1.1)

min_staff=ピーク時最低人数、1.1=バッファ係数、ceil=切り上げ

Room Remaining Capacity

remaining_capacity_min = (staff_count * shift_hours * 60) - assigned_minutes

Scripts

generate_schedule.py

python3 scripts/generate_schedule.py \
  --products products.csv --demand demand.csv \
  --rooms rooms.csv --staff staff.csv \
  --week-start 2026-02-23 \
  --work-hours 8:00-22:00 --lunch-break 12:00-13:00 \
  --output schedule.md
FlagRequiredDefaultDescription
--productsYes-製品マスタCSV
--demandYes-週次需要CSV
--roomsYes-作業室マスタCSV
--staffYes-人員配置CSV
--week-startYes-週開始日(YYYY-MM-DD)
--work-hoursNo8:00-22:00稼働時間帯(HH:MM-HH:MM)
--lunch-breakNo12:00-13:00休憩時間帯(HH:MM-HH:MM)
--outputNostdout出力先(Markdown)

estimate_staff.py

python3 scripts/estimate_staff.py \
  --products products.csv --demand demand.csv \
  --rooms rooms.csv --shift-hours 8 \
  --output staff_report.md
FlagRequiredDefaultDescription
--productsYes-製品マスタCSV
--demandYes-週次需要CSV
--roomsYes-作業室マスタCSV
--shift-hoursNo81人あたりシフト時間
--outputNostdout出力先(Markdown)

Resources

references/

FileDescriptionWhen to Load
references/scheduling_methodology.mdBin-Packing詳細、ソート仕様、改善手法アルゴリズム改善検討時
references/food_production_guide.md製造頻度、FEFO、HACCP考慮事項食品製造制約検討時
references/staff_planning_guide.md人員計算、シフト設計、カバレッジ検証人員計画・シフト設計時

assets/

FileDescription
assets/schedule_template.md週次スケジュール出力テンプレート
assets/sample_products.csv製品マスタサンプル(10製品)
assets/sample_demand.csv週次需要サンプル
assets/sample_rooms.csv作業室マスタサンプル(5室)
assets/sample_staff.csv人員配置サンプル(7日x5室)

Best Practices

入力データ準備

  1. 製品コード命名: カテゴリ+連番(BREAD-001, SAUCE-002)で管理性向上
  2. 賞味期限の正確性: 製造日を含む日数で指定(製造当日=1日)
  3. 需要数量: 週次合計を指定(日次ではない)

スケジュール最適化

  1. 大タスク優先: Bin-Packing原則。手動調整時も同様
  2. FEFO準拠: 賞味期限短い製品を先に配置
  3. Cross-training: 複数room_codesで柔軟な配置を可能に
  4. 土日負荷軽減: 短時間シフトの土日は平日集約を検討

人員計画

  1. バッファ係数調整: 安定現場=1.05x、標準=1.1x、新人多=1.2x
  2. ピーク分散: 開始時刻をずらして人員平準化
  3. パートタイム活用: HALF_4Hでフルタイム人員を抑制
  4. 月次レビュー: 需要変動に対応した定期見直し

アラート対応

  1. PSO-E: 即時対応(データ品質は後続処理に影響)
  2. PSO-W004: 優先対応(未配置=供給不足)
  3. Balance Score < 0.7: タスク配置再検討を推奨
  4. 週次振り返り: 実績と計画差異を次週パラメータに反映

このスキルの目的は、製造施設の生産スケジュール作成を自動化・最適化し、作業室と人員の効率的な活用を支援することです。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Track and update action item status from natural language updates like 'Seanのメールには返信しておいた' or 'Lu対応予定'. Integrates with daily-comms-ops workflow. Use when managing action items across communication channels.

The English summary is being prepared. Showing the original description.

takusaotome/claude-skills-library10Updated Oct 5, 2026

AI活用提案の専門コンサルタントスキル。LLM・AIエージェントの活用事例知識を基に、業界別、部門別、シーン別に最適なAI導入提案を行います。システム化、業務改善、効率化を得意とし、具体的な活用事例、期待効果、導入ステップを含む実践的な提案を提供します。Use when proposing AI/LLM adoption strategies for specific industries, departments, or business scenarios.

The English summary is being prepared. Showing the original description.

takusaotome/claude-skills-library10Updated Oct 5, 2026

Generate AI-powered BPO service proposals for Japanese companies in the US market. Use when creating outsourcing proposals with AI service menus, ROI estimation, implementation roadmaps, and bilingual (JA/EN) proposal documents for 在米日系企業向けAI実装.

The English summary is being prepared. Showing the original description.

takusaotome/claude-skills-library10Updated Oct 5, 2026

AI(LLM)が生成した日本語テキストの「AI臭」を検出・診断し、人間らしい文章にリライトするスキル。 Use when: 「AIっぽい文章を直して」「人間らしくリライトして」「AI臭を消して」「この文章をもっと自然にして」 「テキストのAI感を減らして」「機械っぽさを取りたい」 "make this sound more human", "remove AI tone", "humanize this text", "detect if this is AI-generated". 6つのAI特有パターン(視覚的マーカー、単調なリズム、マニュアル的構成、非コミット姿勢、抽象語の濫用、 定型メタファー)を正規表現ベースで検出し、0-100のAI臭スコアを算出。3つの人間化技法 (バランスを崩す・客観を崩す・論理を崩す)でリライトを実行する。 Note: 検出スクリプトは日本語テキスト専用。英語テキストの場合はClaude自身がreferences/を参照して分析・リライトする。

The English summary is being prepared. Showing the original description.

takusaotome/claude-skills-library10Updated Oct 5, 2026

Generate audit-ready internal control design documents from As-Is business process inventories. Produces control IDs, assertion mappings, procedures, SoD analysis, KPIs, materiality thresholds, and implementation roadmaps. Use when building internal controls for new audit engagements, SOX/J-SOX compliance, or process improvement initiatives.

The English summary is being prepared. Showing the original description.

takusaotome/claude-skills-library10Updated Oct 5, 2026

Review audit-related documents (control design documents, bottleneck analyses, requirements definitions, etc.) for quality, scoring them 0-100 with a severity-rated findings list. Use when reviewing audit documents, checking control design quality, or verifying cross-document consistency. Supports documents governed by US GAAP, IFRS, or J-GAAP.

The English summary is being prepared. Showing the original description.

takusaotome/claude-skills-library10Updated Oct 5, 2026

See all skills by takusaotome

Report a problem with this skill