- Bun (development runtime — the published package runs on Node.js, but you need bun to build and test)
- gh CLI (for testing publish workflows)
- Node.js 18+ (for verifying the built output works with
npx)
git clone https://github.com/igmagollo/suggestion-box.git
cd suggestion-box
bun install
bun run build
bun testsrc/
cli.ts # CLI entry point — init, uninit, serve, publish, etc.
mcp.ts # MCP server (stdio transport)
store.ts # SQLite/Turso data layer (feedback CRUD, dedup)
embedder.ts # HuggingFace embedding for dedup
github.ts # GitHub issue creation and dedup via gh CLI
schemas.ts # Zod schemas for MCP tool inputs
sdk.ts # Public SDK export for programmatic use
types.ts # Shared TypeScript types
tests/
*.test.ts # Bun test files
bun test # run all tests
bun test tests/store # run a specific test fileTests use bun's built-in test runner. No extra test framework needed.
npx tsc --noEmitThe project uses tsconfig.json for editor/type-check and tsconfig.build.json for the production build.
- Conventional commits —
feat:,fix:,docs:,refactor:,test:,chore:, etc. - Branch naming —
feat/short-description,fix/short-description,docs/short-description - Keep PRs focused. One concern per PR.
- CI runs
bun teston pull requests. Make sure tests pass before opening.
Publishing currently goes through src/github.ts, which creates GitHub issues via the gh CLI. To add a different target (e.g., Linear, Jira):
- Create a new file like
src/linear.tsexporting a function with this shape:export function createLinearIssue( feedback: Feedback, voteLog: Array<{ evidence: string | null; sessionId: string; createdAt: number }>, ): { url: string; deduplicated: boolean };
- Wire it into the
publishcommand insrc/cli.ts— either by adding a--targetflag or auto-detecting from config. - If the target needs MCP tool exposure, add a new tool in
src/mcp.tsfollowing the existingsuggestion_box_publish_to_githubpattern. - Add tests in
tests/.
Use src/github.ts as a reference for the overall pattern: check auth, search for duplicates, create or update, return a URL.
The init command in src/cli.ts writes config files for each supported coding agent. Currently supported: Claude Code (.mcp.json), Codex (.codex/config.toml), and OpenCode (opencode.json).
To add a new agent:
- In
src/cli.ts, find theinitblock (search forelse if (command === "init")). - Add a new section after the existing config writers. Follow the pattern:
- Read existing config if the file exists (preserve user settings).
- Merge in the suggestion-box MCP server entry.
- Write the file.
- Use
cli.commandandcli.argsfromgetCliCommand()for the server command. - Support
--dry-runby printing what would happen instead of writing.
- Add the corresponding removal logic in the
uninitblock. - Add the config file path to the
ignoreEntriesarray in bothinitanduninitso it gets added to.gitignore.
| Variable | Description | Default |
|---|---|---|
SUGGESTION_BOX_DIR |
Data directory path | .suggestion-box |
SUGGESTION_BOX_MODEL |
Embedding model override | Xenova/all-MiniLM-L6-v2 |