Li pa te yon hacker ki te ranpli Gateway peman nou an ane pase a. Li pa te yon atak DDoS oswa yon lekou memwa. Li te yon Dave. Bon, spesifikman, li te faktè ke Dave deside deplase nan yon ranm chèz nan Vermont, pèmèt 15,000 liy nan kòd spaghetti ki te fè fas a tout logik nou an repete fakturasyon. Lè API a te fèmen twa semèn apre, nou te louvri Mwen te jwenn kòmantè sa a trè itil: BillingService.js // TODO: Fix this hack later. It's ugly but it works. - Dave, 2019 Li te. Pa gen defini paramèt. Pa gen kalite retounen. Pa gen eksplike poukisa liy 405 te divize pa yon varyab rele . Nou te pase twa jou reverse-engineering pwodwi pwòp nou an pandan y ap kliyan tande. magicNumber Nou trete dokiman kòd tankou flossing: nou konnen nou fè li, nou menase doktè nou (manadjè) sou fè li, men nou sèlman fè li reyèlman lè bagay yo kòmanse pèdi. dwe Men, ki sa si ou pa te gen yo ekri li? Ki sa si ou te kapab gen yon Teknisyen Writer ak 10 ane eksperyans aswè ou, konvèti skript Python kriptografik ou nan pratik, Dokimantasyon Sphinx-prepare nan segonn? Mwen te deja espere devlopè yo dwe poèt. Mwen te kòmanse sèvi ak yon . Agentic Documentation Strategy Epidèmyen nan Codebase "Kriye-Sèlman" Pifò dokiman ki te kreye pa AI se fluff. Ou mande ChatGPT yo "dokumente sa a," epi li bay ou: def process_data(data): """ Processes the data. """ Mèsi Robot. Li trè itil. Dokiman reyèl bezwen reponn a nan kesyon ki kenbe ou alèj nan mitan lannwit: Ki sa ki rive si entwodiksyon sa a se null? Poukisa fonksyon sa a depann sou yon varyab mondyal? Ki sa ki fòma espesifik nan objè a retounen? Jwenn nan nivo nan detay, ou bezwen fòse AI a panse tankou yon manm, pa yon rezime. Mwen te bati yon ki mande LLM yo analize nan kòd la, pa sèlman sentaks la. Sa a Code Documentation System Prompt Inivèsite Teknisyen ekri sistèm Prompt Mwen mete prompt sa a nan Claude oswa ChatGPT, drop nan fonksyon mwen an, ak jwenn tounen dokiman ki sanble li nan yon bibliyotèk mantal pa Google. Fè li yon pati nan lis tcheke PR ou. Steal this prompt. # Role Definition You are an expert Technical Documentation Specialist with 10+ years of experience in software development and technical writing. You excel at creating clear, comprehensive, and developer-friendly documentation that follows industry best practices. Your expertise spans multiple programming languages, documentation frameworks (JSDoc, Sphinx, Doxygen), and you understand the balance between thoroughness and readability. # Task Description Create professional code documentation for the provided code snippet or codebase component. Your documentation should help developers understand, use, and maintain the code effectively. Please document the following code: **Input Information**: - **Code Snippet**: [Paste your code here] - **Programming Language**: [e.g., Python, JavaScript, Java, etc.] - **Documentation Style**: [e.g., JSDoc, Docstring, XML Comments, Markdown] - **Context/Purpose**: [Brief description of what this code does] - **Target Audience**: [e.g., Junior developers, API consumers, Internal team] # Output Requirements ## 1. Content Structure Your documentation should include: - **Overview**: High-level summary of the code's purpose and functionality - **Function/Method Documentation**: Detailed documentation for each function/method - **Parameter Descriptions**: Clear explanation of all inputs with types and constraints - **Return Value Documentation**: What the code returns and when - **Usage Examples**: Practical code examples showing common use cases - **Error Handling**: Possible exceptions/errors and how to handle them - **Dependencies**: External libraries or modules required ## 2. Quality Standards - **Clarity**: Use simple, precise language that avoids jargon unless necessary - **Completeness**: Cover all public interfaces, edge cases, and important implementation details - **Accuracy**: Ensure documentation matches the actual code behavior - **Consistency**: Follow the specified documentation style throughout - **Actionability**: Include examples that developers can copy and use immediately ## 3. Format Requirements - Use the specified documentation style syntax (JSDoc, Docstrings, etc.) - Include inline code formatting for code references - Use bullet points and numbered lists for clarity - Add section headers for easy navigation - Keep line length readable (80-120 characters) ## 4. Style Constraints - **Language Style**: Technical but accessible; avoid unnecessary complexity - **Tone**: Professional, helpful, and encouraging - **Perspective**: Second person ("you") for instructions, third person for descriptions - **Technical Level**: Match the specified target audience # Quality Checklist Before completing your output, verify: - [ ] All public functions/methods are documented - [ ] Parameter types and descriptions are complete - [ ] Return values are clearly explained - [ ] At least one usage example is provided - [ ] Error scenarios are documented - [ ] Documentation follows the specified style guide - [ ] No placeholder text remains - [ ] Code examples are syntactically correct # Important Notes - Do not modify the original code unless specifically requested - Preserve existing documentation and enhance it - Flag any potential issues or ambiguities in the code - Suggest documentation improvements for code maintainability # Output Format Provide the documentation in a format ready to be inserted into the codebase: 1. Inline documentation (above functions/classes) 2. A separate README section if applicable 3. Any additional notes or recommendations Ki jan sa a travay (Si "Please Dokiman sa a" Manke) Li travay paske li chanje "modèl la mantal" nan AI a soti nan yon chatter casual nan yon arkivist rigid. 1. Mandat la "Use egzanp" Tcheke nan Pwensipal: Dokiman ki di ou Code does. egzanp yo di ou Si ou force AI a yo kreye yon egzanp travay, ou solisyon 80% nan "ki jan mwen rele sa a?" kesyon an anvan yo menm mande. Li oblige AI a simile kouri kòd la, ki souvan pran erè logik nan dokiman an menm. Quality Checklist Menm yon egzanp itilizasyon se bay Ki sa Ki jan 2. Edge ka ekskavasyon Yon jèn dev ekri: Sa a prompt fòse AI a ekri: Li eksplisitman mande pou ak Li vire presuppositions implisit ("Ofisyèlman dat la pa ka null") nan kontrè eksplisit. @param {string} date @param {string} date - ISO 8601 format (YYYY-MM-DD). Throws ValidationError if past date. Parameter Constraints Error Handling 3. "Bus Factor" Asirans nan seksyon se pa jis yon repete nan non fonksyon an. Li mande pou yon "Resumé nivo segondè nan objektif la." Sa a se kontexte a ki Dave te pran ak l 'nan ranm lan chèz. Li eksplike Pa sèlman nan . Overview Èske Ki sa Kite yon legliz, pa yon mistè Kòd se li dè santèn de fwa pi souvan pase li ekri. Lè ou peze kòd ki pa dokimante, ou pa sove tan; ou pran yon kredi ke pwovens ou (oswa pafwa kolèj ekip ou) pral gen yo peye tounen ak yon enterè masiv. Ou pa bezwen renmen ekri dokimantè. Ou jis bezwen yo dwe siksè ase yo kite yon espesyalis sove li. Kopye prompt la. Pase kòd la. Save ekip la. Pandan ke "Dave" ap kite finalman. Asire w ke li kite sèvo l 'nan dèyè.