@@ -23,7 +23,10 @@ Add the `time_tracking` section to your `.opencode/opencode-project.json`:
2323 "$schema" : " https://raw.githubusercontent.com/techdivision/opencode-plugins/main/schemas/opencode-project.json" ,
2424 "time_tracking" : {
2525 "csv_file" : " ~/time_tracking/time-tracking.csv" ,
26- "default_account_key" : " YOUR_ACCOUNT_KEY"
26+ "global_default" : {
27+ "issue_key" : " PROJ-MISC" ,
28+ "account_key" : " YOUR_ACCOUNT_KEY"
29+ }
2730 }
2831}
2932```
@@ -46,11 +49,100 @@ export OPENCODE_USER_EMAIL=your@email.com
4649
4750If not set, the system username is used as fallback.
4851
52+ ## Configuration Options
53+
54+ ### Required Fields
55+
56+ | Field | Description |
57+ | -------| -------------|
58+ | ` csv_file ` | Path to the CSV output file (supports ` ~/ ` , absolute, or relative paths) |
59+ | ` global_default.issue_key ` | Default JIRA issue key when no ticket found in context |
60+ | ` global_default.account_key ` | Default Tempo account key for time entries |
61+
62+ ### Optional Fields
63+
64+ #### Agent-specific Defaults
65+
66+ Override default ticket/account for specific agents:
67+
68+ ``` json
69+ {
70+ "time_tracking" : {
71+ "csv_file" : " ..." ,
72+ "global_default" : {
73+ "issue_key" : " PROJ-MISC" ,
74+ "account_key" : " TD_GENERAL"
75+ },
76+ "agent_defaults" : {
77+ "@developer" : {
78+ "issue_key" : " PROJ-DEV" ,
79+ "account_key" : " TD_DEVELOPMENT"
80+ },
81+ "@reviewer" : {
82+ "issue_key" : " PROJ-REVIEW"
83+ }
84+ }
85+ }
86+ }
87+ ```
88+
89+ #### Ignored Agents
90+
91+ Skip time tracking for specific agents:
92+
93+ ``` json
94+ {
95+ "time_tracking" : {
96+ "csv_file" : " ..." ,
97+ "global_default" : { ... },
98+ "ignored_agents" : [" @internal" , " @notrack" ]
99+ }
100+ }
101+ ```
102+
103+ ### Full Example
104+
105+ ``` json
106+ {
107+ "$schema" : " https://raw.githubusercontent.com/techdivision/opencode-plugins/main/schemas/opencode-project.json" ,
108+ "time_tracking" : {
109+ "csv_file" : " ~/time_tracking/time-tracking.csv" ,
110+ "global_default" : {
111+ "issue_key" : " PROJ-MISC" ,
112+ "account_key" : " TD_GENERAL"
113+ },
114+ "agent_defaults" : {
115+ "@developer" : {
116+ "issue_key" : " PROJ-DEV" ,
117+ "account_key" : " TD_DEVELOPMENT"
118+ },
119+ "@reviewer" : {
120+ "issue_key" : " PROJ-REVIEW"
121+ }
122+ },
123+ "ignored_agents" : [" @internal" ]
124+ }
125+ }
126+ ```
127+
128+ ## Fallback Hierarchy
129+
130+ ### Ticket Resolution
131+
132+ 1 . Context ticket (from messages/todos)
133+ 2 . Agent-specific ` issue_key ` (if configured)
134+ 3 . ` global_default.issue_key `
135+
136+ ### Account Key Resolution
137+
138+ 1 . Agent-specific ` account_key ` (if configured)
139+ 2 . ` global_default.account_key `
140+
49141## How it works
50142
51143- Tracks tool executions during each session turn
52- - Extracts JIRA ticket from git branch name (e.g., ` feature/PROJ-123-description ` )
53- - Writes CSV entry when session becomes idle (after each complete response)
144+ - Extracts JIRA ticket from user messages or todos
145+ - Writes CSV entry when session becomes idle
54146- Shows toast notification with tracked time
55147
56148## CSV Format
0 commit comments