writing-docs.mdc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ---
  2. alwaysApply: true
  3. ---
  4. When writing or improving documentation for Agency Swarm, your primary goal is clarity for the target reader: show the information they need to complete the task, with enough context to avoid confusion.
  5. # Agency Swarm Documentation Writing Rules
  6. - Write documentation in an easy to understand conversational language.
  7. - Use simple language and clear terms.
  8. - Docs should be easily readable by an 8th grader.
  9. - Be concise, but keep full sentences and transitions when they are needed for readability.
  10. - Make documentation actionable. Place code snippets at the top so users can easily copy and paste them. Provide only essential context above the code. Move any complex or detailed explanations to the end of the page.
  11. - The more important the information is, the higher it should be on the page.
  12. - Highlight the important parts by using bold, components, etc.
  13. - Hide complexity under tabs, dropdowns, etc.
  14. - Split pages into sub pages if needed. Use ~150 visible lines as a readability target, not a hard limit. Collapsed content (for example accordions) does not count toward this target.
  15. ## Release Notes
  16. Use these rules for release notes so the intro stays readable and every claim stays tied to a shipped change.
  17. - Write the opening paragraph and each section intro for non-technical readers first. In one or two sentences, say what changed and why it matters in plain English.
  18. - Ground every phrase in a concrete change from the repo or release diff. If a phrase cannot be tied to a command, API, capability, limit, or fix, delete it.
  19. - Prefer plain verbs and nouns like `start`, `open`, `run`, `set up`, `use`, and `fix`.
  20. - Avoid vague opener words like `documented`, `surface`, `workflow`, `path`, and `behavior` unless the exact term is required for accuracy.
  21. - Keep the intro broad and easy to read, then let the bullets carry the exact commands, APIs, models, limits, PR numbers, and contributor names.
  22. - Group sections by reader value, not by implementation layer.
  23. - Do not present internal policy or agent-rule changes as public docs. If they must be included, label them as internal maintenance and keep them brief.
  24. # Mintlify Components Reference
  25. You can utilize various components from mintlify:
  26. ## Accordion
  27. Collapsible sections for optional or detailed content:
  28. ```mdx
  29. <Accordion title="Advanced Options" defaultOpen={false}>
  30. Content here
  31. </Accordion>
  32. ```
  33. ## Tabs
  34. Switch between different code examples or content:
  35. ```mdx
  36. <Tabs>
  37. <Tab title="Python">Python code</Tab>
  38. <Tab title="JavaScript">JS code</Tab>
  39. </Tabs>
  40. ```
  41. ## Cards
  42. Highlight key links or concepts:
  43. ```mdx
  44. <Card title="Getting Started" icon="rocket-launch" href="/quickstart">
  45. Start building your first agency
  46. </Card>
  47. ```
  48. ## Steps
  49. Display sequential instructions:
  50. ```mdx
  51. <Steps>
  52. <Step title="Install">Install the package</Step>
  53. <Step title="Configure">Set up your config</Step>
  54. </Steps>
  55. ```
  56. ## CodeGroup
  57. Group related code examples:
  58. ````mdx
  59. <CodeGroup>
  60. ```python example.py
  61. # Python version
  62. ````
  63. ```javascript example.js
  64. // JS version
  65. ```
  66. </CodeGroup>
  67. ```
  68. ## API Components
  69. For API documentation:
  70. ```mdx
  71. <ParamField param="name" type="string" required>
  72. Parameter description
  73. </ParamField>
  74. <ResponseField name="status" type="string">
  75. Response field description
  76. </ResponseField>
  77. ```
  78. # Instructions
  79. ## Before Starting
  80. If style is unclear, review one or more of these examples:
  81. - [Tools](docs/core-framework/tools/overview.mdx)
  82. - [Agents](docs/core-framework/agents/overview.mdx)
  83. - [Agencies](docs/core-framework/agencies/overview.mdx)
  84. - [Communication Flows](docs/core-framework/agencies/communication-flows.mdx)
  85. Use these examples as guidance, not strict templates.
  86. ## Updating Existing Pages
  87. 1. Analyze the feedback provided by the user and determine which specific sections you need to update.
  88. - If there is a lot of feedback, create a to-do list for yourself and break it down.
  89. 2. Only update the required parts, do not add anything unrequested. Perform minimal changes, keep everything unaffected by feedback as is. Only update the parts and the pages that are explicitly requested.
  90. 3. If asked to move the page, keep consistent folder and file structure, matching the structure in the `./docs/docs.json` file.
  91. 4. Ask the user to review the changes and provide feedback.
  92. ## Writing New Pages
  93. 1. Analyze the information or the relevant code provided by the user.
  94. - If critical information is missing, ask only the minimum questions needed to proceed.
  95. - For example:
  96. - What is the use case for this?
  97. - Where can I see relevant files?
  98. - Do you have any example code snippets?
  99. - Why did you create this feature in the first place?
  100. - What does the user have to know before they can start using it?
  101. - etc...
  102. 2. Create a new page reference in the `./docs/docs.json` file in the appropriate group and sub group.
  103. - If it's unclear where to place the page, ask the user for clarification.
  104. - Make sure the folder structure in docs folder matches the structure in the `./docs/docs.json` file.
  105. 3. Write the page content using the same path, following all the rules above.
  106. 4. Ask the user to review the page and provide feedback.
  107. 5. Implement any adjustments as needed. See "Updating Existing Pages" section below.
  108. # Additional Notes
  109. -
  110. # References
  111. - [Mintlify Documentation](https://www.mintlify.com/docs/llms.txt) - Check if you need clarification about how mintlify works or looking for any other components.