Skill: spacesq/s2-spatial-primitive (version 1.0.0)

# 🧱 S2-Spatial-Primitive: The 6-Element Data Model Definer # 空间基元六要素数据模型定义仪 *v1.0.0 | Bilingual Edition (English / 中文)* Welcome to the foundation of the **S2-Spatial-Primitive OS**. This SKILL does not control physical hardware directly; instead, it establishes the **Universal Data Model (全网统一数据模型)** for the next generation of AI-driven smart spaces. 欢迎来到 S2 空间基元操作系统的最底层。本技能不直接控制物理硬件，而是为下一代 AI 驱动的智慧空间建立**全网统一的数据模型库**。 --- ### 📐 The Paradigm Shift: From Apps to Agents Traditional smart homes require humans to press buttons on apps. The S2 ecosystem believes that **AI Agents are the indigenous operators of space**, while humans are merely the beneficiaries. 传统的智能家居需要人类在 App 上按按钮。S2 生态认为，**AI 智能体才是空间的原住民与操作者**，人类只是享受者。 Therefore, this SKILL defines a `2m x 2m` physical grid and maps it into a high-dimensional JSON tensor matrix. This matrix is uniquely designed using **Natural Language Parameters (NLP fields)** instead of rigid tables, allowing Large Language Models (LLMs) to instantly read, comprehend, and orchestrate the space. 因此，本技能定义了一个 `2m x 2m` 的物理格子，并将其映射为高维 JSON 张量矩阵。该矩阵独特地采用了**自然语言参数**而非死板的表格，使得大语言模型能够瞬间阅读、理解并调度该空间。 --- ### 🧬 The 6-Element Matrix / 核心六要素定义 #### 1. Light (光) Metrics of lighting effect, not physical bulbs. Includes Illuminance, Color Temperature, RGBW, and **Natural Language Special Effects** (e.g., "Stage rock strobe", "Cinematic dimming"). / 以光效而非灯泡外观为衡量标准。包含光照度、色温、RGBW及自然语言描述的特殊光效（如舞台摇滚频闪、影院场景）。 #### 2. Air & HVAC (空气：温湿度与风力) Focuses on comfort and health. Includes standard HVAC metrics (Temp, Humidity, Wind Level) and integrates the **GB 3095-2012 Air Quality Standard** (PM2.5, PM10, SO2, NO2, CO, O3, CO2). Also includes Hazard Alarms (Gas leaks). / 提供舒适度与健康度。包含温湿度、风力，并集成国家空气质量标准六项污染物及有害气体报警。 #### 3. Sound (声音) Physical and psychological audio rendering. Includes Volume/EQ params, **Noise Management** (Active suppression & White noise playback), BGM scheduling, and Mic monitoring toggles. / 生理与心理的音频渲染。包含基础音量EQ、噪声抑制与白噪声播放、音乐源时间表及监听开关。 #### 4. Electromagnetic (电磁波) Wireless coverage and human sensing. Includes Wi-Fi/5G/Zigbee networking, and spatial perception via **mmWave Radar, Infrared, and Wi-Fi sensing**. / 无线覆盖与人体感应。包含无线上网/局域网组网，以及毫米波、红外、Wi-Fi人体感应。 #### 5. Energy (能源供应与消耗) Quantitative description of spatial energy. Covers supply layout (sockets/switches), live consumption wattage, and self-generation metrics (Solar PV, Geothermal). / 空间能源的定量描述。涵盖室内配电分布、实时功耗及太阳能/地源热泵等自给生产数据。 #### 6. Visual (视觉影像) **⚠️ STRICT PRIVACY BOUNDARY**: Visual refers exclusively to **OUTPUT/DISPLAY** (Screens, Projectors, AR Glasses, BCI) and Video Stream Sources. **IT DOES NOT INCLUDE CAMERA RECORDING.** Spatial awareness is handled entirely by the Electromagnetic element. / **⚠️ 严苛的隐私边界**：视觉仅指代**输出与显示**（屏幕、投影、智能眼镜、脑机接口）及视频播放源。**绝不包含摄像头录像采集。**空间感知完全交由电磁波要素负责。 --- ### 🚀 Usage / 使用方法 Run the script to generate the `primitive_6_elements_template.json` in your local directory. Supply this JSON schema to your OpenClaw agents as the baseline context for spatial awareness and control. 运行本脚本，将在本地生成六要素 JSON 模板。将此结构体作为上下文提供给您的智能体，使其获得空间感知与控制的基准模型。

path: skill.py
content: import os
import json
from datetime import datetime

# ==========================================
# ⚙️ System Configuration / 系统配置
# ==========================================
PRIMITIVE_DIR = os.path.join(os.getcwd(), "s2_primitive_data")
TEMPLATE_FILE = os.path.join(PRIMITIVE_DIR, "primitive_6_elements_template.json")

def initialize_os():
    if not os.path.exists(PRIMITIVE_DIR):
        os.makedirs(PRIMITIVE_DIR)

def generate_primitive_template():
    """
    🧱 生成标准 2m*2m 空间基元六要素数据模型 (LLM-Native JSON)
    混合精确数值与自然语言描述，专为 AI 智能体阅读设计。
    """
    template = {
        "_meta": {
            "schema_version": "1.0",
            "spatial_unit": "2m x 2m x 2.4m (Standard Spatial Primitive / 标准空间基元)",
            "privacy_declaration": "STRICT COMPLIANCE: Visual elements are strictly for OUTPUT display. Spatial perception relies on Electromagnetic waves (mmWave/IR/WiFi). NO CAMERA RECORDING IS PERMITTED IN THIS PRIMITIVE. / 严格合规：视觉要素仅限输出显示，空间感知依赖电磁波，本基元底层绝不包含任何摄像头录像采集。"
        },
        "spatial_coordinates": {
            "primitive_id": "SP-001",
            "grid_x": 0,
            "grid_y": 0,
            "grid_z": 0,
            "occupancy_status": "Natural Language: Empty, 1 person free, 2 people semi-free, or 4 people emergency sheltering. / 自然语言描述空间占用状态"
        },
        "element_1_light": {
            "illuminance_lux": 0.0,
            "color_temperature_k": 4000,
            "color_rgbw": [255, 255, 255, 0],
            "special_effects_nlp": "Natural Language description of effects. e.g., 'Beam angle 45 degrees, slow breathing mode, or stage rock strobe.' / 光效的自然语言描述（光束角、闪烁、摇动、影院/游戏场景光）"
        },
        "element_2_air_hvac": {
            "comfort_metrics": {
                "temperature_celsius": 24.5,
                "humidity_percent": 50.0,
                "wind_level_nlp": "Natural Language: e.g., 'Level 2 soft breeze from central AC.' / 自然语言描述风力等级与来源"
            },
            "air_quality_gb3095_2012": {
                "pm25_ug_m3": 0.0,
                "pm10_ug_m3": 0.0,
                "so2_ug_m3": 0.0,
                "no2_ug_m3": 0.0,
                "co_mg_m3": 0.0,
                "o3_ug_m3": 0.0,
                "co2_ppm": 400.0
            },
            "hazard_alarms": {
                "gas_leak_nlp": "Natural Language: 'Normal' or 'ALARM: Natural gas leak detected!' / 燃气泄露等有害气体监测状态"
            }
        },
        "element_3_sound": {
            "acoustic_params": {
                "volume_db": 0.0,
                "treble_level": 0,
                "bass_level": 0,
                "subwoofer_level": 0
            },
            "noise_management": {
                "suppression_mode_nlp": "Natural Language: e.g., 'Active noise cancellation enabled' / 噪声抑制功能设置",
                "white_noise_nlp": "Natural Language: e.g., 'Playing rain sounds at 40dB, 432Hz' / 白噪声播放源及关联参数"
            },
            "music_schedule": {
                "bgm_source_nlp": "Natural Language: e.g., 'Spotify Jazz Playlist, scheduled for 7:00 AM daily' / 音乐源名称及时间表"
            },
            "mic_monitoring": {
                "status_nlp": "Natural Language: e.g., 'Mic active for voice commands only, records disabled' / 监听开关与时间安排"
            }
        },
        "element_4_electromagnetic": {
            "network_coverage": {
                "protocols_nlp": "Natural Language: e.g., 'Wi-Fi 6 active, Zigbee mesh ready, 5G standby' / 无线上网与局域网组网设置"
            },
            "spatial_sensing": {
                "sensors_nlp": "Natural Language: e.g., 'mmWave radar detects slight motion at 1.5m, IR clear, Wi-Fi sensing detects 1 adult.' / 毫米波、红外、Wi-Fi人体感应状态描述"
            }
        },
        "element_5_energy": {
            "supply_distribution": {
                "layout_nlp": "Natural Language: e.g., '2 smart sockets active, main switch ON' / 室内配电、插座、开关状态"
            },
            "consumption": {
                "current_power_w": 0.0,
                "total_energy_kwh": 0.0
            },
            "generation": {
                "sources_nlp": "Natural Language: e.g., 'Solar PV generating 500W, Geothermal idle' / 太阳能、地源热泵等自给生产状态"
            }
        },
        "element_6_visual": {
            "display_mediums": {
                "devices_nlp": "Natural Language: e.g., 'Wall-mounted 4K Screen, AR Glasses paired, BCI standby' / 显示屏、投影、智能眼镜、脑机接口等呈现介质"
            },
            "video_stream_source": {
                "content_nlp": "Natural Language: e.g., 'Playing Nature.mp4, Length 120min, Format H.265' / 视频播放源名称、长度、格式的时间序列"
            }
        }
    }
    
    with open(TEMPLATE_FILE, 'w', encoding='utf-8') as f:
        json.dump(template, f, ensure_ascii=False, indent=2)
    return template

def execute_skill():
    initialize_os()
    print("\n" + "═"*90)
    print(" 🧱 S2-SPATIAL-PRIMITIVE : 6-Element Data Model Generator / 空间基元六要素数据模型生成仪")
    print("═"*90)
    
    print("⏳ Compiling the 2m x 2m spatial tensor matrix... / 正在编译 2m x 2m 空间张量矩阵...")
    template = generate_primitive_template()
    
    print("✅ [ SUCCESS ] The universal data model has been generated. / 全网统一的数据模型库已生成。")
    print(f"📂 Location / 存储路径: {TEMPLATE_FILE}\n")
    
    print("💡 [ GEEK PREVIEW / 极客预览 - 核心六要素架构 ]")
    print("  1. ☀️ Light (光): Illuminance, Color Temp, RGBW, NLP Special Effects")
    print("  2. 💨 Air (空气): HVAC metrics, GB3095-2012 Air Quality, Hazard Alarms")
    print("  3. 🎵 Sound (声音): Acoustics, Noise Suppression, White Noise, BGM, Mic Schedule")
    print("  4. 📡 Electromagnetic (电磁波): Wi-Fi/5G Coverage, mmWave/IR Spatial Sensing (NO CAMERAS)")
    print("  5. ⚡ Energy (能源): Supply Layout, Wattage Consumption, PV Generation")
    print("  6. 📺 Visual (视觉): Display Mediums (Screens/BCI), Video Stream Playback Sources\n")
    
    print("🤖 [ AI NATIVE COMPATIBILITY / 智能体原生兼容性 ]")
    print("This JSON uses 'Natural Language Parameters' (NLP fields) instead of rigid boolean tables.")
    print("本 JSON 放弃了死板的布尔表格，大量采用“自然语言参数”，使大模型能够直接阅读并理解复杂的空间语义。")
    
    print("\n" + "═"*90)
    input("👉 Press ENTER to exit / 按回车键退出...")
    return ""

if __name__ == "__main__":
    execute_skill()

path: manifest.json
content: {
  "name": "s2-spatial-primitive",
  "version": "1.0.0",
  "author": "Space2.world",
  "short_description": "Generates the foundational 6-Element Spatial Primitive JSON data model (Light, Air, Sound, EM, Energy, Visual). Strictly text-based AI-native parameters. Explicitly excludes camera recording for privacy.",
  "tags": ["Smart Home", "Data Model", "Spatial Computing", "LLM Native", "Standards"],
  "entry_point": "skill.py",
  "language": "python",
  "homepage": "https://space2.world"
}

Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)