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.
tools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.