{"id":"ded90148-a743-4d6d-8956-d5ea52bf4ea1","entityType":"agent","slug":"clawhub-jose-compu-self-improving-house","name":"Self Improving Domotics","canonicalUrl":"https://www.xpersona.co/agent/clawhub-jose-compu-self-improving-house","canonicalPath":"/agent/clawhub-jose-compu-self-improving-house","generatedAt":"2026-10-11T14:14:59.399Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T09:51:02.581Z","emptyReason":null},"description":"Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud or local integrations break, (5) Occupancy detection is inconsistent with reality, (6) Latency causes delayed or jittery automations, (7) Energy usage patterns are inefficient, (8) Safety automations need stronger guardrails. Skill: Self Improving Domotics Owner: jose-compu Summary: Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17bzpdy0evfmqz6nx069npr3n84p7f2:self-improving-house","sourceUrl":"https://clawhub.ai/jose-compu/self-improving-house","homepage":"https://clawhub.ai/jose-compu/skills/self-improving-house","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/jose-compu/self-improving-house","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/jose-compu/skills/self-improving-house","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportu"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T09:51:02.581Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T09:51:02.581Z","emptyReason":null},"stars":null,"forks":null,"downloads":1095,"packageName":null,"latestVersion":"1.0.1","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T09:51:02.518Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T09:51:02.581Z","lastCrawledAt":"2026-10-11T09:51:02.518Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T09:51:02.518Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.1","createdAt":"2026-08-28T19:26:16.220Z","changelog":"Security review: narrow hook matchers, explicit promotion approval, project-scoped hooks.","fileCount":16,"zipByteSize":24636},{"version":"1.0.0","createdAt":"2026-04-14T10:02:55.974Z","changelog":"- Initial release of the self-improving-domotics skill for smart-home automation quality tracking. - Provides structured guidance for logging learnings, issues, and feature requests to markdown files for continuous domotics improvement. - Detects and captures key automation challenges: conflicts, sensor drift, device connectivity, integration breaks, safety gaps, latency, and energy optimization. - Emphasizes documentation-only usage; does not execute real-world actions. - Includes setup instructions for OpenClaw and generic agent environments. - Supplies detailed templates and best practices for safe, clear incident and improvement logging.","fileCount":16,"zipByteSize":23987}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17bzpdy0evfmqz6nx069npr3n84p7f2:self-improving-house","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T14:14:59.398Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-house/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T09:51:02.581Z","emptyReason":null},"readme":"Skill: Self Improving Domotics\n\nOwner: jose-compu\n\nSummary: Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud or local integrations break, (5) Occupancy detection is inconsistent with reality, (6) Latency causes delayed or jittery automations, (7) Energy usage patterns are inefficient, (8) Safety automations need stronger guardrails.\n\nTags: latest:1.0.1\n\nVersion history:\n\nv1.0.1 | 2026-08-28T19:26:16.220Z | user\n\nSecurity review: narrow hook matchers, explicit promotion approval, project-scoped hooks.\n\nv1.0.0 | 2026-04-14T10:02:55.974Z | user\n\n- Initial release of the self-improving-domotics skill for smart-home automation quality tracking.\n- Provides structured guidance for logging learnings, issues, and feature requests to markdown files for continuous domotics improvement.\n- Detects and captures key automation challenges: conflicts, sensor drift, device connectivity, integration breaks, safety gaps, latency, and energy optimization.\n- Emphasizes documentation-only usage; does not execute real-world actions.\n- Includes setup instructions for OpenClaw and generic agent environments.\n- Supplies detailed templates and best practices for safe, clear incident and improvement logging.\n\nArchive index:\n\nArchive v1.0.1: 16 files, 24636 bytes\n\nFiles: assets/ERRORS.md (1165b), assets/FEATURE_REQUESTS.md (1232b), assets/LEARNINGS.md (1286b), assets/SKILL-TEMPLATE.md (1594b), hooks/openclaw/handler.js (1858b), hooks/openclaw/handler.ts (1983b), hooks/openclaw/HOOK.md (793b), references/examples.md (3891b), references/hooks-setup.md (1798b), references/openclaw-integration.md (1245b), scripts/activator.sh (1054b), scripts/error-detector.sh (1756b), scripts/extract-skill.sh (4876b), skill-card.md (2690b), SKILL.md (25152b), _meta.json (139b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: self-improving-domotics\ndescription: \"Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud or local integrations break, (5) Occupancy detection is inconsistent with reality, (6) Latency causes delayed or jittery automations, (7) Energy usage patterns are inefficient, (8) Safety automations need stronger guardrails.\"\n---\n\n# Self-Improving Domotics Skill\n\nLog domotics-specific learnings, issues, and feature requests to markdown files for continuous improvement of smart home systems.\n\nThis skill is documentation and reminder guidance only. It does not execute physical actuator actions directly.\n\nAlways prefer safe defaults and human confirmation for high-impact routines involving door locks, alarms, gas or water shutoff, and heaters.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure `.learnings/` exists in the project or workspace root and contains the required files:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Domotics Learnings\\n\\nSensor reliability lessons, automation quality findings, integration regressions, safety gaps, and energy optimization observations.\\n\\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/DOMOTICS_ISSUES.md ] || printf \"# Domotics Issues Log\\n\\nRecurring smart-home failures, rule conflicts, unreliable sensors, unreachable devices, and safety-relevant incidents.\\n\\n---\\n\" > .learnings/DOMOTICS_ISSUES.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Domotics Feature Requests\\n\\nAutomation, observability, reliability, and safety capability requests.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. The commands are no-op when already initialised.\n\nDo not log secrets, access tokens, lock PINs, alarm codes, network credentials, or personal household schedules in plain text.\n\nIf automatic reminders are needed, enable hook integration (opt-in) in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Two automations fire opposite commands | Log in `.learnings/DOMOTICS_ISSUES.md` as `automation_conflict` |\n| Zigbee/Z-Wave devices intermittently disappear | Log issue as `device_unreachable` with radio and topology details |\n| Occupancy says \"home\" while house is empty | Log learning as `occupancy_mismatch` and add confidence notes |\n| HVAC oscillates around target temperature | Log learning as `latency_jitter` or `sensor_drift` |\n| Integration API response schema changed | Log issue as `integration_break` and link vendor release notes |\n| Rule repeatedly misses schedule window | Log issue as `latency_jitter` with timeline and queue delay |\n| Energy spike after automation rollout | Log learning as `energy_optimization` with before/after kWh |\n| Safety routine lacks confirmation step | Log learning as `safety_rule_gap` and escalate priority |\n| Pattern appears 3+ times | Add `See Also`, raise priority, and consider promotion |\n| Reusable approach discovered | Promote to playbook, compatibility matrix, rule library, or safety automation standard |\n\n## OpenClaw Setup (Recommended)\n\nOpenClaw is the primary platform for this skill. It supports workspace injection and optional hooks for proactive reminders.\n\n### Installation\n\n**Via ClawdHub (recommended):**\n```bash\nclawdhub install self-improving-domotics\n```\n\n**Manual clone:**\n```bash\ngit clone https://github.com/jose-compu/self-improving-domotics.git ~/.openclaw/skills/self-improving-domotics\n```\n\n### Workspace Structure\n\nOpenClaw injects workspace files at session start:\n\n```\n~/.openclaw/workspace/\n├── AGENTS.md / SOUL.md / TOOLS.md / MEMORY.md\n├── memory/YYYY-MM-DD.md\n└── .learnings/{LEARNINGS.md, DOMOTICS_ISSUES.md, FEATURE_REQUESTS.md}\n```\n\n### Create Learning Files\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nThen create (or copy from `assets/`) the domotics logs:\n- `LEARNINGS.md` - reliability and optimization learnings\n- `DOMOTICS_ISSUES.md` - concrete failures and incident-style timelines\n- `FEATURE_REQUESTS.md` - automation and observability capability requests\n\n### Promotion Targets\n\nPromote proven learnings to durable assets:\n\n| Learning Type | Promote To | Example |\n|---------------|------------|---------|\n| Reproducible automation fix | Home automation playbook | \"Night routine fails when motion timeout overlaps lock delay\" |\n| Device reliability pattern | Device compatibility matrix | \"Battery sensors on firmware X drift after 30 days\" |\n| Rule-quality pattern | Automation rule library | \"Debounce + cooldown template for occupancy-triggered lighting\" |\n| Human-safety safeguard | Safety automations | \"Two-step confirmation for door unlock at night\" |\n| Communication and caution patterns | `SOUL.md` | \"Ask explicit confirmation for high-impact routines\" |\n| Cross-agent routine design | `AGENTS.md` | \"Split analysis of integrations vs radio reliability\" |\n| Integration constraints | `TOOLS.md` | \"Webhook retry backoff and schema validation rules\" |\n\n### Optional: Enable Hook\n\nOpt-in and project-scoped. Enabling a hook persists across future sessions; skip this unless you need reminders.\n\nFor reminder injection during session bootstrap:\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improving-domotics\nopenclaw hooks enable self-improving-domotics\n```\n\nSee `references/openclaw-integration.md` for details.\n\n---\n\n## Generic Setup (Other Agents)\n\nFor Claude Code, Codex, Copilot, or other agents:\n\n```bash\nmkdir -p .learnings\n```\n\nCreate the three files with the headers shown in First-Use Initialisation.\n\n### Add reference to agent instruction files\n\nAdd to `AGENTS.md`, `CLAUDE.md`, or `.github/copilot-instructions.md`:\n\n#### Self-Improving Domotics Workflow\n\nWhen smart-home issues or patterns are discovered:\n1. Log to `.learnings/DOMOTICS_ISSUES.md`, `.learnings/LEARNINGS.md`, or `.learnings/FEATURE_REQUESTS.md`\n2. Promote verified recurring patterns to:\n   - Home automation playbooks\n   - Device compatibility matrix\n   - Automation rule library\n   - Safety automations\n\n## Logging Format\n\n### Learning Entry [LRN-YYYYMMDD-XXX]\n\nAppend to `.learnings/LEARNINGS.md`:\n\n```markdown\n## [LRN-YYYYMMDD-XXX] category\n\n**Logged**: ISO-8601 timestamp\n**Priority**: low | medium | high | critical\n**Status**: pending\n**Area**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n\n### Summary\nOne-line domotics learning\n\n### Details\nWhat happened, why behavior was suboptimal, what rule/device/integration assumptions failed,\nand what robust approach should be preferred.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes | no\n- Human confirmation required: yes | no\n- Fallback on uncertainty: no action | notify-only | safe mode\n\n### Suggested Action\nSpecific design, rule, configuration, or documentation change\n\n### Metadata\n- Source: automation_event | incident_review | user_report | monitoring_alert | simplify-and-harden\n- Category: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n- Related Devices: thermostat-v2, zigbee-motion-3\n- Related Integrations: home-assistant | mqtt | matter | zigbee2mqtt | alexa\n- Related Entries: DOM-20260413-001\n- Tags: tag1, tag2\n- See Also: LRN-20260410-002\n- Pattern-Key: occupancy.false_positive_night | integration.schema_change (optional)\n- Recurrence-Count: 1 (optional)\n- First-Seen: 2026-04-13 (optional)\n- Last-Seen: 2026-04-13 (optional)\n\n---\n```\n\n### Domotics Issue Entry [DOM-YYYYMMDD-XXX]\n\nAppend to `.learnings/DOMOTICS_ISSUES.md`:\n\n```markdown\n## [DOM-YYYYMMDD-XXX] issue_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: medium | high | critical\n**Status**: pending\n**Area**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n\n### Summary\nBrief issue statement\n\n### Incident Timeline\n| Time | Event |\n|------|-------|\n| T+0m | Trigger observed |\n| T+Xm | Detection or alert |\n| T+Xm | Mitigation applied |\n| T+Xm | Verified stable or still failing |\n\n### Root Cause\nUnderlying reason (rule conflict, stale sensor, network partition, vendor API change, etc.)\n\n### Correct Approach\nHow system design or operating procedure should handle this scenario\n\n### Home Impact\n- User Impact: none | minor | significant\n- Safety Impact: none | potential | high\n- Security Impact: none | potential | high\n- Energy Impact: neutral | increased | reduced\n- Manual Intervention: none | required\n\n### Prevention\nGuardrails, retries, validation, fallback policy, notification policy, or routine redesign\n\n### Context\n- Trigger: monitoring_alert | user_report | regression | integration_update | schedule_miss\n- Topology: local_only | cloud_assisted | hybrid\n- Network Layer: wifi | zigbee | zwave | thread | ethernet | mixed\n\n### Metadata\n- Related Devices: lock-front-door, motion-hallway\n- Related Files: automations/night-routine.yaml\n- Related Entries: LRN-20260413-001\n- See Also: DOM-20260410-002\n\n---\n```\n\n### Feature Request Entry [FEAT-YYYYMMDD-XXX]\n\nAppend to `.learnings/FEATURE_REQUESTS.md`:\n\n```markdown\n## [FEAT-YYYYMMDD-XXX] capability_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: low | medium | high\n**Status**: pending\n**Area**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n\n### Requested Capability\nWhat automation or reliability capability is needed\n\n### User Context\nWhy this matters, what failure pattern it prevents, what experience it improves\n\n### Complexity Estimate\nsimple | medium | complex\n\n### Suggested Implementation\nSpecific architecture, tooling, API contracts, and rollout safety controls\n\n### Metadata\n- Frequency: first_time | recurring\n- Related Features: feature_name_or_component\n\n---\n```\n\n## Entry Types and Categories\n\n### Entry Types\n\n| Type | Meaning | File |\n|------|---------|------|\n| `LRN` | Learning from behavior, reliability, safety, or optimization | `.learnings/LEARNINGS.md` |\n| `DOM` | Domotics issue or incident requiring corrective handling | `.learnings/DOMOTICS_ISSUES.md` |\n| `FEAT` | Feature request for tooling, automation, observability, or policy | `.learnings/FEATURE_REQUESTS.md` |\n\n### Categories\n\n| Category | Use When |\n|----------|----------|\n| `automation_conflict` | Two or more rules produce contradictory actuator commands |\n| `sensor_drift` | Sensor readings diverge from reality over time or conditions |\n| `device_unreachable` | Device becomes offline, intermittently available, or non-responsive |\n| `integration_break` | Integration API/auth/schema changes break automations |\n| `energy_optimization` | Opportunity to reduce kWh peaks or unnecessary runtime |\n| `safety_rule_gap` | Automation lacks safeguards for high-impact physical actions |\n| `occupancy_mismatch` | Occupancy inference does not match actual presence |\n| `latency_jitter` | Timing inconsistency causes delayed, oscillatory, or missed actions |\n\n## ID Generation\n\nFormat: `TYPE-YYYYMMDD-XXX`\n- TYPE: `LRN` | `DOM` | `FEAT`\n- YYYYMMDD: current date\n- XXX: sequential or random 3-char suffix (`001`, `A9K`)\n\nExamples:\n- `LRN-20260413-001`\n- `DOM-20260413-A7B`\n- `FEAT-20260413-002`\n\n## Resolving Entries\n\nWhen addressed, update:\n1. `**Status**: pending` -> `**Status**: resolved`\n2. Add resolution section:\n\n```markdown\n### Resolution\n- **Resolved**: 2026-04-13T18:20:00Z\n- **Action Taken**: Added cooldown and guard condition to occupancy-lighting routine\n- **Notes**: Added manual confirmation before lock and alarm state transitions at night\n```\n\nOther valid statuses:\n- `in_progress` - actively investigated\n- `wont_fix` - accepted as non-actionable (include reason)\n- `promoted` - promoted to permanent target\n- `promoted_to_skill` - extracted to reusable skill\n\n## Detection Triggers\n\nAutomatically log when these domotics signals appear.\n\n### Automation Conflict Triggers (-> `DOM` or `LRN`)\n- Rapid repeated toggles, opposing commands, or circular rule loops\n- Overlapping conditions without explicit precedence\n\n### Device Reachability Triggers (-> `DOM`)\n- Offline/unreachable warnings, repeated timeouts, missing acknowledgments\n- Zigbee/Z-Wave mesh drops or MQTT entity unavailable states\n\n### Integration Break Triggers (-> `DOM` or `LRN`)\n- Webhook/API auth/schema/endpoint changes causing parser or action failures\n- Voice-assistant intent mapping regressions after platform updates\n\n### Occupancy and Sensor Triggers (-> `LRN`)\n- Occupancy confidence mismatches observed reality\n- Stale/impossible sensor values beyond threshold windows\n\n### Timing and Schedule Triggers (-> `DOM`)\n- Missed schedules, delayed execution, or jitter-induced duplicate actions\n- Timezone/sunrise-sunset offset errors affecting routines\n\n### Safety Triggers (-> `LRN` high/critical)\n- High-impact routines executing without human confirmation\n- Lock/alarm/gas/water/heater actions under uncertain confidence\n\n## Priority Guidelines\n\n| Priority | When to Use | Domotics Examples |\n|----------|-------------|------------------|\n| `critical` | Potential physical harm, security exposure, or hazardous state | Heater stuck on with failed thermostat feedback; lock opens on false occupancy; gas shutoff rule triggers incorrectly |\n| `high` | Significant reliability/security degradation or repeated unreachable devices | Repeated front-door lock offline; alarm routine disabled by integration break; occupancy loop causing night disruptions |\n| `medium` | Operational nuisance, moderate inefficiency, isolated integration mismatch | HVAC overshoot after schedule changes; webhook retries fail for one integration |\n| `low` | Documentation improvement, minor optimization, edge-case tuning | Non-critical light scene delay under unusual network load |\n\n## Area Tags\n\n| Area | Scope |\n|------|-------|\n| `lighting` | Scene control, occupancy-based lights, dimming and schedule logic |\n| `climate` | HVAC, thermostat feedback loops, humidity controls |\n| `security` | Alarm states, intrusion sensors, siren and notification policies |\n| `access_control` | Smart locks, garage doors, entry routines, authentication checks |\n| `energy` | Consumption scheduling, peak shaving, tariff-aware automations |\n| `sensors` | Motion, contact, temperature, humidity, air quality, leak sensors |\n| `routines` | Cross-device orchestrations and multi-step automation flows |\n| `voice_assistants` | Voice intent mapping, command ambiguity, assistant integrations |\n| `integrations` | Cloud/local APIs, webhooks, middleware platforms |\n| `network` | Wi-Fi, Zigbee, Z-Wave, Thread, MQTT broker, latency behavior |\n\n## Promoting to Permanent Domotics Standards\n\nPromote only when learning is verified, repeatable, and broadly useful.\n\n### Promotion Targets\n\n| Target | What Belongs There |\n|--------|-------------------|\n| Home automation playbooks | Incident-tested troubleshooting and recovery procedures |\n| Device compatibility matrix | Firmware/model interoperability, known limits, workaround notes |\n| Automation rule library | Reusable rule templates with guards, debounce, and precedence |\n| Safety automations | High-impact routines with confirmations, rollback, and audit trails |\n| `SOUL.md` | Behavioral safety defaults and communication constraints |\n| `AGENTS.md` | Multi-agent decomposition for diagnostics and remediation planning |\n| `TOOLS.md` | Integration constraints, retry policies, and validation requirements |\n\n### When to Promote\n\n- Pattern recurs 3+ times within a month\n- Root cause and corrective pattern are validated\n- Applies across multiple homes/devices/integrations\n- Includes explicit safety boundary for high-impact actuations\n\n### How to Promote\n\n1. Distill the learning into concise, reusable rule language\n2. Prepare a minimal patch for the best promotion target\n3. Show a reviewed diff and apply only after explicit user approval\n4. Update original entry:\n   - `**Status**: promoted`\n   - `**Promoted**: home automation playbook` (or matrix/library/safety automation)\n\n## Recurring Pattern Detection\n\nIf an event resembles existing entries:\n\n1. Search first: `rg \"keyword|Pattern-Key\" .learnings/`\n2. Add `See Also` links to related IDs\n3. Increase priority if recurrence grows\n4. Move from one-off mitigation to systemic pattern fix\n\n## Simplify & Harden Feed\n\nIngest strong candidates from simplify-and-harden reviews:\n\n1. Use `Pattern-Key` as dedupe key\n2. Search existing records: `rg \"Pattern-Key: <key>\" .learnings/LEARNINGS.md`\n3. If found:\n   - increment `Recurrence-Count`\n   - update `Last-Seen`\n   - add cross-links in `See Also`\n4. If not found:\n   - create new `LRN` entry with `Source: simplify-and-harden`\n\nPromotion threshold:\n- `Recurrence-Count >= 3`\n- observed across 2+ areas or integration paths\n- validated over at least 14 days\n\n## Periodic Review\n\nReview `.learnings/` at natural checkpoints.\n\n### When to Review\n\n- Before major automation rollout\n- After firmware updates\n- After integration API changes\n- Weekly reliability retrospective\n- After safety-relevant incidents\n\n### Quick Status Check\n\n```bash\nrg \"Status\\*\\*: pending\" .learnings/*.md | wc -l\nrg -n \"Priority\\*\\*: critical|Priority\\*\\*: high\" .learnings/DOMOTICS_ISSUES.md\nrg -n \"safety_rule_gap|device_unreachable|integration_break\" .learnings/*.md\nrg -n \"energy_optimization|occupancy_mismatch\" .learnings/LEARNINGS.md\n```\n\n### Review Actions\n\n- Resolve fixed entries with evidence\n- Promote repeated patterns to permanent targets\n- Tune thresholds and rule precedence\n- Ensure confirmation steps exist for high-impact routines\n\n## Safety Posture and Operational Boundaries\n\nThis skill does not directly control physical devices. It captures and structures learnings so humans can implement changes safely.\n\n### Mandatory Safe Defaults\n\n- Prefer notify-only mode when confidence is low\n- Require explicit human confirmation for:\n  - door lock or unlock routines\n  - alarm arm/disarm transitions\n  - gas or water shutoff actions\n  - heater on/off changes with high thermal impact\n- Keep conservative fallback state on sensor ambiguity\n- Separate detection logic from actuator execution logic\n\n## Hook Integration\n\nHooks are optional and reminder-only. They must not perform direct actuator actions.\n\nHooks persist across sessions once installed. Keep them **project-scoped**. Do **not** install user-level or global hooks. Never use an empty `matcher`. `PostToolUse` inspects command output in-process; do not log raw output, secrets, or transcripts.\n\n### Quick Setup (Claude Code / Codex)\n\nCreate `.claude/settings.json` (or equivalent):\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"sensor|actuator|automation|iot|scene|device|home.?assistant\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improving-domotics/scripts/activator.sh\"\n      }]\n    }]\n  }\n}\n```\n\n### Advanced Setup (With Output Detection)\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"sensor|actuator|automation|iot|scene|device|home.?assistant\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improving-domotics/scripts/activator.sh\"\n      }]\n    }],\n    \"PostToolUse\": [{\n      \"matcher\": \"Bash\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improving-domotics/scripts/error-detector.sh\"\n      }]\n    }]\n  }\n}\n```\n\nEnable `PostToolUse` only if signal detection on tool output is desired.\n\n### Available Hook Scripts\n\n| Script | Hook Type | Purpose |\n|--------|-----------|---------|\n| `scripts/activator.sh` | UserPromptSubmit | Reminds to evaluate domotics learnings after each task |\n| `scripts/error-detector.sh` | PostToolUse (Bash) | Detects high-signal domotics issue phrases and prints reminder-only guidance |\n\nSee `references/hooks-setup.md` for troubleshooting.\n\n## Automatic Skill Extraction\n\nExtracted skills are untrusted until a human reviews the generated `SKILL.md`. Do not keep or publish an extracted skill without explicit user approval.\n\nWhen a domotics learning is stable and reusable, extract it into a standalone skill.\n\n### Skill Extraction Criteria\n\n| Criterion | Description |\n|-----------|-------------|\n| **Recurring** | Same pattern appears 3+ times |\n| **Verified** | Entry status is `resolved` with proof |\n| **Safety-aware** | Includes safe defaults and confirmation strategy for high-impact routines |\n| **Non-obvious** | Insight required investigation, not trivial documentation |\n| **Broadly applicable** | Works across homes, devices, or integration stacks |\n| **User-flagged** | User requests extraction explicitly |\n\n### Extraction Workflow\n\n1. Identify a candidate that meets criteria\n2. Run helper:\n   ```bash\n   ./skills/self-improving-domotics/scripts/extract-skill.sh skill-name --dry-run\n   ./skills/self-improving-domotics/scripts/extract-skill.sh skill-name\n   ```\n3. Fill generated `SKILL.md` TODO placeholders\n4. Update source entry:\n   - `**Status**: promoted_to_skill`\n   - `**Skill-Path**: skills/skill-name`\n5. Validate in a fresh session\n\n### Extraction Detection Triggers\n\n- Conversation signals: \"keeps happening\", \"save as skill\", \"reusable safety pattern\"\n- Entry signals: multiple `See Also`, high/critical resolved status, repeated `Pattern-Key`\n\n## Multi-Agent Support\n\n| Agent | Activation | Detection |\n|-------|-----------|-----------|\n| Claude Code | Hooks + manual review | `error-detector.sh` + periodic review |\n| Codex CLI | Hooks + manual review | same scripts and workflow |\n| GitHub Copilot | Instruction-file guidance | manual logging and periodic review |\n| OpenClaw | Workspace injection + hook integration | bootstrap reminder and optional detection |\n\n## Best Practices\n\n1. Prefer deterministic automations over hidden side effects\n2. Add debounce, cooldown, and guard conditions for noisy sensors\n3. Separate occupancy estimation from high-impact actuations\n4. Design explicit rule precedence to avoid conflicts\n5. Treat integration contracts as versioned dependencies\n6. Capture before/after energy metrics for optimization claims\n7. Keep manual override paths available for security and climate routines\n8. Document safe fallback behavior for every critical routine\n\n## Gitignore Options\n\n**Keep learnings local**:\n```gitignore\n.learnings/\n```\n\n**Track learnings in repo**:\nDo not add `.learnings/` to `.gitignore`.\n\n**Hybrid**:\n```gitignore\n.learnings/*.md\n!.learnings/.gitkeep\n```\n\n## Reference Links\n- Skill repository: `https://github.com/jose-compu/self-improving-domotics.git`\n- Hook setup walkthrough: `references/hooks-setup.md`\nUse this skill to improve reliability, safety, and efficiency through better documentation and review loops. Keep workflows reminder-only, and require human confirmation for high-impact routines.\n\n## Stackability Contract (Standalone + Multi-Skill)\n\nThis skill is standalone-compatible and stackable with other self-improving skills.\n\n### Namespaced Logging (recommended for 2+ skills)\n- Namespace for this skill: `.learnings/domotics/`\n- Keep current standalone behavior if you prefer flat files.\n- Optional shared index for all skills: `.learnings/INDEX.md`\n\n### Required Metadata\nEvery new entry must include:\n\n```markdown\n**Skill**: domotics\n```\n\n### Hook Arbitration (when 2+ skills are enabled)\n- Use one dispatcher hook as the single entrypoint.\n- Dispatcher responsibilities: route by matcher, dedupe repeated events, and rate-limit reminders.\n- Suggested defaults: dedupe key = `event + matcher + file + 5m_window`; max 1 reminder per skill every 5 minutes.\n\n### Narrow Matcher Scope (domotics)\nOnly trigger this skill automatically for domotics signals such as:\n- `sensor|actuator|automation|iot|home assistant`\n- `energy profile|false trigger|device offline|scene failure`\n- explicit domotics intent in user prompt\n\n### Cross-Skill Precedence\nWhen guidance conflicts, apply:\n1. `security`\n2. `engineering`\n3. `coding`\n4. `ai`\n5. user-explicit domain skill\n6. `meta` as tie-breaker\n\n### Ownership Rules\n- This skill writes only to `.learnings/domotics/` in stackable mode.\n- It may read other skill folders for cross-linking, but should not rewrite their entries.\n- Standalone mode writes to this project's `.learnings/*.md` log files only.\n- Stackable mode writes only to the namespaced folder above and must not rewrite other skills' log entries.\n- Promotion into `AGENTS.md`, `SOUL.md`, `TOOLS.md`, `MEMORY.md`, rules, hooks, or generated skills is not a logging write. Show a reviewed diff and apply only after explicit user approval.\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn78jat5kd20evgyxzp9dmryax84qap0\",\n  \"slug\": \"self-improving-house\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1787945176220\n}\n\nFile v1.0.1:references/examples.md\n\n# Domotics Entry Examples\n\nConcrete examples for `LRN`, `DOM`, and `FEAT` entries.\n\n## Example 1: Conflicting Automations (Lighting)\n\n```markdown\n## [DOM-20260413-001] hallway_light_conflict\n\n**Logged**: 2026-04-13T19:10:00Z\n**Priority**: high\n**Status**: pending\n**Area**: lighting\n\n### Summary\nNight motion routine turns hallway lights on while sleep routine turns them off every 20 seconds.\n\n### Incident Timeline\n| Time | Event |\n|------|-------|\n| T+0m | Motion trigger fires after 23:00 |\n| T+1m | Sleep routine \"all-off\" executes |\n| T+2m | Motion retriggers and loop starts |\n\n### Root Cause\nOverlapping conditions without precedence or cooldown.\n\n### Prevention\nAdd precedence: sleep mode dominates. Add 120s cooldown.\n\n---\n```\n\n## Example 2: Occupancy False Positive\n\n```markdown\n## [LRN-20260413-001] occupancy_mismatch\n\n**Logged**: 2026-04-13T19:30:00Z\n**Priority**: high\n**Status**: pending\n**Area**: sensors\n\n### Summary\nHome marked occupied due to stale BLE beacon, preventing alarm arming.\n\n### Details\nPresence remained true for 9 hours after all residents left.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes\n- Human confirmation required: yes\n- Fallback on uncertainty: notify-only\n\n### Metadata\n- Pattern-Key: occupancy.stale_ble_presence\n\n---\n```\n\n## Example 3: HVAC Overshoot\n\n```markdown\n## [LRN-20260413-002] latency_jitter\n\n**Logged**: 2026-04-13T20:00:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: climate\n\n### Summary\nHVAC overshoots target by 2.3C due to delayed temperature updates and aggressive rule.\n\n### Suggested Action\nUse moving average from two sensors + minimum runtime and cooldown.\n\n---\n```\n\n## Example 4: Lock Automation Safety Guard\n\n```markdown\n## [LRN-20260413-003] safety_rule_gap\n\n**Logged**: 2026-04-13T20:15:00Z\n**Priority**: critical\n**Status**: pending\n**Area**: access_control\n\n### Summary\nAuto-unlock at arrival can trigger from low-confidence geofence event.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes\n- Human confirmation required: yes\n- Fallback on uncertainty: no action\n\n### Suggested Action\nRequire dual signal (geofence + BLE) and explicit user confirmation after 22:00.\n\n---\n```\n\n## Example 5: Integration API Change\n\n```markdown\n## [DOM-20260413-002] weather_api_schema_break\n\n**Logged**: 2026-04-13T21:00:00Z\n**Priority**: high\n**Status**: pending\n**Area**: integrations\n\n### Summary\nWeather provider changed `temp_c` to `temperature.celsius`, breaking climate preheat routine.\n\n### Root Cause\nIntegration parser had hard-coded field names and no schema version checks.\n\n### Prevention\nAdd schema validation, feature flags, and fallback parser.\n\n---\n```\n\n## Example 6: Energy Optimization Pattern\n\n```markdown\n## [LRN-20260413-004] energy_optimization\n\n**Logged**: 2026-04-13T21:20:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: energy\n\n### Summary\nShifting water heater preheat outside peak tariff reduced daily usage cost by 14%.\n\n### Details\nPreheat moved from 18:00 to 16:30 with occupancy gate retained.\n\n---\n```\n\n## Example 7: Promoted Playbook\n\n```markdown\n## [LRN-20260401-006] device_unreachable\n\n**Logged**: 2026-04-01T10:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: home automation playbook\n**Area**: network\n\n### Summary\nSystematic recovery sequence for Zigbee mesh partitions after power outages.\n\n### Metadata\n- Pattern-Key: connectivity.zigbee_mesh_recovery\n- Recurrence-Count: 5\n\n---\n```\n\n## Example 8: Promoted Skill\n\n```markdown\n## [LRN-20260405-004] automation_conflict\n\n**Logged**: 2026-04-05T12:40:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/night-occupancy-lock-guard\n**Area**: security\n\n### Summary\nReusable guard pattern to prevent lock/alarm state changes on uncertain occupancy.\n\n### Metadata\n- Pattern-Key: safety.lock_guard_uncertain_occupancy\n- See Also: DOM-20260413-001, LRN-20260413-001\n\n---\n```\n\nFile v1.0.1:references/hooks-setup.md\n\n# Domotics Hook Setup Guide\n\nConfigure optional hooks for domotics self-improvement reminders.\n\n## Overview\n\nHooks help maintain logging discipline:\n- `UserPromptSubmit`: injects reminder to evaluate `LRN` / `DOM` / `FEAT`\n- `PostToolUse (Bash)`: scans tool output for high-signal domotics failure patterns\n\nAll hooks are reminder-only and must not execute direct physical actions.\n\n## Claude Code Setup\n\nCreate `.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"sensor|actuator|automation|iot|scene|device|home.?assistant\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improving-domotics/scripts/activator.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improving-domotics/scripts/error-detector.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Codex Setup\n\nUse equivalent settings file and same script paths.\n\n## Verification\n\n```bash\nchmod +x ./skills/self-improving-domotics/scripts/*.sh\nbash -n ./skills/self-improving-domotics/scripts/activator.sh\nbash -n ./skills/self-improving-domotics/scripts/error-detector.sh\nbash -n ./skills/self-improving-domotics/scripts/extract-skill.sh\n```\n\nStart a new session and confirm reminder tags appear.\n\n## Troubleshooting\n\n1. Check script permissions.\n2. Validate relative paths from project root.\n3. Restart the session after hook config changes.\n4. If overhead is too high, keep only `UserPromptSubmit`.\n\n## Safety Notes\n\n- Hook output should stay concise.\n- Avoid logging secrets, lock codes, or personal occupancy schedules.\n- Keep automation commands out of hook scripts; reminders only.\n\nFile v1.0.1:references/openclaw-integration.md\n\n# OpenClaw Integration (Domotics)\n\nComplete setup for `self-improving-domotics` in OpenClaw.\n\n## Install\n\n```bash\nclawdhub install self-improving-domotics\n```\n\nManual alternative:\n\n```bash\ngit clone https://github.com/jose-compu/self-improving-domotics.git ~/.openclaw/skills/self-improving-domotics\n```\n\n## Optional Hook\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improving-domotics\nopenclaw hooks enable self-improving-domotics\n```\n\n## Workspace Files\n\nEnsure:\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nRequired files:\n- `LEARNINGS.md`\n- `DOMOTICS_ISSUES.md`\n- `FEATURE_REQUESTS.md`\n\n## Promotion Targets\n\n- Home automation playbooks\n- Device compatibility matrix\n- Automation rule library\n- Safety automations\n\n## Detection Focus\n\n- Rule conflict and automation loops\n- Sensor drift and stale occupancy\n- Device offline / unreachable behavior\n- Integration/webhook/API regressions\n- Latency and schedule miss patterns\n- Energy optimization opportunities\n- Safety rule gaps for high-impact routines\n\n## Safety Boundary\n\nThis integration captures reminders and documentation only.\nIt does not execute direct physical actuator actions.\nHuman confirmation is required for lock/alarm/gas/water/heater high-impact routines.\n\nFile v1.0.1:assets/ERRORS.md\n\n# Domotics Issues Log\n\nRecurring smart-home failures, rule conflicts, stale occupancy signals, unreachable devices, and safety-relevant incidents.\n\n**Triggers**: monitoring_alert | user_report | regression | integration_update | schedule_miss\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n\n## Status Definitions\n\n| Status | Meaning |\n|--------|---------|\n| `pending` | Not yet addressed |\n| `in_progress` | Actively investigated or mitigated |\n| `resolved` | Root cause fixed and behavior verified |\n| `wont_fix` | Explicitly accepted with rationale |\n| `promoted` | Converted into durable playbook/matrix/rule/safety automation |\n| `promoted_to_skill` | Extracted to reusable skill |\n\n## Safety Reminder\n\nThis log is reminder/documentation only.\nDo not execute physical actuator actions directly from logging workflows.\nRequire human confirmation for door locks, alarms, gas/water shutoff, and heaters.\n\n---\n\nFile v1.0.1:assets/FEATURE_REQUESTS.md\n\n# Domotics Feature Requests\n\nAutomation, reliability, observability, safety, and energy optimization capabilities requested during smart-home operations.\n\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n**Statuses**: pending | in_progress | resolved | wont_fix\n\n## Common Request Categories\n\n| Category | Examples |\n|----------|----------|\n| Automation Governance | Rule conflict detector, precedence simulator, anti-loop guardrails |\n| Sensor Reliability | Drift detection, stale-value alarms, confidence scoring |\n| Connectivity Resilience | Zigbee/Z-Wave health probes, MQTT disconnect auto-recovery, retry strategies |\n| Integration Stability | Schema diff monitor, webhook contract tests, token expiry alerts |\n| Safety Controls | Human-confirmation workflows, notify-only fallback, rollback templates |\n| Energy Optimization | Tariff-aware schedules, occupancy + climate co-optimization |\n| Observability | Routine timeline tracing, latency/jitter dashboards, failure clustering |\n\n## Safety Reminder\n\nFeature ideation must preserve safe defaults.\nHigh-impact routines must support human confirmation and conservative fallback behavior.\n\n---\n\nFile v1.0.1:assets/LEARNINGS.md\n\n# Domotics Learnings\n\nReliability findings, safety guardrails, integration lessons, occupancy insights, and energy optimization patterns from smart-home automation.\n\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n**Statuses**: pending | in_progress | resolved | wont_fix | promoted | promoted_to_skill\n\n## Status Definitions\n\n| Status | Meaning |\n|--------|---------|\n| `pending` | Not yet addressed |\n| `in_progress` | Under active analysis/remediation |\n| `resolved` | Verified correction applied |\n| `wont_fix` | Accepted limitation with rationale |\n| `promoted` | Elevated to playbook/matrix/library/safety automation |\n| `promoted_to_skill` | Converted into reusable skill |\n\n## Skill Extraction Fields\n\nWhen a learning becomes a skill, include:\n\n```markdown\n**Status**: promoted_to_skill\n**Skill-Path**: skills/skill-name\n```\n\n## Safety Reminder\n\nThis workflow is documentation and reminder guidance only.\nDo not use entries to directly actuate physical devices.\nHuman confirmation is mandatory for high-impact actions.\n\n---\n\nFile v1.0.1:assets/SKILL-TEMPLATE.md\n\n# Domotics Skill Template\n\nTemplate for creating domotics skills extracted from recurring learnings or issues.\n\n---\n\n## SKILL.md Template\n\n```markdown\n---\nname: skill-name-here\ndescription: \"Domotics pattern this skill solves and when to use it. Require narrow, testable trigger conditions plus explicit exclusions (never empty or catch-all matchers).\"\n---\n\n# Skill Name\n\nBrief context: what automation reliability, safety, or energy problem this addresses.\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| [Trigger] | [Response] |\n| [Trigger] | [Response] |\n\n## Scope and Safety\n\n- Documentation/reminder only; does not directly actuate devices\n- Human confirmation required for high-impact actions\n- Safe fallback when signals are ambiguous\n\n## Diagnostic Steps\n\n1. Verify trigger and timeline\n2. Validate sensors/devices/integrations\n3. Confirm rule precedence and guard conditions\n4. Apply remediation and verify stability\n\n## Promotion Target\n\n- Home automation playbook | Device compatibility matrix | Automation rule library | Safety automations\n\n## Source\n\n- Entry ID: LRN-YYYYMMDD-XXX or DOM-YYYYMMDD-XXX\n- Category: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n- Extraction Date: YYYY-MM-DD\n```\n\n---\n\n## Extraction Checklist\n\n- [ ] Pattern is recurring and verified\n- [ ] Safety constraints are explicit\n- [ ] No private household secrets included\n- [ ] Promotion target is selected\n- [ ] Source entry is linked\n- [ ] Generated content is self-contained\n\nFile v1.0.1:hooks/openclaw/HOOK.md\n\n---\nname: self-improving-domotics\ndescription: \"Injects domotics self-improvement reminder during agent bootstrap\"\nmetadata: {\"openclaw\":{\"emoji\":\"🏠\",\"events\":[\"agent:bootstrap\"]}}\n---\n\n# Self-Improving Domotics Hook\n\nInjects a reminder to evaluate domotics learnings at bootstrap.\n\n## What It Does\n\n- Fires on `agent:bootstrap`\n- Adds reminder content for logging `LRN` / `DOM` / `FEAT` entries\n- Highlights reliability, safety, integration, and energy patterns\n- Reinforces safe defaults and human confirmation for high-impact routines\n\n## Safety Boundary\n\nThis hook is reminder-only and documentation-only.\nIt does not execute direct actuator actions (locks, alarms, gas/water shutoff, heaters).\n\n## Configuration\n\nEnable with:\n\n```bash\nopenclaw hooks enable self-improving-domotics\n```\n\nFile v1.0.1:skill-card.md\n\n## Description:\n\nCaptures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[jose-compu](https://clawhub.ai/user/jose-compu)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, developers, and smart-home operators use this skill to record automation conflicts, sensor and occupancy issues, device reachability failures, integration regressions, safety gaps, and energy optimization opportunities as structured markdown notes. It also provides reminder-only hook guidance for capturing recurring domotics patterns without directly controlling physical devices.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Smart-home logs may capture sensitive household information such as lock codes, tokens, network credentials, or personal schedules.\n\nMitigation: Keep logs free of secrets and personal schedules, and periodically clean up retained .learnings content.\n\nRisk: Optional hooks persist after installation and may add reminders outside the intended scope if enabled too broadly.\n\nMitigation: Enable hooks only intentionally, keep them project-scoped, use narrow matchers, and avoid empty or catch-all hook matchers.\n\nRisk: Guidance about high-impact routines could be misapplied to locks, alarms, gas or water shutoff, or heaters.\n\nMitigation: Treat the skill as documentation and reminder guidance only; require explicit human confirmation and conservative fallback behavior for high-impact routines.\n\n## Reference(s):\n\n- [Self Improving Domotics on ClawHub](https://clawhub.ai/jose-compu/skills/self-improving-house)\n- [OpenClaw Integration (Domotics)](references/openclaw-integration.md)\n- [Domotics Hook Setup Guide](references/hooks-setup.md)\n- [Domotics Entry Examples](references/examples.md)\n\n## Skill Output:\n\n**Output Type(s):** [Markdown, Shell commands, Code, Configuration instructions, Guidance]\n\n**Output Format:** [Markdown guidance with inline bash commands, JSON hook examples, and markdown entry templates]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Creates or appends project/workspace learning logs; optional hooks emit reminder-only guidance.]\n\n## Skill Version(s):\n\n1.0.1 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.0: 16 files, 23987 bytes\n\nFiles: assets/ERRORS.md (1165b), assets/FEATURE_REQUESTS.md (1232b), assets/LEARNINGS.md (1286b), assets/SKILL-TEMPLATE.md (1488b), hooks/openclaw/handler.js (1858b), hooks/openclaw/handler.ts (1983b), hooks/openclaw/HOOK.md (793b), references/examples.md (3891b), references/hooks-setup.md (1739b), references/openclaw-integration.md (1245b), scripts/activator.sh (1054b), scripts/error-detector.sh (1650b), scripts/extract-skill.sh (4662b), skill-card.md (2694b), SKILL.md (24052b), _meta.json (139b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: self-improving-domotics\ndescription: \"Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud or local integrations break, (5) Occupancy detection is inconsistent with reality, (6) Latency causes delayed or jittery automations, (7) Energy usage patterns are inefficient, (8) Safety automations need stronger guardrails.\"\n---\n\n# Self-Improving Domotics Skill\n\nLog domotics-specific learnings, issues, and feature requests to markdown files for continuous improvement of smart home systems.\n\nThis skill is documentation and reminder guidance only. It does not execute physical actuator actions directly.\n\nAlways prefer safe defaults and human confirmation for high-impact routines involving door locks, alarms, gas or water shutoff, and heaters.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure `.learnings/` exists in the project or workspace root and contains the required files:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Domotics Learnings\\n\\nSensor reliability lessons, automation quality findings, integration regressions, safety gaps, and energy optimization observations.\\n\\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/DOMOTICS_ISSUES.md ] || printf \"# Domotics Issues Log\\n\\nRecurring smart-home failures, rule conflicts, unreliable sensors, unreachable devices, and safety-relevant incidents.\\n\\n---\\n\" > .learnings/DOMOTICS_ISSUES.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Domotics Feature Requests\\n\\nAutomation, observability, reliability, and safety capability requests.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. The commands are no-op when already initialised.\n\nDo not log secrets, access tokens, lock PINs, alarm codes, network credentials, or personal household schedules in plain text.\n\nIf automatic reminders are needed, enable hook integration (opt-in) in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Two automations fire opposite commands | Log in `.learnings/DOMOTICS_ISSUES.md` as `automation_conflict` |\n| Zigbee/Z-Wave devices intermittently disappear | Log issue as `device_unreachable` with radio and topology details |\n| Occupancy says \"home\" while house is empty | Log learning as `occupancy_mismatch` and add confidence notes |\n| HVAC oscillates around target temperature | Log learning as `latency_jitter` or `sensor_drift` |\n| Integration API response schema changed | Log issue as `integration_break` and link vendor release notes |\n| Rule repeatedly misses schedule window | Log issue as `latency_jitter` with timeline and queue delay |\n| Energy spike after automation rollout | Log learning as `energy_optimization` with before/after kWh |\n| Safety routine lacks confirmation step | Log learning as `safety_rule_gap` and escalate priority |\n| Pattern appears 3+ times | Add `See Also`, raise priority, and consider promotion |\n| Reusable approach discovered | Promote to playbook, compatibility matrix, rule library, or safety automation standard |\n\n## OpenClaw Setup (Recommended)\n\nOpenClaw is the primary platform for this skill. It supports workspace injection and optional hooks for proactive reminders.\n\n### Installation\n\n**Via ClawdHub (recommended):**\n```bash\nclawdhub install self-improving-domotics\n```\n\n**Manual clone:**\n```bash\ngit clone https://github.com/jose-compu/self-improving-domotics.git ~/.openclaw/skills/self-improving-domotics\n```\n\n### Workspace Structure\n\nOpenClaw injects workspace files at session start:\n\n```\n~/.openclaw/workspace/\n├── AGENTS.md / SOUL.md / TOOLS.md / MEMORY.md\n├── memory/YYYY-MM-DD.md\n└── .learnings/{LEARNINGS.md, DOMOTICS_ISSUES.md, FEATURE_REQUESTS.md}\n```\n\n### Create Learning Files\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nThen create (or copy from `assets/`) the domotics logs:\n- `LEARNINGS.md` - reliability and optimization learnings\n- `DOMOTICS_ISSUES.md` - concrete failures and incident-style timelines\n- `FEATURE_REQUESTS.md` - automation and observability capability requests\n\n### Promotion Targets\n\nPromote proven learnings to durable assets:\n\n| Learning Type | Promote To | Example |\n|---------------|------------|---------|\n| Reproducible automation fix | Home automation playbook | \"Night routine fails when motion timeout overlaps lock delay\" |\n| Device reliability pattern | Device compatibility matrix | \"Battery sensors on firmware X drift after 30 days\" |\n| Rule-quality pattern | Automation rule library | \"Debounce + cooldown template for occupancy-triggered lighting\" |\n| Human-safety safeguard | Safety automations | \"Two-step confirmation for door unlock at night\" |\n| Communication and caution patterns | `SOUL.md` | \"Ask explicit confirmation for high-impact routines\" |\n| Cross-agent routine design | `AGENTS.md` | \"Split analysis of integrations vs radio reliability\" |\n| Integration constraints | `TOOLS.md` | \"Webhook retry backoff and schema validation rules\" |\n\n### Optional: Enable Hook\n\nFor reminder injection during session bootstrap:\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improving-domotics\nopenclaw hooks enable self-improving-domotics\n```\n\nSee `references/openclaw-integration.md` for details.\n\n---\n\n## Generic Setup (Other Agents)\n\nFor Claude Code, Codex, Copilot, or other agents:\n\n```bash\nmkdir -p .learnings\n```\n\nCreate the three files with the headers shown in First-Use Initialisation.\n\n### Add reference to agent instruction files\n\nAdd to `AGENTS.md`, `CLAUDE.md`, or `.github/copilot-instructions.md`:\n\n#### Self-Improving Domotics Workflow\n\nWhen smart-home issues or patterns are discovered:\n1. Log to `.learnings/DOMOTICS_ISSUES.md`, `.learnings/LEARNINGS.md`, or `.learnings/FEATURE_REQUESTS.md`\n2. Promote verified recurring patterns to:\n   - Home automation playbooks\n   - Device compatibility matrix\n   - Automation rule library\n   - Safety automations\n\n## Logging Format\n\n### Learning Entry [LRN-YYYYMMDD-XXX]\n\nAppend to `.learnings/LEARNINGS.md`:\n\n```markdown\n## [LRN-YYYYMMDD-XXX] category\n\n**Logged**: ISO-8601 timestamp\n**Priority**: low | medium | high | critical\n**Status**: pending\n**Area**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n\n### Summary\nOne-line domotics learning\n\n### Details\nWhat happened, why behavior was suboptimal, what rule/device/integration assumptions failed,\nand what robust approach should be preferred.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes | no\n- Human confirmation required: yes | no\n- Fallback on uncertainty: no action | notify-only | safe mode\n\n### Suggested Action\nSpecific design, rule, configuration, or documentation change\n\n### Metadata\n- Source: automation_event | incident_review | user_report | monitoring_alert | simplify-and-harden\n- Category: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n- Related Devices: thermostat-v2, zigbee-motion-3\n- Related Integrations: home-assistant | mqtt | matter | zigbee2mqtt | alexa\n- Related Entries: DOM-20260413-001\n- Tags: tag1, tag2\n- See Also: LRN-20260410-002\n- Pattern-Key: occupancy.false_positive_night | integration.schema_change (optional)\n- Recurrence-Count: 1 (optional)\n- First-Seen: 2026-04-13 (optional)\n- Last-Seen: 2026-04-13 (optional)\n\n---\n```\n\n### Domotics Issue Entry [DOM-YYYYMMDD-XXX]\n\nAppend to `.learnings/DOMOTICS_ISSUES.md`:\n\n```markdown\n## [DOM-YYYYMMDD-XXX] issue_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: medium | high | critical\n**Status**: pending\n**Area**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n\n### Summary\nBrief issue statement\n\n### Incident Timeline\n| Time | Event |\n|------|-------|\n| T+0m | Trigger observed |\n| T+Xm | Detection or alert |\n| T+Xm | Mitigation applied |\n| T+Xm | Verified stable or still failing |\n\n### Root Cause\nUnderlying reason (rule conflict, stale sensor, network partition, vendor API change, etc.)\n\n### Correct Approach\nHow system design or operating procedure should handle this scenario\n\n### Home Impact\n- User Impact: none | minor | significant\n- Safety Impact: none | potential | high\n- Security Impact: none | potential | high\n- Energy Impact: neutral | increased | reduced\n- Manual Intervention: none | required\n\n### Prevention\nGuardrails, retries, validation, fallback policy, notification policy, or routine redesign\n\n### Context\n- Trigger: monitoring_alert | user_report | regression | integration_update | schedule_miss\n- Topology: local_only | cloud_assisted | hybrid\n- Network Layer: wifi | zigbee | zwave | thread | ethernet | mixed\n\n### Metadata\n- Related Devices: lock-front-door, motion-hallway\n- Related Files: automations/night-routine.yaml\n- Related Entries: LRN-20260413-001\n- See Also: DOM-20260410-002\n\n---\n```\n\n### Feature Request Entry [FEAT-YYYYMMDD-XXX]\n\nAppend to `.learnings/FEATURE_REQUESTS.md`:\n\n```markdown\n## [FEAT-YYYYMMDD-XXX] capability_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: low | medium | high\n**Status**: pending\n**Area**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n\n### Requested Capability\nWhat automation or reliability capability is needed\n\n### User Context\nWhy this matters, what failure pattern it prevents, what experience it improves\n\n### Complexity Estimate\nsimple | medium | complex\n\n### Suggested Implementation\nSpecific architecture, tooling, API contracts, and rollout safety controls\n\n### Metadata\n- Frequency: first_time | recurring\n- Related Features: feature_name_or_component\n\n---\n```\n\n## Entry Types and Categories\n\n### Entry Types\n\n| Type | Meaning | File |\n|------|---------|------|\n| `LRN` | Learning from behavior, reliability, safety, or optimization | `.learnings/LEARNINGS.md` |\n| `DOM` | Domotics issue or incident requiring corrective handling | `.learnings/DOMOTICS_ISSUES.md` |\n| `FEAT` | Feature request for tooling, automation, observability, or policy | `.learnings/FEATURE_REQUESTS.md` |\n\n### Categories\n\n| Category | Use When |\n|----------|----------|\n| `automation_conflict` | Two or more rules produce contradictory actuator commands |\n| `sensor_drift` | Sensor readings diverge from reality over time or conditions |\n| `device_unreachable` | Device becomes offline, intermittently available, or non-responsive |\n| `integration_break` | Integration API/auth/schema changes break automations |\n| `energy_optimization` | Opportunity to reduce kWh peaks or unnecessary runtime |\n| `safety_rule_gap` | Automation lacks safeguards for high-impact physical actions |\n| `occupancy_mismatch` | Occupancy inference does not match actual presence |\n| `latency_jitter` | Timing inconsistency causes delayed, oscillatory, or missed actions |\n\n## ID Generation\n\nFormat: `TYPE-YYYYMMDD-XXX`\n- TYPE: `LRN` | `DOM` | `FEAT`\n- YYYYMMDD: current date\n- XXX: sequential or random 3-char suffix (`001`, `A9K`)\n\nExamples:\n- `LRN-20260413-001`\n- `DOM-20260413-A7B`\n- `FEAT-20260413-002`\n\n## Resolving Entries\n\nWhen addressed, update:\n1. `**Status**: pending` -> `**Status**: resolved`\n2. Add resolution section:\n\n```markdown\n### Resolution\n- **Resolved**: 2026-04-13T18:20:00Z\n- **Action Taken**: Added cooldown and guard condition to occupancy-lighting routine\n- **Notes**: Added manual confirmation before lock and alarm state transitions at night\n```\n\nOther valid statuses:\n- `in_progress` - actively investigated\n- `wont_fix` - accepted as non-actionable (include reason)\n- `promoted` - promoted to permanent target\n- `promoted_to_skill` - extracted to reusable skill\n\n## Detection Triggers\n\nAutomatically log when these domotics signals appear.\n\n### Automation Conflict Triggers (-> `DOM` or `LRN`)\n- Rapid repeated toggles, opposing commands, or circular rule loops\n- Overlapping conditions without explicit precedence\n\n### Device Reachability Triggers (-> `DOM`)\n- Offline/unreachable warnings, repeated timeouts, missing acknowledgments\n- Zigbee/Z-Wave mesh drops or MQTT entity unavailable states\n\n### Integration Break Triggers (-> `DOM` or `LRN`)\n- Webhook/API auth/schema/endpoint changes causing parser or action failures\n- Voice-assistant intent mapping regressions after platform updates\n\n### Occupancy and Sensor Triggers (-> `LRN`)\n- Occupancy confidence mismatches observed reality\n- Stale/impossible sensor values beyond threshold windows\n\n### Timing and Schedule Triggers (-> `DOM`)\n- Missed schedules, delayed execution, or jitter-induced duplicate actions\n- Timezone/sunrise-sunset offset errors affecting routines\n\n### Safety Triggers (-> `LRN` high/critical)\n- High-impact routines executing without human confirmation\n- Lock/alarm/gas/water/heater actions under uncertain confidence\n\n## Priority Guidelines\n\n| Priority | When to Use | Domotics Examples |\n|----------|-------------|------------------|\n| `critical` | Potential physical harm, security exposure, or hazardous state | Heater stuck on with failed thermostat feedback; lock opens on false occupancy; gas shutoff rule triggers incorrectly |\n| `high` | Significant reliability/security degradation or repeated unreachable devices | Repeated front-door lock offline; alarm routine disabled by integration break; occupancy loop causing night disruptions |\n| `medium` | Operational nuisance, moderate inefficiency, isolated integration mismatch | HVAC overshoot after schedule changes; webhook retries fail for one integration |\n| `low` | Documentation improvement, minor optimization, edge-case tuning | Non-critical light scene delay under unusual network load |\n\n## Area Tags\n\n| Area | Scope |\n|------|-------|\n| `lighting` | Scene control, occupancy-based lights, dimming and schedule logic |\n| `climate` | HVAC, thermostat feedback loops, humidity controls |\n| `security` | Alarm states, intrusion sensors, siren and notification policies |\n| `access_control` | Smart locks, garage doors, entry routines, authentication checks |\n| `energy` | Consumption scheduling, peak shaving, tariff-aware automations |\n| `sensors` | Motion, contact, temperature, humidity, air quality, leak sensors |\n| `routines` | Cross-device orchestrations and multi-step automation flows |\n| `voice_assistants` | Voice intent mapping, command ambiguity, assistant integrations |\n| `integrations` | Cloud/local APIs, webhooks, middleware platforms |\n| `network` | Wi-Fi, Zigbee, Z-Wave, Thread, MQTT broker, latency behavior |\n\n## Promoting to Permanent Domotics Standards\n\nPromote only when learning is verified, repeatable, and broadly useful.\n\n### Promotion Targets\n\n| Target | What Belongs There |\n|--------|-------------------|\n| Home automation playbooks | Incident-tested troubleshooting and recovery procedures |\n| Device compatibility matrix | Firmware/model interoperability, known limits, workaround notes |\n| Automation rule library | Reusable rule templates with guards, debounce, and precedence |\n| Safety automations | High-impact routines with confirmations, rollback, and audit trails |\n| `SOUL.md` | Behavioral safety defaults and communication constraints |\n| `AGENTS.md` | Multi-agent decomposition for diagnostics and remediation planning |\n| `TOOLS.md` | Integration constraints, retry policies, and validation requirements |\n\n### When to Promote\n\n- Pattern recurs 3+ times within a month\n- Root cause and corrective pattern are validated\n- Applies across multiple homes/devices/integrations\n- Includes explicit safety boundary for high-impact actuations\n\n### How to Promote\n\n1. Distill the learning into concise, reusable rule language\n2. Add it to the best promotion target\n3. Update original entry:\n   - `**Status**: promoted`\n   - `**Promoted**: home automation playbook` (or matrix/library/safety automation)\n\n## Recurring Pattern Detection\n\nIf an event resembles existing entries:\n\n1. Search first: `rg \"keyword|Pattern-Key\" .learnings/`\n2. Add `See Also` links to related IDs\n3. Increase priority if recurrence grows\n4. Move from one-off mitigation to systemic pattern fix\n\n## Simplify & Harden Feed\n\nIngest strong candidates from simplify-and-harden reviews:\n\n1. Use `Pattern-Key` as dedupe key\n2. Search existing records: `rg \"Pattern-Key: <key>\" .learnings/LEARNINGS.md`\n3. If found:\n   - increment `Recurrence-Count`\n   - update `Last-Seen`\n   - add cross-links in `See Also`\n4. If not found:\n   - create new `LRN` entry with `Source: simplify-and-harden`\n\nPromotion threshold:\n- `Recurrence-Count >= 3`\n- observed across 2+ areas or integration paths\n- validated over at least 14 days\n\n## Periodic Review\n\nReview `.learnings/` at natural checkpoints.\n\n### When to Review\n\n- Before major automation rollout\n- After firmware updates\n- After integration API changes\n- Weekly reliability retrospective\n- After safety-relevant incidents\n\n### Quick Status Check\n\n```bash\nrg \"Status\\*\\*: pending\" .learnings/*.md | wc -l\nrg -n \"Priority\\*\\*: critical|Priority\\*\\*: high\" .learnings/DOMOTICS_ISSUES.md\nrg -n \"safety_rule_gap|device_unreachable|integration_break\" .learnings/*.md\nrg -n \"energy_optimization|occupancy_mismatch\" .learnings/LEARNINGS.md\n```\n\n### Review Actions\n\n- Resolve fixed entries with evidence\n- Promote repeated patterns to permanent targets\n- Tune thresholds and rule precedence\n- Ensure confirmation steps exist for high-impact routines\n\n## Safety Posture and Operational Boundaries\n\nThis skill does not directly control physical devices. It captures and structures learnings so humans can implement changes safely.\n\n### Mandatory Safe Defaults\n\n- Prefer notify-only mode when confidence is low\n- Require explicit human confirmation for:\n  - door lock or unlock routines\n  - alarm arm/disarm transitions\n  - gas or water shutoff actions\n  - heater on/off changes with high thermal impact\n- Keep conservative fallback state on sensor ambiguity\n- Separate detection logic from actuator execution logic\n\n## Hook Integration\n\nHooks are optional and reminder-only. They must not perform direct actuator actions.\n\n### Quick Setup (Claude Code / Codex)\n\nCreate `.claude/settings.json` (or equivalent):\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improving-domotics/scripts/activator.sh\"\n      }]\n    }]\n  }\n}\n```\n\n### Advanced Setup (With Output Detection)\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improving-domotics/scripts/activator.sh\"\n      }]\n    }],\n    \"PostToolUse\": [{\n      \"matcher\": \"Bash\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improving-domotics/scripts/error-detector.sh\"\n      }]\n    }]\n  }\n}\n```\n\nEnable `PostToolUse` only if signal detection on tool output is desired.\n\n### Available Hook Scripts\n\n| Script | Hook Type | Purpose |\n|--------|-----------|---------|\n| `scripts/activator.sh` | UserPromptSubmit | Reminds to evaluate domotics learnings after each task |\n| `scripts/error-detector.sh` | PostToolUse (Bash) | Detects high-signal domotics issue phrases and prints reminder-only guidance |\n\nSee `references/hooks-setup.md` for troubleshooting.\n\n## Automatic Skill Extraction\n\nWhen a domotics learning is stable and reusable, extract it into a standalone skill.\n\n### Skill Extraction Criteria\n\n| Criterion | Description |\n|-----------|-------------|\n| **Recurring** | Same pattern appears 3+ times |\n| **Verified** | Entry status is `resolved` with proof |\n| **Safety-aware** | Includes safe defaults and confirmation strategy for high-impact routines |\n| **Non-obvious** | Insight required investigation, not trivial documentation |\n| **Broadly applicable** | Works across homes, devices, or integration stacks |\n| **User-flagged** | User requests extraction explicitly |\n\n### Extraction Workflow\n\n1. Identify a candidate that meets criteria\n2. Run helper:\n   ```bash\n   ./skills/self-improving-domotics/scripts/extract-skill.sh skill-name --dry-run\n   ./skills/self-improving-domotics/scripts/extract-skill.sh skill-name\n   ```\n3. Fill generated `SKILL.md` TODO placeholders\n4. Update source entry:\n   - `**Status**: promoted_to_skill`\n   - `**Skill-Path**: skills/skill-name`\n5. Validate in a fresh session\n\n### Extraction Detection Triggers\n\n- Conversation signals: \"keeps happening\", \"save as skill\", \"reusable safety pattern\"\n- Entry signals: multiple `See Also`, high/critical resolved status, repeated `Pattern-Key`\n\n## Multi-Agent Support\n\n| Agent | Activation | Detection |\n|-------|-----------|-----------|\n| Claude Code | Hooks + manual review | `error-detector.sh` + periodic review |\n| Codex CLI | Hooks + manual review | same scripts and workflow |\n| GitHub Copilot | Instruction-file guidance | manual logging and periodic review |\n| OpenClaw | Workspace injection + hook integration | bootstrap reminder and optional detection |\n\n## Best Practices\n\n1. Prefer deterministic automations over hidden side effects\n2. Add debounce, cooldown, and guard conditions for noisy sensors\n3. Separate occupancy estimation from high-impact actuations\n4. Design explicit rule precedence to avoid conflicts\n5. Treat integration contracts as versioned dependencies\n6. Capture before/after energy metrics for optimization claims\n7. Keep manual override paths available for security and climate routines\n8. Document safe fallback behavior for every critical routine\n\n## Gitignore Options\n\n**Keep learnings local**:\n```gitignore\n.learnings/\n```\n\n**Track learnings in repo**:\nDo not add `.learnings/` to `.gitignore`.\n\n**Hybrid**:\n```gitignore\n.learnings/*.md\n!.learnings/.gitkeep\n```\n\n## Reference Links\n- Skill repository: `https://github.com/jose-compu/self-improving-domotics.git`\n- Hook setup walkthrough: `references/hooks-setup.md`\nUse this skill to improve reliability, safety, and efficiency through better documentation and review loops. Keep workflows reminder-only, and require human confirmation for high-impact routines.\n\n## Stackability Contract (Standalone + Multi-Skill)\n\nThis skill is standalone-compatible and stackable with other self-improving skills.\n\n### Namespaced Logging (recommended for 2+ skills)\n- Namespace for this skill: `.learnings/domotics/`\n- Keep current standalone behavior if you prefer flat files.\n- Optional shared index for all skills: `.learnings/INDEX.md`\n\n### Required Metadata\nEvery new entry must include:\n\n```markdown\n**Skill**: domotics\n```\n\n### Hook Arbitration (when 2+ skills are enabled)\n- Use one dispatcher hook as the single entrypoint.\n- Dispatcher responsibilities: route by matcher, dedupe repeated events, and rate-limit reminders.\n- Suggested defaults: dedupe key = `event + matcher + file + 5m_window`; max 1 reminder per skill every 5 minutes.\n\n### Narrow Matcher Scope (domotics)\nOnly trigger this skill automatically for domotics signals such as:\n- `sensor|actuator|automation|iot|home assistant`\n- `energy profile|false trigger|device offline|scene failure`\n- explicit domotics intent in user prompt\n\n### Cross-Skill Precedence\nWhen guidance conflicts, apply:\n1. `security`\n2. `engineering`\n3. `coding`\n4. `ai`\n5. user-explicit domain skill\n6. `meta` as tie-breaker\n\n### Ownership Rules\n- This skill writes only to `.learnings/domotics/` in stackable mode.\n- It may read other skill folders for cross-linking, but should not rewrite their entries.\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn78jat5kd20evgyxzp9dmryax84qap0\",\n  \"slug\": \"self-improving-house\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776160975974\n}\n\nFile v1.0.0:references/examples.md\n\n# Domotics Entry Examples\n\nConcrete examples for `LRN`, `DOM`, and `FEAT` entries.\n\n## Example 1: Conflicting Automations (Lighting)\n\n```markdown\n## [DOM-20260413-001] hallway_light_conflict\n\n**Logged**: 2026-04-13T19:10:00Z\n**Priority**: high\n**Status**: pending\n**Area**: lighting\n\n### Summary\nNight motion routine turns hallway lights on while sleep routine turns them off every 20 seconds.\n\n### Incident Timeline\n| Time | Event |\n|------|-------|\n| T+0m | Motion trigger fires after 23:00 |\n| T+1m | Sleep routine \"all-off\" executes |\n| T+2m | Motion retriggers and loop starts |\n\n### Root Cause\nOverlapping conditions without precedence or cooldown.\n\n### Prevention\nAdd precedence: sleep mode dominates. Add 120s cooldown.\n\n---\n```\n\n## Example 2: Occupancy False Positive\n\n```markdown\n## [LRN-20260413-001] occupancy_mismatch\n\n**Logged**: 2026-04-13T19:30:00Z\n**Priority**: high\n**Status**: pending\n**Area**: sensors\n\n### Summary\nHome marked occupied due to stale BLE beacon, preventing alarm arming.\n\n### Details\nPresence remained true for 9 hours after all residents left.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes\n- Human confirmation required: yes\n- Fallback on uncertainty: notify-only\n\n### Metadata\n- Pattern-Key: occupancy.stale_ble_presence\n\n---\n```\n\n## Example 3: HVAC Overshoot\n\n```markdown\n## [LRN-20260413-002] latency_jitter\n\n**Logged**: 2026-04-13T20:00:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: climate\n\n### Summary\nHVAC overshoots target by 2.3C due to delayed temperature updates and aggressive rule.\n\n### Suggested Action\nUse moving average from two sensors + minimum runtime and cooldown.\n\n---\n```\n\n## Example 4: Lock Automation Safety Guard\n\n```markdown\n## [LRN-20260413-003] safety_rule_gap\n\n**Logged**: 2026-04-13T20:15:00Z\n**Priority**: critical\n**Status**: pending\n**Area**: access_control\n\n### Summary\nAuto-unlock at arrival can trigger from low-confidence geofence event.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes\n- Human confirmation required: yes\n- Fallback on uncertainty: no action\n\n### Suggested Action\nRequire dual signal (geofence + BLE) and explicit user confirmation after 22:00.\n\n---\n```\n\n## Example 5: Integration API Change\n\n```markdown\n## [DOM-20260413-002] weather_api_schema_break\n\n**Logged**: 2026-04-13T21:00:00Z\n**Priority**: high\n**Status**: pending\n**Area**: integrations\n\n### Summary\nWeather provider changed `temp_c` to `temperature.celsius`, breaking climate preheat routine.\n\n### Root Cause\nIntegration parser had hard-coded field names and no schema version checks.\n\n### Prevention\nAdd schema validation, feature flags, and fallback parser.\n\n---\n```\n\n## Example 6: Energy Optimization Pattern\n\n```markdown\n## [LRN-20260413-004] energy_optimization\n\n**Logged**: 2026-04-13T21:20:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: energy\n\n### Summary\nShifting water heater preheat outside peak tariff reduced daily usage cost by 14%.\n\n### Details\nPreheat moved from 18:00 to 16:30 with occupancy gate retained.\n\n---\n```\n\n## Example 7: Promoted Playbook\n\n```markdown\n## [LRN-20260401-006] device_unreachable\n\n**Logged**: 2026-04-01T10:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: home automation playbook\n**Area**: network\n\n### Summary\nSystematic recovery sequence for Zigbee mesh partitions after power outages.\n\n### Metadata\n- Pattern-Key: connectivity.zigbee_mesh_recovery\n- Recurrence-Count: 5\n\n---\n```\n\n## Example 8: Promoted Skill\n\n```markdown\n## [LRN-20260405-004] automation_conflict\n\n**Logged**: 2026-04-05T12:40:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/night-occupancy-lock-guard\n**Area**: security\n\n### Summary\nReusable guard pattern to prevent lock/alarm state changes on uncertain occupancy.\n\n### Metadata\n- Pattern-Key: safety.lock_guard_uncertain_occupancy\n- See Also: DOM-20260413-001, LRN-20260413-001\n\n---\n```\n\nFile v1.0.0:references/hooks-setup.md\n\n# Domotics Hook Setup Guide\n\nConfigure optional hooks for domotics self-improvement reminders.\n\n## Overview\n\nHooks help maintain logging discipline:\n- `UserPromptSubmit`: injects reminder to evaluate `LRN` / `DOM` / `FEAT`\n- `PostToolUse (Bash)`: scans tool output for high-signal domotics failure patterns\n\nAll hooks are reminder-only and must not execute direct physical actions.\n\n## Claude Code Setup\n\nCreate `.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improving-domotics/scripts/activator.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improving-domotics/scripts/error-detector.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Codex Setup\n\nUse equivalent settings file and same script paths.\n\n## Verification\n\n```bash\nchmod +x ./skills/self-improving-domotics/scripts/*.sh\nbash -n ./skills/self-improving-domotics/scripts/activator.sh\nbash -n ./skills/self-improving-domotics/scripts/error-detector.sh\nbash -n ./skills/self-improving-domotics/scripts/extract-skill.sh\n```\n\nStart a new session and confirm reminder tags appear.\n\n## Troubleshooting\n\n1. Check script permissions.\n2. Validate relative paths from project root.\n3. Restart the session after hook config changes.\n4. If overhead is too high, keep only `UserPromptSubmit`.\n\n## Safety Notes\n\n- Hook output should stay concise.\n- Avoid logging secrets, lock codes, or personal occupancy schedules.\n- Keep automation commands out of hook scripts; reminders only.\n\nFile v1.0.0:references/openclaw-integration.md\n\n# OpenClaw Integration (Domotics)\n\nComplete setup for `self-improving-domotics` in OpenClaw.\n\n## Install\n\n```bash\nclawdhub install self-improving-domotics\n```\n\nManual alternative:\n\n```bash\ngit clone https://github.com/jose-compu/self-improving-domotics.git ~/.openclaw/skills/self-improving-domotics\n```\n\n## Optional Hook\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improving-domotics\nopenclaw hooks enable self-improving-domotics\n```\n\n## Workspace Files\n\nEnsure:\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nRequired files:\n- `LEARNINGS.md`\n- `DOMOTICS_ISSUES.md`\n- `FEATURE_REQUESTS.md`\n\n## Promotion Targets\n\n- Home automation playbooks\n- Device compatibility matrix\n- Automation rule library\n- Safety automations\n\n## Detection Focus\n\n- Rule conflict and automation loops\n- Sensor drift and stale occupancy\n- Device offline / unreachable behavior\n- Integration/webhook/API regressions\n- Latency and schedule miss patterns\n- Energy optimization opportunities\n- Safety rule gaps for high-impact routines\n\n## Safety Boundary\n\nThis integration captures reminders and documentation only.\nIt does not execute direct physical actuator actions.\nHuman confirmation is required for lock/alarm/gas/water/heater high-impact routines.\n\nFile v1.0.0:assets/ERRORS.md\n\n# Domotics Issues Log\n\nRecurring smart-home failures, rule conflicts, stale occupancy signals, unreachable devices, and safety-relevant incidents.\n\n**Triggers**: monitoring_alert | user_report | regression | integration_update | schedule_miss\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n\n## Status Definitions\n\n| Status | Meaning |\n|--------|---------|\n| `pending` | Not yet addressed |\n| `in_progress` | Actively investigated or mitigated |\n| `resolved` | Root cause fixed and behavior verified |\n| `wont_fix` | Explicitly accepted with rationale |\n| `promoted` | Converted into durable playbook/matrix/rule/safety automation |\n| `promoted_to_skill` | Extracted to reusable skill |\n\n## Safety Reminder\n\nThis log is reminder/documentation only.\nDo not execute physical actuator actions directly from logging workflows.\nRequire human confirmation for door locks, alarms, gas/water shutoff, and heaters.\n\n---\n\nFile v1.0.0:assets/FEATURE_REQUESTS.md\n\n# Domotics Feature Requests\n\nAutomation, reliability, observability, safety, and energy optimization capabilities requested during smart-home operations.\n\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n**Statuses**: pending | in_progress | resolved | wont_fix\n\n## Common Request Categories\n\n| Category | Examples |\n|----------|----------|\n| Automation Governance | Rule conflict detector, precedence simulator, anti-loop guardrails |\n| Sensor Reliability | Drift detection, stale-value alarms, confidence scoring |\n| Connectivity Resilience | Zigbee/Z-Wave health probes, MQTT disconnect auto-recovery, retry strategies |\n| Integration Stability | Schema diff monitor, webhook contract tests, token expiry alerts |\n| Safety Controls | Human-confirmation workflows, notify-only fallback, rollback templates |\n| Energy Optimization | Tariff-aware schedules, occupancy + climate co-optimization |\n| Observability | Routine timeline tracing, latency/jitter dashboards, failure clustering |\n\n## Safety Reminder\n\nFeature ideation must preserve safe defaults.\nHigh-impact routines must support human confirmation and conservative fallback behavior.\n\n---\n\nFile v1.0.0:assets/LEARNINGS.md\n\n# Domotics Learnings\n\nReliability findings, safety guardrails, integration lessons, occupancy insights, and energy optimization patterns from smart-home automation.\n\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\n**Statuses**: pending | in_progress | resolved | wont_fix | promoted | promoted_to_skill\n\n## Status Definitions\n\n| Status | Meaning |\n|--------|---------|\n| `pending` | Not yet addressed |\n| `in_progress` | Under active analysis/remediation |\n| `resolved` | Verified correction applied |\n| `wont_fix` | Accepted limitation with rationale |\n| `promoted` | Elevated to playbook/matrix/library/safety automation |\n| `promoted_to_skill` | Converted into reusable skill |\n\n## Skill Extraction Fields\n\nWhen a learning becomes a skill, include:\n\n```markdown\n**Status**: promoted_to_skill\n**Skill-Path**: skills/skill-name\n```\n\n## Safety Reminder\n\nThis workflow is documentation and reminder guidance only.\nDo not use entries to directly actuate physical devices.\nHuman confirmation is mandatory for high-impact actions.\n\n---\n\nFile v1.0.0:assets/SKILL-TEMPLATE.md\n\n# Domotics Skill Template\n\nTemplate for creating domotics skills extracted from recurring learnings or issues.\n\n---\n\n## SKILL.md Template\n\n```markdown\n---\nname: skill-name-here\ndescription: \"Domotics pattern this skill solves and when to use it.\"\n---\n\n# Skill Name\n\nBrief context: what automation reliability, safety, or energy problem this addresses.\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| [Trigger] | [Response] |\n| [Trigger] | [Response] |\n\n## Scope and Safety\n\n- Documentation/reminder only; does not directly actuate devices\n- Human confirmation required for high-impact actions\n- Safe fallback when signals are ambiguous\n\n## Diagnostic Steps\n\n1. Verify trigger and timeline\n2. Validate sensors/devices/integrations\n3. Confirm rule precedence and guard conditions\n4. Apply remediation and verify stability\n\n## Promotion Target\n\n- Home automation playbook | Device compatibility matrix | Automation rule library | Safety automations\n\n## Source\n\n- Entry ID: LRN-YYYYMMDD-XXX or DOM-YYYYMMDD-XXX\n- Category: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\n- Extraction Date: YYYY-MM-DD\n```\n\n---\n\n## Extraction Checklist\n\n- [ ] Pattern is recurring and verified\n- [ ] Safety constraints are explicit\n- [ ] No private household secrets included\n- [ ] Promotion target is selected\n- [ ] Source entry is linked\n- [ ] Generated content is self-contained\n\nFile v1.0.0:hooks/openclaw/HOOK.md\n\n---\nname: self-improving-domotics\ndescription: \"Injects domotics self-improvement reminder during agent bootstrap\"\nmetadata: {\"openclaw\":{\"emoji\":\"🏠\",\"events\":[\"agent:bootstrap\"]}}\n---\n\n# Self-Improving Domotics Hook\n\nInjects a reminder to evaluate domotics learnings at bootstrap.\n\n## What It Does\n\n- Fires on `agent:bootstrap`\n- Adds reminder content for logging `LRN` / `DOM` / `FEAT` entries\n- Highlights reliability, safety, integration, and energy patterns\n- Reinforces safe defaults and human confirmation for high-impact routines\n\n## Safety Boundary\n\nThis hook is reminder-only and documentation-only.\nIt does not execute direct actuator actions (locks, alarms, gas/water shutoff, heaters).\n\n## Configuration\n\nEnable with:\n\n```bash\nopenclaw hooks enable self-improving-domotics\n```\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nCaptures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jose-compu](https://clawhub.ai/user/jose-compu) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, smart-home operators, and agent users use this skill to record domotics learnings, issues, and feature requests so recurring automation conflicts, sensor drift, connectivity failures, safety gaps, and energy opportunities can be reviewed and promoted into safer operating patterns. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Domotics logs can expose sensitive household details such as lock PINs, alarm codes, tokens, Wi-Fi credentials, or occupancy schedules. <br>\nMitigation: Do not log secrets or private household schedules in plaintext; redact sensitive details before sharing logs or generated skills. <br>\nRisk: Optional hook matchers can become too broad and create noisy or poorly scoped reminders. <br>\nMitigation: Keep hooks opt-in and narrow matchers to domotics-specific terms before enabling reminder automation. <br>\nRisk: Generated skill scaffolds may contain incomplete TODOs or unsafe domotics assumptions if enabled without review. <br>\nMitigation: Review and scan generated skill scaffolds before enabling or sharing them, especially for routines involving locks, alarms, gas, water, or heaters. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill release](https://clawhub.ai/jose-compu/self-improving-house) <br>\n- [Domotics Entry Examples](references/examples.md) <br>\n- [Domotics Hook Setup Guide](references/hooks-setup.md) <br>\n- [OpenClaw Integration](references/openclaw-integration.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Markdown, Shell commands, Configuration, Code] <br>\n**Output Format:** [Markdown guidance with inline shell commands, configuration snippets, and optional hook or scaffold code] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Writes or updates local markdown learning logs when the user applies the guidance; optional hooks are reminder-only.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>","readmeExcerpt":"Skill: Self Improving Domotics Owner: jose-compu Summary: Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"mkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Domotics Learnings\\n\\nSensor reliability lessons, automation quality findings, integration regressions, safety gaps, and energy optimization observations.\\n\\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/DOMOTICS_ISSUES.md ] || printf \"# Domotics Issues Log\\n\\nRecurring smart-home failures, rule conflicts, unreliable sensors, unreachable devices, and safety-relevant incidents.\\n\\n---\\n\" > .learnings/DOMOTICS_ISSUES.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Domotics Feature Requests\\n\\nAutomation, observability, reliability, and safety capability requests.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md"},{"language":"bash","snippet":"clawdhub install self-improving-domotics"},{"language":"bash","snippet":"git clone https://github.com/jose-compu/self-improving-domotics.git ~/.openclaw/skills/self-improving-domotics"},{"language":"text","snippet":"~/.openclaw/workspace/\n├── AGENTS.md / SOUL.md / TOOLS.md / MEMORY.md\n├── memory/YYYY-MM-DD.md\n└── .learnings/{LEARNINGS.md, DOMOTICS_ISSUES.md, FEATURE_REQUESTS.md}"},{"language":"bash","snippet":"mkdir -p ~/.openclaw/workspace/.learnings"},{"language":"bash","snippet":"cp -r hooks/openclaw ~/.openclaw/hooks/self-improving-domotics\nopenclaw hooks enable self-improving-domotics"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: self-improving-domotics\ndescription: \"Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud or local integrations break, (5) Occupancy detection is inconsistent with reality, (6) Latency causes delayed or jittery automations, (7) Energy usage patterns are inefficient, (8) Safety automations need stronger guardrails.\"\n---\n\n# Self-Improving Domotics Skill\n\nLog domotics-specific learnings, issues, and feature requests to markdown files for continuous improvement of smart home systems.\n\nThis skill is documentation and reminder guidance only. It does not execute physical actuator actions directly.\n\nAlways prefer safe defaults and human confirmation for high-impact routines involving door locks, alarms, gas or water shutoff, and heaters.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure `.learnings/` exists in the project or workspace root and contains the required files:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Domotics Learnings\\n\\nSensor reliability lessons, automation quality findings, integration regressions, safety gaps, and energy optimization observations.\\n\\n**Categories**: automation_conflict | sensor_drift | device_unreachable | integration_break | energy_optimization | safety_rule_gap | occupancy_mismatch | latency_jitter\\n**Areas**: lighting | climate | security | access_control | energy | sensors | routines | voice_assistants | integrations | network\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/DOMOTICS_ISSUES.md ] || printf \"# Domotics Issues Log\\n\\nRecurring smart-home failures, rule conflicts, unreliable sensors, unreachable devices, and safety-relevant incidents.\\n\\n---\\n\" > .learnings/DOMOTICS_ISSUES.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Domotics Feature Requests\\n\\nAutomation, observability, reliability, and safety capability requests.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. The commands are no-op when already initialised.\n\nDo not log secrets, access tokens, lock PINs, alarm codes, network credentials, or personal household schedules in plain text.\n\nIf automatic reminders are needed, enable hook integration (opt-in) in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Two automations fire opposite commands | Log in `.learnings/DOMOTICS_ISSUES.md` as `automation_conflict` |\n| Zigbee/Z-Wave devices intermittently disappear | Log issue as `device_unreachable` with radio and topology details |\n| Occupancy says \"home\" while house is empty | Log learning as `occupancy_mismatch` and add confidence notes |\n| HVAC oscillates around target temperature | Log learning a"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn78jat5kd20evgyxzp9dmryax84qap0\",\n  \"slug\": \"self-improving-house\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1787945176220\n}"},{"path":"references/examples.md","content":"# Domotics Entry Examples\n\nConcrete examples for `LRN`, `DOM`, and `FEAT` entries.\n\n## Example 1: Conflicting Automations (Lighting)\n\n```markdown\n## [DOM-20260413-001] hallway_light_conflict\n\n**Logged**: 2026-04-13T19:10:00Z\n**Priority**: high\n**Status**: pending\n**Area**: lighting\n\n### Summary\nNight motion routine turns hallway lights on while sleep routine turns them off every 20 seconds.\n\n### Incident Timeline\n| Time | Event |\n|------|-------|\n| T+0m | Motion trigger fires after 23:00 |\n| T+1m | Sleep routine \"all-off\" executes |\n| T+2m | Motion retriggers and loop starts |\n\n### Root Cause\nOverlapping conditions without precedence or cooldown.\n\n### Prevention\nAdd precedence: sleep mode dominates. Add 120s cooldown.\n\n---\n```\n\n## Example 2: Occupancy False Positive\n\n```markdown\n## [LRN-20260413-001] occupancy_mismatch\n\n**Logged**: 2026-04-13T19:30:00Z\n**Priority**: high\n**Status**: pending\n**Area**: sensors\n\n### Summary\nHome marked occupied due to stale BLE beacon, preventing alarm arming.\n\n### Details\nPresence remained true for 9 hours after all residents left.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes\n- Human confirmation required: yes\n- Fallback on uncertainty: notify-only\n\n### Metadata\n- Pattern-Key: occupancy.stale_ble_presence\n\n---\n```\n\n## Example 3: HVAC Overshoot\n\n```markdown\n## [LRN-20260413-002] latency_jitter\n\n**Logged**: 2026-04-13T20:00:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: climate\n\n### Summary\nHVAC overshoots target by 2.3C due to delayed temperature updates and aggressive rule.\n\n### Suggested Action\nUse moving average from two sensors + minimum runtime and cooldown.\n\n---\n```\n\n## Example 4: Lock Automation Safety Guard\n\n```markdown\n## [LRN-20260413-003] safety_rule_gap\n\n**Logged**: 2026-04-13T20:15:00Z\n**Priority**: critical\n**Status**: pending\n**Area**: access_control\n\n### Summary\nAuto-unlock at arrival can trigger from low-confidence geofence event.\n\n### Safe Operating Notes\n- High-impact actuator involved: yes\n- Human confirmation required: yes\n- Fallback on uncertainty: no action\n\n### Suggested Action\nRequire dual signal (geofence + BLE) and explicit user confirmation after 22:00.\n\n---\n```\n\n## Example 5: Integration API Change\n\n```markdown\n## [DOM-20260413-002] weather_api_schema_break\n\n**Logged**: 2026-04-13T21:00:00Z\n**Priority**: high\n**Status**: pending\n**Area**: integrations\n\n### Summary\nWeather provider changed `temp_c` to `temperature.celsius`, breaking climate preheat routine.\n\n### Root Cause\nIntegration parser had hard-coded field names and no schema version checks.\n\n### Prevention\nAdd schema validation, feature flags, and fallback parser.\n\n---\n```\n\n## Example 6: Energy Optimization Pattern\n\n```markdown\n## [LRN-20260413-004] energy_optimization\n\n**Logged**: 2026-04-13T21:20:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: energy\n\n### Summary\nShifting water heater preheat outside peak tariff reduced daily usage cost by 14%.\n\n### Details\nPreheat moved from 18:00 to 16:30 with o"},{"path":"references/hooks-setup.md","content":"# Domotics Hook Setup Guide\n\nConfigure optional hooks for domotics self-improvement reminders.\n\n## Overview\n\nHooks help maintain logging discipline:\n- `UserPromptSubmit`: injects reminder to evaluate `LRN` / `DOM` / `FEAT`\n- `PostToolUse (Bash)`: scans tool output for high-signal domotics failure patterns\n\nAll hooks are reminder-only and must not execute direct physical actions.\n\n## Claude Code Setup\n\nCreate `.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"sensor|actuator|automation|iot|scene|device|home.?assistant\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improving-domotics/scripts/activator.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improving-domotics/scripts/error-detector.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Codex Setup\n\nUse equivalent settings file and same script paths.\n\n## Verification\n\n```bash\nchmod +x ./skills/self-improving-domotics/scripts/*.sh\nbash -n ./skills/self-improving-domotics/scripts/activator.sh\nbash -n ./skills/self-improving-domotics/scripts/error-detector.sh\nbash -n ./skills/self-improving-domotics/scripts/extract-skill.sh\n```\n\nStart a new session and confirm reminder tags appear.\n\n## Troubleshooting\n\n1. Check script permissions.\n2. Validate relative paths from project root.\n3. Restart the session after hook config changes.\n4. If overhead is too high, keep only `UserPromptSubmit`.\n\n## Safety Notes\n\n- Hook output should stay concise.\n- Avoid logging secrets, lock codes, or personal occupancy schedules.\n- Keep automation commands out of hook scripts; reminders only."},{"path":"references/openclaw-integration.md","content":"# OpenClaw Integration (Domotics)\n\nComplete setup for `self-improving-domotics` in OpenClaw.\n\n## Install\n\n```bash\nclawdhub install self-improving-domotics\n```\n\nManual alternative:\n\n```bash\ngit clone https://github.com/jose-compu/self-improving-domotics.git ~/.openclaw/skills/self-improving-domotics\n```\n\n## Optional Hook\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improving-domotics\nopenclaw hooks enable self-improving-domotics\n```\n\n## Workspace Files\n\nEnsure:\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nRequired files:\n- `LEARNINGS.md`\n- `DOMOTICS_ISSUES.md`\n- `FEATURE_REQUESTS.md`\n\n## Promotion Targets\n\n- Home automation playbooks\n- Device compatibility matrix\n- Automation rule library\n- Safety automations\n\n## Detection Focus\n\n- Rule conflict and automation loops\n- Sensor drift and stale occupancy\n- Device offline / unreachable behavior\n- Integration/webhook/API regressions\n- Latency and schedule miss patterns\n- Energy optimization opportunities\n- Safety rule gaps for high-impact routines\n\n## Safety Boundary\n\nThis integration captures reminders and documentation only.\nIt does not execute direct physical actuator actions.\nHuman confirmation is required for lock/alarm/gas/water/heater high-impact routines."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud or local integrations break, (5) Occupancy detection is inconsistent with reality, (6) Latency causes delayed or jittery automations, (7) Energy usage patterns are inefficient, (8) Safety automations need stronger guardrails. Skill: Self Improving Domotics Owner: jose-compu Summary: Captures smart-home automation conflicts, sensor drift, device connectivity failures, integration regressions, safety rule gaps, and energy optimization opportunities for continuous domotics improvement. Use when: (1) Automations conflict, loop, or misfire, (2) Sensors become stale or inaccurate, (3) Devices are unreachable or intermittently offline, (4) Cloud","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1025,"uniquenessScore":49,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T09:51:02.581Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T09:51:02.581Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:14:59.399Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}