Skip to content

Conversation

@swedishborgie
Copy link
Collaborator

  • Split codebase into logical subpackages (markdown, selectors, taskparams, taskparser, tokencount, mcp)
  • Add comprehensive parameter parsing with support for quoted values, escape sequences (Unicode, hex, octal), and multiple values per key
  • Change Params type from map[string]string to map[string][]string
  • Move options to separate file
  • Update documentation and tests

@alexec
Copy link
Contributor

alexec commented Dec 16, 2025

@swedishborgie the task params parser is done quite differently now. It uses the particple parser:

func (s *SlashCommand) Params() map[string]string {

It should be possible to expand that parser.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a significant refactoring to reorganize the codebase into logical subpackages and enhance parameter parsing capabilities. The main changes include splitting functionality into markdown, selectors, taskparams, taskparser, tokencount, and mcp subpackages, and changing the Params type from map[string]string to map[string][]string to support multiple values per key.

Key changes:

  • Comprehensive parameter parsing: Added support for quoted values (single/double quotes), escape sequences (Unicode, hex, octal), and multiple values per key with case-insensitive key handling
  • Type system improvement: Changed Params from map[string]string to map[string][]string to enable collecting multiple values for duplicate keys
  • Code organization: Split monolithic package into focused subpackages for better maintainability

Reviewed changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/codingcontext/taskparams/taskparams.go New comprehensive parameter parser with support for multiple values, quotes, and escape sequences
pkg/codingcontext/taskparams/parser.go Internal parser implementation for handling complex parsing logic
pkg/codingcontext/taskparams/expander.go Moved from main package with updated signature to return error
pkg/codingcontext/taskparams/taskparams_test.go Extensive test coverage for new parsing features (677 lines)
pkg/codingcontext/tokencount/tokencount.go Extracted token counting logic into separate subpackage
pkg/codingcontext/markdown/markdown.go Consolidated markdown-related types and functions
pkg/codingcontext/mcp/mcp.go Extracted MCP server configuration types
pkg/codingcontext/selectors/selectors.go Moved selector logic to dedicated subpackage
pkg/codingcontext/options.go Extracted option functions from context.go
pkg/codingcontext/context.go Updated to use new subpackages and handle expansion errors
go.mod Added testify dependency, updated Go version
go.sum Updated dependencies (critical issue found)
docs/reference/cli.md Documented new parameter parsing features

- Split codebase into logical subpackages (markdown, selectors, taskparams,
  taskparser, tokencount, mcp)
- Add comprehensive parameter parsing with support for quoted values, escape
  sequences (Unicode, hex, octal), and multiple values per key
- Change Params type from map[string]string to map[string][]string
- Move options to separate file
- Update documentation and tests
@swedishborgie
Copy link
Collaborator Author

Gotcha! I've gotten rid of the bepoke parser and integrated with participle, and I copied over all of the test cases. I also integrated the concept of positional arguments you had.

Spec here:
https://github.com/swedishborgie/coding-context-cli/blob/3f41d82722e75860512f3372c59ac8110b207f49/pkg/codingcontext/taskparser/params.go#L33-L144

and here:
https://github.com/swedishborgie/coding-context-cli/blob/3f41d82722e75860512f3372c59ac8110b207f49/pkg/codingcontext/taskparser/taskparser.go#L7-L111

@alexec alexec merged commit 623c200 into kitproj:main Dec 17, 2025
1 check passed
@swedishborgie swedishborgie deleted the refactor branch December 18, 2025 13:54
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.

2 participants