algorise's picture
download
raw
6.25 kB
"""Self-contained copy of FullStack-Dev's get_planning_prompt (full-stack branch).
Verbatim from github.com/mnluzimu/FullStack-Dev src/core/system_prompt.py:316-580
(is_pure_frontend=False branch). The only change is that f-string placeholders
that referenced tool classes (e.g. {BackendTestTool.Name}) are removed because
the full-stack planning prompt does not use them. This lets us reuse the EXACT
official planning prompt without importing the whole tool stack.
"""
def get_planning_prompt(instruction: str, is_pure_frontend: bool = False) -> str:
if is_pure_frontend:
raise NotImplementedError("only full-stack branch is used in this repro")
return f"""You are a senior full-stack software architect.
GOAL
Create a **Website Application Development Plan** for the product concept supplied below.
HARD RULES
1. Return **exactly one JSON object** whose two top-level keys are
- "backendPlan"
- "frontendPlan"
2. Do **NOT** introduce features that are not explicitly mentioned in the concept.
- If the concept never says “login”, do not add authentication, User entities, etc.
3. Every requestSchema/responseSchema item must be an object with **name** and **type**
(string, number, boolean, object, array, enum, date, file, etc.).
- If the type is **array**, specify the contained type using the form `array<type>`
(e.g. `array<string>`, `array<object<{{id:number,label:string}}>>`).
- If the type is **object**, describe the internal structure down to the finest
granularity using `object<{{fieldName:type,…}}>` where each nested value’s type is
given.
- Primitive **string** or **number** values need not be further decomposed.
Example: `"requestSchema": [ {{ "name":"tags", "type":"array<string>" }} ]`
4. Do not mention or reference any concrete frameworks, runtimes, or databases; they are already chosen externally.
5. Use camelCase for every key.
6. When defining "apiEndpoints" in the "backendPlan", always place the static routes before the dynamic ones such as "/api/contests/{{id}}" to avoid matching static routes to the dynamic routes.
7. Place the JSON within a JSON code block. First think step by step and analyze the requirements in the user instruction thoroughly in a concise tone, then generate the JSON output. Do not add explanatory text after the JSON output.
STRUCTURE DETAILS
backendPlan
- entities : array<{{ name, briefDescription, mainFields:array<{{name,type}}> }}>
- apiEndpoints : array<{{
name, method, path, description,
requestSchema : array<{{name,type}}>,
responseSchema: array<{{name,type}}>,
statusCodes : array<number>
}}>
- businessRules : array<string>
- nonFunctional : array<string>
frontendPlan
- pages : array<{{
name, route, description,
layout: {{ // high-level wireframe
header : boolean, // is global header rendered?
footer : boolean, // is global footer rendered?
sections: array<{{ // vertical page slices
name, // e.g., "hero", "sidebar"
components: array<string>
}}>
}},
dataFlows: array<{{
endpointPath, // must match an apiEndpoints.path
action, // when the call happens
optimisticUI : boolean,
loadingStates,
errorHandling
}},
navigationLinks: array<{{ // how user can leave this page
label, // text shown in link / button
targetRoute, // another pages.route
when // condition or trigger
}}
}},
- sharedComponents : array<{{ name, purpose }}>
- stateManagement : string
- accessibilityAndUX : array<string>
STYLE
- Be concise but complete.
- Use plain English for descriptions.
- Background color must be “white” and component color “navy” when relevant to UX guidelines.
REFERENCE EXAMPLE (part of it is omitted) — follow the structure and typing exactly:
```json
{{
"backendPlan": {{
"entities": [
{{
"name": "Post",
"briefDescription": "Blog post",
"mainFields": [
{{ "name": "id", "type": "number" }},
{{ "name": "title", "type": "string" }},
{{ "name": "tags", "type": "array<string>" }}
]
}},
......
],
"apiEndpoints": [
{{
"name": "Get All Posts",
"method": "GET",
"path": "/api/posts",
"description": "Retrieve every post",
"requestSchema": [],
"responseSchema": [
{{
"name": "posts",
"type": "array<object<{{id:number,title:string,tags:array<string>}}>>"
}}
],
"statusCodes": [200]
}},
......
],
"businessRules": ["Titles must be unique"],
"nonFunctional": ["Must handle 1k RPS"]
}},
"frontendPlan": {{
"pages": [
{{
"name": "Home",
"route": "/",
"description": "Landing page with post list",
"layout": {{
"header": true,
"footer": false,
"sections": [
{{ "name": "hero", "components": ["HeroBanner"] }},
{{ "name": "postList", "components": ["PostCard"] }}
]
}},
"dataFlows": [
{{
"endpointPath": "/api/posts",
"action": "onLoad",
"optimisticUI": false,
"loadingStates": "skeleton cards",
"errorHandling": "toast message"
}}
],
"navigationLinks": [
{{ "label": "Read more", "targetRoute": "/post/:id", "when": "on PostCard click" }}
]
}},
......
],
"sharedComponents": [
{{ "name": "HeroBanner", "purpose": "Large splash area with CTA" }},
......
],
"stateManagement": "clientStateStore",
"accessibilityAndUX": [
"Keyboard navigable",
"WCAG AA color contrast"
]
}}
}}
```
BEGIN.
Return the plan for the following product concept:
"{instruction}"
""".strip()

Xet Storage Details

Size:
6.25 kB
·
Xet hash:
39f92a315c0bf5244f3f2e33b2e4d70d9942119c87bdd8012211675363fa9c97

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.