Skip to content

Commit a363641

Browse files
authored
Merge pull request #2 from RemoteCTO/default-report
Default report + contribution guidelines
2 parents fa5ade1 + bf7d157 commit a363641

15 files changed

Lines changed: 582 additions & 84 deletions

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "timelog",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Automatic time tracking for Claude Code sessions. Logs project, ticket, and prompt data as JSONL for timesheet reconstruction.",
55
"license": "Apache-2.0",
66
"keywords": [
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in claude-code-timelog
4+
labels: bug
5+
---
6+
7+
## Describe the Bug
8+
9+
A clear description of what the bug is.
10+
11+
## Steps to Reproduce
12+
13+
1. Step one
14+
2. Step two
15+
3. Step three
16+
17+
## Expected Behaviour
18+
19+
What you expected to happen.
20+
21+
## Environment
22+
23+
- OS: [e.g., macOS 14.2, Ubuntu 22.04]
24+
- Node.js version: [e.g., 18.19.0, 22.0.0]
25+
- Claude Code version: [e.g., 1.0.33]
26+
- Plugin version: [e.g., 0.3.0]
27+
28+
## Logs
29+
30+
If applicable, include:
31+
32+
- Report output or error messages
33+
- Contents of `~/.claude/timelog/` (redact
34+
any sensitive prompt text)
35+
36+
```
37+
Paste logs here
38+
```
39+
40+
## Additional Context
41+
42+
Any other context about the problem.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature for claude-code-timelog
4+
labels: enhancement
5+
---
6+
7+
## Problem Description
8+
9+
Describe the problem this feature would solve.
10+
What are you trying to accomplish?
11+
12+
## Proposed Solution
13+
14+
Describe your proposed solution. How would
15+
this feature work?
16+
17+
## Alternatives Considered
18+
19+
What alternative solutions or workarounds
20+
have you considered?
21+
22+
## Additional Context
23+
24+
Any other context, screenshots, or examples.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Description
2+
3+
Describe the changes in this pull request.
4+
5+
## Checklist
6+
7+
- [ ] Description of changes provided above
8+
- [ ] Tests added or updated for new behaviour
9+
- [ ] `npm test` passes
10+
- [ ] `npm run lint` passes
11+
- [ ] `CHANGELOG.md` updated under `[Unreleased]`
12+
- [ ] Documentation updated if needed (README)
13+
14+
## Related Issues
15+
16+
Fixes #(issue number)

CHANGELOG.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Changelog
2+
3+
All notable changes to claude-code-timelog are
4+
documented here. Format follows
5+
[Keep a Changelog][kac].
6+
7+
[kac]: https://keepachangelog.com/en/1.1.0/
8+
9+
## [Unreleased]
10+
11+
### Added
12+
13+
- Default report: `claudelog` with no arguments
14+
runs a weekly report instead of printing usage.
15+
Configurable via `defaultReport` in config.json.
16+
- `CONTRIBUTING.md` with setup, code style,
17+
testing, and submission guidelines.
18+
- `SECURITY.md` with vulnerability reporting
19+
instructions.
20+
- Issue templates for bug reports and feature
21+
requests.
22+
- Pull request template with checklist.
23+
- `CHANGELOG.md` (this file).
24+
25+
## [0.2.0] — 2026-02-12
26+
27+
### Added
28+
29+
- `claudelog` CLI command for running reports
30+
and backfills from any terminal without an
31+
active Claude Code session.
32+
- `bin` field in package.json.
33+
34+
## [0.1.0] — 2026-02-11
35+
36+
Initial release.
37+
38+
### Added
39+
40+
- Automatic time tracking via Claude Code hooks
41+
(SessionStart, UserPromptSubmit, Stop).
42+
- JSONL log files (one per day) with session,
43+
project, ticket, and prompt data.
44+
- Report generation with multiple views:
45+
default (day x project x ticket), timesheet,
46+
by-project, by-ticket, by-model, by-day.
47+
- Date range filters: `--week`, `--month`,
48+
`--from`/`--to`.
49+
- Project and ticket filters.
50+
- JSON output mode (`--json`).
51+
- Backfill from existing Claude Code session
52+
transcripts.
53+
- Configurable project detection via
54+
`projectPattern` regex.
55+
- Configurable ticket patterns with
56+
Jira/Linear/GitHub support.
57+
- Break detection with configurable threshold.
58+
- Event-level aggregation for accurate
59+
mid-session project/ticket switching.

CONTRIBUTING.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Contributing to claude-code-timelog
2+
3+
## Prerequisites
4+
5+
- Node.js 18 or later
6+
- Claude Code (for testing hooks)
7+
8+
## Setup
9+
10+
```bash
11+
git clone https://github.com/RemoteCTO/claude-code-timelog.git
12+
cd claude-code-timelog
13+
npm install
14+
npm test
15+
npm run lint
16+
```
17+
18+
## Project structure
19+
20+
```
21+
hooks/ Claude Code hook handlers
22+
scripts/ CLI scripts (report, backfill)
23+
lib/ Shared library code
24+
bin/ CLI entry point (claudelog)
25+
commands/ Plugin command definitions
26+
test/ Tests (mirrors source layout)
27+
```
28+
29+
**Hooks** run inside Claude Code sessions.
30+
**Scripts** run standalone from the terminal.
31+
**lib/** is shared between both.
32+
33+
## Code style
34+
35+
Code style is enforced by ESLint and
36+
editorconfig:
37+
38+
- 80-character line limit
39+
- ESM modules (`.mjs` extension)
40+
- `prefer-const`, `no-var`
41+
- 2-space indentation
42+
- LF line endings
43+
44+
Run `npm run lint` before submitting changes.
45+
46+
## Testing
47+
48+
Tests use Node's native test runner
49+
(`node --test`).
50+
51+
- Write tests first (TDD)
52+
- Test behaviour, not implementation
53+
- Use real objects, not mocks
54+
- Keep tests focused and independent
55+
56+
Run tests with `npm test`. Run a single file:
57+
58+
```bash
59+
node --test test/lib/config.test.mjs
60+
```
61+
62+
Use `CLAUDE_TIMELOG_DIR` to point at a temp
63+
directory during development to avoid polluting
64+
your real timelog data.
65+
66+
## Pull request process
67+
68+
1. Fork the repository
69+
2. Create a feature branch from `main`
70+
3. Make your changes
71+
4. Write or update tests
72+
5. Update `CHANGELOG.md` under an `[Unreleased]`
73+
heading (see [Keep a Changelog][kac])
74+
6. Run `npm test` and `npm run lint`
75+
7. Submit a pull request
76+
77+
[kac]: https://keepachangelog.com/en/1.1.0/
78+
79+
Keep PRs focused on a single change. Include
80+
clear descriptions of what changed and why.
81+
82+
## Commit messages
83+
84+
Follow conventional commit format where
85+
appropriate:
86+
87+
- `feat:` new features
88+
- `fix:` bug fixes
89+
- `docs:` documentation changes
90+
- `test:` test additions or changes
91+
- `refactor:` code changes without behaviour
92+
changes
93+
94+
Keep commit messages concise and descriptive.
95+
96+
## Questions
97+
98+
Open an issue for questions or clarifications
99+
before starting significant changes.
100+
101+
## Licence
102+
103+
By contributing, you agree that your
104+
contributions will be licensed under the
105+
Apache 2.0 licence.

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ external services.
3131

3232
## Quick start
3333

34-
### From marketplace (recommended)
34+
### From [marketplace][mkt] (recommended)
3535

3636
```
3737
/plugin marketplace add RemoteCTO/claude-plugins-marketplace
@@ -45,6 +45,8 @@ git clone https://github.com/RemoteCTO/claude-code-timelog.git
4545
claude --plugin-dir ./claude-code-timelog
4646
```
4747

48+
[mkt]: https://github.com/RemoteCTO/claude-plugins-marketplace
49+
4850
That's it. The plugin starts logging
4951
immediately with sensible defaults:
5052

@@ -98,12 +100,24 @@ and backfills from any terminal — no active
98100
Claude Code session needed.
99101

100102
```bash
101-
claudelog report --week --by-project
102-
claudelog report --month --timesheet --json
103-
claudelog backfill
104-
claudelog --help
103+
claudelog # default report (--week)
104+
claudelog report --month --timesheet # explicit flags
105+
claudelog backfill # import history
106+
claudelog --help # show usage
105107
```
106108

109+
Running `claudelog` with no arguments runs
110+
a default report. Configure the default via
111+
`defaultReport` in `config.json`:
112+
113+
```json
114+
{
115+
"defaultReport": ["--month", "--timesheet"]
116+
}
117+
```
118+
119+
Falls back to `["--week"]` if not set.
120+
107121
### Adding to PATH
108122

109123
The plugin installs to a versioned cache
@@ -204,7 +218,8 @@ settings are optional.
204218
],
205219
"projectSource": "git-root",
206220
"projectPattern": null,
207-
"breakThreshold": 1800
221+
"breakThreshold": 1800,
222+
"defaultReport": ["--week"]
208223
}
209224
```
210225

SECURITY.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you discover a security vulnerability in
6+
claude-code-timelog, please report it via
7+
GitHub Security Advisories:
8+
9+
https://github.com/RemoteCTO/claude-code-timelog/security/advisories/new
10+
11+
Do **not** open a public issue for security
12+
vulnerabilities.
13+
14+
Alternatively, email security reports to:
15+
edward@bannermedia.ltd
16+
17+
## What to Include
18+
19+
- Description of the vulnerability
20+
- Steps to reproduce
21+
- Potential impact
22+
- Suggested fix (if you have one)
23+
24+
## Response Time
25+
26+
We aim to respond to security reports within
27+
48 hours and provide a fix or mitigation plan
28+
within one week for critical vulnerabilities.
29+
30+
## Disclosure Policy
31+
32+
Please allow us reasonable time to address the
33+
vulnerability before public disclosure. We will
34+
coordinate disclosure timing with you.

0 commit comments

Comments
 (0)