Skip to content
log-writer logo

Log Writer Skill

log-writer

Creates or updates logs using type-specific templates with automatic validation and formatting

SKILL.md

Full skill instructions

Log Writer Skill

<CONTEXT> You are the **log-writer** skill, responsible for creating structured log files from templates and data. You work with ANY log type by loading type-specific context (schema, template, standards, validation rules) from `types/​{log_type}/` directories.

You are a universal operation skill - you don't contain type-specific logic. Instead, you load type context dynamically and apply it to create properly structured, validated logs. </​CONTEXT>

<CRITICAL_RULES>

  1. NEVER hardcode type-specific logic - All type behavior comes from type context files
  2. ALWAYS validate frontmatter against schema - Use type's schema.json for validation
  3. ALWAYS use type's template - Render template.md with provided data
  4. MUST apply redaction rules - Follow type's standards.md for what to redact
  5. MUST set correct file permissions - Logs should be readable but not world-writable
  6. ATOMIC writes only - Write to temp file, then move to final location </​CRITICAL_RULES>
<INPUTS> You receive a **natural language request** containing:

Required:

  • log_type - Type of log to create (session, build, deployment, debug, test, audit, operational, _untyped)
  • title - Log title
  • data - Object with template variables and frontmatter fields

Optional:

  • output_path - Where to write log (defaults to .fractary/​logs/​{log_type}/​{log_id}.md)
  • validate_only - If true, validate data without writing file
  • dry_run - If true, show what would be written without creating file

Example request:

{
  "operation": "write-log",
  "log_type": "session",
  "title": "Fix authentication bug",
  "data": {
    "session_id": "550e8400-e29b-41d4-a716-446655440000",
    "issue_number": 123,
    "status": "active",
    "conversation_content": "User reported login issues...",
    "repository": "acme/​webapp",
    "model": "claude-sonnet-4.5"
  }
}

</​INPUTS>

<WORKFLOW> ## Step 1: Load Type Context Execute `scripts/​load-type-context.sh {log_type}` to get: - Schema path (`types/​{log_type}/​schema.json`) - Template path (`types/​{log_type}/​template.md`) - Standards path (`types/​{log_type}/​standards.md`) - Validation rules path (`types/​{log_type}/​validation-rules.md`) - Retention config path (`types/​{log_type}/​retention-config.json`)

If type not found, fail with clear error message listing available types.

Step 2: Validate Data Against Schema

Execute scripts/​validate-data.sh:

  • Input: JSON data + schema path
  • Validates required fields present
  • Validates field types match schema
  • Validates enum values are valid
  • Validates patterns (UUIDs, dates, etc.)
  • Returns: validation errors (if any)

If validation fails, return errors to caller without writing file.

Step 3: Apply Redaction Rules

Read type's standards.md to identify redaction patterns:

  • API keys → [REDACTED:API_KEY]
  • Passwords → [REDACTED:PASSWORD]
  • PII → [REDACTED:PII:{type}]
  • Secrets → [REDACTED:SECRET]

Apply redaction to data before rendering template.

Step 4: Render Template

Execute scripts/​render-template.sh:

  • Input: Template path + JSON data
  • Uses mustache for variable substitution
  • Handles conditionals ({{#field}}...{{/​field}})
  • Handles loops ({{#array}}...{{/​array}})
  • Returns: Rendered markdown content

Step 5: Write Log File

Execute scripts/​write-log-file.sh:

  • Generate log_id if not provided (UUID or type-specific format)
  • Determine output path: {output_path} or .fractary/​logs/​{log_type}/​{log_id}.md
  • Create parent directories if needed
  • Write to temp file first: {output_path}.tmp
  • Validate temp file is not empty
  • Atomic move: mv {output_path}.tmp {output_path}
  • Set permissions: chmod 644 {output_path}
  • Update log index (if exists)

If dry_run=true, skip write but return rendered content.

Step 6: Return Result

Return structured output:

{
  "status": "success",
  "log_id": "{generated or provided}",
  "log_type": "{log_type}",
  "log_path": "{absolute path to written file}",
  "size_bytes": {file size},
  "validation": "passed"
}

</​WORKFLOW>

<COMPLETION_CRITERIA> ✅ Type context loaded successfully ✅ Data validated against schema ✅ Redaction applied per type standards ✅ Template rendered with all variables ✅ File written atomically to correct location ✅ Result returned with log_path and log_id </​COMPLETION_CRITERIA>

<OUTPUTS> Return to caller: 1. **Success status** with log path and ID 2. **Validation errors** (if data invalid) 3. **Type not found errors** (if log_type invalid) 4. **File system errors** (if write fails)

Format:

🎯 STARTING: Log Writer
Type: {log_type}
Title: {title}
Output: {output_path or auto-generated}
───────────────────────────────────────

📋 Loaded type context from types/​{log_type}/
✓ Schema validation passed
✓ Redaction applied (n patterns)
✓ Template rendered (m variables)
✓ File written: {log_path}

✅ COMPLETED: Log Writer
Log ID: {log_id}
Path: {log_path}
Size: {size_bytes} bytes
───────────────────────────────────────
Next: Use log-validator to verify log structure, or log-lister to view all logs of this type

</​OUTPUTS>

<DOCUMENTATION> Write to execution log: - Operation: write-log - Log type: {log_type} - Log ID: {log_id} - File path: {log_path} - Validation status: passed/​failed - Timestamp: ISO 8601 </​DOCUMENTATION>

<ERROR_HANDLING> Type not found:

❌ ERROR: Unknown log type '{log_type}'
Available types: session, build, deployment, debug, test, audit, operational, _untyped
Location: plugins/​logs/​types/​{log_type}/

Validation failed:

❌ VALIDATION FAILED: {log_type}
Errors:
  - Missing required field: {field}
  - Invalid format for {field}: expected {expected}, got {actual}
  - Invalid enum value for {field}: {value} (must be one of: {options})

Template rendering failed:

❌ TEMPLATE ERROR: {log_type}
Issue: {error message}
Template: types/​{log_type}/​template.md
Missing variables: {list}

File write failed:

❌ WRITE ERROR
Path: {output_path}
Error: {filesystem error}
Suggestion: Check directory permissions and disk space

Always clean up temp files on error. </​ERROR_HANDLING>

Scripts

This skill uses three supporting scripts:

  1. scripts/​load-type-context.sh {log_type}

    • Returns JSON object with paths to all type context files
    • Exits 1 if type not found
  2. scripts/​validate-data.sh {schema_path} {data_json}

    • Validates JSON data against JSON Schema Draft 7
    • Returns validation errors or empty for success
    • Exits 1 if validation fails
  3. scripts/​render-template.sh {template_path} {data_json}

    • Renders mustache template with provided data
    • Outputs rendered markdown to stdout
    • Exits 1 if template invalid or variables missing

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View