Skip to content

Cleanup (part one) before release cut.#4

Merged
josealekhine merged 7 commits intomainfrom
feature/cleanup
Feb 1, 2026
Merged

Cleanup (part one) before release cut.#4
josealekhine merged 7 commits intomainfrom
feature/cleanup

Conversation

@josealekhine
Copy link
Member

No description provided.

Split the monolithic embed.go into cmd.go, hook.go, perm.go, script.go
for better separation of concerns. Renamed functions to follow Go
conventions (drop unnecessary Get/Create/List prefixes):

- GetAutoSaveScript → AutoSaveScript
- GetBlockNonPathCtxScript → BlockNonPathCtxScript
- ListCommands → Commands
- GetCommand → CommandByName
- CreateDefaultHooks → DefaultHooks
- CreateDefaultPermissions → DefaultPermissions
- GetClaudeHook → ClaudeHookByFileName (in templates)

Updated test function names to match the new API names. Refactored
bootstrap.Initialize to use a loop for registering subcommands.

Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
- Replace string literals with config.UpdateType* constants in append.go
- Move addConfig struct from add.go to dedicated config.go file
- Rename addFlags → addConfig to reflect it holds configuration, not a
  collection.

Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
The header insertion logic (find header, skip comments, insert entry)
was duplicated between prependAfterHeader and prependAfterSeparator.
Extracted to a shared insertAfterHeader helper.

Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
Add CommentOpen ("<!--") and CommentClose ("-->") constants to config
and use len() instead of hardcoded 4 and 3 in insertAfterHeader.

Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
Add helper functions for cross-platform newline handling:
- findNewline: finds first CRLF or LF
- skipNewline: advances past CRLF or LF
- skipWhitespace: skips spaces, tabs, and newlines
- endsWithNewline: checks for trailing CRLF or LF

Add NewlineCRLF and NewlineLF constants. Check CRLF first to handle
both Windows and Unix line endings without normalization.

Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
…sh commands

Recall improvements:
- Fix CanParse to check 50 lines (was 5) - finds 57 vs 22 sessions
- Add smart project matching: git remote → path relative to home → exact CWD
- Add --all-projects flag to list/show/export commands
- Label tool results as "Tool Output" instead of "User"

New commands:
- ctx recall export: Export sessions to .context/journal/ as Markdown
- ctx journal site: Generate zensical static site from journal entries
- ctx serve: Convenience wrapper for zensical serve

New slash commands:
- /ctx-journal-enrich: Add frontmatter, topics, tags to journal entries
- /ctx-journal-summarize: Generate period summaries (weekly, monthly, feature)
- /ctx-blog: Generate blog post from recent activity
- /ctx-blog-changelog: Generate blog post from commit range with theme

Documentation:
- Add slash commands reference to integrations.md
- Update TASKS.md with completed items

Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
Code refactoring:
- Split monolithic files into focused modules (add, compact, config, context)
- Extract types, predicates, and helper functions
- Rename decisions → decision, validation → validate for consistency
- Move rc package, add field/pattern/regex modules to config

Testing:
- Add AST-based test to detect fmt.Print* in Cobra command functions
- Ensure CLI functions use cmd.Print* for proper output handling

Documentation:
- Update cli-reference.md with current flags and commands
- Update integrations.md with slash commands reference
- Update blog index and various doc fixes
- Remove deprecated ralph-loop.md (content moved to autonomous-loop.md)

Site:
- Rebuild static site with latest documentation
- Update search index

Misc:
- Add .context/journal/ and .context/journal-site/ to .gitignore
- Update AGENT_PLAYBOOK.md and LEARNINGS.md

Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
@josealekhine josealekhine self-assigned this Feb 1, 2026
@josealekhine josealekhine merged commit 59784a0 into main Feb 1, 2026
5 of 6 checks passed
@josealekhine josealekhine deleted the feature/cleanup branch February 1, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant