Xpersona
S

self-improving-science

CLAWHUB · Unverified

Captures learnings, experiment issues, and methodology corrections for continuous improvement in scientific research and ML workflows. Use when: (1) Data leakage detected in train/test split, (2) Model fails to reproduce across seeds or environments, (3) Statistical test misapplied or p-value misinterpreted, (4) Hypothesis test fails or needs revision, (5) Feature distribution shift detected, (6) User corrects methodology or analysis approach, (7) Experiment design flaw discovered. Also review learnings before designing new experiments. Skill: self-improving-science Owner: jose-compu Summary: Captures learnings, experiment issues, and methodology corrections for continuous improvement in scientific research and ML workflows. Use when: (1) Data leakage detected in train/test split, (2) Model fails to reproduce across seeds or environments, (3) Statistical test misapplied or p-value misinterpreted, (4) Hypothesis test fails or needs revision, (5) Feat

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17bzpdy0evfmqz6nx069npr3n84p7f2:self-improving-science
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. 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: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-jose-compu-self-improving-science/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

144,965 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: self-improving-science
description: "Captures learnings, experiment issues, and methodology corrections for continuous improvement in scientific research and ML workflows. Use when: (1) Data leakage detected in train/test split, (2) Model fails to reproduce across seeds or environments, (3) Statistical test misapplied or p-value misinterpreted, (4) Hypothesis test fails or needs revision, (5) Feature distribution shift detected, (6) User corrects methodology or analysis approach, (7) Experiment design flaw discovered. Also review learnings before designing new experiments."
---

# Self-Improving Science Skill

Log learnings, experiment issues, and methodology corrections to markdown files for continuous improvement in scientific research, data science, and ML/AI experimentation. Important findings get promoted to experiment checklists, data governance docs, model cards, and methodology standards.

## First-Use Initialisation

Before logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:

```bash
mkdir -p .learnings
[ -f .learnings/LEARNINGS.md ] || printf "# Learnings\n\nMethodology insights, statistical corrections, and knowledge gaps captured during research.\n\n**Categories**: methodology_flaw | data_quality | reproducibility_issue | statistical_error | hypothesis_revision | experiment_design\n\n---\n" > .learnings/LEARNINGS.md
[ -f .learnings/EXPERIMENT_ISSUES.md ] || printf "# Experiment Issues\n\nFailed experiments, data quality problems, and reproducibility failures.\n\n---\n" > .learnings/EXPERIMENT_ISSUES.md
[ -f .learnings/FEATURE_REQUESTS.md ] || printf "# Feature Requests\n\nResearch tooling and ML pipeline capabilities requested by the user.\n\n---\n" > .learnings/FEATURE_REQUESTS.md
```

Never overwrite existing files. This is a no-op if `.learnings/` is already initialised.

Do not log proprietary datasets, patient identifiers, API keys, or raw data samples unless the user explicitly asks. Prefer summary statistics and redacted excerpts over full data dumps.

If you want automatic reminders or setup assistance, use the opt-in hook workflow described in [Hook Integration](#hook-integration).

## Quick Reference

| Situation | Action |
|-----------|--------|
| Data leakage found in pipeline | Log to `.learnings/EXPERIMENT_ISSUES.md` with `data_quality` |
| Model fails to reproduce | Log to `.learnings/EXPERIMENT_ISSUES.md` with `reproducibility_issue` |
| Statistical test misapplied | Log to `.learnings/LEARNINGS.md` with `statistical_error` |
| Hypothesis test fails | Log to `.learnings/LEARNINGS.md` with `hypothesis_revision` |
| Methodology flaw discovered | Log to `.learnings/LEARNINGS.md` with `methodology_flaw` |
| Experiment design improvement | Log to `.learnings/LEARNINGS.md` with `experiment_design` |
| Feature distribution shift | Log to `.learnings/EXPERIMENT_ISSUES.md` with `data_quality` |
| User wants missing ML tool | Log to `.l

_meta.json

{
  "ownerId": "kn78jat5kd20evgyxzp9dmryax84qap0",
  "slug": "self-improving-science",
  "version": "1.1.2",
  "publishedAt": 1790689028731
}

references/examples.md

# Entry Examples

Concrete examples of well-formatted entries with all fields for scientific research and ML workflows.

## Learning: Data Quality (Target Leakage)

```markdown
## [LRN-20260410-001] data_quality

**Logged**: 2026-04-10T14:30:00Z
**Priority**: critical
**Status**: resolved
**Area**: preprocessing

### Summary
Target leakage through timestamp feature — `event_timestamp` encoded label assignment time

### Details
The `event_timestamp` feature had near-perfect correlation (0.98) with the
target variable `churned`. Investigation revealed the timestamp recorded when
the churn label was applied by the CRM system, not when the user event
occurred. Model achieved 0.99 AUC in validation but 0.52 AUC on live traffic.

### Suggested Action
Audit all timestamp-derived features against the label generation process.
Features must strictly predate the label event. Add a temporal leakage check
to the preprocessing pipeline.

### Metadata
- Source: experiment
- Related Files: notebooks/churn_model_v3.ipynb, src/features/temporal.py
- Tags: leakage, timestamp, churn, target-leakage
- Dataset: customer_events_2025
- Model: XGBoost v1.7.6
- Metric-Before: 0.99 AUC (validation), 0.52 AUC (production)
- Metric-After: 0.81 AUC (validation), 0.79 AUC (production)
- Pattern-Key: leakage.timestamp_target

### Resolution
- **Resolved**: 2026-04-11T09:00:00Z
- **Commit/PR**: #287
- **Notes**: Removed event_timestamp, added temporal_leakage_check() to pipeline

---
```

## Learning: Statistical Error (T-Test on Non-Normal Data)

```markdown
## [LRN-20260408-002] statistical_error

**Logged**: 2026-04-08T11:15:00Z
**Priority**: high
**Status**: promoted
**Promoted**: methodology-standards.md
**Area**: analysis

### Summary
Applied t-test to highly skewed revenue data — normality assumption violated

### Details
Used independent samples t-test to compare revenue between control and
treatment groups in A/B test. Revenue data had skewness of 4.7 and Shapiro-Wilk
p < 0.001. T-test yielded p = 0.03 (significant). After switching to
Mann-Whitney U test, p = 0.12 (not significant). Original conclusion of
"treatment increases revenue" was invalid.

### Suggested Action
Always run Shapiro-Wilk test before parametric tests. For skewed financial
data, default to non-parametric tests or log-transform with justification.
Report both the test choice rationale and assumption check results.

### Metadata
- Source: peer_review
- Related Files: notebooks/ab_test_revenue_q1.ipynb
- Tags: t-test, normality, mann-whitney, skewness, a-b-test
- Dataset: ab_test_revenue_2026q1
- Pattern-Key: stats.normality_assumption

---
```

## Learning: Methodology Flaw (No Holdout for Tuning)

```markdown
## [LRN-20260405-003] methodology_flaw

**Logged**: 2026-04-05T16:45:00Z
**Priority**: high
**Status**: resolved
**Area**: validation

### Summary
Hyperparameter tuning used validation set that was also final evaluation set

### Details
GridSearchCV was run with 5-fold CV on the full dataset mi

references/hooks-setup.md

# Hook Setup Guide (Science)

Configure automatic self-improvement triggers for scientific research and ML workflows.

## Overview

Hooks enable proactive learning capture by injecting reminders at key moments:
- **UserPromptSubmit**: Reminder after matching prompts to evaluate experiment learnings
- **PostToolUse (Bash)**: ML/data error detection when commands fail

## Claude Code Setup

### Option 1: Project-Level Configuration

Create `.claude/settings.json` in your project root:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "experiment|hypothesis|dataset|reproducib|methodology|benchmark",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-science/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Option 2: User-Level Configuration (discouraged)

Do **not** install this hook globally. User-level hooks persist across all repositories and sessions. Keep hooks project-scoped. The example below is shown only so you can recognize and remove it:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "experiment|hypothesis|dataset|reproducib|methodology|benchmark",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/skills/self-improving-science/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

### Minimal Setup (Activator Only)

For lower overhead, use only the UserPromptSubmit hook:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "experiment|hypothesis|dataset|reproducib|methodology|benchmark",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-science/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## Codex CLI Setup

Codex uses the same hook system. Create `.codex/settings.json`:

```json
{
  "hooks": {
    "UserPromptSubmit": [
      {
        "matcher": "experiment|hypothesis|dataset|reproducib|methodology|benchmark",
        "hooks": [
          {
            "type": "command",
            "command": "./skills/self-improving-science/scripts/activator.sh"
          }
        ]
      }
    ]
  }
}
```

## GitHub Copilot Setup

Copilot doesn't support hooks directly. Add guidance to `.github/copilot-instructions.md`:

```markdown
## Self-Improvement (Science)

After completing tasks that involved:
- Debugging data quality issues or leakage
- Fixing statistical test misapplication
- Resolving model training failures
- Discovering reproducibility problems
- Revising hypotheses based on results

Consider logging the learning to `.learnings/` using the self-improving-science format.

For high-value learnings, promote to experiment checklists, model cards, or methodology standards.
```

## Verification

### Test Activator Hook

1. Enable the hook configuration
2. Start a new Claude Code session
3. Send a prompt that matches the domain matcher
4. Verif

references/openclaw-integration.md

# OpenClaw Integration (Science)

Complete setup and usage guide for integrating the self-improving science skill with OpenClaw.

## Overview

OpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.

## Workspace Structure

```
~/.openclaw/
├── workspace/                   # Working directory
│   ├── AGENTS.md               # Experiment orchestration, pipeline patterns
│   ├── SOUL.md                 # Research rigor principles, communication style
│   ├── TOOLS.md                # ML framework gotchas, data tool capabilities
│   ├── MEMORY.md               # Long-term memory (main session only)
│   └── memory/                 # Daily memory files
│       └── YYYY-MM-DD.md
├── skills/                      # Installed skills
│   └── self-improving-science/
│       └── SKILL.md
└── hooks/                       # Custom hooks
    └── self-improving-science/
        ├── HOOK.md
        └── handler.ts
```

## Quick Setup

### 1. Install the Skill

```bash
clawdhub install self-improving-science
```

Or copy manually:

```bash
cp -r self-improving-science ~/.openclaw/skills/
```

### 2. Install the Hook (Optional)

Copy the hook to OpenClaw's hooks directory:

```bash
mkdir -p .openclaw/hooks
cp -r hooks/openclaw .openclaw/hooks/self-improving-science
```


### 3. Create Learning Files

Create the `.learnings/` directory in your workspace:

```bash
mkdir -p ~/.openclaw/workspace/.learnings
```

## Injected Prompt Files

### AGENTS.md (Science-Oriented)

Purpose: Experiment orchestration and ML pipeline patterns.

```markdown
# Experiment Orchestration

## Pipeline Rules
- Run data validation before any training step
- Log all hyperparameters and random seeds
- Use experiment tracking (MLflow, W&B) for all runs

## Delegation Rules
- Do not spawn sub-agents or read other sessions from this skill
- Log a redacted note in this workspace only
- Do not send cross-session messages
```

### SOUL.md (Science-Oriented)

Purpose: Research rigor and communication guidelines.

```markdown
# Research Principles

## Scientific Rigor
- Report confidence intervals, not just point estimates
- Distinguish correlation from causation
- Acknowledge limitations explicitly

## Scope

This skill does not read other sessions, send cross-session messages, spawn background agents, or read other installed skills. Log redacted notes in this workspace only.

## PyTorch
- DataLoader workers leak memory on macOS — use num_workers=0 for debugging
- torch.use_deterministic_algorithms(True) for reproducibility

## scikit-learn
- Pipeline must wrap preprocessing for proper CV
- StratifiedKFold for imbalanced classes

## pandas
- .copy() after slicing to avoid SettingWithCopyWarning
- Use .astype("category") for memory efficiency on categoricals
```

## Learning Workflow

### Capturing Learnings

1. **In-session**: Log to `.learnings/` as usual
2. **Cross-session*

Sponsored

Ads related to self-improving-science and adjacent AI workflows.