Skip to content

Commit db14e02

Browse files
committed
chore: apply linter formatting and copyright updates
- Update copyright year to 2026 - Apply code formatting from linter - Add claude package documentation - Add config and validation packages Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
1 parent 040ce99 commit db14e02

35 files changed

Lines changed: 248 additions & 178 deletions

.claude/hooks/auto-save-session.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# / Context: https://ctx.ist
44
# ,'`./ do you remember?
55
# `.,'\
6-
# \ Copyright 2025-present Context contributors.
6+
# \ Copyright 2026-present Context contributors.
77
# SPDX-License-Identifier: Apache-2.0
88

99
# Auto-save session transcript on exit (including Ctrl+C)

.claude/hooks/block-non-path-ctx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# / Context: https://ctx.ist
44
# ,'`./ do you remember?
55
# `.,'\
6-
# \ Copyright 2025-present Context contributors.
6+
# \ Copyright 2026-present Context contributors.
77
# SPDX-License-Identifier: Apache-2.0
88

99
# Block non-PATH ctx invocations

.context/TASKS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
## In Progress
44

5+
## Phase 1
6+
7+
- [ ] Verify all Markdown files by "actually reading them"; take notes for
8+
follow-up actions.
9+
- [ ] All go code should have godoc and testing.
10+
- [ ] GitHub CI linter is giving errors that need fixing.
11+
- [ ] Manual code review. take notes.
12+
- [ ] Add tests per file.
13+
- [ ] validate everything in the docs with a skeptical eye.
14+
- [ ] consider the case where `ctx` is not called from within AI prompt:
15+
- does the command still make sense?
16+
- does it create the expected output?
17+
- [ ] Cut the first release.
18+
19+
520
## Next Up
621

722
- [ ] Enforce test coverage targets in CI/Makefile #priority:medium #area:quality

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/ Context: https://ctx.ist
22
,'`./ do you remember?
33
`.,'\
4-
\ Copyright 2025-present Context contributors.
4+
\ Copyright 2026-present Context contributors.
55
SPDX-License-Identifier: Apache-2.0
66

77
Apache License

hack/build-all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# / Context: https://ctx.ist
44
# ,'`./ do you remember?
55
# `.,'\
6-
# \ Copyright 2025-present Context contributors.
6+
# \ Copyright 2026-present Context contributors.
77
# SPDX-License-Identifier: Apache-2.0
88

99
#

hack/start-dogfood.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# / Context: https://ctx.ist
44
# ,'`./ do you remember?
55
# `.,'\
6-
# \ Copyright 2025-present Context contributors.
6+
# \ Copyright 2026-present Context contributors.
77
# SPDX-License-Identifier: Apache-2.0
88

99
#

internal/claude/doc.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1+
// / Context: https://ctx.ist
2+
// ,'`./ do you remember?
3+
// `.,'\
4+
// \ Copyright 2026-present Context contributors.
5+
// SPDX-License-Identifier: Apache-2.0
6+
7+
// Package claude provides Claude Code integration templates and utilities.
8+
//
9+
// It embeds hook scripts, slash command definitions, and configuration types
10+
// for integrating ctx with Claude Code's settings.local.json. The embedded
11+
// assets are installed to project directories via "ctx init --claude".
12+
//
13+
// Embedded assets:
14+
// - auto-save-session.sh: Saves session transcripts on session end
15+
// - block-non-path-ctx.sh: Prevents non-PATH ctx invocations
16+
// - tpl/commands/*.md: Slash command definitions for Claude Code
17+
//
18+
// Example usage:
19+
//
20+
// script, err := claude.GetAutoSaveScript()
21+
// if err != nil {
22+
// return err
23+
// }
24+
// os.WriteFile(".claude/hooks/auto-save-session.sh", script, 0755)
125
package claude

internal/claude/embed_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// / Context: https://ctx.ist
22
// ,'`./ do you remember?
33
// `.,'\
4-
// \ Copyright 2025-present Context contributors.
4+
// \ Copyright 2026-present Context contributors.
55
// SPDX-License-Identifier: Apache-2.0
66

77
package claude
@@ -109,20 +109,20 @@ func TestCreateDefaultHooks(t *testing.T) {
109109
t.Run(tt.name, func(t *testing.T) {
110110
hooks := CreateDefaultHooks(tt.projectDir)
111111

112-
// Check PreToolUse hooks
113-
if len(hooks.PreToolUse) == 0 {
114-
t.Error("CreateDefaultHooks() PreToolUse is empty")
112+
// Check PreToolUseHooks hooks
113+
if len(hooks.PreToolUseHooks) == 0 {
114+
t.Error("CreateDefaultHooks() PreToolUseHooks is empty")
115115
}
116116

117-
// Check SessionEnd hooks
118-
if len(hooks.SessionEnd) == 0 {
119-
t.Error("CreateDefaultHooks() SessionEnd is empty")
117+
// Check SessionEndHooks hooks
118+
if len(hooks.SessionEndHooks) == 0 {
119+
t.Error("CreateDefaultHooks() SessionEndHooks is empty")
120120
}
121121

122122
// Check that project dir is used in paths when provided
123123
if tt.projectDir != "" {
124124
found := false
125-
for _, matcher := range hooks.PreToolUse {
125+
for _, matcher := range hooks.PreToolUseHooks {
126126
for _, hook := range matcher.Hooks {
127127
if strings.Contains(hook.Command, tt.projectDir) {
128128
found = true
@@ -147,8 +147,8 @@ func TestSettingsStructure(t *testing.T) {
147147
},
148148
}
149149

150-
if len(settings.Hooks.PreToolUse) == 0 {
151-
t.Error("Settings.Hooks.PreToolUse should not be empty")
150+
if len(settings.Hooks.PreToolUseHooks) == 0 {
151+
t.Error("Settings.Hooks.PreToolUseHooks should not be empty")
152152
}
153153

154154
if settings.Permissions == nil {

internal/claude/tpl/auto-save-session.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# / Context: https://ctx.ist
44
# ,'`./ do you remember?
55
# `.,'\
6-
# \ Copyright 2025-present Context contributors.
6+
# \ Copyright 2026-present Context contributors.
77
# SPDX-License-Identifier: Apache-2.0
88

99
# Auto-save session transcript on exit (including Ctrl+C)

internal/claude/tpl/block-non-path-ctx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# / Context: https://ctx.ist
44
# ,'`./ do you remember?
55
# `.,'\
6-
# \ Copyright 2025-present Context contributors.
6+
# \ Copyright 2026-present Context contributors.
77
# SPDX-License-Identifier: Apache-2.0
88

99
# Block non-PATH ctx invocations

0 commit comments

Comments
 (0)