src.integrations.nlp_base module#

Base class for Natural Language task creation.

Provides shared functionality for create_project and add_feature tools.

class src.integrations.nlp_base.NaturalLanguageTaskCreator[source]#

Bases: ABC

Base class for natural language task creation tools.

Provides common functionality for: - Task creation on kanban boards - Safety checks and validation - Task classification - Error handling

__init__(kanban_client, ai_engine=None, subtask_manager=None, complexity='standard')[source]#

Initialize the base task creator.

Parameters:
  • kanban_client (Any) – Kanban board client with create_task method

  • ai_engine (Any) – Optional AI engine for enhanced processing

  • subtask_manager (Any) – Optional SubtaskManager for registering decomposed subtasks

  • complexity (str) – Project complexity level: “prototype”, “standard”, “enterprise”

Return type:

None

async create_tasks_on_board(tasks, skip_validation=False, update_dependencies=True)[source]#

Create tasks on the kanban board.

This is the main shared functionality between create_project and add_feature.

Parameters:
  • tasks (List[Task]) – List of tasks to create

  • skip_validation (bool) – Skip dependency validation if True

  • update_dependencies (bool) – Update task dependencies with new IDs after creation

Returns:

List of created tasks

Return type:

List[Task]

Raises:

RuntimeError – If kanban client doesn’t support task creation

async apply_safety_checks(tasks)[source]#

Apply safety checks to ensure logical task ordering.

This method can be overridden by subclasses for custom safety logic.

Parameters:

tasks (List[Task]) – List of tasks to check

Returns:

List of tasks with updated dependencies

Return type:

List[Task]

classify_tasks(tasks)[source]#

Classify tasks by their type.

Parameters:

tasks (List[Task]) – List of tasks to classify

Returns:

Dictionary mapping task types to lists of tasks

Return type:

Dict[TaskType, List[Task]]

classify_tasks_with_details(tasks)[source]#

Classify tasks and return detailed classification info per task.

Parameters:

tasks (List[Task]) – List of tasks to classify

Returns:

Dictionary mapping task IDs to classification details

Return type:

Dict[str, Dict[str, Any]]

get_tasks_by_type(tasks, task_type)[source]#

Get all tasks of a specific type.

Return type:

List[Any]

Parameters:
is_deployment_task(task)[source]#

Check if task is deployment-related.

Return type:

Any

Parameters:

task (Task)

is_implementation_task(task)[source]#

Check if task is implementation-related.

Return type:

Any

Parameters:

task (Task)

is_testing_task(task)[source]#

Check if task is testing-related.

Return type:

Any

Parameters:

task (Task)

abstractmethod async process_natural_language(description, **kwargs)[source]#

Process natural language description into tasks.

This method must be implemented by subclasses.

Parameters:
  • description (str) – Natural language description

  • **kwargs (Any) – Additional parameters specific to the implementation

Returns:

List of generated tasks

Return type:

List[Task]

async create_from_description(description, apply_safety=True, **kwargs)[source]#

Create tasks from natural language description.

Parameters:
  • description (str) – Natural language description

  • apply_safety (bool) – Whether to apply safety checks

  • **kwargs (Any) – Additional parameters for processing

Returns:

Dictionary with creation results

Return type:

Dict[str, Any]