a3-problem-solver
You are a3-problem-solver - a specialized skill for A3 problem-solving including structured problem analysis and countermeasure development.
Overview
This skill enables AI-powered A3 problem-solving including:
- A3 template generation
- Problem statement development
- Current condition analysis
- Root cause investigation
- Target condition definition
- Countermeasure development
- Implementation planning
- Follow-up tracking
Capabilities
1. A3 Template Generation
from dataclasses import dataclass
from typing import List, Dict, Optional
from datetime import datetime
from enum import Enum
class A3Type(Enum):
PROBLEM_SOLVING = "problem_solving"
PROPOSAL = "proposal"
STATUS_REPORT = "status_report"
@dataclass
class A3Document:
title: str
owner: str
date: datetime
a3_type: A3Type
mentor: Optional[str] = None
def create_a3_template(doc: A3Document):
"""
Create A3 template structure
A3 is a single 11x17 page summarizing problem-solving thinking
"""
if doc.a3_type == A3Type.PROBLEM_SOLVING:
template = {
"header": {
"title": doc.title,
"owner": doc.owner,
"date": doc.date.strftime("%Y-%m-%d"),
"mentor": doc.mentor,
"revision": 1
},
"left_side": {
"1_background": {
"section": "Background",
"prompt": "Why is this important? What is the business context?",
"content": ""
},
"2_current_condition": {
"section": "Current Condition",
"prompt": "What is happening now? Include data and visual.",
"content": "",
"data": [],
"visual": None
},
"3_goal": {
"section": "Goal/Target Condition",
"prompt": "What specific, measurable outcome do we want?",
"content": "",
"metric": "",
"target": "",
"deadline": ""
},
"4_root_cause": {
"section": "Root Cause Analysis",
"prompt": "Why does this problem exist? (5 Whys, Fishbone)",
"content": "",
"method": "",
"root_causes": []
}
},
"right_side": {
"5_countermeasures": {
"section": "Countermeasures",
"prompt": "What will we do to address root causes?",
"countermeasures": []
},
"6_implementation": {
"section": "Implementation Plan",
"prompt": "Who does what by when?",
"actions": []
},
"7_followup": {
"section": "Follow-up",
"prompt": "How will we verify results and sustain?",
"check_dates": [],
"success_criteria": ""
}
}
}
elif doc.a3_type == A3Type.PROPOSAL:
template = {
"header": {"title": doc.title, "owner": doc.owner},
"left_side": {
"1_background": {"section": "Background/Context"},
"2_current_condition": {"section": "Current Situation"},
"3_proposal": {"section": "Proposal"},
"4_analysis": {"section": "Analysis/Rationale"}
},
"right_side": {
"5_plan": {"section": "Implementation Plan"},
"6_cost_benefit": {"section": "Cost-Benefit Analysis"},
"7_risks": {"section": "Risks and Mitigation"}
}
}
return template
2. Problem Statement Development
def develop_problem_statement(observations: Dict):
"""
Develop clear, specific problem statement
observations: {
'what': description of the problem,
'where': location/process,
'when': when it occurs,
'extent': magnitude/frequency,
'impact': business impact
}
"""
# Validate completeness
required = ['what', 'where', 'when', 'extent', 'impact']
missing = [r for r in required if r not in observations or not observations[r]]
if missing:
return {
"status": "incomplete",
"missing_elements": missing,
"guidance": get_problem_statement_guidance(missing)
}
# Construct problem statement
statement = f"{observations['what']} is occurring in {observations['where']}. "
statement += f"This happens {observations['when']}, with {observations['extent']}. "
statement += f"The impact is {observations['impact']}."
# Check for solution bias
solution_words = ['should', 'need to', 'must', 'implement', 'install']
has_solution_bias = any(word in statement.lower() for word in solution_words)
return {
"problem_statement": statement,
"elements": observations,
"quality_check": {
"is_specific": len(observations['what']) > 20,
"is_measurable": any(char.isdigit() for char in observations['extent']),
"has_solution_bias": has_solution_bias,
"recommendation": "Remove solution references" if has_solution_bias else "Good problem statement"
}
}
def get_problem_statement_guidance(missing: list):
guidance = {
'what': "Describe what is wrong or not working as expected",
'where': "Specify the location, process, or system affected",
'when': "When does the problem occur? Patterns, triggers?",
'extent': "How big is the problem? Frequency, percentage, quantity?",
'impact': "What is the business impact? Cost, customer, safety?"
}
return {m: guidance.get(m, "") for m in missing}
3. Current Condition Analysis
def analyze_current_condition(data: Dict, process_description: str):
"""
Document and analyze current condition
"""
analysis = {
"process_overview": process_description,
"performance_data": {},
"observations": [],
"process_map": None,
"visual_representation": None
}
# Analyze provided data
if 'metrics' in data:
for metric, values in data['metrics'].items():
if isinstance(values, list):
import numpy as np
analysis['performance_data'][metric] = {
'current': values[-1] if values else None,
'average': round(np.mean(values), 2),
'trend': 'improving' if len(values) > 1 and values[-1] > values[0] else 'declining',
'variability': round(np.std(values), 2)
}
else:
analysis['performance_data'][metric] = {'current': values}
# Gap analysis
if 'target' in data and 'current' in data:
analysis['gap'] = {
'target': data['target'],
'current': data['current'],
'gap_size': data['target'] - data['current'],
'gap_percent': round((data['target'] - data['current']) / data['target'] * 100, 1)
}
# Observations from gemba
if 'observations' in data:
for obs in data['observations']:
analysis['observations'].append({
'observation': obs,
'category': categorize_observation(obs)
})
return analysis
def categorize_observation(observation: str):
"""Categorize observation type"""
obs_lower = observation.lower()
if any(w in obs_lower for w in ['wait', 'idle', 'delay']):
return 'waiting'
elif any(w in obs_lower for w in ['error', 'defect', 'mistake']):
return 'quality'