xiaohongshu
xiaohongshu
extract-business-rules
Extract business rules (BR-*) from requirements - validation rules, business logic, error handling, and decision criteria. Use when disambiguating requirements to identify specific rules that can be autogenerated into validators and logic.
Full skill instructions
Skill Type: Actuator (Requirements Disambiguation) Purpose: Extract BR-* business rules from REQ-* requirements Prerequisites: REQ-* requirement exists
You are extracting business rules (BR-*) from requirements.
Business rules are:
Goal: Identify rules precise enough for code autogeneration.
Format validation:
BR-001: Email validation
- Format: regex ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
- Error: "Invalid email format"
- Autogenerate: validate_email(email) -> Optional[str]
Range validation:
BR-010: Age validation
- Minimum: 18
- Maximum: 120
- Error: "Age must be between 18 and 120"
- Autogenerate: validate_age(age) -> Optional[str]
Enum validation:
BR-020: Card type validation
- Allowed: ["Visa", "Mastercard", "Amex"]
- Error: "Card type not supported"
- Autogenerate: validate_card_type(type) -> Optional[str]
State machines:
BR-030: Account lockout logic
- Max attempts: 3
- Lockout duration: 15 minutes
- Reset on success: Yes
- States: active, locked, expired
- Autogenerate: LockoutStateMachine class
Decision rules:
BR-040: Refund eligibility
- Condition: purchase_date within 30 days AND product not digital
- Result: eligible or not_eligible
- Error: "Refunds only available within 30 days for physical products"
- Autogenerate: is_refund_eligible() -> bool
BR-050: Error message format
- Template: "{field} {error_type}. {help_text}"
- Example: "Email invalid email format. Use format: [email protected]"
- Autogenerate: format_error_message() function
BR-060: Email normalization
- Transform: Convert to lowercase
- Trim: Remove leading/trailing whitespace
- Validate: After transformation
- Autogenerate: normalize_email(email) -> str
Read requirement and identify rule candidates:
Template:
BR-{ID}: {Rule Name}
- Description: {What this rule does}
- Specification: {Precise spec - regex, range, formula}
- Error Message: "{User-facing error message}"
- Autogenerate: {Yes/No - can code be auto-generated?}
- Dependencies: {Other BR-* this depends on}
Example:
BR-001: Email validation
- Description: Validate email address format
- Specification: regex ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
- Error Message: "Invalid email format"
- Autogenerate: Yes
- Dependencies: None
BR-002: Password length validation
- Description: Ensure password meets minimum length
- Specification: len(password) >= 12
- Error Message: "Password must be at least 12 characters"
- Autogenerate: Yes
- Dependencies: None
BR-003: Password complexity validation
- Description: Ensure password has required character types
- Specification:
has_uppercase: password contains [A-Z]
has_lowercase: password contains [a-Z]
has_number: password contains [0-9]
has_special: password contains [!@#$%^&*]
- Error Message: "Password must contain uppercase, lowercase, number, and special character"
- Autogenerate: Yes
- Dependencies: BR-002 (length must be checked first)
Rules:
Example:
<REQ-ID>:
- BR-001: Email validation
- BR-002: Password length
- BR-003: Password complexity
- BR-004: Email case handling
- BR-005: Account lockout
[EXTRACT BUSINESS RULES - <REQ-ID>]
Requirement: User login with email and password
Business Rules Extracted:
Validation Rules (4):
✓ BR-001: Email validation (regex pattern)
✓ BR-002: Password minimum length (12 chars)
✓ BR-003: Password complexity (uppercase, lowercase, number, special)
✓ BR-004: Email case sensitivity (lowercase normalization)
Business Logic (1):
✓ BR-005: Account lockout (3 attempts, 15min duration)
Total: 5 business rules
Autogeneration Ready:
✓ BR-001 → validate_email()
✓ BR-002 → validate_password_length()
✓ BR-003 → validate_password_complexity()
✓ BR-004 → normalize_email()
✓ BR-005 → LockoutTracker class
Updated: docs/requirements/authentication.md
Added: Business Rules section with 5 BR-*
✅ Business Rules Extraction Complete!
Good BR- characteristics*:
BR- vs Requirements*:
Requirement (REQ-*): High-level capability
"User can log in with email and password"
Business Rules (BR-*): Low-level specifications
BR-001: Email regex pattern
BR-002: Password min 12 chars
BR-003: Lockout after 3 attempts
Homeostasis Goal:
desired_state:
all_requirements_have_business_rules: true
all_br_autogenerable: true
"Excellence or nothing" 🔥
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience