Hansem Global is currently producing API guides for various clients.
API guides are generally structured in the order of Method, Endpoint (URI), Request, and Response. The Method specifies the type of API request (e.g., GET, POST, PUT, DELETE), and the Endpoint defines the URL path where the API is called. The Request section details the parameters and their attributes required for the API call, while the Response section describes the data returned and its structure as a result of the call.
Although each project may differ slightly in industry type, authentication methods, or return fields, the basic framework of API documentation remains the same. The main challenge is ensuring consistent quality across all writerswithout deviation.
In other words, because API guides often repeat the same configuration pattern with only the parameters differing per API, maintaining consistency is critical. Furthermore, since the documentation process involves repetitive tasks, improving work efficiency is another key challenge.
Problem Statement
The characteristics of API guides mentioned above lead to the following problems:
- Lack of Consistency: Diminished overall document uniformity due to subtle differences in notation, structure, and terminology choices among different authors.
- Human Error: Frequent mistakes stemming from repetitive manual work (e.g., incorrect parameter types, omission of required fields).
- Time Consumption: Significant time spent writing numerous tables and code blocks according to predefined templates.
These issues can lead to reduced productivity for both the writers creating the guides and the developers who use them, as well as a degradation in the quality of the user experience.
Solution Search: Automation Strategy Using GitHub Copilot
The core solution to these problems lies in “minimizing human intervention” and “automating the process.” The tool selected for this purpose is the VS Code extension, GitHub Copilot (Copilot).
Copilot is an AI coding assistant that supports various development tasks, such as code completion, generation, and debugging, by leveraging multiple Large Language Models (LLMs), including OpenAI’s ChatGPT, Google’s Gemini, Anthropic’s Claude, and xAI’s Grok. It is used as a plugin in IDEs like Visual Studio Code and learns from the user’s code writing patterns to offer appropriate code suggestions.
Among Copilot’s various features, the two core functions most suitable for the API documentation task are:
- Automated Generation of Structured Documents
- Automatically transforms existing documents based on templates and rules within the prompt.
- Context-Based Suggestions
- Suggestions to maintain consistency by understanding the context of the current file and project.
- Suggestions for explanations and code completion based on simple descriptions or comments.
These core functions are utilized in a strategic two-step process.
The API guide is completed through a two-step process: “Step 1: Structuring Documents with Prompts (Templates, Rules)” and “Step 2: Context-Based Autocompletion.”
The draft generated in Step 1 ensures a repeatable common structure, while Step 2 minimizes expression and context errors by maintaining consistency when filling in detailed fields or descriptions. As these two steps become integrated, the writer can concentrate on review and quality control.
Step 1: Structuring Documents with Prompts (Templates, Rules)
The main goal of Step 1 is to quickly reorganize the source material into a consistent document structure. This requires breaking down the components of the document to be transformed, clearly defining the templates and rules, and systematically reflecting them in the prompt.
Prerequisites
- Source Analysis: Organize recurring sections, fields, and terms into tables and extract patterns.
- Template Design: Explicitly fix essential elements such as the API guide configuration order (Method → Endpoint → Request → Response), introductory text, and parameter table format.
- Rule Collection and Organization: Define a checklist or rules for terminology, data type notation, table headers, and code block language.
- Prompt Creation: Combine the analysis results, templates, and rules to create the prompt.
Execution
- Prompt Execution: Input the prepared prompt into Copilot to issue the command.
- Copilot Action: Copilot performs automatic transformation according to the prompt.
- Review and Acceptance: Review and accept the structured document generated by Copilot.
Step 1 completes the basic framework and repetitive structure of the API guide. Step 2 subsequently fills in the detailed content and strengthens overall document consistency.
Step 2: Context-Based Autocompletion
The purpose of Step 2 is to help Copilot understand the context of the current file and the entire project, thereby maintaining consistency and accuracy even during manual work. Real-time suggestions, based on the templates and rules established in Step 1, minimize repetitive tasks.
Maintaining Real-time Context Continuity
Copilot analyzes the immediately preceding section and other endpoints within the same file to infer the content that should follow. In API documents where the structure is repetitive, a suggestion for a section with the same pattern can be received immediately after completing one section.
It also contextually detects common errors such as missing parameter types, unclosed brackets in example JSON, or omitted mandatory sections, and provides correction suggestions. Specifically, during long table creation, it automatically corrects easy-to-miss details like end-line alignment or closing code blocks.
<Example> Recognizing the correction pattern in line 3, it suggests lines 4-6 with the same pattern structure (green area)
- Add backtick (`) to the field column
- Change “문자열” (String) in the Type column to “String”
- Change “필수” (Required) in the Required/Optional column to “Required”
- “선택” (Optional) in the Required/Optional column is automatically converted to “Optional” based on the context.

Enhancing Terminology and Format Consistency
Based on the glossary and style guide used throughout the project, it immediately suggests corrections for typos or inconsistencies in expression. Defining key terms using “copilot.additionalSuggestions” in “settings.json” or a memo file can increase the suggestion accuracy.
<Example> Defining descriptions for “member” and “dept” parameters in “settings.json”.
Suggestions for Explanation and Code Completion Based on Context Understanding and Simple Comments
It learns patterns such as variable names, function signatures (arguments and return types), class definitions, and data structures already written in the currently active file, and infers and suggests the next block of code so that it connects syntactically and logically with the existing code. It also references the coding style (indentation, variable naming conventions, etc.) of the entire project and information from other files, not just the current one.
<Example> Inferring the data format and content for cURL based on the document context.
Based on comments or natural language descriptions, it generates code blocks or content that are more extensive and intelligent than simple autocompletion.
<Example> <– Comment –> Recognizing the content of the comment and suggesting code in the corresponding language.
Additional Considerations
Furthermore, performance may vary depending on the Copilot Chat mode (Agent, Ask, Edit) and the supported modules (various versions of GPT, Claude, Gemini, etc.), making the selection of the appropriate mode and module also important. For more details, please refer to the GitHub Copilot documentation page (https://docs.github.com/ko/copilot).
<Copilot Chat Modes>
<Copilot Supported Modules>
Conclusion
The automation strategy for API documentation using Copilot focuses not just on saving time, but on solving the fundamental issues in API guide production: lack of consistency and human error.
The process—establishing a repeatable structure based on prompts in Step 1 and enhancing the accuracy and consistency of detailed content based on context in Step 2—minimizes human intervention by the document author. Consequently, the writer can focus on review and quality control rather than repetitive typing tasks.
Currently, this strategy is proving highly effective in allowing writers to concentrate their efforts on content management. However, as with any generative AI tool, ongoing optimization and fine-tuning are necessary. If these challenges are successfully resolved, this strategy is expected to become even more robust and scalable, further maximizing content consistency and work efficiency.