STE-Code provides a structured approach to technical writing in code documentation, utilizing 51 rules and grammar recommendations derived from the ASD-STE100 standard. By eliminating ambiguity and jargon, it enhances the clarity of README files, API documentation, and more, allowing developers to produce concise and effective documentation tailored to their token budgets.
STE-Code is an innovative adaptation of the ASD-STE100 Issue 9 standard, specifically designed for software documentation. This project provides a set of guidelines that includes 51 writing rules, 4 grammar recommendations, a controlled vocabulary, and system prompt templates organized at five levels. The focus of STE-Code is to eliminate ambiguity and jargon from documentation, making it suitable for README files, API documentation, docstrings, commit messages, and error messages.
Select from multiple adaptation levels that cater to different token budgets:
| Level | File | Tokens | Best For |
|---|---|---|---|
| 1 | level1/system-prompt.txt | ~1.2K | Interactive sessions, tight token budgets |
| 2 | level2/system-prompt.txt | ~4.5K | Code review, PR feedback |
| 3 | level3/system-prompt.txt | ~8K | Full document rewriting |
| 4 | level4/system-prompt.txt | ~45K | Strict compliance checking |
| 5 | ste-code/artifacts/level5/ | N/A | Comprehensive overview of all rules |
Utilize a system prompt to ensure your LLM (Language Model) generates clear, unambiguous documentation. Here’s a brief example:
You: Copy level1/system-prompt.txt into the system prompt field.
LLM: You are an STE-Code technical writer. Apply these rules...
You: Check this docstring.
/** This function basically handles user stuff. */
LLM: /** Creates a user or updates the data of a user. */
The LLM will utilize a controlled vocabulary, synonym lists, and sentence-length restrictions to produce optimized text, replacing jargon with approved terminology, and employing active voice in documentation.
The standard features 51 rules across nine sections, which include:
| Section | Rules | Covers |
|---|---|---|
| 1 — Words | 14 | Vocabulary, parts of speech, technical terms |
| 2 — Noun Phrases | 2 | Article use, noun clusters |
| 3 — Verbs | 7 | Tense, voice, mood |
| 4 — Sentences | 5 | Length, clarity, contractions |
| 5 — Procedures | 5 | Instructional writing |
| 6 — Descriptions | 5 | Descriptive writing, comparisons |
| 7 — Warnings | 3 | Formatting for critical information |
| 8 — Punctuation | 6 | Comma, hyphen, and list usage |
| 9 — Document Structure | 4 | Headings, lists, organization |
Each rule is tailored for various programming paradigms, including object-oriented and functional programming.
Compared to conventional assistants, STE-Code significantly enhances documentation performance, achieving:
| STE-Code | Plain Assistant | Improvement | |
|---|---|---|---|
| Pass rate | 96.6% | 11.9% | +84.7% |
| Average score | 0.919 | 0.471 | +0.448 |
This project emphasizes excellence in comments, error messages, and configuration files.
In the repository, the files are organized into distinct categories, including artifacts, adaptations, templates, and tools. This enables seamless integration and usage of the documentation standard.
The standard is developed through a five-stage automated pipeline, enhancing efficiency and effectiveness:
Extract → Refine → Merge → Adapt → Artifacts
This process is orchestrated by nine specialized agents working in parallel to ensure a high-quality adaptation for the software domain.
For anyone looking to streamline technical documentation, STE-Code provides a robust framework for achieving clarity and precision in code documentation.
No comments yet.
Sign in to be the first to comment.