timefold-java

A methodology for designing Java systems that schedule or allocate tasks under constraints, using Timefold Solver. It starts by defining what must be assigned, what choices are allowed, which rules are mandatory or preferred, and how the solver and tests should be set up.

In plain words
What is it for?
Use it for production scheduling, employee shifts, school timetables, vehicle routing, project planning, and resource allocation in Java with Timefold or OptaPlanner.
Why use it?
It gives planning problems a consistent structure, making it easier to model real-world rules and avoid choosing unsuitable solver variables or configurations.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/3taste/timefold-java-skill/timefold-java
Any agent
npx skills add 3Taste/timefold-java-skill --skill timefold-java
Clone the repo
git clone --depth 1 https://github.com/3Taste/timefold-java-skill

Made for: Claude Code, Codex.

Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,063 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00102 $0.02063
Opus 5 $0.00051 $0.01032
Sonnet 5 $0.00020 $0.00413
Haiku 4.5 $0.00010 $0.00206

Measured 2d ago against content hash 7c9eb16548b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

timefold-java scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/timefold-java/SKILL.md · 126 lines

How it starts

The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Timefold Java Skill

核心定位:从业务需求 → Timefold 领域模型 + 约束 + 求解器配置的方法论 + 能力目录。

不是"场景查找表"。遇到任何新排程需求(教学排课、车辆路径、人员排班、半导体生产排程、项目调度 ...)都走同一套 6 步法。

触发条件

使用本 skill 当用户请求涉及:

  • 任务 / 资源 / 时间的分配或排程(产线排程、车辆路径、人员排班、课表、会议室)
  • 优化问题:在硬约束下最大化 / 最小化某目标
  • 显式提到 Timefold / OptaPlanner / ConstraintProvider / @PlanningEntity
  • 中文关键词:排程、排产、排班、调度、分配、规划、优化、约束
  • "给 X 安排 Y"、"在时间 / 机台 / 人员约束下"、"最小化成本 / 最大化吞吐"

首要动作:走 6 步建模方法论

拿到需求先做 6 步抽象,不要直接写代码。详见 references/modeling-methodology.md

  1. 识别规划实体:哪些对象"需要被安排"?(@PlanningEntity
  2. 识别规划变量:实体的什么属性是解空间?单值 / 有序列表?(@PlanningVariable / @PlanningListVariable
  3. 识别值域:变量取值是静态全局还是动态按实体过滤?(@ValueRangeProvider 位置)
  4. 识别派生状态:哪些字段是算出来的?(@InverseRelationShadowVariable / @PreviousElementShadowVariable / @ShadowVariable + @ShadowSources / @CascadingUpdateShadowVariable
  5. 分类约束:硬 / 中 / 软,每条归到 cookbook 的范式
  6. 选择求解器配置与集成:纯 JAR / Spring Boot / Quarkus + termination 策略

每一步对应的能力都在 references/capability-catalog.md

输出物清单(每次需求都产出)

  1. 领域类骨架(Entity / Fact / Solution)
  2. 变量 / Shadow 选型表(字段 → 注解 + 理由)
  3. 硬/中/软约束分类表(每条 → 一行 ConstraintStream)
  4. 求解器配置建议(termination + 集成方式 + 是否 ProblemChange)
  5. 测试提示(每条约束对应的 ConstraintVerifier 测试)

能力索引(快速定位注解 / API)

完整细节见 references/capability-catalog.md

建模需求 Timefold 能力 能力目录章节
实体从值域选 1 个 @PlanningVariable §1
实体排成有序列表(路径 / 工序链 / 装载) @PlanningListVariable + 配套 shadow §2
反查列表载体 @InverseRelationShadowVariable §3.1
列表中的前 / 后 / 索引 @PreviousElementShadowVariable / @NextElementShadowVariable / @IndexShadowVariable §3.2 / §3.3
派生字段(到达时间、总成本) @ShadowVariable(supplierName) + @ShadowSources §3.4
沿列表级联派生 @CascadingUpdateShadowVariable §3.5
允许部分实体不分配 allowsUnassigned=true / allowsUnassignedValues=true §4
冻结已确定的排程 @PlanningPin / @PlanningPinToIndex §5
动态值域(按实体过滤) 实体级 @ValueRangeProvider §6
选分数类型 HardSoftScore / HardMediumSoftScore / BendableScore / *LongScore §7
约束逻辑 ConstraintProvider + ConstraintStream DSL §8
运行时调权重 ConstraintWeightOverrides §8.2
异步求解(Web 服务) SolverManager §9.2
分数解释 SolutionManager.analyze() §9.3
实时变更 ProblemChange §10
大规模加速 Nearby Selection §11
区间聚类 / 间隙检测 toConnectedRanges / toConnectedTemporalRanges §13
方案对比(Preview) SolutionManager.diff() §14
自定义 Move(Preview) Neighborhoods API §15
新元启发式(Preview) Diversified Late Acceptance §16

Read the full file on GitHub · 126 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 126 lines · 102 tokens per session scan A 7c9eb16548b0

Subscribe to this mod's changes

timefold-java is a skill published in the GitHub repository 3Taste/timefold-java-skill (6 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 102 tokens to every session and 2,063 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens