We are going to build a generator for an operational readiness review checklist.
The user will input information about their system, and we will generate a checklist that includes:
- Dependencies (internal and external)
- Runbooks (for common operations and failure scenarios)
- Alerts (monitoring and alerting setup)
- Test evidence (evidence of tests performed, such as load tests, failover tests, etc.)
We'll design a simple command-line interface (CLI) that asks the user a series of questions and then generates a checklist in a markdown format.
Steps:
- We'll define a set of questions for each category.
- We'll collect answers from the user (with the ability to skip or provide multiple items).
- We'll format the answers into a markdown checklist.
Let's break down the categories:
-
Dependencies:
- Internal dependencies (e.g., other services within the same organization)
- External dependencies (e.g., third-party APIs, cloud services)
-
Runbooks:
- Common operations (e.g., deployment, scaling, backup/restore)
- Failure scenarios (e.g., service down, data corruption, performance degradation)
-
Alerts:
- Key metrics to monitor (e.g., error rates, latency, resource usage)
- Alert thresholds and notification channels
-
Test evidence:
- Load testing results
- Failover/disaster recovery tests
- Security tests
- Any other relevant tests
We'll create a function for each category that asks the necessary questions and returns a structured list of items.
However, note that the user might have multiple items in each category. We'll design the questions to allow multiple entries.
Example for dependencies:
"List the internal dependencies (one at a time, press Enter when done):"
Then we collect until the user enters a blank line.
But we also want to capture additional details? For example, for each dependency, we might want to know:
- Name
- Description
- Contact/Owner
- SLA/uptime?
Similarly, for runbooks, we might want:
- Scenario title
- Steps to resolve
- Owner/contact
For alerts:
- Metric name
- Threshold
- Notification channel (e.g., Slack, email, PagerDuty)
- Escalation policy?
For test evidence:
- Test type
- Date performed
- Results (pass/fail)
- Link to report or evidence
We can design a flexible way to collect key-value pairs for each item, but that might be too heavy for a CLI.
Alternatively, we can have a fixed set of questions for each item in a category, but that would require the user to answer the same set for each item.
Let's simplify: we'll ask for a description of each item and then for some additional details that are category-specific.
However, to keep it simple and not too tedious, we might just ask for a list of items and then for each item we ask a few follow-up questions.
But note: the user might have 10 dependencies. We don't want to ask 5 questions for each? That's 50 questions.
Alternatively, we can ask for a list and then for each category we ask for the details in a structured way (like a CSV). But that's not user-friendly.
Let's design the flow:
For each category, we:
-
Ask: "How many [items] do you want to list?" or let the user enter one by one until they are done.
-
For each item, we ask a set of questions (but we can make some optional).
However, to avoid fatigue, we can break it into steps:
Step 1: List all items (just names) for the category.
Step 2: For each item, ask for details.
But that's two steps per category. Alternatively, we can do:
For each item:
- Name (required)
- Then, for that category, we ask specific questions.
But then if we have 10 items, we ask the same set of 5 questions 10 times? That's repetitive.
We can have a template for each category and then let the user fill in a table? But in CLI?
Let's think of a compromise:
We'll ask for the items one by one, and for each item we ask the same set of questions (with some being optional).
However, we can make the questions category-specific and skip if not applicable.
Alternatively, we can have a "quick mode" and a "detailed mode". But let's stick to one mode.
Since this is a checklist generator, the user might not need every detail for every item. We can make the additional details optional.
Let's define the questions per category:
Dependencies (for each dependency):
- Name
- Description (optional)
- Owner/Contact (optional)
- SLA/Uptime (optional)
Runbooks (for each runbook):
- Scenario title
- Steps to resolve (could be multiple steps, we can ask for step by step? or just a paragraph?)
- Owner/Contact (optional)
But steps might be long. We can ask for a link to the runbook? Or we can just ask for a summary and then a link.
Alternatively, we can ask:
- Title
- Summary (one paragraph)
- Link to detailed runbook (optional)
Similarly for alerts:
- Metric name
- Threshold (e.g., > 80% CPU for 5 minutes)
- Notification channel (Slack, email, etc.)
- Escalation policy (optional)
For test evidence:
- Test type (e.g., load, failover, security)
- Date
- Result (pass/fail)
- Link to report (optional)
We'll design a function that, given a category name and a list of questions (with optional flag), collects the data.
But note: the user might want to add multiple items of the same category. We'll have a loop.
However, to keep it simple, we can do:
category = "Dependencies"
items = []
while True:
name = input("Enter dependency name (or press Enter to finish): ")
if not name:
break
Then ask the other questions for this dependency.
But we have to do this for each category.
Let's write a helper function to collect an item given a list of questions (each question is a dict with 'text' and 'optional').
However, we don't want to over-engineer.
Alternatively, we can have a fixed set of questions for each category and then just loop.
Let's code for one category at a time.
We'll create a function:
def collect_items(category_name, questions):
items = []
print(f"\n=== {category_name} ===")
while True:
print(f"\nAdding a new {category_name[:-1]} (press Enter without typing to finish):")
item = {}
for q in questions:
answer = input(f"{q['text']} {'(optional)' if q.get('optional') else ''}: ")
# If the question is not optional and answer is empty, we can re-ask? But let's just skip if optional and empty.
if answer or not q.get('optional'):
item[q['key']] = answer
if item: # if the user entered at least the required fields, we add.
items.append(item)
else:
# if the user didn't enter anything for the first required question, we break?
# But note: we might have only optional questions? Not likely.
# Alternatively, we break when the user presses Enter at the name (or first required) prompt?
# Let's break only when the user doesn't enter anything for the first question? But that's not consistent.
# Instead, we break when the user enters nothing at the first prompt (which is the name for dependencies and runbooks, etc.)
# But we don't know which is the first required? We can assume the first question is required.
pass
# Ask if they want to add another
another = input("Add another? (y/n): ").lower()
if another != 'y':
break
return items
But note: the above loop breaks when the user says 'n' for another. Also, we are asking for each question.
However, we might want to allow the user to skip an item if they made a mistake? We can allow them to break without adding if they press Enter at the first question? But then we break the entire loop.
Let's change: we break the inner loop when the user presses Enter at the first required question? Not ideal.
Alternatively, we can do:
while True:
item = {}
for q in questions:
answer = input(...)
if answer:
item[q['key']] = answer
else:
if not q['optional']:
print("This field is required. Please enter a value.")
# and then re-ask the same question? We need to repeat until we get a required field.
# This complicates the loop.
Let's simplify: we assume the first question is required and the rest are optional. If the first is empty, we break the entire item addition.
But then we cannot have a category where the first question is optional? We can design the questions so that the first is always required.
Alternatively, we can have a separate list of required keys and then check after collecting all answers for an item.
Let's do:
required_keys = [q['key'] for q in questions if not q.get('optional')]
Then after collecting, if any required key is missing, we print an error and ask again for that item.
But that would require us to store the item and then re-ask the missing ones? Or we can re-ask the entire item?
Since it's a CLI and we want to keep it simple, let's do:
We ask all questions. If a required question is not answered, we print an error and then re-ask the entire item? Not efficient.
Alternatively, we can ask each question and if it's required and empty, we print a warning and ask again for that same question until we get an answer.
Let's adjust:
for q in questions:
while True:
answer = input(f"{q['text']} {'(optional)' if q.get('optional') else ''}: ")
if answer or q.get('optional'):
item[q['key']] = answer
break
else:
print("This field is required. Please try again.")
But then for optional fields, we break immediately with empty string? We can set to empty string.
However, we might want to skip optional fields if the user doesn't want to provide. So we break the while loop for optional even if empty.
But note: we are in a for loop for questions. We break the inner while only when we have an answer for required or we have an empty for optional.
But then we break the inner while and move to next question.
Let's code accordingly.
However, we also want to allow the user to cancel the entire item? We can have a special command (like 'skip') to skip the entire item? But that's complex.
Alternatively, we can let the user break the item by pressing Ctrl+C? Not user-friendly.
Since this is a simple generator, we can assume the user will provide required info.
Let's change the flow:
We'll collect the first required field separately and if empty, we break the item and then break the loop for adding items? But that's not consistent.
After thinking, I propose:
We'll have a list of questions for each category.
We'll have a function that asks the questions for one item and returns the item dict.
If at any point the user wants to skip the entire item, they can type 'skip' (or just press Enter for the first required and then we break the item?).
But then if they press Enter for the first required, we break the item and then we break the loop for adding items? That's not what we want.
We want to allow the user to finish adding items for the category.
So let's do:
while True:
print(f"\nAdding a new {category_name[:-1]}")
item = {}
for q in questions:
while True:
answer = input(f"{q['text']} {'(optional)' if q.get('optional') else ''}: ")
if answer == 'skip':
# break out of the inner while and then break out of the for loop, and then break out of the outer loop?
# But we want to skip only this item, not the entire category.
# So we break the inner while and then set a flag to break the for loop and then break the outer loop? No.
# We want to skip the current item and then ask if they want to add another.
# So we break the inner while and then break the for loop (without adding the item) and then go to the "another" question.
break
if answer or q.get('optional'):
item[q['key']] = answer
break
else:
print("This field is required. Please try again.")
if answer == 'skip':
break
if item and not (answer == 'skip' and not item):
# if we have an item (meaning we didn't skip in the middle) then add it.
items.append(item)
else:
# if we skipped, we don't add the incomplete item.
pass
another = input("Add another? (y/n): ").lower()
if another != 'y':
break
This is getting complicated.
Let's simplify the requirements:
We don't need a 'skip' for individual items. Instead, if the user makes a mistake, they can just finish the item and then we allow them to delete it later? Or we can have an edit feature? Not in this simple version.
We'll assume the user wants to add an item and will provide the required fields.
So we'll do:
while True:
item = {}
for q in questions:
while True:
answer = input(f"{q['text']} {'(optional)' if q.get('optional') else ''}: ")
if answer:
item[q['key']] = answer
break
elif q.get('optional'):
# if optional and empty, we break without setting the key? or set to empty string?
# We can set to empty string? Or skip the key? We'll skip the key (so it's not in the dict).
break
else:
print("This field is required. Please try again.")
# Now, we check if the item has all required keys? We assume the above loop ensures that.
items.append(item)
another = input("Add another? (y/n): ").lower()
if another != 'y':
break
But note: if the user enters nothing for a required field, we keep asking until they do. So we are guaranteed to have the required keys.
However, what if the user wants to stop in the middle of an item? We don't have a way. But that's okay because they have to finish the required fields.
We can also allow the user to type 'quit' to break the entire category? But then we might lose the items we already collected? We can break the outer loop.
Let's add: in the first required question, if they type 'quit', we break the entire category.
But that's getting too complex.
Alternatively, we can just rely on Ctrl+C.
Let's keep it simple and not handle 'skip' or 'quit' within an item.
Now, we need to define the questions for each category.
- Dependencies:
questions = [
{'key': 'name', 'text': 'Name', 'optional': False},
{'key': 'description', 'text': 'Description', 'optional': True},
{'key': 'owner', 'text': 'Owner/Contact', 'optional': True},
{'key': 'sla', 'text': 'SLA/Uptime', 'optional': True}
]
- Runbooks:
questions = [
{'key': 'title', 'text': 'Scenario title', 'optional': False},
{'key': 'summary', 'text': 'Summary/Steps', 'optional': False}, # we can change to a multi-line input? But let's keep it simple.
{'key': 'link', 'text': 'Link to detailed runbook', 'optional': True}
]
Note: for summary, we can use a multi-line input? The input function in Python reads one line. We can ask for multiple lines until a delimiter? But that's complex.
Let's change: we'll ask for a single line for summary, and if they need more, they can put a link.
Alternatively, we can do:
summary_lines = []
print("Enter summary/steps (one per line, press Enter on an empty line to finish):")
while True:
line = input()
if line == '':
break
summary_lines.append(line)
item['summary'] = '\n'.join(summary_lines)
But that would break our generic function.
So we might need to handle multi-line for some fields? We can have a flag for multi-line in the question.
Let's adjust the question dict:
{'key': 'summary', 'text': 'Summary/Steps (one per line, empty line to finish)', 'optional': False, 'multi_line': True}
Then in the collecting function, we check for 'multi_line' and then do a while loop until empty line.
But then we are mixing the way we collect.
Alternatively, we can have a separate function for multi-line and then for single line.
Since only the summary in runbooks might be multi-line? Maybe also the steps in runbooks? But we are using summary for steps.
Let's keep it simple and not do multi-line. We'll just ask for a single line and they can use semicolons or something.
Or we can change the runbook to have two fields:
- Steps (multi-line)
- Link to detailed runbook (optional)
But then we are changing the structure.
Given the complexity, let's stick to single line for all and if they need more, they can put a link.
So for runbooks, we ask for a summary in one line.
- Alerts:
questions = [
{'key': 'metric', 'text': 'Metric name', 'optional': False},
{'key': 'threshold', 'text': 'Threshold (e.g., > 80% for 5 minutes)', 'optional': False},
{'key': 'channel', 'text': 'Notification channel (e.g., Slack, email)', 'optional': False},
{'key': 'escalation', 'text': 'Escalation policy', 'optional': True}
]
- Test evidence:
questions = [
{'key': 'type', 'text': 'Test type', 'optional': False},
{'key': 'date', 'text': 'Date (YYYY-MM-DD)', 'optional': False},
{'key': 'result', 'text': 'Result (pass/fail)', 'optional': False},
{'key': 'link', 'text': 'Link to report', 'optional': True}
]
Now, we'll create a main loop that goes through each category and collects the items.
Then we generate a markdown file.
Let's code accordingly.
However, note that the user might not want to fill every category. We can ask: "Do you want to add dependencies? (y/n)" and then only if yes, we collect.
But the requirement is to generate a checklist, so we might want to have all categories even if empty? We can generate the markdown with empty lists.
We'll design:
categories = [
{
'name': 'Dependencies',
'questions': [...]
},
{
'name': 'Runbooks',
'questions': [...]
},
... etc.
]
Then we loop over categories, and for each, we ask: "Do you want to add items for Dependencies? (y/n)" and then if yes, we collect.
But then we might want to skip a category entirely? We can, and then in the markdown we just write "## Dependencies\n\nNo items added."
Alternatively, we can just collect for all categories and if the user doesn't want to add, they just press Enter at the first question? But then we break the entire category? We need a way to skip the category.
Let's adjust the collect_items function to allow skipping the entire category by typing 'skip' at the first required question? But then we break the entire category.
We can do:
print(f"\n=== {category_name} ===")
first_question = questions[0]
answer = input(f"{first_question['text']} (or type 'skip' to skip this category): ")
if answer.lower() == 'skip':
return [] # no items for this category
# Otherwise, we start with this answer and then ask the rest?
# But then we have already taken the first answer. We need to handle the first answer in the loop.
Alternatively, we can change the collect_items function to:
items = []
while True:
item = {}
for i, q in enumerate(questions):
if i == 0:
answer = input(f"{q['text']} (or press Enter to finish this category): ")
if answer == '':
break # break the for loop and then break the while? We want to break the while too.
# But note: we are in the for loop. We break the for and then we are still in the while.
# So we break the for and then check if we have an item? But we don't have the first required? So we break the while too.
else:
answer = input(f"{q['text']}: ")
# But then we are not handling required and optional.
This is getting messy.
Let's change the plan:
We'll not have a generic function. We'll handle each category separately with its own set of questions and flow.
But that would be repetitive code.
Alternatively, we can design a simple generic function that just asks the questions in order and breaks when the first required is empty? And then we break the entire category.
We can do:
items = []
while True:
item = {}
for q in questions:
if q.get('multi_line'):
# handle multi-line
pass
else:
answer = input(f"{q['text']} {'(optional)' if q.get('optional') else ''}: ")
if answer:
item[q['key']] = answer
elif not q.get('optional'):
# If required and empty, we break the entire item and then break the while loop?
# We want to break the current item and then break the while loop? Or just break the item and then ask for another?
# Let's break the current item and then break the while loop? That would mean if the user forgets a required field, we skip the entire category? Not good.
# Instead, we can break the current item and then continue to the next item? But we are in the middle of the for loop.
This is too complex for a simple script.
Given the time, let's do a simpler approach:
We'll have a fixed set of questions for each category and we'll just ask them without trying to be too generic.
We'll write separate functions for each category.
But note: the structure of the generated markdown will be the same, just the content different.
We can have:
def collect_dependencies():
items = []
print("\n=== Dependencies ===")
while True:
name = input("Name (or press Enter to finish): ")
if not name:
break
description = input("Description: ")
owner = input("Owner/Contact: ")
sla = input("SLA/Uptime: ")
items.append({
'name': name,
'description': description,
'owner': owner,
'sla': sla
})
return items
And similarly for others.
Then we can have a dictionary of category data:
data = {
'dependencies': collect_dependencies(),
'runbooks': collect_runbooks(),
...
}
Then generate markdown from data.
Let's do that.
We'll write:
collect_dependencies()
collect_runbooks()
collect_alerts()
collect_tests()
And then generate a markdown string.
We'll design the markdown as:
# Operational Readiness Review Checklist
## Dependencies
- [ ] Name: ..., Description: ..., Owner: ..., SLA: ...
or maybe a table? But markdown checklist is usually a list.
We can do:
### Internal Dependencies
- [ ] **Name**: <name>
- Description: <description>
- Owner: <owner>
- SLA: <sla>
### External Dependencies
But we didn't differentiate internal vs external? We can ask in the dependency collection: is it internal or external?
Let's change the dependency collection to ask:
name
type (internal/external)
then the rest.
So we adjust:
name = input("Name: ")
type = input("Type (internal/external): ")
...
Then in the markdown, we can group by type? Or just list and include type.
We'll just list all and include type in the description.
Alternatively, we can have two sub-sections.
But to keep it simple, we'll just list all.
However, the requirement says "dependencies" and we have internal and external. We can ask:
How about:
collect_dependencies():
items = []
while True:
name = input("Dependency name (or press Enter to finish): ")
if not name:
break
dep_type = input("Type (internal/external): ")
description = input("Description: ")
owner = input("Owner/Contact: ")
sla = input("SLA/Uptime: ")
items.append({
'name': name,
'type': dep_type,
'description': description,
'owner': owner,
'sla': sla
})
Then in markdown:
## Dependencies
### Internal
- [ ] **Name**: <name>
- Description: <description>
- Owner: <owner>
- SLA: <sla>
### External
... same
We can group by type.
Let's do that.
Similarly for runbooks, we might want to group by type? The requirement says "common operations and failure scenarios". So we can ask:
For runbooks:
title
scenario_type (common operation / failure scenario)
summary
link
And then group by scenario_type.
For alerts, we don't have a natural grouping? We can just list.
For test evidence, we can group by test type? The requirement mentions load tests, failover tests, security tests.
So ask:
test_type
date
result
link
Then group by test_type.
Let's adjust:
We'll change the collection functions to include a 'type' field for dependencies, runbooks, and test evidence.
For alerts, we don't have a type? We can leave as is.
But then the markdown generation will be:
For each category, if we have a 'type' field, we group by type.
We can design the data structure:
data = {
'dependencies': [
{ 'name': ..., 'type': 'internal', ... },
...
],
'runbooks': [
{ 'title': ..., 'type': 'common operation', ... },
...
],
'alerts': [ ... ], # no type
'tests': [
{ 'type': 'load', ... },
...
]
}
Then in markdown:
## Dependencies
### Internal
- [ ] ...
### External
- [ ] ...
## Runbooks
### Common Operations
- [ ] ...
### Failure Scenarios
- [ ] ...
## Alerts
- [ ] ...
## Test Evidence
### Load Tests
- [ ] ...
### Failover Tests
- [ ] ...
### Security Tests
- [ ] ...
### Other
- [ ] ...
We need to define the types for each category.
Let's define:
Dependencies types: 'internal', 'external'
Runbooks types: 'common operation', 'failure scenario'
Test evidence types: 'load', 'failover', 'security', 'other'
But note: the user might type something else. We can collect as given and then group by the exact string? Or we can normalize?
We can let the user choose from a list? But then we are restricting.
Alternatively, we can collect the type as free text and then when generating, we group by the exact string. But then if the user types "Common Operation" and "common operation", they become two groups.
We can normalize by lowercasing and then maybe mapping? But let's keep it simple and just group by the exact string.
We can also have an 'other' option and then let the user type.
But in the collection, we can provide a list of options? We can do:
dep_type = input("Type (internal/external): ")
while dep_type not in ['internal', 'external']:
print("Please choose 'internal' or 'external'")
dep_type = input("Type (internal/external): ")
Similarly for runbooks and tests.
Let's do that to keep the grouping clean.
So:
Dependencies:
type: choose from ['internal', 'external']
Runbooks:
type: choose from ['common operation', 'failure scenario']
Tests:
type: choose from ['load', 'failover', 'security', 'other']
We'll adjust the collection functions accordingly.
Now, let's code the collection functions.
We'll also allow the user to skip a category by not entering any item.
We'll write:
def collect_dependencies():
items = []
print("\n=== Dependencies ===")
while True:
name = input("\nDependency name (or press Enter to finish): ")
if not name:
break
# Type
while True:
dep_type = input("Type (internal/external): ").lower()
if dep_type in ['internal', 'external']:
break
print("Invalid type. Please choose 'internal' or 'external'.")
description = input("Description: ")
owner = input("Owner/Contact: ")
sla = input("SLA/Uptime: ")
items.append({
'name': name,
'type': dep_type,
'description': description,
'owner': owner,
'sla': sla
})
return items
Similarly for runbooks and tests.
For runbooks:
def collect_runbooks():
items = []
print("\n=== Runbooks ===")
while True:
title = input("\nScenario title (or press Enter to finish): ")
if not title:
break
while True:
scenario_type = input("Type (common operation/failure scenario): ").lower()
if scenario_type in ['common operation', 'failure scenario']:
break
print("Invalid type. Please choose 'common operation' or 'failure scenario'.")
summary = input("Summary/Steps: ")
link = input("Link to detailed runbook (optional): ")
items.append({
'title': title,
'type': scenario_type,
'summary': summary,
'link': link
})
return items
For alerts:
def collect_alerts():
items = []
print("\n=== Alerts ===")
while True:
metric = input("\nMetric name (or press Enter to finish): ")
if not metric:
break
threshold = input("Threshold: ")
channel = input("Notification channel: ")
escalation = input("Escalation policy (optional): ")
items.append({
'metric': metric,
'threshold': threshold,
'channel': channel,
'escalation': escalation
})
return items
For tests:
def collect_tests():
items = []
print("\n=== Test Evidence ===")
while True:
test_type = input("\nTest type (load/failover/security/other) (or press Enter to finish): ")
if not test_type:
break
while test_type not in ['load', 'failover', 'security', 'other']:
print("Invalid type. Please choose from 'load', 'failover', 'security', 'other'.")
test_type = input("Test type (load/failover/security/other): ")
date = input("Date (YYYY-MM-DD): ")
result = input("Result (pass/fail): ")
while result not in ['pass', 'fail']:
print("Invalid result. Please choose 'pass' or 'fail'.")
result = input("Result (pass/fail): ")
link = input("Link to report (optional): ")
items.append({
'type': test_type,
'date': date,
'result': result,
'link': link
})
return items
Now, we collect all.
Then generate markdown.
We'll create a function generate_markdown(data) that returns a string.
Let's code:
def generate_markdown(data):
md = "# Operational Readiness Review Checklist\n\n"
# Dependencies
md += "## Dependencies\n\n"
deps = data['dependencies']
if deps:
# Group by type
grouped = {'internal': [], 'external': []}
for dep in deps:
grouped[dep['type']].append(dep)
for dep_type in ['internal', 'external']:
if grouped[dep_type]:
md += f"### {dep_type.title()}\n\n"
for dep in grouped[dep_type]:
md += f"- [ ] **{dep['name']}**\n"
if dep['description']:
md += f" - Description: {dep['description']}\n"
if dep['owner']:
md += f" - Owner: {dep['owner']}\n"
if dep['sla']:
md += f" - SLA: {dep['sla']}\n"
md += "\n"
else:
md += "No dependencies listed.\n\n"
# Runbooks
md += "## Runbooks\n\n"
runbooks = data['runbooks']
if runbooks:
grouped = {'common operation': [], 'failure scenario': []}
for rb in runbooks:
grouped[rb['type']].append(rb)
for rb_type in ['common operation', 'failure scenario']:
if grouped[rb_type]:
md += f"### {rb_type.title()}\n\n"
for rb in grouped[rb_type]:
md += f"- [ ] **{rb['title']}**\n"
md += f" - Summary: {rb['summary']}\n"
if rb['link']:
md += f" - Link: {rb['link']}\n"
md += "\n"
else:
md += "No runbooks listed.\n\n"
# Alerts
md += "## Alerts\n\n"
alerts = data['alerts']
if alerts:
for alert in alerts:
md += f"- [ ] **{alert['metric']}**\n"
md += f" - Threshold: {alert['threshold']}\n"
md += f" - Channel: {alert['channel']}\n"
if alert['escalation']:
md += f" - Escalation: {alert['escalation']}\n"
md += "\n"
else:
md += "No alerts configured.\n\n"
# Test Evidence
md += "## Test Evidence\n\n"
tests = data['tests']
if tests:
grouped = {'load': [], 'failover': [], 'security': [], 'other': []}
for test in tests:
grouped[test['type']].append(test)
for test_type in ['load', 'failover', 'security', 'other']:
if grouped[test_type]:
md += f"### {test_type.title()} Tests\n\n"
for test in grouped[test_type]:
md += f"- [ ] **{test['date']}** - {test['result'].upper()}\n"
if test['link']:
md += f" - Report: {test['link']}\n"
md += "\n"
else:
md += "No test evidence provided.\n\n"
return md
Then we write the main function:
def main():
data = {
'dependencies': collect_dependencies(),
'runbooks': collect_runbooks(),
'alerts': collect_alerts(),
'tests': collect_tests()
}
md = generate_markdown(data)
filename = "operational_readiness_checklist.md"
with open(filename, 'w') as f:
f.write(md)
print(f"\nChecklist generated and saved to {filename}")
Let's code accordingly.
However, note: the user might not want to answer all categories? We are calling all collect functions. They can just skip by pressing Enter at the first question.
But we are asking for each category. We can also ask: "Do you want to fill [category]? (y/n)" and then only call the collect function if yes.
Let's adjust the main:
categories = [
('dependencies', collect_dependencies),
('runbooks', collect_runbooks),
('alerts', collect_alerts),
('tests', collect_tests)
]
data = {}
for cat_name, collect_func in categories:
answer = input(f"\nDo you want to add items for {cat_name}? (y/n): ").lower()
if answer == 'y':
data[cat_name] = collect_func()
else:
data[cat_name] = []
Then generate.
But note: the collect functions already print headers. We can leave it.
Alternatively, we can move the header printing into the main? But let's keep it in the collect functions.
We'll go with the above.
Let's code accordingly.
However, note: the collect functions are defined to always print the header. If the user says no, we don't call the function, so no header.
But if they say yes, we call the function and it prints the header.
That's acceptable.
Now, we have a problem: in the collect_dependencies, we print "\n=== Dependencies ===". But if we call it only when the user says yes, that's fine.
Let's code accordingly.
We'll write the script.
But note: the user might want to edit the markdown after generation? We are just generating a static file.
This is a simple CLI tool.
Let's code accordingly.
We'll also consider that the user might want to include the date of the review? But that's not part of the checklist.
We can add a title with the date? We can ask for the system name and review date? But the requirement is for a checklist.
We'll stick to the checklist.
Let's code.
We'll also add a note at the top: "This checklist is generated for [system name] on [date]."? We can ask for system name and date.
But the requirement doesn't specify. We can leave it as is.
Alternatively, we can ask:
system_name = input("Enter the system name: ")
review_date = input("Enter the review date (YYYY-MM-DD): ")
Then in the markdown:
# Operational Readiness Review Checklist
**System**: <system_name>
**Review Date**: <review_date>
Then the rest.
Let's do that.
We'll adjust the main:
system_name = input("Enter the system name: ")
review_date = input("Enter the review date (YYYY-MM-DD): ")
Then in generate_markdown, we take system_name and review_date.
def generate_markdown(data, system_name, review_date):
md = f"# Operational Readiness Review Checklist\n\n"
md += f"**System**: {system_name}\n\n"
md += f"**Review Date**: {review_date}\n\n"
... rest ...
Let's do that.
Now, we have a plan.
Let's code accordingly.
However, note: the review date might be optional? We can make it optional? But let's require it.
We'll code accordingly.
Let's write the full script.
We'll also handle the case where the user doesn't enter a date? We can use today's date? But let's require.
We'll do:
review_date = input("Enter the review date (YYYY-MM-DD, press Enter for today): ")
if not review_date:
from datetime import date
review_date = str(date.today())
But then we are using datetime. Let's do that.
We'll adjust:
import datetime
system_name = input("Enter the system name: ")
review_date = input("Enter the review date (YYYY-MM-DD, press Enter for today): ")
if not review_date:
review_date = str(datetime.date.today())
Now, code.
Let's put it all together.
We'll write the script in one file.
We'll also add a note at the end: "Generated by Operational Readiness Review Checklist Generator"
Let's code.
Note: We are using Python 3.
We'll call the script: readiness_checklist.py
Let's code.
I'll create a comprehensive Operational Readiness Review (ORR) checklist generator that covers the key areas you specified. This will be a structured template system with validation and evidence tracking.
"""
Operational Readiness Review (ORR) Checklist Generator
Generates comprehensive checklists for system/service readiness reviews
"""
import json
import datetime
from typing import Dict, List, Any
from dataclasses import dataclass, asdict
from enum import Enum
class CheckStatus(Enum):
PASS = "PASS"
FAIL = "FAIL"
SKIP = "SKIP"
NOT_APPLICABLE = "N/A"
PARTIAL = "PARTIAL"
class RiskLevel(Enum):
CRITICAL = "Critical"
HIGH = "High"
MEDIUM = "Medium"
LOW = "Low"
@dataclass
class ChecklistItem:
"""Represents a single checklist item"""
id: str
category: str
title: str
description: str
status: CheckStatus
evidence_required: bool
evidence: List[str] # URLs, file paths, ticket numbers
owner: str
notes: str
risk_level: RiskLevel
dependencies: List[str] # IDs of dependencies
class ORRChecklistGenerator:
"""Main generator class"""
def __init__(self, service_name: str, environment: str):
self.service_name = service_name
self.environment = environment
self.checklist: List[ChecklistItem] = []
self.generation_date = datetime.datetime.now()
def add_item(self, item: ChecklistItem):
"""Add a checklist item"""
self.checklist.append(item)
def get_categories(self) -> List[str]:
"""Get all distinct categories"""
return list(set(item.category for item in self.checklist))
def get_items_by_category(self, category: str) -> List[ChecklistItem]:
"""Get all items in a category"""
return [item for item in self.checklist if item.category == category]
def generate_dependency_section(self) -> List[ChecklistItem]:
"""Generate dependency checklist items"""
items = []
# Internal Dependencies
items.append(ChecklistItem(
id="DEP-001",
category="Dependencies",
title="Internal Service Dependencies Documented",
description="All internal service dependencies identified with contact owners and SLAs",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="",
risk_level=RiskLevel.HIGH,
dependencies=[]
))
items.append(ChecklistItem(
id="DEP-002",
category="Dependencies",
title="External Dependencies Identified",
description="Third-party APIs, cloud services, and external dependencies listed with SLA commitments",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="",
risk_level=RiskLevel.HIGH,
dependencies=[]
))
items.append(ChecklistItem(
id="DEP-003",
category="Dependencies",
title="Dependency Health Monitoring",
description="Health checks and monitoring configured for all critical dependencies",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="",
risk_level=RiskLevel.HIGH,
dependencies=["DEP-001", "DEP-002"]
))
items.append(ChecklistItem(
id="DEP-004",
category="Dependencies",
title="Dependency Failover Testing",
description="Test evidence of failover procedures for critical dependencies",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="",
risk_level=RiskLevel.CRITICAL,
dependencies=["DEP-003"]
))
return items
def generate_runbook_section(self) -> List[ChecklistItem]:
"""Generate runbook checklist items"""
items = []
# Operational Runbooks
runbook_types = [
("Deployment", "Deployment procedures, rollback steps, version compatibility"),
("Scaling", "Horizontal/vertical scaling procedures, thresholds, impact analysis"),
("Backup/Restore", "Backup schedules, restore procedures, RTO/RPO validation"),
("Data Management", "Data migration, archiving, purging procedures"),
("User Management", "User onboarding/offboarding, access reviews"),
("Configuration Changes", "Change management procedures, validation steps")
]
for i, (rb_type, description) in enumerate(runbook_types, 1):
items.append(ChecklistItem(
id=f"RB-{i:03d}",
category="Runbooks",
title=f"{rb_type} Runbook Available",
description=description,
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes=f"Runbook type: {rb_type}",
risk_level=RiskLevel.MEDIUM,
dependencies=[]
))
# Failure Scenario Runbooks
failure_scenarios = [
("Service Outage", "Complete service failure recovery, incident response"),
("Performance Degradation", "Slow response troubleshooting, cache invalidation"),
("Data Corruption", "Data validation, recovery from backups, corruption detection"),
("Security Incident", "Compromise response, forensic evidence collection"),
("Infrastructure Failure", "Host/network/storage failure procedures"),
("Dependency Failure", "Upstream/downstream service failure handling")
]
for i, (scenario, description) in enumerate(failure_scenarios, 1):
items.append(ChecklistItem(
id=f"RB-FAIL-{i:03d}",
category="Runbooks",
title=f"Failure Scenario: {scenario}",
description=description,
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes=f"Failure scenario: {scenario}",
risk_level=RiskLevel.CRITICAL,
dependencies=[]
))
items.append(ChecklistItem(
id="RB-999",
category="Runbooks",
title="Runbook Validation",
description="All runbooks tested with team members and validated for accuracy",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="Validation signed off by operations team",
risk_level=RiskLevel.HIGH,
dependencies=[f"RB-{i:03d}" for i in range(1, 7)] + [f"RB-FAIL-{i:03d}" for i in range(1, 7)]
))
return items
def generate_alert_section(self) -> List[ChecklistItem]:
"""Generate alerting checklist items"""
items = []
alert_categories = {
"Availability": ["Service down", "High error rate", "Endpoint timeout"],
"Performance": ["High latency", "Throughput drop", "Resource saturation"],
"Capacity": ["Disk full", "Memory leak", "Connection pool exhaustion"],
"Security": ["Authentication failures", "Unauthorized access", "SSL/TLS issues"],
"Business": ["Transaction failure", "Revenue impact", "SLA breach"]
}
alert_id = 1
for category, alert_types in alert_categories.items():
for alert_type in alert_types:
items.append(ChecklistItem(
id=f"ALT-{alert_id:03d}",
category="Alerts",
title=f"{category} Alert: {alert_type}",
description=f"Alert configured for {alert_type} with appropriate thresholds",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes=f"Category: {category}",
risk_level=self._get_risk_for_alert(category, alert_type),
dependencies=[]
))
alert_id += 1
items.append(ChecklistItem(
id="ALT-999",
category="Alerts",
title="Alert Tuning Complete",
description="All alerts tuned to minimize noise, appropriate severity levels assigned",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="Alert noise reduction completed",
risk_level=RiskLevel.HIGH,
dependencies=[f"ALT-{i:03d}" for i in range(1, alert_id)]
))
items.append(ChecklistItem(
id="ALT-998",
category="Alerts",
title="Alert Routing & Escalation",
description="On-call schedules, escalation policies, and notification channels configured",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="PagerDuty/Opsgenie/etc. configured",
risk_level=RiskLevel.CRITICAL,
dependencies=[]
))
return items
def _get_risk_for_alert(self, category: str, alert_type: str) -> RiskLevel:
"""Determine risk level for alert"""
critical_alerts = ["Service down", "Security breach", "SLA breach"]
high_alerts = ["High error rate", "Authentication failures", "Data corruption"]
if alert_type in critical_alerts or category == "Security":
return RiskLevel.CRITICAL
elif alert_type in high_alerts:
return RiskLevel.HIGH
else:
return RiskLevel.MEDIUM
def generate_test_evidence_section(self) -> List[ChecklistItem]:
"""Generate test evidence checklist items"""
items = []
test_types = [
("Load Testing", "Peak load testing, stress testing, capacity validation"),
("Failover Testing", "Active-passive failover, dependency failure simulation"),
("Disaster Recovery", "Full DR drill, RTO/RPO validation, backup restore"),
("Security Testing", "Vulnerability scan, penetration test, compliance check"),
("Chaos Engineering", "Chaos experiments, resilience validation"),
("Performance Baseline", "Baseline metrics established, regression comparison"),
("Compatibility Testing", "Browser, OS, device compatibility matrix"),
("Data Migration", "Migration validation, data integrity checks"),
("Upgrade Testing", "Version upgrade testing, backward compatibility")
]
for i, (test_type, description) in enumerate(test_types, 1):
items.append(ChecklistItem(
id=f"TEST-{i:03d}",
category="Test Evidence",
title=f"{test_type} Completed",
description=description,
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes=f"Test type: {test_type}",
risk_level=self._get_risk_for_test(test_type),
dependencies=[]
))
items.append(ChecklistItem(
id="TEST-999",
category="Test Evidence",
title="Test Coverage Review",
description="All critical paths and failure scenarios covered by test evidence",
status=CheckStatus.NOT_APPLICABLE,
evidence_required=True,
evidence=[],
owner="",
notes="Test matrix reviewed and approved",
risk_level=RiskLevel.HIGH,
dependencies=[f"TEST-{i:03d}" for i in range(1, len(test_types)+1)]
))
return items
def _get_risk_for_test(self, test_type: str) -> RiskLevel:
"""Determine risk level for test"""
critical_tests = ["Disaster Recovery", "Security Testing", "Failover Testing"]
high_tests = ["Load Testing", "Data Migration", "Upgrade Testing"]
if test_type in critical_tests:
return RiskLevel.CRITICAL
elif test_type in high_tests:
return RiskLevel.HIGH
else:
return RiskLevel.MEDIUM
def generate_full_checklist(self) -> 'ORRChecklistGenerator':
"""Generate complete ORR checklist"""
# Clear existing
self.checklist = []
# Add all sections
self.checklist.extend(self.generate_dependency_section())
self.checklist.extend(self.generate_runbook_section())
self.checklist.extend(self.generate_alert_section())
self.checklist.extend(self.generate_test_evidence_section())
return self
def validate_evidence_requirements(self) -> Dict[str, List[str]]:
"""Validate which items require evidence but have none"""
missing_evidence = {}
for item in self.checklist:
if item.evidence_required and not item.evidence:
if item.category not in missing_evidence:
missing_evidence[item.category] = []
missing_evidence[item.category].append(f"{item.id}: {item.title}")
return missing_evidence
def get_status_summary(self) -> Dict[str, Any]:
"""Get summary statistics"""
total = len(self.checklist)
status_counts = {status.value: 0 for status in CheckStatus}
for item in self.checklist:
status_counts[item.status.value] += 1
return {
"service": self.service_name,
"environment": self.environment,
"generated_date": self.generation_date.isoformat(),
"total_items": total,
"status_breakdown": status_counts,
"completion_rate": (status_counts[CheckStatus.PASS.value] / total * 100) if total > 0 else 0,
"critical_items_pending": sum(1 for item in self.checklist
if item.risk_level == RiskLevel.CRITICAL
and item.status != CheckStatus.PASS)
}
def to_markdown(self, include_evidence: bool = True) -> str:
"""Generate markdown report"""
md = f"""# Operational Readiness Review Checklist
**Service:** {self.service_name}
**Environment:** {self.environment}
**Generated:** {self.generation_date.strftime('%Y-%m-%d %H:%M')}
**Reviewer:** ___________________
**Approval:** ___________________
---
## Summary
{json.dumps(self.get_status_summary(), indent=2)}
---
"""
for category in self.get_categories():
md += f"## {category}\n\n"
items = self.get_items_by_category(category)
# Group by risk level
risk_order = [RiskLevel.CRITICAL, RiskLevel.HIGH, RiskLevel.MEDIUM, RiskLevel.LOW]
for risk in risk_order:
risk_items = [item for item in items if item.risk_level == risk]
if risk_items:
md += f"### {risk.value} Risk\n\n"
for item in risk_items:
checkbox = "[x]" if item.status == CheckStatus.PASS else "[ ]"
md += f"- {checkbox} **{item.id}**: {item.title}\n"
md += f" - *Description:* {item.description}\n"
md += f" - *Owner:* {item.owner or 'TBD'}\n"
md += f" - *Status:* {item.status.value}\n"
if item.notes:
md += f" - *Notes:* {item.notes}\n"
if include_evidence and item.evidence_required:
md += f" - *Evidence Required:* {'Yes' if item.evidence_required else 'No'}\n"
if item.evidence:
md += f" - *Evidence Provided:* {', '.join(item.evidence)}\n"
else:
md += f" - *Evidence:* **MISSING** ⚠️\n"
md += "\n"
md += "\n"
# Add validation section
missing = self.validate_evidence_requirements()
if missing:
md += "## ⚠️ Missing Evidence\n\n"
for category, items in missing.items():
md += f"### {category}\n"
for item in items:
md += f"- {item}\n"
md += "\n"
return md
def to_json(self, filename: str = None) -> str:
"""Export to JSON"""
data = {
"metadata": {
"service": self.service_name,
"environment": self.environment,
"generated_date": self.generation_date.isoformat(),
"generator": "ORR Checklist Generator v1.0"
},
"checklist": [asdict(item) for item in self.checklist],
"summary": self.get_status_summary()
}
if filename:
with open(filename, 'w') as f:
json.dump(data, f, indent=2)
return json.dumps(data, indent=2)
def load_from_json(self, json_data: str):
"""Load checklist from JSON"""
data = json.loads(json_data)
self.service_name = data["metadata"]["service"]
self.environment = data["metadata"]["environment"]
self.checklist = [ChecklistItem(**item) for item in data["checklist"]]
return self
def create_sample_checklist() -> ORRChecklistGenerator:
"""Create a sample filled checklist"""
generator = ORRChecklistGenerator("Payment Service", "Production")
generator.generate_full_checklist()
# Sample fill some items
for item in generator.checklist:
if "DEP-001" in item.id:
item.status = CheckStatus.PASS
item.evidence = [" Architecture Diagram", " Dependency Matrix v2.1"]
item.owner = "Platform Team"
item.notes = "All 12 internal dependencies documented"
elif "DEP-002" in item.id:
item.status = CheckStatus.PASS
item.evidence = [" External Service Inventory", " SLA Agreements"]
item.owner = "Vendor Management"
elif "RB-001" in item.id:
item.status = CheckStatus.PASS
item.evidence = ["/runbooks/deployment.md", " Runbook Review sign-off"]
item.owner = "DevOps Team"
elif "ALT-001" in item.id:
item.status = CheckStatus.FAIL
item.evidence = []
item.owner = "SRE Team"
item.notes = "Thresholds too sensitive, need tuning"
elif "TEST-001" in item.id:
item.status = CheckStatus.PASS
item.evidence = [" Load Test Report - 2024-01-15", " Gatling Results"]
item.owner = "QA Team"
return generator
def interactive_orr_review(generator: ORRChecklistGenerator):
"""Interactive CLI for completing ORR checklist"""
print(f"\n=== Operational Readiness Review: {generator.service_name} ===")
print(f"Environment: {generator.environment}")
print(f"Total Items: {len(generator.checklist)}\n")
categories = generator.get_categories()
for category in categories:
print(f"\n{'='*50}")
print(f"CATEGORY: {category.upper()}")
print('='*50)
items = generator.get_items_by_category(category)
for item in items:
print(f"\n[{item.id}] {item.title}")
print(f"Risk: {item.risk_level.value}")
print(f"Description: {item.description}")
if item.evidence_required:
print("⚠️ Evidence Required")
print("\nOptions:")
print(" [P] Mark PASS")
print(" [F] Mark FAIL")
print(" [S] Mark SKIP")
print(" [N] Add Note")
print(" [E] Add Evidence")
print(" [O] Change Owner")
print(" [Q] Quit to main menu")
while True:
choice = input("\nAction? ").upper()
if choice == 'P':
item.status = CheckStatus.PASS
print("✓ Marked as PASS")
break
elif choice == 'F':
item.status = CheckStatus.FAIL
print("✗ Marked as FAIL")
break
elif choice == 'S':
item.status = CheckStatus.SKIP
print("⊘ Marked as SKIP")
break
elif choice == 'N':
note = input("Enter note: ")
item.notes = note
print("Note added")
elif choice == 'E':
evidence = input("Enter evidence (URL, ticket#, file path): ")
item.evidence.append(evidence)
print(f"Evidence added: {evidence}")
elif choice == 'O':
owner = input("Enter owner: ")
item.owner = owner
print(f"Owner set to: {owner}")
elif choice == 'Q':
break
else:
print("Invalid choice")
# Show current status
print(f"Current Status: {item.status.value}")
if item.evidence:
print(f"Evidence: {', '.join(item.evidence)}")
# Show summary
summary = generator.get_status_summary()
print(f"\n{'='*50}")
print("REVIEW SUMMARY")
print('='*50)
print(f"Completion: {summary['completion_rate']:.1f}%")
print(f"Critical Items Pending: {summary['critical_items_pending']}")
print(f"Pass: {summary['status_breakdown'][CheckStatus.PASS.value]}")
print(f"Fail: {summary['status_breakdown'][CheckStatus.FAIL.value]}")
print(f"Skip: {summary['status_breakdown'][CheckStatus.SKIP.value]}")
# Example usage
if __name__ == "__main__":
# Create new checklist
service_name = input("Enter service name: ") or "Example Service"
environment = input("Enter environment (dev/staging/prod): ") or "Production"
generator = ORRChecklistGenerator(service_name, environment)
generator.generate_full_checklist()
# Option to load sample or start fresh
use_sample = input("Load sample data? (y/n): ").lower() == 'y'
if use_sample:
generator = create_sample_checklist()
# Interactive review
interactive_orr_review(generator)
# Generate reports
print("\nGenerating reports...")
# Markdown report
md_report = generator.to_markdown()
md_filename = f"ORR_Checklist_{service_name}_{environment}_{datetime.datetime.now().strftime('%Y%m%d')}.md"
with open(md_filename, 'w') as f:
f.write(md_report)
print(f"✓ Markdown report: {md_filename}")
# JSON export
json_filename = f"ORR_Data_{service_name}_{environment}_{datetime.datetime.now().strftime('%Y%m%d')}.json"
generator.to_json(json_filename)
print(f"✓ JSON data: {json_filename}")
# Show summary
summary = generator.get_status_summary()
print(f"\nFinal Summary:")
print(f" Completion: {summary['completion_rate']:.1f}%")
print(f" Critical items needing attention: {summary['critical_items_pending']}")
if summary['critical_items_pending'] > 0:
print("\n⚠️ CRITICAL ITEMS REQUIRE IMMEDIATE ATTENTION!")
This comprehensive ORR checklist generator provides:
Key Features:
1. Dependencies Section
- Internal vs external dependency tracking
- SLA documentation
- Dependency health monitoring
- Failover test evidence
- Owner/contact information
2. Runbooks Section
- Operational runbooks: Deployment, scaling, backup/restore, configuration changes
- Failure scenarios: Service outage, performance degradation, data corruption, security incidents
- Validation and sign-off requirements
3. Alerts Section
- 15+ critical alert categories:
- Availability (service down, high error rate)
- Performance (latency, throughput)
- Capacity (disk, memory, connections)
- Security (auth failures, unauthorized access)
- Business (transaction failure, SLA breach)
- Alert tuning and noise reduction
- Routing and escalation policies
4. Test Evidence Section
- 9 test types with evidence requirements:
- Load/stress testing
- Failover/DR testing
- Security testing
- Chaos engineering
- Performance baselines
- Data migration validation
- Test coverage review
Output Formats:
-
Markdown Report - Human-readable checklist with:
- Risk-based grouping (Critical → Low)
- Evidence tracking
- Status indicators
- Missing evidence warnings
-
JSON Export - Machine-readable format with:
- Complete metadata
- All checklist items with status
- Summary statistics
- Import/export capability
Usage Examples:
# Quick start
generator = ORRChecklistGenerator("MyService", "Production")
generator.generate_full_checklist()
# Load existing review
with open('previous_review.json') as f:
generator.load_from_json(f.read())
# Interactive review session
interactive_orr_review(generator)
# Generate reports
markdown = generator.to_markdown()
generator.to_json('current_review.json')
# Check what's missing
missing = generator.validate_evidence_requirements()
if missing:
print(f"Missing evidence in: {list(missing.keys())}")
Validation Features:
- Evidence requirement tracking
- Risk-level prioritization
- Dependency mapping between checklist items
- Completion percentage calculation
- Critical item flagging
Customization Points:
- Add custom categories: Modify
generate_*_section() methods
- Adjust risk levels: Modify
_get_risk_for_*() methods
- Custom evidence types: Modify
evidence_required field logic
- Add automation: Integrate with ticketing systems (Jira, ServiceNow)
- Add compliance mapping: Map to SOC2, ISO27001, HIPAA requirements
Integration Opportunities:
- CI/CD pipeline validation
- Ticketing system integration (auto-create JIRA tickets for fails)
- Monitoring system integration (auto-verify alert existence)
- Documentation systems (Confluence, Wiki)
- Compliance frameworks mapping
The generator creates production-ready checklists that can be:
- Used in gate reviews
- Tracked over time (via JSON)
- Shared with stakeholders (via Markdown)
- Integrated into deployment pipelines
- Used for audit evidence
Would you like me to add specific features like:
- Jira/ServiceNow ticket integration?
- Automated evidence collection from monitoring systems?
- Compliance framework mapping (SOC2, HIPAA, etc.)?
- Multi-service aggregation?
- Historical trend tracking?