Skip to content

feat: PR-1 add project infrastructure and tooling config#1

Merged
mynameistito merged 7 commits intomainfrom
init/01-project-infra
Mar 26, 2026
Merged

feat: PR-1 add project infrastructure and tooling config#1
mynameistito merged 7 commits intomainfrom
init/01-project-infra

Conversation

@mynameistito
Copy link
Copy Markdown
Owner

@mynameistito mynameistito commented Mar 25, 2026

Summary

  • Set up build system (tsdown, Bun), linting (Ultracite/Biome), and git hooks (lefthook)
  • Add CI/CD workflows (CI, CodeQL, release, stale, PR labels/triage)
  • Add community files (contributing guide, code of conduct, security policy, issue/PR templates)
  • Add development config (.env.example, .zed, .claude, changeset)

Stacked PR Chain

This is PR 1 of 7 — merge in order.
mainPR1 ← PR2 ← PR3 ← PR4 ← PR5 ← PR6 ← PR7

Test plan

  • bun install resolves dependencies
  • bun run check passes linting
  • bun run typecheck passes
  • CI workflows trigger on push

Summary by cubic

Set up project infrastructure: build with tsdown on Bun, strict linting via ultracite/@biomejs/biome, pre-commit hooks with lefthook, and CI/CD workflows (CI, CodeQL, release, stale, labels/triage). Added Changesets, Dependabot, and community health files to standardize releases and contributions.

  • New Features

    • Build pipeline via tsdown (ESM/CJS + types) and TS config.
    • Lint/format with ultracite and @biomejs/biome; repo presets and editor settings.
    • Git hooks with lefthook for fix, YAML validate, typecheck, and cleanup.
    • GitHub Actions: CI, CodeQL, release with @changesets/cli, stale, labeler/triage.
    • Community and repo hygiene: CODEOWNERS, issue/PR templates, conduct, contributing, security, .env.example.
  • Dependencies

    • Runtime: @clack/prompts, better-result, zod, @typescript/native-preview.
    • Dev: @biomejs/biome, ultracite, tsdown, typescript, @types/bun, lefthook, @changesets/cli.

Written for commit 7c339aa. Summary will update on new commits.

Greptile Summary

This PR establishes the full project infrastructure for discord-search: build pipeline (tsdown/Bun), strict linting (ultracite/Biome), pre-commit hooks (lefthook), CI/CD workflows (CI, CodeQL, release via Changesets), Dependabot, and all community health files. The foundation is well-structured and thoughtfully configured, but three issues need to be resolved before CI and releases will work correctly.

  • Missing test:node scriptci.yml calls bun run test:node in the test-node matrix job, but no such script exists in package.json. That job will always fail on every push/PR.
  • @typescript/native-preview in dependencies — The TypeScript native compiler (tsgo) is a build-time tool and should be in devDependencies. Leaving it in dependencies ships a large binary to every consumer of the published CLI package.
  • release.yml missing permissions — The Changesets action requires contents: write and pull-requests: write to push version tags and open release PRs. Without an explicit permissions block the workflow will silently fail on repos with restrictive default GITHUB_TOKEN settings.
  • .gitignore glob typo_.log and the numbered report pattern use _ instead of * as a wildcard, so most log files won't be ignored.

Confidence Score: 3/5

  • Not safe to merge as-is — CI will fail on every run and the release pipeline is broken until three concrete fixes are applied.
  • Two of the three blocking issues (missing test:node script and missing release workflow permissions) will cause immediate, reproducible CI/CD failures on the very first PR after merge. The third (TypeScript compiler shipped as a production dependency) silently bloats every published version. These are straightforward fixes that keep the overall infrastructure design — which is solid — intact.
  • package.json, .github/workflows/ci.yml, and .github/workflows/release.yml all need attention before this is safe to merge.

Important Files Changed

Filename Overview
package.json Two issues: @typescript/native-preview is in dependencies instead of devDependencies (pollutes published package), and the test:node script referenced by CI is missing entirely.
.github/workflows/ci.yml Well-structured CI with typecheck, lint, build, and multi-runtime test jobs, but the test-node job calls bun run test:node which is absent from package.json — that job will always fail.
.github/workflows/release.yml Changesets-based release workflow is missing the permissions block (contents: write, pull-requests: write) required for the action to create release PRs and push version tags.
.gitignore Uses _ instead of * as glob wildcard in _.log and the numbered report pattern, so most log files won't actually be ignored.
lefthook.yml Pre-commit hooks for linting, YAML validation, typecheck, and cleanup run in parallel — clean and well-scoped.
tsdown.config.ts Bundles ESM/CJS with declarations; explicitly bundles all three runtime dependencies for distribution as a self-contained CLI.
tsconfig.json Strict TypeScript config with bundler resolution and noUncheckedIndexedAccess; includes jsx: "react-jsx" which is unused for this CLI but harmless.
scripts/cleanup.ts Recursive cleanup of tmpclaude-* and nul temp files; cross-platform and well-guarded against errors.
.github/workflows/pr-triage.yml Auto-assigns CODEOWNER as reviewer on pull_request_target; correctly avoids self-assignment and handles both user and team owners.
.github/dependabot.yml Weekly Dependabot updates for both npm and GitHub Actions, grouped into a single PR — sensible configuration.
biome.jsonc Extends Ultracite's Biome core preset, adds Bun as a global, and enforces type over interface — minimal and correct.
.github/workflows/codeql.yml Standard CodeQL workflow for JS/TS with security-extended queries; action SHAs are pinned.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push / PR to main] --> B{Event type?}
    B -->|push| C[CI Workflow]
    B -->|push| D[Release Workflow]
    B -->|push or PR| E[CodeQL Workflow]
    B -->|PR opened/sync| F[PR Labels Workflow]
    B -->|PR opened/ready| G[PR Triage Workflow]

    C --> C1[check: Typecheck & Lint]
    C1 --> C2[build: Build Verification]
    C1 --> C3[test-bun: Bun latest + canary]
    C1 --> C4[test-node: Node 22 + 24]

    D --> D1[bun install]
    D1 --> D2[bun run build]
    D2 --> D3{changesets/action}
    D3 -->|has changesets| D4[Publish to npm]
    D3 -->|no changesets| D5[Open Release PR]

    G --> G1[Parse CODEOWNERS]
    G1 --> G2{No reviewers?}
    G2 -->|yes| G3[Request CODEOWNER review]

    subgraph Pre-commit hooks via lefthook
        H1[bun fix staged files]
        H2[bunx v8r YAML files]
        H3[bun typecheck]
        H4[cleanup.ts]
    end
Loading

Reviews (1): Last reviewed commit: "feat: add project infrastructure and too..." | Re-trigger Greptile

Set up build system (tsdown, Bun), linting (Ultracite/Biome), git hooks
(lefthook), CI/CD workflows, dependency management, and community files.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

Adds comprehensive repository scaffolding: CI/CD workflows, issue/PR templates, linting/commit hooks, Changesets release config, editor/tool settings, documentation, package metadata, and utility scripts for a Bun/Node TypeScript Discord search CLI.

Changes

Cohort / File(s) Summary
Changesets
.changeset/...
\.changeset/README.md, \.changeset/config.json
Added Changesets README and config for changelog generation, commit behavior, base branch, and release settings.
GitHub configuration & automation
.github/...
\.github/CODEOWNERS, \.github/ISSUE_TEMPLATE/*, \.github/PULL_REQUEST_TEMPLATE.md, \.github/dependabot.yml, \.github/labeler.yml
Added CODEOWNERS, structured issue/PR templates, Dependabot, and labeler rules.
Workflows
.github/workflows/...
\.github/workflows/ci.yml, \.github/workflows/codeql.yml, \.github/workflows/pr-labels.yml, \.github/workflows/pr-triage.yml, \.github/workflows/release.yml, \.github/workflows/stale.yml
Introduced CI, CodeQL, PR labeling/triage, release via Changesets, and stale automation workflows.
Project metadata & packaging
package.json, .npmrc, tsdown.config.ts, tsconfig.json
Added package manifest with dual ESM/CJS exports, npm registry, tsdown build config, and TypeScript config for strict ESNext builds.
Linting / Formatting / Hooks / Tooling
biome.jsonc, lefthook.yml, \.v8rrc.yml, \.zed/settings.json
Configured Biome linting/presets, pre-commit Lefthook tasks, schema catalog entry, and editor formatting settings.
Claude / AI guidance & tooling
.claude/...
\.claude/CLAUDE.md, \.claude/settings.json, \.claude/commands/*, \.claude/skills/*
Added Ultracite guidance, Claude skill docs, and a post-write hook to run fixes after edits.
Documentation & policies
AGENTS.md, CLAUDE.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md
Added project README-style agent guide, contribution guidelines, code of conduct, security policy, and cross-references.
Repository housekeeping
.gitignore, .env.example, \.github/*
Added .gitignore entries, sample .env variables for Discord integration, and repository templates.
Scripts & utilities
scripts/cleanup.ts
Added a Bun-based cleanup script to remove temporary files matching configured patterns.
Editor / CI labeling config
\.github/labeler.yml, .v8rrc.yml
Schema and labeler mapping for automatic PR labels and validation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble through configs, tidy and spry,

workflows hum, and changelogs sigh.
Hooks hop in place, docs snug and bright,
A tiny cleanup script scurries at night.
Hooray — the repo’s cozy and ready to try!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding project infrastructure and tooling configuration. It directly corresponds to the core objectives and file additions.
Description check ✅ Passed The PR description clearly outlines project infrastructure setup including build system, linting, CI/CD workflows, and community files, which directly aligns with the changeset across 50+ configuration and documentation files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch init/01-project-infra

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Mar 25, 2026

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

7 issues found across 38 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="package.json">

<violation number="1" location="package.json:67">
P2: Move `@typescript/native-preview` to `devDependencies`; it's a build/typecheck tool, not a runtime dependency.</violation>
</file>

<file name="SECURITY.md">

<violation number="1" location="SECURITY.md:33">
P3: The security policy references `repo-updater`, which appears to be the wrong project name for this repository and can misdirect vulnerability reporters.</violation>
</file>

<file name="CONTRIBUTING.md">

<violation number="1" location="CONTRIBUTING.md:79">
P3: This dependency policy line is out of sync with `package.json` (it omits `@typescript/native-preview`), which can mislead contributors about allowed/runtime deps.</violation>
</file>

<file name=".gitignore">

<violation number="1" location=".gitignore:17">
P2: The log ignore pattern uses `_` instead of `*`, so most `.log` files will still be tracked.</violation>

<violation number="2" location=".gitignore:18">
P3: The report filename pattern uses `_` instead of `*`, so generated report JSON files may not be ignored.</violation>
</file>

<file name=".github/workflows/release.yml">

<violation number="1" location=".github/workflows/release.yml:9">
P2: Add explicit workflow token permissions for the release job; without them, changesets can fail to create/update the release PR when default GITHUB_TOKEN permissions are read-only.</violation>
</file>

<file name=".github/workflows/pr-labels.yml">

<violation number="1" location=".github/workflows/pr-labels.yml:11">
P2: Concurrency is keyed by branch ref, so label runs from different PRs targeting the same branch can cancel each other. Use the PR number in the group key to isolate runs per PR.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread package.json Outdated
Comment thread .gitignore Outdated
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/pr-labels.yml Outdated
Comment thread SECURITY.md Outdated
Comment thread CONTRIBUTING.md
Comment thread .gitignore Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 24

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/skills/better-result-adopt/SKILL.md:
- Line 143: The workflow step referencing the non-existent directory "opensrc/"
should be updated: either remove the "opensrc/" mention from the checklist step
that starts with "Check for source reference" or replace it with a clarifying
sentence that instructs users to create or supply an "opensrc/" directory
beforehand (e.g., "If you rely on local source code, ensure an 'opensrc/'
directory exists and contains the better-result source"); update the text around
the string "opensrc/" in SKILL.md to make this explicit.
- Line 32: Add a short, one- or two-sentence clarification for the "Panic" term
referenced in the migration table (the "Bugs/defects" row under Result callback)
that defines what a Panic is, when it is raised (e.g., unrecoverable runtime
error such as null deref or type error within a Result callback), and how it
differs from regular/handled errors; add this as a footnote or inline
parenthetical after the table and optionally include a link or reference to the
runtime docs for panics.
- Around line 75-82: The example references an UnhandledException type used in
the fetchUser function and in Result.tryPromise's catch handler but that class
is not defined; add a definition or reference so readers can follow the example.
Define UnhandledException (for example in tagged-errors.md) as a TaggedError
subtype that accepts a cause and builds a readable message, or add a clear note
in SKILL.md pointing to the exact file and exported class name where
UnhandledException is implemented; ensure the fetchUser example's return type
and the catch branch (UnhandledException) use that exact exported symbol so the
type and runtime class resolve.

In @.env.example:
- Around line 5-6: The .env.example file has keys out of alphabetical order
causing dotenv-linter UnorderedKey; reorder the variables so DISCORD_CLIENT_ID
appears before DISCORD_GUILD_ID (i.e., place the DISCORD_CLIENT_ID line above
the DISCORD_GUILD_ID line) and ensure the rest of the file follows alphabetical
ordering for environment keys.

In @.github/ISSUE_TEMPLATE/bug_report.yml:
- Around line 85-87: The description currently asks reporters to paste their
full `.env` file, which risks secret leakage; update the `description` value for
the "Environment file (if applicable)" label to request only the names of
relevant environment variables and a masked/example snippet (e.g.,
"DISCORD_TOKEN=REDACTED, DB_URL=postgres://user@host/... (redacted)") instead of
the full `.env` contents, and adjust text to explicitly warn against pasting
secrets so users provide only variable names and masked examples.

In @.github/ISSUE_TEMPLATE/question.yml:
- Around line 37-50: Add a new required runtime version field to the issue
template so reporters provide precise versions; specifically, next to the
existing dropdown field with id "runtime" add a short text/input field with id
"runtime_version" (label "Runtime version") and set validations.required: true
so the template collects exact runtime versions for faster troubleshooting.

In @.github/labeler.yml:
- Around line 1-61: Update the schema reference in .v8rrc.yml to match labeler
v6 when SchemaStore publishes a v6 schema, or temporarily remove the SchemaStore
v5 reference and validate against the official actions/labeler docs instead;
specifically, watch for a v6 schema in the SchemaStore repo and then change the
$schema value in .v8rrc.yml to the v6 URL (or replace the schema-based
validation with documentation-based checks), and ensure your .github/labeler.yml
usage remains compatible with labeler v6.0.1 during the interim.

In @.github/PULL_REQUEST_TEMPLATE.md:
- Line 1: Change the top-level heading "## What does this PR do?" to an H1 by
replacing the leading "##" with a single "#" so the first line reads "# What
does this PR do?" to satisfy MD041; update only the first line/header in
PULL_REQUEST_TEMPLATE.md (the header text "What does this PR do?") to use a
single '#' H1 marker.

In @.github/workflows/ci.yml:
- Around line 112-113: The CI step named "Test (Node.js runtime)" is invoking a
non-existent npm script "test:node"; update the workflow or package.json so the
script exists: either change the workflow command in the Test (Node.js runtime)
job from "bun run test:node" to an existing script (for example "bun run test"
or the correct script name found in package.json) or add a "test:node" script
entry to package.json that runs the intended Node.js test command; make sure to
reference the workflow job name and the script key "test:node" when making the
change.

In @.github/workflows/pr-labels.yml:
- Around line 10-12: The concurrency group currently uses `${{ github.workflow
}}-${{ github.ref }}` which with pull_request_target resolves to the base branch
and causes unrelated PR runs to cancel each other; update the concurrency key to
be PR-scoped by using a pull-request-specific identifier such as `${{
github.workflow }}-pr-${{ github.event.pull_request.number }}` or `${{
github.workflow }}-pr-${{ github.event.pull_request.head.sha }}` in the
`concurrency: group` value so each PR gets its own concurrency group (leave
`cancel-in-progress: true` as-is).

In @.github/workflows/release.yml:
- Around line 7-13: The workflow is missing explicit permissions required for
changesets/action to create/update release PRs and for npm publish with
provenance; add a top-level permissions block in the release workflow (near
concurrency and the release job declaration) granting at minimum pull-requests:
write (for PR creation), contents: write or packages: write (for package
publishing/metadata), and id-token: write (for OIDC/provenance); update the
release job definition (the release job name/runs-on/steps block) to use these
explicit permissions so the actions creating release PRs and publishing to npm
with provenance no longer rely on repo defaults.

In @.gitignore:
- Around line 16-19: The .gitignore patterns are too specific: replace the
literal "_.log" and overly rigid "report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json" so
they match real generated files; keep the existing "logs" entry as a directory
(or change to "logs/") and add broader globs such as "*.log" (to ignore any log
file) and a relaxed report pattern like "report*.json" or "report_*.json" (or
"report-*.json") to catch numbered/dated report files; update those entries in
the .gitignore accordingly.

In `@AGENTS.md`:
- Around line 3-5: The AGENTS.md header contains hardcoded
Generated/Commit/Branch metadata that will become stale; remove those static
lines or replace them with CI-generated placeholders and set up your pipeline to
populate them (e.g., use build-time templating, git describe/commit SHA and
branch env vars) so the file no longer contains drifting values; specifically
edit the AGENTS.md header to remove the three lines "**Generated:**",
"**Commit:**", and "**Branch:**" or swap them for templated tokens that your CI
(or a pre-commit hook) will substitute at publish time.
- Around line 11-24: The fenced directory-listing code block in AGENTS.md (the
block that begins with "src/" and ends with "presets.ts       # Preset
persistence") should include a language identifier to satisfy markdownlint
MD040; change the opening fence from ``` to ```text so the block becomes a
"text" fenced code block (e.g., ```text ... ```), leaving the directory contents
unchanged.

In `@CLAUDE.md`:
- Line 1: Add a top-level H1 heading as the very first line of CLAUDE.md to
satisfy MD041 (e.g., prepend a line beginning with "#" such as "# CLAUDE" or a
project-appropriate title), ensuring there's a blank line after the heading so
the rest of the existing content ("Read AGENTS.md for project knowledge.")
follows correctly.

In `@CONTRIBUTING.md`:
- Around line 29-51: The fenced project-structure block in CONTRIBUTING.md lacks
a language tag (violates MD040); update the opening fence from ``` to ```text so
the block is marked as plain text. Locate the block showing "index.ts # Entry
point — CLI main loop..." and change its fence to include "text" (i.e., the
triple backticks that start the block), ensuring markdownlint passes and the doc
renders as intended.

In `@lefthook.yml`:
- Around line 7-8: The pre-commit hook currently runs the unpinned command "bunx
v8r {staged_files}" which allows whatever v8r version is resolved at runtime;
change this to an explicit pinned invocation (e.g., "bunx v8r@<VERSION>
{staged_files}") so the hook uses a deterministic v8r release—update the
lefthook.yml entry that contains the run line for the v8r hook to include the
chosen semver version (replace <VERSION> with the specific v8r version you want
to lock to).

In `@package.json`:
- Line 8: The top-level "types" field in package.json currently points to an
ESM-only declaration ("./dist/index.d.mts") which can confuse CJS consumers;
update package.json by either removing the top-level "types" entry to rely on
the "exports" map for per-entry type resolution, or change it to point to a
universal declaration file (e.g. "./dist/index.d.ts") if tsdown/your build emits
one so both ESM and CJS consumers get compatible typings; adjust the exports map
entries if necessary to reference their specific .d.mts/.d.cts/.d.ts files to
keep type resolution correct.
- Line 38: The "typecheck" npm script currently calls "tsgo --noEmit" which is
invalid; update the "typecheck" script (the "typecheck" entry in package.json)
to use "tsc --noEmit" instead of "tsgo --noEmit" so TypeScript type checking
runs correctly; ensure any callers like "prepublishOnly" and CI that rely on the
"typecheck" script continue to work after this change.
- Line 15: Add an outExtensions function to tsdown.config.ts that maps
js->.cjs/.mjs and dts->.d.cts/.d.mts based on context.format (implement the
suggested outExtensions callback) so tsdown emits .d.mts/.d.cts files, then
update package.json's export conditions and the "types" field referenced in
package.json (the import condition and the require/commonjs condition) to point
to the correct declaration file names produced for each format (use
./dist/index.d.mts for ESM and ./dist/index.d.cts for CJS) to match the
generated outputs.
- Line 67: The package "@typescript/native-preview" is a nightly experimental
TypeScript build and must not be listed in runtime dependencies; remove it from
dependencies and add it to devDependencies (or delete it entirely if not
needed). Update package.json so the entry for "@typescript/native-preview"
appears under the devDependencies section (or is removed), ensuring any build
scripts or tooling that rely on it still reference it as a dev-only dependency.

In `@scripts/cleanup.ts`:
- Line 11: The SKIP_DIRS set (const SKIP_DIRS) should be expanded to include
common generated and build folders so the pre-commit traversal stays fast;
update SKIP_DIRS to add directories such as dist, build, .next, out, target,
coverage, .turbo, .parcel-cache, and any repo-specific generated folders (e.g.,
generated, typings, build-output) so the walk logic that references SKIP_DIRS on
lines ~29-31 will skip those directories during traversal.
- Around line 22-23: The cleanup code currently swallows all filesystem errors
by using .catch(() => []) on readdir and similar swallowing around unlink;
update the logic in scripts/cleanup.ts to explicitly handle errors instead of
ignoring them: wrap the readdir call (the entries variable) in a try/catch,
treat ENOENT as harmless but log and rethrow or return failure for any other
error, and do the same for unlink/file removal operations (do not use blanket
.catch(() => {}) for unlink); include the target path and the caught error in
the log message so callers can diagnose failures, or rethrow non-ENOENT errors
so they aren’t silently skipped.

In `@SECURITY.md`:
- Line 33: The SECURITY.md guidance references the stale project name
"repo-updater"; update the doc by locating the string "repo-updater" in
SECURITY.md and replacing it with this repository's correct project name (use
the canonical repo/project name used elsewhere in docs or package metadata) so
vulnerability reports are routed correctly and consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c546325-b14b-4ec4-abe0-08a451eedc05

📥 Commits

Reviewing files that changed from the base of the PR and between 7db4749 and 7c339aa.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (37)
  • .changeset/README.md
  • .changeset/config.json
  • .claude/CLAUDE.md
  • .claude/commands/adopt-better-result.md
  • .claude/settings.json
  • .claude/skills/better-result-adopt/SKILL.md
  • .claude/skills/better-result-adopt/references/tagged-errors.md
  • .env.example
  • .github/CODEOWNERS
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/ISSUE_TEMPLATE/feature_request.yml
  • .github/ISSUE_TEMPLATE/question.yml
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/dependabot.yml
  • .github/labeler.yml
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml
  • .github/workflows/pr-labels.yml
  • .github/workflows/pr-triage.yml
  • .github/workflows/release.yml
  • .github/workflows/stale.yml
  • .gitignore
  • .npmrc
  • .v8rrc.yml
  • .zed/settings.json
  • AGENTS.md
  • CLAUDE.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • SECURITY.md
  • biome.jsonc
  • lefthook.yml
  • package.json
  • scripts/cleanup.ts
  • tsconfig.json
  • tsdown.config.ts

Comment thread .claude/skills/better-result-adopt/SKILL.md
Comment thread .claude/skills/better-result-adopt/SKILL.md
Comment thread .claude/skills/better-result-adopt/SKILL.md
Comment thread .env.example Outdated
Comment thread .github/ISSUE_TEMPLATE/bug_report.yml
Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread scripts/cleanup.ts Outdated
Comment thread scripts/cleanup.ts Outdated
Comment thread SECURITY.md Outdated
@mynameistito mynameistito changed the title feat: add project infrastructure and tooling config feat: PR #1 add project infrastructure and tooling config Mar 25, 2026
@mynameistito mynameistito changed the title feat: PR #1 add project infrastructure and tooling config feat: PR-1 add project infrastructure and tooling config Mar 25, 2026
@mynameistito
Copy link
Copy Markdown
Owner Author

@greptile

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 25, 2026

Greptile Summary

This PR establishes the complete project infrastructure for discord-search: build pipeline (tsdown/Bun), strict linting (ultracite/Biome), pre-commit hooks (lefthook), CI/CD workflows (CI, CodeQL, Changesets release), Dependabot, and all community health files. The four issues flagged in the prior review round (missing test:node script, @typescript/native-preview placement, missing release.yml permissions, and .gitignore wildcard typos) are all resolved in this HEAD — great convergence. One concrete blocker remains:

  • Missing src/index.ts entry pointtsdown.config.ts specifies entry: ["src/index.ts"], but no src/ files exist in this PR. The build CI job (and the release workflow's bun run build step) will fail on every run until source files are introduced. A minimal placeholder export {} in src/index.ts, or making the build job continue-on-error: true for this bootstrap PR, would unblock CI while keeping the rest of the infrastructure intact.

Confidence Score: 3/5

  • Not safe to merge as-is — the build CI job will fail on every run because src/index.ts does not exist.
  • All four previously flagged issues are fully resolved, which is a meaningful improvement. However, tsdown.config.ts references src/index.ts as its entry point and no src/ files are present anywhere in the repository at this HEAD. Every push will produce a red build check, blocking merge if branch protection requires it. This is a single, targeted, easy-to-fix issue (add a placeholder src/index.ts or make the job non-blocking), but it is a concrete CI blocker on the infrastructure PR that is supposed to be the foundation for all subsequent PRs.
  • tsdown.config.ts (missing entry file) and by extension .github/workflows/ci.yml (the build job that runs it).

Important Files Changed

Filename Overview
tsdown.config.ts Bundles ESM/CJS with declarations and bundles all three runtime deps, but entry: ["src/index.ts"] references a file that doesn't exist yet — the CI build job will fail on every run until source files are added.
package.json All previously flagged issues resolved: @typescript/native-preview is correctly in devDependencies and runtime deps are limited to @clack/prompts, better-result, and zod.
.github/workflows/ci.yml Clean CI with typecheck, lint, build, and Bun matrix tests. The previously flagged test-node job and missing test:node script have been removed. The build job will fail until src/index.ts exists (tracked via the tsdown.config.ts comment).
.github/workflows/release.yml Previously missing permissions block is now present with contents: write, pull-requests: write, and id-token: write. Changesets-based publish flow with npm provenance looks correct.
.gitignore Previously flagged _ wildcard typos are gone; patterns now correctly use * (e.g. *.log, report*.json). All standard exclusions are present.
lefthook.yml Parallel pre-commit hooks for linting staged files, YAML validation, typecheck, and cleanup — well-scoped with correct globs for each job.
scripts/cleanup.ts Recursive cleanup of tmpclaude-* and nul temp files; cross-platform, skips well-known output directories, and handles errors gracefully.
.github/workflows/pr-triage.yml Uses pull_request_target safely (reads CODEOWNERS from base branch), avoids self-assignment, and handles both user and team owners correctly.
tsconfig.json Strict TypeScript config with bundler resolution and noUncheckedIndexedAccess; jsx: "react-jsx" is unused for this CLI but harmless.
.github/dependabot.yml Weekly Dependabot updates for npm and GitHub Actions, grouped into single PRs with appropriate labels and conventional commit prefixes.
biome.jsonc Extends Ultracite's Biome core preset, adds Bun as a global, and enforces type over interface — minimal and correct.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push / PR to main] --> B[CI Workflow]
    A --> C[Release Workflow]
    A --> D[CodeQL Workflow]
    A --> E[PR Labels / Triage]

    B --> B1[check: typecheck + lint]
    B1 --> B2[build: tsdown src/index.ts]
    B1 --> B3[test-bun: Bun latest + canary]
    B2 --> B2E["❌ FAILS — src/index.ts missing"]

    C --> C1[bun install]
    C1 --> C2[bun run build]
    C2 --> C2E["❌ FAILS — src/index.ts missing"]
    C2 --> C3{changesets/action}
    C3 -->|changesets present| C4[Publish to npm]
    C3 -->|no changesets| C5[Open Release PR]

    E --> E1[pr-labels: labeler from labeler.yml]
    E --> E2[pr-triage: parse CODEOWNERS]
    E2 --> E3{No reviewers?}
    E3 -->|yes| E4[Request CODEOWNER review]

    subgraph lefthook pre-commit
        H1[bun fix staged JS/TS/JSON/CSS]
        H2[bunx v8r staged YAML]
        H3[bun typecheck staged TS]
        H4[scripts/cleanup.ts]
    end
Loading

Reviews (2): Last reviewed commit: "chore: add changeset for initial project..." | Re-trigger Greptile

Comment thread package.json
Comment thread package.json
Comment thread .github/workflows/release.yml
Comment thread .gitignore
- Move @typescript/native-preview to devDependencies
- Fix typecheck script (tsgo -> tsc)
- Add test:node placeholder script
- Add permissions block to release workflow
- Fix .gitignore wildcard patterns (_ -> *)
- Add outExtensions to tsdown config for .d.mts/.d.cts
- Remove top-level types field from package.json
- Update exports map with correct type declarations
- Fix pr-labels concurrency (branch -> PR number)
- Improve cleanup.ts error handling and expand SKIP_DIRS
- Pin v8r version in lefthook.yml
- Fix security.md project name reference
- Sync contributing.md dependency policy
- Reorder .env.example alphabetically
- Secure bug_report.yml (warn against pasting secrets)
- Add language tag to AGENTS.md code block
- Add H1 heading to CLAUDE.md
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 13 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="CONTRIBUTING.md">

<violation number="1" location="CONTRIBUTING.md:79">
P3: The contributing guide now incorrectly documents `@typescript/native-preview` as a runtime dependency, but it is a devDependency in `package.json`. This can mislead contributors about dependency policy.</violation>
</file>

<file name="package.json">

<violation number="1" location="package.json:38">
P2: `test:node` is a no-op that always succeeds, so CI can pass without executing any Node tests.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread package.json Outdated
Comment thread CONTRIBUTING.md Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

♻️ Duplicate comments (3)
AGENTS.md (1)

3-5: ⚠️ Potential issue | 🟡 Minor

Remove stale hardcoded metadata.

These hardcoded Generated, Commit, and Branch values will immediately drift and provide misleading information. Consider removing them or automating their generation via CI.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 3 - 5, Remove the stale hardcoded metadata lines
"Generated:", "Commit:", and "Branch:" from AGENTS.md (they are the three
top-level metadata entries) and either delete them entirely or replace with
CI-populated placeholders; if automation is chosen, add CI template tokens
(e.g., {{BUILD_TIMESTAMP}}, {{GIT_COMMIT}}, {{GIT_BRANCH}}) so the values are
injected at build time instead of hardcoding the literal strings.
lefthook.yml (1)

7-8: 🧹 Nitpick | 🔵 Trivial

Consider pinning v8r to a specific version for reproducibility.

Using v8r@latest is better than unpinned, but different developers or CI runs may still resolve different versions over time. For fully deterministic builds, pin to a specific version (e.g., v8r@3.1.0).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lefthook.yml` around lines 7 - 8, The lefthook pre-commit hook currently
invokes v8r via "run: bunx v8r@latest {staged_files}" which is not pinned;
change that invocation to a fixed version (for example "bunx v8r@3.1.0
{staged_files}") so the v8r version is deterministic across dev machines and CI;
update the run line in lefthook.yml where "bunx v8r@latest" appears and ensure
any related documentation or comments reflect the chosen pinned version.
CONTRIBUTING.md (1)

29-51: ⚠️ Potential issue | 🟡 Minor

Add a language tag to the project-structure fenced block.

Use a text info string on the opening fence to satisfy markdown linting and keep doc checks clean.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CONTRIBUTING.md` around lines 29 - 51, The fenced project-structure block in
CONTRIBUTING.md lacks a language/info string; update its opening triple
backticks to include the `text` info string (i.e., change ``` to ```text) so the
markdown linter accepts the block and doc checks pass, leaving the block
contents (the index.ts and src/ tree) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/ISSUE_TEMPLATE/bug_report.yml:
- Around line 37-39: Update the "description" value for the block labeled "Full
command and output" to include an explicit redaction warning instructing
reporters to remove secrets/PII (tokens, auth headers, file paths, user
identifiers) before pasting terminal output; modify the description string in
the same YAML entry (the fields labeled label/description/render) to append a
short sentence like "Please redact secrets/PII (tokens, auth headers, file
paths, user IDs) before posting" while preserving render: shell and existing
instructions.
- Around line 89-96: Replace the realistic-looking example values in the
environment snippet with obvious placeholders so scanners/users won't mistake
them for real IDs: update the sample lines for DISCORD_BOT_TOKEN,
DISCORD_CLIENT_ID, and DISCORD_GUILD_ID (the env block shown in the template) to
use clearly non-sensitive placeholders like DISCORD_BOT_TOKEN=REDACTED_TOKEN,
DISCORD_CLIENT_ID=YOUR_CLIENT_ID, DISCORD_GUILD_ID=YOUR_GUILD_ID (or similar),
ensuring only variable names and explicit placeholder text remain.

In `@CONTRIBUTING.md`:
- Around line 79-80: Update the runtime dependencies list in CONTRIBUTING.md by
removing `@typescript/native-preview` (which is a devDependency in package.json)
so the bullet lists only the actual runtime deps: `@clack/prompts`,
`better-result`, and `zod`; specifically edit the bullet that currently reads
"**No external runtime deps** ... `@clack/prompts`, `better-result`,
`@typescript/native-preview`, and `zod`" and remove `@typescript/native-preview`
so the text matches package.json.
- Around line 20-22: Replace the stale `tsgo` references in the CONTRIBUTING.md
documentation with the actual TypeScript command used by the project: `tsc
--noEmit`; specifically update the "Type check" bullet that currently shows
`tsgo --noEmit` and any other occurrences (e.g., the second reference at line
57) so they read `tsc --noEmit` to match the project's npm script and avoid
confusing contributors.

In `@SECURITY.md`:
- Around line 18-20: Replace the brittle relative link "../../security" in
SECURITY.md with the repository's direct advisory/reporting URL (use the GitHub
security advisory/report vulnerability form for this repo) so the "Security tab"
link always resolves; update the line containing "../../security" to point to
the canonical advisory submission link (replace the "../../security" token in
the diff) and ensure the link text and instructions remain unchanged.

---

Duplicate comments:
In `@AGENTS.md`:
- Around line 3-5: Remove the stale hardcoded metadata lines "Generated:",
"Commit:", and "Branch:" from AGENTS.md (they are the three top-level metadata
entries) and either delete them entirely or replace with CI-populated
placeholders; if automation is chosen, add CI template tokens (e.g.,
{{BUILD_TIMESTAMP}}, {{GIT_COMMIT}}, {{GIT_BRANCH}}) so the values are injected
at build time instead of hardcoding the literal strings.

In `@CONTRIBUTING.md`:
- Around line 29-51: The fenced project-structure block in CONTRIBUTING.md lacks
a language/info string; update its opening triple backticks to include the
`text` info string (i.e., change ``` to ```text) so the markdown linter accepts
the block and doc checks pass, leaving the block contents (the index.ts and src/
tree) unchanged.

In `@lefthook.yml`:
- Around line 7-8: The lefthook pre-commit hook currently invokes v8r via "run:
bunx v8r@latest {staged_files}" which is not pinned; change that invocation to a
fixed version (for example "bunx v8r@3.1.0 {staged_files}") so the v8r version
is deterministic across dev machines and CI; update the run line in lefthook.yml
where "bunx v8r@latest" appears and ensure any related documentation or comments
reflect the chosen pinned version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 19a1646c-f22d-4e9e-bd03-be4709f2bfce

📥 Commits

Reviewing files that changed from the base of the PR and between 7c339aa and 3925944.

📒 Files selected for processing (13)
  • .env.example
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/workflows/pr-labels.yml
  • .github/workflows/release.yml
  • .gitignore
  • AGENTS.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • SECURITY.md
  • lefthook.yml
  • package.json
  • scripts/cleanup.ts
  • tsdown.config.ts

Comment thread .github/ISSUE_TEMPLATE/bug_report.yml
Comment thread .github/ISSUE_TEMPLATE/bug_report.yml
Comment thread CONTRIBUTING.md
Comment thread CONTRIBUTING.md Outdated
Comment thread SECURITY.md Outdated
- Remove @typescript/native-preview from runtime dep list (now in devDependencies)
- Remove test:node no-op script that always succeeds
- Remove test-node job from CI (no tests exist yet)

Prevents misleading contributors about deps and CI passing without actual tests
- Add redaction warning to bug report command output field
- Replace realistic IDs with obvious placeholders (YOUR_CLIENT_ID/YOUR_GUILD_ID)
- Replace stale tsgo references with tsc --noEmit (2 occurrences)
- Replace brittle ../../security link with direct GitHub URL
- Pin v8r to v3.1.0 for determinism
- Fix outExtensions: change 'esm' to 'es' (correct InternalModuleFormat)
- Restore package.json with 'tsc --noEmit' (was reverted to tsgo)

Fixes TypeScript error TS2367 in tsdown config
@mynameistito
Copy link
Copy Markdown
Owner Author

@greptile

@mynameistito mynameistito merged commit 167c79f into main Mar 26, 2026
5 checks passed
Comment thread tsdown.config.ts
import { defineConfig } from "tsdown";

export default defineConfig({
entry: ["src/index.ts"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 src/index.ts does not exist — CI build job will always fail

The entry field points to src/index.ts, but no files under src/ are present in this PR (confirmed via git ls-tree). When bun run build runs tsdown, the bundler will exit with a "file not found" error, failing the build job on every push/PR until source files are introduced in a later PR.

Since the build job has no continue-on-error: true and branch protection typically requires all required jobs to pass, this PR cannot be merged as-is if the build check is required.

Options to unblock:

  • Add a minimal placeholder src/index.ts (e.g. export {}) so the build and pack dry-run succeed on this infrastructure PR.
  • Or mark the build job continue-on-error: true in ci.yml until the source is present.
  • Or skip the build job entirely and add it back in the PR that introduces src/index.ts.

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