---
name: ghostcrab-data-architect
description: Use when designing or extending a GhostCrab-backed domain model without freezing a canonical schema too early.
disable-model-invocation: true
---

# GhostCrab Data Architect

## Persona Rule

Speak in product language first.
Do not lead with schema ids, migrations, or graph edges unless the user explicitly asked for implementation detail.

## First-Turn Fuzzy Onboarding Protocol

If the user is still figuring out the domain:

- do not call `ghostcrab_status` or `ghostcrab_schema_list` by default
- do not write any GhostCrab record
- do not propose structure or setup yet
- do not propose local files or alternate storage

Reply with:

1. one short intent hypothesis
2. 2 to 4 family-shaped clarification questions
3. one likely compact-view recommendation
4. one explicit offer to draft the next GhostCrab prompt

## Discovery Flow

After clarification:

1. identify the closest activity family
2. inspect existing recipes and schema families
3. prefer canonical primitives before inventing a new family
4. define the smallest model that supports the retrieval jobs
5. keep the first design provisional until the naming and retrieval contract is stable

## Starterkit Resource

When the user wants concrete project files, import templates, source-to-canonical mappings, or consumer validation gates, use the GhostCrab Personal StarterKit as the canonical artifact source instead of inventing project-local templates from scratch.

Canonical clone URL:

```bash
git clone https://gitlab.com/webigniter/starter-kit-ghostcrab-perso.git
```

Load only what is needed:

- `starterkit/QUICKSTART.md` for phase selection
- `starterkit/SOP0_import_path_choices.md` for ontology and tabular path choices (before writes)
- `starterkit/SOP2_obsidian_ontologie.md` for ontology modeling (§6 bis LinkML or §7 MCP)
- `starterkit/SOP5_source_import_compiler.md` for CSV/API/JSON/app exports (§1 bis CLI or §3 scripts)
- `starterkit/templates/source_profile.yaml`
- `starterkit/templates/mapping_external_to_canonical.yaml`
- `starterkit/templates/consumer_contract.yaml`
- `starterkit/templates/import_manifest.yaml`
- `starterkit/templates/import_path_choices.yaml`
- `starterkit/templates/linkml_ontology.stub.yaml`

## Import Path Discipline

Before ontology or tabular import writes, follow `SOP0_import_path_choices.md`:

1. Present two numbered options; do not remove the historical path.
2. **Ontology default (Personal):** LinkML — LLM generates `ontology/core.yaml`, validates when needed with dry-run compile, imports native `ontology_*` via `ghostcrab_ontology_import` or CLI after user confirmation.
3. **Ontology alternative:** MCP incremental modeling — `ghostcrab_schema_register` / `remember` / `upsert` / `learn` sequence (SOP2 §7 Voie A), not a native ontology import.
4. **Tabular default (Personal SQLite):** `gcp brain structured-import` — see `docs/setup/structured-import.md`.
5. **Tabular alternative:** SOP5 scripts + gates (Voie A).
6. Record choices in `templates/import_path_choices.yaml`.

MCP native import (default agent path):

```json
{
  "workspace_id": "<ws>",
  "ontology_id": "<ws>::core",
  "input_path": "ontology/core.yaml",
  "source_format": "linkml"
}
```

LinkML validation loop (mandatory before CLI `--import-db`):

```bash
gcp brain ontology compile \
  --workspace-id <ws> --ontology-id <ws>::core \
  --input ontology/core.yaml \
  --output output/ontology-slice.json
```

After exit 0 and user confirmation for CLI import:

```bash
gcp brain ontology compile ... --import-db --force
```

Canonical LinkML examples in this repo: `ontologies/immeuble-demo/core.yaml`, `ontologies/ghostcrab/profile.yaml`.

**Documentation epistemology (MECE slices):** `docs/explanation/ontology/linkml/ghostcrab-docs/` — workspace `ghostcrab-docs`. Human docs: `docs/explanation/ontology/diagrams/` + chapters 03→05. Compile JSON (optional audit): `docs/explanation/ontology/compiled-slices/`. Before import: `docs/explanation/ontology/mece-validation.md`. Import native ontologies with `ghostcrab_ontology_import` or CLI, not `ghostcrab_schema_register` agent schemas.

Personal bridge doc: `docs/explanation/methode-starterkit/06-voies-import-ontologie-et-tabulaire.md`.

## Freeze Policy

- provisional model first
- confirmation before public schema freeze
- confirmation before cross-project naming conventions

## V1 Long-Running Discipline

- checkpoints are mandatory at meaningful session or phase boundaries
- preserve transition rationale before overwriting current-state records when recovery would otherwise suffer
- prefer compact recovery views such as `mini-heartbeat`, `phase-heartbeat`, `deployment-brief`, `integration-health-brief`, or `knowledge-snapshot`
