improvement(repo): update ship skills, flatten internal tools contracts dir (#4379)

* improvement(repo): update ship skills, flatten internal tools contracts dir

* update baselines

* address comments
This commit is contained in:
Vikhyath Mondreti
2026-05-01 12:08:00 -07:00
committed by GitHub
parent a9c12a2b36
commit b10b4479fe
40 changed files with 71 additions and 67 deletions
+10 -9
View File
@@ -13,21 +13,20 @@ When the user runs `/ship`:
1. **Check git status** - See what files have changed
2. **Generate a commit message** following this format: `type(scope): description`
- Types: `fix`, `feat`, `improvement`, `chore`
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
- Keep it concise
3. **Run lint** - Run `bun run lint` from the repo root to fix formatting issues before staging
- Types: `fix`, `feat`, `improvement`, `chore`
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
- Keep it concise
3. **Run pre-ship checks** from the repo root before staging:
- `bun run lint` to fix formatting issues
- `bun run check:api-validation:strict` to catch boundary contract failures before CI
4. **Stage and commit** the changes with the generated message
5. **Push to origin** using the current branch name
6. **Create a PR** to staging with a description in the user's voice
## Commit Message Format
Based on the repo's commit history:
```
fix(scope): description for bug fixes
feat(scope): description for new features
@@ -61,6 +60,7 @@ Tested manually (or describe testing)
## PR Creation Command
Use this command structure:
```bash
gh pr create --base staging --title "COMMIT_MESSAGE" --body "PR_BODY"
```
@@ -77,6 +77,7 @@ gh pr create --base staging --title "COMMIT_MESSAGE" --body "PR_BODY"
- Short, direct bullet points
- No unnecessary explanation
- "Tested manually" is acceptable for testing section
- "Tested manually" is acceptable for testing section; include lint and boundary validation results when run
- Checkboxes filled in appropriately
- No screenshots section unless UI changes
+4 -2
View File
@@ -17,7 +17,9 @@ When the user runs `/ship`:
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
- Keep it concise
3. **Run lint** - Run `bun run lint` from the repo root to fix formatting issues before staging
3. **Run pre-ship checks** from the repo root before staging:
- `bun run lint` to fix formatting issues
- `bun run check:api-validation:strict` to catch boundary contract failures before CI
4. **Stage and commit** the changes with the generated message
@@ -77,6 +79,6 @@ gh pr create --base staging --title "COMMIT_MESSAGE" --body "PR_BODY"
- Short, direct bullet points
- No unnecessary explanation
- "Tested manually" is acceptable for testing section
- "Tested manually" is acceptable for testing section; include lint and boundary validation results when run
- Checkboxes filled in appropriately
- No screenshots section unless UI changes
+4 -2
View File
@@ -12,7 +12,9 @@ When the user runs `/ship`:
- Scope: short identifier (e.g., `undo-redo`, `api`, `ui`)
- Keep it concise
3. **Run lint** - Run `bun run lint` from the repo root to fix formatting issues before staging
3. **Run pre-ship checks** from the repo root before staging:
- `bun run lint` to fix formatting issues
- `bun run check:api-validation:strict` to catch boundary contract failures before CI
4. **Stage and commit** the changes with the generated message
@@ -72,6 +74,6 @@ gh pr create --base staging --title "COMMIT_MESSAGE" --body "PR_BODY"
- Short, direct bullet points
- No unnecessary explanation
- "Tested manually" is acceptable for testing section
- "Tested manually" is acceptable for testing section; include lint and boundary validation results when run
- Checkboxes filled in appropriately
- No screenshots section unless UI changes
@@ -2,7 +2,7 @@ import type { Task } from '@a2a-js/sdk'
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient } from '@/lib/a2a/utils'
import { a2aCancelTaskContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aCancelTaskContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient } from '@/lib/a2a/utils'
import { a2aDeletePushNotificationContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aDeletePushNotificationContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient } from '@/lib/a2a/utils'
import { a2aGetAgentCardContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aGetAgentCardContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient } from '@/lib/a2a/utils'
import { a2aGetPushNotificationContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aGetPushNotificationContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
+1 -1
View File
@@ -2,7 +2,7 @@ import type { Task } from '@a2a-js/sdk'
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient } from '@/lib/a2a/utils'
import { a2aGetTaskContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aGetTaskContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -9,7 +9,7 @@ import type {
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient, extractTextContent, isTerminalState } from '@/lib/a2a/utils'
import { a2aResubscribeContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aResubscribeContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -4,7 +4,7 @@ import { toError } from '@sim/utils/errors'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient, extractTextContent, isTerminalState } from '@/lib/a2a/utils'
import { a2aSendMessageContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aSendMessageContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { validateUrlWithDNS } from '@/lib/core/security/input-validation.server'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { createA2AClient } from '@/lib/a2a/utils'
import { a2aSetPushNotificationContract } from '@/lib/api/contracts/tools/internal/a2a'
import { a2aSetPushNotificationContract } from '@/lib/api/contracts/tools/a2a'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
import { validateUrlWithDNS } from '@/lib/core/security/input-validation.server'
@@ -1,6 +1,6 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { cursorDownloadArtifactContract } from '@/lib/api/contracts/tools/internal/cursor'
import { cursorDownloadArtifactContract } from '@/lib/api/contracts/tools/cursor'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import {
+1 -1
View File
@@ -1,6 +1,6 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { docusignToolContract } from '@/lib/api/contracts/tools/internal/docusign'
import { docusignToolContract } from '@/lib/api/contracts/tools/docusign'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -2,7 +2,7 @@ import type { ItemCreateParams } from '@1password/sdk'
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordCreateItemContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordCreateItemContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordDeleteItemContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordDeleteItemContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordGetItemContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordGetItemContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordGetVaultContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordGetVaultContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordListItemsContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordListItemsContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordListVaultsContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordListVaultsContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -2,7 +2,7 @@ import type { Item } from '@1password/sdk'
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordReplaceItemContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordReplaceItemContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordResolveSecretContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordResolveSecretContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,7 +1,7 @@
import { createLogger } from '@sim/logger'
import { generateId } from '@sim/utils/id'
import { type NextRequest, NextResponse } from 'next/server'
import { onePasswordUpdateItemContract } from '@/lib/api/contracts/tools/internal/onepassword'
import { onePasswordUpdateItemContract } from '@/lib/api/contracts/tools/onepassword'
import { parseRequest, validationErrorResponse } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,6 +1,6 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { quiverImageToSvgContract } from '@/lib/api/contracts/tools/internal/quiver'
import { quiverImageToSvgContract } from '@/lib/api/contracts/tools/quiver'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -1,6 +1,6 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { quiverTextToSvgContract } from '@/lib/api/contracts/tools/internal/quiver'
import { quiverTextToSvgContract } from '@/lib/api/contracts/tools/quiver'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -6,7 +6,7 @@ import {
assertSafeSapExternalUrl,
type SapS4HanaProxyRequest,
sapS4HanaProxyContract,
} from '@/lib/api/contracts/tools/internal/sap'
} from '@/lib/api/contracts/tools/sap'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { generateRequestId } from '@/lib/core/utils/request'
@@ -1,7 +1,7 @@
import type { Stagehand as StagehandType } from '@browserbasehq/stagehand'
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { stagehandAgentContract } from '@/lib/api/contracts/tools/internal/stagehand'
import { stagehandAgentContract } from '@/lib/api/contracts/tools/stagehand'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { env } from '@/lib/core/config/env'
@@ -1,7 +1,7 @@
import type { Stagehand as StagehandType } from '@browserbasehq/stagehand'
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { stagehandExtractContract } from '@/lib/api/contracts/tools/internal/stagehand'
import { stagehandExtractContract } from '@/lib/api/contracts/tools/stagehand'
import { getValidationErrorMessage, parseRequest } from '@/lib/api/server'
import { checkInternalAuth } from '@/lib/auth/hybrid'
import { env } from '@/lib/core/config/env'
+1 -1
View File
@@ -1,6 +1,6 @@
import { createLogger } from '@sim/logger'
import { type NextRequest, NextResponse } from 'next/server'
import { thinkingToolContract } from '@/lib/api/contracts/tools/internal/thinking'
import { thinkingToolContract } from '@/lib/api/contracts/tools/thinking'
import { parseRequest } from '@/lib/api/server'
import { generateRequestId } from '@/lib/core/utils/request'
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
@@ -1,5 +1,5 @@
import { z } from 'zod'
import { internalToolResponseSchema } from '@/lib/api/contracts/tools/internal/shared'
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
import { defineRouteContract } from '@/lib/api/contracts/types'
const a2aBaseBodySchema = z.object({
@@ -53,7 +53,7 @@ export const a2aGetAgentCardContract = defineRouteContract({
body: a2aGetAgentCardBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -63,7 +63,7 @@ export const a2aSendMessageContract = defineRouteContract({
body: a2aSendMessageBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -73,7 +73,7 @@ export const a2aGetTaskContract = defineRouteContract({
body: a2aGetTaskBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -83,7 +83,7 @@ export const a2aCancelTaskContract = defineRouteContract({
body: a2aCancelTaskBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -93,7 +93,7 @@ export const a2aResubscribeContract = defineRouteContract({
body: a2aResubscribeBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -103,7 +103,7 @@ export const a2aSetPushNotificationContract = defineRouteContract({
body: a2aSetPushNotificationBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -113,7 +113,7 @@ export const a2aGetPushNotificationContract = defineRouteContract({
body: a2aGetPushNotificationBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -123,6 +123,6 @@ export const a2aDeletePushNotificationContract = defineRouteContract({
body: a2aDeletePushNotificationBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -1,5 +1,5 @@
import { z } from 'zod'
import { internalToolResponseSchema } from '@/lib/api/contracts/tools/internal/shared'
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
import { defineRouteContract } from '@/lib/api/contracts/types'
export const cursorDownloadArtifactBodySchema = z.object({
@@ -14,6 +14,6 @@ export const cursorDownloadArtifactContract = defineRouteContract({
body: cursorDownloadArtifactBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
+9 -1
View File
@@ -1,20 +1,28 @@
export * from './a2a'
export * from './agiloft'
export * from './asana'
export * from './communication'
export * from './crowdstrike'
export * from './cursor'
export * from './custom'
export * from './databases'
export * from './docusign'
export * from './evernote'
export * from './file'
export * from './firecrawl'
export * from './github'
export * from './google'
export * from './imap'
export * from './internal'
export * from './mail'
export * from './media'
export * from './microsoft'
export * from './onepassword'
export * from './pipedrive'
export * from './quiver'
export * from './sap'
export * from './search'
export * from './shared'
export * from './stagehand'
export * from './thinking'
export * from './workday'
export * from './zoom'
@@ -1,9 +0,0 @@
export * from '@/lib/api/contracts/tools/internal/a2a'
export * from '@/lib/api/contracts/tools/internal/cursor'
export * from '@/lib/api/contracts/tools/internal/docusign'
export * from '@/lib/api/contracts/tools/internal/onepassword'
export * from '@/lib/api/contracts/tools/internal/quiver'
export * from '@/lib/api/contracts/tools/internal/sap'
export * from '@/lib/api/contracts/tools/internal/shared'
export * from '@/lib/api/contracts/tools/internal/stagehand'
export * from '@/lib/api/contracts/tools/internal/thinking'
@@ -1,5 +1,5 @@
import { z } from 'zod'
import { internalToolResponseSchema } from '@/lib/api/contracts/tools/internal/shared'
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
import { defineRouteContract } from '@/lib/api/contracts/types'
import { FileInputSchema } from '@/lib/uploads/utils/file-schemas'
@@ -34,7 +34,7 @@ export const quiverTextToSvgContract = defineRouteContract({
body: quiverTextToSvgBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -44,6 +44,6 @@ export const quiverImageToSvgContract = defineRouteContract({
body: quiverImageToSvgBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -1,5 +1,5 @@
import { z } from 'zod'
import { internalToolResponseSchema } from '@/lib/api/contracts/tools/internal/shared'
import { genericToolResponseSchema } from '@/lib/api/contracts/tools/shared'
import { defineRouteContract } from '@/lib/api/contracts/types'
const sapHttpMethodSchema = z.enum(['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'MERGE'])
@@ -270,6 +270,6 @@ export const sapS4HanaProxyContract = defineRouteContract({
body: sapS4HanaProxyBodySchema,
response: {
mode: 'json',
schema: internalToolResponseSchema,
schema: genericToolResponseSchema,
},
})
@@ -1,6 +1,6 @@
import { z } from 'zod'
export const internalToolResponseSchema = z
export const genericToolResponseSchema = z
.object({
success: z.boolean().optional(),
output: z.unknown().optional(),
+2 -2
View File
@@ -9,8 +9,8 @@ const QUERY_HOOKS_DIR = path.join(ROOT, 'apps/sim/hooks/queries')
const SELECTOR_HOOKS_DIR = path.join(ROOT, 'apps/sim/hooks/selectors')
const BASELINE = {
totalRoutes: 716,
zodRoutes: 716,
totalRoutes: 717,
zodRoutes: 717,
nonZodRoutes: 0,
} as const