Issue Doc Sync
Documentsissue-doc-syncIssue Doc Sync is an Agent Skill for documents published in the kxn/codex-remote-feishu repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Use when syncing closed GitHub issues back into repo docs. Scans closed issues incrementally by updatedAt, reuses a tracked state cache, surfaces only candidates that changed since the last extraction, and records skip/merge/new-doc decisions for this repository.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/kxn/codex-remote-feishu/blob/HEAD/.codex/skills/issue-doc-sync/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/issue-doc-sync, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
issue-doc-sync
Use this skill when the user asks to:
- sync closed GitHub issues back into
docs/ - extract durable design knowledge from closed issues
- avoid re-reading unchanged closed issues
- maintain the tracked issue-to-doc sync state in this repository
Workflow
- Sync the current branch first.
- Run
git pull --ff-only. - Do not assess issues against stale local code or stale tracked cache.
- Run
- List only changed closed issues.
- Prefer
scripts/issue-doc-sync/review.sh plan. - This compares GitHub
updatedAtagainst.codex/state/issue-doc-sync/state.json. - The default processing order is old to new by
closedAt, with issue number fallback for same-time ties.
- Prefer
- Review each candidate issue.
- Prefer
scripts/issue-doc-sync/review.sh inspect [issue-number]. - If no issue number is given, the runner opens the oldest pending candidate automatically.
- If current docs already cover the durable result, skip it and record why.
- If an existing canonical doc is the right home, merge into that doc.
- If no suitable doc exists, create a new doc under the correct lifecycle directory.
- Prefer
- Update docs.
- Every
docs/**/*.mdfile must keep the visible metadata block under the title:TypeUpdatedSummary
- If you add or move a lifecycle doc, update
docs/README.mdin the same change.
- Every
- Record the decision in the tracked state cache.
- Prefer
scripts/issue-doc-sync/review.sh record [issue-number] --decision ... --reason .... - If no issue number is given, the runner records against the oldest pending candidate.
- Required fields:
--issue--decision skip|merge|new-doc--reason
- Add
--target-doconce per touched doc path when the decision ismergeornew-doc. - The underlying
recordcommand now auto-fills issue metadata from GitHub when not provided. - If a target doc was already touched by a newer synced issue,
recordrefuses by default and requires--forcefor an intentional backfill.
- Prefer
- Validate.
- The runner re-runs
planautomatically afterrecord. - You can also run
scripts/issue-doc-sync/review.sh planand confirm unchanged issues disappear from the candidate set.
- The runner re-runs
Decision Rules
- Default doc target:
docs/implemented/for feature-level implemented behaviordocs/general/only when the conclusion is a longer-lived repo baseline or canonical process
- Skip when:
- the durable conclusion is already covered by current docs
- the issue is mostly process chatter, copy tweaks, or low-value operational history
- Prefer merge over new doc when one existing canonical doc clearly owns the topic.
State Cache
- Cache path:
.codex/state/issue-doc-sync/state.json - The cache is tracked in git on purpose.
- Each decision should be committed together with the matching doc change.
- Expected tracked state fields:
- issue number
- GitHub
updatedAt - decision
- reason
- target doc paths
- source issue URL
References
- For the doc metadata template and decision examples, read references/doc-template.md.