skills/hsts-planning-scheduling/SKILL.md
Heuristic search-based temporal planning and scheduling for complex multi-constraint environments
npx skillsauth add curiositech/windags-skills hsts-planning-schedulingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Wisdom from Muscettola's HSTS framework for building intelligent systems that unify planning (what to do) and scheduling (when/how to do it). Activates when designing constraint-based agents, solving resource allocation problems, building robust execution systems, or reasoning about commitment under uncertainty.
IF domain has resources with time-varying availability
AND causal goals interact with resource constraints
AND execution environment is uncertain
→ Use unified state variable approach
→ Model as evolving constraint network
IF problem is purely causal (no resource contention)
→ Classical planning may suffice
IF problem has fixed task structure with only temporal constraints
→ Classical scheduling may suffice
IF you see "planner feeds into scheduler" architecture
→ QUESTION: Is the seam creating coordination debt?
FOR each variable binding decision:
IF decision is reversible AND more information is coming
→ Post ordering constraint only
→ Example: "A before B" instead of "A at 10:00, B at 11:30"
IF decision resolves high-contention bottleneck (measured via simulation)
→ Commit to specific value now
→ Example: Assign spacecraft antenna to high-priority download
IF tempted to fix exact times early in search
→ STOP: Can ordering relation achieve same progress?
→ Preserve temporal flexibility for executor
BEFORE resolving any disjunction:
1. Run stochastic simulation on current partial solution
2. Sample 100+ paths without resolving open choices
3. Count conflicts per resource-time pair
4. Focus next decision on highest-contention resource
IF search is thrashing (many backtracks, little progress)
→ You're attacking non-bottleneck variables first
→ Re-estimate contention distribution
→ Switch to highest-conflict resource
IF domain has objects with internal state evolving over time
→ Model each as state variable with transition graph
→ Example: Satellite antenna {idle, tracking, downloading, slewing}
IF domain has shared resources (consumable/reusable)
→ Model resource levels as state variables
→ Track availability windows, not just capacity numbers
IF expert rules exist ("X and Y can't overlap during Z")
→ Encode as compatibility constraints
→ NOT as search pruning hacks
Detection Rule: If schedule output is sequence of exact times/actions with no flexibility Root Cause: Confusing schedule with execution plan; over-committing temporal decisions Symptom: Any runtime deviation requires full replanning Fix: Output behavioral envelopes (constraint networks) not nominal sequences Timeline: Becomes critical when execution uncertainty > 5% of plan duration
Detection Rule: If binding variables to specific values before constraints force it Root Cause: Not distinguishing between progress and commitment Symptom: Search space artificially shrunk; solutions exist but aren't found Fix: Post weakest constraint that enables progress; commit only when forced Timeline: Shows up immediately in search statistics (solution quality drops)
Detection Rule: If resolving disjunctions without measuring which matter most Root Cause: Treating all constraints as equally important Symptom: Search thrashing on easy variables while hard constraints fester Fix: Use stochastic simulation to estimate conflict probability before each decision Timeline: Becomes exponentially worse as problem size grows
Detection Rule: If propagation time grows quadratically with problem size Root Cause: Not respecting module boundaries; monolithic constraint posting Symptom: Solver becomes unusably slow on realistic problems Fix: Decompose into state variable modules; make interaction topology explicit Timeline: Hits performance wall around 50-100 activities
Detection Rule: If domain knowledge exists as ad-hoc search pruning rules Root Cause: Encoding constraints implicitly instead of declaratively Symptom: Knowledge invisible to debugging; doesn't compose across modules Fix: Express expert rules as formal compatibility constraints with causal semantics Timeline: Maintenance nightmare emerges when domain complexity grows
Scenario: Mars orbiter with 2 instruments (camera, spectrometer), 1 antenna, 4 GB storage. Plan 8-hour observation session with data downlink.
Novice Approach:
Expert HSTS Approach:
Alternative Path Shown: If simulation revealed antenna conflicts instead of storage, would commit to antenna schedule first, leave storage management flexible.
Scenario: 5 jobs, 3 machines, delivery deadlines. Machine M2 has 50% uptime, others 90%.
Novice Approach: Schedule assuming all machines available; handle breakdowns reactively.
Expert HSTS Approach:
What Expert Catches: M2 unreliability creates secondary bottleneck at other machines when jobs reroute. Plans for cascade effects.
Schedule is valid and complete when:
Automated Validation Signals:
This skill should NOT be used for:
Delegation Rules:
path-planning-algorithms insteadconstraint-satisfaction-methods insteadtime-series-forecasting insteadplan-execution-monitoring insteadBoundary Signals: If you're spending more effort encoding the domain than solving instances, consider whether classical OR methods might suffice for your use case.
data-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.