[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C1QYW82X06291SSFH50956":3,"skill-same:01M7C1QYW82X06291SSFH50956":43},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7C1QYW82X06291SSFH50956","milp-solver-workflow",null,"linyouxue\u002Fskill-repair-benchmark","linyouxue","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216151464?v=4","01M7BJEVCXKD74KH6FG9CBVSQB","林宥学","01M7BJEVE02NP217V93BKZFC0J",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002FSkillrevise\u002Ftasks\u002Fenergy-unit-commitment\u002Frepaired_run\u002Finputs\u002Fskills\u002Fmilp-solver-workflow\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# unit-commitment-milp-verifier-aligned-workflow\n\n## Purpose\nProduce a feasible and verifier-consistent mixed-integer linear unit-commitment style schedule (commitment, startups\u002Fshutdowns, dispatch, reserves, renewables) by (1) discovering the task's required report contract, (2) building a UC MILP with correct time indexing and initial conditions, and (3) validating feasibility and reported fields by recomputing checks from the final report arrays (not from internal solver state).\n\n## When to Use\nUse only when the task requires an end-to-end UC-style optimization output that will be graded by an external verifier reading a written artifact (typically JSON) containing time-series schedules, costs\u002Fsummaries, and constraint-check fields. Do not use for generic MILP advice, non-UC MILPs, or tasks without a machine-checked report contract; in those cases use a simpler solver\u002Frunbook skill.\n\n## Procedure\n- 1) Discover the observable contract (do this before modeling).\n- Locate task files and required output path(s) via repository search (do not assume fixed paths).\n- Identify the required report schema\u002Fkeys by reading: README\u002Finstructions, any provided schema files, and any verifier\u002Ftest code.\n- Checkpoint evidence: you can list required arrays (names, shapes, units), required summary fields, and how the verifier computes each pass\u002Ffail check. If any are unclear, stop and ask for clarification or inspect more files; do not guess.\n- 2) Normalize inputs and define index conventions (make time semantics explicit).\n- Parse inputs into deterministic arrays with explicit indices: generators g=0..G-1, time t=0..T-1.\n- Define, in writing, the meaning of each decision:\n- u[g,t] in {0,1} commitment (online status at t).\n- su[g,t], sd[g,t] in {0,1} startup\u002Fshutdown indicator for transitions between t-1 and t (define whether su at t refers to turning on at start of period t).\n- p[g,t] >= 0 dispatch in MW (total output, not \"above-min\", unless the contract explicitly says otherwise).\n- r[g,t] >= 0 reserve provided (and any renewable spillage\u002Fcurtailment variables if needed).\n- Checkpoint evidence: print shapes and confirm they match the contract (T alignment, per-generator parameters present). If any parameter is missing, stop and add a safe default only if the contract explicitly allows it.\n- 3) Pre-solve sanity checks (execution anchor: stop early on impossible inputs).\n- For each time t, compute a conservative upper bound on achievable supply using only input limits (no MILP):\n- max_supply[t] = sum_g Pmax[g] + renewable_max[t] (or other sources per contract), adjusted by any hard outages if present.\n- required[t] = demand[t] + reserve_requirement[t] (if reserve is required by contract).\n- If any t has max_supply[t] \u003C required[t] (optionally with a small tolerance), stop: report \"input infeasible\" and do not build a MILP that will only return infeasible.\n- Checkpoint evidence: a list of failing periods (if any) and the computed bounds.\n- 4) Build the UC MILP with a deterministic variable map and UC-specific constraint templates.\n- Create a deterministic variable map (single allocator; no scattered index arithmetic).\n- Add constraints in this order (each family must be mirrored by a later validator check):\n- Variable bounds and integrality.\n- Transition linking with explicit t=0 handling:\n- For t>0: su[g,t] - sd[g,t] = u[g,t] - u[g,t-1] (or equivalent), plus su+sd \u003C= 1 if required.\n- For t=0: use initial status u0[g] (from inputs) in the same equation; do not invent u[-1].\n- Dispatch feasibility:\n- If u[g,t]=0 then p[g,t]=0 (enforced via p \u003C= Pmax*u and p >= Pmin*u when Pmin exists).\n- Ensure the model matches the contract's definition of p (total MW vs above-min).\n- Demand and reserve balance:\n- Sum_g p[g,t] + renewables_used[t] (as defined) meets demand.\n- Sum_g r[g,t] meets reserve requirement if applicable.\n- Joint capability and deliverability:\n- p[g,t] + r[g,t] \u003C= Pmax[g]*u[g,t] (and >= Pmin*u if applicable).\n- Ramp\u002Fdeliverability constraints must match contract (e.g., reserve deployable within ramp-up): encode using p and r and correct time coupling.\n- Minimum up\u002Fdown time with initial conditions:\n- Use a standard formulation keyed off su\u002Fsd, explicitly incorporating initial on\u002Foff durations if provided.\n- If initial duration data is absent, do not guess obligations; instead implement only what the contract\u002Fdata supports and record the assumption.\n- Startup\u002Fshutdown costs and any multi-tier logic:\n- Implement only if the contract or input data defines the tier mapping unambiguously; otherwise keep costs simple and avoid adding feasibility-impacting constraints.\n- Checkpoint evidence: for each constraint family, you can point to (a) the input parameters used and (b) the corresponding validator function\u002Fcheck that will recompute it from the report.\n- 5) Solve safely and decide what to do based on solver outputs.\n- Discover available solver interfaces in the environment (do not assume a specific package). Prefer a MILP-capable open-source solver present in the environment.\n- Set a time limit and request an incumbent.\n- Decision point:\n- If no incumbent solution exists, stop and debug the model; do not emit a report claiming feasibility.\n- If time-limited but incumbent exists, proceed to validation but mark solver status accordingly.\n- Constraint: only report a MIP gap if it is directly provided by the solver API as a valid relative gap; otherwise set it to null\u002Fempty per schema (never invent).\n- 6) Extract schedules and run verifier-aligned validation (execution anchor: report-driven gate).\n- Extract arrays from the incumbent without post-hoc \"fixing\" (no rounding binaries unless within a strict tolerance and you re-validate after rounding).\n- Build the report object in the contract's exact units and conventions.\n- Run a validator that recomputes, from the report arrays plus original inputs (not internal solver rows):\n- transition consistency (u, su, sd, including t=0 with u0),\n- min up\u002Fdown windows,\n- dispatch bounds (Pmin\u002FPmax with u),\n- ramp and reserve deliverability,\n- demand balance and reserve satisfaction,\n- objective\u002Fcost recomputation consistency (within tolerance if required).\n- Decision point:\n- If any check fails or any required summary metric disagrees with recomputation, do not set any \"pass\" flags; return to modeling\u002Fextraction and fix the root cause.\n- Only after all checks pass, set constraint_check fields to \"pass\" (or schema-equivalent) and populate summary fields from the validator outputs.\n- 7) Write, reload, and finalize.\n- Write the report to the required output path.\n- Reload the written artifact and rerun the report-driven validator on the reloaded data (guards against serialization\u002Fschema mistakes).\n- Checkpoint evidence: validator returns all_pass=true on the reloaded artifact; only then claim completion.\n\n## Constraints \u002F Pitfalls\n- Never \"cosmetically\" overwrite violation metrics or set constraint checks to \"pass\" without recomputing them from the final report arrays. If the validator shows nonzero violations, the report must reflect that or the schedule must be fixed.\n- Do not hard-code time indexing, t=0 transition behavior, or whether dispatch is total MW vs above-min. These are frequent verifier-mismatch causes; always derive conventions from the observable contract and inputs, and encode t=0 explicitly using provided initial conditions.",{},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","evaluation\u002Fresults\u002FSkillrevise\u002Ftasks\u002Fenergy-unit-commitment\u002Frepaired_run\u002Finputs\u002Fskills\u002Fmilp-solver-workflow",1,"https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark","https:\u002F\u002Fgithub.com\u002Flinyouxue","2026-11-14 20:28:35",{"source":7,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill milp-solver-workflow",{"tool":35,"command":36},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill milp-solver-workflow",{"tool":38,"command":39},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill milp-solver-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002FSkillrevise\u002Ftasks\u002Fenergy-unit-commitment\u002Frepaired_run\u002Finputs\u002Fskills\u002Fmilp-solver-workflow\u002FSKILL.md",true,[],[44,51,58,65,70,75],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M7E1HGVRY73NBJ022CJG13X6","video-frame-extraction","Extract frames from video files and save them as images using OpenCV","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7E1HAG5R7CJ9C8NYJS771MB","openai-vision","Analyze images and multi-frame sequences using OpenAI GPT vision models","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7E1H7DADKB6QBWKC2KQ63SZ","image-ocr","Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],{"skillNo":66,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7E1H0WBNT43TENGQY7AVZHD","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":71,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7E1GTC7D4N4Q2EF03875J9E","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":76,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7E1GQ92CWFMGH53KSSE4WER","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[]]