Per-operation prompt customization
Prompt assembly is handled by src/utils/promptLoader.ts
(v3). For each operation directory (e.g., contexts/Mutation.createCourse
), the loader concatenates sources in this generic → specific order:
- Settings:
extraPrompt
(oruserGuidance
) - Settings (type):
extraPrompt{Query|Mutation|Subscription}
- Settings file:
extraPromptFile
- Workspace:
.appsync-testgen/prompt.md
- Workspace (type):
.appsync-testgen/prompt.<type>.md
- Contexts:
contexts/_prompts/prompt.md
- Contexts (type):
contexts/_prompts/prompt.<type>.md
- Settings:
perOperationPrompts[]
(supports*
wildcard onop
) - Workspace per-op:
.appsync-testgen/operations/<Parent>.<field>.md
- Contexts per-op:
contexts/_prompts/operations/<Parent>.<field>.md
- Per-op file in op folder:
<opDir>/gen.prompt.md
Tip: Prefer small, focused files per operation for strict guidance, and keep global guidance light.
Examples
// settings.json
{
"appsyncTestGen.generation.perOperationPrompts": [
{ "op": "Mutation.create*", "prompt": "When validating, remove a required string field." },
{ "op": "Query.get*", "file": ".appsync-testgen/prompt.query.md" }
]
}
Create contexts/_prompts/operations/Mutation.createCourse.md
to target a single operation.