Delegate independent tasks to specialized agents working concurrently with isolated context.
Docs Director Skill
docs-director-skill
Handles multi-document operations with pattern matching and parallel execution, delegating to docs-manager-skill for each matched document
SKILL.md
Full skill instructions
docs-director-skill
<CONTEXT> **Purpose**: Handle multi-document operations with pattern matching and parallel execution.Architecture: Director skill (Layer 2) - routes to docs-manager-skill for each matched document.
Scope: Pattern matching, batch operations, parallel execution with file locking. </CONTEXT>
<CRITICAL_RULES>
-
Pattern Matching
- ALWAYS expand wildcards (docs/api/**/README.md)
- ALWAYS handle glob patterns correctly
- NEVER process more than 50 documents without user confirmation
-
Parallel Execution
- ALWAYS execute independent operations in parallel (max 10 concurrent)
- ALWAYS use file locking (flock) to prevent conflicts
- NEVER run index updates in parallel for same directory
-
Delegation
- ALWAYS delegate single-doc operations to docs-manager-skill
- NEVER implement document operations directly
- ALWAYS collect and aggregate results
-
Safety
- ALWAYS show preview of matched files before executing
- ALWAYS require confirmation for destructive operations
- ALWAYS handle partial failures gracefully
-
Progress Reporting
- ALWAYS show progress for batch operations
- ALWAYS report success/failure counts
- ALWAYS list failed items with errors </CRITICAL_RULES>
For write-batch:
doc_type- Document typedocuments- Array of {file_path, context} objectsskip_validation- Skip validation (default: false)skip_index- Skip index updates (default: false)parallel- Execute in parallel (default: true)max_concurrent- Max parallel operations (default: 10)
For validate-batch:
doc_type- Document type (optional, can auto-detect)
For audit:
doc_types- Filter by doc types (optional)status- Filter by status (optional)
For list:
doc_type- Filter by type (optional)status- Filter by status (optional)format- Output format: "table", "json", "markdown" (default: "table") </INPUTS>
-
Validate Input
- Check documents array is not empty
- Verify all file_paths are unique
- Confirm if > 10 documents
-
Expand Patterns
- If pattern contains wildcards, expand to file list
- Filter by doc_type if specified
-
Preview
- Show list of files to be written
- Count: total documents
- Wait for user confirmation (if > 10 docs)
-
Execute in Parallel
for doc in documents; do # Run docs-manager-skill in background with flock ( flock -x "$file_path.lock" \ coordinate-write.sh "$file_path" "$doc_type" "$context" ) & # Limit concurrent jobs if (( $(jobs -r | wc -l) >= $max_concurrent )); then wait -n fi done wait # Wait for all jobs to complete -
Collect Results
- Aggregate success/failure counts
- List failed documents with errors
- Update indices (one per directory, sequential)
-
Return Summary
{ "status": "partial_success", "operation": "write-batch", "total": 25, "succeeded": 23, "failed": 2, "failures": [ {"file": "docs/api/foo.md", "error": "Validation failed"}, {"file": "docs/api/bar.md", "error": "Template not found"} ], "indices_updated": ["docs/api/README.md"] }
Operation: validate-batch
-
Expand Pattern
- Find all matching files
- Auto-detect doc_type if not provided
-
Execute Validation
- Run in parallel (validation is read-only, safe)
- Collect results
-
Aggregate Results
- Count errors, warnings
- Group by error type
- Return detailed report
Operation: audit
-
Scan Directories
- Find all doc directories (containing fractary_doc_type docs)
- Classify documents by type
-
Collect Metadata
- Count by type
- Count by status
- Identify missing indices
- Identify validation issues
-
Generate Report
# Documentation Audit Report ## Summary - Total Documents: 156 - Document Types: 8 - Missing Indices: 2 - Validation Issues: 5 ## By Type | Type | Count | Status Distribution | |---------------|-------|----------------------------| | api | 45 | draft: 12, published: 33 | | adr | 32 | accepted: 28, superseded: 4| | guide | 28 | published: 28 | ## Issues - docs/api/deprecated/: Missing index - docs/dataset/metrics.md: Missing fractary_doc_type field
Operation: list
-
Invoke doc-lister Skill
- Pass pattern and filters
- Get structured document list
-
Format Output
- Table, JSON, or Markdown
- Apply sorting
-
Return Results </WORKFLOW>
<COMPLETION_CRITERIA>
- All matched documents processed
- Results aggregated correctly
- Indices updated (batch write operations)
- Progress reported throughout
- Final summary returned </COMPLETION_CRITERIA>
Batch Write Partial:
{
"status": "partial_success",
"operation": "write-batch",
"total": 25,
"succeeded": 23,
"failed": 2,
"failures": [
{"file": "docs/api/foo.md", "error": "Validation failed: missing endpoint"},
{"file": "docs/api/bar.md", "error": "Template rendering error"}
],
"indices_updated": ["docs/api/README.md"]
}
Audit Report:
{
"status": "success",
"operation": "audit",
"summary": {
"total_documents": 156,
"doc_types": 8,
"missing_indices": 2,
"validation_issues": 5
},
"by_type": { ... },
"issues": [ ... ]
}
</OUTPUTS>
<DOCUMENTATION> Output structured messages:Start (Batch Operation):
🎯 STARTING: docs-director-skill
Operation: write-batch
Pattern: docs/api/**/*.md
Total matches: 25 documents
───────────────────────────────────────
Preview:
📋 Preview of documents to process:
1. docs/api/auth/login/README.md (api)
2. docs/api/auth/logout/README.md (api)
3. docs/api/users/create/README.md (api)
... (22 more)
Proceed with batch write? [y/N]
During Execution:
Processing batch (25 documents, max 10 parallel)...
[1/25] ✅ docs/api/auth/login/README.md
[2/25] ✅ docs/api/auth/logout/README.md
[3/25] ❌ docs/api/users/create/README.md (validation failed)
[4/25] ✅ docs/api/users/update/README.md
...
Progress: 15/25 (60%) | Success: 14 | Failed: 1
Indexing Phase:
Updating indices (sequential)...
✅ docs/api/README.md (23 documents)
✅ docs/guides/README.md (2 documents)
Completion:
✅ COMPLETED: docs-director-skill
Operation: write-batch
Results:
Total: 25
Succeeded: 23
Failed: 2
Indices Updated: 2
Failed documents:
❌ docs/api/users/create/README.md
Error: Validation failed - missing required field 'endpoint'
❌ docs/api/admin/delete/README.md
Error: Template rendering failed - invalid JSON
───────────────────────────────────────
Next: Review failed documents and retry
</DOCUMENTATION>
<ERROR_HANDLING> Pattern Match Failures:
- No files matched pattern → warn user, suggest pattern fixes
- Too many files (>50) → require explicit confirmation
Partial Failures:
- Some documents fail → continue with others
- Collect all failures → report at end
- Update indices for successful documents only
Parallel Execution Errors:
- File lock timeout → retry with backoff
- Process killed → report incomplete operation
- Suggest sequential mode for debugging
Resource Limits:
- Too many concurrent jobs → throttle to max_concurrent
- Disk space low → abort operation
- Memory pressure → reduce parallelism
Index Update Conflicts:
- Multiple docs in same directory → batch index update
- Run index updates sequentially (never parallel for same dir)
- Use flock to prevent concurrent index writes </ERROR_HANDLING>
More Other skills
brand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
internal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).
Fundamental design principles for writing maintainable, testable Python code.
responsive-design
Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.
Generate Playwright tests from scenarios using interactive browser exploration and validation.
Automated website exploration and test case generation using Playwright.
Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.
gdpr-data-handling
GDPR-compliant data handling with consent management, data subject rights, and privacy controls.
Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.
refactor-plan
Detailed multi-file refactor planning with safety checks and rollback guidance.
