Documentation Workflows
frg docs writes project documentation from an issue's implementation plan, builds the documentation, and answers questions about it. Use it when documentation work belongs to an issue that already has a plan from frg issue plan.
Prerequisites
-
A valid Telerik license. See Licensing.
-
A supported coding agent, installed and authenticated. Check it with
frg status. -
An Issue ID in the current context. Without one, Forge stops with
Issue ID required for 'docs' operations.bashfrg config set-issue 123 # or: export FORGE_ISSUE_ID=123 -
An implementation plan in
.forge/work/job_<issue_id>/code/(README.md,research.md,tasks.md,phase_x.md). Create it withfrg issue plan. -
The documentation sources and build configuration in your repository.
Subcommands at a glance
| Subcommand | What it does | Typical inputs | Outputs | Default role |
|---|---|---|---|---|
create | Generates documentation or guides | Implementation plan, source code, existing docs | Documentation files in the repository's documentation directories | technical_writer |
build | Builds documentation and reports the result | Implementation plan, documentation sources | .forge/work/job_<issue_id>/docs/build_report.md | technical_writer |
ask | Answers a question about the documentation | Question, implementation plan, docs | .forge/work/job_<issue_id>/docs/answer.md | technical_writer |
Typical flow
issue plan ──► docs ask ──► docs create ──► docs build ──► fix sources ──► docs build ──► commit docs
│ ▲
└── build_report.md ──────────┘
-
Set the issue and make sure its plan exists:
bashfrg config set-issue 123 ls .forge/work/job_123/code/ -
Find the gaps:
bashfrg docs ask "Which new APIs from this issue are undocumented?" -
Write the documentation:
bashfrg docs create -
Build it and read the report:
bashfrg docs build cat .forge/work/job_123/docs/build_report.md -
Fix any reported errors, rebuild, and commit the documentation files. Keep reports under
.forge/work/out of version control.
Options shared by all subcommands
Every frg docs subcommand accepts these options.
| Option | Description | Default |
|---|---|---|
-a, --agent <NAME> | Coding agent for this run: claude_code, github_copilot, or opencode. | Agent in agents.toml |
-r, --role <ROLE> | Overrides the default role: product_manager, software_engineer, software_architect, technical_writer, security_analyst, sre. Cannot be combined with --custom-agent. | technical_writer |
--custom-agent <NAME> | Selects a custom agent configuration inside your coding agent. Cannot be combined with --role. | None |
-m, --model <MODEL> | Overrides the model configured in agents.toml. | Model in agents.toml |
-c, --context-file <FILE> | Adds a file path as context. Repeatable. | None |
--context-dir <DIR> | Adds a directory as context. Repeatable. Up to 100 files per directory and 1 MB per file. | None |
--clear | Clears the existing agent session and starts fresh. | Off |
--retry [<INSTRUCTIONS>] | Continues the previous session to complete missing outputs. Requires an existing session; cannot be combined with --clear. | Off |
--auto-retry | Retries once automatically when expected outputs are missing. Cannot be combined with --clear. | Off |
--print-prompt | Prints the compiled prompt without running the agent. | Off |
--bypass-safety-checks | Skips prompt-injection validation. Bypasses are logged. | Off |
-q, --quiet | Suppresses all output except errors. | Off |
frg docs create
Generates documentation from the issue requirements, research, tasks, implementation phases, source code, and existing documentation. Files are written to the repository's documentation directories, not to .forge/work/, so they can be committed.
frg docs create [OPTIONS]
| Option | Description |
|---|---|
--edit [<INSTRUCTIONS>] | Refines the documentation with your instructions, given inline or in edit.md. |
frg docs create
frg docs create --edit "Add a troubleshooting section for the new config keys"
frg docs build
Builds the documentation with the project's documentation framework, analyzes errors and warnings, and writes a report. Built artifacts stay in the framework's default output location.
frg docs build [OPTIONS]
| Option | Description |
|---|---|
--dev | Focuses on the developer/API audience. |
frg docs build
frg docs build --dev
Output: .forge/work/job_<issue_id>/docs/build_report.md, with the build command, status, errors, warnings, artifact location, and recommended fixes.
Notes:
frg docs buildhas no--fixoption. Use the report to correct sources or configuration, then run the build again.
frg docs ask
Answers a question about the project's documentation. It does not change documentation.
frg docs ask [OPTIONS] [QUESTION]
No additional options.
frg docs ask "What sections need updating?"
frg docs ask "Is the API reference complete?"
Output: .forge/work/job_<issue_id>/docs/answer.md.
See Also
- Issue Management: create the implementation plan these operations read.
- Code Operations:
frg code documentdocuments code inside the source files. - Pull Requests: review and merge documentation changes.
- Workflow Commands and Modifiers.
- Command Reference.