[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KK9A19MANM95GKQVASDN4W":3,"skill-same:01M6KK9A19MANM95GKQVASDN4W":65},{"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":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":13,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6KK9A19MANM95GKQVASDN4W","combined-head-linecount-check",null,"Verify a file's first N lines and total line count in one shell call using head and wc -l with an echo separator, minimizing read operations and shell iterations.","AG064\u002FOpenSpace","AG064","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184930299?v=4","01M6KHVFG7TB73NHX3RDYSTMH2","01M6KHVFMM7XA2PZA9Z83PHS3V",0,"MIT","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fcombined-head-linecount-check\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"check","head","combined head linecount check","file","first","verify","shell","read","operations","Echo","call","line","with","line count","wc","2026-11-10 10:12:30",false,"---\nname: combined-head-linecount-check\ndescription: Verify a file's first N lines and total line count in one shell call using head and wc -l with an echo separator, minimizing read operations and shell iterations.\n---\n\n# Combined Head + Line Count Check\n\nWhen you need to **both** inspect the top of a file and confirm its total line count, collapse the two checks into a single `run_shell` call instead of issuing two separate commands.\n\n## Why\n\n- Each shell call is a round-trip. Two separate calls (`head` then `wc -l`) cost two iterations.\n- A combined call costs one iteration and returns both pieces of information atomically.\n- When checking multiple files at once, each file still only needs one call (or all files can be parallelized in a single compound command).\n\n## Pattern\n\n```bash\nhead -N \u003Cfile> && echo \"---\" && wc -l \u003Cfile>\n```\n\nThe `echo \"---\"` separator makes the output easy to parse visually: everything above the dashes is content, everything below is the line count.\n\n## Examples\n\n### Single file — inspect first 10 lines and total count\n\n```bash\nhead -10 src\u002Fmain.ts && echo \"---\" && wc -l src\u002Fmain.ts\n```\n\nSample output:\n```\nimport { createApp } from 'vue'\nimport App from '.\u002FApp.vue'\n...\n---\n      142 src\u002Fmain.ts\n```\n\n### Multiple files — fully parallelized\n\nWhen you need to check several files simultaneously, run them all in one shell call using `&&` chains or newline-separated subshells:\n\n```bash\n(head -10 src\u002Fmain.ts     && echo \"---\" && wc -l src\u002Fmain.ts)     && echo \"===\" && \\\n(head -10 vite.config.ts  && echo \"---\" && wc -l vite.config.ts)  && echo \"===\" && \\\n(head -5  package.json    && echo \"---\" && wc -l package.json)\n```\n\nOr, if order independence is acceptable, run them in parallel background jobs and wait:\n\n```bash\n{\n  head -10 src\u002Fmain.ts    && echo \"---\" && wc -l src\u002Fmain.ts\n} &\n{\n  head -10 vite.config.ts && echo \"---\" && wc -l vite.config.ts\n} &\nwait\n```\n\n## When to Apply\n\n| Situation | Recommendation |\n|-----------|---------------|\n| Verifying a generated\u002Fmodified file was written correctly | ✅ Use combined call |\n| Checking multiple output files after a build step | ✅ Parallelize all in one shell call |\n| Only need line count (no content preview required) | Use plain `wc -l` |\n| Only need content (no line count required) | Use plain `head -N` |\n| File is extremely large and you want a middle section | Use `sed -n` or `awk` instead |\n\n## Integration with Parallel Reads\n\nThis pattern compounds well with parallel file reads. In a single iteration you can:\n\n1. Read file contents with `cat` or `head` for multiple files.\n2. Simultaneously verify line counts with `wc -l`.\n3. Check for specific patterns with `grep -c`.\n\nExample of a 5-file parallel verification in one shell call:\n\n```bash\necho \"=== main.ts ===\" && head -10 src\u002Fmain.ts && echo \"lines:\" && wc -l \u003C src\u002Fmain.ts && \\\necho \"=== config ===\" && head -5 vite.config.ts && echo \"lines:\" && wc -l \u003C vite.config.ts && \\\necho \"=== package ===\" && head -5 package.json && echo \"lines:\" && wc -l \u003C package.json && \\\necho \"=== index ===\" && head -8 index.html && echo \"lines:\" && wc -l \u003C index.html && \\\necho \"=== readme ===\" && head -5 README.md && echo \"lines:\" && wc -l \u003C README.md\n```\n\n> **Tip:** Using `wc -l \u003C file` (with input redirect) prints only the number, without the filename — cleaner output when the filename is already shown by the `echo` label above it.\n\n## Key Takeaway\n\n> **Never use two shell calls where one will do.** Combining `head -N` and `wc -l` in a single command is the minimal-overhead way to answer both \"what does this file contain?\" and \"is it the right size?\" simultaneously.","# Combined Head + Line Count Check\n\nWhen you need to **both** inspect the top of a file and confirm its total line count, collapse the two checks into a single `run_shell` call instead of issuing two separate commands.\n\n## Why\n\n- Each shell call is a round-trip. Two separate calls (`head` then `wc -l`) cost two iterations.\n- A combined call costs one iteration and returns both pieces of information atomically.\n- When checking multiple files at once, each file still only needs one call (or all files can be parallelized in a single compound command).\n\n## Pattern\n\n```bash\nhead -N \u003Cfile> && echo \"---\" && wc -l \u003Cfile>\n```\n\nThe `echo \"---\"` separator makes the output easy to parse visually: everything above the dashes is content, everything below is the line count.\n\n## Examples\n\n### Single file — inspect first 10 lines and total count\n\n```bash\nhead -10 src\u002Fmain.ts && echo \"---\" && wc -l src\u002Fmain.ts\n```\n\nSample output:\n```\nimport { createApp } from 'vue'\nimport App from '.\u002FApp.vue'\n...\n---\n      142 src\u002Fmain.ts\n```\n\n### Multiple files — fully parallelized\n\nWhen you need to check several files simultaneously, run them all in one shell call using `&&` chains or newline-separated subshells:\n\n```bash\n(head -10 src\u002Fmain.ts     && echo \"---\" && wc -l src\u002Fmain.ts)     && echo \"===\" && \\\n(head -10 vite.config.ts  && echo \"---\" && wc -l vite.config.ts)  && echo \"===\" && \\\n(head -5  package.json    && echo \"---\" && wc -l package.json)\n```\n\nOr, if order independence is acceptable, run them in parallel background jobs and wait:\n\n```bash\n{\n  head -10 src\u002Fmain.ts    && echo \"---\" && wc -l src\u002Fmain.ts\n} &\n{\n  head -10 vite.config.ts && echo \"---\" && wc -l vite.config.ts\n} &\nwait\n```\n\n## When to Apply\n\n| Situation | Recommendation |\n|-----------|---------------|\n| Verifying a generated\u002Fmodified file was written correctly | ✅ Use combined call |\n| Checking multiple output files after a build step | ✅ Parallelize all in one shell call |\n| Only need line count (no content preview required) | Use plain `wc -l` |\n| Only need content (no line count required) | Use plain `head -N` |\n| File is extremely large and you want a middle section | Use `sed -n` or `awk` instead |\n\n## Integration with Parallel Reads\n\nThis pattern compounds well with parallel file reads. In a single iteration you can:\n\n1. Read file contents with `cat` or `head` for multiple files.\n2. Simultaneously verify line counts with `wc -l`.\n3. Check for specific patterns with `grep -c`.\n\nExample of a 5-file parallel verification in one shell call:\n\n```bash\necho \"=== main.ts ===\" && head -10 src\u002Fmain.ts && echo \"lines:\" && wc -l \u003C src\u002Fmain.ts && \\\necho \"=== config ===\" && head -5 vite.config.ts && echo \"lines:\" && wc -l \u003C vite.config.ts && \\\necho \"=== package ===\" && head -5 package.json && echo \"lines:\" && wc -l \u003C package.json && \\\necho \"=== index ===\" && head -8 index.html && echo \"lines:\" && wc -l \u003C index.html && \\\necho \"=== readme ===\" && head -5 README.md && echo \"lines:\" && wc -l \u003C README.md\n```\n\n> **Tip:** Using `wc -l \u003C file` (with input redirect) prints only the number, without the filename — cleaner output when the filename is already shown by the `echo` label above it.\n\n## Key Takeaway\n\n> **Never use two shell calls where one will do.** Combining `head -N` and `wc -l` in a single command is the minimal-overhead way to answer both \"what does this file contain?\" and \"is it the right size?\" simultaneously.",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","showcase\u002Fskills\u002Fcombined-head-linecount-check","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace","https:\u002F\u002Fgithub.com\u002FAG064","AG064, E.Mi.\r\n\r\nA person who thinks all the time, yet all they have to think about is nothing. I want to improve the world and work on open source projects","2026-10-08 06:53:48",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add AG064\u002FOpenSpace --skill combined-head-linecount-check",{"tool":51,"command":52},"bunx","bunx skills add AG064\u002FOpenSpace --skill combined-head-linecount-check",{"tool":54,"command":55},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill combined-head-linecount-check","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fcombined-head-linecount-check\u002FSKILL.md",true,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},".skill_id","OTHER","其他",43,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fcombined-head-linecount-check\u002F.skill_id",[66,88,103,111,141,157],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":33},"01M6KKMPWA0B5SCCH766F8M5EA","write-special-chars-ts-check","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-ts-check\u002FSKILL.md",[],[73,18,74,75,76,77,78,79,80,81,82,83,84,85,21,86,87],"write special chars ts check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","python","typescript",{"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":94,"publishedAt":33},"01M6KKMJXVBNVEY3TRK055F4A7","write-special-chars-readback","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of \u002Ftmp helper scripts.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-readback\u002FSKILL.md",[],[95,96,74,85,97,25,21,86,98,99,100,101,102,78,80,30],"readback","write special chars readback","cleanup","scripts","verification","via","post","helper",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":33},"01M6KKMEGX9M9NC105J0W3Q5B9","write-special-chars-heredoc","Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) by using a Python heredoc script executed via shell.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fwrite-special-chars-heredoc\u002FSKILL.md",[],[74,110,86,78,100,85,24,21,80],"write special chars heredoc",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":122,"publishedAt":33},"01M6KKM8EJ2AATVHZBNB916WT0","worldmonitor-reference","Curated architecture index of the WorldMonitor open-source dashboard. Reference for extracting patterns — vanilla TypeScript, Panel class hierarchy, service layer, CSS grid, API edge functions, refresh scheduler, and 60+ data source integrations.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fworldmonitor-reference\u002FSKILL.md",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[123,124,125,126,87,127,128,129,130,131,78,132,133,134,135,136,137,138,139,140],"reference","worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","patterns","edge functions","integrations","open","api","data","scheduler",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":33},"01M6KKM39PHYK627F19GE2B9XN","virtual-list","Implement efficient virtual scrolling for rendering large lists with DOM recycling, chunk-based rendering, and performance optimizations","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fvirtual-list\u002FSKILL.md",[],[148,149,150,151,78,152,30,153,154,155,156],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":33},"01M6KKKY7T2P61Y0JH54CDEJKQ","verify-directory-structure","Diagnose and resolve file access issues by first verifying the directory structure.","https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fverify-directory-structure\u002FSKILL.md",[],[164,23,165,166,167,22,21,168,169,170],"directory","structure","verify directory structure","access","issues","diagnose","file access"]