docs: fold stocktake rule guidance into common rules

This commit is contained in:
Affaan Mustafa
2026-04-05 15:49:43 -07:00
parent 31afed5b5d
commit adebf3e30b
3 changed files with 71 additions and 0 deletions

View File

@@ -27,3 +27,31 @@ MANDATORY workflow:
## Agent Support
- **tdd-guide** - Use PROACTIVELY for new features, enforces write-tests-first
## Test Structure (AAA Pattern)
Prefer Arrange-Act-Assert structure for tests:
```typescript
test('calculates similarity correctly', () => {
// Arrange
const vector1 = [1, 0, 0]
const vector2 = [0, 1, 0]
// Act
const similarity = calculateCosineSimilarity(vector1, vector2)
// Assert
expect(similarity).toBe(0)
})
```
### Test Naming
Use descriptive names that explain the behavior under test:
```typescript
test('returns empty array when no markets match query', () => {})
test('throws error when API key is missing', () => {})
test('falls back to substring search when Redis is unavailable', () => {})
```