aw¶
aw - Agentic Workflows for Data Preparation
An AI agent package for data preparation with a focus on loading and preparing data for various purposes (e.g., visualization with cosmograph).
Key Features:
AgenticStep protocol for building modular agents
ReAct pattern (Reason-Act-Observe) with retry logic
Three validation flavors: schema, info-dict, and functional
Code execution with safe defaults and extensibility
Loading and Preparation agents for data workflows
Cosmograph-specific validators and utilities
Orchestration for chaining multiple steps
Example
>>> from aw import load_for_cosmo
>>> df, metadata = load_for_cosmo('data.csv')
>>> from cosmograph import cosmo
>>> params = metadata['preparing']['metadata']['validation_result']['params']
>>> cosmo(df, **params)
Architecture:
aw.base: Core protocols and configurations
aw.validation: Three validation flavors
aw.tools: Code execution and agent tools
aw.utils: Helper functions and facades
aw.loading: LoadingAgent for data ingestion
aw.preparing: PreparationAgent for data transformation
aw.cosmo: Cosmograph-specific validators
aw.orchestration: Workflow management
Functions
|
Create a validator from a schema (Pydantic, JSON Schema, etc.). |
|
Create a validator that computes info then checks it. |
|
Create a validator that tries to use the artifact for its purpose. |
|
Combine multiple validators - all must pass. |
|
Combine multiple validators - at least one must pass. |
|
Validator that checks artifact type. |
Validator that checks artifact is not empty. |
|
|
Validator that checks artifact has required attributes. |
Create an executor using LangChain's CodeInterpreter (if available). |
|
|
Join two or more pathname components, inserting '/' as needed. |
|
Infer pandas loader function from file extension. |
|
Infer parameters for pandas loader based on file characteristics. |
Compute comprehensive info about a DataFrame. |
|
|
Get numeric columns from DataFrame. |
|
Factory to create LLM function from various specifications. |
|
Create a text-to-text chat function using OpenAI API. |
Create a chat function through |
|
|
Factory function to create a loading agent. |
|
Factory function to create a preparation agent. |
|
Create a validator for cosmograph requirements. |
|
Try to create a cosmograph visualization. |
Basic validator that checks structural requirements only. |
|
Strict validator that actually calls cosmograph. |
|
Infer suitable cosmograph parameters from DataFrame. |
|
|
Factory to create a data preparation workflow. |
|
Create a workflow specifically for cosmograph preparation. |
|
Convenience function to load and prepare data in one call. |
|
Load and prepare data specifically for cosmograph visualization. |
|
Extract a normalized AgentSpec from any aw agent. |
|
Translate an aw agent to a Claude Code SKILL.md string. |
|
Render a Claude Code SKILL.md string from an |
|
Write a complete Claude Code skill directory. |
|
Translate an AgenticWorkflow into a set of Claude Code skills. |
|
Translate an aw agent to a CrewAI agent YAML config dict. |
|
Render a CrewAI agent config dict from an |
|
Translate an AgenticWorkflow to CrewAI agents.yaml + tasks.yaml. |
|
Translate an aw agent's tools to OpenAI function-calling tool schemas. |
|
Render OpenAI function-calling tool schemas from an |
|
Translate an aw agent to an OpenAI Assistant-style config dict. |
|
Render an OpenAI Assistant-style config dict from an |
Classes
|
Protocol defining the interface for any agentic step in a workflow. |
|
Protocol for validation functions. |
|
Protocol for tools that agents can use. |
|
Configuration for an AgenticStep. |
|
Global configuration with cascading defaults. |
|
Context for sharing state and artifacts between agentic steps. |
|
Tool for executing Python code in a controlled environment. |
|
Extra-safe code interpreter with restricted operations. |
|
Result of code execution. |
|
Tool to sample and analyze file metadata and content. |
|
Agent that loads data from various sources into pandas DataFrames. |
|
Agent that prepares data to meet target requirements. |
|
Orchestrates a chain of agentic steps. |
|
Workflow with human-in-the-loop capabilities. |
|
Normalized, format-agnostic description of an aw agent. |
|
Normalized description of a tool. |
|
Normalized description of a validator. |
- class aw.AgentSpec(name, description='', instructions='', tools=list(), validators=list(), model='', max_retries=3, human_in_loop=False, source_class='', extra=dict())[source]¶
Bases:
objectNormalized, format-agnostic description of an aw agent.
This is the intermediate representation that all translators consume. It captures the essential components of an agent without being tied to any specific framework.
Example
>>> from aw import LoadingAgent >>> spec = extract_agent_spec(LoadingAgent()) >>> spec.name 'LoadingAgent'
- class aw.AgenticStep[ArtifactType](*args, **kwargs)[source]¶
Bases:
Protocol[ArtifactType]Protocol defining the interface for any agentic step in a workflow.
Each step follows the ReAct pattern:
Reason (Thought): Analyze input and context
Act (Action): Generate and execute code or use tools
Observe: Capture results and validate
Repeat or finish based on validation
Example
>>> class MyAgent: ... def execute(self, input_data, context): ... # Agent implementation ... return result, metadata
- execute(input_data, context)[source]¶
Execute the agentic step.
- Parameters:
input_data (
Any) – The input to processcontext (
MutableMapping[str,Any]) – Mutable mapping containing shared state and history
- Return type:
- Returns:
Tuple of (artifact, metadata) where artifact is the main output and metadata contains auxiliary information
- class aw.AgenticWorkflow(context=None)[source]¶
Bases:
objectOrchestrates a chain of agentic steps.
Manages the execution of multiple steps in sequence, handling context/artifact passing between steps.
Example
>>> workflow = AgenticWorkflow() >>> workflow.add_step('loading', loading_agent) >>> workflow.add_step('preparing', preparing_agent) >>> result = workflow.run(source_uri)
- add_step(name, step)[source]¶
Add a step to the workflow.
- Parameters:
name (
str) – Name/identifier for the stepstep (
AgenticStep) – Agent or step implementation
- Return type:
- Returns:
Self for chaining
- class aw.CodeInterpreterTool(allowed_modules=None, global_context=None, executor=None)[source]¶
Bases:
objectTool for executing Python code in a controlled environment.
Provides a safe default implementation using exec() with limited namespace, and allows injection of more robust backends.
Example
>>> tool = CodeInterpreterTool() >>> result = tool("x = 5; y = x * 2; print(y)") >>> result.success True >>> result.output.strip() '10'
- class aw.Context(initial_data=None)[source]¶
Bases:
MutableMapping[str,Any]Context for sharing state and artifacts between agentic steps.
Implements MutableMapping interface for dict-like behavior while providing additional functionality for managing agent state.
Example
>>> ctx = Context() >>> ctx['loading'] = {'df': df, 'info': {...}} >>> ctx['preparing'] = {'df': prepared_df}
- class aw.ExecutionResult(success, output='', error='', traceback_str='', result=None, locals_dict=None)[source]¶
Bases:
objectResult of code execution.
- success¶
Whether execution succeeded without exceptions
- output¶
Standard output captured during execution
- error¶
Error message if execution failed
- traceback¶
Full traceback if execution failed
- result¶
The return value or final expression value
- locals¶
Local variables after execution
- class aw.FileSamplerTool(sample_size=1024)[source]¶
Bases:
objectTool to sample and analyze file metadata and content.
Helps agents understand what kind of data they’re dealing with before attempting to load it.
Example
>>> sampler = FileSamplerTool() >>> info = sampler('/path/to/data.csv') >>> info['extension'] '.csv'
- class aw.GlobalConfig(llm='gpt-4', max_retries=3, human_in_loop=False)[source]¶
Bases:
objectGlobal configuration with cascading defaults.
Provides defaults that can be overridden at step or agent level.
Example
>>> global_cfg = GlobalConfig(llm="gpt-4", max_retries=5) >>> step_cfg = global_cfg.override(llm="gpt-3.5-turbo")
- class aw.InteractiveWorkflow(context=None)[source]¶
Bases:
AgenticWorkflowWorkflow with human-in-the-loop capabilities.
Pauses execution to request human input/approval at configured points.
Example
>>> workflow = InteractiveWorkflow() >>> workflow.add_step('loading', agent, require_approval=True) >>> result = workflow.run_interactive(source_uri)
- add_step(name, step, require_approval=False)[source]¶
Add step with optional approval requirement.
- Return type:
- class aw.LoadingAgent(config=None)[source]¶
Bases:
objectAgent that loads data from various sources into pandas DataFrames.
Uses ReAct loop:
Thought: Analyze source (extension, sample) to choose loader
Action: Generate code to load data
Observe: Execute code and capture result/error
Validate: Check if result is valid DataFrame
Repeat or finish
Example
>>> agent = LoadingAgent() >>> context = Context() >>> df, metadata = agent.execute('/path/to/data.csv', context)
- class aw.PreparationAgent(config=None, target='generic', target_validator=None)[source]¶
Bases:
objectAgent that prepares data to meet target requirements.
Uses ReAct loop with functional validation:
Thought: Analyze current data state vs. requirements
Action: Generate transformation code
Observe: Execute code and capture result
Validate: Try to use data for its purpose (e.g., visualization)
Repeat or finish
Example
>>> agent = PreparationAgent(target='cosmo-ready') >>> context = Context({'loading': {'df': df}}) >>> prepared_df, metadata = agent.execute(df, context)
- class aw.SafeCodeInterpreter(**kwargs)[source]¶
Bases:
CodeInterpreterToolExtra-safe code interpreter with restricted operations.
Disallows file I/O, network access, and other potentially dangerous operations.
- class aw.StepConfig(llm='gpt-4', validator=None, tools=list(), max_retries=3, human_in_loop=False)[source]¶
Bases:
objectConfiguration for an AgenticStep.
Supports both simple objects (strings, ints) and callables for maximum flexibility with dependency injection.
- llm¶
Either a model name string or a text-to-text chat function
Example
>>> config = StepConfig( ... llm="gpt-4", ... validator=lambda x: (True, {}), ... max_retries=3 ... )
- class aw.Tool(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for tools that agents can use.
Tools are callable objects that perform specific actions like executing code, sampling files, or calling external APIs.
Example
>>> class FileSampler: ... def __call__(self, uri): ... # Sample file logic ... return {'extension': '.csv', 'sample': '...'}
- class aw.ToolSpec(name, description='', parameters=dict(), source='')[source]¶
Bases:
objectNormalized description of a tool.
- class aw.Validator(*args, **kwargs)[source]¶
Bases:
ProtocolProtocol for validation functions.
Validators check if an artifact meets requirements and return both a success indicator and detailed information.
Example
>>> def is_non_empty_dataframe(df): ... success = df is not None and len(df) > 0 ... info = {'shape': df.shape if success else None} ... return success, info
- class aw.ValidatorSpec(name, description='', checks=list())[source]¶
Bases:
objectNormalized description of a validator.
- aw.all_validators(*validators)[source]¶
Combine multiple validators - all must pass.
- Parameters:
*validators (
Callable) – Validator functions to combine- Return type:
- Returns:
A validator that passes only if all validators pass
Example
>>> validate = all_validators( ... is_dataframe, ... has_required_columns(['x', 'y']), ... has_no_nulls ... )
- aw.basic_cosmo_validator()[source]¶
Basic validator that checks structural requirements only.
Does not require cosmograph to be installed.
Example
>>> validator = basic_cosmo_validator() >>> success, info = validator(df)
- Return type:
- aw.claude_skill_from_spec(spec, *, name=None, description=None, extra_tools=None, disable_model_invocation=False)[source]¶
Render a Claude Code SKILL.md string from an
AgentSpec.The rendering core of
to_claude_skill()— driveable by anyAgentSpec(not only a live aw agent), so other tools (e.g.coact) can reuse it.Example
>>> from aw import LoadingAgent >>> from aw.translators import extract_agent_spec, claude_skill_from_spec >>> spec = extract_agent_spec(LoadingAgent(), name='data-loading') >>> '---' in claude_skill_from_spec(spec) True
- Return type:
- aw.compute_dataframe_info(df)[source]¶
Compute comprehensive info about a DataFrame.
- Parameters:
df – pandas DataFrame
- Return type:
- Returns:
Dict with shape, dtypes, null counts, sample rows, etc.
Example
>>> import pandas as pd >>> df = pd.DataFrame({'a': [1, 2], 'b': [3, 4]}) >>> info = compute_dataframe_info(df) >>> info['shape'] (2, 2)
- aw.create_cosmo_prep_workflow(cosmo_validator=None, max_retries=3)[source]¶
Create a workflow specifically for cosmograph preparation.
- Parameters:
- Return type:
- Returns:
Configured workflow
Example
>>> workflow = create_cosmo_prep_workflow() >>> prepared_df, metadata = workflow.run('data.csv')
- aw.create_cosmo_validator(cosmo_function=None, required_columns=2, allow_generated_params=True)[source]¶
Create a validator for cosmograph requirements.
This validator attempts to actually call cosmograph.cosmo() with the DataFrame to see if it’s ready for visualization.
- Parameters:
- Return type:
- Returns:
Validator function following (artifact) -> (success, info) protocol
Example
>>> validator = create_cosmo_validator() >>> success, info = validator(df) >>> if success: ... print(f"Can visualize with: {info['params']}")
- aw.create_data_prep_workflow(loading_config=None, preparing_config=None, target='generic')[source]¶
Factory to create a data preparation workflow.
Creates a workflow with LoadingAgent -> PreparationAgent.
- Parameters:
loading_config (
StepConfig) – Configuration for loading agentpreparing_config (
StepConfig) – Configuration for preparing agenttarget (
str) – Target format for preparation
- Return type:
- Returns:
Configured workflow
Example
>>> workflow = create_data_prep_workflow(target='cosmo-ready') >>> df, metadata = workflow.run('/path/to/data.csv')
- aw.create_langchain_executor()[source]¶
Create an executor using LangChain’s CodeInterpreter (if available).
- Return type:
Callable[[str,dict],ExecutionResult]- Returns:
Executor function compatible with CodeInterpreterTool
Example
>>> try: ... executor = create_langchain_executor() ... tool = CodeInterpreterTool(executor=executor) ... except ImportError: ... # LangChain not available - use default ... tool = CodeInterpreterTool()
- aw.create_loading_agent(llm=None, validator=None, max_retries=3)[source]¶
Factory function to create a loading agent.
- Parameters:
- Return type:
- Returns:
Configured LoadingAgent
Example
>>> agent = create_loading_agent(llm="gpt-4", max_retries=5)
- aw.create_oa_chat()[source]¶
Create a chat function through
aw.llm.default_chat()(aix, elseoa).The name is kept for compatibility; generation is routed through
aix.Example
>>> chat = create_oa_chat() >>> response = chat("Hello!")
- aw.create_openai_chat(model='gpt-4', **default_kwargs)[source]¶
Create a text-to-text chat function using OpenAI API.
- Parameters:
model (
str) – OpenAI model name**default_kwargs – Default parameters for API calls
- Return type:
- Returns:
A callable that takes a prompt and returns a response
Example
>>> chat = create_openai_chat("gpt-4o-mini") >>> response = chat("What is 2+2?")
(Skipped: the call is billable and needs
OPENAI_API_KEY.)
- aw.create_preparation_agent(target='generic', validator=None, llm=None, max_retries=3)[source]¶
Factory function to create a preparation agent.
- Parameters:
- Return type:
- Returns:
Configured PreparationAgent
Example
>>> agent = create_preparation_agent( ... target='cosmo-ready', ... validator=cosmo_validator, ... max_retries=5 ... )
- aw.crewai_yaml_from_spec(spec, *, name=None, role=None, goal=None, backstory=None)[source]¶
Render a CrewAI agent config dict from an
AgentSpec.The rendering core of
to_crewai_yaml(), driveable by anyAgentSpec.- Return type:
- aw.default_llm_factory(model='gpt-4')[source]¶
Factory to create LLM function from various specifications.
- Parameters:
model (
Union[str,Callable]) – Either a model name string, or a callable- Return type:
- Returns:
A callable text-to-text function
Example
>>> llm = default_llm_factory("gpt-4") >>> llm = default_llm_factory(lambda p: f"Echo: {p}")
- aw.djoin(*p)¶
Join two or more pathname components, inserting ‘/’ as needed. If any component is an absolute path, all previous path components will be discarded. An empty last part will result in a path that ends with a separator.
- aw.extract_agent_spec(agent, name=None)[source]¶
Extract a normalized AgentSpec from any aw agent.
Introspects the agent’s class, config, tools, and validators to build a format-agnostic intermediate representation.
- Parameters:
- Return type:
- Returns:
AgentSpec with all extractable information
Example
>>> from aw import LoadingAgent >>> spec = extract_agent_spec(LoadingAgent()) >>> spec.name 'LoadingAgent' >>> len(spec.tools) >= 1 True
- aw.functional_validator(try_function, success_check=None)[source]¶
Create a validator that tries to use the artifact for its purpose.
This validator actually attempts to use the artifact in the way it’s intended to be used (e.g., try to visualize the data, try to train a model).
- Parameters:
- Return type:
- Returns:
A validator function
Example
>>> def try_cosmo(df): ... return cosmograph.cosmo(df, points_x_by='x', points_y_by='y') >>> validate = functional_validator(try_cosmo) >>> validate(df)
- aw.get_numeric_columns(df, exclude_nulls=True)[source]¶
Get numeric columns from DataFrame.
- Parameters:
df – pandas DataFrame
exclude_nulls (
bool) – Whether to exclude columns with null values
- Returns:
Generator of column names
Example
>>> for col in get_numeric_columns(df): ... print(col)
- aw.has_attributes(**required_attrs)[source]¶
Validator that checks artifact has required attributes.
Example
>>> validate = has_attributes(shape=lambda s: len(s) == 2, columns=lambda c: len(c) > 0)
- aw.infer_cosmo_params(df)[source]¶
Infer suitable cosmograph parameters from DataFrame.
- Parameters:
df – pandas DataFrame
- Return type:
- Returns:
Dict of suggested parameters for cosmograph.cosmo()
Example
>>> params = infer_cosmo_params(df) >>> from cosmograph import cosmo >>> cosmo(df, **params)
- aw.infer_loader_from_extension(extension)[source]¶
Infer pandas loader function from file extension.
- Parameters:
extension (
str) – File extension (e.g., ‘.csv’, ‘.json’)- Return type:
- Returns:
Name of pandas loader function
Example
>>> infer_loader_from_extension('.csv') 'read_csv' >>> infer_loader_from_extension('.xlsx') 'read_excel'
- aw.infer_loader_params(extension, sample_text=None)[source]¶
Infer parameters for pandas loader based on file characteristics.
- Parameters:
- Return type:
- Returns:
Dict of parameters to pass to loader
Example
>>> params = infer_loader_params('.csv', 'a,b,c\n1,2,3') >>> params.get('sep') ','
- aw.info_dict_validator(compute_info, check_info)[source]¶
Create a validator that computes info then checks it.
This is a two-stage validator:
Compute information about the artifact (e.g., df.shape, df.dtypes)
Check if that information meets requirements
- Parameters:
- Return type:
- Returns:
A validator function
Example
>>> def compute_df_info(df): ... return {'shape': df.shape, 'null_count': df.isnull().sum().sum()} >>> def check_df_info(info): ... if info['null_count'] > 10: ... return False, "Too many nulls" ... return True, "OK" >>> validate = info_dict_validator(compute_df_info, check_df_info)
- aw.is_not_empty()[source]¶
Validator that checks artifact is not empty.
Works for sequences, mappings, DataFrames, etc.
- aw.is_type(expected_type)[source]¶
Validator that checks artifact type.
Example
>>> import pandas as pd >>> validate = is_type(pd.DataFrame)
- aw.load_and_prepare(source_uri, target='generic', validator=None, max_retries=3)[source]¶
Convenience function to load and prepare data in one call.
- Parameters:
- Return type:
- Returns:
Tuple of (prepared_dataframe, metadata)
Example
>>> df, meta = load_and_prepare('data.csv', target='cosmo-ready')
- aw.load_for_cosmo(source_uri, max_retries=3, strict=False)[source]¶
Load and prepare data specifically for cosmograph visualization.
- Parameters:
- Return type:
- Returns:
Tuple of (prepared_dataframe, metadata)
Example
>>> df, meta = load_for_cosmo('data.csv') >>> from cosmograph import cosmo >>> cosmo(df, **meta['preparing']['metadata']['validation_result']['params'])
- aw.openai_assistant_from_spec(spec, *, name=None, model='gpt-4')[source]¶
Render an OpenAI Assistant-style config dict from an
AgentSpec.The rendering core of
to_openai_assistant(), driveable by anyAgentSpec.- Return type:
- aw.openai_tools_from_spec(spec)[source]¶
Render OpenAI function-calling tool schemas from an
AgentSpec.The rendering core of
to_openai_tools(), driveable by anyAgentSpec.- Return type:
- aw.schema_validator(schema)[source]¶
Create a validator from a schema (Pydantic, JSON Schema, etc.).
- Parameters:
schema (
Any) – A schema object with validation capability- Return type:
- Returns:
A validator function
Example
>>> from pydantic import BaseModel >>> class DataSchema(BaseModel): ... x: float ... y: float >>> validate = schema_validator(DataSchema) >>> validate({'x': 1.0, 'y': 2.0}) (True, {'validated': ...})
- aw.strict_cosmo_validator()[source]¶
Strict validator that actually calls cosmograph.
Requires cosmograph to be installed.
Example
>>> validator = strict_cosmo_validator() >>> success, info = validator(df)
- Return type:
- aw.to_claude_skill(agent, name=None, description=None, extra_tools=None, disable_model_invocation=False)[source]¶
Translate an aw agent to a Claude Code SKILL.md string.
Generates a complete SKILL.md file with YAML frontmatter and markdown instructions, compatible with both Claude Code skills and the Agent Skills Open Standard (agentskills.io).
- Parameters:
- Return type:
- Returns:
Complete SKILL.md content as a string
Example
>>> from aw import LoadingAgent >>> skill = to_claude_skill(LoadingAgent(), name='data-loading') >>> '---' in skill True >>> 'data-loading' in skill True
- aw.to_crewai_yaml(agent, name=None, role=None, goal=None, backstory=None)[source]¶
Translate an aw agent to a CrewAI agent YAML config dict.
CrewAI agents are defined with role, goal, backstory, and tools. This function maps aw’s AgentSpec to that structure.
- Parameters:
- Return type:
- Returns:
Dict suitable for YAML serialization as a CrewAI agent config
Example
>>> from aw import LoadingAgent >>> config = to_crewai_yaml(LoadingAgent(), name='data_loader') >>> config['role'] 'Data Loading Specialist'
- aw.to_openai_assistant(agent, name=None, model='gpt-4')[source]¶
Translate an aw agent to an OpenAI Assistant-style config dict.
Generates a configuration suitable for creating an OpenAI Assistant (or Responses API agent) via the API.
- Parameters:
- Return type:
- Returns:
Dict with assistant configuration
Example
>>> from aw import LoadingAgent >>> config = to_openai_assistant(LoadingAgent()) >>> 'instructions' in config True
- aw.to_openai_tools(agent)[source]¶
Translate an aw agent’s tools to OpenAI function-calling tool schemas.
Generates JSON-Schema-based tool definitions compatible with the OpenAI Chat Completions API and Responses API.
- Parameters:
agent (
Any) – An aw agent instance- Return type:
- Returns:
List of tool definition dicts in OpenAI format
Example
>>> from aw import LoadingAgent >>> tools = to_openai_tools(LoadingAgent()) >>> all(t['type'] == 'function' for t in tools) True
- aw.try_cosmo_visualization(df, cosmo_function=None, **cosmo_kwargs)[source]¶
Try to create a cosmograph visualization.
This is a functional validator that actually attempts the visualization.
- Parameters:
- Return type:
- Returns:
Tuple of (success, info)
Example
>>> from cosmograph import cosmo >>> success, info = try_cosmo_visualization(df, cosmo)
- aw.workflow_to_crewai_yaml(workflow)[source]¶
Translate an AgenticWorkflow to CrewAI agents.yaml + tasks.yaml.
- Parameters:
workflow (
Any) – An AgenticWorkflow instance- Return type:
- Returns:
Dict with ‘agents’ and ‘tasks’ keys, each containing YAML-serializable config dicts
Example
>>> from aw import create_cosmo_prep_workflow >>> workflow = create_cosmo_prep_workflow() >>> config = workflow_to_crewai_yaml(workflow) >>> 'agents' in config and 'tasks' in config True
- aw.workflow_to_skills(workflow, output_dir)[source]¶
Translate an AgenticWorkflow into a set of Claude Code skills.
Each step in the workflow becomes a separate skill directory.
- Parameters:
- Return type:
- Returns:
List of Paths to created skill directories
Example
>>> from aw import create_cosmo_prep_workflow >>> workflow = create_cosmo_prep_workflow() >>> paths = workflow_to_skills(workflow, '/tmp/skills')
- aw.write_skill_directory(agent, output_dir, name=None, description=None, include_scripts=True)[source]¶
Write a complete Claude Code skill directory.
Creates:
output_dir/ ├── SKILL.md └── scripts/ (if include_scripts and agent has tools) └── validate.py (validator wrapper script)- Parameters:
- Return type:
- Returns:
Path to the created directory
Example
>>> from aw import LoadingAgent >>> path = write_skill_directory( ... LoadingAgent(), '/tmp/test-skill', name='data-loading' ... )
Modules
Core protocols and base classes for agentic workflows. |
|
Cosmograph-specific validator tool. |
|
Cheap-first dispatch to a skill: calibrated retrieval first, an LLM adjudicator only on ambiguity. |
|
This module provides robust templates for creating (python) code-generating functions that can translate natural language task descriptions into executable Python code. |
|
The one place aw reaches a language model: |
|
Loading agent for converting data sources to pandas DataFrames. |
|
Orchestration and workflow management for agentic steps. |
|
Preparation agent for transforming data to meet target requirements. |
|
Function makeing and calling |
|
Configurable routing and decision chains for agentic workflows. |
|
Tools for executing code and other agent actions. |
|
Translators from aw agent specifications to other agent formats. |
|
Utility tools and helper functions for agents. |
|
Validation system supporting three flavors: schema, info-dict, and functional. |