[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KK948V8MDTEX8CVATFYAWR":3,"skill-same:01M6KK948V8MDTEX8CVATFYAWR":67},{"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":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":13,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6KK948V8MDTEX8CVATFYAWR","codebase-pattern-analyzer",null,"Analyze a reference codebase to discover and extract reusable architectural patterns. Produces structured pattern descriptions that can be turned into standalone skills. This is a meta-skill that bootstraps the skill evolution chain.","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\u002Fcodebase-pattern-analyzer\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"pattern","codebase pattern analyzer","codebase","analyzer","reference","reusable","patterns","meta-skill","Meta","structured","discover","chain","extract","can","standalone","evolution","analyze","2026-11-10 10:12:30",false,"---\nname: codebase-pattern-analyzer\ndescription: Analyze a reference codebase to discover and extract reusable architectural patterns. Produces structured pattern descriptions that can be turned into standalone skills. This is a meta-skill that bootstraps the skill evolution chain.\n---\n\n# Codebase Pattern Analyzer\n\nSystematically analyze a reference codebase and extract reusable architectural patterns into structured descriptions. These descriptions become the raw material for new skills (via the `skill-template-generator` skill).\n\n## When to Use\n\n- You need to understand how a large codebase is structured before replicating it\n- You want to extract a specific pattern (component architecture, service layer, API proxy, etc.) from a reference project\n- You are bootstrapping a new project that should follow the conventions of an existing one\n\n## Step 1: Map the Directory Structure\n\nRead the top-level directory and identify the major code zones:\n\n```\nlist_dir \u003Cproject_root>\nlist_dir \u003Cproject_root>\u002Fsrc\n```\n\nClassify each directory into one of these roles:\n\n| Role | Typical Dirs | What to Look For |\n|------|-------------|------------------|\n| **Components** | `src\u002Fcomponents\u002F` | UI classes, base class inheritance, DOM manipulation |\n| **Services** | `src\u002Fservices\u002F` | Data fetching, API calls, circuit breakers, caching |\n| **Config** | `src\u002Fconfig\u002F` | Constants, panel definitions, API endpoints, feature flags |\n| **Styles** | `src\u002Fstyles\u002F` | CSS custom properties, theme variables, grid layout |\n| **Utils** | `src\u002Futils\u002F` | Helper functions, formatting, DOM utilities |\n| **API Layer** | `api\u002F`, `server\u002F` | Serverless functions, route handlers, CORS, proxy logic |\n| **Entry Point** | `src\u002Fmain.ts` | Bootstrap, panel instantiation, scheduler setup |\n\n## Step 2: Identify the Component Pattern\n\nFind the base component class (usually the most imported file in `components\u002F`):\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fcomponents\u002FPanel.ts\n```\n\nExtract these structural elements:\n\n1. **Constructor options interface** — what config each component accepts (id, title, className, etc.)\n2. **DOM structure** — how the element tree is built (header, content area, resize handles)\n3. **Lifecycle methods** — constructor, destroy, show\u002Fhide, refresh\n4. **State management** — loading\u002Ferror\u002Fcontent states, fetching guards\n5. **Data binding** — how data flows from service → render → DOM\n\nRecord the pattern as:\n```\nCOMPONENT PATTERN:\n  Base class: [name]\n  Options: [list of constructor params]\n  DOM tree: [element hierarchy]\n  States: [loading, error, content]\n  Lifecycle: [init → fetch → render → destroy]\n  Key methods: [getElement, showLoading, showError, setContent, refresh, destroy]\n```\n\n## Step 3: Identify the Service Layer Pattern\n\nExamine 2-3 service files to find the common structure:\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fservices\u002Fnews.ts\nread_file \u003Cproject_root>\u002Fsrc\u002Fservices\u002Fstock-market.ts\n```\n\nLook for:\n\n1. **Circuit breaker \u002F resilience** — retry logic, cooldown, cached fallback\n2. **Interface definitions** — typed data shapes returned by each service\n3. **Fetch pattern** — how HTTP calls are made (direct fetch, proxy, batching)\n4. **Caching strategy** — TTLs, stale-while-revalidate, in-memory cache\n5. **Error handling** — what happens on failure, default return values\n\nRecord as:\n```\nSERVICE PATTERN:\n  Resilience: [circuit breaker with N failures → cooldown]\n  Cache: [in-memory, TTL=Xms]\n  Fetch: [browser fetch → \u002Fapi\u002F... proxy → external API]\n  Error: [catch → recordFailure → return default]\n  Exports: [async functions, not class instances]\n```\n\n## Step 4: Identify the API Proxy Pattern\n\nRead the server-side proxy layer:\n\n```\nlist_dir \u003Cproject_root>\u002Fapi\u002F\nread_file \u003Cproject_root>\u002Fapi\u002F_cors.js\nread_file \u003Cproject_root>\u002Fapi\u002Fstocks.ts    # or similar endpoint\n```\n\nExtract:\n\n1. **File-per-endpoint structure** — one file per API domain\n2. **CORS handling** — origin allowlist, preflight response\n3. **API key isolation** — `process.env.*` usage, never exposed to frontend\n4. **Cache headers** — `Cache-Control`, `s-maxage`, `stale-while-revalidate`\n5. **Error wrapping** — structured JSON errors, never raw upstream responses\n6. **Input validation** — query parameter checks before upstream call\n\n## Step 5: Identify the Styling System\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fstyles\u002Fmain.css   # first 100 lines for CSS variables\n```\n\nExtract:\n\n1. **CSS custom properties** — color tokens, font stacks, spacing\n2. **Theme structure** — dark\u002Flight mode switch mechanism\n3. **Grid layout** — `grid-template-columns`, `auto-fill`, `minmax()` values\n4. **Component styles** — panel base styles, header, content, scrollbar\n5. **Semantic colors** — positive\u002Fnegative, severity levels, status indicators\n6. **Typography** — font family, sizes, letter-spacing, text-transform\n\n## Step 6: Identify the Scheduling \u002F Refresh Pattern\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fapp\u002Frefresh-scheduler.ts\n```\n\nExtract:\n\n1. **Registration API** — how panels register their refresh functions\n2. **Interval management** — per-panel configurable intervals\n3. **Visibility awareness** — pause when tab hidden, flush stale on return\n4. **In-flight guards** — prevent duplicate concurrent refreshes\n5. **Stagger logic** — avoid API burst when resuming\n\n## Step 7: Synthesize Into Pattern Descriptions\n\nFor each pattern discovered, produce a structured description:\n\n```markdown\n## Pattern: [Name]\n\n**Source file(s)**: [paths in reference codebase]\n**Category**: component | service | api | style | scheduler | utility\n\n### Structure\n[Key structural elements — interfaces, classes, functions]\n\n### Key Code\n[Minimal representative code snippet, 20-40 lines]\n\n### Conventions\n[Naming, file organization, import paths]\n\n### Dependencies\n[Other patterns this depends on]\n\n### Adaptation Notes\n[What must change when applying to a different project]\n```\n\n## Output\n\nThe final output should be a list of pattern descriptions, one per architectural concern. These become the input to the `skill-template-generator` skill, which turns each pattern into a standalone SKILL.md.\n\n## Tips\n\n- **Read broadly first, deeply second** — scan directory listings before reading individual files\n- **Follow imports** — if a component imports from `..\u002Fservices\u002F`, read that service next\n- **Count instances** — if 10+ components extend the same base class, that's a core pattern\n- **Note what's NOT used** — no framework (React, Vue) means vanilla DOM; no ORM means raw fetch\n- **Compare 2-3 examples** of the same pattern to distinguish the template from the instance-specific parts\n\n","# Codebase Pattern Analyzer\n\nSystematically analyze a reference codebase and extract reusable architectural patterns into structured descriptions. These descriptions become the raw material for new skills (via the `skill-template-generator` skill).\n\n## When to Use\n\n- You need to understand how a large codebase is structured before replicating it\n- You want to extract a specific pattern (component architecture, service layer, API proxy, etc.) from a reference project\n- You are bootstrapping a new project that should follow the conventions of an existing one\n\n## Step 1: Map the Directory Structure\n\nRead the top-level directory and identify the major code zones:\n\n```\nlist_dir \u003Cproject_root>\nlist_dir \u003Cproject_root>\u002Fsrc\n```\n\nClassify each directory into one of these roles:\n\n| Role | Typical Dirs | What to Look For |\n|------|-------------|------------------|\n| **Components** | `src\u002Fcomponents\u002F` | UI classes, base class inheritance, DOM manipulation |\n| **Services** | `src\u002Fservices\u002F` | Data fetching, API calls, circuit breakers, caching |\n| **Config** | `src\u002Fconfig\u002F` | Constants, panel definitions, API endpoints, feature flags |\n| **Styles** | `src\u002Fstyles\u002F` | CSS custom properties, theme variables, grid layout |\n| **Utils** | `src\u002Futils\u002F` | Helper functions, formatting, DOM utilities |\n| **API Layer** | `api\u002F`, `server\u002F` | Serverless functions, route handlers, CORS, proxy logic |\n| **Entry Point** | `src\u002Fmain.ts` | Bootstrap, panel instantiation, scheduler setup |\n\n## Step 2: Identify the Component Pattern\n\nFind the base component class (usually the most imported file in `components\u002F`):\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fcomponents\u002FPanel.ts\n```\n\nExtract these structural elements:\n\n1. **Constructor options interface** — what config each component accepts (id, title, className, etc.)\n2. **DOM structure** — how the element tree is built (header, content area, resize handles)\n3. **Lifecycle methods** — constructor, destroy, show\u002Fhide, refresh\n4. **State management** — loading\u002Ferror\u002Fcontent states, fetching guards\n5. **Data binding** — how data flows from service → render → DOM\n\nRecord the pattern as:\n```\nCOMPONENT PATTERN:\n  Base class: [name]\n  Options: [list of constructor params]\n  DOM tree: [element hierarchy]\n  States: [loading, error, content]\n  Lifecycle: [init → fetch → render → destroy]\n  Key methods: [getElement, showLoading, showError, setContent, refresh, destroy]\n```\n\n## Step 3: Identify the Service Layer Pattern\n\nExamine 2-3 service files to find the common structure:\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fservices\u002Fnews.ts\nread_file \u003Cproject_root>\u002Fsrc\u002Fservices\u002Fstock-market.ts\n```\n\nLook for:\n\n1. **Circuit breaker \u002F resilience** — retry logic, cooldown, cached fallback\n2. **Interface definitions** — typed data shapes returned by each service\n3. **Fetch pattern** — how HTTP calls are made (direct fetch, proxy, batching)\n4. **Caching strategy** — TTLs, stale-while-revalidate, in-memory cache\n5. **Error handling** — what happens on failure, default return values\n\nRecord as:\n```\nSERVICE PATTERN:\n  Resilience: [circuit breaker with N failures → cooldown]\n  Cache: [in-memory, TTL=Xms]\n  Fetch: [browser fetch → \u002Fapi\u002F... proxy → external API]\n  Error: [catch → recordFailure → return default]\n  Exports: [async functions, not class instances]\n```\n\n## Step 4: Identify the API Proxy Pattern\n\nRead the server-side proxy layer:\n\n```\nlist_dir \u003Cproject_root>\u002Fapi\u002F\nread_file \u003Cproject_root>\u002Fapi\u002F_cors.js\nread_file \u003Cproject_root>\u002Fapi\u002Fstocks.ts    # or similar endpoint\n```\n\nExtract:\n\n1. **File-per-endpoint structure** — one file per API domain\n2. **CORS handling** — origin allowlist, preflight response\n3. **API key isolation** — `process.env.*` usage, never exposed to frontend\n4. **Cache headers** — `Cache-Control`, `s-maxage`, `stale-while-revalidate`\n5. **Error wrapping** — structured JSON errors, never raw upstream responses\n6. **Input validation** — query parameter checks before upstream call\n\n## Step 5: Identify the Styling System\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fstyles\u002Fmain.css   # first 100 lines for CSS variables\n```\n\nExtract:\n\n1. **CSS custom properties** — color tokens, font stacks, spacing\n2. **Theme structure** — dark\u002Flight mode switch mechanism\n3. **Grid layout** — `grid-template-columns`, `auto-fill`, `minmax()` values\n4. **Component styles** — panel base styles, header, content, scrollbar\n5. **Semantic colors** — positive\u002Fnegative, severity levels, status indicators\n6. **Typography** — font family, sizes, letter-spacing, text-transform\n\n## Step 6: Identify the Scheduling \u002F Refresh Pattern\n\n```\nread_file \u003Cproject_root>\u002Fsrc\u002Fapp\u002Frefresh-scheduler.ts\n```\n\nExtract:\n\n1. **Registration API** — how panels register their refresh functions\n2. **Interval management** — per-panel configurable intervals\n3. **Visibility awareness** — pause when tab hidden, flush stale on return\n4. **In-flight guards** — prevent duplicate concurrent refreshes\n5. **Stagger logic** — avoid API burst when resuming\n\n## Step 7: Synthesize Into Pattern Descriptions\n\nFor each pattern discovered, produce a structured description:\n\n```markdown\n## Pattern: [Name]\n\n**Source file(s)**: [paths in reference codebase]\n**Category**: component | service | api | style | scheduler | utility\n\n### Structure\n[Key structural elements — interfaces, classes, functions]\n\n### Key Code\n[Minimal representative code snippet, 20-40 lines]\n\n### Conventions\n[Naming, file organization, import paths]\n\n### Dependencies\n[Other patterns this depends on]\n\n### Adaptation Notes\n[What must change when applying to a different project]\n```\n\n## Output\n\nThe final output should be a list of pattern descriptions, one per architectural concern. These become the input to the `skill-template-generator` skill, which turns each pattern into a standalone SKILL.md.\n\n## Tips\n\n- **Read broadly first, deeply second** — scan directory listings before reading individual files\n- **Follow imports** — if a component imports from `..\u002Fservices\u002F`, read that service next\n- **Count instances** — if 10+ components extend the same base class, that's a core pattern\n- **Note what's NOT used** — no framework (React, Vue) means vanilla DOM; no ORM means raw fetch\n- **Compare 2-3 examples** of the same pattern to distinguish the template from the instance-specific parts\n\n",{"name":5,"description":7},"main","ff671ef61ed6587c49bd54c81cdc751c0b99e363","showcase\u002Fskills\u002Fcodebase-pattern-analyzer","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":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add AG064\u002FOpenSpace --skill codebase-pattern-analyzer",{"tool":53,"command":54},"bunx","bunx skills add AG064\u002FOpenSpace --skill codebase-pattern-analyzer",{"tool":56,"command":57},"pnpm","pnpm dlx skills add AG064\u002FOpenSpace --skill codebase-pattern-analyzer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fcodebase-pattern-analyzer\u002FSKILL.md",true,[61],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},".skill_id","OTHER","其他",39,"https:\u002F\u002Fgithub.com\u002FAG064\u002FOpenSpace\u002Fblob\u002Fmain\u002Fshowcase\u002Fskills\u002Fcodebase-pattern-analyzer\u002F.skill_id",[68,92,109,118,146,162],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":35},"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",[],[75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91],"write special chars ts check","check","write","filters","Existing","type-checking","for","errors","script","output","type","files","only","template","file","python","typescript",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":35},"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",[],[99,100,77,88,101,102,89,90,103,104,105,106,107,81,83,108],"readback","write special chars readback","cleanup","read","scripts","verification","via","post","helper","with",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":35},"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",[],[77,116,90,81,105,88,117,89,83],"write special chars heredoc","shell",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":129,"publishedAt":35},"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",[124],{"categoryNo":125,"categoryName":126,"taxonomyType":127,"taxonomyTypeDesc":128},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[22,130,131,132,91,133,134,135,136,137,81,138,139,24,140,141,142,143,144,145],"worldmonitor","worldmonitor reference","dashboard","css","architecture","extracting","hierarchy","source","layer","panel","edge functions","integrations","open","api","data","scheduler",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":35},"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",[],[153,154,155,156,81,157,108,158,159,160,161],"virtual list","list","virtual","chunk","dom","rendering","recycling","implement","performance",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":35},"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",[],[169,170,171,172,173,174,89,175,176,177],"directory","verify","structure","verify directory structure","access","first","issues","diagnose","file access"]