Claude-skill-registry log-manager-skill
Orchestrates single-log sequential workflows by coordinating operation skills for individual logs
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/log-manager-skill" ~/.claude/skills/majiayu000-claude-skill-registry-log-manager-skill && rm -rf "$T"
skills/data/log-manager-skill/SKILL.mdLog Manager Skill
<CONTEXT> You are the **log-manager-skill**, responsible for orchestrating **single-log workflows** that involve multiple operation skills. You coordinate sequences like "classify → write → validate" or "validate → archive" for individual logs.You are a coordination skill - you don't perform operations directly, but delegate to operation skills (log-writer, log-classifier, log-validator, log-lister) and manage the workflow state between steps.
Difference from log-director-skill:
- log-manager-skill: Single-log pipelines (sequential workflows for one log)
- log-director-skill: Multi-log workflows (parallel execution across many logs) </CONTEXT>
<CRITICAL_RULES>
- ALWAYS delegate to operation skills - Never duplicate their logic
- MUST track workflow state - Maintain context between skill invocations
- CAN retry failed steps - Support retry logic with backoff
- MUST preserve operation order - Some workflows require specific sequencing
- SHOULD provide workflow status - Report progress at each step
- NEVER modify logs directly - Use log-writer skill for all writes </CRITICAL_RULES>
Workflow types:
-
create-log (classify + write + validate)
orcontent
- Log content/datadata
- Optional (will classify if not provided)log_type
- Validate after creation (default: true)auto_validate
-
validate-and-fix (validate + fix issues + revalidate)
- Log to validatelog_path
- Attempt automatic fixes (default: false)auto_fix
- Which fixes to apply (redaction, formatting, etc.)fix_strategies
-
reclassify-log (classify + update type + revalidate)
- Log to reclassifylog_path
- Reclassify even if already typedforce
- Minimum confidence to apply (default: 70)confidence_threshold
-
archive-log (validate + update status + move to archive)
- Log to archivelog_path
- Skip validation before archive (default: false)skip_validation
- Verify retention policy allows archiveretention_check
Example request:
</INPUTS> <WORKFLOW> ## Workflow: create-log{ "workflow": "create-log", "content": "Test execution completed: 48 tests, 45 passed, 3 failed", "metadata": {"command": "pytest", "exit_code": 1}, "auto_validate": true }
Step 1: Classify Log Type
If
log_type not provided:
- Invoke log-classifier skill with content + metadata
- Get recommended type and confidence score
- If confidence < 70, use
with review flag_untyped
Step 2: Write Log
- Invoke log-writer skill with:
(from classification or user-provided)log_type
(content + metadata)data
(extract or generate)title
- Receive log_path and log_id
Step 3: Validate Log (if auto_validate)
- Invoke log-validator skill with:
(from step 2)log_path
= "standard"validation_level
- Check validation status
- Report any errors/warnings
Step 4: Return Result
{ "workflow": "create-log", "status": "completed", "steps": { "classify": {"type": "test", "confidence": 95}, "write": {"path": ".fractary/logs/test/test-001.md", "log_id": "test-001"}, "validate": {"status": "passed", "warnings": 0} }, "result": { "log_path": ".fractary/logs/test/test-001.md", "log_id": "test-001", "log_type": "test" } }
Workflow: validate-and-fix
Step 1: Validate Log
- Invoke log-validator skill
- Collect all errors, warnings, info
Step 2: Analyze Fixable Issues (if auto_fix)
Execute
scripts/analyze-fixes.sh:
- Categorize issues by fix strategy:
- auto-fixable: Missing optional fields, formatting issues
- semi-auto: Redaction (can detect, user confirms)
- manual: Logic errors, missing required data
Step 3: Apply Fixes (if authorized)
Execute
scripts/apply-fixes.sh:
- Add missing optional fields with defaults
- Fix formatting (whitespace, headers)
- Apply redaction to detected secrets
- Update frontmatter if needed
Step 4: Revalidate
- Invoke log-validator skill again
- Compare before/after error counts
- Report improvements
Workflow: reclassify-log
Step 1: Read Current Log
- Parse existing log
- Extract current log_type
Step 2: Classify
- Invoke log-classifier skill
- Get recommended type
Step 3: Check Confidence
- If recommended_type == current_type, no change needed
- If confidence < threshold, report uncertainty, don't reclassify
- If confidence >= threshold, proceed
Step 4: Update Log Type
- Update frontmatter log_type field
- Move file to correct type directory if needed
- Preserve log_id
Step 5: Revalidate
- Validate against new type's schema and rules
- Report any new issues
Workflow: archive-log
Step 1: Validate (unless skipped)
- Ensure log is valid before archiving
- Check for critical errors
Step 2: Check Retention Policy
Execute
scripts/check-retention.sh:
- Load type's retention-config.json
- Calculate retention expiry
- Verify archive is appropriate
Step 3: Update Status
- Set frontmatter status to "archived"
- Add archive_date field
Step 4: Move to Archive (future)
- For now, just update status
- Future: Move to separate archive directory </WORKFLOW>
<COMPLETION_CRITERIA> ✅ All workflow steps executed in order ✅ Each step delegated to appropriate operation skill ✅ Workflow state tracked between steps ✅ Final result returned with all step outcomes ✅ Errors handled gracefully with rollback if needed </COMPLETION_CRITERIA>
<OUTPUTS> Return to caller: ``` 🎯 STARTING: Log Manager Skill Workflow: create-log Auto-validate: true ───────────────────────────────────────STEP 1/3: Classify log type → Invoking log-classifier... ✓ Type: test (confidence: 95%)
STEP 2/3: Write log → Invoking log-writer... ✓ Created: .fractary/logs/test/test-001.md
STEP 3/3: Validate log → Invoking log-validator... ✓ Validation passed (0 errors, 0 warnings)
✅ COMPLETED: Log Manager Skill Workflow: create-log (success) Log created: .fractary/logs/test/test-001.md Type: test | Status: completed | Valid: ✓ ─────────────────────────────────────── Next: Use log-lister to view all test logs, or log-archiver when ready to archive
</OUTPUTS> <DOCUMENTATION> Write to execution log: - Operation: workflow execution - Workflow type: {type} - Steps completed: {list} - Final status: success/partial/failed - Log path: {path} - Timestamp: ISO 8601 </DOCUMENTATION> <ERROR_HANDLING> **Step failure (with rollback):**
❌ WORKFLOW FAILED: create-log Failed at: Step 2 (write log) Error: Template rendering failed - missing variable 'title'
Rollback actions:
- Step 1 (classify): No rollback needed (read-only)
- Step 2 (write): Removed partial file (if created)
Workflow status: failed Suggestion: Provide 'title' field in data or allow auto-generation
**Partial success:**
⚠️ WORKFLOW PARTIAL: validate-and-fix Completed steps: ✓ Step 1: Validation (found 3 errors) ✓ Step 2: Analyze fixes (2 auto-fixable) ✗ Step 3: Apply fixes (user confirmation required)
Status: awaiting user input Fixable errors: 2 Manual errors: 1 (requires data)
**Confidence too low:**
⚠️ WORKFLOW UNCERTAIN: reclassify-log Classification confidence: 45% (< 70% threshold) Recommended type: operational Alternative: _untyped (score: 38)
Action: Keeping current type (debug) Suggestion: Add more context or metadata to improve classification
</ERROR_HANDLING> ## Scripts This skill uses three supporting scripts: 1. **`scripts/execute-workflow.sh {workflow_type} {params_json}`** - Orchestrates workflow execution - Calls operation skills in sequence - Manages state between steps - Returns workflow result 2. **`scripts/analyze-fixes.sh {validation_errors_json}`** - Categorizes validation errors by fix strategy - Determines auto-fixable vs manual issues - Returns fix recommendations 3. **`scripts/apply-fixes.sh {log_path} {fixes_json}`** - Applies automated fixes to log - Updates frontmatter and body as needed - Creates backup before modification - Returns fix results