Skill: aipoch-ai/sop-writer-aipoch (version 1.0.0)

--- name: sop-writer description: Write GCP-compliant Standard Operating Procedures for labs and clinical sites version: 1.0.0 category: Pharma tags: [] author: AIPOCH license: MIT status: Draft risk_level: Medium skill_type: Tool/Script owner: AIPOCH reviewer: '' last_updated: '2026-02-06' --- # SOP Writer Generate compliant Standard Operating Procedures. ## Use Cases - Sample processing SOPs - Equipment calibration SOPs - Safety procedure documentation - GCP compliance procedures ## Parameters - `procedure_name`: SOP title - `scope`: Applicable areas - `responsibility`: Who performs ## Returns - ISO 15189 compliant SOP - Version control section - Signature page template ## Example Input: Blood sample processing Output: Complete SOP with materials, methods, QC checks ## Risk Assessment | Risk Indicator | Assessment | Level | |----------------|------------|-------| | Code Execution | Python/R scripts executed locally | Medium | | Network Access | No external API calls | Low | | File System Access | Read input files, write output files | Medium | | Instruction Tampering | Standard prompt guidelines | Low | | Data Exposure | Output files saved to workspace | Low | ## Security Checklist - [ ] No hardcoded credentials or API keys - [ ] No unauthorized file system access (../) - [ ] Output does not expose sensitive information - [ ] Prompt injection protections in place - [ ] Input file paths validated (no ../ traversal) - [ ] Output directory restricted to workspace - [ ] Script execution in sandboxed environment - [ ] Error messages sanitized (no stack traces exposed) - [ ] Dependencies audited ## Prerequisites No additional Python packages required. ## Evaluation Criteria ### Success Metrics - [ ] Successfully executes main functionality - [ ] Output meets quality standards - [ ] Handles edge cases gracefully - [ ] Performance is acceptable ### Test Cases 1. **Basic Functionality**: Standard input → Expected output 2. **Edge Case**: Invalid input → Graceful error handling 3. **Performance**: Large dataset → Acceptable processing time ## Lifecycle Status - **Current Stage**: Draft - **Next Review Date**: 2026-03-06 - **Known Issues**: None - **Planned Improvements**: - Performance optimization - Additional feature support

path: scripts/main.py
content: #!/usr/bin/env python3
"""
SOP Writer
Write GCP-compliant Standard Operating Procedures.
"""

import argparse
from datetime import datetime


class SOPWriter:
    """Generate Standard Operating Procedures."""
    
    def generate_sop(self, procedure_name, scope, responsibility, steps):
        """Generate SOP document."""
        
        sop = f"""
STANDARD OPERATING PROCEDURE

Title: {procedure_name}
Document Number: SOP-{datetime.now().strftime('%Y')}-XXX
Version: 1.0
Effective Date: {datetime.now().strftime('%Y-%m-%d')}

1. PURPOSE
This SOP describes the procedure for {procedure_name}.

2. SCOPE
{scope}

3. RESPONSIBILITY
{responsibility}

4. MATERIALS AND EQUIPMENT
[List required materials]

5. PROCEDURE
"""
        
        for i, step in enumerate(steps, 1):
            sop += f"\n5.{i} {step}\n"
        
        sop += f"""
6. QUALITY CONTROL
[Describe QC checks]

7. DOCUMENTATION
[Record keeping requirements]

8. REFERENCES
[List applicable regulations and guidelines]

Approved by: _________________ Date: ___________
"""
        
        return sop


def main():
    parser = argparse.ArgumentParser(description="SOP Writer")
    parser.add_argument("--name", "-n", required=True, help="Procedure name")
    parser.add_argument("--scope", "-s", required=True, help="Scope")
    parser.add_argument("--responsibility", "-r", required=True, help="Who performs")
    parser.add_argument("--output", "-o", default="sop.txt", help="Output file")
    
    args = parser.parse_args()
    
    writer = SOPWriter()
    
    # Demo steps
    steps = [
        "Prepare workspace and materials",
        "Follow detailed procedure steps",
        "Document all actions",
        "Perform quality checks",
        "Archive records"
    ]
    
    sop = writer.generate_sop(args.name, args.scope, args.responsibility, steps)
    
    print(sop)
    
    with open(args.output, 'w') as f:
        f.write(sop)
    print(f"SOP saved to: {args.output}")


if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)