[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XDZTWZ406BJR8ZKWMZM4VM":3,"skill-same:01M6XDZTWZ406BJR8ZKWMZM4VM":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":13,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M6XDZTWZ406BJR8ZKWMZM4VM","map-optimization-strategy",null,"Strategy for solving constraint optimization problems on spatial maps. Use when you need to place items on a grid\u002Fmap to maximize some objective while satisfying constraints.","Waaaalnut\u002Fskillsbench","Waaaalnut","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F103995656?v=4","01M6XCS9K1V51EY3JMB7DGMX24","01M6XCS9Q4WPW88W62C55G1H44",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fciv6-adjacency-optimizer\u002Fenvironment\u002Fskills\u002Fmap-optimization-strategy\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31],"Optimization","strategy","map","map optimization strategy","constraints","use","Spatial","maps","you","grid","for","constraint","objective","when","2026-11-10 10:12:30",false,"---\nname: map-optimization-strategy\ndescription: Strategy for solving constraint optimization problems on spatial maps. Use when you need to place items on a grid\u002Fmap to maximize some objective while satisfying constraints.\n---\n\n# Map-Based Constraint Optimization Strategy\n\nA systematic approach to solving placement optimization problems on spatial maps. This applies to any problem where you must place items on a grid to maximize an objective while respecting placement constraints.\n\n## Why Exhaustive Search Fails\n\nExhaustive search (brute-force enumeration of all possible placements) is the **worst approach**:\n\n- Combinatorial explosion: Placing N items on M valid tiles = O(M^N) combinations\n- Even small maps become intractable (e.g., 50 tiles, 5 items = 312 million combinations)\n- Most combinations are clearly suboptimal or invalid\n\n## The Three-Phase Strategy\n\n### Phase 1: Prune the Search Space\n\n**Goal:** Eliminate tiles that cannot contribute to a good solution.\n\nRemove tiles that are:\n1. **Invalid for any placement** - Violate hard constraints (wrong terrain, out of range, blocked)\n2. **Dominated** - Another tile is strictly better in all respects\n3. **Isolated** - Too far from other valid tiles to form useful clusters\n\n```\nBefore: 100 tiles in consideration\nAfter pruning: 20-30 candidate tiles\n```\n\nThis alone can reduce search space by 70-90%.\n\n### Phase 2: Identify High-Value Spots\n\n**Goal:** Find tiles that offer exceptional value for your objective.\n\nScore each remaining tile by:\n1. **Intrinsic value** - What does this tile contribute on its own?\n2. **Adjacency potential** - What bonuses from neighboring tiles?\n3. **Cluster potential** - Can this tile anchor a high-value group?\n\nRank tiles and identify the top candidates. These are your **priority tiles** - any good solution likely includes several of them.\n\n```\nExample scoring:\n- Tile A: +4 base, +3 adjacency potential = 7 points (HIGH)\n- Tile B: +1 base, +1 adjacency potential = 2 points (LOW)\n```\n\n### Phase 3: Anchor Point Search\n\n**Goal:** Find placements that capture as many high-value spots as possible.\n\n1. **Select anchor candidates** - Tiles that enable access to multiple high-value spots\n2. **Expand from anchors** - Greedily add placements that maximize marginal value\n3. **Validate constraints** - Ensure all placements satisfy requirements\n4. **Local search** - Try swapping\u002Fmoving placements to improve the solution\n\nFor problems with a \"center\" constraint (e.g., all placements within range of a central point):\n- The anchor IS the center - try different center positions\n- For each center, the reachable high-value tiles are fixed\n- Optimize placement within each center's reach\n\n## Algorithm Skeleton\n\n```python\ndef optimize_placements(map_tiles, constraints, num_placements):\n    # Phase 1: Prune\n    candidates = [t for t in map_tiles if is_valid_tile(t, constraints)]\n\n    # Phase 2: Score and rank\n    scored = [(tile, score_tile(tile, candidates)) for tile in candidates]\n    scored.sort(key=lambda x: -x[1])  # Descending by score\n    high_value = scored[:top_k]\n\n    # Phase 3: Anchor search\n    best_solution = None\n    best_score = 0\n\n    for anchor in get_anchor_candidates(high_value, constraints):\n        solution = greedy_expand(anchor, candidates, num_placements, constraints)\n        solution = local_search(solution, candidates, constraints)\n\n        if solution.score > best_score:\n            best_solution = solution\n            best_score = solution.score\n\n    return best_solution\n```\n\n## Key Insights\n\n1. **Prune early, prune aggressively** - Every tile removed saves exponential work later\n\n2. **High-value tiles cluster** - Good placements tend to be near other good placements (adjacency bonuses compound)\n\n3. **Anchors constrain the search** - Once you fix an anchor, many other decisions follow logically\n\n4. **Greedy + local search is often sufficient** - You don't need the global optimum; a good local optimum found quickly beats a perfect solution found slowly\n\n5. **Constraint propagation** - When you place one item, update what's valid for remaining items immediately\n\n## Common Pitfalls\n\n- **Ignoring interactions** - Placing item A may change the value of placing item B (adjacency effects, mutual exclusion)\n- **Over-optimizing one metric** - Balance intrinsic value with flexibility for remaining placements\n- **Forgetting to validate** - Always verify final solution satisfies ALL constraints\n","# Map-Based Constraint Optimization Strategy\n\nA systematic approach to solving placement optimization problems on spatial maps. This applies to any problem where you must place items on a grid to maximize an objective while respecting placement constraints.\n\n## Why Exhaustive Search Fails\n\nExhaustive search (brute-force enumeration of all possible placements) is the **worst approach**:\n\n- Combinatorial explosion: Placing N items on M valid tiles = O(M^N) combinations\n- Even small maps become intractable (e.g., 50 tiles, 5 items = 312 million combinations)\n- Most combinations are clearly suboptimal or invalid\n\n## The Three-Phase Strategy\n\n### Phase 1: Prune the Search Space\n\n**Goal:** Eliminate tiles that cannot contribute to a good solution.\n\nRemove tiles that are:\n1. **Invalid for any placement** - Violate hard constraints (wrong terrain, out of range, blocked)\n2. **Dominated** - Another tile is strictly better in all respects\n3. **Isolated** - Too far from other valid tiles to form useful clusters\n\n```\nBefore: 100 tiles in consideration\nAfter pruning: 20-30 candidate tiles\n```\n\nThis alone can reduce search space by 70-90%.\n\n### Phase 2: Identify High-Value Spots\n\n**Goal:** Find tiles that offer exceptional value for your objective.\n\nScore each remaining tile by:\n1. **Intrinsic value** - What does this tile contribute on its own?\n2. **Adjacency potential** - What bonuses from neighboring tiles?\n3. **Cluster potential** - Can this tile anchor a high-value group?\n\nRank tiles and identify the top candidates. These are your **priority tiles** - any good solution likely includes several of them.\n\n```\nExample scoring:\n- Tile A: +4 base, +3 adjacency potential = 7 points (HIGH)\n- Tile B: +1 base, +1 adjacency potential = 2 points (LOW)\n```\n\n### Phase 3: Anchor Point Search\n\n**Goal:** Find placements that capture as many high-value spots as possible.\n\n1. **Select anchor candidates** - Tiles that enable access to multiple high-value spots\n2. **Expand from anchors** - Greedily add placements that maximize marginal value\n3. **Validate constraints** - Ensure all placements satisfy requirements\n4. **Local search** - Try swapping\u002Fmoving placements to improve the solution\n\nFor problems with a \"center\" constraint (e.g., all placements within range of a central point):\n- The anchor IS the center - try different center positions\n- For each center, the reachable high-value tiles are fixed\n- Optimize placement within each center's reach\n\n## Algorithm Skeleton\n\n```python\ndef optimize_placements(map_tiles, constraints, num_placements):\n    # Phase 1: Prune\n    candidates = [t for t in map_tiles if is_valid_tile(t, constraints)]\n\n    # Phase 2: Score and rank\n    scored = [(tile, score_tile(tile, candidates)) for tile in candidates]\n    scored.sort(key=lambda x: -x[1])  # Descending by score\n    high_value = scored[:top_k]\n\n    # Phase 3: Anchor search\n    best_solution = None\n    best_score = 0\n\n    for anchor in get_anchor_candidates(high_value, constraints):\n        solution = greedy_expand(anchor, candidates, num_placements, constraints)\n        solution = local_search(solution, candidates, constraints)\n\n        if solution.score > best_score:\n            best_solution = solution\n            best_score = solution.score\n\n    return best_solution\n```\n\n## Key Insights\n\n1. **Prune early, prune aggressively** - Every tile removed saves exponential work later\n\n2. **High-value tiles cluster** - Good placements tend to be near other good placements (adjacency bonuses compound)\n\n3. **Anchors constrain the search** - Once you fix an anchor, many other decisions follow logically\n\n4. **Greedy + local search is often sufficient** - You don't need the global optimum; a good local optimum found quickly beats a perfect solution found slowly\n\n5. **Constraint propagation** - When you place one item, update what's valid for remaining items immediately\n\n## Common Pitfalls\n\n- **Ignoring interactions** - Placing item A may change the value of placing item B (adjacency effects, mutual exclusion)\n- **Over-optimizing one metric** - Balance intrinsic value with flexibility for remaining placements\n- **Forgetting to validate** - Always verify final solution satisfies ALL constraints\n",{"name":5,"description":7},"main","7eeb258ada72b7f58119b0e7a2c00ea89d9beedd","tasks\u002Fciv6-adjacency-optimizer\u002Fenvironment\u002Fskills\u002Fmap-optimization-strategy","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench","https:\u002F\u002Fgithub.com\u002FWaaaalnut","student of Zhejiang University","2026-04-21 23:16:23",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add Waaaalnut\u002Fskillsbench --skill map-optimization-strategy",{"tool":50,"command":51},"bunx","bunx skills add Waaaalnut\u002Fskillsbench --skill map-optimization-strategy",{"tool":53,"command":54},"pnpm","pnpm dlx skills add Waaaalnut\u002Fskillsbench --skill map-optimization-strategy","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fciv6-adjacency-optimizer\u002Fenvironment\u002Fskills\u002Fmap-optimization-strategy\u002FSKILL.md",true,[],[59,73,88,113,135,153],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":69,"publishedAt":32},"01M6XEWMJ6VY3ZC53MPDCPG3GH","data-reconciliation","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fxlsx-recover-data\u002Fenvironment\u002Fskills\u002Fdata-reconciliation\u002FSKILL.md",[64],{"categoryNo":65,"categoryName":66,"taxonomyType":67,"taxonomyTypeDesc":68},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[70,71,72],"data reconciliation","reconciliation","data",{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":32},"01M6XEW8MNPMF1KRXV6ATGFRQF","speech-to-text","Transcribe video to timestamped text using Whisper tiny model (pre-installed).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-tutorial-indexer\u002Fenvironment\u002Fskills\u002Fspeech-to-text\u002FSKILL.md",[],[80,81,82,83,84,85,86,87],"speech","text","speech to text","transcribe video","whisper","model","Video","transcribe",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":99,"publishedAt":32},"01M6XEW3FQZP0T1RKQQJFXVY9T","video-processor","Process videos by removing segments and concatenating remaining parts. Use when you need to remove detected pauses\u002Fopenings from videos, create highlight reels, or batch process segment removals using ffmpeg filter_complex.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fvideo-processor\u002FSKILL.md",[94],{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[86,100,101,102,103,104,31,105,106,107,108,26,109,110,111,23,112],"processor","video processor","batch","create","reels","parts","segments","process","videos","segment","filter","ffmpeg","remove",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":120,"publishedAt":32},"01M6XEVXJ5KZ0NTY3XZKRY4AS1","silence-detector","Detect initial silence segments in audio\u002Fvideo using energy-based analysis. Use when you need to find low-energy periods at the start of recordings (title slides, setup time, pre-roll silence).","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsilence-detector\u002FSKILL.md",[119],{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},[121,122,123,124,31,26,125,126,127,128,129,106,130,131,86,132,133,134,23],"detector","silence detector","title","slides","time","energy","at","recordings","detect","find","Audio","analysis","start","setup",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":32},"01M6XEVT3NGRN1FT7JPMAPXS6M","segment-combiner","Combine multiple segment detection results into a unified list. Use when you need to merge segments from different detectors, prepare removal lists for video processing, or consolidate detection outputs.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Fsegment-combiner\u002FSKILL.md",[],[109,142,86,143,144,145,146,28,31,147,148,106,26,149,150,23,151,152],"segment combiner","detection","prepare","merge","video processing","outputs","combine","processing","consolidate","results","list",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":162,"publishedAt":32},"01M6XEVMPVASGS2KX86QK4FMT7","report-generator","Generate compression reports for video processing. Use when you need to create structured JSON reports with duration statistics, compression ratios, and segment details after video processing.","https:\u002F\u002Fgithub.com\u002FWaaaalnut\u002Fskillsbench\u002Fblob\u002Fmain\u002Ftasks\u002Fvideo-silence-remover\u002Fenvironment\u002Fskills\u002Freport-generator\u002FSKILL.md",[159],{"categoryNo":160,"categoryName":161,"taxonomyType":67,"taxonomyTypeDesc":68},"01JBSEEDCAT000000000000034","行政与办公人员",[163,164,165,109,31,28,26,166,149,167,168,169,23,146,170,86,171,172,103],"generator","report generator","report","with","statistics","structured","reports","json","compression","generate"]