> For the complete documentation index, see [llms.txt](https://docs.flexbase.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flexbase.in/flexbase-mcp-ai-prompts/legacy-migration-prompts-json-file.md).

# Legacy Migration Prompts - json file

> Generate FlexBase JSON import files from legacy application code (or from previously extracted Markdown).

## How to Use

Tell your AI agent what you need. It will load the JSON structure rules and conventions automatically.

**Example prompts you can give your AI agent:**

```
Generate a FlexBase JSON import file from this legacy codebase
```

```
Convert the legacy extraction markdown to FlexBase JSON
```

```
Create JSON for just the domain services from this legacy app
```

```
Generate FlexBase JSON from this PowerBuilder application
```

***

## Task Catalog

### Task 1: Quick JSON Generation

**Goal:** Generate a complete FlexBase JSON import file with all defaults applied\
**User provides:** Legacy code folder or existing extraction markdown\
**Output:** `[ProjectName]_Flexbase_Import.json`

### Task 2: Complete JSON with Verification

**Goal:** Generate JSON with explicit verification of all structure rules\
**User provides:** Legacy code folder or existing extraction markdown\
**Output:** `[ProjectName]_Flexbase_Import.json` + verification checklist

### Task 3: Modules JSON Only

**Goal:** Generate only the modules array\
**User provides:** Legacy code folder or existing extraction markdown\
**Output:** `[ProjectName]_Modules.json`

### Task 4: Domain Services JSON Only

**Goal:** Generate only the consolidated domain services array\
**User provides:** Legacy code folder or existing extraction markdown\
**Output:** `[ProjectName]_DomainServices.json`

### Task 5: Domain Services with Properties

**Goal:** Generate domain services JSON with full attribute, relationship, and index definitions\
**User provides:** Legacy code folder or existing extraction markdown\
**Output:** `[ProjectName]_DomainServices.json` — includes attributes, relationships, and indexes per entity

### Task 6: Complete Legacy Application JSON (Any Language)

**Goal:** Generate FlexBase JSON from any legacy application using platform-specific mapping\
**User provides:** Legacy project folder + optionally database connection for FK chain analysis\
**Output:** `[ProjectName]_Flexbase_Import.json` with platform-specific metadata

The agent auto-detects the platform (PowerBuilder, .NET, Java, Python, PHP, Ruby, Node.js) and maps source artifacts to FlexBase components automatically.

### Task 7: UI-Enriched JSON Generation

**Goal:** Generate FlexBase JSON with screen/UI metadata on each feature\
**User provides:** Legacy code folder with UI (web pages, desktop forms, DataWindows)\
**Output:** JSON with `metadata.screenFlow` on UI-facing features

### Task 8: Screen Definition JSON Generation

**Goal:** Generate screen definitions with controls referencing features\
**User provides:** Legacy code folder with UI or existing extraction markdown with screen flow data\
**Output:** `[ProjectName]_[ModuleName]_Screens.json` — one per module

***

## Key Rules (Applied Automatically)

* **3-section JSON structure** (4 sections when UI screens are present): `modules`, `domainServices`, `modulesWithFeatures`, `modulesWithScreens`
* **Every operation = one feature** — no operations array inside features
* **Module names PLURAL** PascalCase
* **Files auto-split when large** — per-module JSON files + full combined import

***

## Related

* **Extraction first:** [Legacy Migration → Markdown](/flexbase-mcp-ai-prompts/legacy-migration-prompts-md-file.md)
* **PowerBuilder analysis:** [PowerBuilder Project Analysis](/flexbase-mcp-ai-prompts/legacy-migration-pb-analysis-prompts.md)
* **SP extraction:** [Stored Procedure & Trigger Extraction](/flexbase-mcp-ai-prompts/legacy-migration-stored-procedures-prompts.md)
* **After import:** [Implementation Completion](/flexbase-mcp-ai-prompts/implementation-completion-prompts.md)
