Add automated documentation updater to any Claude skill. Creates a Python sync script that downloads upstream docs, processes markdown for AI consumption, and maintains local cache with configurable refresh. Collects template variables, then delegates implementation through 5-phase workflow. Use when adding auto-updating reference documentation to plugins or skills.
87
Quality
85%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
<skill_path>$ARGUMENTS</skill_path>
Orchestrate adding automated documentation updater to target Claude skills. Follow the proven pattern from gitlab-skill's sync_gitlab_docs.py.
Purpose: Create a self-maintaining documentation pipeline that downloads upstream docs, processes markdown for AI consumption, transforms links for local navigation, and enforces cooldown periods between updates.
Template: doc-updater-template.md
Process: Collect 6 template variables from the user, substitute into template, delegate implementation through 5-phase workflow with quality gates at each stage.
flowchart TD
Start([Skill invoked with target path]) --> P0[Phase 0: Collect Variables<br>via AskUserQuestion]
P0 --> P1[Phase 1: Implementation<br>delegate to @python-cli-architect]
P1 --> P2[Phase 2: Code Review<br>delegate to @python-code-reviewer]
P2 --> P3[Phase 3: Quality Gates<br>ruff, mypy, pyright, prek]
P3 --> P4[Phase 4: Testing & Validation<br>7-point checklist]
P4 --> P5[Phase 5: Integration<br>SKILL.md, .gitignore, integration test]
P5 --> Complete([Documentation updater ready])
P1 -.->|Failure| Loop1[Return to Phase 1<br>with error context]
P2 -.->|Failure| Loop1
P3 -.->|Failure| Loop1
P4 -.->|Failure| Loop1
P5 -.->|Failure| Loop1
Loop1 -.-> P1<phase_0>
Step 1: Validate target path
Read the path from <skill_path/>:
Step 2: Infer defaults
Extract reasonable defaults to reduce user input:
Step 3: Collect all 6 template variables
Use AskUserQuestion for each variable. Present defaults where available.
<variables_to_collect>
1. SKILL_NAME — Skill identifier
gitlab-skill2. DOC_SOURCE_URL — Documentation archive URL
https://gitlab.com/gitlab-org/cli/-/archive/main/cli-main.tar.gz?path=docs3. DOC_PATH_IN_ARCHIVE — Path to extract from archive
docs or doc/ci4. LOCAL_DOC_DIR — Local directory name for downloaded docs
{target-path}/references/{LOCAL_DOC_DIR}/ci or glab-cli5. DOC_DESCRIPTION — Brief description
GitLab CI/CD pipeline documentation6. COOLDOWN_DAYS — Days between automatic updates
</variables_to_collect>
Step 4: Confirm before proceeding
Display all collected values in structured format. Ask user to confirm before entering Phase 1.
</phase_0>
<phase_1>
Activate Python development workflow
Invoke /python3-development skill to load Python development orchestration standards.
Prepare substituted template
## Full Prompt Template section (between 5-backtick code fence delimiters){VARIABLE} placeholders with collected values:
{SKILL_NAME} → collected SKILL_NAME{DOC_SOURCE_URL} → collected DOC_SOURCE_URL{DOC_PATH_IN_ARCHIVE} → collected DOC_PATH_IN_ARCHIVE{LOCAL_DOC_DIR} → collected LOCAL_DOC_DIR{DOC_DESCRIPTION} → collected DOC_DESCRIPTION{COOLDOWN_DAYS} → collected COOLDOWN_DAYSDelegate to Python CLI architect
Use Agent tool to delegate to @python-cli-architect agent:
{target-path}/scripts/update-{LOCAL_DOC_DIR}-docs.pyWait for implementation completion before proceeding to Phase 2.
</phase_1>
<phase_2>
Delegate to code reviewer
Use Agent tool to delegate to @python-code-reviewer agent:
Critical review points
pathlib.Path, no string concatenation for paths./, ../, absolute pathsOn failure: Loop back to Phase 1 with specific review feedback. Pass reviewer comments to @python-cli-architect along with original template.
</phase_2>
<phase_3>
Execute sequentially. Each step gates the next. All must pass before proceeding to Phase 4.
Step 1: Format
ruff format {script-path}Rationale: Format first to prevent lint errors on whitespace and style issues.
Step 2: Lint
ruff check {script-path}Rationale: Catch code smells, style violations, common bugs after formatting.
Step 3: Type checking
mypy {script-path}
pyright {script-path}Rationale: Validate type annotations and inference after style compliance.
Step 4: Pre-commit hooks
uv run prek run --files {script-path}Rationale: Final validation against all repository standards (YAML, markdown, executables, shebangs).
On failure: Loop back to Phase 1. Pass specific error output to @python-cli-architect along with original template and instruction to fix the identified issue.
</phase_3>
<phase_4>
Execute 7-point validation checklist. All must pass.
1. Initial execution
uv run {script-path} --working-dir {target-path}Expected: Script completes successfully, exit code 0.
2. File existence verification
ls -la {target-path}/references/{LOCAL_DOC_DIR}/Expected: Downloaded markdown files present in target directory.
3. Hugo shortcode removal
grep -r "{{< details" {target-path}/references/{LOCAL_DOC_DIR}/ | wc -lExpected: 0 matches. All Hugo-specific syntax removed.
4. Link transformation sampling
Read 3-5 random markdown files from downloaded docs. Verify:
./ relative paths5. SKILL.md integration
Verify Documentation Index section created or updated in target SKILL.md with correct file references.
6. Cooldown enforcement
uv run {script-path} --working-dir {target-path}Expected: Script exits with code 0 and message indicating update blocked by cooldown.
7. Force flag bypass
uv run {script-path} --working-dir {target-path} --forceExpected: Script re-downloads and processes documentation despite cooldown.
On failure: Loop back to Phase 1 with specific failure details. Include: which validation step failed, observed behavior, expected behavior.
</phase_4>
<phase_5>
5a. Update target SKILL.md
Add or update ## Execution Protocol section in target skill's SKILL.md:
## Execution Protocol
1. Update documentation (enforces {COOLDOWN_DAYS}-day cooldown):
```bash
uv run scripts/update-{LOCAL_DOC_DIR}-docs.py --working-dir .Use --force flag to bypass cooldown and force immediate update.
Position documentation update as first step in execution protocol. Include cooldown information and force flag usage.
**5b. Update .gitignore**
Add entries for lock files and downloaded documentation:
```text
# {SKILL_NAME} documentation sync
*/.update-{LOCAL_DOC_DIR}-docs.lock
{target-path}/references/{LOCAL_DOC_DIR}/Ensure paths are relative to repository root. Add section header comment for clarity.
5c. Integration test
Use Agent tool to spawn general-purpose agent with minimal WHAT-only prompt:
Use the {SKILL_NAME} skill to [accomplish task requiring documentation access].Do NOT tell the agent:
Verify agent:
On failure: Loop back to Phase 1 if integration test reveals missing execution protocol steps, incorrect documentation paths, or inaccessible references.
</phase_5>
<error_handling>
Phase 0 failures (invalid path, missing variables):
Phase 1-5 failures (implementation, review, quality, testing, integration):
@python-cli-architect agent:
Maximum iterations:
</error_handling>
Documentation updater integration complete when:
Report completion with summary of created/modified files and next steps for user.
fd243f9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.