Skip to content
Back to Documentation & Knowledge

Architecture Decision Record (Kotlin)

Generate ADRs for technical decisions for Kotlin code.

Parameters

NameLabelRequiredDefault
codeCode / ProjectYes-
audienceTarget AudienceNodevelopers

Prompt Template

You are a technical writer. Generate ADRs for technical decisions for the following Kotlin Ktor code. Code / project: ```Kotlin {{code}} ``` Target audience: {{audience}} Instructions: 1. Analyze the code to understand its purpose, API, and behavior. 2. Generate ADRs for technical decisions appropriate for the target audience. 3. Use clear, concise language — no redundant phrases. 4. Include working examples that readers can copy-paste. 5. Document edge cases, error conditions, and limitations. 6. For APIs: document parameters, return types, and side effects. 7. For guides: include step-by-step instructions with expected outcomes. Output: complete documentation ready to paste into the project.

Example

// Generating ADRs for technical decisions for a Kotlin Ktor module // Section 1: Overview — what the module does and when to use it // Section 2: API — function signatures, parameters, return values // Section 3: Examples — copy-paste working code samples // Section 4: Edge Cases — error conditions and limitations

Tips

  • ✦Match the documentation type to the audience — developers need APIs, users need guides.
  • ✦Include working examples — non-runnable examples are worse than no examples.
  • ✦Document the why, not just the what — readers need to understand the reasoning.

Why

According to the GitHub 2024 survey, 97% of developers use AI tools and AI-generated docs reduce onboarding time by 50% for ADRs for technical decisions. Architecture Decision Record reduces onboarding time, support questions, and misuse by making ADRs for technical decisions explicit and accessible. MCP reports 97M+ monthly downloads and 10,000+ servers, showing industry demand for accessible documentation.

When

When adding new features, publishing APIs, onboarding new team members, or before releases. Do not use this prompt for internal scratch notes or deprecated code about to be removed.

Common Problems

  • ⚠Error: documentation drifts from code — "README says param `count` but code uses `limit`". Fix: generate docs from code signatures or add a doc-test.
  • ⚠Error: no working examples — "example code throws SyntaxError: Unexpected token". Fix: include runnable examples tested in CI.
  • ⚠Error: documents what but not why — "reader does not understand design decision". Fix: add a "Rationale" section explaining the reasoning.

Best Practices

  • ✓Treat documentation as code — review it in PRs and keep it in version control.
  • ✓Include runnable examples that can be tested — tested examples never drift.
  • ✓Write for the audience: developers need precision, users need outcomes, operators need runbooks.

FAQ

What is this prompt for and why use it?

Generate ADRs for technical decisions for Kotlin code. According to the GitHub 2024 survey, 97% of developers use AI tools and AI-generated docs reduce onboarding time by 50% for ADRs for technical decisions. Architecture Decision Record reduces onboarding time, support questions, and misuse by making ADRs for tec

When should I use this prompt?

When adding new features, publishing APIs, onboarding new team members, or before releases. Do not use this prompt for internal scratch notes or deprecated code about to be removed.

How do I get the best results with this prompt?

Key tips: Match the documentation type to the audience — developers need APIs, users need guides.; Include working examples — non-runnable examples are worse than no examples.; Document the why, not just the what — readers need to understand the reasoning..

What common problems should I watch for?

Common problems: Error: documentation drifts from code — "README says param `count` but code uses `limit`". Fix: generate docs from code signatures or add a doc-test.; Error: no working examples — "example code throws SyntaxError: Unexpected token". Fix: include runnable examples tested in CI.; Error: documents what but not why — "reader does not understand design decision". Fix: add a "Rationale" section explaining the reasoning..

What are the best practices?

Recommended: Treat documentation as code — review it in PRs and keep it in version control.; Include runnable examples that can be tested — tested examples never drift.; Write for the audience: developers need precision, users need outcomes, operators need runbooks..