generate_design_notes_preview
Generate Jupyter notebook previews with 7 standardized sections for compliance rule design notes, enabling review of evidence details and schemas before creation.
Instructions
Generate design notes preview for user confirmation before actual creation.
DESIGN NOTES PREVIEW GENERATION
This tool generates a complete Jupyter notebook structure as a dictionary for user review. The MCP will create the full notebook content with 7 standardized sections based on rule context and metadata, then return it for user confirmation.
DESIGN NOTES TEMPLATE STRUCTURE REQUIREMENTS
The MCP should generate a Jupyter notebook (.ipynb format) with exactly 7 sections:
SECTION 1: Evidence Details
DESCRIPTION: System identification and rule purpose documentation
CONTENT REQUIREMENTS:
Table with columns: System | Source of data | Frameworks | Purpose
System: {TARGET_SYSTEM_NAME} (all lowercase")
Source: Always 'compliancecow'
Frameworks: Always '-'
Purpose: Use rule's purpose from metadata
RecommendedEvidenceName: {RULE_OUTPUT_NAME} (use rule's primary compliance output, exclude LogFile)
Description: Use rule description from metadata
Reference: Include actual API documentation links that the rule uses (extract from task specifications, no placeholder values)
FORMAT: Markdown cell with table and code blocks only
SECTION 2: Define the System Specific Data (Extended Data Schema)
DESCRIPTION: System-specific raw data structure definition with detailed breakdown
CONTENT REQUIREMENTS:
Step 2a: Inputs
Generate numbered list from rule's spec.inputs
Format: "{NUMBER}. {INPUT_NAME}({INPUT_DATA_TYPE}) - {INPUT_DESCRIPTION}"
Include all inputs with their types and purposes
Step 2b: API & Flow
Generate numbered list of API endpoints based on target system
Format: "{NUMBER}. {HTTP_METHOD} {URL} - {BRIEF_DESCRIPTION}"
Include only actual API endpoints that this specific rule uses for data collection
Extract from task specifications, not generic templates
Step 2c: Define the Extended Schema
Generate large JSON code block with actual API response structure
Use system-specific field names and realistic data values
Include all fields that will be processed by the rule
FORMAT: Markdown headers with detailed lists + large JSON code block
SECTION 3: Define the Standard Schema
DESCRIPTION: Standardized compliance data format documentation
CONTENT REQUIREMENTS:
Header explaining standard schema purpose
JSON code block with complete standardized structure containing:
System: based on target system (lowercase)
Source: Always 'compliancecow'
Resource info: ResourceID, ResourceName, ResourceType, ResourceLocation, ResourceTags, ResourceURL
System-specific data fields based on actual rule output columns, if unavailable then generate based on rule details
Compliance fields: ValidationStatusCode, ValidationStatusNotes, ComplianceStatus, ComplianceStatusReason
Evaluation and action fields: EvaluatedTime, UserAction, ActionStatus, ActionResponseURL (UserAction, ActionStatus, ActionResponseURL are empty by default)
Step 3a: Sample Data
Generate markdown table with ALL standard schema columns in same order - include all columns even if empty
Include three complete example rows with realistic, system-specific data
Use proper data formatting and realistic identifiers
FORMAT: JSON code block + comprehensive markdown table
SECTION 4: Describe the Compliance Taxonomy
DESCRIPTION: Status codes and compliance definitions
CONTENT REQUIREMENTS:
Table with columns: ValidationStatusCode | ValidationStatusNotes | ComplianceStatus | ComplianceStatusReason
ValidationStatusCode: CRITICAL FORMAT REQUIREMENT - Rule-specific codes must strictly follow this exact format:
Each word must be exactly 3-4 characters long
Words must be separated by underscores (_)
Use ALL UPPERCASE letters
Create codes that directly relate to the rule's compliance purpose
Examples: CODE_OWN_HAS_PR_REV (code ownership has pull request review), REPO_SEC_SCAN_PASS (repository security scan passed), AUTH_MFA_ENBL (authentication multi-factor enabled)
DO NOT use generic codes like "PASS" or "FAIL"
DO NOT exceed 4 characters per word
DO NOT use special characters other than underscores
Generate 4-6 different status codes covering various compliance scenarios
Detailed compliance reasons specific to the rule's purpose
Both COMPLIANT and NON_COMPLIANT scenarios
FORMAT: Markdown cell with table
SECTION 5: Calculation for Compliance Percentage and Status
DESCRIPTION: Percentage calculations and status logic
CONTENT REQUIREMENTS:
Header explaining compliance calculation methodology
Code cell with calculation logic:
TotalCount = Count of 'COMPLIANT' and 'NON_COMPLIANT' records
CompliantCount = Count of 'COMPLIANT' records
CompliancePCT = (CompliantCount / TotalCount) * 100
Status determination rules:
COMPLIANT: 100%
NON_COMPLIANT: 0% to less than 100%
NOT_DETERMINED: If no records are found
FORMAT: Markdown header cell + Code cell with calculation logic
SECTION 6: Describe (in words) the Remediation Steps for Non-Compliance
DESCRIPTION: Non-compliance remediation procedures
CONTENT REQUIREMENTS:
Can be "N/A" if no specific remediation steps apply
When applicable, provide:
Immediate Actions required
Short-term remediation steps
Long-term monitoring approaches
Responsible parties and timeframes
System-agnostic guidance that can be customized
FORMAT: Markdown cell with detailed remediation procedures
SECTION 7: Control Setup Details
DESCRIPTION: Rule configuration and implementation details
CONTENT REQUIREMENTS:
Table with two columns: Control Details | (Values)
Required fields (only these):
RuleName: Use actual rule name
PreRequisiteRuleNames: Default to 'N/A' or list dependencies
ExtendedSchemaRuleNames: Default to 'N/A' or list related rules
ApplicationClassName: Fetch all appType values from spec.tasks array, combine them, remove duplicates, and format as comma-separated values
PostSynthesizerName: Default to 'N/A' or specify if used
FORMAT: Markdown table with control configuration details
JUPYTER NOTEBOOK METADATA REQUIREMENTS
Include proper notebook metadata (colab, kernelspec, language_info)
Set nbformat: 4, nbformat_minor: 0
Use appropriate cell metadata with unique IDs for each section
Ensure proper markdown and code cell formatting
MCP CONTENT POPULATION INSTRUCTIONS
The MCP should extract the following information from the rule context:
Rule name, purpose, description from rule metadata
System name from appType (clean by removing connector suffixes like "-connector")
Task details from spec.tasks array
Input specifications from spec.inputs and spec.inputsMeta__
Output specifications from spec.outputsMeta__
Application connector information for control setup
API endpoints from task specifications (not generic placeholders)
CONTENT GENERATION GUIDELINES
Use realistic, system-specific examples that can be customized later
Include comments in code sections indicating customization points
Provide system-agnostic content that applies broadly
Use consistent naming conventions throughout all sections
Extract actual API documentation links from task specifications
Generate ValidationStatusCodes that are specific to the rule's compliance purpose
Ensure all sample data reflects the actual system being monitored
WORKFLOW
MCP retrieves rule context from stored rule information
MCP generates complete Jupyter notebook using template structure above
MCP populates template with extracted rule metadata and calculated values
MCP returns complete notebook structure as dictionary for user review
User reviews and confirms the structure
If approved, call create_design_notes() to actually save the notebook
ARGS
rule_name: Name of the rule for which to generate design notes preview
RETURNS
Dict containing complete notebook structure for user review and confirmation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||