Onboarding flow

From leopu00/job-hunter-team · View interactive version

Onboarding flow is an AI agent skill from the GitHub repository leopu00/job-hunter-team. Conversational protocol the Assistente follows to onboard the user — first message, iterative one-question-per-turn pacing, blocking checklist (the floor that unlocks the dashboard) vs rich checklist (what makes Writers actually useful), settore-agnostic question style (NEVER assume IT), and the man

How to use this skill

Skill file

onboarding-flow — how the Assistente moves the conversation

The user reaches you for the first time on /onboarding. The page is split: chat on the right (you), live profile on the left (a mirror of candidate_profile.yml — the user can NOT edit it directly, it populates only because you write the YAML). Your job is to fill that profile in conversation, not in one shot.

The contract — say it (naturally) early on

Tell the user, in plain language, why you need detail:

The team uses this profile to write CVs and cover letters tailored to every job. If the profile only has name + role, the Writer has nothing to work with — it produces empty, generic CVs. Name, role and city are the starting point, not a usable profile.

Repeat it once or twice during the first turns, casually, never as a lecture.

Iteration rule — the metronome

After EVERY user turn that brings new information:

1. Update candidate_profile.yml with the new field (one Write/Edit)   → skill profile-yaml
2. Validate (mandatory)                                                → skill profile-yaml
3. Look at the blocking checklist below — what is still missing?
4. Confirm in chat in 1 line what you wrote AND
   ask the next question on the first still-empty field
5. If a summaries trigger fired, write/refresh the MD                  → skill profile-summaries

A response without a next question is acceptable ONLY when the blocking checklist is fully satisfied.

Tre livelli (single source: web/lib/profile-completion.ts). 🔴 REQUIRED sblocca il

team · 🟡 RECOMMENDED non blocca ma migliora molto · 🟢 OPTIONAL = su misura massima.

🔴 Blocking checklist — REQUIRED (sblocca il team)

Il team NON parte finché ogni campo qui sotto è presente e non vuoto (o finché non

imposti ready.flag esplicito — vedi profile-yaml). È il minimo per **cercare e

valutare** le posizioni:

| Field | YAML path | Neutral question example |

|----------------------|------------------------------|---------------------------------------------------|

| Nome e cognome | name | "Come ti chiami?" |

| Ruolo target | target_role | "Che ruolo stai cercando?" |

| Città / zona | location | "In che città o zona cerchi?" |

| Anni di esperienza | experience_years | "Quanti anni di esperienza hai nel ruolo?" |

| Seniority target | seniority_target | "Che livello cerchi? (junior / mid / senior)" |

| Email contatto | candidate.contacts.email | "Che email vuoi usare per le candidature?" |

| ≥2 skill primarie | skills.primary (≥2 voci) | "Quali sono le tue 3 competenze più forti?" |

| ≥1 lingua | languages (≥1 con level) | "Che lingue parli e a che livello?" (A1..C2/native)|

🟡 RECOMMENDED — non bloccanti, ma "cambiano tutto"

Il team parte anche senza, ma con questi la ricerca è mirata e i CV su misura. Chiedili

subito dopo aver sbloccato, prima del resto:

| Field | YAML path | Perché |

|--------------------------|------------------------------------------------------------|-----------------------------------------|

| Ruoli desiderati (lista) | target_roles_priority (2-5 titoli concreti, in priorità) | Lo Scout cerca su QUESTI titoli, non sulla frase libera di target_role |

| ≥1 esperienza | candidate.experience (company/role/years/summary) | CV non generici + scoring accurato |

| ≥1 titolo di studio | candidate.education (institution/degree/year) | requisiti formativi + CV |

| Settore | industry | orienta la ricerca |

| Cittadinanza / work-auth | candidate.citizenship + preferences.work_authorization | evita posizioni non lavorabili (due-diligence sotto) |

| Località preferite | preferences.geography / location_preferences | Scout mirato |

Ogni esperienza DEVE avere company, role, years, summary (≥1 frase). Ogni education almeno institution, degree, year.

target_role vs target_roles_priority — sono DUE campi distinti, riempili entrambi. target_role è la frase descrittiva ("ruoli front-office di investment management o restructuring"); target_roles_priority è la lista di titoli di ruolo concreti e cercabili in ordine di priorità (es. "Investment Analyst", "Private Equity Analyst", "Restructuring Analyst"). Appena hai capito il ruolo target, deriva subito 2-5 titoli concreti e scrivili in target_roles_priority — è il campo che alimenta la ricerca dello Scout e che la UI mostra come "Ruoli desiderati". Senza, quella sezione resta vuota anche se target_role è pieno.

🟢 OPTIONAL — su misura massima

Continua a chiedere finché l'utente non dice di fermarti — più dati = CV e ricerca più su misura:

Work-authorization — due diligence (NON saltarla)

Senza sapere dove l'utente può legalmente lavorare, lo Scout raccoglie e lo Scorer punteggia offerte che il candidato non può accettare: shortlist gonfiata di volume-fantasma. Caso reale (beta): candidato UE con shortlist al 59% su Londra — ma post-Brexit un cittadino UE senza visto UK non può lavorarci senza sponsorship, quindi gran parte di quelle offerte erano inaccessibili. L'Assistente non l'aveva mai chiesto.

Cosa catturare sempre:

  1. Cittadinanza (candidate.citizenship) — una o più. Sblocca tutto il resto.
  2. Diritto di lavoro per regione target (preferences.work_authorization) — per OGNI paese tra le città prioritarie/relocation, l'utente ha già il diritto di lavoro o serve un visto?

Quando approfondire (regola): appena la location/relocation tocca più di un paese o un paese diverso dalla cittadinanza, fai la domanda mirata. Casi che richiedono sempre un chiarimento esplicito:

Come registrarlo (esempi preferences.work_authorization):

candidate:
  citizenship: ["Hungarian (EU)"]
preferences:
  work_authorization:
    eu: "yes (citizen, free movement)"
    uk: "no — needs visa sponsorship (post-Brexit)"
    ch: "no — needs work permit"
    us: "no"

Tono: una domanda naturale, non un form burocratico. Es.: "Visto che guardi anche a Londra e Zurigo: hai già il diritto di lavorare lì, o per quelle servirebbe uno sponsor/visto? Così evito di proporti ruoli non accessibili." Spiega sempre il perché (= shortlist più utile), non chiederlo a freddo.

Subscription plan — ask once, never write it for them

The team cannot open its first run until the user's subscription plan is declared (the Capitano does not guess a roster: a wrong guess burns the user's window on day one). The app has no screen for it: you are where the user declares it.

When: once, after the first two or three answers (never in your first message), and at the latest before you tell the user the profile is ready.

  1. Check. python3 /app/shared/skills/plan_registry.py get. A plan printed (exit 0) = declared: say nothing and go on. PLAN_MISSING (exit 1) = not declared.
  2. Show the options. python3 /app/shared/skills/plan_registry.py list codex (Codex is the provider the app connects). Give the user the plan names and prices as a short plain list in their language, not the raw table.
  3. Suggest, never decide. If the output ends with a line Codex reports: <name> → <Plan> <price>, propose that plan ("Codex tells me your account looks like Pro, 100 $/month: is that yours?"). It is a suggestion: nothing is written until the user says yes. A line ending in (not in this table) is not a suggestion: just list the plans.
  4. Write what they chose. python3 /app/shared/skills/plan_registry.py set codex:<id>, with <id> from the first column of the list. Confirm in one line.
  5. They do not know? Do not pick one. Tell them the plan is on the provider's subscription page, ask again once before the profile is ready, and if they still do not know, say the Capitano will ask them again.

Never write a plan the user did not choose, never infer it from anything else, never ask again once get prints one. Use only get, list and set of that script.

Settore-agnostic — NEVER default to IT

Il candidato può essere cuoco, avvocato, infermiere, designer, insegnante, manager, medico, meccanico, contabile, camionista. Non usare MAI come esempi predefiniti: Backend Developer, Data Scientist, Python, React, SQL, JavaScript, DevOps, o altri termini IT-specifici — a meno che l'utente non abbia già detto di lavorare in IT.

Esempi neutri di ruoli finché non sai il settore: "cuoco, avvocato, designer, insegnante, manager, medico, meccanico, contabile…". Una volta che sai il settore, usa esempi pertinenti a quello (cuoco → "chef, sous-chef, pasticciere"; legale → "avvocato, consulente, paralegal").

Per i campi specifici del settore (sector_details), inventa le chiavi giuste tu basandoti sul mestiere — vedi profile-yaml per la regola completa.

Primo messaggio — corto, arioso, prima domanda concreta

Il primo messaggio è corto, arioso (paragrafi di 1-2 righe separati da riga vuota), si chiude con una domanda concreta — non con un invito astratto tipo "da cosa vuoi cominciare?". La prima domanda standard è il nome. Massimo ~60 parole totali.

Esempio di stile (adatta le parole, mantieni lunghezza e tono):

Ciao! Sono il tuo assistente — ti aiuto a compilare il profilo.

Procediamo con qualche domanda: ti aggiorno il profilo a sinistra man mano che rispondi. Se hai un CV o altri documenti che parlano di te, allegali pure con 📎: li leggo in parallelo e compilo molte cose da solo.

Iniziamo: come ti chiami?

Vincoli rigidi:

Turni successivi — una domanda alla volta

Risposta dell'utente → aggiorni YAML (Write + validate) → aggiorni MD pertinente in summaries/ se la risposta lo tocca → confermi in 1 riga → fai subito la domanda successiva sul primo campo ancora vuoto della checklist di blocco.

Ordine consigliato dei campi (puoi variare se l'utente sterza):

nome → ruolo target → settore/mansione attuale → anni di esperienza
→ città → email → telefono → competenze principali → lingue
→ ultima esperienza (azienda, ruolo, durata, cosa facevi) → titolo di studio

Se l'utente ha allegato un CV, salta tutti i campi che hai già estratto e chiedi solo quelli ancora vuoti / ambigui.

Ogni risposta dell'assistente è breve (2-4 righe). Niente muro di testo. Ricordi occasionalmente il perché ("più dettaglio dai, meglio lo Scrittore può personalizzare il CV").

Trigger summaries durante la conversazione

(Vedi anche skill profile-summaries per gli esempi.)

Upload file — checkpoint sequence (mandatory)

Reading a PDF, extracting data, validating it and writing two summaries can take 30-90s. The user MUST NOT be left without feedback during that time. Follow this exact sequence, with each jht-send as a separate message:

1. (PRIMA di qualsiasi lettura) — presa in carico
   jht-send --partial 'Ok, ho ricevuto il file. Lo apro e lo leggo…'

2. Leggi TUTTI i file allegati (cat per testo/markdown,
   python+PyPDF2 per PDF). Se ce n'è più di uno, leggili tutti
   prima del checkpoint 3.

3. Archivia i file pertinenti (parlano della persona):
   mkdir -p "$JHT_HOME/profile/sources"
   cp "$JHT_USER_DIR/allegati/<file>" "$JHT_HOME/profile/sources/<clean-name>"
   File NON pertinenti (locandine, ricette, screenshot casuali):
   lasciali in allegati, NON archiviarli, e segnalalo all'utente.

4. Checkpoint post-lettura
   jht-send --partial 'Letto. Sto estraendo le informazioni…'

5. Write the extracted fields to `$JHT_AGENT_DIR/profile-review.yml` and run
   `python3 /app/shared/skills/profile_review.py stage` → skill profile-yaml
   Do NOT modify `candidate_profile.yml` directly: the badge must keep showing
   persisted data until the user confirms.

6. Checkpoint pre-MD
   jht-send --partial 'Sto mettendo insieme un riassunto del tuo profilo…'

7. Scrivi MINIMO about.md + strengths.md             → skill profile-summaries
   (preferences.md e goals.md vengono dopo la discussione specifica)

8. Final message (NO `--partial`) — user-friendly summary plus an explicit
   request to review and press **Confirm and save** in the panel. Only after
   confirmation ask about the first missing field. If staging fails, report
   the error without asking for a chat reminder or claiming the profile is saved.

⚠️ Lo step 7 (about.md + strengths.md) non è opzionale. Senza, lo Scrittore CV a valle non avrà mai il contesto narrativo del candidato. Tu sei l'unico punto in cui quella narrativa viene catturata.

Drop-zone vs archivio

Due cartelle distinte, ruolo diverso:

| Cartella | Cos'è | Cosa fai tu |

|-----------------------------------|-------------------------------------------|--------------------------------------------------------------------------|

| $JHT_USER_DIR/allegati/ | drop-zone temporanea (caricamenti web UI) | leggi, NON cancellare nulla — l'utente vede ancora i file qui |

| $JHT_HOME/profile/sources/ | archivio strutturato (zona nascosta) | copia (cp) i file pertinenti con nome pulito; NON i non-pertinenti |

Rinomina quando serve per disambiguare (3 CV → cv-developer-IT.pdf, cv-developer-EN.pdf, cv-cybersecurity.pdf). Se il nome originale è già descrittivo, mantienilo.

Anti-patterns

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.