jeremylongshore/tons-of-skills-marketplace / plugins/devops/network-policy-manager/skills/managing-network-policies
managing-network-policies
VerifiedExecute use when managing Kubernetes network policies and firewall rules. Trigger with phrases like "create network policy", "configure firewall rules", "restrict pod communication", or "setup ingress/egress rules". Generates Kubernetes NetworkPolicy manifests following least privilege and zero-trust principles.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.5 KB |
| assets/README.md | markdown | 310 B |
| assets/network_policy_template.yaml | config | 2.2 KB |
| references/README.md | markdown | 65 B |
| scripts/README.md | markdown | 547 B |
| scripts/generate_network_policy.pyexecutable | script | 3.6 KB |
scripts/generate_network_policy.py
View on GitHub#!/usr/bin/env python3
"""
network-policy-manager - Generator Script
Generates Kubernetes network policy YAML based on user input and best practices.
Generated: 2025-12-10 03:48:17
"""
import json
import argparse
from pathlib import Path
from datetime import datetime
from typing import Dict
class Generator:
def __init__(self, config: Dict):
self.config = config
self.output_dir = Path(config.get("output", "./output"))
self.output_dir.mkdir(parents=True, exist_ok=True)
def generate_markdown(self, title: str, content: str) -> Path:
"""Generate markdown document."""
filename = f"{title.lower().replace(' ', '_')}_{datetime.now().strftime('%Y%m%d_%H%M%S')}.md"
file_path = self.output_dir / filename
md_content = f"""# {title}
Generated by network-policy-manager
Date: {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}
## Overview
{content}
## Configuration
```json
{json.dumps(self.config, indent=2)}
```
## Category
devops
## Plugin
network-policy-manager
"""
file_path.write_text(md_content)
return file_path
def generate_json(self, data: Dict) -> Path:
"""Generate JSON output."""
filename = f"output_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
file_path = self.output_dir / filename
output_data = {
"generated_by": "network-policy-manager",
"timestamp": datetime.now().isoformat(),
"category": "devops",
"plugin": "network-policy-manager",
"data": data,
"config": self.config,
}
with open(file_path, "w") as f:
json.dump(output_data, f, indent=2)
return file_path
def generate_script(self, name: str, template: str) -> Path:
"""Generate executable script."""
filename = f"{name}.sh"
file_path = self.output_dir / filename
script_content = f"""#!/bin/bash
# Generated by network-policy-manager
# Date: {datetime.now().strftime("%Y-%m-%d %H:%M:%S")}
set -e # Exit on error
echo "🚀 Running {name}..."
# Template content
{template}
echo "✅ Completed successfully"
"""
file_path.write_text(script_content)
file_path.chmod(0o755) # Make executable
return file_path
def main():
parser = argparse.ArgumentParser(
description="Generates Kubernetes network policy YAML based on user input and best practices."
)
parser.add_argument("--type", choices=["markdown", "json", "script"], default="markdown")
parser.add_argument("--output", "-o", default="./output", help="Output directory")
parser.add_argument("--config", "-c", help="Configuration file")
parser.add_argument("--title", default="network-policy-manager Output")
parser.add_argument("--content", help="Content to include")
args = parser.parse_args()
config = {"output": args.output}
if args.config and Path(args.config).exists():
with open(args.config) as f:
config.update(json.load(f))
generator = Generator(config)
print(f"🔧 Generating {args.type} output...")
if args.type == "markdown":
output_file = generator.generate_markdown(args.title, args.content or "Generated content")
elif args.type == "json":
output_file = generator.generate_json({"title": args.title, "content": args.content})
else: # script
output_file = generator.generate_script(
args.title.lower().replace(" ", "_"), args.content or "# Add your script content here"
)
print(f"✅ Generated: {output_file}")
return 0
if __name__ == "__main__":
import sys
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |