pdd-cli 0.0.60__py3-none-any.whl → 0.0.61__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pdd-cli might be problematic. Click here for more details.

pdd/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """PDD - Prompt Driven Development"""
2
2
 
3
- __version__ = "0.0.60"
3
+ __version__ = "0.0.61"
4
4
 
5
5
  # Strength parameter used for LLM extraction across the codebase
6
6
  # Used in postprocessing, XML tagging, code generation, and other extraction
pdd/cli.py CHANGED
@@ -348,14 +348,26 @@ def process_commands(ctx: click.Context, results: List[Optional[Tuple[Any, float
348
348
  invoked_subcommands = ctx.obj.get('invoked_subcommands', []) or []
349
349
  except Exception:
350
350
  invoked_subcommands = []
351
- results = results or []
351
+ # Normalize results: Click may pass a single return value (e.g., a 3-tuple)
352
+ # rather than a list of results. Wrap single 3-tuples so we treat them as
353
+ # one step in the summary instead of three separate items.
354
+ if results is None:
355
+ normalized_results: List[Any] = []
356
+ elif isinstance(results, list):
357
+ normalized_results = results
358
+ elif isinstance(results, tuple) and len(results) == 3:
359
+ normalized_results = [results]
360
+ else:
361
+ # Fallback: wrap any other scalar/iterable as a single result
362
+ normalized_results = [results]
363
+
352
364
  num_commands = len(invoked_subcommands)
353
- num_results = len(results) # Number of results actually received
365
+ num_results = len(normalized_results) # Number of results actually received
354
366
 
355
367
  if not ctx.obj.get("quiet"):
356
368
  console.print("\n[info]--- Command Execution Summary ---[/info]")
357
369
 
358
- for i, result_tuple in enumerate(results):
370
+ for i, result_tuple in enumerate(normalized_results):
359
371
  # Use the retrieved subcommand name (might be "Unknown Command X" in tests)
360
372
  command_name = invoked_subcommands[i] if i < num_commands else f"Unknown Command {i+1}"
361
373
 
@@ -395,7 +407,7 @@ def process_commands(ctx: click.Context, results: List[Optional[Tuple[Any, float
395
407
 
396
408
  if not ctx.obj.get("quiet"):
397
409
  # Only print total cost if at least one command potentially contributed cost
398
- if any(res is not None and isinstance(res, tuple) and len(res) == 3 for res in results):
410
+ if any(res is not None and isinstance(res, tuple) and len(res) == 3 for res in normalized_results):
399
411
  console.print(f"[info]Total Estimated Cost:[/info] ${total_cost:.6f}")
400
412
  # Indicate if the chain might have been incomplete due to errors
401
413
  if num_results < num_commands and not all(res is None for res in results): # Avoid printing if all failed
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: generic/generate_prompt
3
+ description: Generate a module prompt (.prompt) for any stack (backend, frontend, CLI, jobs) using project docs and context
4
+ version: 1.0.0
5
+ tags: [template, prompt, generic]
6
+ language: prompt
7
+ output: prompts/${MODULE}_${LANG_OR_FRAMEWORK}.prompt
8
+ variables:
9
+ MODULE:
10
+ required: true
11
+ type: string
12
+ description: Module/component basename to generate a prompt for.
13
+ examples: [orders, auth, users]
14
+ LANG_OR_FRAMEWORK:
15
+ required: false
16
+ type: string
17
+ description: Target language or framework suffix used in prompt naming (matches your stack conventions).
18
+ examples: [Python, TypeScriptReact, Go, Java, Ruby]
19
+ default: Python
20
+ LAYER:
21
+ required: false
22
+ type: string
23
+ description: System layer or interface type for context.
24
+ examples: [backend, frontend, api, graphql, cli, job, message, config, module, component, page]
25
+ README_FILE:
26
+ required: false
27
+ type: path
28
+ description: Project README to provide overall context.
29
+ example_paths: [README.md, docs/README.md]
30
+ API_DOC_FILE:
31
+ required: false
32
+ type: path
33
+ description: API documentation describing endpoints and conventions.
34
+ example_paths: [docs/api-documentation.md, docs/api.md]
35
+ DB_SCHEMA_FILE:
36
+ required: false
37
+ type: path
38
+ description: Database schema or ERD for backend data models.
39
+ example_paths: [context/database-schema.md, docs/db/schema.md]
40
+ BACKEND_FILES_CSV:
41
+ required: false
42
+ type: path
43
+ description: CSV listing backend Python files/modules (for context/reference).
44
+ example_paths: [prompts/backend/python_architecture.csv]
45
+ IO_DEPENDENCIES_CSV:
46
+ required: false
47
+ type: path
48
+ description: CSV of function inputs/outputs and dependencies for backend modules.
49
+ example_paths: [prompts/backend/io_dependencies.csv]
50
+ ARCHITECTURE_FILE:
51
+ required: false
52
+ type: path
53
+ description: Architecture JSON (from architecture/architecture_json) to drive module scope, dependencies, and interface.
54
+ example_paths: [architecture.json]
55
+ TECH_STACK_FILE:
56
+ required: false
57
+ type: path
58
+ description: Tech stack overview (languages, frameworks, infrastructure, tools) for shaping conventions.
59
+ example_paths: [docs/tech_stack.md, docs/architecture/stack.md]
60
+ CODE_GENERATOR_PROMPT:
61
+ required: false
62
+ type: path
63
+ description: Reference code generator prompt to mirror style and expectations.
64
+ example_paths: [prompts/code_generator_python.prompt, prompts/code_generator_main_python.prompt]
65
+ EXISTING_PROMPTS:
66
+ required: false
67
+ type: list
68
+ description: Existing prompt files to use as reference (comma/newline-separated).
69
+ example_paths: [prompts/orders_python.prompt, prompts/auth_python.prompt]
70
+ DEP_EXAMPLE_EXT:
71
+ required: false
72
+ type: string
73
+ description: File extension for dependency examples under context/ (for non-Python stacks).
74
+ examples: [py, ts, tsx, go, java]
75
+ default: py
76
+ usage:
77
+ generate:
78
+ - name: Minimal (module only)
79
+ command: pdd generate -e MODULE=orders -e LANG_OR_FRAMEWORK=Python --output 'prompts/${MODULE}_${LANG_OR_FRAMEWORK}.prompt' pdd/templates/generic/generate_prompt.prompt
80
+ - name: With project docs
81
+ command: pdd generate -e MODULE=orders -e LANG_OR_FRAMEWORK=Python -e README_FILE=README.md -e API_DOC_FILE=docs/api-documentation.md -e DB_SCHEMA_FILE=context/database-schema.md --output 'prompts/${MODULE}_${LANG_OR_FRAMEWORK}.prompt' pdd/templates/generic/generate_prompt.prompt
82
+ - name: With CSVs and references (backend/Python)
83
+ command: pdd generate -e MODULE=orders -e LANG_OR_FRAMEWORK=Python -e README_FILE=README.md -e API_DOC_FILE=docs/api-documentation.md -e DB_SCHEMA_FILE=context/database-schema.md -e BACKEND_FILES_CSV=prompts/backend/python_architecture.csv -e IO_DEPENDENCIES_CSV=prompts/backend/io_dependencies.csv -e CODE_GENERATOR_PROMPT=prompts/code_generator_python.prompt --output 'prompts/${MODULE}_${LANG_OR_FRAMEWORK}.prompt' pdd/templates/generic/generate_prompt.prompt
84
+ - name: Frontend (TypeScriptReact) variant
85
+ command: pdd generate -e MODULE=profile_page -e LANG_OR_FRAMEWORK=TypeScriptReact -e LAYER=frontend -e README_FILE=README.md --output 'prompts/${MODULE}_${LANG_OR_FRAMEWORK}.prompt' pdd/templates/generic/generate_prompt.prompt
86
+ - name: From architecture.json
87
+ command: pdd generate -e MODULE=orders_api -e LANG_OR_FRAMEWORK=Python -e LAYER=api -e ARCHITECTURE_FILE=architecture.json --output 'prompts/${MODULE}_${LANG_OR_FRAMEWORK}.prompt' pdd/templates/generic/generate_prompt.prompt
88
+
89
+ discover:
90
+ enabled: false
91
+ max_per_pattern: 5
92
+ max_total: 10
93
+ ---
94
+
95
+ % You are an expert prompt writer and software architect for PDD. Your goal is to write a high-quality prompt that will generate the code for the ${MODULE} module/component. The prompt you create will be used to produce a detailed implementation specification in a file named ${MODULE}_${LANG_OR_FRAMEWORK}.prompt, suitable for the specified stack and layer.
96
+
97
+ % Project context (optional but recommended):
98
+ <readme><include>${README_FILE}</include></readme>
99
+ <api><include>${API_DOC_FILE}</include></api>
100
+ <database><include>${DB_SCHEMA_FILE}</include></database>
101
+ <backend_files_csv><include>${BACKEND_FILES_CSV}</include></backend_files_csv>
102
+ <io_dependencies_csv><include>${IO_DEPENDENCIES_CSV}</include></io_dependencies_csv>
103
+ <architecture><include>${ARCHITECTURE_FILE}</include></architecture>
104
+ <tech_stack><include>${TECH_STACK_FILE}</include></tech_stack>
105
+ <generate_code_cli_example><include>${CODE_GENERATOR_PROMPT}</include></generate_code_cli_example>
106
+
107
+ % Existing prompt references (optional):
108
+ <existing_backend_prompts><include-many>${EXISTING_PROMPTS}</include-many></existing_backend_prompts>
109
+
110
+ % Do the following:
111
+ - Explain concisely what you are going to do (create a prompt for the ${MODULE} module/component for the specified layer and stack).
112
+ - Analyze any difficulties this prompt might encounter for ${MODULE} (e.g., data modeling, API or UI contracts, transactions, idempotency, auth, state management, error handling) and briefly state mitigation strategies tailored to the given LAYER and LANG_OR_FRAMEWORK.
113
+ - If ARCHITECTURE_FILE is provided, identify the item that corresponds to this prompt by matching `filename` to `${MODULE}_${LANG_OR_FRAMEWORK}.prompt` (or best match by basename and layer). Use that item’s `reason`, `description`, `dependencies`, `interface`, and `tags` to shape the sections below.
114
+ - Then create the prompt content for ${MODULE} inside XML tags named prompt, ensuring conventions fit the stack and layer.
115
+
116
+ % The prompt you generate must follow this structure:
117
+ 1) First paragraph: describe the role and responsibility of the ${MODULE} module/component within the system (consider the LAYER if provided).
118
+ 2) A "Requirements" section with numbered points covering functionality, contracts, error handling, validation, logging, performance, and security.
119
+ 3) A "Dependencies" section using XML include tags for each dependency (see format below).
120
+ 4) An "Instructions" section with precise implementation guidance (clarify inputs/outputs, function/class responsibilities, edge cases, and testing notes).
121
+ 5) A clear "Deliverable" section describing the expected code artifacts and entry points.
122
+
123
+ % Dependencies format and conventions:
124
+ - Represent each dependency using an XML tag with the dependency name, and put the file path inside an <include> tag, e.g.:
125
+ <orders_service>
126
+ <include>context/orders_service_example.${DEP_EXAMPLE_EXT}</include>
127
+ </orders_service>
128
+ - Prefer real example files available in the provided context (use <include-many> when listing multiple). If examples are not provided, assume dependency examples live under context/ using the pattern context/[dependency_name]_example.${DEP_EXAMPLE_EXT}.
129
+ - Include all necessary dependencies for the module/component (based on the provided context and references).
130
+ - When using ARCHITECTURE_FILE, its `dependencies` reference other prompt filenames. Convert each dependency prompt filename into a sensible dependency name (strip language suffix and `_prompt`), and map to context files with the `${DEP_EXAMPLE_EXT}` extension if present; otherwise, list the prompt filename explicitly in a "Prompt Dependencies" subsection.
131
+
132
+ % Architecture awareness (when ARCHITECTURE_FILE provided):
133
+ - Align the "Requirements" and "Instructions" with the selected item’s `interface.type` (e.g., page, component, module, api, graphql, cli, job, message, config).
134
+ - For `api`, outline endpoints (method, path, auth) consistent with the architecture description; for `page`/`component`, describe route/props/data sources; for `job`, include trigger and retry policy; for `config`, list keys and sources.
135
+
136
+ % Style and quality requirements:
137
+ - The generated prompt must be detailed enough to yield production-ready code.
138
+ - Match the style and patterns of existing *_${LANG_OR_FRAMEWORK}.prompt files when present.
139
+ - Do not invent technologies or files; rely on the included context. If assumptions are necessary, state them explicitly and conservatively.
140
+
141
+ % Output contract:
142
+ - Return free-form text containing a single <prompt>...</prompt> XML section with the complete prompt content described above. Do not include additional commentary after the <prompt> block.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pdd-cli
3
- Version: 0.0.60
3
+ Version: 0.0.61
4
4
  Summary: PDD (Prompt-Driven Development) Command Line Interface
5
5
  Author: Greg Tanaka
6
6
  Author-email: glt@alumni.caltech.edu
@@ -53,7 +53,7 @@ Requires-Dist: build; extra == "dev"
53
53
  Requires-Dist: twine; extra == "dev"
54
54
  Dynamic: license-file
55
55
 
56
- .. image:: https://img.shields.io/badge/pdd--cli-v0.0.60-blue
56
+ .. image:: https://img.shields.io/badge/pdd--cli-v0.0.61-blue
57
57
  :alt: PDD-CLI Version
58
58
 
59
59
  .. image:: https://img.shields.io/badge/Discord-join%20chat-7289DA.svg?logo=discord&logoColor=white&link=https://discord.gg/Yp4RTh8bG7
@@ -130,7 +130,7 @@ After installation, verify:
130
130
 
131
131
  pdd --version
132
132
 
133
- You'll see the current PDD version (e.g., 0.0.60).
133
+ You'll see the current PDD version (e.g., 0.0.61).
134
134
 
135
135
  Getting Started with Examples
136
136
  -----------------------------
@@ -1,4 +1,4 @@
1
- pdd/__init__.py,sha256=DkLNT664TDBz1q2bKJ1z7tY7zRdVTF6dTex1j5DokZU,633
1
+ pdd/__init__.py,sha256=60zr1ZNOzlSl4emQ4nH962OEwIZiUFC4jsFk1CrMMHc,633
2
2
  pdd/auto_deps_main.py,sha256=cpP3bbzVL3jomrGinpzTxzIDIC8tmDDYOwUAC1TKRaw,3970
3
3
  pdd/auto_include.py,sha256=OJcdcwTwJNqHPHKG9P4m9Ij-PiLex0EbuwJP0uiQi_Y,7484
4
4
  pdd/auto_update.py,sha256=w6jzTnMiYRNpwQHQxWNiIAwQ0d6xh1iOB3xgDsabWtc,5236
@@ -6,7 +6,7 @@ pdd/bug_main.py,sha256=EtaGTuucQ7VgqOhyg4o6GFG7_QtTsDPTrRdGJWT648M,4841
6
6
  pdd/bug_to_unit_test.py,sha256=BoQqNyKQpBQDW8-JwBH_RX4RHRSiU8Kk3EplFrkECt0,6665
7
7
  pdd/change.py,sha256=Hg_x0pa370-e6oDiczaTgFAy3Am9ReCPkqFrvqv4U38,6114
8
8
  pdd/change_main.py,sha256=04VHiO_D-jlfeRn6rrVH7ZTA5agXPoJGm1StGI8--XY,27804
9
- pdd/cli.py,sha256=c5Gco_Ra1ZCZf1MtxrNZdySDhZqICHBQMSH5VBqVPEw,55162
9
+ pdd/cli.py,sha256=phCEbNXjK-3Orjg7N-yhKb5DeXAhX9s1q7sWpqPlDps,55747
10
10
  pdd/cmd_test_main.py,sha256=M-i5x26ORXurt_pu8x1sgLAyVIItbuRThiux4wBg3Ls,7768
11
11
  pdd/code_generator.py,sha256=AxMRZKGIlLh9xWdn2FA6b3zSoZ-5TIZNIAzqjFboAQs,4718
12
12
  pdd/code_generator_main.py,sha256=UtoskalEPpMAvCO-zd6xmr1lbQqSWQ7BvYgNJCybqok,35151
@@ -111,9 +111,10 @@ pdd/prompts/unfinished_prompt_LLM.prompt,sha256=vud_G9PlVv9Ig64uBC-hPEVFRk5lwpc8
111
111
  pdd/prompts/update_prompt_LLM.prompt,sha256=prIc8uLp2jqnLTHt6JvWDZGanPZipivhhYeXe0lVaYw,1328
112
112
  pdd/prompts/xml_convertor_LLM.prompt,sha256=YGRGXJeg6EhM9690f-SKqQrKqSJjLFD51UrPOlO0Frg,2786
113
113
  pdd/templates/architecture/architecture_json.prompt,sha256=uSNSsKTL-cuMMhi5a4GSpC94DKkOFAlXh7R0CUlo-hg,8126
114
- pdd_cli-0.0.60.dist-info/licenses/LICENSE,sha256=kvTJnnxPVTYlGKSY4ZN1kzdmJ0lxRdNWxgupaB27zsU,1066
115
- pdd_cli-0.0.60.dist-info/METADATA,sha256=4vSMytmX5LPnADjAlOVkZPCSf--g5FWbATtu9zo7Qqs,12687
116
- pdd_cli-0.0.60.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
117
- pdd_cli-0.0.60.dist-info/entry_points.txt,sha256=Kr8HtNVb8uHZtQJNH4DnF8j7WNgWQbb7_Pw5hECSR-I,36
118
- pdd_cli-0.0.60.dist-info/top_level.txt,sha256=xjnhIACeMcMeDfVNREgQZl4EbTni2T11QkL5r7E-sbE,4
119
- pdd_cli-0.0.60.dist-info/RECORD,,
114
+ pdd/templates/generic/generate_prompt.prompt,sha256=EIE4vCEauJglLxS8OxuMx1S4JnPexi-yXxEOpIwaRW4,9276
115
+ pdd_cli-0.0.61.dist-info/licenses/LICENSE,sha256=kvTJnnxPVTYlGKSY4ZN1kzdmJ0lxRdNWxgupaB27zsU,1066
116
+ pdd_cli-0.0.61.dist-info/METADATA,sha256=iS6Mds35DEHVnnWEfrKI0tDsInfBj7V49NUFd8UWhdI,12687
117
+ pdd_cli-0.0.61.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
118
+ pdd_cli-0.0.61.dist-info/entry_points.txt,sha256=Kr8HtNVb8uHZtQJNH4DnF8j7WNgWQbb7_Pw5hECSR-I,36
119
+ pdd_cli-0.0.61.dist-info/top_level.txt,sha256=xjnhIACeMcMeDfVNREgQZl4EbTni2T11QkL5r7E-sbE,4
120
+ pdd_cli-0.0.61.dist-info/RECORD,,