ara-cli 0.1.10.0__py3-none-any.whl → 0.1.13.3__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.
- ara_cli/__init__.py +51 -6
- ara_cli/__main__.py +270 -103
- ara_cli/ara_command_action.py +106 -63
- ara_cli/ara_config.py +187 -128
- ara_cli/ara_subcommands/__init__.py +0 -0
- ara_cli/ara_subcommands/autofix.py +26 -0
- ara_cli/ara_subcommands/chat.py +27 -0
- ara_cli/ara_subcommands/classifier_directory.py +16 -0
- ara_cli/ara_subcommands/common.py +100 -0
- ara_cli/ara_subcommands/config.py +221 -0
- ara_cli/ara_subcommands/convert.py +43 -0
- ara_cli/ara_subcommands/create.py +75 -0
- ara_cli/ara_subcommands/delete.py +22 -0
- ara_cli/ara_subcommands/extract.py +22 -0
- ara_cli/ara_subcommands/fetch.py +41 -0
- ara_cli/ara_subcommands/fetch_agents.py +22 -0
- ara_cli/ara_subcommands/fetch_scripts.py +19 -0
- ara_cli/ara_subcommands/fetch_templates.py +19 -0
- ara_cli/ara_subcommands/list.py +139 -0
- ara_cli/ara_subcommands/list_tags.py +25 -0
- ara_cli/ara_subcommands/load.py +48 -0
- ara_cli/ara_subcommands/prompt.py +136 -0
- ara_cli/ara_subcommands/read.py +47 -0
- ara_cli/ara_subcommands/read_status.py +20 -0
- ara_cli/ara_subcommands/read_user.py +20 -0
- ara_cli/ara_subcommands/reconnect.py +27 -0
- ara_cli/ara_subcommands/rename.py +22 -0
- ara_cli/ara_subcommands/scan.py +14 -0
- ara_cli/ara_subcommands/set_status.py +22 -0
- ara_cli/ara_subcommands/set_user.py +22 -0
- ara_cli/ara_subcommands/template.py +16 -0
- ara_cli/artefact_autofix.py +154 -63
- ara_cli/artefact_converter.py +256 -0
- ara_cli/artefact_models/artefact_model.py +106 -25
- ara_cli/artefact_models/artefact_templates.py +20 -10
- ara_cli/artefact_models/epic_artefact_model.py +11 -2
- ara_cli/artefact_models/feature_artefact_model.py +31 -1
- ara_cli/artefact_models/userstory_artefact_model.py +15 -3
- ara_cli/artefact_scan.py +2 -2
- ara_cli/chat.py +283 -80
- ara_cli/chat_agent/__init__.py +0 -0
- ara_cli/chat_agent/agent_process_manager.py +155 -0
- ara_cli/chat_script_runner/__init__.py +0 -0
- ara_cli/chat_script_runner/script_completer.py +23 -0
- ara_cli/chat_script_runner/script_finder.py +41 -0
- ara_cli/chat_script_runner/script_lister.py +36 -0
- ara_cli/chat_script_runner/script_runner.py +36 -0
- ara_cli/chat_web_search/__init__.py +0 -0
- ara_cli/chat_web_search/web_search.py +263 -0
- ara_cli/commands/agent_run_command.py +98 -0
- ara_cli/commands/fetch_agents_command.py +106 -0
- ara_cli/commands/fetch_scripts_command.py +43 -0
- ara_cli/commands/fetch_templates_command.py +39 -0
- ara_cli/commands/fetch_templates_commands.py +39 -0
- ara_cli/commands/list_agents_command.py +39 -0
- ara_cli/commands/read_command.py +17 -4
- ara_cli/completers.py +180 -0
- ara_cli/constants.py +2 -0
- ara_cli/directory_navigator.py +37 -4
- ara_cli/file_loaders/text_file_loader.py +2 -2
- ara_cli/global_file_lister.py +5 -15
- ara_cli/llm_utils.py +58 -0
- ara_cli/prompt_chat.py +20 -4
- ara_cli/prompt_extractor.py +199 -76
- ara_cli/prompt_handler.py +160 -59
- ara_cli/tag_extractor.py +38 -18
- ara_cli/template_loader.py +3 -2
- ara_cli/template_manager.py +52 -21
- ara_cli/templates/global-scripts/hello_global.py +1 -0
- ara_cli/templates/prompt-modules/commands/add_scenarios_for_new_behaviour.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/align_feature_with_implementation_changes.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/analyze_codebase_and_plan_tasks.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/choose_best_parent_artefact.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/create_tasks_from_artefact_content.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/create_tests_for_uncovered_modules.test_generation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/derive_features_from_video_description.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/describe_agent_capabilities.agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
- ara_cli/templates/prompt-modules/commands/execute_scoped_todos_in_task.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/explain_single_file_purpose.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/extract_file_information_bullets.interview_agent.commands.md +1 -0
- 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/fix_failing_behave_step_definitions.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/fix_failing_pytest_tests.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/general_instruction_policy.commands.md +47 -0
- ara_cli/templates/prompt-modules/commands/generate_and_fix_pytest_tests.test_generation_agent.commands.md +1 -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/templates/prompt-modules/commands/suggest_next_story_child_tasks.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/summarize_or_transcribe_media.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/update_feature_to_match_implementation.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/update_user_story_with_requirements.interview_agent.commands.md +1 -0
- ara_cli/version.py +1 -1
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/METADATA +34 -1
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/RECORD +123 -54
- tests/test_ara_command_action.py +31 -19
- tests/test_ara_config.py +177 -90
- tests/test_artefact_autofix.py +170 -97
- tests/test_artefact_autofix_integration.py +495 -0
- tests/test_artefact_converter.py +357 -0
- tests/test_artefact_extraction.py +564 -0
- tests/test_artefact_scan.py +1 -1
- tests/test_chat.py +162 -126
- tests/test_chat_givens_images.py +603 -0
- tests/test_chat_script_runner.py +454 -0
- tests/test_global_file_lister.py +1 -1
- tests/test_llm_utils.py +164 -0
- tests/test_prompt_chat.py +343 -0
- tests/test_prompt_extractor.py +683 -0
- tests/test_prompt_handler.py +12 -4
- tests/test_tag_extractor.py +19 -13
- tests/test_web_search.py +467 -0
- ara_cli/ara_command_parser.py +0 -605
- ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
- 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.0.dist-info → ara_cli-0.1.13.3.dist-info}/WHEEL +0 -0
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/entry_points.txt +0 -0
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/top_level.txt +0 -0
ara_cli/ara_command_parser.py
DELETED
|
@@ -1,605 +0,0 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
import sys
|
|
3
|
-
from ara_cli.classifier import Classifier
|
|
4
|
-
from ara_cli.commandline_completer import (
|
|
5
|
-
ArtefactCompleter,
|
|
6
|
-
ParentNameCompleter,
|
|
7
|
-
StatusCompleter,
|
|
8
|
-
)
|
|
9
|
-
from ara_cli.template_manager import SpecificationBreakdownAspects
|
|
10
|
-
import os
|
|
11
|
-
import glob
|
|
12
|
-
|
|
13
|
-
classifiers = Classifier.ordered_classifiers()
|
|
14
|
-
aspects = SpecificationBreakdownAspects.VALID_ASPECTS
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def create_parser(subparsers):
|
|
18
|
-
create_parser = subparsers.add_parser(
|
|
19
|
-
"create", help="Create a classified artefact with data directory"
|
|
20
|
-
)
|
|
21
|
-
create_parser.add_argument(
|
|
22
|
-
"classifier",
|
|
23
|
-
choices=classifiers,
|
|
24
|
-
help="Classifier that also serves as file extension for the artefact file to be created. Valid Classifiers are: businessgoal, capability, keyfeature, feature, epic, userstory, example, task",
|
|
25
|
-
)
|
|
26
|
-
create_parser.add_argument(
|
|
27
|
-
"parameter", help="Artefact name that serves as filename"
|
|
28
|
-
).completer = ArtefactCompleter()
|
|
29
|
-
|
|
30
|
-
option_parser = create_parser.add_subparsers(dest="option")
|
|
31
|
-
|
|
32
|
-
contribution_parser = option_parser.add_parser("contributes-to")
|
|
33
|
-
contribution_parser.add_argument(
|
|
34
|
-
"parent_classifier", choices=classifiers, help="Classifier of the parent"
|
|
35
|
-
)
|
|
36
|
-
contribution_parser.add_argument(
|
|
37
|
-
"parent_name", help="Name of a parent artefact"
|
|
38
|
-
).completer = ParentNameCompleter()
|
|
39
|
-
contribution_parser.add_argument("-r", "--rule", dest="rule", action="store")
|
|
40
|
-
|
|
41
|
-
aspect_parser = option_parser.add_parser("aspect")
|
|
42
|
-
aspect_parser.add_argument(
|
|
43
|
-
"aspect",
|
|
44
|
-
choices=aspects,
|
|
45
|
-
help="Adds additional specification breakdown aspects in data directory.",
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def delete_parser(subparsers):
|
|
50
|
-
delete_parser = subparsers.add_parser(
|
|
51
|
-
"delete", help="Delete an artefact file including its data directory"
|
|
52
|
-
)
|
|
53
|
-
delete_parser.add_argument(
|
|
54
|
-
"classifier",
|
|
55
|
-
choices=classifiers,
|
|
56
|
-
help="Classifier of the artefact to be deleted",
|
|
57
|
-
)
|
|
58
|
-
delete_parser.add_argument(
|
|
59
|
-
"parameter", help="Filename of artefact"
|
|
60
|
-
).completer = ArtefactCompleter()
|
|
61
|
-
delete_parser.add_argument(
|
|
62
|
-
"-f",
|
|
63
|
-
"--force",
|
|
64
|
-
dest="force",
|
|
65
|
-
action="store_true",
|
|
66
|
-
help="ignore nonexistent files and arguments, never prompt",
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def rename_parser(subparsers):
|
|
71
|
-
rename_parser = subparsers.add_parser(
|
|
72
|
-
"rename", help="Rename a classified artefact and its data directory"
|
|
73
|
-
)
|
|
74
|
-
rename_parser.add_argument(
|
|
75
|
-
"classifier", choices=classifiers, help="Classifier of the artefact"
|
|
76
|
-
)
|
|
77
|
-
rename_parser.add_argument(
|
|
78
|
-
"parameter", help="Filename of artefact"
|
|
79
|
-
).completer = ArtefactCompleter()
|
|
80
|
-
rename_parser.add_argument(
|
|
81
|
-
"aspect", help="New artefact name and new data directory name"
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def add_filter_flags(parser):
|
|
86
|
-
parser.add_argument(
|
|
87
|
-
"-I",
|
|
88
|
-
"--include-content",
|
|
89
|
-
nargs="+",
|
|
90
|
-
default=None,
|
|
91
|
-
help="filter for files which include given content",
|
|
92
|
-
)
|
|
93
|
-
parser.add_argument(
|
|
94
|
-
"-E",
|
|
95
|
-
"--exclude-content",
|
|
96
|
-
nargs="+",
|
|
97
|
-
default=None,
|
|
98
|
-
help="filter for files which do not include given content",
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
parser.add_argument(
|
|
102
|
-
"--include-tags",
|
|
103
|
-
nargs="+",
|
|
104
|
-
default=None,
|
|
105
|
-
help="filter for files which include given tags",
|
|
106
|
-
)
|
|
107
|
-
parser.add_argument(
|
|
108
|
-
"--exclude-tags",
|
|
109
|
-
nargs="+",
|
|
110
|
-
default=None,
|
|
111
|
-
help="filter for files which do not include given tags",
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
extension_group = parser.add_mutually_exclusive_group()
|
|
115
|
-
extension_group.add_argument(
|
|
116
|
-
"-i",
|
|
117
|
-
"--include-extension",
|
|
118
|
-
"--include-classifier",
|
|
119
|
-
dest="include_extension",
|
|
120
|
-
nargs="+",
|
|
121
|
-
help="list of extensions to include in listing",
|
|
122
|
-
)
|
|
123
|
-
extension_group.add_argument(
|
|
124
|
-
"-e",
|
|
125
|
-
"--exclude-extension",
|
|
126
|
-
"--exclude-classifier",
|
|
127
|
-
dest="exclude_extension",
|
|
128
|
-
nargs="+",
|
|
129
|
-
help="list of extensions to exclude from listing",
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
def list_parser(subparsers):
|
|
134
|
-
list_parser = subparsers.add_parser("list", help="List files with optional tags")
|
|
135
|
-
list_parser.add_argument("tags", nargs="*", help="Tags for listing files")
|
|
136
|
-
|
|
137
|
-
add_filter_flags(list_parser)
|
|
138
|
-
|
|
139
|
-
argument_group = list_parser.add_mutually_exclusive_group()
|
|
140
|
-
argument_group.add_argument(
|
|
141
|
-
"-b",
|
|
142
|
-
"--branch",
|
|
143
|
-
dest="branch_args",
|
|
144
|
-
nargs=2,
|
|
145
|
-
metavar=("classifier", "artefact_name"),
|
|
146
|
-
help="List artefacts in the parent chain of the artefact with specified classifier and artefact_name",
|
|
147
|
-
)
|
|
148
|
-
argument_group.add_argument(
|
|
149
|
-
"-c",
|
|
150
|
-
"--children",
|
|
151
|
-
dest="children_args",
|
|
152
|
-
nargs=2,
|
|
153
|
-
metavar=("classifier", "artefact_name"),
|
|
154
|
-
help="List child artefacts of the artefact with specified classifier and artefact_name",
|
|
155
|
-
)
|
|
156
|
-
argument_group.add_argument(
|
|
157
|
-
"-d",
|
|
158
|
-
"--data",
|
|
159
|
-
dest="data_args",
|
|
160
|
-
nargs=2,
|
|
161
|
-
metavar=("classifier", "artefact_name"),
|
|
162
|
-
help="List file in the data directory of the artefact with specified classifier and artefact_name",
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
list_parser.set_defaults(
|
|
166
|
-
branch_args=(None, None), children_args=(None, None), data_args=(None, None)
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
def list_tags_parser(subparsers):
|
|
171
|
-
tags_parser = subparsers.add_parser("list-tags", help="Show tags")
|
|
172
|
-
tags_parser.add_argument(
|
|
173
|
-
"--json",
|
|
174
|
-
"-j",
|
|
175
|
-
help="Output tags as JSON",
|
|
176
|
-
action=argparse.BooleanOptionalAction,
|
|
177
|
-
)
|
|
178
|
-
tags_parser.add_argument(
|
|
179
|
-
"--include-classifier",
|
|
180
|
-
choices=classifiers,
|
|
181
|
-
help="Show tags for an artefact type",
|
|
182
|
-
)
|
|
183
|
-
tags_parser.add_argument(
|
|
184
|
-
"--exclude_classifier",
|
|
185
|
-
choices=classifiers,
|
|
186
|
-
help="Show tags for an artefact type",
|
|
187
|
-
)
|
|
188
|
-
tags_parser.add_argument(
|
|
189
|
-
"--filtered-extra-column",
|
|
190
|
-
action="store_true",
|
|
191
|
-
help="Filter tags for extra column",
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
class TemplateNameCompleter:
|
|
196
|
-
"""Provides command-line completion for template names."""
|
|
197
|
-
def __call__(self, prefix, parsed_args, **kwargs):
|
|
198
|
-
import os
|
|
199
|
-
from ara_cli.template_loader import TemplateLoader
|
|
200
|
-
|
|
201
|
-
if not hasattr(parsed_args, 'template_type'):
|
|
202
|
-
return []
|
|
203
|
-
|
|
204
|
-
template_type = parsed_args.template_type
|
|
205
|
-
context_path = os.getcwd()
|
|
206
|
-
|
|
207
|
-
loader = TemplateLoader()
|
|
208
|
-
templates = loader.get_available_templates(template_type, context_path)
|
|
209
|
-
|
|
210
|
-
return [t for t in templates if t.startswith(prefix)]
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
def load_parser(subparsers):
|
|
214
|
-
load_parser = subparsers.add_parser(
|
|
215
|
-
"load", help="Load a template into a chat file."
|
|
216
|
-
)
|
|
217
|
-
load_parser.add_argument(
|
|
218
|
-
"chat_name", help="Name of the chat file to load template into (without extension)."
|
|
219
|
-
)
|
|
220
|
-
load_parser.add_argument(
|
|
221
|
-
"template_type",
|
|
222
|
-
choices=['rules', 'intention', 'commands', 'blueprint'],
|
|
223
|
-
help="Type of template to load."
|
|
224
|
-
)
|
|
225
|
-
load_parser.add_argument(
|
|
226
|
-
"template_name",
|
|
227
|
-
nargs='?',
|
|
228
|
-
default="",
|
|
229
|
-
help="Name of the template to load. Supports wildcards and 'global/' prefix."
|
|
230
|
-
).completer = TemplateNameCompleter()
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
def add_chat_arguments(chat_parser):
|
|
234
|
-
chat_parser.add_argument(
|
|
235
|
-
"chat_name",
|
|
236
|
-
help="Optional name for a specific chat. Pass the .md file to continue an existing chat",
|
|
237
|
-
nargs="?",
|
|
238
|
-
default=None,
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
chat_parser.add_argument(
|
|
242
|
-
"-r",
|
|
243
|
-
"--reset",
|
|
244
|
-
dest="reset",
|
|
245
|
-
action=argparse.BooleanOptionalAction,
|
|
246
|
-
help="Reset the chat file if it exists",
|
|
247
|
-
)
|
|
248
|
-
chat_parser.set_defaults(reset=None)
|
|
249
|
-
|
|
250
|
-
chat_parser.add_argument(
|
|
251
|
-
"--out",
|
|
252
|
-
dest="output_mode",
|
|
253
|
-
action="store_true",
|
|
254
|
-
help="Output the contents of the chat file instead of entering interactive chat mode",
|
|
255
|
-
)
|
|
256
|
-
|
|
257
|
-
chat_parser.add_argument(
|
|
258
|
-
"--append", nargs="*", default=None, help="Append strings to the chat file"
|
|
259
|
-
)
|
|
260
|
-
|
|
261
|
-
chat_parser.add_argument(
|
|
262
|
-
"--restricted",
|
|
263
|
-
dest="restricted",
|
|
264
|
-
action=argparse.BooleanOptionalAction,
|
|
265
|
-
help="Start with a limited set of commands",
|
|
266
|
-
)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
def prompt_parser(subparsers):
|
|
270
|
-
prompt_parser = subparsers.add_parser(
|
|
271
|
-
"prompt", help="Base command for prompt interaction mode"
|
|
272
|
-
)
|
|
273
|
-
|
|
274
|
-
steps = [
|
|
275
|
-
"init",
|
|
276
|
-
"load",
|
|
277
|
-
"send",
|
|
278
|
-
"load-and-send",
|
|
279
|
-
"extract",
|
|
280
|
-
"update",
|
|
281
|
-
"chat",
|
|
282
|
-
"init-rag",
|
|
283
|
-
]
|
|
284
|
-
steps_parser = prompt_parser.add_subparsers(dest="steps")
|
|
285
|
-
for step in steps:
|
|
286
|
-
step_parser = steps_parser.add_parser(step)
|
|
287
|
-
step_parser.add_argument(
|
|
288
|
-
"classifier", choices=classifiers, help="Classifier of the artefact"
|
|
289
|
-
)
|
|
290
|
-
step_parser.add_argument(
|
|
291
|
-
"parameter",
|
|
292
|
-
help="Name of artefact data directory for prompt creation and interaction",
|
|
293
|
-
).completer = ArtefactCompleter()
|
|
294
|
-
if step == "chat":
|
|
295
|
-
add_chat_arguments(step_parser)
|
|
296
|
-
if step == "extract":
|
|
297
|
-
step_parser.add_argument(
|
|
298
|
-
"-w",
|
|
299
|
-
"--write",
|
|
300
|
-
action="store_true",
|
|
301
|
-
help="Overwrite existing files without using LLM for merging."
|
|
302
|
-
)
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
def chat_parser(subparsers):
|
|
306
|
-
chat_parser = subparsers.add_parser(
|
|
307
|
-
"chat", help="Command line chatbot. Chat control with SEND/s | RERUN/r | QUIT/q"
|
|
308
|
-
)
|
|
309
|
-
add_chat_arguments(chat_parser)
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
def template_parser(subparsers):
|
|
313
|
-
template_parser = subparsers.add_parser(
|
|
314
|
-
"template", help="Outputs a classified ara template in the terminal"
|
|
315
|
-
)
|
|
316
|
-
template_parser.add_argument(
|
|
317
|
-
"classifier", choices=classifiers, help="Classifier of the artefact type"
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
def fetch_templates_parser(subparsers):
|
|
322
|
-
subparsers.add_parser(
|
|
323
|
-
"fetch-templates", help="Fetches templates and stores them in .araconfig"
|
|
324
|
-
)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
def read_parser(subparsers):
|
|
328
|
-
read_parser = subparsers.add_parser("read", help="Reads contents of artefacts")
|
|
329
|
-
read_parser.add_argument(
|
|
330
|
-
"classifier", choices=classifiers, help="Classifier of the artefact type"
|
|
331
|
-
)
|
|
332
|
-
read_parser.add_argument(
|
|
333
|
-
"parameter", help="Filename of artefact"
|
|
334
|
-
).completer = ArtefactCompleter()
|
|
335
|
-
|
|
336
|
-
add_filter_flags(read_parser)
|
|
337
|
-
|
|
338
|
-
branch_group = read_parser.add_mutually_exclusive_group()
|
|
339
|
-
branch_group.add_argument(
|
|
340
|
-
"-b",
|
|
341
|
-
"--branch",
|
|
342
|
-
dest="read_mode",
|
|
343
|
-
action="store_const",
|
|
344
|
-
const="branch",
|
|
345
|
-
help="Output the contents of artefacts in the parent chain",
|
|
346
|
-
)
|
|
347
|
-
branch_group.add_argument(
|
|
348
|
-
"-c",
|
|
349
|
-
"--children",
|
|
350
|
-
dest="read_mode",
|
|
351
|
-
action="store_const",
|
|
352
|
-
const="children",
|
|
353
|
-
help="Output the contents of child artefacts",
|
|
354
|
-
)
|
|
355
|
-
|
|
356
|
-
read_parser.set_defaults(read_mode=None)
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
def reconnect_parser(subparsers):
|
|
360
|
-
reconnect_parser = subparsers.add_parser(
|
|
361
|
-
"reconnect", help="Connect an artefact to a parent artefact"
|
|
362
|
-
)
|
|
363
|
-
reconnect_parser.add_argument(
|
|
364
|
-
"classifier", choices=classifiers, help="Classifier of the artefact type"
|
|
365
|
-
)
|
|
366
|
-
reconnect_parser.add_argument(
|
|
367
|
-
"parameter", help="Filename of artefact"
|
|
368
|
-
).completer = ArtefactCompleter()
|
|
369
|
-
reconnect_parser.add_argument(
|
|
370
|
-
"parent_classifier",
|
|
371
|
-
choices=classifiers,
|
|
372
|
-
help="Classifier of the parent artefact type",
|
|
373
|
-
)
|
|
374
|
-
reconnect_parser.add_argument(
|
|
375
|
-
"parent_name", help="Filename of parent artefact"
|
|
376
|
-
).completer = ParentNameCompleter()
|
|
377
|
-
reconnect_parser.add_argument("-r", "--rule", dest="rule", action="store")
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
def read_status_parser(subparsers):
|
|
381
|
-
read_status_parser = subparsers.add_parser(
|
|
382
|
-
"read-status", help="Read status of an artefact by checking its tags"
|
|
383
|
-
)
|
|
384
|
-
read_status_parser.add_argument(
|
|
385
|
-
"classifier", choices=classifiers, help="Classifier of the artefact type"
|
|
386
|
-
)
|
|
387
|
-
read_status_parser.add_argument(
|
|
388
|
-
"parameter", help="Filename of artefact"
|
|
389
|
-
).completer = ArtefactCompleter()
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
def read_user_parser(subparsers):
|
|
393
|
-
read_user_parser = subparsers.add_parser(
|
|
394
|
-
"read-user", help="Read user of an artefact by checking its tags"
|
|
395
|
-
)
|
|
396
|
-
read_user_parser.add_argument(
|
|
397
|
-
"classifier", choices=classifiers, help="Classifier of the artefact type"
|
|
398
|
-
)
|
|
399
|
-
read_user_parser.add_argument(
|
|
400
|
-
"parameter", help="Filename of artefact"
|
|
401
|
-
).completer = ArtefactCompleter()
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
def set_status_parser(subparsers):
|
|
405
|
-
set_status_parser = subparsers.add_parser(
|
|
406
|
-
"set-status", help="Set the status of a task"
|
|
407
|
-
)
|
|
408
|
-
set_status_parser.add_argument(
|
|
409
|
-
"classifier",
|
|
410
|
-
choices=classifiers,
|
|
411
|
-
help="Classifier of the artefact type, typically 'task'",
|
|
412
|
-
)
|
|
413
|
-
set_status_parser.add_argument(
|
|
414
|
-
"parameter", help="Name of the task artefact"
|
|
415
|
-
).completer = ArtefactCompleter()
|
|
416
|
-
set_status_parser.add_argument(
|
|
417
|
-
"new_status", help="New status to set for the task"
|
|
418
|
-
).completer = StatusCompleter()
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
def set_user_parser(subparsers):
|
|
422
|
-
set_user_parser = subparsers.add_parser("set-user", help="Set the user of a task")
|
|
423
|
-
set_user_parser.add_argument(
|
|
424
|
-
"classifier",
|
|
425
|
-
choices=classifiers,
|
|
426
|
-
help="Classifier of the artefact type, typically 'task'",
|
|
427
|
-
)
|
|
428
|
-
set_user_parser.add_argument(
|
|
429
|
-
"parameter", help="Name of the task artefact"
|
|
430
|
-
).completer = ArtefactCompleter()
|
|
431
|
-
set_user_parser.add_argument("new_user", help="New user to assign to the task")
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
def classifier_directory_parser(subparsers):
|
|
435
|
-
classifier_directory_parser = subparsers.add_parser(
|
|
436
|
-
"classifier-directory",
|
|
437
|
-
help="Print the ara subdirectory for an artefact classifier",
|
|
438
|
-
)
|
|
439
|
-
classifier_directory_parser.add_argument(
|
|
440
|
-
"classifier", choices=classifiers, help="Classifier of the artefact type"
|
|
441
|
-
)
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
def scan_parser(subparsers):
|
|
445
|
-
subparsers.add_parser("scan", help="Scan ARA tree for incompatible artefacts.")
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
def autofix_parser(subparsers):
|
|
449
|
-
autofix_parser = subparsers.add_parser(
|
|
450
|
-
"autofix",
|
|
451
|
-
help="Fix ARA tree with llm models for scanned artefacts with ara scan command. By default three attemps for every file.",
|
|
452
|
-
)
|
|
453
|
-
autofix_parser.add_argument(
|
|
454
|
-
"--single-pass",
|
|
455
|
-
action="store_true",
|
|
456
|
-
help="Run the autofix once for every scaned file.",
|
|
457
|
-
)
|
|
458
|
-
determinism_group = autofix_parser.add_mutually_exclusive_group()
|
|
459
|
-
determinism_group.add_argument(
|
|
460
|
-
"--deterministic",
|
|
461
|
-
"-d",
|
|
462
|
-
action="store_true",
|
|
463
|
-
help="Run only deterministic fixes e.g Title-FileName Mismatch fix",
|
|
464
|
-
)
|
|
465
|
-
determinism_group.add_argument(
|
|
466
|
-
"--non-deterministic",
|
|
467
|
-
"-nd",
|
|
468
|
-
action="store_true",
|
|
469
|
-
help="Run only non-deterministic fixes",
|
|
470
|
-
)
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
def extract_parser(subparsers):
|
|
474
|
-
extract_parser = subparsers.add_parser("extract", help="Extract blocks of marked content from a given file.")
|
|
475
|
-
extract_parser.add_argument(
|
|
476
|
-
"filename",
|
|
477
|
-
help="Input file to extract from."
|
|
478
|
-
)
|
|
479
|
-
extract_parser.add_argument(
|
|
480
|
-
"--force", "-f",
|
|
481
|
-
action="store_true",
|
|
482
|
-
help="Answer queries with yes when extracting."
|
|
483
|
-
)
|
|
484
|
-
extract_parser.add_argument(
|
|
485
|
-
"-w",
|
|
486
|
-
"--write",
|
|
487
|
-
action="store_true",
|
|
488
|
-
help="Overwrite existing files without using LLM for merging."
|
|
489
|
-
)
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
class CustomHelpFormatter(argparse.HelpFormatter):
|
|
493
|
-
def __init__(self, *args, **kwargs):
|
|
494
|
-
self.add_examples = kwargs.pop("add_examples", False)
|
|
495
|
-
super().__init__(*args, **kwargs)
|
|
496
|
-
|
|
497
|
-
def format_help(self):
|
|
498
|
-
help_message = super().format_help()
|
|
499
|
-
if self.add_examples:
|
|
500
|
-
examples = (
|
|
501
|
-
"\nValid classified artefacts are: businessgoal, vision, capability, keyfeature, feature, epic, userstory, example, feature, task.\n"
|
|
502
|
-
"The default ara directory structure of classified artefact of the ara cli tool is:\n"
|
|
503
|
-
".\n"
|
|
504
|
-
"└── ara\n"
|
|
505
|
-
" ├── businessgoals\n"
|
|
506
|
-
" ├── capabilities\n"
|
|
507
|
-
" ├── epics\n"
|
|
508
|
-
" ├── examples\n"
|
|
509
|
-
" ├── features\n"
|
|
510
|
-
" ├── keyfeatures\n"
|
|
511
|
-
" ├── tasks\n"
|
|
512
|
-
" ├── userstories\n"
|
|
513
|
-
" └── vision\n"
|
|
514
|
-
"\n"
|
|
515
|
-
"\nara artefact handling examples:\n"
|
|
516
|
-
" > create a new artefact for e.g. a feature: ara create feature {feature_name}\n"
|
|
517
|
-
" > create a new artefact for e.g. a feature that contributes to an userstory: ara create feature {feature_name} contributes-to userstory {story_name}\n"
|
|
518
|
-
" > read an artefact and return the content as terminal output, for eg. of a task: ara read task {task_name}\n"
|
|
519
|
-
" > read an artefact and its full chain of contributions to its parents and return\n"
|
|
520
|
-
" the content as terminal output, for eg. of a task: ara read task {task_name} --branch\n"
|
|
521
|
-
" > delete an artefact for e.g. feature: ara delete feature {feature_name}\n"
|
|
522
|
-
" > rename artefact and artefact data directory for e.g. a feature: ara rename feature {initial_feature_name} {new_feature_name}\n"
|
|
523
|
-
" > create additional templates for a specific aspect (valid aspects are: customer,\n"
|
|
524
|
-
" persona, concept, technology) related to an existing artefact like a feature: ara create feature {feature_name} aspect {aspect_name}\n"
|
|
525
|
-
" > list artefact data with .md file extension ara list --data {classifier} {artefact_name} --include-extension .md\n"
|
|
526
|
-
" > list artefact data with .md and .json file extensions ara list --data {classifier} {artefact_name} --include-extension .md .json\n"
|
|
527
|
-
" > list everything but userstories ara list --exclude-extension .userstory\n"
|
|
528
|
-
" > list all existing features: ara list --include-extension .feature\n"
|
|
529
|
-
' > list all child artefacts contributing value to a parent artefact: ara list --include-content "Contributes to {name_of_parent_artefact} {ara classifier_of_parent_artefact}"\n'
|
|
530
|
-
" > list tasks which contain 'example content' ara list --include-extension .task --include-content \"example content\"\n"
|
|
531
|
-
" > list children artefacts of a userstory ara list --children userstory {name_of_userstory}\n"
|
|
532
|
-
" > list parent artefacts of a userstory ara list --branch userstory {name_of_userstory}\n"
|
|
533
|
-
" > list parent businessgoal artefact of a userstory ara list --branch userstory {name_of_userstory} --include-extension .businessgoal\n"
|
|
534
|
-
" > print any artefact template for e.g. a feature file template in the terminal: ara template feature\n"
|
|
535
|
-
"\n"
|
|
536
|
-
" \nara prompt templates examples:\n"
|
|
537
|
-
" > get and copy all prompt templates (blueprints, rules, intentions, commands\n"
|
|
538
|
-
" in the ara/.araconfig/global-prompt-modules directory: ara fetch-templates\n"
|
|
539
|
-
"\n"
|
|
540
|
-
" \nara chat examples:\n"
|
|
541
|
-
" > chat with ara and save the default chat.md file in the working directory: ara chat\n"
|
|
542
|
-
" > chat with ara and save the default task_chat.md file in the task.data directory: ara prompt chat task {task_name}\n"
|
|
543
|
-
"\n"
|
|
544
|
-
" > initialize a macro prompt for a task: ara prompt init task {task_name}\n"
|
|
545
|
-
" > load selected templates in config_prompt_templates.md for the task {task_name}: ara prompt load task {task_name}\n"
|
|
546
|
-
" > create and send configured prompt of the task {task_name} to the configured LLM: ara prompt send task {task_name}\n"
|
|
547
|
-
" > extract the selected LLM response in task.exploration.md and save to disk: ara prompt extract task {task_name}\n"
|
|
548
|
-
)
|
|
549
|
-
return help_message + examples
|
|
550
|
-
return help_message
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
class CustomArgumentParser(argparse.ArgumentParser):
|
|
554
|
-
def __init__(self, *args, **kwargs):
|
|
555
|
-
self.add_examples = False
|
|
556
|
-
kwargs["formatter_class"] = CustomHelpFormatter
|
|
557
|
-
super().__init__(*args, **kwargs)
|
|
558
|
-
|
|
559
|
-
def _get_formatter(self):
|
|
560
|
-
# Pass add_examples flag to formatter
|
|
561
|
-
return self.formatter_class(prog=self.prog, add_examples=self.add_examples)
|
|
562
|
-
|
|
563
|
-
def print_help(self, file=None):
|
|
564
|
-
# Use the formatter with the current add_examples
|
|
565
|
-
if file is None:
|
|
566
|
-
file = sys.stdout
|
|
567
|
-
file.write(self.format_help())
|
|
568
|
-
file.write("\n")
|
|
569
|
-
|
|
570
|
-
def error(self, message):
|
|
571
|
-
self.add_examples = True
|
|
572
|
-
sys.stderr.write(f"error: {message}\n")
|
|
573
|
-
self.print_help(sys.stderr)
|
|
574
|
-
sys.exit(2)
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
def action_parser():
|
|
578
|
-
# Use the CustomArgumentParser instead of argparse.ArgumentParser
|
|
579
|
-
parser = CustomArgumentParser(
|
|
580
|
-
description="The ara cli terminal tool is a management tool for classified ara artefacts."
|
|
581
|
-
)
|
|
582
|
-
|
|
583
|
-
subparsers = parser.add_subparsers(dest="action", help="Action to perform")
|
|
584
|
-
create_parser(subparsers)
|
|
585
|
-
delete_parser(subparsers)
|
|
586
|
-
rename_parser(subparsers)
|
|
587
|
-
list_parser(subparsers)
|
|
588
|
-
list_tags_parser(subparsers)
|
|
589
|
-
prompt_parser(subparsers)
|
|
590
|
-
chat_parser(subparsers)
|
|
591
|
-
template_parser(subparsers)
|
|
592
|
-
fetch_templates_parser(subparsers)
|
|
593
|
-
read_parser(subparsers)
|
|
594
|
-
reconnect_parser(subparsers)
|
|
595
|
-
read_status_parser(subparsers)
|
|
596
|
-
read_user_parser(subparsers)
|
|
597
|
-
set_status_parser(subparsers)
|
|
598
|
-
set_user_parser(subparsers)
|
|
599
|
-
classifier_directory_parser(subparsers)
|
|
600
|
-
scan_parser(subparsers)
|
|
601
|
-
autofix_parser(subparsers)
|
|
602
|
-
load_parser(subparsers)
|
|
603
|
-
extract_parser(subparsers)
|
|
604
|
-
|
|
605
|
-
return parser
|
|
@@ -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.
|
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
|