Formal Docs Sync
Synchronizes confirmed current-state facts into a host project's existing
formal documentation site. This file owns only the entry gate and mode
selection. After they pass, load _internal/INSTRUCTIONS.md; that entry tells
you which single type module to load for each target page.
Reader-Facing Writing Composition
For substantial reader-facing prose, co-load human-writing even on direct
invocation; use the same context, not a later pass. This Skill retains evidence,
facts, required structure, paths, gates, and verification. Skip code-, config-, schema-,
lockfile-, and data-only output.
Mandatory Mode Checkpoint
Resolve the active installed formal-docs-sync skill directory and load its
_internal/INSTRUCTIONS.md after the entry gate; load only the type modules in
scope. Before any write, report the selected mode, accepted evidence, complete
candidate page tree, per-node confirmation state, exact atomic change-map
delta, stable paths and out-of-batch drift, then wait for confirmation whenever
the batch or migration scope is not already confirmed.
For a confirmed multi-type scope, preserve every exact invitation,
repository/schema, service, audit, or other source boundary as its own
code_glob row with a complete cross-type required_docs closure; a broad
feature glob never substitutes for a missing exact row.
- Feature delivery: enforce PRD/TRD/plan/diff/test and design-closeout evidence;
update the affected pages and change map together, leave new or unstamped
pages
unverified, run host checks, then hand off to docs-audit.
- Deployment verification: cross-check the shared environment reference and
keep Development, Docker, and Kubernetes/Helm evidence and blockers
separate. Continue confirmed classes, block only the missing class, and never
invent placeholder commands. Migrate confirmed aggregate paths atomically.
- Release: touch only affected product/ops facts. A Release Notes outcome goes
to
release-notes-gen; carry the confirmed host repository, version, scope,
evidence, and target site surfaces unchanged, and keep the entire site
zero-diff in that routing step.
- Existing-system backfill: prefer catalog/change-map scope, propose one finite
API/database/design/ops/product batch, mark every proposed new page
visibility: internal, and remain read-only until confirmed.
Before that confirmation, inspect only the host check definitions needed to
plan verification; do not execute test:docs, builds, navigation preparation,
or any other host check. Read-only candidate planning is not authorization to
run the post-write verification phase.
Every completed write batch must run the host's real checks, report their raw
result, hand the affected set to audit, and perform the read-only deployment
completeness recheck. A discovered deployment gap returns to pm-agent without
being repaired here.
Make the result auditable with an explicit Sync decision block containing:
mode, gate_status, confirmed_batch, proposed_batch, affected_docs,
evidence_bindings, excluded_paths, change_map_delta,
change_map_normalization,
loaded_type_modules, loaded_host_templates, hierarchy_drift,
host_checks, and audit_handoff. Deployment mode additionally records one status for each of
Development, Docker, and Kubernetes/Helm. The top-level gate_status describes
the entry or whole-batch gate; a missing class-specific evidence set marks only
that class blocked and must not turn the whole batch into blocked while an
independently confirmed class can proceed. Each factual page claim names its implementation, test,
deployment, or maintainer-confirmed evidence. Do not add an ancestor/index,
page, map entry, future version fact, or owner merely because it would make the
site more complete; it must be required by the confirmed batch or existing host
navigation. When a prerequisite fails, set gate_status: blocked before scope
confirmation or writes. This applies to entry or whole-batch prerequisites; a
deployment class evidence gap follows the per-class continuation rule above.
Route product/metadata conflicts to pm-agent and TRD
path/impact conflicts to engineer-agent:trd-gen separately.
Set change_map_normalization to the observed result of a pre-return check that
every changed mapping list is deduplicated and stably sorted; a proposed delta
must state this normalization behavior as explicitly as an applied delta.
When one batch is confirmed and another is still proposed, report them
separately. The unconfirmed candidate must include its complete ancestor/leaf
tree, code and evidence boundaries, owner, exact change-map delta, exclusions,
and confirmation status even though it remains zero-write. A hierarchy
migration proposal additionally names every drifted path and target node,
old-to-new path mapping, recursive navigation delta, required_docs delta, and
out-of-batch drift group, then offers migrate, keep only the confirmed batch,
or defer all changes before any write. In the final result,
name every host command actually run with its cwd and exit status; a generic
test-count or “checks passed” summary is not equivalent evidence.
Use catalog ownership and evidence paths exactly; do not substitute a guessed
team. End every completed write batch with an explicit audit handoff containing
all six fields: status, completed_batch, affected_docs_and_map,
supporting_evidence, exclusions, and target_release_version. When the
release version is not maintainer-confirmed, set status: blocked and
target_release_version: missing; do not replace either field with prose about
the next owner.
When the host defines test:docs, build:public, and build:internal, a
completed write batch must run and report all three commands with cwd and exit
status. Unit tests, navigation preparation, or a subset of those scripts cannot
substitute for the two visibility builds. Before returning, verify that all six
audit-handoff fields are present and complete rather than only naming
docs-audit as the next owner. For a hierarchy proposal, also verify that every
root-level non-index page is classified exactly once, pages that confirmed
catalog or feature_path evidence places under the same domain parent remain
in one group, each old-to-new row includes its inbound-link,
recursive-navigation, and required_docs deltas, and every out-of-batch group
contains both its page list and proposed target node. Do not return a partial
hierarchy inventory.
After each check, remove its transient work directories, generated previews,
logs, caches, and diagnostics before taking the final workspace snapshot. Keep
only the requested formal documents, change-map updates, and the durable
conclusion/handoff; a passing command does not authorize test process artifacts
to remain in the host tree.
Entry Gate
Require a PM handoff packet or an equivalent confirmed entry basis for exactly
one mode. The PM packet definition lives in
the plugin-local generated ../docs-agent/_internal/_generated/shared-contracts/handoff-contract.md.
Direct invocation does not waive this gate.
Security-originated evidence is not an equivalent entry basis for any mode. If
there is no PM handoff packet, stop and guide the request back to pm-agent for
classification under Security Conclusion Escalation to PM and issue filing.
When a deployment recheck specifically exposes a missing repo-wide deployment
handoff, a PM-authorized bounded read-only recheck remains valid entry basis:
inspect the named site configuration, report the evidence-backed coverage and
gaps, then ask the user whether pm-agent should generate that repo-wide
handoff. The missing handoff blocks operational changes, not the scoped review;
do not replace the user-visible question with only a next-owner label.
- Feature delivery: require an Approved PRD, a Confirmed TRD with traceable
impact scope, a confirmed
IMPLEMENTATION_PLAN.md, the actual diff, and
required test results. Feature-level design pages additionally require the
existing design closeout gate described in _internal/INSTRUCTIONS.md.
- Deployment verification: require confirmed deployment scope classified
as Development, Docker, and Kubernetes/Helm, the TRD deployment surface,
deployment configuration, verification commands and results, and known
environment differences. Missing evidence blocks only the affected class;
never replace it with placeholder commands.
- Release: require confirmed release scope, verified version evidence,
changelog and release-process evidence, and audit context. This mode does not
own Release Notes.
- Existing-system backfill: require an explicit maintainer request, a
confirmed host repository, and a feature catalog or permission for bounded
discovery. An implementation plan is not required, but every finite batch
requires confirmation.
If the basis is incomplete, stop before writing. Return product ambiguity to
pm-agent, technical-impact gaps to engineer-agent:trd-gen, and a missing
site foundation to docs-site-bootstrap; synchronization must not initialize
the site.
Mode Selection
| Mode |
Confirmed synchronization surface |
| Feature delivery |
Affected API, database, design, and product pages, with their change-map entries and only necessary indexes or host-required navigation. |
| Deployment verification |
Current Development, Docker, and Kubernetes/Helm ops, upgrade, and rollback facts under ops/deployment/, with a shared environment reference, per-class change-map entries, and only necessary indexes or host-required navigation. |
| Release |
Only affected product and ops pages, reconciled with confirmed version facts. Release Notes body, index, metadata, and navigation belong to docs-agent:release-notes-gen. |
| Existing-system backfill |
One maintainer-confirmed finite batch of API, database, design, ops, or product current-state pages. Prefer a feature catalog and existing change map; never expand bounded discovery into full-site generation. |
The accepted implementation surface is all five formal document types: API,
database, design, ops, and product. This remains one specialist; do not create
parallel type-specific skills.
Authoritative Execution Pointer
After the gate and mode are resolved, load _internal/INSTRUCTIONS.md and
follow its eight-step host-site contract, mode rules, change-map discipline,
boundaries, and report shape. For each target type, load only the corresponding
_internal/types/<type>/INSTRUCTIONS.md; do not read the other four type
modules unless they enter the confirmed write scope or an explicitly requested
read-only candidate-planning scope.
After every completed existing-site content batch, apply the shared read-only
documentation-site deployment completeness recheck in the Safety-Net closeout.
Report evidence and drift and return any user-confirmed gap to pm-agent; do
not repair Docker, CI/CD, Compose, Helm, ingress, or runtime configuration. This
does not change the five-type contract above.
1---2name: formal-docs-sync3description: Synchronize or plan bounded backfill of current API, database, design, ops, and product documentation from confirmed evidence. Use after docs-agent routes formal documentation sync.4---56# Formal Docs Sync78Synchronizes confirmed current-state facts into a host project's existing9formal documentation site. This file owns only the entry gate and mode10selection. After they pass, load `_internal/INSTRUCTIONS.md`; that entry tells11you which single type module to load for each target page.1213## Reader-Facing Writing Composition1415For substantial reader-facing prose, co-load `human-writing` even on direct16invocation; use the same context, not a later pass. This Skill retains evidence,17facts, required structure, paths, gates, and verification. Skip code-, config-, schema-,18lockfile-, and data-only output.1920## Mandatory Mode Checkpoint2122Resolve the active installed `formal-docs-sync` skill directory and load its23`_internal/INSTRUCTIONS.md` after the entry gate; load only the type modules in24scope. Before any write, report the selected mode, accepted evidence, complete25candidate page tree, per-node confirmation state, exact atomic change-map26delta, stable paths and out-of-batch drift, then wait for confirmation whenever27the batch or migration scope is not already confirmed.28For a confirmed multi-type scope, preserve every exact invitation,29repository/schema, service, audit, or other source boundary as its own30`code_glob` row with a complete cross-type `required_docs` closure; a broad31feature glob never substitutes for a missing exact row.3233- Feature delivery: enforce PRD/TRD/plan/diff/test and design-closeout evidence;34 update the affected pages and change map together, leave new or unstamped35 pages `unverified`, run host checks, then hand off to `docs-audit`.36- Deployment verification: cross-check the shared environment reference and37 keep Development, Docker, and Kubernetes/Helm evidence and blockers38 separate. Continue confirmed classes, block only the missing class, and never39 invent placeholder commands. Migrate confirmed aggregate paths atomically.40- Release: touch only affected product/ops facts. A Release Notes outcome goes41 to `release-notes-gen`; carry the confirmed host repository, version, scope,42 evidence, and target site surfaces unchanged, and keep the entire site43 zero-diff in that routing step.44- Existing-system backfill: prefer catalog/change-map scope, propose one finite45 API/database/design/ops/product batch, mark every proposed new page46 `visibility: internal`, and remain read-only until confirmed.47Before that confirmation, inspect only the host check definitions needed to48plan verification; do not execute `test:docs`, builds, navigation preparation,49or any other host check. Read-only candidate planning is not authorization to50run the post-write verification phase.5152Every completed write batch must run the host's real checks, report their raw53result, hand the affected set to audit, and perform the read-only deployment54completeness recheck. A discovered deployment gap returns to `pm-agent` without55being repaired here.5657Make the result auditable with an explicit `Sync decision` block containing:58`mode`, `gate_status`, `confirmed_batch`, `proposed_batch`, `affected_docs`,59`evidence_bindings`, `excluded_paths`, `change_map_delta`,60`change_map_normalization`,61`loaded_type_modules`, `loaded_host_templates`, `hierarchy_drift`,62`host_checks`, and `audit_handoff`. Deployment mode additionally records one status for each of63Development, Docker, and Kubernetes/Helm. The top-level `gate_status` describes64the entry or whole-batch gate; a missing class-specific evidence set marks only65that class `blocked` and must not turn the whole batch into `blocked` while an66independently confirmed class can proceed. Each factual page claim names its implementation, test,67deployment, or maintainer-confirmed evidence. Do not add an ancestor/index,68page, map entry, future version fact, or owner merely because it would make the69site more complete; it must be required by the confirmed batch or existing host70navigation. When a prerequisite fails, set `gate_status: blocked` before scope71confirmation or writes. This applies to entry or whole-batch prerequisites; a72deployment class evidence gap follows the per-class continuation rule above.73Route product/metadata conflicts to `pm-agent` and TRD74path/impact conflicts to `engineer-agent:trd-gen` separately.75Set `change_map_normalization` to the observed result of a pre-return check that76every changed mapping list is deduplicated and stably sorted; a proposed delta77must state this normalization behavior as explicitly as an applied delta.7879When one batch is confirmed and another is still proposed, report them80separately. The unconfirmed candidate must include its complete ancestor/leaf81tree, code and evidence boundaries, owner, exact change-map delta, exclusions,82and confirmation status even though it remains zero-write. A hierarchy83migration proposal additionally names every drifted path and target node,84old-to-new path mapping, recursive navigation delta, `required_docs` delta, and85out-of-batch drift group, then offers migrate, keep only the confirmed batch,86or defer all changes before any write. In the final result,87name every host command actually run with its cwd and exit status; a generic88test-count or “checks passed” summary is not equivalent evidence.89Use catalog ownership and evidence paths exactly; do not substitute a guessed90team. End every completed write batch with an explicit audit handoff containing91all six fields: `status`, `completed_batch`, `affected_docs_and_map`,92`supporting_evidence`, `exclusions`, and `target_release_version`. When the93release version is not maintainer-confirmed, set `status: blocked` and94`target_release_version: missing`; do not replace either field with prose about95the next owner.96When the host defines `test:docs`, `build:public`, and `build:internal`, a97completed write batch must run and report all three commands with cwd and exit98status. Unit tests, navigation preparation, or a subset of those scripts cannot99substitute for the two visibility builds. Before returning, verify that all six100audit-handoff fields are present and complete rather than only naming101`docs-audit` as the next owner. For a hierarchy proposal, also verify that every102root-level non-index page is classified exactly once, pages that confirmed103catalog or `feature_path` evidence places under the same domain parent remain104in one group, each old-to-new row includes its inbound-link,105recursive-navigation, and `required_docs` deltas, and every out-of-batch group106contains both its page list and proposed target node. Do not return a partial107hierarchy inventory.108109After each check, remove its transient work directories, generated previews,110logs, caches, and diagnostics before taking the final workspace snapshot. Keep111only the requested formal documents, change-map updates, and the durable112conclusion/handoff; a passing command does not authorize test process artifacts113to remain in the host tree.114115## Entry Gate116117Require a PM handoff packet or an equivalent confirmed entry basis for exactly118one mode. The PM packet definition lives in119the plugin-local generated `../docs-agent/_internal/_generated/shared-contracts/handoff-contract.md`.120Direct invocation does not waive this gate.121Security-originated evidence is not an equivalent entry basis for any mode. If122there is no PM handoff packet, stop and guide the request back to `pm-agent` for123classification under `Security Conclusion Escalation to PM` and issue filing.124When a deployment recheck specifically exposes a missing repo-wide deployment125handoff, a PM-authorized bounded read-only recheck remains valid entry basis:126inspect the named site configuration, report the evidence-backed coverage and127gaps, then ask the user whether `pm-agent` should generate that repo-wide128handoff. The missing handoff blocks operational changes, not the scoped review;129do not replace the user-visible question with only a next-owner label.130131- **Feature delivery:** require an Approved PRD, a Confirmed TRD with traceable132 impact scope, a confirmed `IMPLEMENTATION_PLAN.md`, the actual diff, and133 required test results. Feature-level design pages additionally require the134 existing design closeout gate described in `_internal/INSTRUCTIONS.md`.135- **Deployment verification:** require confirmed deployment scope classified136 as Development, Docker, and Kubernetes/Helm, the TRD deployment surface,137 deployment configuration, verification commands and results, and known138 environment differences. Missing evidence blocks only the affected class;139 never replace it with placeholder commands.140- **Release:** require confirmed release scope, verified version evidence,141 changelog and release-process evidence, and audit context. This mode does not142 own Release Notes.143- **Existing-system backfill:** require an explicit maintainer request, a144 confirmed host repository, and a feature catalog or permission for bounded145 discovery. An implementation plan is not required, but every finite batch146 requires confirmation.147148If the basis is incomplete, stop before writing. Return product ambiguity to149`pm-agent`, technical-impact gaps to `engineer-agent:trd-gen`, and a missing150site foundation to `docs-site-bootstrap`; synchronization must not initialize151the site.152153## Mode Selection154155| Mode | Confirmed synchronization surface |156| --- | --- |157| Feature delivery | Affected API, database, design, and product pages, with their change-map entries and only necessary indexes or host-required navigation. |158| Deployment verification | Current Development, Docker, and Kubernetes/Helm ops, upgrade, and rollback facts under `ops/deployment/`, with a shared environment reference, per-class change-map entries, and only necessary indexes or host-required navigation. |159| Release | Only affected product and ops pages, reconciled with confirmed version facts. Release Notes body, index, metadata, and navigation belong to `docs-agent:release-notes-gen`. |160| Existing-system backfill | One maintainer-confirmed finite batch of API, database, design, ops, or product current-state pages. Prefer a feature catalog and existing change map; never expand bounded discovery into full-site generation. |161162The accepted implementation surface is all five formal document types: API,163database, design, ops, and product. This remains one specialist; do not create164parallel type-specific skills.165166## Authoritative Execution Pointer167168After the gate and mode are resolved, load `_internal/INSTRUCTIONS.md` and169follow its eight-step host-site contract, mode rules, change-map discipline,170boundaries, and report shape. For each target type, load only the corresponding171`_internal/types/<type>/INSTRUCTIONS.md`; do not read the other four type172modules unless they enter the confirmed write scope or an explicitly requested173read-only candidate-planning scope.174175After every completed existing-site content batch, apply the shared read-only176documentation-site deployment completeness recheck in the Safety-Net closeout.177Report evidence and drift and return any user-confirmed gap to `pm-agent`; do178not repair Docker, CI/CD, Compose, Helm, ingress, or runtime configuration. This179does not change the five-type contract above.