|
| 1 | +--- |
| 2 | +name: fastforward-sphinx-docs |
| 3 | +description: Generate structured, consistent, and reusable Sphinx (reStructuredText) documentation for Fast Forward PHP framework libraries. |
| 4 | +version: 1.0.0 |
| 5 | +tags: |
| 6 | + - documentation |
| 7 | + - sphinx |
| 8 | + - rst |
| 9 | + - php |
| 10 | + - fast-forward |
| 11 | + - technical-writing |
| 12 | +author: Fast Forward Ecosystem |
| 13 | +license: MIT |
| 14 | +inputs: [] |
| 15 | +outputs: |
| 16 | + - type: documentation |
| 17 | + format: rst |
| 18 | +--- |
| 19 | + |
| 20 | + |
| 21 | +# Sphinx Documentation Skill for Fast Forward Framework |
| 22 | + |
| 23 | +This skill provides a comprehensive checklist and structure for generating rich, congruent, and reusable documentation in reStructuredText (.rst) for all libraries in the Fast Forward PHP framework ecosystem. Use these guidelines to ensure consistency, depth, and usability across all package docs. |
| 24 | + |
| 25 | +## General Principles |
| 26 | +- All documentation must be written in clear, technical English. |
| 27 | +- Use Sphinx/reStructuredText (.rst) format with proper indentation and directives. |
| 28 | +- Structure documentation for both beginners and advanced users. |
| 29 | +- Ensure congruence in structure, terminology, and navigation across all libraries. |
| 30 | +- Provide practical, real-world examples for all major features and edge cases. |
| 31 | +- Reference relevant PSRs, RFCs, and related libraries where appropriate. |
| 32 | +- Always detect and document special features in the codebase: aliases, factories, singleton patterns, extensibility points, static helpers, PSR compliance, and integration hooks. |
| 33 | + |
| 34 | +## Recommended Directory and File Structure |
| 35 | + |
| 36 | +- docs/ |
| 37 | + - index.rst |
| 38 | + - getting-started/ |
| 39 | + - index.rst |
| 40 | + - installation.rst |
| 41 | + - quickstart.rst |
| 42 | + - usage/ |
| 43 | + - index.rst |
| 44 | + - getting-services.rst |
| 45 | + - use-cases.rst |
| 46 | + - [one .rst per specialized response/stream, e.g., html-response.rst, json-response.rst, text-response.rst, empty-response.rst, redirect.rst, stream-usage.rst] |
| 47 | + - api/ |
| 48 | + - index.rst |
| 49 | + - [one .rst per major class or interface, or grouped by topic] |
| 50 | + - [aliases.rst if applicable] |
| 51 | + - advanced/ |
| 52 | + - index.rst |
| 53 | + - integration.rst |
| 54 | + - [aliases.rst if applicable] |
| 55 | + - [other advanced topics, e.g., extension, middleware, error handling, performance, custom factories, override patterns] |
| 56 | + - links/ |
| 57 | + - index.rst |
| 58 | + - dependencies.rst |
| 59 | + - [coverage.rst, testdox.rst if available] |
| 60 | + - faq.rst |
| 61 | + - [compatibility.rst or version-table.rst if relevant] |
| 62 | + |
| 63 | +## Minimum Required Topics and Content |
| 64 | + |
| 65 | +### index.rst |
| 66 | +- Project summary and positioning in the ecosystem. |
| 67 | +- Useful links (GitHub, Coverage, API Reference, Issue Tracker, Packagist). |
| 68 | +- .. toctree:: with all major sections and maxdepth 2. |
| 69 | + |
| 70 | +### getting-started/ |
| 71 | +- **installation.rst**: Requirements, install command, supported PHP versions, dependency notes, optional dependencies, integration tips. |
| 72 | +- **quickstart.rst**: Minimal working example, with code blocks and output comments. |
| 73 | +- **index.rst**: Overview, key features, and toctree for the section. |
| 74 | + |
| 75 | +### usage/ |
| 76 | +- **getting-services.rst**: How to instantiate or retrieve main classes (direct, via container, via static helpers, etc.). |
| 77 | +- **[one .rst per specialized response/stream]**: Document each response/stream type (HTML, JSON, Text, Empty, Redirect, Stream, etc) with examples, use cases, best practices, and gotchas. |
| 78 | +- **use-cases.rst**: Common and advanced usage scenarios, with code samples for each, including REST, streaming, redirects, error handling, etc. |
| 79 | +- **index.rst**: Section summary and toctree. |
| 80 | + |
| 81 | +### api/ |
| 82 | +- **index.rst**: List and describe all main classes, interfaces, traits, and aliases. |
| 83 | +- One .rst per major class/interface, or group by topic (e.g., responses, payloads, headers, factories, aliases). |
| 84 | +- For each: describe purpose, public API, usage, extension points, gotchas, and static helpers. |
| 85 | +- Use tables or lists to summarize classes/interfaces, their responsibilities, and relationships. |
| 86 | +- Document singleton patterns, aliasing, and extensibility if present. |
| 87 | + |
| 88 | +### advanced/ |
| 89 | +- **integration.rst**: How to integrate with frameworks, containers (PSR-11), or other libraries. Include configuration examples, best practices, and troubleshooting. |
| 90 | +- **aliases.rst**: If the library provides aliases or singleton patterns, document their usage, override, and extensibility. |
| 91 | +- Other advanced topics: extension, middleware, error handling, performance, custom factories, override patterns, static helpers, and advanced troubleshooting. |
| 92 | +- **index.rst**: Section summary and toctree. |
| 93 | + |
| 94 | +### links/ |
| 95 | +- **dependencies.rst**: List all direct and indirect dependencies, with links and short descriptions. Include optional dependencies and integration notes. |
| 96 | +- **coverage.rst**: Link to live coverage and testdox reports if available. |
| 97 | +- **index.rst**: Section summary and toctree. |
| 98 | +- Add links to RFCs, PSRs, and related FastForward packages. |
| 99 | + |
| 100 | +### faq.rst |
| 101 | +- At least 8-12 questions, including installation, usage, integration, troubleshooting, advanced topics, aliases, override/customization, and static helpers. |
| 102 | +- Include troubleshooting tips, best practices, and links to relevant sections. |
| 103 | +- Add questions about version compatibility, container integration, and how to access special features (e.g., ServerRequest, singleton, etc). |
| 104 | + |
| 105 | + |
| 106 | +## Special Cases and Best Practices |
| 107 | +- For HTTP/message libraries, always document PSR-7/PSR-15 compliance, extension points, and specialized responses/streams. |
| 108 | +- For container/config libs, document service/provider registration, autowiring, and aliasing. |
| 109 | +- For middleware, show pipeline usage, error handling, and integration with PSR-15. |
| 110 | +- For all: add version compatibility tables, roadmap/upgrade notes, and highlight optional dependencies. |
| 111 | +- Document singleton patterns, static helpers, and how to override/extend factories or aliases. |
| 112 | +- Use .. code-block:: php for all code samples, with output comments and best practices. |
| 113 | +- Use .. toctree:: in every index.rst for navigation. |
| 114 | +- Cross-link to related packages, RFCs, PSRs, and FastForward ecosystem docs. |
| 115 | +- Use tables for summarizing classes, interfaces, features, and alias mappings. |
| 116 | +- Add a section for extending/customizing the library and for advanced troubleshooting. |
| 117 | +- Always detect and document any special scenario found in the codebase: static methods, singleton, extensibility, aliasing, integration hooks, etc. |
| 118 | + |
| 119 | + |
| 120 | +## Example Toctree for index.rst |
| 121 | + |
| 122 | +.. toctree:: |
| 123 | + :maxdepth: 2 |
| 124 | + :caption: Contents: |
| 125 | + |
| 126 | + getting-started/index |
| 127 | + usage/index |
| 128 | + advanced/index |
| 129 | + api/index |
| 130 | + links/index |
| 131 | + faq |
| 132 | + [compatibility or version-table if present] |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## How to Use This Skill |
| 139 | + |
| 140 | +1. Use as a checklist and template for all new or updated documentation in the Fast Forward PHP framework ecosystem. |
| 141 | +2. When generating docs, always analyze the codebase for: |
| 142 | + - Specialized responses/streams, static helpers, singleton/alias patterns, extensibility points, PSR compliance, and integration hooks. |
| 143 | + - Integration with containers (PSR-11), service providers, and override/customization patterns. |
| 144 | + - Optional dependencies, version compatibility, and advanced troubleshooting scenarios. |
| 145 | +3. Always create or update sections to document any special scenario or advanced feature found in the codebase, mesmo que não esteja presente em outras libs. |
| 146 | +4. Follow the suggested structure, but add extra files/sections as needed to cover all the library's features and unique selling points. |
0 commit comments