Przejdź do treści
Biblioteka skilli
AI i agenci · Automatyzacja

continuous-learning-v2

/continuous-learning-v2

Obserwuje sesje przez hooki, ocenia pewność zapisanych reguł i przekształca sprawdzone w umiejętności, komendy lub agentów, oddzielając projekty.

Repozytorium
Nemo-Cli ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
05.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
12
Skrypty
9
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co sprawdzić przed instalacją
  • 9 skryptów w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: agents/observer-loop.sh, agents/session-guardian.sh, agents/start-observer.sh, hooks/observe.sh, scripts/detect-project.sh, scripts/instinct-cli.py, scripts/lib/homunculus-dir.sh, scripts/migrate-homunculus.sh, scripts/test_parse_instinct.py

Co robi i kiedy

Obserwuje sesje przez hooki, ocenia pewność zapisanych reguł i przekształca sprawdzone w umiejętności, komendy lub agentów, oddzielając projekty.

Oryginalny opis (EN)

Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination. Use when capturing lessons from a session, managing instincts, or promoting them into skills, commands, or agents.

Jak działa

  1. When to Activate
  2. What's New in v2.1
  3. What's New in v2 (vs v1)
  4. The Instinct Model
  5. How It Works
  6. Project Detection
  7. Quick Start
  8. Commands
  9. Configuration
  10. File Structure
Sekcje z nagłówków SKILL.md, w oryginale · 386 linii, 1 803 słów
Podgląd SKILL.md
---
name: continuous-learning-v2
description: Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination. Use when capturing lessons from a session, managing instincts, or promoting them into skills, commands, or agents.
metadata:
  version: 2.1.0
  origin: ECC
---

# Continuous Learning v2.1 - Instinct

-Based Architecture

An advanced learning system that turns your Nemo Code sessions into reusable knowledge through atomic "instincts" - small learned behaviors with confidence scoring.

**v2.1** adds **project-scoped instincts** — React patterns stay in your React project, Python conventions stay in your Python project, and universal patterns (like "always validate input") are shared globally.

## When to Activate

- Setting up automatic learning from Nemo Code sessions
- Configuring instinct-based behavior extraction via hooks
- Tuning confidence thresholds for learned behaviors
- Reviewing, exporting, or importing instinct libraries
- Evolving instincts into full skills, commands, or agents
- Managing project-scoped vs global instincts
- Promoting instincts from project to global scope

## What's New in v2.1

| Feature       | v2.0                                | v2.1                                                                                |
| ------------- | ----------------------------------- | ----------------------------------------------------------------------------------- |
| Storage       | Global (`~/.nemo/homunculus/`) | Project-scoped (`${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/projects/<hash>/`) |
| Scope         | All instincts apply everywhere      | Project-scoped + global                                                             |
| Detection     | None                                | git remote URL / repo path                                                          |
| Promotion     | N/A                                 | Project → global when seen in 2+ projects                                           |
| Commands      | 4 (status/evolve/export/import)     | 6 (+promote/projects)                                                               |
| Cross-project | Contamination risk                  | Isolated by default                                                                 |

## What's New in v2 (vs v1)

| Feature     | v1                      | v2                                          |
| ----------- | ----------------------- | ------------------------------------------- |
| Observation | Stop hook (session end) | PreToolUse/PostToolUse (100% reliable)      |
| Analysis    | Main context            | Background agent (Haiku)                    |
| Granularity | Full skills             | Atomic "instincts"                          |
| Confidence  | None                    | 0.3-0.9 weighted                            |
| Evolution   | Direct to skill         | Instincts -> cluster -> skill/command/agent |
| Sharing     | None                    | Export/import instincts                     |

## The Instinct Model

An instinct is a small learned behavior:

```yaml
---
id: prefer-functional-style
trigger: "when writing new functions"
confidence: 0.7
domain: "code-style"
source: "session-observation"
scope: project
project_id: "a1b2c3d4e5f6"
project_name: "my-react-app"
---

# Prefer Functional Style

## Action
Use functional patterns over classes when appropriate.

## Evidence
- Observed 5 instances of functional pattern preference
- User corrected class-based approach to functional on 2025-01-15
```

**Properties:**

- **Atomic** -- one trigger, one action
- **Confidence-weighted** -- 0.3 = tentative, 0.9 = near certain
- **Domain-tagged** -- code-style, testing, git, debugging, workflow, etc.
- **Evidence-backed** -- tracks what observations created it
- **Scope-aware** -- `project` (default) or `global`

## How It Works

```
Session Activity (in a git repo)
      |
      | Hooks capture prompts + tool use (100% reliable)
      | + detect project context (git remote / repo path)
      v
+---------------------------------------------+
|  projects/<project-hash>/observations.jsonl  |
|   (prompts, tool calls, outcomes, project)   |
+---------------------------------------------+
      |
      | Observer agent reads (background, Haiku)
      v
+---------------------------------------------+
|          PATTERN DETECTION                   |
|   * User corrections -> instinct             |
|   * Error resolutions -> instinct            |
|   * Repeated workflows -> instinct           |
|   * Scope decision: project or global?       |
+---------------------------------------------+
      |
      | Creates/updates
      v
+---------------------------------------------+
|  projects/<project-hash>/instincts/personal/ |
|   * prefer-functional.yaml (0.7) [project]   |
|   * use-react-hooks.yaml (0.9) [project]     |
+---------------------------------------------+
|  instincts/personal/  (GLOBAL)               |
|   * always-validate-input.yaml (0.85) [global]|
|   * grep-before-edit.yaml (0.6) [global]     |
+---------------------------------------------+
      |
      | /evolve clusters + /promote
      v
+---------------------------------------------+
|  projects/<hash>/evolved/ (project-scoped)   |
|  evolved/ (global)                           |
|   * commands/new-feature.md                  |
|   * skills/testing-workflow.md               |
|   * agents/refactor-specialist.md            |
+---------------------------------------------+
```

## Project Detection

The system automatically detects your current project:

1. **`NEMO_PROJECT_DIR` env var** (highest priority) -- honored as an explicit override even when the directory is not a git repo (hashed by its absolute path)
2. **`git remote get-url origin`** -- hashed to create a portable project ID (same repo on different machines gets the same ID)
3. **`git rev-parse --show-toplevel`** -- fallback using repo path (machine-specific)
4. **Global fallback** -- if no project is detected, instincts go to global scope

Each project gets a 12-character hash ID (e.g., `a1b2c3d4e5f6`). A registry file at `${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/projects.json` maps IDs to human-readable names.

### Data Directory

Continuous-learning-v2 stores observer data outside `~/.nemo` so Nemo Code's sensitive-path guard does not block background instinct writes:

1. `CLV2_HOMUNCULUS_DIR` when set to an absolute path
2. `$XDG_DATA_HOME/ecc-homunculus`
3. `$HOME/.local/share/ecc-homunculus`

Existing users with data at `~/.nemo/homunculus` can migrate once:

```bash
bash skills/continuous-learning-v2/scripts/migrate-homunculus.sh
```

## Quick Start

### 1. Enable Observation Hooks

**If installed as a plugin** (recommended):

No extra `settings.json` hook block is required. Nemo Code v2.1+ auto-loads the plugin `hooks/hooks.json`, and `observe.sh` is already registered there.

If you previously copied `observe.sh` into `~/.nemo/settings.json`, remove that duplicate `PreToolUse` / `PostToolUse` block. Duplicating the plugin hook causes double execution and `${NEMO_PLUGIN_ROOT}` resolution errors because that variable is only available inside plugin-managed `hooks/hooks.json` entries.

**If installed manually** to `~/.nemo/skills`, add this to your `~/.nemo/settings.json`:

```json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "~/.nemo/skills/continuous-learning-v2/hooks/observe.sh"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "~/.nemo/skills/continuous-learning-v2/hooks/observe.sh"
          }
        ]
      }
    ]
  }
}
```

### 2. Initialize Directory Structure

The system creates directories automatically on first use, but you can also create them manually:

```bash
# Global directories
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/ecc-homunculus"/{instincts/{personal,inherited},evolved/{agents,skills,commands},projects}

# Project directories are auto-created when the hook first runs in a git repo
```

### 3. Use the Instinct Commands

```bash
/instinct-status     # Show learned instincts (project + global)
/evolve              # Cluster related instincts into skills/commands
/instinct-export     # Export instincts to file
/instinct-import     # Import instincts from others
/promote             # Promote project instincts to global scope
/projects            # List all known projects and their instinct counts
```

## Commands

| Command                   | Description                                                        |
| ------------------------- | ------------------------------------------------------------------ |
| `/instinct-status`        | Show all instincts (project-scoped + global) with confidence       |
| `/evolve`                 | Cluster related instincts into skills/commands, suggest promotions |
| `/instinct-export`        | Export instincts (filterable by scope/domain)                      |
| `/instinct-import <file>` | Import instincts with scope control                                |
| `/promote [id]`           | Promote project instincts to global scope                          |
| `/projects`               | List all known projects and their instinct counts                  |

## Configuration

Edit `config.json` to control the background observer:

```json
{
  "version": "2.1",
  "observer": {
    "enabled": false,
    "run_interval_minutes": 5,
    "min_observations_to_analyze": 20
  }
}
```

| Key                                    | Default | Description                                  |
| -------------------------------------- | ------- | -------------------------------------------- |
| `observer.enabled`                     | `false` | Enable the background observer agent         |
| `observer.run_interval_minutes`        | `5`     | How often the observer analyzes observations |
| `observer.min_observations_to_analyze` | `20`    | Minimum observations before analysis runs    |

Other behavior (observation capture, instinct thresholds, project scoping, promotion criteria) is configured via code defaults in `instinct-cli.py` and `observe.sh`.

### Observer platform support

The background observer requires WSL2, Linux, or macOS. On native Windows
(Git Bash / MSYS2) it starts and reports success, but the process is killed
when the spawning hook exits and its Job Object closes, so no analysis ever
runs — setting `observer.enabled: true` there is effectively a no-op
(see issue #2489).

`observe.sh` detects this on the following hook invocation and writes an
explanatory warning to `observer-start.log` once the observer has failed to
survive several times in a row.

| Env var                             | Default | Description                                            |
| ----------------------------------- | ------- | ------------------------------------------------------ |
| `ECC_OBSERVER_NOSURVIVE_WARN_AFTER` | `3`     | Consecutive non-survivals before the warning is logged |

## File Structure

```
${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/
+-- identity.json           # Your profile, technical level
+-- projects.json           # Registry: project hash -> name/path/remote
+-- observations.jsonl      # Global observations (fallback)
+-- instincts/
|   +-- personal/           # Global auto-learned instincts
|   +-- inherited/          # Global imported instincts
+-- evolved/
|   +-- agents/             # Global generated agents
|   +-- skills/             # Global generated skills
|   +-- commands/           # Global generated commands
+-- projects/
    +-- a1b2c3d4e5f6/       # Project hash (from git remote URL)
    |   +-- project.json    # Per-project metadata mirror (id/name/root/remote)
    |   +-- observations.jsonl
    |   +-- observations.archive/
    |   +-- instincts/
    |   |   +-- personal/   # Project-specific auto-learned
    |   |   +-- inherited/  # Project-specific imported
    |   +-- evolved/
    |       +-- skills/
    |       +-- commands/
    |       +-- agents/
    +-- f6e5d4c3b2a1/       # Another project
        +-- ...
```

## Scope Decision Guide

| Pattern Type                   | Scope       | Examples                                                 |
| ------------------------------ | ----------- | -------------------------------------------------------- |
| Language/framework conventions | **project** | "Use React hooks", "Follow Django REST patterns"         |
| File structure preferences     | **project** | "Tests in `__tests__`/", "Components in src/components/" |
| Code style                     | **project** | "Use functional style", "Prefer dataclasses"             |
| Error handling strategies      | **project** | "Use Result type for errors"                             |
| Security practices             | **global**  | "Validate user input", "Sanitize SQL"                    |
| General best practices         | **global**  | "Write tests first", "Always handle errors"              |
| Tool workflow preferences      | **global**  | "Grep before Edit", "Read before Write"                  |
| Git practices                  | **global**  | "Conventional commits", "Small focused commits"          |

## Instinct Promotion (Project -> Global)

When the same instinct appears in multiple projects with high confidence, it's a candidate for promotion to global scope.

**Auto-promotion criteria:**

- Same instinct ID in 2+ projects
- Average confidence >= 0.8

**How to promote:**

```bash
# Promote a specific instinct
python3 instinct-cli.py promote prefer-explicit-errors

# Auto-promote all qualifying instincts
python3 instinct-cli.py promote

# Preview without changes
python3 instinct-cli.py promote --dry-run
```

The `/evolve` command also suggests promotion candidates.

## Confidence Scoring

Confidence evolves over time:

| Score | Meaning      | Behavior                      |
| ----- | ------------ | ----------------------------- |
| 0.3   | Tentative    | Suggested but not enforced    |
| 0.5   | Moderate     | Applied when relevant         |
| 0.7   | Strong       | Auto-approved for application |
| 0.9   | Near-certain | Core behavior                 |

**Confidence increases** when:

- Pattern is repeatedly observed
- User doesn't correct the suggested behavior
- Similar instincts from other sources agree

**Confidence decreases** when:

- User explicitly corrects the behavior
- Pattern isn't observed for extended periods
- Contradicting evidence appears

## Why Hooks vs Skills for Observation?

> "v1 relied on skills to observe. Skills are probabilistic -- they fire ~50-80% of the time based on Nemo's judgment."

Hooks fire **100% of the time**, deterministically. This means:

- Every tool call is observed
- No patterns are missed
- Learning is comprehensive

## Backward Compatibility

v2.1 is fully compatible with v2.0 and v1:

- Existing global instincts can be migrated from `~/.nemo/homunculus/instincts/` with `scripts/migrate-homunculus.sh`
- Existing `~/.nemo/skills/learned/` skills from v1 still work
- Stop hook still runs (but now also feeds into v2)
- Gradual migration: run both in parallel

## Privacy

- Observations stay **local** on your machine
- Project-scoped instincts are isolated per project
- Only **instincts** (patterns) can be exported — not raw observations
- No actual code or conversation content is shared
- You control what gets exported and promoted

## Related

- [ECC-Tools GitHub App](https://github.com/apps/ecc-tools) - Generate instincts from repo history
- Homunculus - Community project that inspired the v2 instinct-based architecture (atomic observations, confidence scoring, instinct evolution pipeline)
- [The Longform Guide](https://x.com/affaanmustafa/status/2014040193557471352) - Continuous learning section

---

_Instinct-based learning: teaching Nemo your patterns, one project at a time._
Pliki w paczce (12)
  • SKILL.md 16 KB
  • config.json 1 KB
  • agents/observer-loop.sh 13 KB
  • agents/observer.md 7 KB
  • agents/session-guardian.sh 6 KB
  • agents/start-observer.sh 8 KB
  • hooks/observe.sh 27 KB
  • scripts/detect-project.sh 11 KB
  • scripts/instinct-cli.py 89 KB
  • scripts/migrate-homunculus.sh 2 KB
  • scripts/test_parse_instinct.py 50 KB
  • scripts/lib/homunculus-dir.sh 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · SHRIJANAGAIN/Nemo-Cli100Apache-2.0
affaan-m/ECC100MIT
ginaservice/ginaservice-skills100MIT
v1truv1us/ai-eng-system100MIT

Migawka bazy z 13.11.2026 · wersja paczki e2a0be250886 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 86self-improving-agent
    Prowadzi system ciągłego uczenia oparty na instynktach: zapisuje atomowe wnioski z oceną pewności, rozróżnia zakres projektowy i globalny oraz rozwija instynkty w skille, komendy i agentów.
  • 95instinct-status
    Pokazuje nauczone instynkty, ich poziom pewności i aktualność, czytając lokalny plik w ~/.aos/instincts/, wyłącznie do odczytu.
  • 95gdd-instinct
    Przegląda i przeszukuje zapamiętane wzorce pracy projektowej, a sprawdzony wzorzec awansuje z projektu do wspólnego zasobu.
  • 95gdd-instinct
    Wyszukuje wzorce projektowe po słowach kluczowych i zarządza nimi w zasobie projektu oraz w zasobie globalnym.
  • 95instinct-import
    Importuje instynkty z innej maszyny lub narzędzia z paczki YAML do lokalnego vaulta, nie nadpisując własnych wpisów.
  • 100evolve
    Promuje nagromadzone instynkty o wysokiej pewności w jednej domenie do komendy, skilla lub agenta i przegląda propozycje w katalogu Instinct Proposals.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.