AI Agent Hub
Back to skills
Code and UI Business Logic Documentation Generator icon

Code and UI Business Logic Documentation Generator

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_35d642b5/code-to-doc-generator according to https://skillhub.cn/install/skillhub.md.

About this skill

Why docs drift

Code can be checked by CI, linters, and compile errors, but business docs often have no equivalent feedback loop. When APIs change, rules shift, or UI flows are reorganized, docs keep describing the previous version. This skill focuses on extracting business facts that already exist in code and UI, then turning them into maintainable documents instead of copying stale prose.

How the skill works

  • Choose a mode: use generation mode when docs are missing, and reverse-sync mode when existing docs may have drifted from the code.
  • Confirm the doc type first: for example PRD, HLD, LLD, test docs, operations manual, or admin quick reference; analysis does not start before the type is explicit.
  • Map the project skeleton: infer tech stack, entry points, and module boundaries from root files, existing docs, and code layout.
  • Extract high-signal details: routes, menus, i18n strings, data models, permission middleware, error codes, state machines, and CI configs, selected by target audience.
  • Deepen by doc type: PRDs focus on user stories and acceptance criteria, LLDs on interfaces, data structures, and exception paths, operations manuals on impact, risk level, and named business rules.
  • Generate and reconcile: build a chapter skeleton first, then fill content; mark inference as [INFER] and code-verified facts as [FACT|file:line], then check related docs for needed updates.

Boundaries and notes

It fits business systems that already have runnable code, UI routes, or configuration files, especially when backfilling requirements, architecture, ops, or operations docs. When evidence is thin, the skill marks uncertainty instead of inventing details; if implementation diverges from design intent, it asks the user for a decision.

Use Cases

  • Take over an unfamiliar admin system and compile an operations manual from routes, menus, permission middleware, and visible UI flow.
  • After a backend change, reconcile stale API docs with code and update HLD plus LLD sections that describe current behavior.
  • Before release, derive testable acceptance criteria and business rules from service methods, state transitions, and validation branches for QA review.
  • Prepare an admin quick reference that maps system architecture, reader paths, dangerous actions, and config impact for new operators team.

Best For

  • Ops or product owner who inherited an admin backend and needs its permissions and business rules documented.
  • Backend engineer who needs HLD/LLD derived from module dependencies, interfaces, and state transitions.
  • QA engineer who needs test docs built from exception paths, error codes, and validation rules.
  • SRE or administrator who needs a quick reference covering system context, reader paths, and dangerous actions.