The /research command gathers context before you define requirements, ensuring specs are informed by existing patterns and past decisions.
Search accumulated project context, explore codebase patterns, and fetch current information to inform spec creation.
/research <your-query>
# Research existing patterns
/research authentication patterns in this codebase
# Investigate current best practices
/research current best practices for error handling in Express.js 2025
# Understand implementations
/research how pagination is implemented in our API
# Explore architecture
/research database connection pooling strategy
# Find related features
/research user session management and token refresh
When you run /research, Buildforce:
.buildforce/context/_index.yaml for relevant contexts## Research Summary
The codebase uses JWT-based authentication with 15-minute token expiration
and refresh tokens. Implementation follows OAuth2 patterns with bcrypt
password hashing.
## Key Findings
- Authentication middleware in `src/auth/middleware.ts`
- JWT tokens expire after 15 minutes
- Refresh tokens stored in Redis with 7-day TTL
- Password hashing uses bcrypt with salt rounds = 10
## File Paths
| Path | Relevance |
|------|-----------|
| `src/auth/middleware.ts` | JWT validation middleware |
| `src/auth/service.ts` | Authentication business logic |
| `src/auth/tokens.ts` | Token generation and refresh |
## Mermaid Diagram
```mermaid
sequenceDiagram
Client->>API: POST /login
API->>Database: Validate credentials
Database-->>API: User data
API->>API: Generate JWT + Refresh token
API-->>Client: Tokens
## How Research Informs Spec
Research findings stay in conversation context and inform `/spec`:
**Research finds:**
```yaml
key_findings:
- "Authentication uses JWT with 15-minute expiration"
- "Refresh tokens stored in Redis"
Spec references this:
functional_requirements:
- FR1: "Implement OAuth2 login following existing JWT auth pattern"
design_principles:
- "Follow established JWT + refresh token pattern (15min access, 7day refresh)"
# First: Broad exploration
/research authentication in this codebase
# Then: Specific investigation (if needed)
/research JWT token refresh implementation details
Run /research multiple times before /spec:
/research error handling patterns
/research database transaction management
/research API response formatting conventions
# Now define spec with all context loaded
/spec Add user registration endpoint
# Triggers web search for up-to-date information
/research current best practices for React performance 2025
/research modern TypeScript error handling patterns 2025
/document# Gather context first
/research authentication module architecture
# Then document what you learned
/document authentication module
/researchSkip when:
/spec without /research. Even if you think you know the context, running /research often reveals patterns, conventions, or decisions you forgot about.| Traditional Research | Buildforce /research |
|---|---|
| Manual file search | Automated context search |
| Lost in documentation | Structured report |
| Stale StackOverflow | Current best practices |
| Forgotten decisions | Searchable context repository |
| No project history | Accumulated team knowledge |
If you run /research before /spec, Buildforce automatically materializes research findings into a research.yaml file alongside your spec:
.buildforce/specs/add-oauth-login-20250105/
├── research.yaml # ← Research findings materialized
├── spec.yaml # Requirements
└── plan.yaml # Implementation plan
This research.yaml becomes reference material during /build, ensuring implementation stays aligned with researched patterns.
/research searches