---
phase: menu
kind: level
level: applications
---

# Level 1 — Applications

> Scope strict: propose **applications only**. No modules/sections/resources/
> entities/rules/screens. The phase boundary in `SKILL.md` applies verbatim.
> The write protocol (scaffold node folder + `index.md` + placeholders) and the
> code/label rules also live in `SKILL.md` — this file is the proposal heuristic.

## Exploration (first message, empty tree) — run in parallel before proposing

1. **Read SmartStack config**: open `.smartstack/config.json` if present —
   `baseNamespace` (project name), `dbContext`, `tablePrefix`. Absent → "not a
   SmartStack project", continue anyway.
2. **Read the current tree**: `Glob .smartstack/ba/**/index.md` — empty or
   populated?
3. **Scan existing code** (if a SmartStack project): controllers
   (`src/*.Api/Controllers/**/*.cs`, `[NavRoute("app.module")]`), entities
   (`src/*.Domain/Entities/**`), React pages (`web/*/src/pages/**` — folders =
   modules). Extract real app/module names rather than inventing them.
4. **Present a short exploration summary** (project, prefix, current tree,
   existing code, verdict: new / extend / fill gaps).

## Calibration — HARD CAP 1 question, then propose

The same domain (e.g. HR) yields different apps by industry. Ask **at most one**
calibration question via AskUserQuestion, then propose. Skip it entirely if the
user's prompt already answers it.

- **Whitelist** (the only topics you may ask): industry/sector · application-level
  scope (which high-level areas the app covers) · org size/volume.
- **Blacklist** (defer, never ask here): payment/billing models, access models,
  workflow steps, schedules, field-level details, permission matrices, form
  structures, dashboard contents. These belong to later phases.

If you catch yourself drafting a 2nd calibration question, STOP — propose with
your best inference plus a one-line caveat ("on affinera au tour suivant").

## Application guidelines

- **Autonomy**: each application is an autonomous business scope with its own
  settings. NEVER a cross-cutting `SETTINGS`/`ADMIN` application — configuration
  is a MODULE inside the relevant app.
- **Infer** 1-3 apps from the requirement + context; **check** against SmartStack
  Core (never duplicate built-ins); **challenge** (>8 potential modules → split;
  similar scope → merge); **verify** each app is autonomous.
- **Naming**: short business-scope names (1-2 words). No `& / \ | < > "` (split or
  pick an umbrella concept).
- Optional in `index.md`: a one-line rationale and an `## Hors-périmètre` whenever
  the user signalled exclusions.

## Out-of-scope checkpoint (turn 1 only)

On the very first turn of a brand-new project, before proposing apps, you MAY ask
one multi-select AskUserQuestion: "are there areas you explicitly do NOT want
covered?" (billing, payroll, client portal, consolidated reporting, none). Record
any picks as the `## Hors-périmètre` of the project root `.smartstack/ba/index.md`
and/or the relevant app. One scope question per project, turn 1 only.

## First message with an existing tree

Present what exists ("{N} apps, {M} modules, sections: yes/no"), then ask via
AskUserQuestion how to proceed (continue with sections / modify / add a new app).
Never auto-jump to the next level.

## Edge cases

| Situation | Action |
|-----------|--------|
| User refuses all | Ask to rephrase, re-propose |
| Duplicates SmartStack Core | Explain the built-in, suggest an alternative |
| Single app for everything | Accept; warn if >8 modules |
| Two apps, similar scope | Suggest merging |

## After validation

Write each application: create `.smartstack/ba/<CODE>/index.md` (level=application)
+ the six placeholder docs, and add the app to the project root
`index.md` `## Enfants`. Then acknowledge in one line and ask (AskUserQuestion)
whether to define modules for an app, add another app, or pause — per the
checkpoint rule in `SKILL.md`. Do not auto-propose modules.
