一键导入
handoff-pack
Generates structured Handoff Pack prompts for delegating work to Gemini with clear scope, acceptance criteria, and output format requirements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generates structured Handoff Pack prompts for delegating work to Gemini with clear scope, acceptance criteria, and output format requirements.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | handoff-pack |
| description | Generates structured Handoff Pack prompts for delegating work to Gemini with clear scope, acceptance criteria, and output format requirements. |
Generate well-structured prompts ("Handoff Packs") for delegating scoped work to Gemini, ensuring clear instructions, verifiable acceptance criteria, and parseable output format.
gemini-delegation agent after user approves delegationA complete Handoff Pack has these sections:
# Gemini Handoff Pack
## Session Context
- **Delegated By**: Claude Cloud Agent
- **Delegation ID**: [YYYYMMDD-HHMMSS-hash]
- **Project**: [repo name]
- **Branch**: [current branch]
## Allowed Scope
**You may ONLY modify these paths:**
src/features/user/.ts src/features/user/**/.test.ts
**You may NOT:**
- Modify files outside the allowed scope
- Change function signatures or public APIs
- Delete existing functionality
- Add new dependencies
- Modify configuration files
## Task Instructions
**Objective**: [Clear, specific, measurable objective]
**Context**: [Why this work is needed, background info]
**Pattern to Follow**:
```typescript
// === BEFORE ===
export function calculateTotal(items: Item[]): number {
return items.reduce((sum, item) => sum + item.price, 0);
}
// === AFTER ===
/**
* Calculates the total price of all items.
* @param items - Array of items with price property
* @returns Total price as a number
*/
export function calculateTotal(items: Item[]): number {
return items.reduce((sum, item) => sum + item.price, 0);
}
Apply this pattern to:
### 4. Acceptance Criteria
```markdown
## Acceptance Criteria
Before reporting completion, ALL of these must pass:
```bash
# TypeScript compilation (required)
npx tsc --noEmit
# Linting (required)
npm run lint
# OR: pnpm lint
# OR: yarn lint
# Tests (if applicable)
npm test -- --passWithNoTests
# OR: pnpm test
# OR: yarn test
Success means:
If any fail:
### 5. Output Format
```markdown
## Required Output Format
When complete, provide this EXACT format:
```markdown
## Gemini Completion Report
### Delegation ID
[same ID from Session Context]
### Files Modified
- `path/to/file1.ts` - Added JSDoc to 3 functions
- `path/to/file2.ts` - Added JSDoc to 5 functions
- `path/to/file3.ts` - Added JSDoc to 2 functions
### Commands Run
- `npx tsc --noEmit` - ✅ Passed
- `npm run lint` - ✅ Passed
- `npm test` - ✅ Passed (or N/A)
### Diff Summary
src/features/user/service.ts | 45 +++++++++++++++++++++ src/features/user/types.ts | 12 ++++++ src/features/user/utils.ts | 18 +++++++++ 3 files changed, 75 insertions(+)
### Notes
[Any decisions made, edge cases encountered, or observations]
### Escalations (if any)
[Items that need Cloud review - unclear patterns, security concerns, etc.]
### 6. Guardrails
```markdown
## Guardrails
⚠️ **STOP and report as Escalation** if you encounter:
1. **Unclear patterns** - Need architectural decision
2. **Business logic changes** - Beyond scope of delegation
3. **Security-sensitive code** - Auth, crypto, validation, secrets
4. **Breaking changes** - Would change public API behavior
5. **Cross-cutting concerns** - Changes ripple outside scope
6. **Dependency changes** - Package.json modifications needed
**How to escalate:**
```markdown
### Escalations
1. **File**: `src/features/user/auth.ts`
**Issue**: Contains password hashing logic - security sensitive
**Recommendation**: Skip this file, let Cloud handle
2. **Pattern unclear**: `src/features/user/legacy.ts`
**Issue**: Mixed export styles, unclear which to document
**Recommendation**: Clarify pattern before proceeding
Do NOT guess on escalation items. Report and skip.
## Instructions
### Generating a New Handoff Pack
**Input required:**
- Task description
- Scope (file patterns)
- Triage score (for context)
- Acceptance commands (auto-detected or specified)
**Process:**
1. **Detect project type:**
```bash
# Check for package.json
if [ -f "package.json" ]; then
PKG_MANAGER="npm"
[ -f "pnpm-lock.yaml" ] && PKG_MANAGER="pnpm"
[ -f "yarn.lock" ] && PKG_MANAGER="yarn"
fi
DELEGATION_ID="$(date +%Y%m%d-%H%M%S)-$(echo "$TASK" | md5sum | cut -c1-8)"
Build scope section from provided path patterns
Create before/after examples from existing code in scope
Add appropriate acceptance criteria based on project type
Include guardrails section (always)
When verification fails, generate a minimal fix-up pack:
# Gemini Fix-Up Pack
## Previous Delegation
- **Original ID**: [original delegation ID]
- **Fix-Up ID**: [new ID]
## Issues to Fix
### Issue 1: [Category]
**File**: `path/to/file.ts`
**Error**: [exact error message]
**Fix**: [specific instruction]
### Issue 2: [Category]
**File**: `path/to/file2.ts`
**Error**: [exact error message]
**Fix**: [specific instruction]
## After Fixes
Re-run verification:
```bash
npx tsc --noEmit
npm run lint
## Fix-Up Report
### Original Delegation ID
[id]
### Issues Fixed
- Issue 1: ✅ Fixed - [what was done]
- Issue 2: ✅ Fixed - [what was done]
### Verification
- `npx tsc --noEmit` - ✅ Passed
- `npm run lint` - ✅ Passed
### Notes
[Any additional context]
## Templates
### Template: Documentation Addition
```markdown
# Gemini Handoff Pack
## Session Context
- **Delegated By**: Claude Cloud Agent
- **Delegation ID**: {{DELEGATION_ID}}
- **Project**: {{PROJECT_NAME}}
## Allowed Scope
{{SCOPE_PATTERNS}}
**You may NOT:**
- Modify files outside scope
- Change any code logic
- Modify function signatures
## Task Instructions
**Objective**: Add JSDoc documentation to all exported functions
**Pattern**:
```typescript
// BEFORE
export function myFunction(param: Type): ReturnType {
// AFTER
/**
* Brief description of what the function does.
* @param param - Description of parameter
* @returns Description of return value
*/
export function myFunction(param: Type): ReturnType {
Rules:
export keyword)npx tsc --noEmit
{{PKG_MANAGER}} run lint
[Standard completion report format]
[Standard guardrails]
### Template: Rename/Replace
```markdown
# Gemini Handoff Pack
## Session Context
[standard]
## Allowed Scope
{{SCOPE_PATTERNS}}
## Task Instructions
**Objective**: Rename `{{OLD_NAME}}` to `{{NEW_NAME}}` across all files in scope
**What to rename:**
- Variable declarations
- Function parameters
- Object properties
- Type/interface properties
- Import/export statements
- String literals in specific contexts (specify)
**What NOT to rename:**
- Comments (unless referencing the identifier)
- String literals (unless confirmed as identifiers)
- External API calls
## Acceptance Criteria
```bash
npx tsc --noEmit # Must pass - catches missed renames
{{PKG_MANAGER}} run lint
{{PKG_MANAGER}} test
[Standard]
[Standard]
### Template: Type Hardening
```markdown
# Gemini Handoff Pack
## Session Context
- **Delegated By**: Claude Cloud Agent
- **Delegation ID**: {{DELEGATION_ID}}
- **Project**: {{PROJECT_NAME}}
- **Reference Skill**: `.claude/skills/quality/type-hardening/SKILL.md`
## Allowed Scope
{{SCOPE_PATTERNS}}
**You may ONLY modify files matching these patterns.**
## Task Instructions
**Objective**: Harden types by replacing string literals with enums and narrowing `any` to specific types.
**Priority Order:**
1. Prisma Enums (most reliable)
2. Shared Types (`shared/types/`, `@shared/types`)
3. Constants (`*.constants.ts`)
4. Create new types ONLY when genuinely needed
**Check existing types FIRST:**
```bash
# Prisma enums
grep -E "^enum " backend/prisma/schema.prisma
# Shared types
find shared/types -name "*.ts" -exec grep "export type\|export interface" {} \;
# Constants
find . -name "*.constants.ts" -exec cat {} \;
Pattern - String Literals:
// ❌ BEFORE
if (user.role === 'admin')
// ✅ AFTER
import { UserRole } from '../generated/prisma/index.js';
if (user.role === UserRole.admin)
Pattern - Any Types:
// ❌ BEFORE
const data: any = response.body;
// ✅ AFTER - narrow to SPECIFIC type
const data: UserPayload = response.body;
// ❌ WRONG - unknown is cheating, not fixing
const data: unknown = response.body; // NOT ALLOWED
Work in small batches (1-3 changes), verify after each.
# REQUIRED after EACH batch of changes
npx tsc --noEmit
# Before final completion
{{PKG_MANAGER}} run lint
If verification fails: STOP, report the error, do NOT proceed.
## Type Hardening Report
### Delegation ID
{{DELEGATION_ID}}
### Changes Applied
| File | Line | Before | After |
|------|------|--------|-------|
| auth.service.ts | 45 | `'admin'` | `UserRole.admin` |
| user.service.ts | 89 | `any` | `UserProfile` |
### Existing Types Used
- `UserRole` from `@prisma/client`
- `UserProfile` from `shared/types/user`
### New Types Created (if any)
- None (or list with justification)
### Verification
- `npx tsc --noEmit` - ✅ Passed
- `npm run lint` - ✅ Passed
### Remaining Opportunities
[List any skipped items with reason]
⚠️ STOP and escalate if:
any would require business logic changes⚠️ NEVER:
any with unknown (that's cheating, not fixing)
## Best Practices
1. **Scope narrowly** - Better to under-scope than over-scope
2. **Provide concrete examples** - Always include before/after from actual code
3. **Be explicit about boundaries** - What's allowed, what's forbidden
4. **Make acceptance criteria runnable** - Exact commands, not descriptions
5. **Require structured output** - Parseable completion reports
6. **Include escalation path** - Gemini should know when to stop
## Related Skills
- `gemini-api/caching` - For caching Gemini API calls
- `gemini-api/rate-limiting` - For managing API rate limits
## Related Agents
- `gemini-delegation` - Uses this skill to generate packs
Detect project stack, apply architecture patterns, wire quality gates, and scaffold features. Use when bootstrapping a project, adding a vertical slice, wiring CI/CD, adding Docker compose, or setting up quality gates.
Incrementally improve type safety by replacing string literals with enums, narrowing `any` types, and using shared types. Works in small verified batches. Preserves functionality while improving code quality.
Cloudflare DNS and infrastructure management. Manage DNS records, tunnels, Access policies, SSL certificates, and CDN caching.
Deploy projects to staging or production environments. Repo-agnostic deployment orchestration using SSH MCP for VPS operations and Cloudflare for DNS/SSL. Reads project configuration from deployments.registry.json.
Direct VPS operations via SSH MCP. Manage Docker containers, check logs, run commands, and troubleshoot services on registered VPS servers.
Generate a session briefing from development memory (events.jsonl, sessions.jsonl). Shows recent timeline, open questions, and suggested focus areas.