Agent skill
document-business-rule
Generate business rule documentation from domain knowledge and requirements. Use when documenting complex business logic.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/document-business-rule
SKILL.md
Business Rule Documentation Generator
Generate structured documentation for business logic and domain knowledge.
User Request
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
What This Command Does
- Interpret user's natural language request to understand documentation needs
- Research existing codebase for related implementations
- Generate structured business rule documentation
- Save to appropriate location based on project structure
Input Interpretation
Analyze the user's natural language input to intelligently extract:
- Domain/Topic: What business area needs documentation
- Context: Background information, related systems, stakeholders
- Scope: Specific aspects, rules, or processes to focus on
- Output preferences: File location, format preferences if mentioned
Interpretation Guidelines:
- Accept any natural language description - no strict format required
- Infer domain name from context if not explicitly stated
- Ask clarifying questions only when truly ambiguous
- If input is empty, ask user to describe what they want to document
Documentation Structure
Basic Principles
- Concise and clear: Avoid verbose explanations
- With actionable examples: Include code references
- Focus on the "why": Explain reasoning behind rules
Generated Document Template
# [Domain Name]
## Overview
The business area covered by this domain (1-2 sentences)
## Core Concepts
### [Concept Name]
**Definition:** Clear definition
**Example:**
```typescript
// Actual usage example code
```
Code Location: src/domain/concept.ts
Business Rules
[Rule Name]
- Content: Rule description
- Reason: Why this rule is necessary
- Exceptions (if any): Exception scenarios
- Code Location:
src/domain/rules.ts:45-67
Process Flow (Complex cases only)
[Process Name]
- Step 1 →
src/service/step1.ts - Step 2 →
src/service/step2.ts - Step 3 →
src/service/step3.ts
Cautions (if any)
- Common mistake areas
- Things to watch for when making changes
Glossary (if needed)
- Term 1: Definition
- Term 2: Definition
## Output Location
Determine appropriate location:
project-root/ ├── docs/ │ └── domain/ # Primary location for domain docs │ └── {domain-name}.md └── src/ └── {module}/ └── README.md # Alternative: module-specific docs
**Decision logic:**
- If `docs/domain/` exists → use `docs/domain/{domain-name}.md`
- If documenting specific module → use module's `README.md`
- Ask user if unclear
## Execution Steps
1. **Parse Input**: Extract domain info from `$ARGUMENTS`
2. **Research Codebase**:
- Search for related files: `Glob src/**/*{domain}*`
- Find existing documentation: `Glob docs/**/*.md`
- Check for related code patterns: `Grep {domain keywords}`
3. **Generate Document**: Create documentation following template
4. **Write File**: Save to determined location
5. **Report**: Show created file path and summary
## Usage Examples
```bash
# Simple domain name
/document-business-rule user-authentication
# Natural language description
/document-business-rule 주문 처리 로직 문서화해줘. 결제 검증이랑 재고 확인 규칙 포함해서
# Conversational style
/document-business-rule 우리 billing 모듈에 있는 구독 관련 비즈니스 규칙들 정리해줘
# Detailed context
/document-business-rule We need to document the refund policy rules. Customer can request refund within 7 days, partial refunds allowed for digital goods
```
## Important Notes
- This command generates documentation based on user input and codebase analysis
- Review generated content for accuracy before committing
- Update documentation when business rules change
- Keep documentation close to related code
- Use code references (`file:line`) for traceability
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?