[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BK1Z788WK2AEPWN3JFMM5C":3,"skill-same:01M7BK1Z788WK2AEPWN3JFMM5C":53},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7BK1Z788WK2AEPWN3JFMM5C","flowio",null,"Parse FCS (Flow Cytometry Standard) files v2.0-3.1. Extract events as NumPy arrays, read metadata\u002Fchannels, convert to CSV\u002FDataFrame, for flow cytometry data preprocessing.","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-AI-应用工具\u002FYYC3-AI-应用工具-claude-code-templates-main\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fflowio\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: flowio\ndescription: \"Parse FCS (Flow Cytometry Standard) files v2.0-3.1. Extract events as NumPy arrays, read metadata\u002Fchannels, convert to CSV\u002FDataFrame, for flow cytometry data preprocessing.\"\n---\n\n# FlowIO: Flow Cytometry Standard File Handler\n\n## Overview\n\nFlowIO is a lightweight Python library for reading and writing Flow Cytometry Standard (FCS) files. Parse FCS metadata, extract event data, and create new FCS files with minimal dependencies. The library supports FCS versions 2.0, 3.0, and 3.1, making it ideal for backend services, data pipelines, and basic cytometry file operations.\n\n## When to Use This Skill\n\nThis skill should be used when:\n\n- FCS files requiring parsing or metadata extraction\n- Flow cytometry data needing conversion to NumPy arrays\n- Event data requiring export to FCS format\n- Multi-dataset FCS files needing separation\n- Channel information extraction (scatter, fluorescence, time)\n- Cytometry file validation or inspection\n- Pre-processing workflows before advanced analysis\n\n**Related Tools:** For advanced flow cytometry analysis including compensation, gating, and FlowJo\u002FGatingML support, recommend FlowKit library as a companion to FlowIO.\n\n## Installation\n\n```bash\nuv pip install flowio\n```\n\nRequires Python 3.9 or later.\n\n## Quick Start\n\n### Basic File Reading\n\n```python\nfrom flowio import FlowData\n\n# Read FCS file\nflow_data = FlowData('experiment.fcs')\n\n# Access basic information\nprint(f\"FCS Version: {flow_data.version}\")\nprint(f\"Events: {flow_data.event_count}\")\nprint(f\"Channels: {flow_data.pnn_labels}\")\n\n# Get event data as NumPy array\nevents = flow_data.as_array()  # Shape: (events, channels)\n```\n\n### Creating FCS Files\n\n```python\nimport numpy as np\nfrom flowio import create_fcs\n\n# Prepare data\ndata = np.array([[100, 200, 50], [150, 180, 60]])  # 2 events, 3 channels\nchannels = ['FSC-A', 'SSC-A', 'FL1-A']\n\n# Create FCS file\ncreate_fcs('output.fcs', data, channels)\n```\n\n## Core Workflows\n\n### Reading and Parsing FCS Files\n\nThe FlowData class provides the primary interface for reading FCS files.\n\n**Standard Reading:**\n\n```python\nfrom flowio import FlowData\n\n# Basic reading\nflow = FlowData('sample.fcs')\n\n# Access attributes\nversion = flow.version              # '3.0', '3.1', etc.\nevent_count = flow.event_count      # Number of events\nchannel_count = flow.channel_count  # Number of channels\npnn_labels = flow.pnn_labels        # Short channel names\npns_labels = flow.pns_labels        # Descriptive stain names\n\n# Get event data\nevents = flow.as_array()            # Preprocessed (gain, log scaling applied)\nraw_events = flow.as_array(preprocess=False)  # Raw data\n```\n\n**Memory-Efficient Metadata Reading:**\n\nWhen only metadata is needed (no event data):\n\n```python\n# Only parse TEXT segment, skip DATA and ANALYSIS\nflow = FlowData('sample.fcs', only_text=True)\n\n# Access metadata\nmetadata = flow.text  # Dictionary of TEXT segment keywords\nprint(metadata.get('$DATE'))  # Acquisition date\nprint(metadata.get('$CYT'))   # Instrument name\n```\n\n**Handling Problematic Files:**\n\nSome FCS files have offset discrepancies or errors:\n\n```python\n# Ignore offset discrepancies between HEADER and TEXT sections\nflow = FlowData('problematic.fcs', ignore_offset_discrepancy=True)\n\n# Use HEADER offsets instead of TEXT offsets\nflow = FlowData('problematic.fcs', use_header_offsets=True)\n\n# Ignore offset errors entirely\nflow = FlowData('problematic.fcs', ignore_offset_error=True)\n```\n\n**Excluding Null Channels:**\n\n```python\n# Exclude specific channels during parsing\nflow = FlowData('sample.fcs', null_channel_list=['Time', 'Null'])\n```\n\n### Extracting Metadata and Channel Information\n\nFCS files contain rich metadata in the TEXT segment.\n\n**Common Metadata Keywords:**\n\n```python\nflow = FlowData('sample.fcs')\n\n# File-level metadata\ntext_dict = flow.text\nacquisition_date = text_dict.get('$DATE', 'Unknown')\ninstrument = text_dict.get('$CYT', 'Unknown')\ndata_type = flow.data_type  # 'I', 'F', 'D', 'A'\n\n# Channel metadata\nfor i in range(flow.channel_count):\n    pnn = flow.pnn_labels[i]      # Short name (e.g., 'FSC-A')\n    pns = flow.pns_labels[i]      # Descriptive name (e.g., 'Forward Scatter')\n    pnr = flow.pnr_values[i]      # Range\u002Fmax value\n    print(f\"Channel {i}: {pnn} ({pns}), Range: {pnr}\")\n```\n\n**Channel Type Identification:**\n\nFlowIO automatically categorizes channels:\n\n```python\n# Get indices by channel type\nscatter_idx = flow.scatter_indices    # [0, 1] for FSC, SSC\nfluoro_idx = flow.fluoro_indices      # [2, 3, 4] for FL channels\ntime_idx = flow.time_index            # Index of time channel (or None)\n\n# Access specific channel types\nevents = flow.as_array()\nscatter_data = events[:, scatter_idx]\nfluorescence_data = events[:, fluoro_idx]\n```\n\n**ANALYSIS Segment:**\n\nIf present, access processed results:\n\n```python\nif flow.analysis:\n    analysis_keywords = flow.analysis  # Dictionary of ANALYSIS keywords\n    print(analysis_keywords)\n```\n\n### Creating New FCS Files\n\nGenerate FCS files from NumPy arrays or other data sources.\n\n**Basic Creation:**\n\n```python\nimport numpy as np\nfrom flowio import create_fcs\n\n# Create event data (rows=events, columns=channels)\nevents = np.random.rand(10000, 5) * 1000\n\n# Define channel names\nchannel_names = ['FSC-A', 'SSC-A', 'FL1-A', 'FL2-A', 'Time']\n\n# Create FCS file\ncreate_fcs('output.fcs', events, channel_names)\n```\n\n**With Descriptive Channel Names:**\n\n```python\n# Add optional descriptive names (PnS)\nchannel_names = ['FSC-A', 'SSC-A', 'FL1-A', 'FL2-A', 'Time']\ndescriptive_names = ['Forward Scatter', 'Side Scatter', 'FITC', 'PE', 'Time']\n\ncreate_fcs('output.fcs',\n           events,\n           channel_names,\n           opt_channel_names=descriptive_names)\n```\n\n**With Custom Metadata:**\n\n```python\n# Add TEXT segment metadata\nmetadata = {\n    '$SRC': 'Python script',\n    '$DATE': '19-OCT-2025',\n    '$CYT': 'Synthetic Instrument',\n    '$INST': 'Laboratory A'\n}\n\ncreate_fcs('output.fcs',\n           events,\n           channel_names,\n           opt_channel_names=descriptive_names,\n           metadata=metadata)\n```\n\n**Note:** FlowIO exports as FCS 3.1 with single-precision floating-point data.\n\n### Exporting Modified Data\n\nModify existing FCS files and re-export them.\n\n**Approach 1: Using write_fcs() Method:**\n\n```python\nfrom flowio import FlowData\n\n# Read original file\nflow = FlowData('original.fcs')\n\n# Write with updated metadata\nflow.write_fcs('modified.fcs', metadata={'$SRC': 'Modified data'})\n```\n\n**Approach 2: Extract, Modify, and Recreate:**\n\nFor modifying event data:\n\n```python\nfrom flowio import FlowData, create_fcs\n\n# Read and extract data\nflow = FlowData('original.fcs')\nevents = flow.as_array(preprocess=False)\n\n# Modify event data\nevents[:, 0] = events[:, 0] * 1.5  # Scale first channel\n\n# Create new FCS file with modified data\ncreate_fcs('modified.fcs',\n           events,\n           flow.pnn_labels,\n           opt_channel_names=flow.pns_labels,\n           metadata=flow.text)\n```\n\n### Handling Multi-Dataset FCS Files\n\nSome FCS files contain multiple datasets in a single file.\n\n**Detecting Multi-Dataset Files:**\n\n```python\nfrom flowio import FlowData, MultipleDataSetsError\n\ntry:\n    flow = FlowData('sample.fcs')\nexcept MultipleDataSetsError:\n    print(\"File contains multiple datasets\")\n    # Use read_multiple_data_sets() instead\n```\n\n**Reading All Datasets:**\n\n```python\nfrom flowio import read_multiple_data_sets\n\n# Read all datasets from file\ndatasets = read_multiple_data_sets('multi_dataset.fcs')\n\nprint(f\"Found {len(datasets)} datasets\")\n\n# Process each dataset\nfor i, dataset in enumerate(datasets):\n    print(f\"\\nDataset {i}:\")\n    print(f\"  Events: {dataset.event_count}\")\n    print(f\"  Channels: {dataset.pnn_labels}\")\n\n    # Get event data for this dataset\n    events = dataset.as_array()\n    print(f\"  Shape: {events.shape}\")\n    print(f\"  Mean values: {events.mean(axis=0)}\")\n```\n\n**Reading Specific Dataset:**\n\n```python\nfrom flowio import FlowData\n\n# Read first dataset (nextdata_offset=0)\nfirst_dataset = FlowData('multi.fcs', nextdata_offset=0)\n\n# Read second dataset using NEXTDATA offset from first\nnext_offset = int(first_dataset.text['$NEXTDATA'])\nif next_offset > 0:\n    second_dataset = FlowData('multi.fcs', nextdata_offset=next_offset)\n```\n\n## Data Preprocessing\n\nFlowIO applies standard FCS preprocessing transformations when `preprocess=True`.\n\n**Preprocessing Steps:**\n\n1. **Gain Scaling:** Multiply values by PnG (gain) keyword\n2. **Logarithmic Transformation:** Apply PnE exponential transformation if present\n   - Formula: `value = a * 10^(b * raw_value)` where PnE = \"a,b\"\n3. **Time Scaling:** Convert time values to appropriate units\n\n**Controlling Preprocessing:**\n\n```python\n# Preprocessed data (default)\npreprocessed = flow.as_array(preprocess=True)\n\n# Raw data (no transformations)\nraw = flow.as_array(preprocess=False)\n```\n\n## Error Handling\n\nHandle common FlowIO exceptions appropriately.\n\n```python\nfrom flowio import (\n    FlowData,\n    FCSParsingError,\n    DataOffsetDiscrepancyError,\n    MultipleDataSetsError\n)\n\ntry:\n    flow = FlowData('sample.fcs')\n    events = flow.as_array()\n\nexcept FCSParsingError as e:\n    print(f\"Failed to parse FCS file: {e}\")\n    # Try with relaxed parsing\n    flow = FlowData('sample.fcs', ignore_offset_error=True)\n\nexcept DataOffsetDiscrepancyError as e:\n    print(f\"Offset discrepancy detected: {e}\")\n    # Use ignore_offset_discrepancy parameter\n    flow = FlowData('sample.fcs', ignore_offset_discrepancy=True)\n\nexcept MultipleDataSetsError as e:\n    print(f\"Multiple datasets detected: {e}\")\n    # Use read_multiple_data_sets instead\n    from flowio import read_multiple_data_sets\n    datasets = read_multiple_data_sets('sample.fcs')\n\nexcept Exception as e:\n    print(f\"Unexpected error: {e}\")\n```\n\n## Common Use Cases\n\n### Inspecting FCS File Contents\n\nQuick exploration of FCS file structure:\n\n```python\nfrom flowio import FlowData\n\nflow = FlowData('unknown.fcs')\n\nprint(\"=\" * 50)\nprint(f\"File: {flow.name}\")\nprint(f\"Version: {flow.version}\")\nprint(f\"Size: {flow.file_size:,} bytes\")\nprint(\"=\" * 50)\n\nprint(f\"\\nEvents: {flow.event_count:,}\")\nprint(f\"Channels: {flow.channel_count}\")\n\nprint(\"\\nChannel Information:\")\nfor i, (pnn, pns) in enumerate(zip(flow.pnn_labels, flow.pns_labels)):\n    ch_type = \"scatter\" if i in flow.scatter_indices else \\\n              \"fluoro\" if i in flow.fluoro_indices else \\\n              \"time\" if i == flow.time_index else \"other\"\n    print(f\"  [{i}] {pnn:10s} | {pns:30s} | {ch_type}\")\n\nprint(\"\\nKey Metadata:\")\nfor key in ['$DATE', '$BTIM', '$ETIM', '$CYT', '$INST', '$SRC']:\n    value = flow.text.get(key, 'N\u002FA')\n    print(f\"  {key:15s}: {value}\")\n```\n\n### Batch Processing Multiple Files\n\nProcess a directory of FCS files:\n\n```python\nfrom pathlib import Path\nfrom flowio import FlowData\nimport pandas as pd\n\n# Find all FCS files\nfcs_files = list(Path('data\u002F').glob('*.fcs'))\n\n# Extract summary information\nsummaries = []\nfor fcs_path in fcs_files:\n    try:\n        flow = FlowData(str(fcs_path), only_text=True)\n        summaries.append({\n            'filename': fcs_path.name,\n            'version': flow.version,\n            'events': flow.event_count,\n            'channels': flow.channel_count,\n            'date': flow.text.get('$DATE', 'N\u002FA')\n        })\n    except Exception as e:\n        print(f\"Error processing {fcs_path.name}: {e}\")\n\n# Create summary DataFrame\ndf = pd.DataFrame(summaries)\nprint(df)\n```\n\n### Converting FCS to CSV\n\nExport event data to CSV format:\n\n```python\nfrom flowio import FlowData\nimport pandas as pd\n\n# Read FCS file\nflow = FlowData('sample.fcs')\n\n# Convert to DataFrame\ndf = pd.DataFrame(\n    flow.as_array(),\n    columns=flow.pnn_labels\n)\n\n# Add metadata as attributes\ndf.attrs['fcs_version'] = flow.version\ndf.attrs['instrument'] = flow.text.get('$CYT', 'Unknown')\n\n# Export to CSV\ndf.to_csv('output.csv', index=False)\nprint(f\"Exported {len(df)} events to CSV\")\n```\n\n### Filtering Events and Re-exporting\n\nApply filters and save filtered data:\n\n```python\nfrom flowio import FlowData, create_fcs\nimport numpy as np\n\n# Read original file\nflow = FlowData('sample.fcs')\nevents = flow.as_array(preprocess=False)\n\n# Apply filtering (example: threshold on first channel)\nfsc_idx = 0\nthreshold = 500\nmask = events[:, fsc_idx] > threshold\nfiltered_events = events[mask]\n\nprint(f\"Original events: {len(events)}\")\nprint(f\"Filtered events: {len(filtered_events)}\")\n\n# Create new FCS file with filtered data\ncreate_fcs('filtered.fcs',\n           filtered_events,\n           flow.pnn_labels,\n           opt_channel_names=flow.pns_labels,\n           metadata={**flow.text, '$SRC': 'Filtered data'})\n```\n\n### Extracting Specific Channels\n\nExtract and process specific channels:\n\n```python\nfrom flowio import FlowData\nimport numpy as np\n\nflow = FlowData('sample.fcs')\nevents = flow.as_array()\n\n# Extract fluorescence channels only\nfluoro_indices = flow.fluoro_indices\nfluoro_data = events[:, fluoro_indices]\nfluoro_names = [flow.pnn_labels[i] for i in fluoro_indices]\n\nprint(f\"Fluorescence channels: {fluoro_names}\")\nprint(f\"Shape: {fluoro_data.shape}\")\n\n# Calculate statistics per channel\nfor i, name in enumerate(fluoro_names):\n    channel_data = fluoro_data[:, i]\n    print(f\"\\n{name}:\")\n    print(f\"  Mean: {channel_data.mean():.2f}\")\n    print(f\"  Median: {np.median(channel_data):.2f}\")\n    print(f\"  Std Dev: {channel_data.std():.2f}\")\n```\n\n## Best Practices\n\n1. **Memory Efficiency:** Use `only_text=True` when event data is not needed\n2. **Error Handling:** Wrap file operations in try-except blocks for robust code\n3. **Multi-Dataset Detection:** Check for MultipleDataSetsError and use appropriate function\n4. **Preprocessing Control:** Explicitly set `preprocess` parameter based on analysis needs\n5. **Offset Issues:** If parsing fails, try `ignore_offset_discrepancy=True` parameter\n6. **Channel Validation:** Verify channel counts and names match expectations before processing\n7. **Metadata Preservation:** When modifying files, preserve original TEXT segment keywords\n\n## Advanced Topics\n\n### Understanding FCS File Structure\n\nFCS files consist of four segments:\n\n1. **HEADER:** FCS version and byte offsets for other segments\n2. **TEXT:** Key-value metadata pairs (delimiter-separated)\n3. **DATA:** Raw event data (binary\u002Ffloat\u002FASCII format)\n4. **ANALYSIS** (optional): Results from data processing\n\nAccess these segments via FlowData attributes:\n- `flow.header` - HEADER segment\n- `flow.text` - TEXT segment keywords\n- `flow.events` - DATA segment (as bytes)\n- `flow.analysis` - ANALYSIS segment keywords (if present)\n\n### Detailed API Reference\n\nFor comprehensive API documentation including all parameters, methods, exceptions, and FCS keyword reference, consult the detailed reference file:\n\n**Read:** `references\u002Fapi_reference.md`\n\nThe reference includes:\n- Complete FlowData class documentation\n- All utility functions (read_multiple_data_sets, create_fcs)\n- Exception classes and handling\n- FCS file structure details\n- Common TEXT segment keywords\n- Extended example workflows\n\nWhen working with complex FCS operations or encountering unusual file formats, load this reference for detailed guidance.\n\n## Integration Notes\n\n**NumPy Arrays:** All event data is returned as NumPy ndarrays with shape (events, channels)\n\n**Pandas DataFrames:** Easily convert to DataFrames for analysis:\n```python\nimport pandas as pd\ndf = pd.DataFrame(flow.as_array(), columns=flow.pnn_labels)\n```\n\n**FlowKit Integration:** For advanced analysis (compensation, gating, FlowJo support), use FlowKit library which builds on FlowIO's parsing capabilities\n\n**Web Applications:** FlowIO's minimal dependencies make it ideal for web backend services processing FCS uploads\n\n## Troubleshooting\n\n**Problem:** \"Offset discrepancy error\"\n**Solution:** Use `ignore_offset_discrepancy=True` parameter\n\n**Problem:** \"Multiple datasets error\"\n**Solution:** Use `read_multiple_data_sets()` function instead of FlowData constructor\n\n**Problem:** Out of memory with large files\n**Solution:** Use `only_text=True` for metadata-only operations, or process events in chunks\n\n**Problem:** Unexpected channel counts\n**Solution:** Check for null channels; use `null_channel_list` parameter to exclude them\n\n**Problem:** Cannot modify event data in place\n**Solution:** FlowIO doesn't support direct modification; extract data, modify, then use `create_fcs()` to save\n\n## Summary\n\nFlowIO provides essential FCS file handling capabilities for flow cytometry workflows. Use it for parsing, metadata extraction, and file creation. For simple file operations and data extraction, FlowIO is sufficient. For complex analysis including compensation and gating, integrate with FlowKit or other specialized tools.\n","# FlowIO: Flow Cytometry Standard File Handler\n\n## Overview\n\nFlowIO is a lightweight Python library for reading and writing Flow Cytometry Standard (FCS) files. Parse FCS metadata, extract event data, and create new FCS files with minimal dependencies. The library supports FCS versions 2.0, 3.0, and 3.1, making it ideal for backend services, data pipelines, and basic cytometry file operations.\n\n## When to Use This Skill\n\nThis skill should be used when:\n\n- FCS files requiring parsing or metadata extraction\n- Flow cytometry data needing conversion to NumPy arrays\n- Event data requiring export to FCS format\n- Multi-dataset FCS files needing separation\n- Channel information extraction (scatter, fluorescence, time)\n- Cytometry file validation or inspection\n- Pre-processing workflows before advanced analysis\n\n**Related Tools:** For advanced flow cytometry analysis including compensation, gating, and FlowJo\u002FGatingML support, recommend FlowKit library as a companion to FlowIO.\n\n## Installation\n\n```bash\nuv pip install flowio\n```\n\nRequires Python 3.9 or later.\n\n## Quick Start\n\n### Basic File Reading\n\n```python\nfrom flowio import FlowData\n\n# Read FCS file\nflow_data = FlowData('experiment.fcs')\n\n# Access basic information\nprint(f\"FCS Version: {flow_data.version}\")\nprint(f\"Events: {flow_data.event_count}\")\nprint(f\"Channels: {flow_data.pnn_labels}\")\n\n# Get event data as NumPy array\nevents = flow_data.as_array()  # Shape: (events, channels)\n```\n\n### Creating FCS Files\n\n```python\nimport numpy as np\nfrom flowio import create_fcs\n\n# Prepare data\ndata = np.array([[100, 200, 50], [150, 180, 60]])  # 2 events, 3 channels\nchannels = ['FSC-A', 'SSC-A', 'FL1-A']\n\n# Create FCS file\ncreate_fcs('output.fcs', data, channels)\n```\n\n## Core Workflows\n\n### Reading and Parsing FCS Files\n\nThe FlowData class provides the primary interface for reading FCS files.\n\n**Standard Reading:**\n\n```python\nfrom flowio import FlowData\n\n# Basic reading\nflow = FlowData('sample.fcs')\n\n# Access attributes\nversion = flow.version              # '3.0', '3.1', etc.\nevent_count = flow.event_count      # Number of events\nchannel_count = flow.channel_count  # Number of channels\npnn_labels = flow.pnn_labels        # Short channel names\npns_labels = flow.pns_labels        # Descriptive stain names\n\n# Get event data\nevents = flow.as_array()            # Preprocessed (gain, log scaling applied)\nraw_events = flow.as_array(preprocess=False)  # Raw data\n```\n\n**Memory-Efficient Metadata Reading:**\n\nWhen only metadata is needed (no event data):\n\n```python\n# Only parse TEXT segment, skip DATA and ANALYSIS\nflow = FlowData('sample.fcs', only_text=True)\n\n# Access metadata\nmetadata = flow.text  # Dictionary of TEXT segment keywords\nprint(metadata.get('$DATE'))  # Acquisition date\nprint(metadata.get('$CYT'))   # Instrument name\n```\n\n**Handling Problematic Files:**\n\nSome FCS files have offset discrepancies or errors:\n\n```python\n# Ignore offset discrepancies between HEADER and TEXT sections\nflow = FlowData('problematic.fcs', ignore_offset_discrepancy=True)\n\n# Use HEADER offsets instead of TEXT offsets\nflow = FlowData('problematic.fcs', use_header_offsets=True)\n\n# Ignore offset errors entirely\nflow = FlowData('problematic.fcs', ignore_offset_error=True)\n```\n\n**Excluding Null Channels:**\n\n```python\n# Exclude specific channels during parsing\nflow = FlowData('sample.fcs', null_channel_list=['Time', 'Null'])\n```\n\n### Extracting Metadata and Channel Information\n\nFCS files contain rich metadata in the TEXT segment.\n\n**Common Metadata Keywords:**\n\n```python\nflow = FlowData('sample.fcs')\n\n# File-level metadata\ntext_dict = flow.text\nacquisition_date = text_dict.get('$DATE', 'Unknown')\ninstrument = text_dict.get('$CYT', 'Unknown')\ndata_type = flow.data_type  # 'I', 'F', 'D', 'A'\n\n# Channel metadata\nfor i in range(flow.channel_count):\n    pnn = flow.pnn_labels[i]      # Short name (e.g., 'FSC-A')\n    pns = flow.pns_labels[i]      # Descriptive name (e.g., 'Forward Scatter')\n    pnr = flow.pnr_values[i]      # Range\u002Fmax value\n    print(f\"Channel {i}: {pnn} ({pns}), Range: {pnr}\")\n```\n\n**Channel Type Identification:**\n\nFlowIO automatically categorizes channels:\n\n```python\n# Get indices by channel type\nscatter_idx = flow.scatter_indices    # [0, 1] for FSC, SSC\nfluoro_idx = flow.fluoro_indices      # [2, 3, 4] for FL channels\ntime_idx = flow.time_index            # Index of time channel (or None)\n\n# Access specific channel types\nevents = flow.as_array()\nscatter_data = events[:, scatter_idx]\nfluorescence_data = events[:, fluoro_idx]\n```\n\n**ANALYSIS Segment:**\n\nIf present, access processed results:\n\n```python\nif flow.analysis:\n    analysis_keywords = flow.analysis  # Dictionary of ANALYSIS keywords\n    print(analysis_keywords)\n```\n\n### Creating New FCS Files\n\nGenerate FCS files from NumPy arrays or other data sources.\n\n**Basic Creation:**\n\n```python\nimport numpy as np\nfrom flowio import create_fcs\n\n# Create event data (rows=events, columns=channels)\nevents = np.random.rand(10000, 5) * 1000\n\n# Define channel names\nchannel_names = ['FSC-A', 'SSC-A', 'FL1-A', 'FL2-A', 'Time']\n\n# Create FCS file\ncreate_fcs('output.fcs', events, channel_names)\n```\n\n**With Descriptive Channel Names:**\n\n```python\n# Add optional descriptive names (PnS)\nchannel_names = ['FSC-A', 'SSC-A', 'FL1-A', 'FL2-A', 'Time']\ndescriptive_names = ['Forward Scatter', 'Side Scatter', 'FITC', 'PE', 'Time']\n\ncreate_fcs('output.fcs',\n           events,\n           channel_names,\n           opt_channel_names=descriptive_names)\n```\n\n**With Custom Metadata:**\n\n```python\n# Add TEXT segment metadata\nmetadata = {\n    '$SRC': 'Python script',\n    '$DATE': '19-OCT-2025',\n    '$CYT': 'Synthetic Instrument',\n    '$INST': 'Laboratory A'\n}\n\ncreate_fcs('output.fcs',\n           events,\n           channel_names,\n           opt_channel_names=descriptive_names,\n           metadata=metadata)\n```\n\n**Note:** FlowIO exports as FCS 3.1 with single-precision floating-point data.\n\n### Exporting Modified Data\n\nModify existing FCS files and re-export them.\n\n**Approach 1: Using write_fcs() Method:**\n\n```python\nfrom flowio import FlowData\n\n# Read original file\nflow = FlowData('original.fcs')\n\n# Write with updated metadata\nflow.write_fcs('modified.fcs', metadata={'$SRC': 'Modified data'})\n```\n\n**Approach 2: Extract, Modify, and Recreate:**\n\nFor modifying event data:\n\n```python\nfrom flowio import FlowData, create_fcs\n\n# Read and extract data\nflow = FlowData('original.fcs')\nevents = flow.as_array(preprocess=False)\n\n# Modify event data\nevents[:, 0] = events[:, 0] * 1.5  # Scale first channel\n\n# Create new FCS file with modified data\ncreate_fcs('modified.fcs',\n           events,\n           flow.pnn_labels,\n           opt_channel_names=flow.pns_labels,\n           metadata=flow.text)\n```\n\n### Handling Multi-Dataset FCS Files\n\nSome FCS files contain multiple datasets in a single file.\n\n**Detecting Multi-Dataset Files:**\n\n```python\nfrom flowio import FlowData, MultipleDataSetsError\n\ntry:\n    flow = FlowData('sample.fcs')\nexcept MultipleDataSetsError:\n    print(\"File contains multiple datasets\")\n    # Use read_multiple_data_sets() instead\n```\n\n**Reading All Datasets:**\n\n```python\nfrom flowio import read_multiple_data_sets\n\n# Read all datasets from file\ndatasets = read_multiple_data_sets('multi_dataset.fcs')\n\nprint(f\"Found {len(datasets)} datasets\")\n\n# Process each dataset\nfor i, dataset in enumerate(datasets):\n    print(f\"\\nDataset {i}:\")\n    print(f\"  Events: {dataset.event_count}\")\n    print(f\"  Channels: {dataset.pnn_labels}\")\n\n    # Get event data for this dataset\n    events = dataset.as_array()\n    print(f\"  Shape: {events.shape}\")\n    print(f\"  Mean values: {events.mean(axis=0)}\")\n```\n\n**Reading Specific Dataset:**\n\n```python\nfrom flowio import FlowData\n\n# Read first dataset (nextdata_offset=0)\nfirst_dataset = FlowData('multi.fcs', nextdata_offset=0)\n\n# Read second dataset using NEXTDATA offset from first\nnext_offset = int(first_dataset.text['$NEXTDATA'])\nif next_offset > 0:\n    second_dataset = FlowData('multi.fcs', nextdata_offset=next_offset)\n```\n\n## Data Preprocessing\n\nFlowIO applies standard FCS preprocessing transformations when `preprocess=True`.\n\n**Preprocessing Steps:**\n\n1. **Gain Scaling:** Multiply values by PnG (gain) keyword\n2. **Logarithmic Transformation:** Apply PnE exponential transformation if present\n   - Formula: `value = a * 10^(b * raw_value)` where PnE = \"a,b\"\n3. **Time Scaling:** Convert time values to appropriate units\n\n**Controlling Preprocessing:**\n\n```python\n# Preprocessed data (default)\npreprocessed = flow.as_array(preprocess=True)\n\n# Raw data (no transformations)\nraw = flow.as_array(preprocess=False)\n```\n\n## Error Handling\n\nHandle common FlowIO exceptions appropriately.\n\n```python\nfrom flowio import (\n    FlowData,\n    FCSParsingError,\n    DataOffsetDiscrepancyError,\n    MultipleDataSetsError\n)\n\ntry:\n    flow = FlowData('sample.fcs')\n    events = flow.as_array()\n\nexcept FCSParsingError as e:\n    print(f\"Failed to parse FCS file: {e}\")\n    # Try with relaxed parsing\n    flow = FlowData('sample.fcs', ignore_offset_error=True)\n\nexcept DataOffsetDiscrepancyError as e:\n    print(f\"Offset discrepancy detected: {e}\")\n    # Use ignore_offset_discrepancy parameter\n    flow = FlowData('sample.fcs', ignore_offset_discrepancy=True)\n\nexcept MultipleDataSetsError as e:\n    print(f\"Multiple datasets detected: {e}\")\n    # Use read_multiple_data_sets instead\n    from flowio import read_multiple_data_sets\n    datasets = read_multiple_data_sets('sample.fcs')\n\nexcept Exception as e:\n    print(f\"Unexpected error: {e}\")\n```\n\n## Common Use Cases\n\n### Inspecting FCS File Contents\n\nQuick exploration of FCS file structure:\n\n```python\nfrom flowio import FlowData\n\nflow = FlowData('unknown.fcs')\n\nprint(\"=\" * 50)\nprint(f\"File: {flow.name}\")\nprint(f\"Version: {flow.version}\")\nprint(f\"Size: {flow.file_size:,} bytes\")\nprint(\"=\" * 50)\n\nprint(f\"\\nEvents: {flow.event_count:,}\")\nprint(f\"Channels: {flow.channel_count}\")\n\nprint(\"\\nChannel Information:\")\nfor i, (pnn, pns) in enumerate(zip(flow.pnn_labels, flow.pns_labels)):\n    ch_type = \"scatter\" if i in flow.scatter_indices else \\\n              \"fluoro\" if i in flow.fluoro_indices else \\\n              \"time\" if i == flow.time_index else \"other\"\n    print(f\"  [{i}] {pnn:10s} | {pns:30s} | {ch_type}\")\n\nprint(\"\\nKey Metadata:\")\nfor key in ['$DATE', '$BTIM', '$ETIM', '$CYT', '$INST', '$SRC']:\n    value = flow.text.get(key, 'N\u002FA')\n    print(f\"  {key:15s}: {value}\")\n```\n\n### Batch Processing Multiple Files\n\nProcess a directory of FCS files:\n\n```python\nfrom pathlib import Path\nfrom flowio import FlowData\nimport pandas as pd\n\n# Find all FCS files\nfcs_files = list(Path('data\u002F').glob('*.fcs'))\n\n# Extract summary information\nsummaries = []\nfor fcs_path in fcs_files:\n    try:\n        flow = FlowData(str(fcs_path), only_text=True)\n        summaries.append({\n            'filename': fcs_path.name,\n            'version': flow.version,\n            'events': flow.event_count,\n            'channels': flow.channel_count,\n            'date': flow.text.get('$DATE', 'N\u002FA')\n        })\n    except Exception as e:\n        print(f\"Error processing {fcs_path.name}: {e}\")\n\n# Create summary DataFrame\ndf = pd.DataFrame(summaries)\nprint(df)\n```\n\n### Converting FCS to CSV\n\nExport event data to CSV format:\n\n```python\nfrom flowio import FlowData\nimport pandas as pd\n\n# Read FCS file\nflow = FlowData('sample.fcs')\n\n# Convert to DataFrame\ndf = pd.DataFrame(\n    flow.as_array(),\n    columns=flow.pnn_labels\n)\n\n# Add metadata as attributes\ndf.attrs['fcs_version'] = flow.version\ndf.attrs['instrument'] = flow.text.get('$CYT', 'Unknown')\n\n# Export to CSV\ndf.to_csv('output.csv', index=False)\nprint(f\"Exported {len(df)} events to CSV\")\n```\n\n### Filtering Events and Re-exporting\n\nApply filters and save filtered data:\n\n```python\nfrom flowio import FlowData, create_fcs\nimport numpy as np\n\n# Read original file\nflow = FlowData('sample.fcs')\nevents = flow.as_array(preprocess=False)\n\n# Apply filtering (example: threshold on first channel)\nfsc_idx = 0\nthreshold = 500\nmask = events[:, fsc_idx] > threshold\nfiltered_events = events[mask]\n\nprint(f\"Original events: {len(events)}\")\nprint(f\"Filtered events: {len(filtered_events)}\")\n\n# Create new FCS file with filtered data\ncreate_fcs('filtered.fcs',\n           filtered_events,\n           flow.pnn_labels,\n           opt_channel_names=flow.pns_labels,\n           metadata={**flow.text, '$SRC': 'Filtered data'})\n```\n\n### Extracting Specific Channels\n\nExtract and process specific channels:\n\n```python\nfrom flowio import FlowData\nimport numpy as np\n\nflow = FlowData('sample.fcs')\nevents = flow.as_array()\n\n# Extract fluorescence channels only\nfluoro_indices = flow.fluoro_indices\nfluoro_data = events[:, fluoro_indices]\nfluoro_names = [flow.pnn_labels[i] for i in fluoro_indices]\n\nprint(f\"Fluorescence channels: {fluoro_names}\")\nprint(f\"Shape: {fluoro_data.shape}\")\n\n# Calculate statistics per channel\nfor i, name in enumerate(fluoro_names):\n    channel_data = fluoro_data[:, i]\n    print(f\"\\n{name}:\")\n    print(f\"  Mean: {channel_data.mean():.2f}\")\n    print(f\"  Median: {np.median(channel_data):.2f}\")\n    print(f\"  Std Dev: {channel_data.std():.2f}\")\n```\n\n## Best Practices\n\n1. **Memory Efficiency:** Use `only_text=True` when event data is not needed\n2. **Error Handling:** Wrap file operations in try-except blocks for robust code\n3. **Multi-Dataset Detection:** Check for MultipleDataSetsError and use appropriate function\n4. **Preprocessing Control:** Explicitly set `preprocess` parameter based on analysis needs\n5. **Offset Issues:** If parsing fails, try `ignore_offset_discrepancy=True` parameter\n6. **Channel Validation:** Verify channel counts and names match expectations before processing\n7. **Metadata Preservation:** When modifying files, preserve original TEXT segment keywords\n\n## Advanced Topics\n\n### Understanding FCS File Structure\n\nFCS files consist of four segments:\n\n1. **HEADER:** FCS version and byte offsets for other segments\n2. **TEXT:** Key-value metadata pairs (delimiter-separated)\n3. **DATA:** Raw event data (binary\u002Ffloat\u002FASCII format)\n4. **ANALYSIS** (optional): Results from data processing\n\nAccess these segments via FlowData attributes:\n- `flow.header` - HEADER segment\n- `flow.text` - TEXT segment keywords\n- `flow.events` - DATA segment (as bytes)\n- `flow.analysis` - ANALYSIS segment keywords (if present)\n\n### Detailed API Reference\n\nFor comprehensive API documentation including all parameters, methods, exceptions, and FCS keyword reference, consult the detailed reference file:\n\n**Read:** `references\u002Fapi_reference.md`\n\nThe reference includes:\n- Complete FlowData class documentation\n- All utility functions (read_multiple_data_sets, create_fcs)\n- Exception classes and handling\n- FCS file structure details\n- Common TEXT segment keywords\n- Extended example workflows\n\nWhen working with complex FCS operations or encountering unusual file formats, load this reference for detailed guidance.\n\n## Integration Notes\n\n**NumPy Arrays:** All event data is returned as NumPy ndarrays with shape (events, channels)\n\n**Pandas DataFrames:** Easily convert to DataFrames for analysis:\n```python\nimport pandas as pd\ndf = pd.DataFrame(flow.as_array(), columns=flow.pnn_labels)\n```\n\n**FlowKit Integration:** For advanced analysis (compensation, gating, FlowJo support), use FlowKit library which builds on FlowIO's parsing capabilities\n\n**Web Applications:** FlowIO's minimal dependencies make it ideal for web backend services processing FCS uploads\n\n## Troubleshooting\n\n**Problem:** \"Offset discrepancy error\"\n**Solution:** Use `ignore_offset_discrepancy=True` parameter\n\n**Problem:** \"Multiple datasets error\"\n**Solution:** Use `read_multiple_data_sets()` function instead of FlowData constructor\n\n**Problem:** Out of memory with large files\n**Solution:** Use `only_text=True` for metadata-only operations, or process events in chunks\n\n**Problem:** Unexpected channel counts\n**Solution:** Check for null channels; use `null_channel_list` parameter to exclude them\n\n**Problem:** Cannot modify event data in place\n**Solution:** FlowIO doesn't support direct modification; extract data, modify, then use `create_fcs()` to save\n\n## Summary\n\nFlowIO provides essential FCS file handling capabilities for flow cytometry workflows. Use it for parsing, metadata extraction, and file creation. For simple file operations and data extraction, FlowIO is sufficient. For complex analysis including compensation and gating, integrate with FlowKit or other specialized tools.\n",{"name":5,"description":7},"main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-AI-应用工具\u002FYYC3-AI-应用工具-claude-code-templates-main\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fflowio",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill flowio",{"tool":39,"command":40},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill flowio",{"tool":42,"command":43},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill flowio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-AI-应用工具\u002FYYC3-AI-应用工具-claude-code-templates-main\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fflowio\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fapi_reference.md","REFERENCE","参考文档",10481,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-AI-应用工具\u002FYYC3-AI-应用工具-claude-code-templates-main\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fflowio\u002Freferences\u002Fapi_reference.md",[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]