dev

GitHub

提供开发工作流指南,涵盖构建、测试、代码规范及 Git Hooks 配置。用于初始化环境、执行测试及遵循项目约定。

.agents/skills/dev/SKILL.md serithemage/serverless-openclaw

Trigger Scenarios

设置开发环境 运行测试命令 遵循项目编码规范

Install

npx skills add serithemage/serverless-openclaw --skill dev -g -y
More Options

Non-standard path

npx skills add https://github.com/serithemage/serverless-openclaw/tree/main/.agents/skills/dev -g -y

Use without installing

npx skills use serithemage/serverless-openclaw@dev

指定 Agent (Claude Code)

npx skills add serithemage/serverless-openclaw --skill dev -a claude-code -g -y

安装 repo 全部 skill

npx skills add serithemage/serverless-openclaw --all -g -y

预览 repo 内 skill

npx skills add serithemage/serverless-openclaw --list

SKILL.md

Frontmatter
{
    "name": "dev",
    "description": "Development workflow guide. Covers build, test, lint, format commands, package structure, Git hooks, TDD methodology, and coding conventions. Use when setting up dev environment, running tests, or following project conventions.",
    "allowed-tools": "Read, Bash, Glob, Grep"
}

Development Workflow

Full guide: docs/development.md

Quick Command Reference

npm run build          # tsc --build (all packages via project references)
npm run lint           # eslint "packages/**/*.ts"
npm run format         # prettier
npm run test           # vitest run (unit tests, excludes *.e2e.test.ts)
npm run test:e2e       # vitest e2e (CDK synth E2E tests)
npm run skills:sync    # sync shared skills into Claude/Codex mirrors
npm run skills:check   # verify shared skill mirrors are in sync

# Single test file
npx vitest run packages/gateway/__tests__/handlers/ws-connect.test.ts

# Single test by name
npx vitest run -t "should verify JWT"

Package Structure (6 packages)

packages/
├── shared/      # Types + constants (TABLE_NAMES, BRIDGE_PORT, key prefixes)
├── cdk/         # CDK stacks (lib/stacks/)
├── gateway/     # 7 Lambda handlers (ws-connect/message/disconnect, telegram-webhook, api-handler, watchdog, prewarm)
├── container/   # Fargate container (Bridge server + OpenClaw JSON-RPC client)
├── lambda-agent/ # Lambda agent (Phase 2 — OpenClaw embedded in Lambda)
└── web/         # React SPA (Vite, amazon-cognito-identity-js for auth)

Git Hooks (husky)

Hook Checks
pre-commit npm run build + npm run lint + unit tests
pre-push E2E tests (CDK synth verification)

TDD Rules

  • Tests first for all packages except web
  • Write test → watch it fail → implement → watch it pass
  • Unit tests: packages/<pkg>/__tests__/
  • E2E tests: packages/<pkg>/__tests__/*.e2e.test.ts

Import Path Rule

TypeScript uses NodeNext module resolution. All imports must use .js extension:

// Correct
import { TABLE_NAMES } from "@serverless-openclaw/shared/constants.js";
import { routeMessage } from "../services/message.js";

// Wrong — omitting .js will fail at runtime
import { TABLE_NAMES } from "@serverless-openclaw/shared/constants";

Coding Conventions

  • DI pattern: Inject send function (same pattern as container package)
  • AWS SDK send binding: ddb.send.bind(ddb) as (cmd: any) => Promise<any> cast needed
  • vi.mock hoisting: Use vi.hoisted() when referencing variables in module-level mocks
  • npm workspaces: Use "*" for local dependencies ("workspace:*" is pnpm-only)
  • TypeScript: ES2022, Node16 module resolution, strict, composite builds

Version History

  • 504300d Current 2026-07-25 09:01

Same Skill Collection

.agents/skills/architecture/SKILL.md
.agents/skills/cold-start/SKILL.md
.agents/skills/context/SKILL.md
.agents/skills/cost/SKILL.md
.agents/skills/deploy/SKILL.md
.agents/skills/implement/SKILL.md
.agents/skills/lambda-migration/SKILL.md
.agents/skills/openclaw/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/security/SKILL.md
.agents/skills/solo-maintainer-guard/SKILL.md
.agents/skills/solo-maintainer-inbox/SKILL.md
.agents/skills/solo-maintainer/SKILL.md
.agents/skills/status/SKILL.md
.agents/skills/troubleshoot/SKILL.md
.claude/skills/architecture/SKILL.md
.claude/skills/cold-start/SKILL.md
.claude/skills/context/SKILL.md
.claude/skills/cost/SKILL.md
.claude/skills/deploy/SKILL.md
.claude/skills/dev/SKILL.md
.claude/skills/implement/SKILL.md
.claude/skills/lambda-migration/SKILL.md
.claude/skills/openclaw/SKILL.md
.claude/skills/release/SKILL.md
.claude/skills/security/SKILL.md
.claude/skills/solo-maintainer-guard/SKILL.md
.claude/skills/solo-maintainer-inbox/SKILL.md
.claude/skills/solo-maintainer/SKILL.md
.claude/skills/status/SKILL.md
.claude/skills/troubleshoot/SKILL.md
.codex/skills/architecture/SKILL.md
.codex/skills/cold-start/SKILL.md
.codex/skills/context/SKILL.md
.codex/skills/cost/SKILL.md
.codex/skills/deploy/SKILL.md
.codex/skills/dev/SKILL.md
.codex/skills/implement/SKILL.md
.codex/skills/lambda-migration/SKILL.md
.codex/skills/openclaw/SKILL.md
.codex/skills/release/SKILL.md
.codex/skills/security/SKILL.md
.codex/skills/solo-maintainer-guard/SKILL.md
.codex/skills/solo-maintainer-inbox/SKILL.md
.codex/skills/solo-maintainer/SKILL.md
.codex/skills/status/SKILL.md
.codex/skills/troubleshoot/SKILL.md

Metadata

Files
0
Version
504300d
Hash
b70f4ad1
Indexed
2026-07-25 09:01

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 08:04
浙ICP备14020137号-1 $Гость$