diff --git a/metagpt/actions/write_prd.py b/metagpt/actions/write_prd.py index a062ece54..f66d586a3 100644 --- a/metagpt/actions/write_prd.py +++ b/metagpt/actions/write_prd.py @@ -313,7 +313,7 @@ class WritePRD(Action): if not output_pathname: output_pathname = DEFAULT_WORKSPACE_ROOT / "docs" / "prd.json" - output_pathname.mkdir(parents=True, exist_ok=True) + output_pathname.parent.mkdir(parents=True, exist_ok=True) elif not Path(output_pathname).is_absolute(): output_pathname = DEFAULT_WORKSPACE_ROOT / output_pathname output_pathname = Path(output_pathname)