Bwat Project Guidelines
Understanding Bwat Rules
Bwat Rules provide a persistent way to establish project-specific or global guidelines that shape Bwat's behavior. These rules serve as system-level instructions that maintain context and preferences across your development workflow.
Creating a Bwat Rule
To establish a new rule:
- Click the + button in the Rules interface
- A new file will open in your IDE for rule creation
- Save the file to activate the rule
Rule storage locations:
- Workspace Rules: .bwatrules/ directory in your project
- Global Rules: Documents/Bwat/Rules directory
Alternatively, use the /newrule
command to have Bwat generate a rule template for you.
# Project Standards
## Documentation Practices
- Synchronize /docs when modifying features
- Maintain current README.md
- Update CHANGELOG.md with significant changes
## Architectural Decisions
Create ADRs in /docs/adr for:
- Major dependency updates
- Architectural pattern changes
- New integration approaches
- Database schema modifications
Use template: /docs/adr/template.md
## Code Conventions
- Generate API clients via OpenAPI Generator
- Implement TypeScript axios template
- Store generated code in /src/generated
- Prefer composition patterns
- Apply repository pattern for data access
- Follow error handling in /src/utils/errors.ts
## Testing Protocols
- Unit tests for business logic
- Integration tests for API endpoints
- E2E tests for critical user journeys
Key Advantages
- Version Control Integration: .bwatrules files become part of your codebase
- Team Alignment: Ensures consistent behavior across all team members
- Project Customization: Tailored guidelines for each project's requirements
- Knowledge Preservation: Maintains project standards in code form
Project structure example:
your-project/
├── .bwatrules
├── src/
├── docs/
└── ...
For prompt engineering best practices, reference this resource.
Effective Rule Writing Tips
- Use clear, unambiguous language
- Focus on desired outcomes rather than specific processes
- Test and refine rules through iteration
.bwatrules/ Directory System
your-project/
├── .bwatrules/ # Active rules directory
│ ├── 01-coding.md # Core coding standards
│ ├── 02-docs.md # Documentation requirements
│ └── current-sprint.md # Sprint-specific guidelines
├── src/
└── ...
Bwat automatically processes all Markdown files within .bwatrules/, combining them into a unified ruleset. Optional numeric prefixes help organize files logically.
Rules Repository System
For projects with multiple contexts:
your-project/
├── .bwatrules/ # Active rules
│ ├── 01-coding.md
│ └── client-x.md
│
├── bwatrules-repo/ # Available rule sets
│ ├── clients/ # Client-specific rules
│ │ ├── client-x.md
│ │ └── client-y.md
│ ├── frameworks/ # Framework standards
│ │ ├── react.md
│ │ └── vue.md
│ └── project-types/ # Project category rules
│ ├── api-service.md
│ └── web-app.md
└── ...
Directory System Benefits
- Context Switching: Copy relevant rules from repository to active folder
- Maintenance: Update individual rule files independently
- Team Flexibility: Members can activate task-specific rules
- Focus: Keep active ruleset relevant and streamlined
Usage Examples
Switch client contexts:
# Activate Client Y rules
rm .bwatrules/client-x.md
cp bwatrules-repo/clients/client-y.md .bwatrules/
Change tech stack:
# Vue project setup
cp bwatrules-repo/frameworks/vue.md .bwatrules/
Implementation Recommendations
- Keep rule files focused on specific domains
- Use descriptive, clear filenames
- Consider git-ignoring active .bwatrules/ while tracking bwatrules-repo/
- Create team scripts for common rule combinations
This flexible system transforms static rules into dynamic knowledge that adapts to your team's evolving needs.
Rule Management Interface
Bwat's dedicated popover UI (introduced in v3.13) simplifies rule management:
Features:
- Active Rules Visibility: View currently active global and workspace rules
- Quick Toggle: Enable/disable specific rule files with one click
- Rule Management: Easily create or modify workspace rules