Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .claude/agents/debugger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
name: debugger
description: Investigates runtime errors, reads stack traces, and suggests targeted fixes
tools: Read, Grep, Glob, Bash
model: sonnet
color: red
---

# Debugger Agent

You are a focused runtime debugger. Your job is to diagnose errors quickly from stack traces, logs, and reproduction steps, then propose a minimal, well-justified fix. You do **not** apply fixes — you investigate and recommend.

## When You Are Invoked

You will typically receive one or more of:
- A stack trace, exception message, or error log
- A failing command (test, server start, script) to reproduce
- A description of unexpected runtime behavior

Treat the trace as the primary evidence. Read it top-to-bottom and identify the deepest frame in *project code* (not library internals) — that's usually where the bug lives.

## Investigation Process

1. **Parse the stack trace**
- Identify the exception type and message
- Find the first project-owned frame (skip framework/library frames unless they're the obvious culprit)
- Note line numbers and file paths — use `file_path:line_number` format in your report

2. **Read the implicated code**
- Use `Read` to inspect the failing function and its callers
- Use `Grep` to find related call sites, definitions, and similar patterns
- Use `Glob` to discover related files (tests, fixtures, configs)

3. **Reproduce if possible**
- Use `Bash` to re-run the failing command and capture fresh output
- For Python work in this repo, activate the venv first:
```bash
source "/Users/mamitaso/SFC-CNS Dropbox/Mami Okura/BaseCamp_CC/inventory-management/server/.venv/bin/activate"
```
- Check logs, environment, and recent git history (`git log -n 5 --oneline -- <file>`) for clues

4. **Form a hypothesis**
- State *what* is wrong and *why* it produces this trace
- Distinguish symptom from root cause
- Confirm by re-reading code or running a targeted check (e.g., `python -c "..."`, a single pytest case)

5. **Recommend a fix**
- Smallest change that addresses the root cause
- Call out side effects or related call sites that may need the same fix
- Suggest a regression test if one is missing

## Common Bug Categories To Check

- **`AttributeError` / `TypeError`** — wrong type passed, `None` where object expected, missing field after data-model change
- **`KeyError` / `IndexError`** — missing dict key, empty list, off-by-one
- **Pydantic `ValidationError`** — JSON shape drifted from the model (see `server/mock_data.py` and `server/data/*.json`)
- **Vue reactivity issues** — mutating a non-reactive object, missing `.value` on a ref, derived state placed in a ref instead of `computed`
- **HTTP 4xx/5xx** — query-param parsing, missing filter handling, mismatched route
- **Async/await** — unawaited coroutine, mixing sync and async, event-loop blocking

## Report Format

```markdown
# Debug Report: [Short summary of the error]

**Error**: `<ExceptionType: message>`
**Location**: `path/to/file.py:42` (deepest project frame)
**Reproduced**: ✅ Yes / ❌ No / ⏭ Skipped

## Root Cause
[One paragraph: what the code does, why it fails, what assumption is violated]

## Evidence
- `path/to/file.py:42` — [what this line does and why it's wrong]
- `path/to/other.py:17` — [related call site / contributing factor]
- (commands run, key output snippets)

## Recommended Fix
[Specific change, ideally a minimal diff sketch]

```python
# before
foo[key]
# after
foo.get(key, default)
```

## Related Risks
- [Other call sites that share the bug]
- [Missing test that would have caught this]
```

## Key Rules

- **Evidence-first** — quote the actual trace and file contents; don't speculate without reading the code
- **Find the root cause, not just the symptom** — wrapping in try/except is rarely the answer
- **Stay minimal** — propose the smallest fix that holds; flag larger refactors as follow-ups
- **Don't apply changes** — you investigate and recommend; the caller decides and edits
- **Be specific** — `file:line` references, concrete commands, exact error strings
5 changes: 5 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"enabledPlugins": {
"epcc-workflow@aws-claude-code-plugins": true
}
}
264 changes: 264 additions & 0 deletions .claude/skills/vue-optimize/SKILL.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.6.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0",
"axios": "^1.6.7"
"vue-router": "^4.3.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"prettier": "^3.8.3",
"vite": "^5.2.0"
}
}
3 changes: 3 additions & 0 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<router-link to="/demand" :class="{ active: $route.path === '/demand' }">
{{ t('nav.demandForecast') }}
</router-link>
<router-link to="/restocking" :class="{ active: $route.path === '/restocking' }">
{{ t('nav.restocking') }}
</router-link>
<router-link to="/reports" :class="{ active: $route.path === '/reports' }">
Reports
</router-link>
Expand Down
10 changes: 10 additions & 0 deletions client/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,15 @@ export const api = {
async getPurchaseOrderByBacklogItem(backlogItemId) {
const response = await axios.get(`${API_BASE_URL}/purchase-orders/${backlogItemId}`)
return response.data
},

async getSubmittedOrders() {
const response = await axios.get(`${API_BASE_URL}/submitted-orders`)
return response.data
},

async createSubmittedOrder(payload) {
const response = await axios.post(`${API_BASE_URL}/submitted-orders`, payload)
return response.data
}
}
39 changes: 39 additions & 0 deletions client/src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
orders: 'Orders',
finance: 'Finance',
demandForecast: 'Demand Forecast',
restocking: 'Restocking',
companyName: 'Catalyst Components',
subtitle: 'Inventory Management System'
},
Expand Down Expand Up @@ -106,6 +107,10 @@ export default {
title: 'Orders',
description: 'View and manage customer orders',
allOrders: 'All Orders',
submittedSection: 'Submitted Orders',
submittedDate: 'Submitted',
leadTime: 'Lead Time',
leadTimeDays: '{days} days',
totalOrders: 'Total Orders',
totalRevenue: 'Total Revenue',
avgOrderValue: 'Avg Order Value',
Expand All @@ -129,6 +134,40 @@ export default {
}
},

// Restocking
restocking: {
title: 'Restocking',
description: 'Set a budget and submit a restocking order built from inventory shortfalls and forecasted demand.',
budgetCard: {
title: 'Available Budget',
help: 'Move the slider to set how much you want to spend. Items are auto-selected by priority.',
selected: 'Selected total',
itemsSelected: '{count} items selected',
utilization: 'Budget used',
noCandidates: 'No items below their reorder point. Lower thresholds or restock later.'
},
table: {
title: 'Recommended Items',
sku: 'SKU',
name: 'Item',
warehouse: 'Warehouse',
currentStock: 'On Hand',
reorderPoint: 'Reorder Point',
trending: 'Trending',
qty: 'Restock Qty',
unitCost: 'Unit Cost',
subtotal: 'Subtotal',
leadTime: 'Lead Time'
},
trendingBadge: 'Trending',
skippedLabel: 'Over budget',
placeOrder: 'Place Order',
placing: 'Placing order...',
successToast: 'Order {orderNumber} submitted. Expected by {expected}.',
errorToast: 'Could not submit order. Please try again.',
viewInOrders: 'View in Orders'
},

// Finance/Spending
finance: {
title: 'Finance Dashboard',
Expand Down
39 changes: 39 additions & 0 deletions client/src/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
orders: '注文',
finance: '財務',
demandForecast: '需要予測',
restocking: '補充発注',
companyName: '触媒コンポーネンツ',
subtitle: '在庫管理システム'
},
Expand Down Expand Up @@ -106,6 +107,10 @@ export default {
title: '注文',
description: '顧客注文の表示と管理',
allOrders: 'すべての注文',
submittedSection: '送信済み発注',
submittedDate: '送信日',
leadTime: 'リードタイム',
leadTimeDays: '{days}日',
totalOrders: '総注文数',
totalRevenue: '総収益',
avgOrderValue: '平均注文額',
Expand All @@ -129,6 +134,40 @@ export default {
}
},

// Restocking
restocking: {
title: '補充発注',
description: '予算を設定し、在庫不足と需要予測に基づいた補充注文を送信します。',
budgetCard: {
title: '利用可能予算',
help: 'スライダーで予算を設定すると、優先度の高い品目から自動で選択されます。',
selected: '選択合計',
itemsSelected: '{count}件選択中',
utilization: '予算使用率',
noCandidates: '再注文点を下回る品目はありません。後で再度ご確認ください。'
},
table: {
title: '推奨品目',
sku: 'SKU',
name: '品目',
warehouse: '倉庫',
currentStock: '手持在庫',
reorderPoint: '再注文点',
trending: 'トレンド',
qty: '補充数量',
unitCost: '単価',
subtotal: '小計',
leadTime: 'リードタイム'
},
trendingBadge: '需要増',
skippedLabel: '予算超過',
placeOrder: '発注する',
placing: '送信中...',
successToast: '注文 {orderNumber} を送信しました。納期予定: {expected}',
errorToast: '発注に失敗しました。再度お試しください。',
viewInOrders: '注文タブで確認'
},

// Finance/Spending
finance: {
title: '財務ダッシュボード',
Expand Down
2 changes: 2 additions & 0 deletions client/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Dashboard from './views/Dashboard.vue'
import Inventory from './views/Inventory.vue'
import Orders from './views/Orders.vue'
import Demand from './views/Demand.vue'
import Restocking from './views/Restocking.vue'
import Spending from './views/Spending.vue'
import Reports from './views/Reports.vue'

Expand All @@ -15,6 +16,7 @@ const router = createRouter({
{ path: '/inventory', component: Inventory },
{ path: '/orders', component: Orders },
{ path: '/demand', component: Demand },
{ path: '/restocking', component: Restocking },
{ path: '/spending', component: Spending },
{ path: '/reports', component: Reports }
]
Expand Down
Loading