Skill: terrycarter1985/greeting-skill (version 1.0.0)

--- name: greeting-skill emoji: 👋 description: A friendly greeting skill that provides personalized and time-based greetings version: 1.0.0 author: orlyjamie tags: - utility - social triggers: - greet - hello - hi - good morning - good afternoon - good evening metadata: openclaw: requires: kind: node package: typescript --- # Greeting Skill A simple skill that provides friendly personalized greetings. Supports both random generic greetings and time-based contextual greetings. ## Tools ### greet Generates a random friendly greeting for a user **Parameters:** - `name` (string, required): The name of the person to greet **Returns:** A random greeting string **Example:** > User: greet Alice > Agent: Hello, Alice! Hope you're having a great day! 👋 ### getTimeBasedGreeting Generates a greeting appropriate for the current time of day **Parameters:** - `name` (string, required): The name of the person to greet **Returns:** A time-appropriate greeting (morning/afternoon/evening) **Example:** > User: greet Bob (at 10 AM) > Agent: Good morning, Bob!

path: README.md
content: # Greeting Skill for Clawd Bot

A simple, friendly greeting skill that provides personalized greetings for users of the Clawd personal AI assistant.

## Features

- Random generic greetings
- Time-based contextual greetings (morning/afternoon/evening)
- Fully compatible with OpenClaw skill specification

## Installation

```bash
npx clawhub install greeting-skill
```

## Usage

The skill responds to natural language triggers like "greet", "hello", "hi", "good morning", etc. You can also call the tools directly:

### Random greeting
```
greet [name]
```

### Time-based greeting
```
time-greet [name]
```

## Development

### Prerequisites
- Node.js 18+
- TypeScript 5+
- @openclaw/core

### Build
```bash
npm run build
```

### Watch mode
```bash
npm run dev
```

### Type check
```bash
npm run typecheck
```

### Test
```bash
npm test
```

## License

MIT


path: package.json
content: {
  "name": "greeting-skill",
  "version": "1.0.0",
  "description": "A friendly greeting skill for Clawd bot",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "scripts": {
    "build": "tsc",
    "dev": "tsc --watch",
    "typecheck": "tsc --noEmit",
    "test": "openclaw skill test"
  },
  "keywords": [
    "openclaw",
    "clawd",
    "skill",
    "greeting"
  ],
  "author": "orlyjamie",
  "license": "MIT",
  "dependencies": {
    "@openclaw/core": "^1.2.0"
  },
  "devDependencies": {
    "typescript": "^5.4.0",
    "@types/node": "^20.0.0"
  }
}


path: src/index.ts
content: import { ClawSkill, SkillContext, SkillResponse } from '@openclaw/core';

/**
 * Generate a random friendly greeting
 */
function greet(name: string): string {
  const greetings = [
    `Hello, ${name}!`,
    `Hey there, ${name}!`,
    `Hi ${name}, nice to see you!`,
    `Greetings, ${name}!`,
  ];
  const randomIndex = Math.floor(Math.random() * greetings.length);
  return greetings[randomIndex];
}

/**
 * Generate a greeting appropriate for the current time of day
 */
function getTimeBasedGreeting(name: string): string {
  const hour = new Date().getHours();
  if (hour < 12) {
    return `Good morning, ${name}!`;
  } else if (hour < 17) {
    return `Good afternoon, ${name}!`;
  } else {
    return `Good evening, ${name}!`;
  }
}

/**
 * Greeting skill implementation
 */
export class GreetingSkill extends ClawSkill {
  constructor() {
    super();
    this.registerTool('greet', this.greetTool.bind(this));
    this.registerTool('getTimeBasedGreeting', this.timeBasedGreetTool.bind(this));
  }

  private async greetTool(context: SkillContext): Promise<SkillResponse> {
    const name = context.parameters.name as string;
    if (!name) {
      return {
        success: false,
        error: 'Name parameter is required',
      };
    }
    return {
      success: true,
      data: greet(name),
    };
  }

  private async timeBasedGreetTool(context: SkillContext): Promise<SkillResponse> {
    const name = context.parameters.name as string;
    if (!name) {
      return {
        success: false,
        error: 'Name parameter is required',
      };
    }
    return {
      success: true,
      data: getTimeBasedGreeting(name),
    };
  }
}

export default new GreetingSkill();
export { greet, getTimeBasedGreeting };


path: tsconfig.json
content: {
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "lib": ["ES2020"],
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": true,
    "resolveJsonModule": true
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules", "dist"]
}


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)