[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CZ5QMXCF78Z3ES0S053HAV":3,"skill-same:01M6CZ5QMXCF78Z3ES0S053HAV":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":26,"frontMatter":27,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M6CZ5QMXCF78Z3ES0S053HAV","stat-cluster-samples",null,"Cluster samples or features using k-means or hierarchical clustering, evaluate cluster quality with silhouette scores, and produce a dendrogram or cluster plot.","Scientific-Tooling\u002Fstructured-intelligence","Scientific-Tooling","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F267453265?v=4","01M6CZ1SE6GGD4F67EAQ0PVX38","Scientific Tooling","01M6CZ1SJKCFVGH10Z3A152K02",4,"MIT","https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-cluster-samples\u002FSKILL.md",[],[19,20,21,22],"stat cluster samples","produce","clustering","quality","2026-11-10 10:12:30",false,"---\nname: stat-cluster-samples\ndescription: Cluster samples or features using k-means or hierarchical clustering, evaluate cluster quality with silhouette scores, and produce a dendrogram or cluster plot.\n---\n\n# Skill: Sample Clustering\n\n## Use When\n\n- User wants to discover groups of similar samples or features in high-dimensional data\n- User wants to create a heatmap with hierarchical clustering of genes and samples\n- User wants to determine the optimal number of clusters for k-means\n- Use cases: gene expression pattern discovery, cell type grouping, patient stratification\n\n## Inputs\n\n- Required:\n  - Data matrix (CSV or TSV): rows = samples (or features), columns = features (or samples)\n- Optional:\n  - Matrix orientation: `samples_as_rows` (default) or `samples_as_columns`\n  - Clustering method: `hierarchical` (default) or `kmeans`\n  - For hierarchical: linkage method (`ward` default, `complete`, `average`, `single`)\n  - Distance metric: `euclidean` (default), `correlation`, or `cosine`\n  - For k-means: number of clusters k (default: auto-select using elbow method, k = 2–10)\n  - Scale features before clustering: `true` (default) or `false`\n  - Metadata table for heatmap annotation (optional)\n  - Output directory (default: `.\u002Fcluster_output`)\n\n## Workflow\n\n1. Read data matrix; scale features if requested.\n2. If hierarchical clustering:\n   a. Compute distance matrix using specified metric.\n   b. Perform hierarchical clustering on both rows (samples) and columns (features).\n   c. Generate a clustered heatmap with dendrogram.\n3. If k-means:\n   a. If k not specified: compute within-cluster sum of squares for k = 2–10; plot elbow curve; select k at elbow.\n   b. Fit k-means with selected k; report cluster assignments.\n   c. Generate PCA-based cluster scatter plot.\n4. Compute silhouette score for final cluster solution; report mean and per-sample scores.\n5. Assign and report cluster labels for each sample.\n6. Write cluster assignments (TSV), silhouette scores (TSV), heatmap or cluster plot (PDF) to output directory.\n7. Save the executable analysis script (`analysis_code.py` or `analysis_code.R`) and software version manifest (`session_info.txt`) used to produce results.\n\n## Output Contract\n\n- Cluster assignments table (TSV): sample_id, cluster_label\n- Silhouette scores table (TSV): sample_id, silhouette_score, cluster_label\n- Clustered heatmap (PDF, hierarchical) or cluster scatter plot (PDF, k-means)\n- Elbow curve (PDF, k-means only when k is auto-selected)\n- Mean silhouette score (printed to stdout)\n- Reproducibility artifacts: `analysis_code.py` or `analysis_code.R`, plus `session_info.txt`\n\n## Limits\n\n- K-means assumes spherical, similarly sized clusters; performs poorly on elongated or irregular shapes.\n- Hierarchical clustering with Ward linkage and Euclidean distance is sensitive to outliers; remove outliers before clustering.\n- Very large matrices (> 10k samples or > 50k features) may be slow; consider subsampling or running PCA first.\n- Common failure: data with many zero entries (e.g., single-cell) — apply dimensionality reduction first.\n","# Skill: Sample Clustering\n\n## Use When\n\n- User wants to discover groups of similar samples or features in high-dimensional data\n- User wants to create a heatmap with hierarchical clustering of genes and samples\n- User wants to determine the optimal number of clusters for k-means\n- Use cases: gene expression pattern discovery, cell type grouping, patient stratification\n\n## Inputs\n\n- Required:\n  - Data matrix (CSV or TSV): rows = samples (or features), columns = features (or samples)\n- Optional:\n  - Matrix orientation: `samples_as_rows` (default) or `samples_as_columns`\n  - Clustering method: `hierarchical` (default) or `kmeans`\n  - For hierarchical: linkage method (`ward` default, `complete`, `average`, `single`)\n  - Distance metric: `euclidean` (default), `correlation`, or `cosine`\n  - For k-means: number of clusters k (default: auto-select using elbow method, k = 2–10)\n  - Scale features before clustering: `true` (default) or `false`\n  - Metadata table for heatmap annotation (optional)\n  - Output directory (default: `.\u002Fcluster_output`)\n\n## Workflow\n\n1. Read data matrix; scale features if requested.\n2. If hierarchical clustering:\n   a. Compute distance matrix using specified metric.\n   b. Perform hierarchical clustering on both rows (samples) and columns (features).\n   c. Generate a clustered heatmap with dendrogram.\n3. If k-means:\n   a. If k not specified: compute within-cluster sum of squares for k = 2–10; plot elbow curve; select k at elbow.\n   b. Fit k-means with selected k; report cluster assignments.\n   c. Generate PCA-based cluster scatter plot.\n4. Compute silhouette score for final cluster solution; report mean and per-sample scores.\n5. Assign and report cluster labels for each sample.\n6. Write cluster assignments (TSV), silhouette scores (TSV), heatmap or cluster plot (PDF) to output directory.\n7. Save the executable analysis script (`analysis_code.py` or `analysis_code.R`) and software version manifest (`session_info.txt`) used to produce results.\n\n## Output Contract\n\n- Cluster assignments table (TSV): sample_id, cluster_label\n- Silhouette scores table (TSV): sample_id, silhouette_score, cluster_label\n- Clustered heatmap (PDF, hierarchical) or cluster scatter plot (PDF, k-means)\n- Elbow curve (PDF, k-means only when k is auto-selected)\n- Mean silhouette score (printed to stdout)\n- Reproducibility artifacts: `analysis_code.py` or `analysis_code.R`, plus `session_info.txt`\n\n## Limits\n\n- K-means assumes spherical, similarly sized clusters; performs poorly on elongated or irregular shapes.\n- Hierarchical clustering with Ward linkage and Euclidean distance is sensitive to outliers; remove outliers before clustering.\n- Very large matrices (> 10k samples or > 50k features) may be slow; consider subsampling or running PCA first.\n- Common failure: data with many zero entries (e.g., single-cell) — apply dimensionality reduction first.\n",{"name":5,"description":7},"main","5118e7fda890e9aa819cb71e003cd243d3a31970","skills\u002Fstat-cluster-samples",1,"https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence","https:\u002F\u002Fgithub.com\u002FScientific-Tooling","2026-11-03 00:01:40",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Scientific-Tooling\u002Fstructured-intelligence --skill stat-cluster-samples",{"tool":41,"command":42},"bunx","bunx skills add Scientific-Tooling\u002Fstructured-intelligence --skill stat-cluster-samples",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Scientific-Tooling\u002Fstructured-intelligence --skill stat-cluster-samples","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-cluster-samples\u002FSKILL.md",true,[49,55,59],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"agents\u002Fclaude.yaml","REFERENCE","参考文档",373,"https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-cluster-samples\u002Fagents\u002Fclaude.yaml",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"agents\u002Fopenai.yaml",374,"https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-cluster-samples\u002Fagents\u002Fopenai.yaml",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"config.yaml",332,"https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-cluster-samples\u002Fconfig.yaml",[64,92,105,118,131,143],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":75,"publishedAt":23},"01M6CZ6S2C54G03K71G77H22KE","structured-intelligence-skill-creator","Create or update repository skills that conform to local templates, provider metadata requirements, registry rules, and validation workflows.","https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstructured-intelligence-skill-creator\u002FSKILL.md",[70],{"categoryNo":71,"categoryName":72,"taxonomyType":73,"taxonomyTypeDesc":74},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91],"structured intelligence skill creator","skill creator","intelligence","structured","create","requirements","workflows","provider","update","registry","local","validation","metadata","repository","templates","Rules",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":23},"01M6CZ6M3JFN400406T1NPWNER","stat-survival-analysis","Estimate and compare survival functions using Kaplan-Meier curves and log-rank test, with optional Cox proportional hazards regression.","https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-survival-analysis\u002FSKILL.md",[],[99,100,101,102,103,104],"analysis","stat survival analysis","regression","log","functions","test",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":23},"01M6CZ6G5JPDZASM4DRD9QCTEE","stat-pca","Perform PCA on a numeric data matrix to reduce dimensionality, visualize sample structure, and identify top contributing features.","https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-pca\u002FSKILL.md",[],[112,113,114,115,116,117],"stat pca","sample","visualize","contributing","data","structure",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":23},"01M6CZ6D9A3N6849BT9VYFSBK5","stat-pairwise-correlation","Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.","https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-pairwise-correlation\u002FSKILL.md",[],[125,126,20,127,128,129,130],"stat pairwise correlation","correlation","heatmap","compute","across","tests",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":23},"01M6CZ69DMF1PDKW83RWARQX6D","stat-nonlinear-embedding","Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.","https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-nonlinear-embedding\u002FSKILL.md",[],[138,139,116,140,113,141,142],"stat nonlinear embedding","visualization","relationships","cell","exploratory visualization",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":23},"01M6CZ65YZGJV40F2FZNH04PBS","stat-logistic-regression","Fit a logistic regression model for binary outcomes, report odds ratios and model performance (AUC-ROC, confusion matrix).","https:\u002F\u002Fgithub.com\u002FScientific-Tooling\u002Fstructured-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fstat-logistic-regression\u002FSKILL.md",[],[101,150,151,152,153,154],"stat logistic regression","report","model","outcomes","performance"]