# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flexbase.in/flexbase-mcp-ai-prompts/legacy-migration-prompts-json-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
