instinct-lifecycle

Full lifecycle management for clarc instincts — capture, scoring, decay, conflict resolution, promotion, and removal

8 stars

Best use case

instinct-lifecycle is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Full lifecycle management for clarc instincts — capture, scoring, decay, conflict resolution, promotion, and removal

Teams using instinct-lifecycle should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/instinct-lifecycle/SKILL.md --create-dirs "https://raw.githubusercontent.com/marvinrichter/clarc/main/skills/instinct-lifecycle/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/instinct-lifecycle/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How instinct-lifecycle Compares

Feature / Agentinstinct-lifecycleStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Full lifecycle management for clarc instincts — capture, scoring, decay, conflict resolution, promotion, and removal

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Instinct Lifecycle Skill

## Overview

Instincts in clarc accumulate over time via `/learn-eval`. Without lifecycle
management, stale and noisy instincts dilute the signal from useful ones.

This skill covers the complete lifecycle:

```
Capture → Score → Validate → Decay (if stale) → Promote (if high-confidence)
```

---

## Lifecycle Step Sequence

Follow this sequence to actively manage instincts — don't just let them accumulate passively:

### Phase 1: Capture (automatic)
- Sessions run → `/learn-eval` observes patterns → instincts created at `confidence: 0.60`
- No action needed. Instincts appear in `~/.claude/homunculus/projects/<hash>/instincts/`

### Phase 2: Score (manual, weekly)
1. Run `/instinct-report` to see the ranked list with trend indicators (↑↓→)
2. For each instinct that influenced your work this week, record an outcome:
   - `/instinct-outcome <id> good` — it helped
   - `/instinct-outcome <id> bad` — it caused problems
   - `/instinct-outcome <id> neutral` — it was applied but had no clear effect

### Phase 3: Validate (on conflict or confusion)
1. Run `/instinct-status` to check for conflicts
2. If conflicts shown: run `/evolve` to cluster and resolve them
3. Contradictory instincts surface as pairs — pick one or merge them

### Phase 4: Promote (when confidence ≥ 0.80 and usage ≥ 5)
1. Run `/instinct-report` — top-confidence instincts are promotion candidates
2. If an instinct appears in 2+ projects: run `/instinct-promote` to make it global
3. Optional: run `/instinct-promote --auto --dry-run` to review all candidates at once
4. Optional: run `/evolve` to cluster related high-confidence instincts into a skill or command

### Phase 5: Retire (automatic + manual)
- **Automatic**: unused 180+ days at < 0.50 confidence → auto-archived
- **Manual**: run `/instinct-report` → look for LOW CONFIDENCE section → archive via `/instinct-outcome <id> bad` (speeds up decay) or delete YAML file directly

**Cadence recommendation:**
- Weekly: run `/instinct-report` + record outcomes for work done that week
- Monthly: run `/evolve` to cluster and `/instinct-promote` to promote global patterns
- Quarterly: review archived instincts, delete permanently if no longer relevant

---

## Instinct Schema (v2)

Every instinct YAML file has these fields:

```yaml
---
id: test-first-workflow
trigger: "when writing new features"
confidence: 0.75
domain: testing
scope: project
created: 2026-01-15
last_used: 2026-03-08
usage_count: 12
positive_outcomes: 9
negative_outcomes: 1
neutral_outcomes: 2
decay_rate: standard
conflicts_with: ""
---

## Action
Always write a failing test before writing implementation code.

## Evidence
TDD catches integration issues early and improves design.
```

### Schema Migration

Existing instincts without the v2 fields can be migrated:

```bash
node scripts/instinct-schema-migrate.js            # preview
node scripts/instinct-schema-migrate.js --apply    # apply
```

---

## Confidence Model

### Initial State

```
created:          confidence = 0.60 (default from /learn-eval quality gate)
```

### Outcome Signals

| Signal  | Confidence change | When to use |
|---------|-------------------|-------------|
| `good`  | +0.05 (max 0.95)  | Instinct led to better outcome |
| `bad`   | -0.10 (min 0.10)  | Instinct caused problems or was wrong |
| `neutral` | no change       | Instinct was applied but outcome neutral |

Record via `/instinct-outcome <id> good|bad|neutral`.

### Decay (Automatic, Weekly)

| Condition | Effect |
|-----------|--------|
| Unused 30–89 days | confidence -= 0.02/week |
| Unused 90–179 days | Flagged in `/instinct-report` |
| Unused 180+ days AND confidence < 0.50 | Auto-archived |

Decay runs automatically at session end (SessionEnd hook, weekly gate).

### Promotion Threshold

An instinct qualifies for global promotion when:
- `confidence >= 0.80` AND `usage_count >= 5`
- Appears in 2+ projects (via `/instinct-promote --auto`)

Run `/instinct-promote` or `/instinct-promote --auto --dry-run` to review candidates.

### Deletion / Archiving

Instincts are **never automatically deleted** — they are archived:
- Archive path: `~/.claude/homunculus/.../archived/`
- Review archived instincts with `ls ~/.claude/homunculus/*/archived/`
- Permanently remove only after manual review

---

## Commands Reference

| Command | Description |
|---------|-------------|
| `/instinct-status` | Show all instincts with confidence bars |
| `/instinct-report` | Ranked list with trend indicators (↑↓→) |
| `/instinct-outcome <id> <good\|bad\|neutral>` | Record outcome for an instinct |
| `/evolve` | Cluster instincts into skills/commands/agents |
| `/instinct-export` | Export instincts for team sharing |
| `/instinct-import` | Import team instincts |

---

## Conflict Detection

Conflicts are detected when two instincts in the same domain contain
antonymous keywords (e.g., "prefer functional" vs "prefer class-based").

Conflicts are detected automatically during `/evolve` and `/instinct-status`.
Conflict report is stored in `~/.claude/homunculus/conflicts.json`.

**Resolution options:**
1. `/evolve` — review and choose which to keep
2. `/instinct-outcome <losing-id> bad` — reduce confidence of wrong instinct
3. `conflict-detector.py --fix` — auto-remove lower-confidence instinct

---

## Flywheel: Full Weekly Workflow

```
Monday (automatic on session end):
  1. instinct-decay.js — decay stale instincts
  2. weekly-evolve digest — suggest /evolve run

During the week:
  3. /instinct-outcome <id> good|bad — record outcomes after noticing instinct impact
  4. /instinct-report — review confidence ranking

Monthly:
  5. /evolve — cluster high-confidence instincts into skills/commands
  6. /instinct-promote --auto --dry-run — review global promotion candidates
  7. Remove archived instincts that are no longer relevant
```

---

## Troubleshooting

**Instinct confidence not updating:**
- Ensure the instinct file has the v2 schema fields (`node scripts/instinct-schema-migrate.js --stats`)
- Run `node scripts/instinct-outcome-tracker.js --list` to verify instinct IDs

**Decay not running:**
- Check `~/.claude/homunculus/last-decay.json` for last run date
- Force decay: `node scripts/instinct-decay.js --force --dry-run`

**Conflicts not detected:**
- Run `python3 skills/continuous-learning-v2/scripts/conflict-detector.py` directly
- Check `~/.claude/homunculus/conflicts.json`

**Archived instinct recovery:**
- Copy from `~/.claude/homunculus/.../archived/` back to `personal/`

Related Skills

product-lifecycle

8
from marvinrichter/clarc

Full product development lifecycle from raw idea to shipped implementation. Covers idea capture, evaluation (Go/No-Go), solution design (ADR), PRD writing, and handoff to the implementation pipeline. Prevents building the wrong thing.

zero-trust-patterns

8
from marvinrichter/clarc

Zero-Trust security patterns — mTLS between microservices (Istio/SPIFFE), SPIRE workload identity, OPA/Envoy authorization, NetworkPolicy default-deny-all, short-lived credentials, service mesh security, and Kubernetes RBAC hardening.

wireframing

8
from marvinrichter/clarc

Wireframing and prototyping workflow: fidelity levels (lo-fi sketch → mid-fi wireframe → hi-fi prototype), tool selection (Figma, Excalidraw, Balsamiq), user flow diagrams, wireframe annotation standards, information architecture (IA) mapping, and the handoff from wireframe to visual design. For developers who need to communicate UI structure before writing code.

webrtc-patterns

8
from marvinrichter/clarc

WebRTC patterns — peer connection setup, ICE/STUN/TURN configuration, signaling server design, SFU vs mesh topology, screen sharing, media track management, and reconnect/ICE restart handling.

webhook-patterns

8
from marvinrichter/clarc

Webhook patterns for receiving, verifying (HMAC), and idempotently processing third-party events. Covers Stripe, GitHub, and generic webhook patterns, delivery guarantees, retry handling, and testing.

web-performance

8
from marvinrichter/clarc

Web performance optimization: Core Web Vitals (LCP, CLS, INP), Lighthouse CI with budget configuration, bundle analysis (webpack-bundle-analyzer, vite-bundle-visualizer), hydration performance, network waterfall reading, image optimization (WebP/AVIF, srcset), and font performance.

wasm-performance

8
from marvinrichter/clarc

WebAssembly performance: wasm-opt binary optimization, size reduction (panic=abort, LTO, strip), profiling WASM in Chrome DevTools, memory management (linear memory, avoiding GC pressure), SIMD, and multi-threading with SharedArrayBuffer.

wasm-patterns

8
from marvinrichter/clarc

WebAssembly patterns: wasm-pack, wasm-bindgen (JS↔Wasm interop), WASI, Component Model, wasm-opt, Rust-to-WASM compilation, JS integration (web workers, streaming instantiation), and production deployment (CDN, Content-Type headers).

visual-testing

8
from marvinrichter/clarc

Visual Regression Testing: tool comparison (Chromatic/Percy/Playwright screenshots/BackstopJS), pixel-diff vs AI-based comparison, baseline management, flakiness strategies (masks, tolerances, waitForLoadState), CI integration with GitHub Actions, and Storybook integration.

visual-identity

8
from marvinrichter/clarc

Brand identity development: color palette construction (primary/secondary/semantic/neutral), logo concept brief writing, typeface pairings, brand voice definition, mood board direction, and Brand Guidelines document structure. Use when establishing or evolving a visual brand — not for implementing existing tokens.

ux-micro-patterns

8
from marvinrichter/clarc

UX micro-patterns for every product state: Empty States, Loading States (skeleton screens, spinners, optimistic UI), Error States, Success States, Confirmation Dialogs, Onboarding Flows, and Progressive Disclosure. These patterns apply to every feature — done wrong, they're the biggest source of user confusion.

typography-design

8
from marvinrichter/clarc

Typography as a creative discipline: typeface selection criteria, type pairing (serif + sans, display + body), modular scale systems, line-height and tracking ratios, hierarchy construction, and web/mobile rendering considerations. The decisions behind design tokens, not the tokens themselves.