Skip to content

Conversation

@ryoppippi
Copy link
Member

@ryoppippi ryoppippi commented Dec 9, 2025

Summary

  • Add knip to detect and remove unused code and dependencies
  • Add lint:knip and format:knip scripts to package.json
  • Add knip to lefthook pre-commit hook
  • Add knip to CI lint workflow

Changes

  • Removed unused files: src/utils/file.ts, src/utils/schema.ts
  • Removed unused dependencies: fs-fixture, nano-spawn
  • Removed unused exports and types from various files
  • Updated documentation to reflect removed file utilities

Closes #155


Summary by cubic

Add Knip to detect and clean up unused code and dependencies, wired into pre-commit. This keeps the codebase lean and prevents dead code from landing. Closes #155.

  • New Features

    • Add knip.config.ts with workspace entries and ignores.
    • Add scripts: lint:knip, format:knip; aggregate lint/format include Knip.
    • Run Knip in lefthook pre-commit.
  • Refactors

    • Remove unused modules and related docs/rules: src/utils/file.ts, src/utils/schema.ts, .cursor rule; trim file-operations skill to HTTP-only.
    • Remove unused deps (fs-fixture, nano-spawn); add knip; update workspace and lockfile.
    • Make unused exports internal across the codebase (rpc-client, tool, stackone, types, tfidf-index) and drop the ToolSet re-export.

Written for commit 1ac40cc. Summary will update automatically on new commits.

Remove internal type aliases that are not used:

- RpcActionRequest (kept as internal)

- RpcActionResponseData (removed entirely)

- RpcClientConfig (kept as internal)
Run knip as part of CI to detect unused code and dependencies
Copilot AI review requested due to automatic review settings December 9, 2025 12:36
@ryoppippi ryoppippi requested a review from a team as a code owner December 9, 2025 12:36
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@174

commit: 1ac40cc

@ryoppippi ryoppippi enabled auto-merge (squash) December 9, 2025 12:40
Copy link
Contributor

@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.

No issues found across 18 files

Copy link

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 introduces knip for automated detection of unused code and dependencies, resulting in cleaner codebase maintenance. The changes include removing unused utility files, pruning unused exports from various modules, and establishing knip as part of the development workflow.

  • Added knip configuration and integrated it into lint/format scripts and CI pipeline
  • Removed unused utility files (file.ts, schema.ts) and dependencies (fs-fixture, nano-spawn)
  • Converted public exports to internal types/interfaces where they weren't used externally

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
knip.config.ts New configuration file defining workspaces, entry points, and rules for knip
package.json Added knip scripts to lint/format workflows; removed unused @ai-sdk/openai from root devDependencies
lefthook.yaml Added knip to pre-commit hook for automatic cleanup on staged TypeScript files
.github/workflows/lint.yaml Added separate knip step to CI workflow
pnpm-workspace.yaml Updated catalog to include knip and remove unused dependencies
pnpm-lock.yaml Lockfile updates reflecting new knip dependency and removed packages
src/utils/file.ts Removed unused file utilities module (133 lines)
src/utils/schema.ts Removed unused JSON schema helper functions (39 lines)
src/utils/tfidf-index.ts Changed TfidfDocument and TfidfResult from exported to internal interfaces
src/types.ts Changed Headers, JsonSchemaType, and HttpExecuteParameter from exported to internal types
src/toolsets/index.ts Removed ToolSet from public exports (kept internal for inheritance)
src/toolsets/stackone.ts Changed FetchToolsOptions and WorkflowConfig from exported to internal interfaces
src/tool.ts Changed metaSearchTools and metaExecuteTool from exported to internal functions
src/rpc-client.ts Changed RpcActionRequest and RpcClientConfig to internal types; removed unused RpcActionResponseData export
examples/package.json Removed unused nano-spawn dependency
CLAUDE.md Updated documentation to reflect removal of file utilities
.claude/skills/file-operations/SKILL.md Renamed skill from "File Operations and HTTP Standards" to "HTTP Request Standards"
.cursor/rules/file-utils.mdc Removed entire file utilities documentation (111 lines)
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ryoppippi ryoppippi merged commit 9df963d into main Dec 9, 2025
9 checks passed
@ryoppippi ryoppippi deleted the feat/add-knip branch December 9, 2025 13:39
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.

add knip

3 participants