/ba-develop — Du PRD au code/ba-develop — From PRD to code
Une fois qu'un PRD a passé l'audit (score GO ≥ 80), /ba-develop <APP>/<MODULE> orchestre 6 phases séquentielles pour générer le code complet du module. Le run est entièrement autonome : il ne s'arrête jamais et ne pose aucune question — ce qui exigerait une décision humaine est consigné comme blocker et remonté uniquement dans le rapport final. Plusieurs modules interdépendants : /ba-create-plan-development puis /ba-develop-plan.
Once a PRD passes audit (GO score ≥ 80), /ba-develop <APP>/<MODULE> orchestrates 6 sequential phases to generate the module's full code. The run is fully autonomous: it never halts and never asks a question — anything that would need a human decision is recorded as a blocker and surfaced only in the final report. Several interdependent modules: /ba-create-plan-development then /ba-develop-plan.
/ba-develop <APP>/<MODULE> # run normal (les phases dont le gate passe sont sautées)
/ba-develop <APP>/<MODULE> --force # régénération complète
/ba-develop <APP>/<MODULE> --allow-dirty
Vue d'ensemble du pipelinePipeline at a glance
Chaque phase tourne dans son propre subagent avec UNE slice du PRD. Entre les phases, des gates auto-réparants : sur un échec, le pipeline tente de corriger lui-même (max 25 tentatives par item) ; un échec non réparable est différé en blocker et le run continue jusqu'au bout. Les audits symétriques (audit-dev-api côté backend, audit-dev-frontend côté frontend) verrouillent l'alignement entre le pagespec (source de vérité métier) et le code généré.
Each phase runs in its own subagent with ONE PRD slice. Between phases, self-healing gates: on failure the pipeline tries to fix things itself (max 25 retries per item); an unhealable failure is deferred as a blocker and the run continues to the end. The symmetric audits (audit-dev-api on the backend, audit-dev-frontend on the frontend) lock the alignment between the pagespec (business source of truth) and the generated code.
Détail des 6 phasesThe 6 phases in detail
Chaque phase est un subagent isolé qui reçoit UNE slice du PRD. Un gate vérifie compilation + tests + audit dédié ; sur échec, il s'auto-répare (max 25 tentatives par item) puis diffère en blocker. Each phase runs as an isolated subagent that receives ONE PRD slice. A gate verifies compile + tests + dedicated audit; on failure it self-heals (max 25 retries per item) then defers as a blocker.
Voir le détail : skills, sortie et gate de chaque phaseShow details: skills, output and gate of each phase
| PhasePhase | NomName | Skills mobiliséesMobilised skills | SortieOutput | GateGate |
|---|---|---|---|---|
| 0 | Core Foundation SeedCore Foundation Seed | backend-core-seed |
Navigation, rôles, permissions de l'appApp navigation, roles, permissions | build + tests |
| 1 | Entities (Domain + Data)Entities (Domain + Data) | backend-data-layer, backend-seed-data |
Entités, EF configs, migrations, seedEntities, EF configs, migrations, seed | build + tests |
| 2a | API Integration (Business + API)API Integration (Business + API) | backend-business-layer, backend-controller |
CQRS, validators, controllers RBAC, actions custom alignées sur le pagespecCQRS, validators, RBAC controllers, custom actions aligned with the pagespec | build + tests + /audit-dev-api |
| 2b | API Screen-driven — retirée du chemin canonique (les apps générées routent en [NavRoute] ; cette strate n'est plus générée pour un nouveau module)API Screen-driven — removed from the canonical path (generated apps route via [NavRoute]; this stratum is no longer generated for a new module) |
— | — | — |
| 3 | Frontend (7 sous-phases : auth, thème, layout, primitives, pages, API client, i18n)Frontend (7 sub-phases: auth, theme, layout, primitives, pages, API client, i18n) | scaffold-theme, scaffold-layout, frontend-component, frontend-api-client, frontend-auth |
Pages, routes, API client, hooks d'auth, boutons custom (kind:api → hook, kind:navigate → navigate())Pages, routes, API client, auth hooks, custom buttons (kind:api → hook, kind:navigate → navigate()) |
build + tests + /audit-dev-frontend + smoke-test |
| 4 | Acceptance TestsAcceptance Tests | scaffold-tests-from-ac, testing |
Un test [Fact] par critère d'acceptation BA (lus depuis use-case.md), corps implémentésOne [Fact] test per BA acceptance criterion (read from use-case.md), bodies implemented |
audit-dev-tests (bloquant)(blocking) |
À la sortie de la phase 4, le module est livré : compilation + tests OK, smoke-test vert, et le rapport final liste healingSummary[] (ce qui a été auto-réparé) et blockers[] (ce qui requiert votre décision).
At the end of phase 4, the module is delivered: compile + tests OK, smoke-test green, and the final report lists healingSummary[] (what was self-healed) and blockers[] (what needs your decision).
GarantiesGuarantees
- Le code appartient aux scaffolders : backend ET frontend sont générés par les CLIs déterministes (marqueur
@generated-by) — jamais écrits à la main. La personnalisation passe par le seam@customised.Scaffolders own the code: backend AND frontend are generated by the deterministic CLIs (@generated-bymarker) — never hand-written. Customisation goes through the@customisedseam. - Aucun stub : règles métier et use cases sont implémentés, pas laissés vides.No stubs: business rules and use cases are implemented, not left empty.
- FK réelles :
relations[]du PRD se traduit enHasForeignKey()+ navigation +OnDelete.Real FKs: PRDrelations[]map toHasForeignKey()+ navigation +OnDelete. - Never-halt : gates auto-réparants (max 25 tentatives/item), échec non réparable = blocker différé, aucune question en cours de run.Never-halt: self-healing gates (max 25 retries/item), unhealable failure = deferred blocker, no mid-run questions.
Propagation des actions customCustom-action propagation
Quand un pagespec déclare des actions au-delà des CRUD standard (par exemple syncFromPce kind:api ou openHistory kind:navigate), /ba-develop les propage verbatim à toutes les couches qui doivent les voir. Le champ endpoint du pagespec est l'unique source de vérité — il est compilé sans transformation dans le route attribute du Controller et dans l'URL axios du service.
When a pagespec declares actions beyond the standard CRUD (e.g. syncFromPce kind:api or openHistory kind:navigate), /ba-develop propagates them verbatim to every layer that must see them. The pagespec's endpoint field is the single source of truth — it is compiled without transformation into the Controller route attribute and into the service's axios URL.
Voir le détail : propagation couche par couche, audits symétriques, garantie de fin de pipelineShow details: layer-by-layer propagation, symmetric audits, end-of-pipeline guarantee
| PhasePhase | Pour kind: apiFor kind: api |
Pour kind: navigateFor kind: navigate |
|---|---|---|
| 2 (Business) | Recette canonique ou stub NotImplementedException avec // TODO[UC-…]Canonical recipe or NotImplementedException stub with // TODO[UC-…] |
— |
| 2 (Controller) | [HttpVerb("<endpoint>")] + [RequirePermission("…")] |
— |
| 3 (Service.ts) | apiClient.<verb>('/api/.../<endpoint>') + hook React QueryReact Query hook |
— |
| 3 (Bouton) | Importe le hook + appelle .mutate() au clicImports the hook + calls .mutate() on click |
Importe useNavigate + appelle navigate(targetRoute). Aucun hook, aucun appel axios.Imports useNavigate + calls navigate(targetRoute). No hook, no axios call. |
| Gate Phase 2Phase 2 gate | Cross-check : chaque kind:api du pagespec doit avoir un [HttpVerb("<endpoint>")] matching côté Controller, sinon la phase échoue.Cross-check: every pagespec kind:api action must have a matching [HttpVerb("<endpoint>")] on the Controller, otherwise the phase fails. |
Les audits dev symétriques verrouillent l'alignement après génération : The symmetric dev audits lock the alignment after generation:
| PhasePhase | Audit exécuté automatiquementAudit invoked automatically | Règles bloquantesBlocking rules |
|---|---|---|
| 2 (Backend) | audit-dev-api --mode audit |
DEV-API-010 (pagespec → controller), DEV-API-011 (warn) |
| 3 (Frontend) | audit-dev-frontend --mode audit |
DEV-UI-019 / DEV-UI-020 / DEV-UI-021 |
Garantie de fin de pipeline — un drift entre pagespec et Controller (cas classique : POST /sync-from-pce côté frontend, [HttpPost("sync-from-proconcept")] côté backend → 405 garanti) est détecté au gate avant Phase 3 et auto-réparé ; s'il n'est pas réparable, il est consigné en blocker avec un message précis (« Controller manquant pour action <endpoint> du pagespec <file> »). Aucune interaction n'est requise pendant /ba-develop — à la fin du run, le rapport final vous dit exactement ce qui a été réparé et ce qui attend votre décision.
End-of-pipeline guarantee — any drift between pagespec and Controller (classic case: POST /sync-from-pce on the frontend, [HttpPost("sync-from-proconcept")] on the backend → guaranteed 405) is detected at the gate before Phase 3 and self-healed; if unhealable, it is recorded as a blocker with a precise message ("Controller missing for action <endpoint> from pagespec <file>"). No interaction is required during /ba-develop — at the end of the run, the final report tells you exactly what was healed and what awaits your decision.
Trois niveaux d'orchestrationThree orchestration levels
Selon la portée du travail, trois entrées sont disponibles. Elles partagent toutes le même moteur (les 6 phases ci-dessus) mais varient en cardinalité. Depending on the scope of work, three entry points are available. They all share the same engine (the 6 phases above) but vary in cardinality.
| PortéeScope | SkillSkill | LitReads | EffetEffect |
|---|---|---|---|
| 1 modulemodule | /ba-develop <APP>/<MODULE> |
prd.md + slices + pagespecs/*.md |
6 phases séquentielles sur ce module6 sequential phases on that module |
| 1+ applicationsapplications | /ba-create-plan-development <APP1> [APP2]… |
entité.md des appsof the apps |
Construit le graphe FK cross-module + tri topologique → dev-plan.mdBuilds cross-module FK graph + topological sort → dev-plan.md |
| Exécution du planPlan execution | /ba-develop-plan [--waves 1,2] |
dev-plan.json |
Lance une vague à la fois ; dans chaque vague, un /ba-develop par module en parallèle ; gate entre vaguesRuns one wave at a time; within a wave, one /ba-develop per module in parallel; gate between waves |
Cycle multi-module — comment ça marcheMulti-module cycle — how it works
Le multi-module fonctionne en deux temps : Multi-module works in two steps:
- Génération du plan :
/ba-create-plan-development APP_A APP_Blit chaqueentité.md, détecte les FK cross-module, trie les modules par dépendance en vagues parallélisables, et écritdev-plan.json.Plan generation:/ba-create-plan-development APP_A APP_Breads everyentité.md, detects cross-module FKs, sorts modules by dependency into parallelisable waves, and writesdev-plan.json. - Exécution du plan :
/ba-develop-plantraite une vague à la fois. Dans chaque vague, il lance un subagent/ba-developpar module en parallèle ; une fois les N modules terminés, un gate compile + tests sur l'ensemble doit passer avant la vague suivante.Plan execution:/ba-develop-planprocesses one wave at a time. Within each wave it launches one/ba-developsubagent per module in parallel; once the N modules complete, a compile + tests gate over the whole set must pass before the next wave starts.
Voir l'exemple : un plan à 3 vagues sur 2 applicationsShow example: a 3-wave plan over 2 applications
| VagueWave | Modules développés en parallèleModules developed in parallel | Gate de sortieExit gate |
|---|---|---|
| 1 | APP_A/Module_A1, APP_A/Module_A2, APP_B/Module_B1 |
compile + tests des 3 modulescompile + tests of the 3 modules |
| 2 | APP_A/Module_A3, APP_B/Module_B2 |
compile + tests des 2 modulescompile + tests of the 2 modules |
| 3 | APP_B/Module_B3 |
smoke-test finalfinal smoke-test |
Pourquoi des vagues ? Un module qui possède une entité référencée comme FK par un autre module doit être livré avant ses dépendants. Les vagues encodent cet ordre tout en autorisant le maximum de parallélisme. Why waves? A module whose entity is referenced as an FK by another module must ship before its dependents. Waves encode that ordering while allowing maximum parallelism.
Outil de remédiation — projets legacyRemediation tool — legacy projects
Pour les projets qui ont été développés avant la propagation typée des actions (custom actions en texte libre dans screen.md, drifts pagespec / Controller / service.ts accumulés), un CLI standalone cartographie les désalignements sans rien modifier par défaut.
For projects developed before typed action propagation existed (free-text custom actions in screen.md, accumulated pagespec / Controller / service.ts drifts), a standalone CLI maps the misalignments without modifying anything by default.
Quand l'utiliser : on hérite d'un projet ancien ; on observe un bug HTTP 405 / 404 sur un bouton ; on veut auditer un module avant de le migrer au format custom actions typé. When to use it: inheriting an old project; observing a 405 / 404 HTTP bug on a button; auditing a module before migrating it to typed custom actions.
Voir le détail : commande audit-dev-actions-alignment, rapport et mode applyShow details: audit-dev-actions-alignment command, report and apply mode
npx tsx templates/skills/development/audit-dev-frontend/cli/audit-dev-actions-alignment/index.ts `
--project-path "<chemin>/web/<app>-web" `
--backend-path "<chemin>" `
--module-path "<chemin>/.smartstack/ba/<APP>/<MODULE>" `
--mode report-only
Sortie : _audit/actions-alignment.md listant les drifts par catégorie (ACTION-DRIFT-001..005) avec, pour chaque drift, le pagespec / Controller / service concerné et la commande de correction. Le mode --mode apply existe (opt-in) avec --source-of-truth pagespec|controller pour choisir qui gagne — toujours à utiliser avec un commit propre derrière.
Output: _audit/actions-alignment.md listing drifts per category (ACTION-DRIFT-001..005) with, for each, the affected pagespec / Controller / service and the fix command. The --mode apply mode exists (opt-in) with --source-of-truth pagespec|controller to choose who wins — always use it with a clean commit behind.
Dans quel cas ?Which situation, which command?
| Je suis dans ce cas…I am in this situation… | …alors je fais…then I do |
|---|---|
| Le PRD d'un module vient de passer GO ≥ 80A module's PRD just passed GO ≥ 80 | /ba-develop <APP>/<MODULE> |
| Un run précédent s'est interrompu (coupure, session)A previous run was interrupted (crash, session) | relancer /ba-develop <APP>/<MODULE> — les phases dont le gate passe sont sautéesre-run /ba-develop <APP>/<MODULE> — phases with a passing gate are skipped |
| Le PRD a changé, je veux tout régénérerThe PRD changed, I want a full regeneration | /ba-develop <APP>/<MODULE> --force |
| Plusieurs modules interdépendantsSeveral interdependent modules | /ba-create-plan-development puis /ba-develop-plan (vagues parallèles)/ba-create-plan-development then /ba-develop-plan (parallel waves) |
| Le rapport final liste des blockersThe final report lists blockers | traiter chaque blocker (corriger le doc BA, arbitrer, régénérer la slice) puis relancer le runaddress each blocker (fix the BA doc, adjudicate, regenerate the slice) then re-run |
| Un bouton renvoie 404/405 sur un vieux projetA button returns 404/405 on an old project | le CLI de remédiation audit-dev-actions-alignment (section ci-dessus)the audit-dev-actions-alignment remediation CLI (section above) |
| Je veux vérifier une fonctionnalité livrée de bout en boutI want to verify a delivered feature end-to-end | /validate-feature |
Skills orchestréesOrchestrated skills
La table ci-dessous liste toutes les skills mobilisées (planification, backend, frontend, audits, tests) : The table below lists every mobilised skill (planning, backend, frontend, audits, tests):
Skills orchestrées par /ba-develop
Skills orchestrated by /ba-develop
business-analyse 1
-
/ba-create-plan-developmentGenerates a phased development plan ordering modules by their cross-module data-model dependencies.<APP1> [APP2] …
devApi 3
-
/audit-dev-apiAudit code generated by the API phase against the PRD slice — controllers, routes, HTTP actions, RBAC attributes, DTOs, integration tests -
/audit-dev-external-apiAudit the PUBLIC (third-party, machine-to-machine) API surface of a generated client extension — whitelisted route prefix, seeded catalogue row, catalogue-pe… -
/audit-dev-wireStatic parity gate between the generated frontend service URLs and the generated backend controller routes.
devCore 1
-
/audit-dev-coreAudit the Phase 0 (Core Foundation Seed) bundle against what scaffold-core-seed EMITS — deterministic CLI (DEV-CORE-000/001/005/006/008/009/010: the 6 per-app providers under Seeding/Applications/{AppPascal}/Core/, the per-app `<<< CORE-SEED-DI-{AppPascal} >>>` block, test users actually created, the `.smartstack/core-seed/{app}.state.json` snapshot, the CoreSeedScriptRunner + its registration + the csproj EmbeddedResource block, the seed-owned AssignedBy marker, and a scan that inspected something).
devData 1
-
/audit-dev-dataAudit the generated persistence layer against the BA data model — deterministic CLI (DEV-DAT-001/002/003/007/008/009/010 — every entity has its migration, table naming, no duplicate CreateTable, migration filenames, every declared relationship a REAL FK constraint in the Configuration AND the migration with the declared cascade, every declared **Index** — non-unique included — present in a migration, the business test dataset `jeu-de-test.md` reached its guarded `{Module}TestDataSeedDataProvider`).
devDomain 1
-
/audit-dev-domainAudit code generated by the Domain phase against the PRD slice — entity files, FK pairing, naming, traceability, drift detection
development/audit 3
-
/auditAudit of generated code against SmartStack conventions (i18n, React, structure, dynamic routing, RBAC, security) -
/audit-dev-customisedDetects @customised page drift from the regenerated service/hook contract (DRIFT-001/002). -
/audit-routing-dynamicREAD-ONLY audit of the SmartStack development skills to verify their conformance to the DB-driven dynamic routing architecture (PageRegistry + componentRegistry + DynamicRouter).
development/backend 7
-
/backend-business-layerGenerates full CQRS stack — Commands, Queries, Handlers, DTOs, Validators, Service interface + implementation — on SmartStack NuGet abstractions (IExtensions… -
/backend-controllerGenerates the **integration-strata** API controller (generic CRUD served at /api/{module}/{section} from its [NavRoute], Swagger group "integration") with RequirePermission, auto-mapped DTO → Command conversions, and module-scoped permission classes. -
/backend-core-seedPhase 0 of /ba-develop — generates one Core Foundation Seed bundle per declared application (6 IClientSeedDataProvider classes per app covering navigation + tenant↔app links + roles + permissions + role-permission mappings + dev test users) by invoking the deterministic `scaffold-core-seed` CLI. -
/backend-data-layerGenerates Domain entities on the project-local ExtensionBaseEntity shim (soft-delete + domain events over SmartStack.Domain.Common.BaseEntity), domain events… -
/backend-screen-controllerGenerates the **screen-driven** API stratum: one controller per section exposing one endpoint per screen, payload shaped from the pagespec. -
/backend-seed-dataGenerates module-scoped IClientSeedDataProvider implementations for reference data (lookup tables, enum codes — the SETUP tier, every environment), the guarded business TEST DATASET provider (jeu-de-test.md → testData[] — dev, test and qual on demand, never prod) and per-module overrides. -
/dotnet-structure.NET Clean Architecture 4-layer SmartStack
development/debug 6
-
/audit-bugRefine a user-reported bug — rephrase, classify, and cross-reference the code in the current worktree. -
/debugDiagnose and auto-fix SmartStack dev-runner issues (backend + frontend) -
/debug-backendDiagnose and auto-fix SmartStack .NET backend failures -
/debug-frontendDiagnose and auto-fix SmartStack React+Vite frontend failures -
/discuss-bugConversational triage on a tracked bug — answer the user, decide whether to reopen the fix or re-audit, never modify code directly. -
/fix-bugImplement a fix for a user-reported bug — edit code, verify, commit atomically with a traceable message.
development/frontend 9
-
/dashboardTransverse dashboard reference + scaffolder, consumed DURING development so every dashboard uses the right components, the right UI, and correct theming.[scaffold the dashboard primitives, or ask for the dashboard conventions] -
/frontend-api-clientGenerates TypeScript service clients + React hooks (useState/useEffect) using the `api` HTTP client from @atlashub/smartstack (pre-configured, returns unwrap… -
/frontend-authScaffold the per-project useAuth adapter + PermissionGuard -
/frontend-componentGenerates React page components (list, detail, form) consuming @atlashub/smartstack npm package: PermissionGuard, Slot, SmartStackProvider. -
/frontend-extension-configGenerates ExtensionConfig (@atlashub/smartstack) with slot definitions that mirror the <Slot name="..."> calls emitted by frontend/component. -
/frontend-pwaTurns a generated CLIENT SmartStack app (an @atlashub/smartstack consumer) into an installable, offline-capable PWA: faithful socle service worker (tenant/language-isolated API cache), VitePWA injectManifest wiring, web manifest + meta tags, placeholder icons, the registerSW → package update channel bridge, initOutbox() and the offline-write outbox aggregation. -
/frontend-routesGenerates PageRegistry registrations for SmartStack's DB-driven routing (DynamicRouter). -
/frontend-structureReact + Vite + Tailwind + SmartStack frontend structure (npm consumer of @atlashub/smartstack) -
/ui-polishAudits and auto-fixes React pages in a generated SmartStack frontend against the customisation-ui design system standards (CSS variable tokens, PageTemplate wrapper, DataTable/EntityCard components, lucide-react icons, semantic badges, permission keys, i18n namespaces).
development/run 3
-
/runKill orphans + launch backend + frontend, auto-retry on failure -
/run-backendKill stale .Api processes, launch dotnet run, verify /health — retry loop -
/run-frontendKill stale Vite, npm run dev, verify /, retry loop
development/smoke-test 1
-
/smoke-testRuntime smoke-test for a freshly-generated SmartStack.app project.
development/testing 3
-
/development-testing-fix-buildAuto-correct a SINGLE compilation error surfaced by the Studio's Dev Runner (dotnet CS####, tsc TS####, vite resolve). -
/development-testing-ui-testPhase 5 UI tests — drives dev-browser to navigate every scaffolded page, submit forms with role-based seeded users, and auto-correct failures via the existing fix-bug skill loop (max 50 iterations per test). -
/smoke-httpHTTP smoke prober for generated SmartStack applications.
devFrontend 5
-
/audit-dev-frontendAudit code generated by the Frontend phase against the PRD slice — page coverage, registry wiring, lazy-import integrity, i18n namespaces, drift detection -
/audit-dev-pwaAudit the PWA / offline surface of a generated client app — tenant-isolated service worker markers, manifest icon chain, per-page mobile metadata, offline RE… -
/scaffold-layoutScaffold the page wrapper (PageTemplate) of the generated client app. -
/scaffold-themeBootstrap src/index.css with Tailwind v4 + Shoelace token overrides + design tokens from the PRD theme slice (or SmartStack defaults). -
/scaffold-ui-primitivesScaffold theme-compliant UI primitives into the client project (EntityLookup combobox, DateInput inline calendar, EnumSelect + MultiSelect dropdowns, SegmentedControl, Textarea, Switch, TruncatedText + the owned base DataTable and its ResponsiveDataTable wrapper for responsive list tables with truncation tooltips, TabStrip scrollable tab bar with arrow nudges, SectionCard titled category card with the read-first per-section edit toggle, plus the modern kit Skeleton, EmptyState, Badge, StatCard, and the URL list-state layer useListState + SavedViewsMenu).
infrastructure 2
-
/ba-developConsumes a module's PRD on disk (`prd.md` + 3 phase slices + `pagespecs/*.md` under `.smartstack/ba/<APP>/<MODULE>/`) and drives development through 6 sequential phases (Core → Entities → API Integration → API Screen-driven → Frontend → Acceptance Tests).<APP>/<MODULE> [--force] [--allow-dirty] -
/ba-develop-planOrchestrates multi-module development across applications by executing the phased plan from /ba-create-plan-development.[--waves 1,2]
Aucun skill ne correspond.No skill matches.