# Task Logging Protocol (MANDATORY)

You (Claude Code) MUST log every task you perform in this project to a daily
markdown log file. This applies to coding, debugging, refactoring, config
changes, deployments — anything the user asks you to do in this repo.

## Log file location & naming

- Folder: `dailytasklogs/<developer>/`
- File: `dailytasklogs/<developer>/YYYY-MM-DD.md` (one file per dev, per calendar day, IST)
- `<developer>` = the current git branch name, lowercased, since each dev
  pushes to their own branch (e.g. branch `Ashish` or `ashish-dev` → folder
  `dailytasklogs/ashish/`). Get it by running `git branch --show-current`.
  - If the branch name doesn't clearly map to a person (e.g. `main`,
    `feature/xyz`), fall back to `git config user.name` instead.
- Create the folder/file if it doesn't exist yet.
- Append new entries to the bottom of today's file. Never overwrite past entries.

## Before starting ANY task

1. Run `git branch --show-current` (or `git config user.name` as fallback)
   once per session to resolve `<developer>`, and reuse it for the rest of
   the session — don't re-run this every task.
2. Run `date "+%Y-%m-%d %H:%M:%S"` in the shell to get the real start time.
   Do not guess or estimate the time.
3. Append a new entry header to today's log file with status "IN PROGRESS".

## After finishing the task

1. Run `date "+%Y-%m-%d %H:%M:%S"` again to get the real end time.
2. Update that same entry: set status to DONE (or BLOCKED/PARTIAL if
   applicable), fill in end time, duration, files changed, and a 1-3 line
   summary of what was actually done.

## Entry format (use this exact structure)

```markdown
### [HH:MM:SS] Task: <short task title>

- **Developer:** <git config user.name, or ask once and reuse>
- **Start:** YYYY-MM-DD HH:MM:SS
- **End:** YYYY-MM-DD HH:MM:SS
- **Duration:** Xh Ym
- **Status:** DONE | BLOCKED | PARTIAL | IN PROGRESS
- **Files changed:** path/one.php, path/two.jsx
- **Summary:** What was done, in 1-3 plain-English lines. Mention *why* if
  it's not obvious (bug fix, new feature, refactor, client request).
- **Notes/Blockers:** Anything relevant (optional)

---
```

## Rules

- One entry per distinct task. If the user asks for 3 unrelated things in one
  message, create 3 separate entries.
- Never skip logging because a task seems small. A one-line fix still gets
  an entry (duration can be a few minutes).
- The `<developer>` folder name and the **Developer:** field in each entry
  should match (both derived from the branch/git config resolved above).
- Keep summaries factual and specific — not "worked on frontend" but
  "fixed mobile nav overflow on product listing page (Aureleo UI)".
- If a task spans a break (e.g. paused for hours), still record actual
  start/end wall-clock time — don't round it into one clean block.
- Do not ask the user for permission to log — logging is automatic and silent
  unless the log file itself can't be written, in which case flag it.

## Example entry

File: `dailytasklogs/ashish/2026-07-13.md`

```markdown
### [10:14:02] Task: Fix 500 error on gold price API endpoint

- **Developer:** Ashish
- **Start:** 2026-07-13 10:14:02
- **End:** 2026-07-13 10:47:51
- **Duration:** 0h 34m
- **Status:** DONE
- **Files changed:** app/Http/Controllers/GoldPriceController.php, routes/api.php
- **Summary:** Endpoint was throwing 500 due to missing null check when
  external gold rate API timed out. Added try/catch with cached fallback rate.
- **Notes/Blockers:** None

---
```
