Files

115 lines
2.8 KiB
Markdown
Raw Permalink Normal View History

---
name: instinct-import
2026-03-02 04:07:13 +08:00
description: Import instincts from file or URL into project/global scope
command: true
---
# Instinct Import Command
## Implementation
Run the instinct CLI using the plugin root path:
```bash
2026-03-02 04:07:13 +08:00
python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" import <file-or-url> [--dry-run] [--force] [--min-confidence 0.7] [--scope project|global]
```
Or if `CLAUDE_PLUGIN_ROOT` is not set (manual installation):
```bash
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import <file-or-url>
```
2026-03-02 04:07:13 +08:00
Import instincts from local file paths or HTTP(S) URLs.
## Usage
```
/instinct-import team-instincts.yaml
/instinct-import https://github.com/org/repo/instincts.yaml
2026-03-02 04:07:13 +08:00
/instinct-import team-instincts.yaml --dry-run
/instinct-import team-instincts.yaml --scope global --force
```
## What to Do
1. Fetch the instinct file (local path or URL)
2. Parse and validate the format
3. Check for duplicates with existing instincts
4. Merge or add new instincts
2026-03-02 04:07:13 +08:00
5. Save to inherited instincts directory:
- Project scope: `~/.claude/homunculus/projects/<project-id>/instincts/inherited/`
- Global scope: `~/.claude/homunculus/instincts/inherited/`
## Import Process
```
2026-03-29 08:59:06 -04:00
Importing instincts from: team-instincts.yaml
================================================
Found 12 instincts to import.
Analyzing conflicts...
## New Instincts (8)
These will be added:
✓ use-zod-validation (confidence: 0.7)
✓ prefer-named-exports (confidence: 0.65)
✓ test-async-functions (confidence: 0.8)
...
## Duplicate Instincts (3)
Already have similar instincts:
2026-03-29 08:59:06 -04:00
WARNING: prefer-functional-style
Local: 0.8 confidence, 12 observations
Import: 0.7 confidence
→ Keep local (higher confidence)
2026-03-29 08:59:06 -04:00
WARNING: test-first-workflow
Local: 0.75 confidence
Import: 0.9 confidence
→ Update to import (higher confidence)
2026-03-02 04:07:13 +08:00
Import 8 new, update 1?
```
2026-03-02 04:07:13 +08:00
## Merge Behavior
2026-03-02 04:07:13 +08:00
When importing an instinct with an existing ID:
- Higher-confidence import becomes an update candidate
- Equal/lower-confidence import is skipped
- User confirms unless `--force` is used
## Source Tracking
Imported instincts are marked with:
```yaml
2026-03-02 04:07:13 +08:00
source: inherited
scope: project
imported_from: "team-instincts.yaml"
2026-03-02 04:07:13 +08:00
project_id: "a1b2c3d4e5f6"
project_name: "my-project"
```
## Flags
- `--dry-run`: Preview without importing
2026-03-02 04:07:13 +08:00
- `--force`: Skip confirmation prompt
- `--min-confidence <n>`: Only import instincts above threshold
2026-03-02 04:07:13 +08:00
- `--scope <project|global>`: Select target scope (default: `project`)
## Output
After import:
```
2026-03-29 08:59:06 -04:00
PASS: Import complete!
Added: 8 instincts
Updated: 1 instinct
2026-03-02 04:07:13 +08:00
Skipped: 3 instincts (equal/higher confidence already exists)
New instincts saved to: ~/.claude/homunculus/instincts/inherited/
Run /instinct-status to see all instincts.
```