بنقرة واحدة
arib-docs-generate
Docs | Generate documentation - analyze target, extract interfaces, create docs, commit
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Docs | Generate documentation - analyze target, extract interfaces, create docs, commit
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Memory | Code-graph subsystem — a native lightweight IMPORT graph (which file imports which, god-node candidates) built with ripgrep/grep, so a large monorepo can be navigated by structure instead of re-grepping every session. build/refresh/query. Honest scope: structural import graph, NOT semantic (no call-graph/type resolution); no Graphify dependency. Loads ON DEMAND only (zero always-on tokens). ADR-034.
Dev | Over-engineering review — reads a diff/module and returns a delete-list of bloat (single-use abstractions, premature generalization, speculative config, dead options) WITHOUT stripping legitimate structure. Advisory: returns recommendations, never auto-deletes. The on-demand companion to the ponytail-lite tripwire hook. Authored natively (no Ponytail dependency). ADR-033.
Wave | Pre-wave requirement lock — Act 1 derives the requirements from the codebase + memory (an honest grill, not guesswork), Act 2 hands the locked plan to an independent model (Codex) to tear apart until sign-off. Produces waves/<id>/PLAN.md + PLAN-REVIEW-LOG.md. Auto-chained idempotently from /arib-wave-start. If Act 2 can't run (no Codex), the wave proceeds but HOLDS MERGE for a human. Absorbs grill-me-codex (ADR-032).
Wave | Start a multi-session delivery wave — branch, plan, parallel architect+planner
Engine | Command the engineering team to deliver a known goal — dispatches the engineer-manager to decompose → dispatch specialists (parallel where safe) → integrate → reconcile (verification-agent) → merge gate. Scales its own reach: runs inline for a bounded goal, escalates to a parallel Workflow for a broad one, and paces under /loop for a multi-turn campaign — only when it needs to. Use when a goal needs a coordinated TEAM, not one specialist. Sibling of /arib-engine: the engine DISCOVERS its own backlog; /arib-build EXECUTES a goal you hand it.
Stack | NestJS architecture & patterns reference — modules/providers/DI, DTO+validation, guards/interceptors/pipes/filters, config, async lifecycle, testing, and the security + performance pitfalls that bite at scale. Use when building or reviewing a NestJS backend. Composes with security-auditor (OWASP), database-guardian (TypeORM/Prisma migrations), and performance (N+1). Authored natively (the ECC graft was unsourceable; this is CCM's own, MIT).
| name | arib-docs-generate |
| argument-hint | <target> |
| description | Docs | Generate documentation - analyze target, extract interfaces, create docs, commit |
Generate or update comprehensive documentation ensuring consistency and clarity across the project.
User types /arib-docs-generate [target]
Examples:
/arib-docs-generate UserService/arib-docs-generate API/arib-docs-generate database-schema/arib-docs-generate deployment-processDetermine what needs documenting:
Function/Method Documentation:
Module/Class Documentation:
API Documentation:
Architecture Documentation:
Process Documentation:
Before writing new docs:
DOCUMENTATION_STYLE.md (if exists) for project conventionsCollect information about the target:
Create documentation following project conventions:
For Functions (JSDoc style):
/**
* Brief description of what the function does.
*
* Longer description explaining the purpose, behavior, and any important
* context about this function.
*
* @param {Type} paramName - Description of parameter
* @param {Type} anotherParam - Description of another parameter
* @returns {Type} Description of what is returned
* @throws {ErrorType} Description of when this error is thrown
*
* @example
* const result = functionName(param1, param2);
* // Result: expected output
*/
For APIs (Markdown style):
## GET /api/users/:id
Retrieve user information by ID.
### Parameters
- `id` (string, required): User ID
### Response
- **200 OK**: Returns user object
- **404 Not Found**: User not found
- **401 Unauthorized**: Authentication required
### Example
For Modules (Markdown style):
# UserService
## Purpose (per documentation target)
Handles all user-related business logic and data operations.
## Public API
- `createUser(data)` - Creates new user
- `getUser(id)` - Retrieves user by ID
- `updateUser(id, data)` - Updates user
## Usage Example
After documenting the target, update:
Separate documentation commits from code changes:
git add docs/ [documentation files]
git commit -m "Docs: Add documentation for [target]
Documented:
- [What was documented]
- [What was explained]
Related files:
- [Path to documented component/function]"
Before considering documentation complete, verify:
Provide a summary of documentation completed:
Documentation Complete: [target]
Added/Updated:
- [File path]: [What was documented]
- [File path]: [What was documented]
Coverage:
- [Component X]: Fully documented
- [Component Y]: Updated with examples
Ready for: [PR/Merge/Review]
User/reader needs to:
├─ Understand what a function/method does?
│ ├─ Single function → JSDoc/docstring (inline)
│ ├─ Multiple functions → Docstring + API table in module README
│ └─ Complex logic → Docstring + architecture doc
├─ Know how to use a class/module?
│ ├─ Simple public API → JSDoc for class + methods
│ ├─ Multiple features → README in module folder
│ └─ Complex workflow → Architecture + tutorials
├─ Set up a new feature/component?
│ └─ Feature README + examples + FAQs
├─ Understand system design?
│ ├─ One component → Component architecture doc
│ ├─ Multiple components → System architecture + diagrams
│ └─ Data model → Schema docs + migrations guide
├─ Deploy or configure?
│ └─ Deployment/Operations guide
└─ Run tests or contribute?
└─ CONTRIBUTING.md + testing guide
/**
* Brief one-line description.
*
* Longer description explaining the purpose, behavior, important context,
* and any caveats. Mention what this function does and why it exists.
*
* @param {Type} paramName - Description of parameter. Include constraints:
* - "required", "optional", "nullable"
* - Valid values or ranges
* - Default value if applicable
* @param {Object} options - Configuration object
* @param {boolean} options.verbose - Enable debug output (default: false)
* @param {number} [options.timeout=3000] - Request timeout in ms
*
* @returns {Promise<Type>} Description of return value
* @returns {string} Resolves with the user ID on success
*
* @throws {TypeError} If paramName is not a string
* @throws {ValidationError} If paramName fails validation
* @throws {TimeoutError} If options.timeout exceeded
*
* @example
* const result = await functionName("alice", { verbose: true });
* console.log(result); // "user-123"
*
* @see relatedFunction() - See this for alternative approach
* @see {@link https://example.com/docs} - External reference
*
* @deprecated Since v2.0. Use newFunction() instead.
*/
async function functionName(paramName, options = {}) {
// implementation
}
def function_name(param_name: str, options: Optional[dict] = None) -> str:
"""Brief one-line description.
Longer description explaining the purpose, behavior, important context,
and any caveats. Mention what this function does and why it exists.
Args:
param_name (str): Description of parameter. Include constraints:
- Valid values
- Default value if applicable
options (dict, optional): Configuration object. Defaults to None.
- verbose (bool): Enable debug output. Defaults to False.
- timeout (int): Request timeout in ms. Defaults to 3000.
Returns:
str: Description of return value. Example: "The user ID on success"
Raises:
TypeError: If param_name is not a string.
ValidationError: If param_name fails validation.
TimeoutError: If timeout exceeded.
Example:
>>> result = function_name("alice", {"verbose": True})
>>> print(result)
user-123
See Also:
related_function(): Alternative approach
https://example.com/docs: External reference
Deprecated:
Since v2.0. Use new_function() instead.
"""
pass
// FunctionName describes what the function does in one sentence.
//
// Longer description explaining the purpose, behavior, and important context.
// Mention what this function does and why it exists. Describe any important
// behavior or side effects.
//
// Parameters:
// - paramName: Description. Include constraints: valid values, required/optional, defaults.
// - options: Configuration struct with these fields:
// - Verbose: Enable debug output (default: false)
// - Timeout: Request timeout in milliseconds (default: 3000)
//
// Returns:
// - result: The result on success
// - error: Non-nil error if validation failed, timeout exceeded, etc.
//
// Example:
//
// result, err := FunctionName("alice", Options{Verbose: true})
// if err != nil {
// log.Fatal(err)
// }
// fmt.Println(result) // user-123
//
// See Also:
// - RelatedFunction: Alternative approach
// - https://example.com/docs: External reference
//
// Deprecated: Since v2.0. Use NewFunction instead.
func FunctionName(paramName string, options Options) (string, error) {
// implementation
}
# [Module Name]
Brief description: what does this module do, why exist, who uses it.
## Features
- Feature 1
- Feature 2
- Feature 3
## Installation/Setup
Step-by-step instructions to use this module.
## Quick Start
Minimal example to get working immediately.
## API Reference
### FunctionName(params)
Description. Parameters. Returns. Throws.
### ClassName
Description. Constructor. Public methods.
## Usage Examples
1. Common case: Code example + expected output
2. Advanced case: Code example + expected output
3. Error handling: Code example + how to handle errors
## Configuration
What can be configured, defaults, constraints.
## Performance Considerations
- Complexity/speed notes
- Memory usage notes
- When to use vs when to avoid
## Troubleshooting
Common issues and solutions.
## Related
- Link to other modules
- Link to tutorials
- Link to reference docs
# [API Name] API
Description: what endpoints, what operations, what data.
## Authentication
How to authenticate. API keys, tokens, OAuth, etc.
## Endpoints
### GET /resource
Retrieve resource(s).
**Parameters:**
- param1 (string, required): Description
**Response:**
- 200 OK: Returns array of resources
- 404 Not Found: Resource not found
- 401 Unauthorized: Missing or invalid auth
**Example:**
GET /api/users/123 Response: { "id": "123", "name": "Alice" }
## Error Handling
Error codes, error format, how to handle each error type.
## Rate Limiting
If applicable: limits, reset time, headers.
## Webhooks (if applicable)
What webhooks are available, payload structure, how to handle.
## Examples
Complete working examples (cURL, JavaScript, Python).
## SDK Reference
If SDK exists, link to SDK docs.
# [System/Component] Architecture
## Overview
High-level purpose. Problem it solves. Key design decisions.
## Architecture Diagram
[ASCII diagram or link to Figma/Draw.io]
Components:
## Components
### Component A
**Purpose:** What does this component do?
**Responsibility:** What are its specific duties?
**Dependencies:** What does it depend on?
**Data:** What data does it own?
### Component B
...
## Data Flow
Describe how data moves through the system:
1. User action
2. Data validation
3. Processing
4. Persistence
5. Response
Include sequence diagram or flow chart.
## Technology Choices
| Choice | Alternatives | Why Chosen | Trade-offs |
|--------|--------------|-----------|-----------|
| [Tech A] | [Alt 1], [Alt 2] | [Reason] | [Cost/limitation] |
## Scalability Considerations
- How does this scale with data size?
- How does this scale with user count?
- Bottlenecks and solutions?
- Future growth plans?
## Security Considerations
- Authentication/authorization
- Data protection
- Input validation
- Known vulnerabilities
## Testing Strategy
- Unit test approach
- Integration test approach
- E2E test approach
- Performance test approach
## Deployment
- How is this deployed?
- Staging vs. production differences?
- Rollback procedure?
- Monitoring and alerts?
## Future Improvements
- Known limitations
- Planned enhancements
- Research needed
Before marking documentation complete, verify:
When documentation references other docs, verify:
| Mistake | Example | Fix |
|---|---|---|
| Incomplete params | No mention of optional params | Document all params, mark optional, provide defaults |
| Wrong example | Docs show POST, code actually GET | Test examples by running them |
| Outdated reference | Docs link to deleted API endpoint | Search repo for references, update all |
| Missing error docs | Doesn't mention ValidationError thrown | Document every error type with when thrown |
| Unclear usage | "Pass an options object" without structure | Show actual structure: { key: value } |
| No defaults | Docs say "optional timeout" without default | State: "default: 3000ms" |
| Version mismatch | Docs say method signature different from code | Keep docs and code in sync, update immediately |
| Broken links | Links to /docs/foo that doesn't exist | Test all links before committing |
| Duplicate docs | Same info in README and JSDoc | Pick one source of truth, reference from other |
/arib-docs-api - Generate API documentation/arib-docs-language - Check i18n compliancereview - Review documentation in PRssecurity-review - Audit docs for security issues