
logwork
by fpontejos
SKILL.md
name: logwork description: Manage work log sessions (start/end/status/add)
Logwork
Manage work log sessions. Argument provided: "$ARGUMENTS"
Usage
/logwork # Show current session status (default)
/logwork status # Same as above - show status
/logwork start # Start a new session
/logwork start 14:30 # Start with custom time
/logwork end # End current session
/logwork end 17:00 # End with custom time
/logwork add [note] # Add entry to current session
IMPORTANT: ALWAYS retrieve the current timestamp from the local machine using date '+%Y-%m-%d %H:%M:%S %Z'. NEVER guess or infer timestamps.
Step 0: Parse Arguments
Parse $ARGUMENTS to extract:
- command: first word (
start,end,status,add, or empty) - rest: everything after the command
| Input | Command | Rest |
|---|---|---|
| (empty) | status | (empty) |
status | status | (empty) |
start | start | (empty) |
start 14:30 | start | 14:30 |
end | end | (empty) |
end 17:00 | end | 17:00 |
add Fixed the auth bug | add | Fixed the auth bug |
Configuration
Gap Threshold
The gap threshold determines when a session is considered "stale" and should be closed.
Default: 2 hours
Location: logs/log_index.yaml
config:
gap_threshold_hours: 2
If not set, use default of 2 hours.
Command: status (Default)
Read-only - Shows current session information without modifying anything.
Process
- Read
logs/log_index.yaml - Check if session is active (no
endedkey) - Calculate duration if active
- Display status
Output Format
If session is active:
## Session Status
**Status**: 🟢 Active
**Started**: [timestamp]
**Duration**: [Xh Ym] (ongoing)
**Log file**: logs/[filename].md
**Entries**: [N] logged items
### Recent Entries
- [HH:MM] [entry 1]
- [HH:MM] [entry 2]
### Project Totals
- **Total tracked time**: [Xh Ym]
- **Sessions**: [N]
---
→ `/logwork add [note]` to log work
→ `/logwork end` to close session
If no active session:
## Session Status
**Status**: ⚪ No active session
**Last session**: [date] ([duration])
**Total tracked time**: [Xh Ym] across [N] sessions
---
→ `/logwork start` to begin a new session
If no log data exists:
## Session Status
**Status**: No time tracking data
Run `/logwork start` to begin tracking time.
Command: start
Start a new session.
Process
-
Check for existing active session:
- If active session exists, warn and ask to close it first
- Or offer to close it automatically
-
Determine timestamp:
- Get current system time:
date '+%Y-%m-%d %H:%M:%S %Z' - If time provided (e.g.,
start 14:30):- Parse it (accepts: "14:30", "14:30:00", "2026-01-19 14:30")
- If only time given, use today's date
- Add system timezone
- Ask user to confirm: "Use [parsed timestamp] as start time?"
- If no time: use current system time
- Get current system time:
-
Create log file:
logs/YYYY-MM-DD_NN.md- NN = next sequence number for that date
-
Add frontmatter:
--- title: Work Log started: [timestamp] --- ## Tasks Completed -
Update
logs/log_index.yaml:current: YYYY-MM-DD_NN started: [timestamp] updated: [timestamp] sessions: - YYYY-MM-DD_NN- Remove
endedkey if present
- Remove
Output
## Session Started
**Started**: [timestamp]
**Log file**: logs/[filename].md
Ready to track work. Use:
- `/logwork add [note]` to log completed work
- `/logwork end` when done
Command: end
End the current session.
Process
-
Check for active session:
- If no active session, show error
-
Determine timestamp:
- Same logic as
startfor custom time
- Same logic as
-
Calculate duration:
- From
startedto end timestamp - Format:
Xh Ym
- From
-
Update log file frontmatter:
--- title: Work Log started: [start timestamp] ended: [end timestamp] duration: Xh Ym --- -
Append closing entry:
### [timestamp] 1. [summary of recent work from conversation] 2. Session ended -
Update
logs/log_index.yaml:current: YYYY-MM-DD_NN started: [timestamp] updated: [timestamp] ended: [timestamp] total_duration: Xh Ym # cumulative -
Suggest session title:
- Analyze tasks completed during session
- Generate concise title (5-10 words)
- Ask: "Suggested title: [title] — Use this?"
- If approved, update
titlein frontmatter
Output
## Session Ended
**Duration**: [Xh Ym]
**Started**: [start timestamp]
**Ended**: [end timestamp]
**Title**: [title]
### Session Summary
- [key accomplishment 1]
- [key accomplishment 2]
### Project Totals
- **Total tracked time**: [Xh Ym]
- **Sessions**: [N]
---
→ `/handoff` to prepare git commit
Command: add
Add an entry to the current session without changing session state.
Process
-
Check for active session:
- If no active session, offer to start one first
-
Get timestamp:
date '+%Y-%m-%d %H:%M:%S %Z' -
Parse note:
- Use the rest of the arguments as the note
- If empty, ask: "What did you complete?"
-
Append to log file:
### [timestamp] - [note] -
Update
logs/log_index.yaml:- Set
updatedto current timestamp
- Set
Output
## Entry Added
**Time**: [timestamp]
**Note**: [note]
Session continues. [Xh Ym] elapsed since start.
Quick Add Examples
/logwork add Fixed authentication bug
/logwork add Completed code review for PR #123
/logwork add Refactored database queries
Handling Stale Sessions
When checking session status or adding entries, detect stale sessions.
Detection
A session is stale if:
- Session is active (no
endedkey) - Current time -
updatedtime >gap_threshold_hours(default: 2 hours)
Handling
If stale session detected:
## Stale Session Detected
Last activity was [X] hours ago at [updated timestamp].
Options:
1. **Close and start new** - End previous session, start fresh
2. **Continue existing** - Keep current session, add entry
3. **Just show status** - Take no action
What would you like to do?
If user chooses "Close and start new":
- Close old session with
updatedas end time - Generate closing summary from conversation/log
- Start new session
- Add current work entry
Error Handling
No logs directory
## Setup Required
Logs directory not found.
Run `/onboard-claude` to initialize the workspace, or create manually:
```bash
mkdir -p logs
### No log_index.yaml
No Session Data
No session tracking data found.
Starting fresh. Run /logwork start to begin.
### Attempting to end with no active session
No Active Session
There's no active session to end.
Run /logwork start to begin a new session.
### Attempting to add with no active session
No Active Session
Can't add entry - no active session.
Would you like to start a new session and add this entry?
---
## File Formats
### logs/log_index.yaml
```yaml
current: 2026-01-19_01
started: 2026-01-19 09:30:00 EST
updated: 2026-01-19 11:45:00 EST
# ended: only present when session is closed
total_duration: 45h 30m
sessions:
- 2026-01-15_01
- 2026-01-16_01
- 2026-01-19_01
config:
gap_threshold_hours: 2
logs/YYYY-MM-DD_NN.md
---
title: Implement authentication flow
started: 2026-01-19 09:30:00 EST
ended: 2026-01-19 12:15:00 EST
duration: 2h 45m
---
## Tasks Completed
### 2026-01-19 09:35:00 EST
- Set up JWT token generation
### 2026-01-19 10:20:00 EST
- Implemented login endpoint
- Added password hashing
### 2026-01-19 11:45:00 EST
- Completed refresh token logic
### 2026-01-19 12:15:00 EST
1. Finished authentication module
2. Session ended
Duration Calculations
Format
Always use Xh Ym format:
0h 15m(15 minutes)1h 30m(1 hour 30 minutes)12h 45m(12 hours 45 minutes)
Adding Durations
When updating total_duration:
- Parse existing: "5h 30m" → 330 minutes
- Add new duration: 45 minutes
- Convert back: 375 minutes → "6h 15m"
Examples
Example 1: Check Status
User: /logwork
Claude:
1. Reads log_index.yaml
2. Finds active session started 2h ago
3. Shows status with duration and recent entries
Example 2: Quick Add
User: /logwork add Fixed the login timeout bug
Claude:
1. Checks for active session - found
2. Appends entry with timestamp
3. Updates log_index.yaml
4. Confirms entry added
Example 3: Start with Custom Time
User: /logwork start 09:30
Claude:
1. Parses "09:30" as today at 09:30
2. Asks: "Use 2026-01-19 09:30:00 EST as start time?"
3. User confirms
4. Creates session with that timestamp
Example 4: Stale Session
User: /logwork add Completed the refactor
Claude:
1. Checks for active session - found
2. Detects: last update was 5 hours ago
3. Shows stale session warning
4. User chooses "Close and start new"
5. Closes old session, starts new, adds entry
Skill Chaining
After logwork operations, suggest next actions:
| Situation | Suggestion |
|---|---|
| Session started | "Ready to work. Use /logwork add to track progress" |
| Entry added | "Continue working or /logwork end when done" |
| Session ended | "Run /handoff to prepare git commit" |
| Status shown (active) | "Use /logwork add [note] or /logwork end" |
| Status shown (inactive) | "Run /logwork start to begin tracking" |
Checklist
- Parsed command and arguments
- Retrieved current timestamp from system
- Checked for existing session state
- Handled stale sessions if applicable
- Applied appropriate action (status/start/end/add)
- Updated log file if needed
- Updated log_index.yaml if needed
- Calculated durations correctly
- Suggested next action
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です