# Domain Keywords Reference

Curated keyword sets for semantic analysis of terminal recordings.

---

## Trading/Quantitative

Keywords for trading systems, backtesting, and quantitative analysis.

### Performance Metrics

| Keyword   | Description                         |
| --------- | ----------------------------------- |
| `sharpe`  | Sharpe ratio (risk-adjusted return) |
| `sortino` | Sortino ratio (downside risk)       |
| `calmar`  | Calmar ratio (return/max drawdown)  |
| `cagr`    | Compound annual growth rate         |
| `roi`     | Return on investment                |
| `alpha`   | Excess return over benchmark        |
| `beta`    | Market sensitivity                  |

### Risk & Execution

| Keyword      | Description                   |
| ------------ | ----------------------------- |
| `drawdown`   | Peak-to-trough decline        |
| `pnl`        | Profit and loss               |
| `volatility` | Price variation measure       |
| `backtest`   | Historical simulation         |
| `slippage`   | Execution price deviation     |
| `leverage`   | Position amplification factor |

### Search Pattern

```bash
/usr/bin/env bash << 'TRADING_SEARCH_EOF'
KEYWORDS="sharpe sortino calmar backtest drawdown pnl cagr alpha beta roi volatility leverage slippage"
for kw in $KEYWORDS; do
  rg -c -i "$kw" "$INPUT_FILE" 2>/dev/null || echo "0"
done | paste - - | column -t
TRADING_SEARCH_EOF
```

---

## ML/AI

Keywords for machine learning, deep learning, and AI development.

### Training & Evaluation

| Keyword      | Description               |
| ------------ | ------------------------- |
| `epoch`      | Training iteration        |
| `loss`       | Error/cost function value |
| `accuracy`   | Correct prediction rate   |
| `validation` | Held-out evaluation       |
| `training`   | Model fitting phase       |
| `inference`  | Prediction phase          |

### Architecture & Optimization

| Keyword    | Description                 |
| ---------- | --------------------------- |
| `model`    | Neural network architecture |
| `tensor`   | Multi-dimensional array     |
| `gradient` | Derivative for optimization |
| `sota`     | State-of-the-art            |
| `layer`    | Network component           |
| `batch`    | Training data subset        |

### Search Pattern

```bash
/usr/bin/env bash << 'ML_SEARCH_EOF'
KEYWORDS="epoch loss accuracy sota training model validation inference tensor gradient layer batch"
for kw in $KEYWORDS; do
  rg -c -i "$kw" "$INPUT_FILE" 2>/dev/null || echo "0"
done | paste - - | column -t
ML_SEARCH_EOF
```

---

## Development

Keywords for software development workflows and practices.

### Workflow

| Keyword     | Description                |
| ----------- | -------------------------- |
| `iteration` | Development cycle          |
| `refactor`  | Code restructuring         |
| `deploy`    | Production release         |
| `build`     | Compilation/packaging      |
| `commit`    | Version control checkpoint |
| `merge`     | Branch integration         |

### Quality

| Keyword  | Description         |
| -------- | ------------------- |
| `test`   | Verification        |
| `fix`    | Bug resolution      |
| `debug`  | Issue investigation |
| `error`  | Failure condition   |
| `lint`   | Static analysis     |
| `review` | Code inspection     |

### Search Pattern

```bash
/usr/bin/env bash << 'DEV_SEARCH_EOF'
KEYWORDS="iteration refactor fix test deploy build commit merge debug error lint review"
for kw in $KEYWORDS; do
  rg -c -i "$kw" "$INPUT_FILE" 2>/dev/null || echo "0"
done | paste - - | column -t
DEV_SEARCH_EOF
```

---

## Claude Code

Keywords specific to Claude Code sessions.

### Tools

| Keyword     | Description             |
| ----------- | ----------------------- |
| `Skill`     | Skill invocation        |
| `TodoWrite` | Task tracking updates   |
| `Read`      | File reading            |
| `Edit`      | File editing            |
| `Bash`      | Shell command execution |
| `Grep`      | Content search          |
| `Write`     | File creation           |
| `Glob`      | File pattern matching   |

### Session Markers

| Pattern              | Description              |
| -------------------- | ------------------------ |
| `iteration complete` | Completed work iteration |
| `thinking`           | Claude reasoning phase   |
| `tool call`          | Tool invocation          |
| `AskUserQuestion`    | User interaction         |

### Search Pattern

```bash
/usr/bin/env bash << 'CLAUDE_SEARCH_EOF'
# Case-sensitive for tool names
TOOLS="Skill TodoWrite Read Edit Bash Grep Write Glob"
for tool in $TOOLS; do
  COUNT=$(rg -c "$tool" "$INPUT_FILE" 2>/dev/null || echo "0")
  echo "$tool: $COUNT"
done

# Pattern matching
echo ""
echo "Patterns:"
rg -c "iteration complete" "$INPUT_FILE" 2>/dev/null || echo "0"
rg -c "AskUserQuestion" "$INPUT_FILE" 2>/dev/null || echo "0"
CLAUDE_SEARCH_EOF
```

---

## Custom Keywords

Add project-specific keywords by extending these patterns:

```bash
/usr/bin/env bash << 'CUSTOM_SEARCH_EOF'
# Define custom keywords
CUSTOM="myproject myfunction myclass"

for kw in $CUSTOM; do
  COUNT=$(rg -c -i "$kw" "$INPUT_FILE" 2>/dev/null || echo "0")
  echo "$kw: $COUNT"
done
CUSTOM_SEARCH_EOF
```

---

## Combining Domains

For comprehensive analysis, search multiple domains:

```bash
/usr/bin/env bash << 'COMBINED_SEARCH_EOF'
# All domains
echo "=== Trading ===" && rg -c -i "sharpe\|sortino\|backtest" "$INPUT_FILE"
echo "=== ML/AI ===" && rg -c -i "epoch\|loss\|training" "$INPUT_FILE"
echo "=== Dev ===" && rg -c -i "iteration\|commit\|deploy" "$INPUT_FILE"
echo "=== Claude ===" && rg -c "TodoWrite\|Skill\|Edit" "$INPUT_FILE"
COMBINED_SEARCH_EOF
```
