{"slug": "turns-long-ai-chats-into-adaptive-markdown-documentation-with-mermaid-diagrams", "title": "Turns long AI chats into adaptive Markdown documentation with Mermaid diagrams, preserving knowledge instead of chat history.", "summary": "A developer has created the Knowledge Pack Generator v3, a tool that transforms long AI chat conversations into adaptive Markdown documentation with Mermaid diagrams, preserving knowledge instead of chat history. The system analyzes entire conversations, identifies topics and decisions, and generates a structured knowledge base with files like README.md and Knowledge-Pack.md, using Mermaid diagrams for visual explanations.", "body_md": "| # Knowledge Pack Generator v3 | |\n| You are entering \"Knowledge Pack Mode.\" | |\n| If your environment supports file creation, write each document as a separate downloadable Markdown (.md) file instead of displaying it inline. If file creation is unavailable, clearly state that and output the Markdown in the chat. | |\n| Your task is NOT to summarize this conversation. | |\n| Your task is to transform this entire conversation into a polished, reusable knowledge base. | |\n| Assume this chat will be permanently deleted after your response. | |\n| Your goal is to preserve understanding, reasoning, discoveries, decisions, workflows, and future usefulness. | |\n| Do not produce \"chat notes.\" | |\n| Produce professional documentation. | |\n| The final result should feel like a small GitHub repository created by an expert after finishing a project. | |\n| --- | |\n| # Your Mission | |\n| Analyze the ENTIRE conversation before writing anything. | |\n| Identify: | |\n| • the main subject | |\n| • every subtopic | |\n| • the user's goals | |\n| • decisions | |\n| • reasoning | |\n| • discoveries | |\n| • mistakes | |\n| • corrections | |\n| • workflows | |\n| • code | |\n| • commands | |\n| • references | |\n| • resources | |\n| • unresolved questions | |\n| • future ideas | |\n| Then determine the complexity of the conversation. | |\n| --- | |\n| # Adaptive Output | |\n| DO NOT always generate the same files. | |\n| Choose automatically. | |\n| If the conversation is tiny: | |\n| Generate ONE file. | |\n| Knowledge-Pack.md | |\n| If the conversation is medium: | |\n| Generate TWO files. | |\n| README.md | |\n| Knowledge-Pack.md | |\n| If the conversation is large: | |\n| Generate as many Markdown files as necessary. | |\n| Never create unnecessary files. | |\n| Never merge unrelated topics into one huge document. | |\n| Instead split naturally. | |\n| Possible files include (only if needed): | |\n| README.md | |\n| Knowledge-Pack.md | |\n| Architecture.md | |\n| Learning-Guide.md | |\n| Research.md | |\n| Code.md | |\n| Commands.md | |\n| Resources.md | |\n| Decision-Log.md | |\n| Roadmap.md | |\n| Glossary.md | |\n| Workflow.md | |\n| FAQ.md | |\n| Troubleshooting.md | |\n| Continue-Context.md | |\n| Examples.md | |\n| Ideas.md | |\n| Best-Practices.md | |\n| Performance.md | |\n| Security.md | |\n| API.md | |\n| Reference.md | |\n| Appendix.md | |\n| You may invent better names when appropriate. | |\n| Quality matters more than the number of files. | |\n| --- | |\n| # File Formatting | |\n| Each file MUST begin with | |\n| # filename | |\n| Example | |\n| # README.md | |\n| ... | |\n| Then continue normally. | |\n| Never mix two files together. | |\n| --- | |\n| # README.md | |\n| If generated, this is always the entry point. | |\n| Include | |\n| Project overview | |\n| Current status | |\n| How to navigate the generated files | |\n| Biggest discoveries | |\n| Quick resume | |\n| Next actions | |\n| Estimated reading order | |\n| --- | |\n| # Documentation Style | |\n| Rewrite everything. | |\n| Improve everything. | |\n| Merge duplicate information. | |\n| Improve explanations. | |\n| Organize logically. | |\n| Preserve reasoning. | |\n| Never copy the conversation. | |\n| Write documentation. | |\n| --- | |\n| # Mermaid | |\n| Whenever a visual explanation is useful, ALWAYS use Mermaid. | |\n| Never draw ASCII diagrams. | |\n| Never fake diagrams using text. | |\n| Automatically choose the most appropriate Mermaid diagram. | |\n| Examples include | |\n| flowchart | |\n| mindmap | |\n| timeline | |\n| journey | |\n| sequenceDiagram | |\n| stateDiagram-v2 | |\n| classDiagram | |\n| erDiagram | |\n| gitGraph | |\n| quadrantChart | |\n| pie | |\n| xychart-beta | |\n| requirementDiagram | |\n| architecture | |\n| C4 (when supported) | |\n| sankey-beta | |\n| block-beta | |\n| Use as many Mermaid diagrams as needed. | |\n| Every diagram should improve understanding. | |\n| Never insert diagrams just for decoration. | |\n| ## Mermaid Serialization Rule | |\n| All Mermaid diagrams MUST be written as raw source code inside the generated Markdown files. | |\n| Do NOT render, preview, interpret, execute, convert, or replace Mermaid diagrams with images, SVGs, HTML, canvas, rich widgets, artifacts, or embedded visualizations. | |\n| Every Mermaid diagram MUST appear exactly like this: | |\n| ``` mermaid | |\n| flowchart TD | |\n| A --> B | |\n| ``` | |\n| The literal Mermaid source must be preserved in the Markdown file so it renders later in Markdown viewers such as GitHub, GitHub Gists, Obsidian, MkDocs, Docusaurus, and any Mermaid-compatible renderer. | |\n| Raw Markdown is the canonical output. | |\n| ## Visualization Rule | |\n| Whenever information is easier to understand visually than in prose, generate a Mermaid diagram instead of describing it with lists or ASCII art. | |\n| Prefer diagrams for: | |\n| - Architecture | |\n| - Workflows | |\n| - Decision trees | |\n| - Timelines | |\n| - Mind maps | |\n| - State machines | |\n| - Sequence flows | |\n| - Entity relationships | |\n| - Dependency graphs | |\n| - Component hierarchies | |\n| - Git histories | |\n| - User journeys | |\n| - Requirement relationships | |\n| Use the most appropriate Mermaid diagram type automatically. Every diagram must be wrapped in a fenced Markdown block with the `mermaid` language tag. | |\n| # Tables | |\n| Whenever comparison is useful, use Markdown tables. | |\n| Examples | |\n| Tool comparisons | |\n| Feature comparisons | |\n| Pros and cons | |\n| Performance | |\n| Compatibility | |\n| Costs | |\n| Decision matrices | |\n| Learning paths | |\n| --- | |\n| # Code | |\n| Extract every useful code snippet. | |\n| Improve formatting. | |\n| Explain why it exists. | |\n| Mention limitations. | |\n| Suggest improvements. | |\n| Group related snippets together. | |\n| --- | |\n| # Commands | |\n| Collect every command. | |\n| Explain | |\n| Purpose | |\n| Arguments | |\n| Common mistakes | |\n| Examples | |\n| When to use | |\n| --- | |\n| # Decisions | |\n| Create a complete decision log. | |\n| Each decision should contain | |\n| Decision | |\n| Reason | |\n| Alternatives considered | |\n| Trade-offs | |\n| Confidence | |\n| Impact | |\n| --- | |\n| # Concepts | |\n| Explain every important concept. | |\n| Definition | |\n| Why it matters | |\n| Examples | |\n| Connections | |\n| Related concepts | |\n| Common mistakes | |\n| --- | |\n| # Resources | |\n| Collect every resource. | |\n| GitHub | |\n| Documentation | |\n| Books | |\n| Videos | |\n| Courses | |\n| Articles | |\n| Tools | |\n| Libraries | |\n| Communities | |\n| Explain WHY each resource matters. | |\n| --- | |\n| # Learning | |\n| If this was educational, | |\n| Generate | |\n| Learning roadmap | |\n| Difficulty progression | |\n| Practice ideas | |\n| Review checklist | |\n| Knowledge gaps | |\n| --- | |\n| # Programming | |\n| If this involved software, | |\n| Generate | |\n| Architecture | |\n| Component relationships | |\n| File structure | |\n| Dependencies | |\n| Data flow | |\n| APIs | |\n| Design decisions | |\n| Testing ideas | |\n| Future improvements | |\n| --- | |\n| # Research | |\n| If this involved research, | |\n| Generate | |\n| Evidence | |\n| Claims | |\n| Confidence | |\n| Counterarguments | |\n| Open questions | |\n| Future research | |\n| --- | |\n| # Planning | |\n| If planning occurred, | |\n| Generate | |\n| Milestones | |\n| Risks | |\n| Dependencies | |\n| Timeline | |\n| Priority matrix | |\n| Action plan | |\n| --- | |\n| # Continue Context | |\n| If the conversation is large, | |\n| Generate Continue-Context.md | |\n| This file should allow another AI to continue the project with almost zero context loss. | |\n| Include | |\n| Goals | |\n| Current progress | |\n| Important assumptions | |\n| Completed work | |\n| Rejected ideas | |\n| Current direction | |\n| Remaining work | |\n| Preferred approach | |\n| --- | |\n| # Compression Rules | |\n| Remove | |\n| Greetings | |\n| Small talk | |\n| Repetition | |\n| Speech filler | |\n| Typing mistakes | |\n| Repeated explanations | |\n| Keep | |\n| Knowledge | |\n| Reasoning | |\n| Insights | |\n| Trade-offs | |\n| Patterns | |\n| Lessons | |\n| Techniques | |\n| Examples | |\n| Context | |\n| --- | |\n| # Output Quality | |\n| Think like | |\n| a senior engineer, | |\n| a technical writer, | |\n| a researcher, | |\n| and an editor | |\n| working together. | |\n| The generated documentation should be clearer than the original conversation. | |\n| --- | |\n| # Final Validation | |\n| Before finishing, verify | |\n| ✓ Every important idea is preserved. | |\n| ✓ Duplicate information is merged. | |\n| ✓ Documentation is easy to navigate. | |\n| ✓ Mermaid diagrams replace text diagrams. | |\n| ✓ Tables are used where appropriate. | |\n| ✓ Concepts are explained. | |\n| ✓ Decisions include reasons. | |\n| ✓ Resources explain their purpose. | |\n| ✓ Code is documented. | |\n| ✓ Future work is clear. | |\n| ✓ Another AI could continue the work immediately. | |\n| Your output should be something I would happily commit to a GitHub repository without editing. |", "url": "https://wpnews.pro/news/turns-long-ai-chats-into-adaptive-markdown-documentation-with-mermaid-diagrams", "canonical_source": "https://gist.github.com/kuroyurioss/049806dffcba98e084ed0cfa98216185", "published_at": "2026-08-03 14:36:28+00:00", "updated_at": "2026-08-03 15:30:36.444464+00:00", "lang": "en", "topics": ["developer-tools", "generative-ai", "ai-tools"], "entities": ["Knowledge Pack Generator v3", "Mermaid"], "alternates": {"html": "https://wpnews.pro/news/turns-long-ai-chats-into-adaptive-markdown-documentation-with-mermaid-diagrams", "markdown": "https://wpnews.pro/news/turns-long-ai-chats-into-adaptive-markdown-documentation-with-mermaid-diagrams.md", "text": "https://wpnews.pro/news/turns-long-ai-chats-into-adaptive-markdown-documentation-with-mermaid-diagrams.txt", "jsonld": "https://wpnews.pro/news/turns-long-ai-chats-into-adaptive-markdown-documentation-with-mermaid-diagrams.jsonld"}}