ara-cli 0.1.10.5__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.
- ara_cli/__init__.py +0 -1
- ara_cli/__main__.py +23 -49
- ara_cli/chat.py +142 -18
- ara_cli/chat_agent/__init__.py +0 -0
- ara_cli/chat_agent/agent_communicator.py +62 -0
- ara_cli/chat_agent/agent_process_manager.py +211 -0
- ara_cli/chat_agent/agent_status_manager.py +73 -0
- ara_cli/chat_agent/agent_workspace_manager.py +76 -0
- ara_cli/directory_navigator.py +37 -4
- ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
- ara_cli/templates/prompt-modules/commands/extract_general.commands.md +12 -0
- ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md +11 -0
- ara_cli/templates/prompt-modules/commands/extract_python.commands.md +13 -0
- ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md +36 -0
- ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md +53 -0
- ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md +95 -0
- ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md +34 -0
- ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md +27 -0
- ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md +39 -0
- ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md +40 -0
- ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md +48 -0
- ara_cli/version.py +1 -1
- {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.11.0.dist-info}/METADATA +31 -1
- {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.11.0.dist-info}/RECORD +27 -28
- ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
- ara_cli/templates/prompt-modules/blueprints/pytest_unittest_prompt.blueprint.md +0 -32
- ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -30
- ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -9
- ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -17
- ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -14
- ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -102
- ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -20
- ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -13
- ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -20
- ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -18
- ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -43
- ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -13
- ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -15
- ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -9
- ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -15
- ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -19
- {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.11.0.dist-info}/WHEEL +0 -0
- {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.11.0.dist-info}/entry_points.txt +0 -0
- {ara_cli-0.1.10.5.dist-info → ara_cli-0.1.11.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
### COMMANDS FOR FIXING BUGS
|
|
2
|
+
|
|
3
|
+
Your job is now to fix the described error:
|
|
4
|
+
|
|
5
|
+
* Silently analyze the given error description or error log files
|
|
6
|
+
* Silently review the provided source files and if given the provided feature file (specified behavior) to understand the current faulty implementation and draft silently a potential solution to fix the error
|
|
7
|
+
* Develop implementation strategies that minimize code changes, prefer reusing existing methods over new implementations. Also always prefer to use existing python packages over your own implementation.
|
|
8
|
+
|
|
9
|
+
When you touch code or need to generate code for bug fixing:
|
|
10
|
+
* The max function or method length should not exceed 40 lines.
|
|
11
|
+
* The max class length should not exceed 150 lines.
|
|
12
|
+
* The max file length should not exceed 150 lines.
|
|
13
|
+
* Split implementation files or functions/methods/classes in case they exceed their defined length maximum.
|
|
14
|
+
* Apply as coding and design principle the separation of concerns and single responsibility principle in general and specifically when you need to split.
|
|
15
|
+
|
|
16
|
+
* Important: you are NOT allowed to do any further refactorings not related to the bug fixing implementation. Refactoring for enhancing the code quality is not allowed.
|
|
17
|
+
* The fixed code must fully implement the specified behavior in an easy testable and modular/extensible way.
|
|
18
|
+
* Follow PEP8 coding guidelines.
|
|
19
|
+
* Use descriptive numpy style docstrings for inline method and class documentation.
|
|
20
|
+
* Use the python logger logging package to implement logging for all application modules that enables a fine granular full observability of the program flow by the log file. Use ./logs/<module_name>.log as filepath for logging.
|
|
21
|
+
|
|
22
|
+
* Only return full copy pastable file content.
|
|
23
|
+
* Use for every single generated code block this markdown code block format:
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
# [ ] extract
|
|
27
|
+
# filename: src/{filename}.py
|
|
28
|
+
{python code}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
* The extract and filename statements are only allowed once per code block
|
|
32
|
+
* The first character of the first line inside your code block must be '#' and the first character of the second line inside your code block must be '#'
|
|
33
|
+
* replace the '# [ ] extract' statement of the template with '# [x] extract' in your response
|
|
34
|
+
* in case of files get deprecated give me a list of files that can be safely deleted
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
### COMMANDS FOR IMPLEMENTING ONE OR A SET OF NEW OR CHANGED FEATURE FILES
|
|
2
|
+
|
|
3
|
+
Your job is now:
|
|
4
|
+
* Silently analyze the given feature files and the specified behavior.
|
|
5
|
+
* Develop implementation strategies that minimize code changes with respect to any given code and test files, prefer reusing existing methods over new implementations.
|
|
6
|
+
* The max function length should not exceed 25 lines. The max file length should not exceed 120 lines.
|
|
7
|
+
* Always prefer to use existing python packages over your own implementation.
|
|
8
|
+
* In case additional implementation instructions are given as:
|
|
9
|
+
* Specified in files with extensions "*.technology.md" follow strictly the specified mandatory python packages and tech stack
|
|
10
|
+
* Explicitly specified as example reference implementation: use this reference information as starting point for your own implementation
|
|
11
|
+
* Fully implement the specified behavior in an easy testable and modular/extensible way, fully implement unit tests for your production code (try to achieve at least 90% code coverage) and implement for all given feature files the corresponding step definitions. Follow PEP8 coding guidelines, use numpy style docstrings for inline function documentation, apply as coding and design principle the separation of concerns and single responsibility principle.
|
|
12
|
+
* Generated or reworked python methods must not exceed 25 lines of code. In case methods exceed this length they need to be split according to the single responsibility principle and separation of concerns.
|
|
13
|
+
* Generated or reworked python files must not exceed 120 lines of code. In case files exceed this length they need to be split according to the single responsibility principle and separation of concerns.
|
|
14
|
+
* Use the python logger logging package to implement logging for all application modules that enable a full observability of the program flow over the log file. Use ./logs/<module_name>.log as filepath for logging.
|
|
15
|
+
|
|
16
|
+
* Only return full copy pastable file content for production code, unit test files and step definition files. Use for every single generated code block this markdown code block format:
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
# [ ] extract
|
|
20
|
+
# filename: src/{filename}.py
|
|
21
|
+
{python code}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
* The extract and filename statements are only allowed once per markdown code block
|
|
25
|
+
* The first character of the first line inside your code block must be '#' and the first character of the second line inside your code block must be '#'
|
|
26
|
+
* replace the '# [ ] extract' statement of the template with '# [x] extract' in your response
|
|
27
|
+
* in case of files get deprecated give me a list of files that can be safely deleted
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
### COMMANDS FOR REFACTORING
|
|
2
|
+
|
|
3
|
+
Your job is now to refactor the code for enhancing the code quality and the design of the code according to the following guidelines:
|
|
4
|
+
* Refactoring = Changing the internal structure of code
|
|
5
|
+
* Without changing its external behavior
|
|
6
|
+
* Goal = Improve readability, maintainability, and design
|
|
7
|
+
-> "Refactoring is a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior."
|
|
8
|
+
-> "Refactoring changes how code is written, not what it does."
|
|
9
|
+
|
|
10
|
+
Now do:
|
|
11
|
+
* Silently analyze the given code base
|
|
12
|
+
* Silently analyze the given feature file (specified behavior) to fully understand the flow and logic of the current implementation. Remember: you are not allowed to change specified behavior.
|
|
13
|
+
|
|
14
|
+
When you refactor the code remember:
|
|
15
|
+
* The max function or method length should not exceed 40 lines.
|
|
16
|
+
* The max class length should not exceed 150 lines.
|
|
17
|
+
* The max file length should not exceed 150 lines.
|
|
18
|
+
* Split implementation files or functions/methods/classes in case they exceed their defined length maximum.
|
|
19
|
+
* Apply as coding and design principle the separation of concerns and single responsibility principle in general and specifically when you need to split.
|
|
20
|
+
* Flatten nested code structures (e.g. if/while/for statements) to only one nesting level.
|
|
21
|
+
* The refactored code must fully implement the specified behavior in an easy testable and modular/extensible way.
|
|
22
|
+
* Follow PEP8 coding guidelines.
|
|
23
|
+
* Use descriptive numpy style docstrings for inline method and class documentation.
|
|
24
|
+
* Use the python logger logging package to implement logging for all application modules that enables a fine granular full observability of the program flow by the log file. Use ./logs/<module_name>.log as filepath for logging.
|
|
25
|
+
|
|
26
|
+
Your output specification is:
|
|
27
|
+
* Only return full copy pastable file content.
|
|
28
|
+
* Use for every single generated code block this markdown code block format:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
# [ ] extract
|
|
32
|
+
# filename: src/{filename}.py
|
|
33
|
+
{python code}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
* The extract and filename statements are only allowed once per markdown code block
|
|
37
|
+
* The first character of the first line inside your code block must be '#' and the first character of the second line inside your code block must be '#'
|
|
38
|
+
* replace the '# [ ] extract' statement of the template with '# [x] extract' in your response
|
|
39
|
+
* in case of files get deprecated give me a list of files that can be safely deleted
|
ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
### COMMANDS FOR CREATING AND CORRECTING STEP DEFINITIONS FOR FEATURE FILES
|
|
2
|
+
|
|
3
|
+
**MANDATORY INPUT VALIDATION:**
|
|
4
|
+
- Feature files (.feature) must be provided
|
|
5
|
+
- Behave test report must be provided
|
|
6
|
+
|
|
7
|
+
**PROMPT DEFINITION ERROR:** If mandatory input is missing, immediately stop and return: "ERROR: Missing mandatory input. Please provide both feature files (.feature) and behave test report before proceeding."
|
|
8
|
+
|
|
9
|
+
**OPTIONAL INPUT:**
|
|
10
|
+
- Already existing step definitions
|
|
11
|
+
|
|
12
|
+
**PROMPT DEFINITION WARNING:** If optional input is missing: "WARNING: No existing step definitions provided. If step definitions already exist in your project, please include them as input context to avoid duplication and ensure consistency."
|
|
13
|
+
|
|
14
|
+
### Your job is now:
|
|
15
|
+
* Silently analyze the given feature files and behave test report to understand current test failures and missing step implementations.
|
|
16
|
+
* Silently review any provided existing step definitions to avoid duplication and maintain consistency.
|
|
17
|
+
* Develop step definition implementation strategies that minimize code changes with respect to existing step definitions, prefer reusing existing step patterns over new implementations.
|
|
18
|
+
* The max function length should not exceed 25 lines. The max file length should not exceed 120 lines.
|
|
19
|
+
* Always prefer to use existing python packages over your own implementation.
|
|
20
|
+
* Use the behave testing framework for all step definition implementations.
|
|
21
|
+
* Apply mocking extensively to isolate step definitions from external inputs and interfaces using unittest.mock or pytest-mock.
|
|
22
|
+
* Fully implement all missing step definitions for the given feature files in an easy testable and modular/extensible way. Follow PEP8 coding guidelines, use numpy style docstrings for inline function documentation, apply as coding and design principle the separation of concerns and single responsibility principle.
|
|
23
|
+
* Generated or reworked python methods must not exceed 25 lines of code. In case methods exceed this length they need to be split according to the single responsibility principle and separation of concerns.
|
|
24
|
+
* Generated or reworked python files must not exceed 120 lines of code. In case files exceed this length they need to be split according to the single responsibility principle and separation of concerns.
|
|
25
|
+
* Implement proper assertion methods that provide clear error messages when steps fail.
|
|
26
|
+
* Use context.scenario, context.feature, and context.table appropriately for data sharing between steps.
|
|
27
|
+
* Implement proper cleanup in @after_scenario and @after_feature hooks when necessary.
|
|
28
|
+
|
|
29
|
+
* Only return full copy pastable file content for step definition files. Use for every single generated code block this markdown code block format:
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
# [ ] extract
|
|
33
|
+
# filename: ara/features/steps/{filename}_steps.py
|
|
34
|
+
{python code}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
* The extract and filename statements are only allowed once per markdown code block
|
|
38
|
+
* The first character of the first line inside your code block must be '#' and the first character of the second line inside your code block must be '#'
|
|
39
|
+
* replace the '# [ ] extract' statement of the template with '# [x] extract' in your response
|
|
40
|
+
* in case of files get deprecated give me a list of files that can be safely deleted
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
### COMMANDS FOR CREATING AND CORRECTING UNIT TESTS
|
|
2
|
+
|
|
3
|
+
**MANDATORY INPUT VALIDATION:**
|
|
4
|
+
- Feature files (.feature) must be provided
|
|
5
|
+
- Code coverage report or pytest test report must be provided
|
|
6
|
+
|
|
7
|
+
**PROMPT DEFINITION ERROR:** If mandatory input is missing, immediately stop and return: "ERROR: Missing mandatory input. Please provide both feature files (.feature) and code coverage/pytest test report before proceeding."
|
|
8
|
+
|
|
9
|
+
**OPTIONAL INPUT:**
|
|
10
|
+
- Already existing unit tests
|
|
11
|
+
|
|
12
|
+
**PROMPT DEFINITION WARNING:** If optional input is missing: "WARNING: No existing unit tests provided. If unit tests already exist in your project, please include them as input context to avoid duplication and ensure consistency."
|
|
13
|
+
|
|
14
|
+
#### Your job is now:
|
|
15
|
+
* Silently analyze the given feature files and code coverage/pytest test report to understand current test gaps and implementation requirements.
|
|
16
|
+
* Silently review any provided existing unit tests to avoid duplication and maintain consistency with existing test patterns.
|
|
17
|
+
* Develop unit test implementation strategies that minimize code changes with respect to existing tests, prefer reusing existing test patterns and fixtures over new implementations.
|
|
18
|
+
* The max function length should not exceed 25 lines. The max file length should not exceed 120 lines.
|
|
19
|
+
* Always prefer to use existing python packages over your own implementation.
|
|
20
|
+
* Use the pytest testing framework for all unit test implementations.
|
|
21
|
+
* Apply mocking extensively to isolate unit tests from external inputs and interfaces using unittest.mock or pytest-mock. Mock all external dependencies, file I/O, network calls, and database interactions.
|
|
22
|
+
* Fully implement comprehensive unit tests that achieve at least 90% code coverage for the specified behavior in an easy maintainable and modular/extensible way. Follow PEP8 coding guidelines, use numpy style docstrings for inline function documentation, apply as coding and design principle the separation of concerns and single responsibility principle.
|
|
23
|
+
* Generated or reworked python methods must not exceed 25 lines of code. In case methods exceed this length they need to be split according to the single responsibility principle and separation of concerns.
|
|
24
|
+
* Generated or reworked python files must not exceed 120 lines of code. In case files exceed this length they need to be split according to the single responsibility principle and separation of concerns.
|
|
25
|
+
|
|
26
|
+
* Implement comprehensive test cases covering:
|
|
27
|
+
- Happy path scenarios
|
|
28
|
+
- Edge cases and boundary conditions
|
|
29
|
+
- Error handling and exception scenarios
|
|
30
|
+
- Input validation scenarios
|
|
31
|
+
|
|
32
|
+
* Use pytest fixtures for test data setup and teardown to ensure test isolation.
|
|
33
|
+
* Implement parametrized tests using @pytest.mark.parametrize for testing multiple input combinations efficiently.
|
|
34
|
+
* Use descriptive test method names that clearly indicate what is being tested.
|
|
35
|
+
* Include proper assertions with meaningful error messages.
|
|
36
|
+
|
|
37
|
+
* Only return full copy pastable file content for unit test files. Use for every single generated code block this markdown code block format:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
# [ ] extract
|
|
41
|
+
# filename: test/test_{filename}.py
|
|
42
|
+
{python code}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
* The extract and filename statements are only allowed once per markdown code block
|
|
46
|
+
* The first character of the first line inside your code block must be '#' and the first character of the second line inside your code block must be '#'
|
|
47
|
+
* replace the '# [ ] extract' statement of the template with '# [x] extract' in your response
|
|
48
|
+
* in case of files get deprecated give me a list of files that can be safely deleted
|
ara_cli/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# version.py
|
|
2
|
-
__version__ = "0.1.
|
|
2
|
+
__version__ = "0.1.11.0" # fith parameter like .0 for local install test purposes only. official numbers should be 4 digit numbers
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ara_cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11.0
|
|
4
4
|
Summary: Powerful, open source command-line tool for managing, structuring and automating software development artifacts in line with Business-Driven Development (BDD) and AI-assisted processes
|
|
5
5
|
Description-Content-Type: text/markdown
|
|
6
6
|
Requires-Dist: langfuse
|
|
@@ -20,6 +20,7 @@ Requires-Dist: pydantic_ai
|
|
|
20
20
|
Requires-Dist: python-docx
|
|
21
21
|
Requires-Dist: pymupdf4llm
|
|
22
22
|
Requires-Dist: typer
|
|
23
|
+
Requires-Dist: psutil
|
|
23
24
|
Dynamic: description
|
|
24
25
|
Dynamic: description-content-type
|
|
25
26
|
Dynamic: requires-dist
|
|
@@ -130,6 +131,35 @@ ara autofix
|
|
|
130
131
|
|
|
131
132
|
See `ara -h` for the complete list of commands and usage examples.
|
|
132
133
|
|
|
134
|
+
---
|
|
135
|
+
## Agent Commands
|
|
136
|
+
|
|
137
|
+
`ara-cli` includes powerful agent-based capabilities that can be accessed through the interactive chat. These agents can perform complex, multi-step tasks, such as conducting interviews or automating coding workflows.
|
|
138
|
+
|
|
139
|
+
To use the agent commands, first start an interactive chat session:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
ara prompt chat <artefact_classifier> <artefact_name>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Once inside the chat, you can use the following commands to manage agents:
|
|
146
|
+
|
|
147
|
+
| Command | Shortcut | Description |
|
|
148
|
+
| ---------------- | -------- | ------------------------------------------------- |
|
|
149
|
+
| `AGENT_RUN` | `a` | Run an agent by name. |
|
|
150
|
+
| `AGENT_STOP` | `as` | Stop the currently running agent. |
|
|
151
|
+
| `AGENT_CONTINUE` | `ac` | Continue the agent's operation without new input. |
|
|
152
|
+
| `AGENT_STATUS` | `astat` | Show the status of the current agent. |
|
|
153
|
+
| `exit` | | Exit from agent interfacto back to chat. |
|
|
154
|
+
|
|
155
|
+
**Example:**
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
ara> a interview_agent
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Important:** The agent functionality requires the `ara-agents` package to be installed separately. If you do not have `ara-agents` installed, please contact the Talsen Team for assistance.
|
|
162
|
+
|
|
133
163
|
---
|
|
134
164
|
|
|
135
165
|
## Artefact Structure
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
ara_cli/__init__.py,sha256=
|
|
2
|
-
ara_cli/__main__.py,sha256=
|
|
1
|
+
ara_cli/__init__.py,sha256=w_BYefMe7IdHoAycBTn0VxHr686Ha9oCCVnO5eWjeTU,504
|
|
2
|
+
ara_cli/__main__.py,sha256=mT5ljAyzjYtWFcuO7DR455f9QLZHpWtDfN0Cpw4kwHA,11411
|
|
3
3
|
ara_cli/ara_command_action.py,sha256=yWtZXxwGp-n5kl-I6bMvwESfyRVGHHBYHVapu-8knl4,24618
|
|
4
4
|
ara_cli/ara_config.py,sha256=vZsY2zYJdlSExRE84L5LqRH3DjveeuMSmG5fC8HDIVc,9794
|
|
5
5
|
ara_cli/artefact_autofix.py,sha256=wLAWKGjhNqXZjsBqy98L3ZpDzg8S5OzFeroJBxGyAAw,26308
|
|
@@ -11,13 +11,13 @@ ara_cli/artefact_lister.py,sha256=M-ggazAgZ-OLeW9NB48r_sd6zPx0p4hEpeS63qHwI1A,41
|
|
|
11
11
|
ara_cli/artefact_reader.py,sha256=-6E1VhIlh2oJE1Rn8ARcHRc_E9N4uk8cEViKMoywm6E,7753
|
|
12
12
|
ara_cli/artefact_renamer.py,sha256=8S4QWD19_FGKsKlWojnu_RUOxx0u9rmLugydM4s4VDc,4219
|
|
13
13
|
ara_cli/artefact_scan.py,sha256=qY2Gp4zVcqMXhtuP7rICW0UBG4pcj3W2ABofnL9SIG8,4806
|
|
14
|
-
ara_cli/chat.py,sha256=
|
|
14
|
+
ara_cli/chat.py,sha256=_1xjUPuBWFxeXQ-9QDf1pJe5x7Xr9lEaSkeQMrCTpYg,44337
|
|
15
15
|
ara_cli/classifier.py,sha256=zWskj7rBYdqYBGjksBm46iTgVU5IIf2PZsJr4qeiwVU,1878
|
|
16
16
|
ara_cli/codefusionretriever.py,sha256=fCHgXdIBRzkVAnapX-KI2NQ44XbrrF4tEQmn5J6clUI,1980
|
|
17
17
|
ara_cli/codehierachieretriever.py,sha256=Xd3EgEWWhkSf1TmTWtf8X5_YvyE_4B66nRrqarwSiTU,1182
|
|
18
18
|
ara_cli/commandline_completer.py,sha256=b00Dqb5n7SecpxYIDLxAfYhp8X6e3c8a5qYz6ko0i3E,1192
|
|
19
19
|
ara_cli/completers.py,sha256=V4bcmUnuFkdgMpJ3bLAL7cnxinxZb8wwB17WnRHIrHM,5404
|
|
20
|
-
ara_cli/directory_navigator.py,sha256=
|
|
20
|
+
ara_cli/directory_navigator.py,sha256=mr34qhuz8MT2Qj_sTddffCB2nzYpWCg9AWLPdaFjeOM,4518
|
|
21
21
|
ara_cli/error_handler.py,sha256=nNaJSq82f3xiz_QFRKPg5kX_-oI-UoFdRJ2OTj1AR18,4019
|
|
22
22
|
ara_cli/file_classifier.py,sha256=nUcNrhflUydCyCRbXHjEEXYwwwfUm65lYnNEvc86fpM,4026
|
|
23
23
|
ara_cli/file_lister.py,sha256=0C-j8IzajXo5qlvnuy5WFfe43ALwJ-0JFh2K6Xx2ccw,2332
|
|
@@ -34,7 +34,7 @@ ara_cli/tag_extractor.py,sha256=vjuPGGlT3mQpez6eY9LLgIBFQqPsTEgfAWODbXlgODc,4057
|
|
|
34
34
|
ara_cli/template_loader.py,sha256=nYQ4zadcXX6oXSNgFNlXx8u5961BZCj3dw0tSKHdNfE,10756
|
|
35
35
|
ara_cli/template_manager.py,sha256=l2c785YHB7m0e2TjE0CX-nwXrS4v3EiT9qrS5KuatAc,7105
|
|
36
36
|
ara_cli/update_config_prompt.py,sha256=moqj2Kha7S7fEGzTReU0v2y8UjXC8QfnoiieOQr35C4,5157
|
|
37
|
-
ara_cli/version.py,sha256=
|
|
37
|
+
ara_cli/version.py,sha256=A7GCqR2NtmlH854O1ujcswyBm-a8O6nrMFHIv3aoNHQ,146
|
|
38
38
|
ara_cli/ara_subcommands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
ara_cli/ara_subcommands/autofix.py,sha256=h7-6hV97Q6PisUJ_U1Qs4sHYwkHsDpeYH63y_LQsfSc,1095
|
|
40
40
|
ara_cli/ara_subcommands/chat.py,sha256=9zorWKbM0ulu9xFhW2tzV5vl8hCLOCjcp2E9hYgZJ90,1239
|
|
@@ -74,6 +74,11 @@ ara_cli/artefact_models/serialize_helper.py,sha256=Wks30wy-UrwJURetydKykLgJkdGRg
|
|
|
74
74
|
ara_cli/artefact_models/task_artefact_model.py,sha256=1BSMbz9D-RXvdpdd0RlAr9hUx84Rcuysk2YfQC8Qy14,6046
|
|
75
75
|
ara_cli/artefact_models/userstory_artefact_model.py,sha256=P5an9UrZ1QrQ57TxSJ48F2OwKxhqEz1B-QxTtHeSZFI,7172
|
|
76
76
|
ara_cli/artefact_models/vision_artefact_model.py,sha256=frjaUJj-mmIlVHEhzAQztCGs-CtvNu_odSborgztfzo,5251
|
|
77
|
+
ara_cli/chat_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
|
+
ara_cli/chat_agent/agent_communicator.py,sha256=Tru2o7LZ0n2iQ1ip01ZFt5d9iwAI6Pcgj6NBK5OF1_A,2349
|
|
79
|
+
ara_cli/chat_agent/agent_process_manager.py,sha256=k_AfG1pr2xbhDVSUm79r5RnOKpdzCvTS3VpUpgIvHUA,7349
|
|
80
|
+
ara_cli/chat_agent/agent_status_manager.py,sha256=CflNgTKjF6MnyiU_5u97LUfpUw9vvAdDm71xFROSupY,2337
|
|
81
|
+
ara_cli/chat_agent/agent_workspace_manager.py,sha256=2Oj8GP6qpme9kTI0Ele3H9VNJr2O6VpuHE8-nsy3LRE,2683
|
|
77
82
|
ara_cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
83
|
ara_cli/commands/command.py,sha256=Y_2dNeuxRjbyI3ScXNv55lptSe8Hs_ya78L0nPYNZHA,154
|
|
79
84
|
ara_cli/commands/extract_command.py,sha256=CzUOwDembG587PYbxg5rge4XSfdsuTyOPUvkobkXCIs,573
|
|
@@ -102,30 +107,24 @@ ara_cli/templates/template.steps.prompt_log.md,sha256=sd8g1KtwgpPvU-vGWAFCDXiWHk
|
|
|
102
107
|
ara_cli/templates/template.task.prompt_log.md,sha256=4kAy1zC0k3_y3SoYb-mg3rQEJCW_c43X7ggOLZ321TE,190
|
|
103
108
|
ara_cli/templates/template.userstory.prompt_log.md,sha256=Yp62iF7zDy2XNIwwJN35jKKSmezinK_JKbSvVuagtmA,205
|
|
104
109
|
ara_cli/templates/template.vision.prompt_log.md,sha256=CAzBzj3O23CzrPIUq3xzpXGKn3_nAvyBLRUi-5Bnq_0,196
|
|
105
|
-
ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md,sha256=DtZsdfVDNy9_cGE_Nn_TE2T3oRwr27kecZchOp5uIG0,672
|
|
106
110
|
ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
|
-
ara_cli/templates/prompt-modules/blueprints/pytest_unittest_prompt.blueprint.md,sha256=4R6Vtr55ZaPkOYM6K8_4vkHX91n5pZ1_CAVez-k9Cws,1305
|
|
108
111
|
ara_cli/templates/prompt-modules/blueprints/task_todo_list_C4_architecture_analysis.blueprint.md,sha256=jEZrZaVK_pkRhLp1SpTX3xR6BGXkox6NafXEjX_GDvM,3099
|
|
109
|
-
ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md,sha256=EimfgzjhFIsZnJ0qMNbVlUQEU0vC9Sv1VupesLz7A1E,2088
|
|
110
112
|
ara_cli/templates/prompt-modules/commands/architecture_C4_analysis.commands.md,sha256=xzfmOBsETlh90P1haJOiC8y8eLPboZ3yFodbuSUPLBU,1557
|
|
111
113
|
ara_cli/templates/prompt-modules/commands/architecture_radon_cc_score.commands.md,sha256=t-cozhSQPGUOoYfdySBL4n-yQykvCc4s5n0AKpKCn0Q,3074
|
|
112
114
|
ara_cli/templates/prompt-modules/commands/architecture_radon_halstead_v.commands.md,sha256=YBQKZdTJ4QRnBocsWTvT9dmaHOKys1hE0NJC7LPl2vQ,1676
|
|
113
115
|
ara_cli/templates/prompt-modules/commands/architecture_radon_maintainability_score.commands.md,sha256=9nBsY_EYNI9GmD-KzbGKdtEDP4YoY7ECV2QWEzoznfc,5511
|
|
114
|
-
ara_cli/templates/prompt-modules/commands/
|
|
115
|
-
ara_cli/templates/prompt-modules/commands/
|
|
116
|
-
ara_cli/templates/prompt-modules/commands/
|
|
117
|
-
ara_cli/templates/prompt-modules/commands/
|
|
118
|
-
ara_cli/templates/prompt-modules/commands/
|
|
119
|
-
ara_cli/templates/prompt-modules/commands/
|
|
120
|
-
ara_cli/templates/prompt-modules/commands/
|
|
121
|
-
ara_cli/templates/prompt-modules/commands/
|
|
122
|
-
ara_cli/templates/prompt-modules/commands/
|
|
123
|
-
ara_cli/templates/prompt-modules/commands/
|
|
124
|
-
ara_cli/templates/prompt-modules/commands/
|
|
125
|
-
ara_cli/templates/prompt-modules/commands/
|
|
126
|
-
ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md,sha256=RjMAa6rBCou0XGhu1-IFGy21EgcxSUkGWSCCqbw6CFw,1028
|
|
127
|
-
ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md,sha256=9togxxeBTcSvD5hLdBqyC-rUCF-xhU68PtD5rQySbFY,964
|
|
128
|
-
ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md,sha256=-pW71nV064aTfLTyYEnkH5eAaZPH3HRdOQsSxAfiNu8,1315
|
|
116
|
+
ara_cli/templates/prompt-modules/commands/empty.commands.md,sha256=vgi8-ep2JZBuv0cocpBWJe1-gDzpw1OpHt5KANtaH58,80
|
|
117
|
+
ara_cli/templates/prompt-modules/commands/extract_general.commands.md,sha256=g21jnK5gd0UX8dLv8IpxOX-r5A61EpVgT1VcmxXPcTw,718
|
|
118
|
+
ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md,sha256=em3jFTXNzT5ULdOyFg__DlRciYOTuCXrHiImnJS5B4M,657
|
|
119
|
+
ara_cli/templates/prompt-modules/commands/extract_python.commands.md,sha256=BhTtbfnrr_ABHza0XmGYlQ8YzrESQumyobQj2Ff9dNM,641
|
|
120
|
+
ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md,sha256=vuGfxSifR1UGxUhOQakEYA2KkoK66s_jf2pn6ClHuM0,2444
|
|
121
|
+
ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md,sha256=oufTleuQcHiYmdzKTtDleMHHN6anw-n8JSpUKUzE7GQ,2810
|
|
122
|
+
ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md,sha256=Z32V1Ux94Uol3gqxqV8V6gdiKSIyrbtd6re7tuLIRsM,4446
|
|
123
|
+
ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md,sha256=slOySzxZnIXzmIma3jZVvGcNC-llkqlhUil1cuWYE2U,2273
|
|
124
|
+
ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md,sha256=LYNfVuAhtBHB1CDjUqy5Y6dDmq9PVfo8UbJbfB2_mKE,2601
|
|
125
|
+
ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md,sha256=p-Y1r10-80Eo7lUmz2hX7uJto8J2-d2C0RMV595t0Sg,2453
|
|
126
|
+
ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md,sha256=i74lgqMc9KFu9QWfOcZR1jcDMLAZCW4wvGvGRK7Yng0,3204
|
|
127
|
+
ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md,sha256=jMuMfOiw_H8RL-I8J5OqBO4rpzYmGgGgzh-kKt_fNkg,3561
|
|
129
128
|
ara_cli/templates/prompt-modules/intentions/classify_task.intention.md,sha256=9ZiEOBFiku24SX4kBJlSCgm5ScYlNZIcNPoHwtGbWIU,254
|
|
130
129
|
ara_cli/templates/prompt-modules/intentions/empty.intention.md,sha256=6dqUtORC992KagZX2Up2yHHvBjVgDTj--wIyYbG4jhc,48
|
|
131
130
|
ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md,sha256=pcfG4csCF830lk8anDCkOA0ewTYnRo5mg0Y0w-fyEJU,206
|
|
@@ -187,8 +186,8 @@ tests/test_tag_extractor.py,sha256=7eVD10Y1uLkoSrEgqkXzRvPFs8lJ1RiaJzDu7ml_FZE,3
|
|
|
187
186
|
tests/test_template_loader.py,sha256=R7s8HJZbKqja-1TRBMBkVKPTgajofUjjRKUJq7a3_Oc,7427
|
|
188
187
|
tests/test_template_manager.py,sha256=qliEeYgAEakn8JIqIHa8u0Ht6DY4L3T6DcHBXkjzR4I,4167
|
|
189
188
|
tests/test_update_config_prompt.py,sha256=xsqj1WTn4BsG5Q2t-sNPfu7EoMURFcS-hfb5VSXUnJc,6765
|
|
190
|
-
ara_cli-0.1.
|
|
191
|
-
ara_cli-0.1.
|
|
192
|
-
ara_cli-0.1.
|
|
193
|
-
ara_cli-0.1.
|
|
194
|
-
ara_cli-0.1.
|
|
189
|
+
ara_cli-0.1.11.0.dist-info/METADATA,sha256=J3UhEy0Gi12HQIjRZlfq9raSlOLt5NDpk2qZLwNUdx0,8141
|
|
190
|
+
ara_cli-0.1.11.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
191
|
+
ara_cli-0.1.11.0.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
|
|
192
|
+
ara_cli-0.1.11.0.dist-info/top_level.txt,sha256=WM4cLHT5DYUaWzLtRj-gu3yVNFpGQ6lLRI3FMmC-38I,14
|
|
193
|
+
ara_cli-0.1.11.0.dist-info/RECORD,,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Usage:
|
|
2
|
-
# necessary input and adaption:
|
|
3
|
-
# replace text snippets in <> with specific context
|
|
4
|
-
# ...
|
|
5
|
-
# expected output:
|
|
6
|
-
# ...
|
|
7
|
-
Do not use usage information as prompt instructions
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Given source code
|
|
11
|
-
```python
|
|
12
|
-
<source code for context, skip irrelevant for current task>
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Given existing unit tests
|
|
16
|
-
```python
|
|
17
|
-
<existing unit tests>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Given pytest is available
|
|
21
|
-
|
|
22
|
-
Modify and/or create unit tests so this is fully covered:
|
|
23
|
-
```python
|
|
24
|
-
<snippet you want to cover in the next step>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Give me only what is relevant to testing this snippet. Use parametrization where applicable. Split into multiple tests instead of using if-else blocks. Mock all dependencies of tested code.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
MODE: STRICT_GENERATION
|
|
2
|
-
TASK: Produce one complete pytest file for a given Python module.
|
|
3
|
-
|
|
4
|
-
REQUIREMENTS:
|
|
5
|
-
- Output only valid Python code (no text, no markdown).
|
|
6
|
-
- Target: full behavioral + branch coverage (100%).
|
|
7
|
-
- Tests follow AAA pattern (# Arrange, # Act, # Assert).
|
|
8
|
-
- Exactly ONE assert or ONE pytest.raises() per test.
|
|
9
|
-
- Use tmp_path fixture for filesystem isolation.
|
|
10
|
-
- Include an autouse=True fixture for global patching if needed.
|
|
11
|
-
- No external I/O or network calls.
|
|
12
|
-
- All tests independent, self-contained.
|
|
13
|
-
|
|
14
|
-
STYLE:
|
|
15
|
-
- File starts with module docstring describing AAA, single assert rule, autouse fixture.
|
|
16
|
-
- Group tests with comment headers:
|
|
17
|
-
# --- Success paths --- / # --- Error paths --- / # --- Edge cases ---
|
|
18
|
-
- Function names: test_<function>_<expected_behavior>_<condition>
|
|
19
|
-
- Variables descriptive (rel, path, new_content, etc.).
|
|
20
|
-
- Use direct asserts (assert result is True, assert path.read_text() == "x").
|
|
21
|
-
- For errors:
|
|
22
|
-
with pytest.raises(ExceptionType, match=r"text"): function_call()
|
|
23
|
-
|
|
24
|
-
COVERAGE:
|
|
25
|
-
- Include success, failure, and rare edge branches (e.g., conditional exceptions).
|
|
26
|
-
- Ensure 100% of conditional branches executed.
|
|
27
|
-
|
|
28
|
-
OUTPUT:
|
|
29
|
-
- Single .py file, runnable via: pytest -v --disable-warnings --maxfail=1 --cov=<target_module>
|
|
30
|
-
- No explanations or prose, only the test code.
|
|
31
|
-
|
|
32
|
-
END
|
ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
### INTENTION and CONTEXT
|
|
2
|
-
My intention is to setup a todo list in my given task that helps me to implement a feature in a BDD way
|
|
3
|
-
|
|
4
|
-
Now do the following:
|
|
5
|
-
Search for a line starting with `Task: ` defined in the `### GIVENS` section. Just repeat the task_name you have found as confirmation
|
|
6
|
-
* Do not proceed if no task is defined. Return immediatly with the message: "No task defined as prompt control"
|
|
7
|
-
|
|
8
|
-
* Focus on the description in the `Description` section of the defined task. Ignore all other sections.
|
|
9
|
-
* Analyze the content of the task description section and adapt your default recipe accordingly. You can add new "[@to-do]s ...", you can delete "[@to-do]s" that are not necessary anymore according to the existing task description content
|
|
10
|
-
|
|
11
|
-
* the format and formulation of your default recipe implementing a feature in BDD style is
|
|
12
|
-
```
|
|
13
|
-
[@to-do] analyze and understand the given `user story`
|
|
14
|
-
[@to-do] generate an example contributing to the rule `rule of userstory to implement` which should be turned into a scenario or feature description
|
|
15
|
-
[@to-do] use the example and aditional relevant context `{context list}` to formulate the feature file
|
|
16
|
-
[@to-do] use the formulated feature file, relevant existing step implementations and relevant existing production code to implement the new step implementations that will fail
|
|
17
|
-
[@to-do] use the created step definitions, the relevant existing production code to modify existing code and to create new code implementing the requested behavior so that the step implementations will pass
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
* append your recipe at the end of task
|
|
21
|
-
* return the extended task in the following format
|
|
22
|
-
```artefact
|
|
23
|
-
# [ ] extract
|
|
24
|
-
# filename: ara/tasks/{task_name}.task
|
|
25
|
-
{initial task content}
|
|
26
|
-
{recipe}
|
|
27
|
-
```
|
|
28
|
-
* the extract and filename statements are only allowed once per code block
|
|
29
|
-
|
|
30
|
-
* 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,9 +0,0 @@
|
|
|
1
|
-
### COMMANDS FOR THE CORRECT CONTEXTUAL CLASSIFICATION OF 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
|
-
* give me a list of the top 5 artefacts to which the new artefact contributes the most
|
|
6
|
-
* the output format must be a table with the columns
|
|
7
|
-
| artefact name | contribution rating from 0 (very low) - 1 (very high) | arguments for rating | path to artefact |
|
|
8
|
-
|
|
9
|
-
* in case you think the relationship of the new artefact is to weak to any given files, return a warning "WARNING: new artefact is not directly related to already existing aretefacts" and then make a proposal with regard of the ara "work orchestration contribution hierarchy" and/or the "specification contribution hierarchy"
|
|
@@ -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.
|