ara-cli 0.1.10.1__py3-none-any.whl → 0.1.11.0__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 ara-cli might be problematic. Click here for more details.

Files changed (57) hide show
  1. ara_cli/__init__.py +0 -1
  2. ara_cli/__main__.py +95 -2
  3. ara_cli/artefact_autofix.py +44 -6
  4. ara_cli/artefact_models/artefact_model.py +18 -6
  5. ara_cli/artefact_models/artefact_templates.py +2 -1
  6. ara_cli/artefact_models/epic_artefact_model.py +11 -2
  7. ara_cli/artefact_models/feature_artefact_model.py +31 -1
  8. ara_cli/artefact_models/userstory_artefact_model.py +13 -1
  9. ara_cli/chat.py +142 -37
  10. ara_cli/chat_agent/__init__.py +0 -0
  11. ara_cli/chat_agent/agent_communicator.py +62 -0
  12. ara_cli/chat_agent/agent_process_manager.py +211 -0
  13. ara_cli/chat_agent/agent_status_manager.py +73 -0
  14. ara_cli/chat_agent/agent_workspace_manager.py +76 -0
  15. ara_cli/directory_navigator.py +37 -4
  16. ara_cli/file_loaders/text_file_loader.py +2 -2
  17. ara_cli/global_file_lister.py +5 -15
  18. ara_cli/prompt_extractor.py +179 -71
  19. ara_cli/prompt_handler.py +160 -59
  20. ara_cli/tag_extractor.py +26 -23
  21. ara_cli/template_loader.py +1 -1
  22. ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
  23. ara_cli/templates/prompt-modules/commands/extract_general.commands.md +12 -0
  24. ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md +11 -0
  25. ara_cli/templates/prompt-modules/commands/extract_python.commands.md +13 -0
  26. ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md +36 -0
  27. ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md +53 -0
  28. ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md +95 -0
  29. ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md +34 -0
  30. ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md +27 -0
  31. ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md +39 -0
  32. ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md +40 -0
  33. ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md +48 -0
  34. ara_cli/version.py +1 -1
  35. {ara_cli-0.1.10.1.dist-info → ara_cli-0.1.11.0.dist-info}/METADATA +31 -1
  36. {ara_cli-0.1.10.1.dist-info → ara_cli-0.1.11.0.dist-info}/RECORD +41 -41
  37. tests/test_global_file_lister.py +1 -1
  38. tests/test_prompt_handler.py +12 -4
  39. ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
  40. ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -30
  41. ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -9
  42. ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -17
  43. ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -14
  44. ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -102
  45. ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -20
  46. ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -13
  47. ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -20
  48. ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -18
  49. ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -43
  50. ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -13
  51. ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -15
  52. ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -9
  53. ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -15
  54. ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -19
  55. {ara_cli-0.1.10.1.dist-info → ara_cli-0.1.11.0.dist-info}/WHEEL +0 -0
  56. {ara_cli-0.1.10.1.dist-info → ara_cli-0.1.11.0.dist-info}/entry_points.txt +0 -0
  57. {ara_cli-0.1.10.1.dist-info → ara_cli-0.1.11.0.dist-info}/top_level.txt +0 -0
@@ -1,17 +0,0 @@
1
- ### COMMANDS FOR EXTENDING EXISTING AGILE REQUIREMENTS ARTIFACTS
2
- Your job is now:
3
- * analyze the given files with respect to content and relationship
4
- * analyze the new or changed behavior with respect to content and the relationship to the existing artefacts
5
- * Develop formulation strategies that minimize formulation changes of existing changes.
6
- * generate a formulation proposal that adds the new context and or behavior for the specified documents
7
- * wrap and return the formulated in the following format
8
- ```artefact
9
- # [ ] extract
10
- # filename: {path/filename.filextension}
11
- {formulation}
12
- ```
13
- * the extract and filename statements are only allowed once per code block
14
-
15
- * Adhere strictly to established rules for AGILE PRODUCT OWNERS for high-quality specification artefacts.
16
-
17
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to formulate the new aretefacts" and then explain what kind of information you think is missing and how I could easily retrieve it
@@ -1,14 +0,0 @@
1
- ### COMMANDS FOR FORMULATING AGILE REQUIREMENTS ARTIFACTS
2
- Your job is now:
3
- * analyze the given files with respect to content and relationship
4
- * analyze the new artefact with respect to content and the relationship to the given files
5
- * generate a formulation proposal for the specified documents
6
- * wrap and return the formulated in the following format
7
- ```artefact
8
- # [ ] extract
9
- # filename: {path/filename.filextension}
10
- {formulation}
11
- ```
12
- * the extract and filename statements are only allowed once per code block
13
-
14
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to formulate the new artefacts" and then explain what kind of information you think is missing and how I could easily retrieve it
@@ -1,102 +0,0 @@
1
- ### COMMANDS FOR IMPLEMENTING A STEP IMPLEMENTATION FROM A GIVEN FEATURE FILE
2
- Your job is now:
3
- * Silently analyze the given feature file to understand the required step implementations.
4
- * Silently review any additionally provided source files to check if any reusable step implementations already exist or if the necessary support methods are available.
5
- * Develop implementation strategies that minimize code changes, prefer reusing existing methods and step definitions over new implementations.
6
- * Use this example of a simple feature file, the corresponding step definitions and the production code as best practice to get your job done
7
- """
8
- Feature file:
9
- **features/arithmetic.feature**
10
- ```gherkin
11
- Feature: Arithmetic Operations
12
-
13
- Contributes to: <Any artefact name to which this feature contributes value> <Classifier of this artefact>
14
-
15
- Scenario: Addition of two numbers
16
- Given the CLI is initialized
17
- When the user runs the addition command with "2" and "3"
18
- Then the result should be "5"
19
-
20
- Scenario Outline: Subtraction of two numbers
21
- Given the CLI is initialized
22
- When the user runs the subtraction command with "<num1>" and "<num2>"
23
- Then the result should be "<result>"
24
-
25
- Examples:
26
- | num1 | num2 | result |
27
- | 5 | 3 | 2 |
28
- | 10 | 4 | 6 |
29
- | 0 | 0 | 0 |
30
- ```
31
-
32
- Step Definitions in Python with behave as BDD test framework:
33
- **features/steps/arithmetic_steps.py**
34
- ```python
35
- import subprocess
36
- from behave import given, when, then
37
-
38
- @given('the CLI is initialized')
39
- def step_given_cli_initialized(context):
40
- context.cli_command = 'python path/to/your_arithmetic_script.py'
41
-
42
- @when('the user runs the addition command with "{num1}" and "{num2}"')
43
- def step_when_user_runs_addition_command(context, num1, num2):
44
- context.result = subprocess.run(
45
- [context.cli_command, 'add', num1, num2],
46
- capture_output=True,
47
- text=True
48
- ).stdout.strip()
49
-
50
- @when('the user runs the subtraction command with "{num1}" and "{num2}"')
51
- def step_when_user_runs_subtraction_command(context, num1, num2):
52
- context.result = subprocess.run(
53
- [context.cli_command, 'subtract', num1, num2],
54
- capture_output=True,
55
- text=True
56
- ).stdout.strip()
57
-
58
- @then('the result should be "{expected_result}"')
59
- def step_then_result_should_be(context, expected_result):
60
- assert context.result == expected_result, f"Expected {expected_result} but got {context.result}"
61
- ```
62
-
63
- CLI Script as example production code to satisfiy the interfaces defined in the step definitions (DO NOT GENERATE ANY PRODUCTION CODE NOW):
64
- **your_arithmetic_script.py**
65
- ```python
66
- import sys
67
-
68
- def add(a, b):
69
- return int(a) + int(b)
70
-
71
- def subtract(a, b):
72
- return int(a) - int(b)
73
-
74
- if __name__ == "__main__":
75
- if len(sys.argv) != 4:
76
- print("Usage: python your_arithmetic_script.py <operation> <num1> <num2>")
77
- sys.exit(1)
78
-
79
- operation = sys.argv[1]
80
- num1 = sys.argv[2]
81
- num2 = sys.argv[3]
82
-
83
- if operation == 'add':
84
- print(add(num1, num2))
85
- elif operation == 'subtract':
86
- print(subtract(num1, num2))
87
- else:
88
- print(f"Unknown operation: {operation}")
89
- sys.exit(1)
90
- ```
91
- """
92
- * Systematically search and check if any of the new step definitions is already existing in any given step file. It must then be omitted in the new step definitions generation. Otherwise it will create an ambiguous steps error in the behave registry.
93
- * return the generated step definitions in this format:
94
- ```python
95
- # [ ] extract
96
- # filename: {path/filename}.py
97
- {python code}
98
- ```
99
-
100
- * The extract and filename statements are only allowed once per code block.
101
- * Adhere strictly to established rules for high-quality Python code and architecture.
102
- * If essential information is missing for code generation, issue a warning: "WARNING: Information is missing to do a correct step implementation." Specify what information is lacking and suggest how it might be retrieved.
@@ -1,20 +0,0 @@
1
- ### COMMANDS FOR IMPLEMENTING THE INTENDED GOAL
2
- Your job is now:
3
- * Silently analyze the intended behavior and draft potential new implementations in pseudo code.
4
- * Silently review the provided source files to understand both the current behavior and the intended new implementation.
5
- * Develop implementation strategies that minimize code changes, prefer reusing existing methods over new implementations.
6
- * Output a "change table" listing all necessary changes. Include an example line for reference:
7
- | filename | method | short description of intended changes |
8
- | {filename}.py | {method name of existing or new method} | {detailed explanation of the changes serving as code generation prompt} |
9
-
10
- * Implement the changes as specified in the change table, ensuring your generated code blocks are not just code snippets but at complete method levels. Use for every single generated code block this format:
11
- ```python
12
- # [ ] extract
13
- # filename: {path/filename}.py
14
- {python code}
15
- ```
16
- * the extract and filename statements are only allowed once per code block
17
-
18
- * Adhere strictly to established rules for high-quality Python code and architecture.
19
-
20
- * If essential information is missing for code generation, issue a warning: "WARNING: Information is missing to do a correct implementation." Specify what information is lacking and suggest how it might be retrieved.
@@ -1,13 +0,0 @@
1
- ### COMMANDS FOR AN OBVIOUS IMPLEMENTATION THE INTENDED GOAL
2
- Your job is now:
3
- * remember you are strictly following your given RULES AS EXPERT PYTHON DEVELOPER for code and architectural code quality
4
- * change only code that must changed
5
- * Implement the code ensuring your generated code blocks are not just code snippets but at complete method levels. Use for every single generated code block this format:
6
- ```python
7
- # [ ] extract
8
- # filename: {path/filename}.py
9
- {python code}
10
- ```
11
- * the extract and filename statements are only allowed once per code block
12
-
13
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to formulate the new aretefacts" and then explain what kind of information you think is missing and how I could easily retrieve it
@@ -1,20 +0,0 @@
1
- ### COMMANDS FOR ERROR FIXING
2
- Your job is now to fix the error:
3
- * Silently analyze the described error and draft a potential solution to the fix the error
4
- * Silently review the provided source files to understand both the current faulty implementation and the intended changes to fix the error.
5
- * Develop implementation strategies that minimize code changes, prefer reusing existing methods over new implementations.
6
- * Output a "change table" listing all necessary changes. Include an example line for reference:
7
- | filename | method | short description of intended changes |
8
- | {filename}.py | {method name of existing or new method} | {detailed explanation of the changes serving as code generation prompt} |
9
-
10
- * Implement the changes as specified in the change table, ensuring your generated code blocks are not just code snippets but at complete method levels. Use for every single generated code block this format:
11
- ```python
12
- # [ ] extract
13
- # filename: {path/filename}.py
14
- {python code}
15
- ```
16
- * the extract and filename statements are only allowed once per code block
17
-
18
- * Adhere strictly to established rules for high-quality Python code and architecture.
19
-
20
- * If essential information is missing for code generation, issue a warning: "WARNING: Information is missing to do a correct implementation." Specify what information is lacking and suggest how it might be retrieved.
@@ -1,18 +0,0 @@
1
- ### COMMANDS FOR UPDATING THE FORMULATION OF FEATURE FILES
2
- Your job is now:
3
- * Examine the designated feature file, ensuring it aligns with the content and its relationships within the context files.
4
- * If there is a discrepancy between the feature's specifications and the system behavior described in the context files, defer to the behavior outlined in the context files. This also applies to behaviors not yet described in the existing feature file.
5
- * return a table of your five top rated proposed enhancements sorted by the "Formulation enhancement rating" and formatted in the following way (one example line is given as reference):
6
- | Number | filename | Scenario name | Line of feature file (from - to) | Formulation enhancement rating (0 - 1) | explanation of enhancement |
7
- | 1 | file.feature | some_scenario | 30-65 | 0.9 | {here comes an explanation and reasoning of the updated formulation and a reference to the context source} |
8
-
9
- * Propose a revised formulation for the feature file based on the analysis.
10
- * wrap and return the revised formulation in the following format
11
- ```artefact
12
- # [ ] extract
13
- # filename: {path/artefac_filename.feature}
14
- {formulation}
15
- ```
16
- * the extract and filename statements are only allowed once per code block
17
-
18
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to update the formulation of the designated feature file" and then explain what kind of information you think is missing and how I could easily retrieve it
@@ -1,43 +0,0 @@
1
- ### COMMANDS FOR FORMULATING AGILE REQUIREMENTS ARTIFACTS
2
- Your job is now:
3
- * remember your RULES
4
- * analyze the given files with respect to content and relationship
5
- * analyze the new artefact with respect to content and the relationship to the given files
6
- * generate a formulation proposal for the specified documents
7
-
8
- * Use this example of a simple feature file, the corresponding step definitions and the production code as best practice to get your job done
9
- """
10
- Feature file:
11
- **features/arithmetic.feature**
12
- ```gherkin
13
- Feature: Arithmetic Operations
14
-
15
- Contributes to: <Any artefact name to which this feature contributes value> <Classifier of this artefact>
16
-
17
- Scenario: Addition of two numbers
18
- Given the CLI is initialized
19
- When the user runs the addition command with "2" and "3"
20
- Then the result should be "5"
21
-
22
- Scenario Outline: Subtraction of two numbers
23
- Given the CLI is initialized
24
- When the user runs the subtraction command with "<num1>" and "<num2>"
25
- Then the result should be "<result>"
26
-
27
- Examples:
28
- | num1 | num2 | result |
29
- | 5 | 3 | 2 |
30
- | 10 | 4 | 6 |
31
- | 0 | 0 | 0 |
32
- ```
33
-
34
- * wrap and return the formulated feature in the following format
35
- ```artefact
36
- # [ ] extract
37
- # filename: {path/filename.filextension}
38
- {formulation}
39
- ```
40
- * the extract and filename statements are only allowed once per code block
41
-
42
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to formulate the new artefacts" and then explain what kind of information you think is missing and how I could easily retrieve it
43
-
@@ -1,13 +0,0 @@
1
- ### COMMANDS FOR AN OBVIOUS IMPLEMENTATION THE INTENDED GOAL
2
- Your job is now:
3
- * remember you are strictly following your given RULES AS EXPERT JAVASCRIPT DEVELOPER for code and architectural code quality
4
- * change only code that must changed
5
- * Implement the code ensuring your generated code blocks are not just code snippets but at complete method levels. Use for every single generated code block this format:
6
- ```js
7
- # [ ] extract
8
- # filename: {path/filename}.js
9
- {js code}
10
- ```
11
- * the extract and filename statements are only allowed once per code block
12
-
13
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to formulate the new aretefacts" and then explain what kind of information you think is missing and how I could easily retrieve it
@@ -1,15 +0,0 @@
1
- ### COMMANDS FOR REFACTORING
2
- Your job is now
3
- * remember you are strictly following your given RULES AS EXPERT PYTHON DEVELOPER
4
- * analyze again the given files with regard to the intended refactoring
5
- * refactor to enhance the code as indended
6
- * return code as fully refactored methods and not as code snippets
7
- * return the code in the following format, ensuring your generated code blocks are not just code snippets but at complete method levels. Use for every single generated code block this format:
8
- ```python
9
- # [ ] extract
10
- # filename: {path/filename}.py
11
- {python code}
12
- ```
13
- * the extract and filename statements are only allowed once per code block
14
-
15
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to formulate the new aretefacts" and then explain what kind of information you think is missing and how I could easily retrieve it
@@ -1,9 +0,0 @@
1
- ### COMMANDS FOR REFACTORING ANALYSIS
2
- Your job is now:
3
- * remember you are strictly following your given RULES AS EXPERT PYTHON DEVELOPER
4
- * analyze the intended refactoring and make a list of potential code enhancements with regard to the given files
5
- * return a table of your five top rated proposed enhancements sorted by the "Code enhancement rating" and formatted in the following way (one example line is given as reference):
6
- | Number | filename | method name | Line of code (from - to) | Code enhancement rating (0 - 1) | explanation of enhancement |
7
- | 1 | file.py | some_method | 30-65 | 0.9 | {here comes an explanation that on the level of a precise and detailed refactoring prompt} |
8
-
9
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to formulate the new aretefacts" and then explain what kind of information you think is missing and how I could easily retrieve it
@@ -1,15 +0,0 @@
1
- ### COMMANDS FOR REVERSE ENGINEER A FEATURE FILE FROM EXISTING CODE
2
- Your job is now:
3
- * remember you are strictly following your given RULES AS GHERKIN EXPERT
4
- * Silently analyze the intended behavior of the given code and if given any other description of the program flow like pseudo code
5
- * do not add any additional behavior in the feature file, describe strictly the behavior that is defined by code or pseudo code
6
- * if any existing feature files are provided maximize reusage of formulated steps so that later step implementation effort can be reduces
7
-
8
- * return your results in the following format
9
- ```gherkin
10
- # [ ] extract
11
- # filename: {path/filename}.feature
12
- {feature file}
13
- ```
14
-
15
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to correctly fullfill the job!" and then explain what kind of information you think is missing and how I could easily retrieve it.
@@ -1,19 +0,0 @@
1
- ### COMMANDS FOR REVERSE ENGINEER PROGRAM FLOW FROM EXISTING CODE
2
- Your job is now:
3
- * remember you are strictly following your given RULES AS CODE ANAYLST
4
- * Silently analyze the intended behavior of the given code
5
- * create as result of your silent analysis this analysis table
6
- | filename | method | short description of logical contribution to the logical program flow |
7
- | {filename}.py | {method name, descriptive name of code block} | {detailed explanation of the value to the program flow} |
8
-
9
- * then generate based on your analysis and by using your generated analysis table the pseudo code that summarizes the logical flow for the whole process to generate the listing from start to end. Here is an example how the pseude code could look like:
10
- ```pseudo code
11
- Initialize the system to prepare for use
12
- Verify if the user is authenticated
13
- IF the user is authenticated:
14
- Retrieve and process user information
15
- ELSE:
16
- Display an error message if authentication fails
17
- ```
18
-
19
- * in case you think information is missing in order to generate a suffiently precise formulation, return a warning "WARNING: information is missing to correctly fullfill the job!" and then explain what kind of information you think is missing and how I could easily retrieve it.