Skill: johnsmithfan/information-services (version 1.0.0)

--- name: "Information Services" slug: "information-services" version: "1.0.0" language: en description: | Unified information services hub combining location, weather, and time capabilities. Multi-source geolocation (GPS/IP/WiFi), fixed-point weather forecasts, and multi-source time reporting with confidence scoring. Single entry point for all location-aware services. license: MIT triggers: - location - weather - time - GPS coordinates - forecast - current time - where am i - what time is it - weather forecast interface: inputs: type: object schema: type: object properties: service: type: string enum: [location, weather, time, all] description: Which service to query location: type: string description: City name or coordinates (lat,lon) method: type: string description: Specific method (gps, system, ip, wifi, cellular) outputs: type: object schema: type: object properties: service_type: type: string description: location | weather | time data: type: object description: Service-specific result data confidence: type: number description: Confidence score 0-1 errors: - code: LOC_UNAVAILABLE message: No location source available - code: WEATHER_FAILED message: Weather API request failed - code: TIME_FAILED message: Time source unavailable - code: NO_CREDENTIALS message: Required API credentials missing quality: idempotent: true metadata: category: information standardized: true --- # Information Services v1.0.0 > Index & Quick Reference. Full specifications in [references/](references/). ## Quick Reference ### Role Unified hub for location, weather, and time services. Routes requests to the appropriate subsystem based on service type. ### Department Information ## Section Index - [Location Service](references/location.md) - [Weather Service](references/weather.md) - [Time Service](references/time.md) - [Coordination Logic](references/method-patterns.md#coordination) ## Services | Service | Capabilities | Source Skills | |---------|-------------|---------------| | **Location** | GPS, system, IP, WiFi, cellular triangulation | multi-source-locate | | **Weather** | Current conditions, forecast, multi-source fusion | locate-weather | | **Time** | System clock, NTP, web API, confidence scoring | multi-source-time | ## Prompts - [01-implement-method.md](prompts/01-implement-method.md) - [02-robustness-checks.md](prompts/02-robustness-checks.md) - [03-test-cases.md](prompts/03-test-cases.md) - [04-documentation.md](prompts/04-documentation.md) - [05-workflow-execution.md](prompts/05-workflow-execution.md) --- *See [references/](references/) for detailed service specifications.*

path: prompts/01-implement-method.md
content: # Information Services — Implementation Prompt

## Role
You are the Information Services hub. You provide unified access to location, weather, and time data through a single interface.

## Task
Process user requests for location, weather, or time information. Route to the appropriate service, fuse results from multiple sources, and return structured data with confidence scores.

## Context
- Department: Information
- Skill: information-services v1.0.0
- Services: location (GPS/IP/WiFi/cellular), weather (conditions/forecast), time (system/NTP/web)

## Process

### Step 1: Parse Intent
Identify the service type from user query:
- Location keywords: "where", "location", "coordinates", "GPS"
- Weather keywords: "weather", "forecast", "temperature", "rain"
- Time keywords: "time", "clock", "date", "when"
- Multiple or none: execute all services

### Step 2: Execute Service(s)
For each required service:
1. Check available methods/sources
2. Execute with appropriate parameters
3. Collect results with accuracy metadata

### Step 3: Compute Confidence
- Single source: confidence = source_base
- Multiple sources: triangulated confidence > any single source
- Failed sources: use next in fallback chain

### Step 4: Return Structured Output
```json
{
  "service_type": "location|weather|time|all",
  "data": { ... service-specific ... },
  "confidence": 0.0-1.0,
  "timestamp": "ISO8601"
}
```

## Output Format
Always return JSON with service_type, data, and confidence fields.

## Quality Checklist
- [ ] Intent correctly identified
- [ ] Best available sources used
- [ ] Fallback chain executed if primary fails
- [ ] Confidence score computed
- [ ] Results returned in < 5 seconds
- [ ] No credentials or PII in output

path: prompts/02-robustness-checks.md
content: # Information Services — Robustness Verification

## Pre-flight Checks
- [ ] Service type identified from intent
- [ ] At least one fallback source available
- [ ] API keys configured (if required for enhanced accuracy)
- [ ] Network connectivity confirmed (for external APIs)

## Edge Cases

| Case | Input | Expected | Handling |
|------|-------|----------|----------|
| GPS unavailable | Indoor query | System location | Fallback: system → ip |
| Weather API down | Weather request | Backup API | Fallback: wttr.in → open-meteo |
| NTP unreachable | Time request | System clock | Fallback: system → web API |
| No sources available | Any request | Error code | Return LOC_UNAVAILABLE / WEATHER_FAILED / TIME_FAILED |
| Triangulation conflict | Multiple methods differ >50m | Warning + best estimate | Use weighted centroid, flag confidence |

## Failure Modes

| Mode | Detection | Recovery |
|------|-----------|----------|
| All location sources fail | Confidence = 0 | Return error, suggest manual input |
| Primary weather API fails | HTTP error or timeout | Retry with backup, then IP-based |
| NTP timeout | > 500ms response | Fall back to system clock |
| Network unavailable | Connection error | Use cached/system data if available |

## Security Checklist
- [ ] No API keys in output
- [ ] No coordinates logged without request
- [ ] Rate limits respected (1 req/s for free APIs)
- [ ] Privacy: no PII in results

## Compliance Checklist
- [ ] License terms honored (MIT)
- [ ] Attribution preserved (wttr.in, open-meteo, etc.)
- [ ] Scope not exceeded (info retrieval only)

path: prompts/03-test-cases.md
content: # Information Services — Test Cases

## Location Tests

### TC-01: GPS Location
- Input: service=location, method=gps
- Expected: lat/lon with accuracy < 20m
- Pass: confidence > 0.7

### TC-02: IP Fallback
- Input: service=location, no GPS available
- Expected: city-level coordinates
- Pass: confidence > 0.5

### TC-03: Triangulation
- Input: service=location, methods=[gps,wifi,ip]
- Expected: weighted centroid with combined confidence
- Pass: confidence > max(individual_sources)

## Weather Tests

### TC-04: Current Weather
- Input: service=weather, location="Shanghai"
- Expected: temp, conditions, humidity, wind
- Pass: all fields populated, confidence > 0.7

### TC-05: Forecast
- Input: service=weather, days=3
- Expected: 3-day forecast array
- Pass: array of 3 entries with date/temp/conditions

### TC-06: API Fallback
- Input: service=weather, primary API unreachable
- Expected: data from backup API
- Pass: same fields, possibly lower confidence

## Time Tests

### TC-07: System Time
- Input: service=time
- Expected: current datetime with timezone
- Pass: within 2s of actual time

### TC-08: NTP Precision
- Input: service=time, precision=high
- Expected: accuracy_ms < 50
- Pass: confidence > 0.95

### TC-09: Timezone Conversion
- Input: service=time, timezone="Europe/London"
- Expected: correct local time for timezone
- Pass: matches public time API

## Combined Tests

### TC-10: All Services
- Input: service=all
- Expected: location + weather + time in single response
- Pass: all three data objects present

path: prompts/04-documentation.md
content: # Information Services — Documentation

## Overview
Unified information services hub combining location, weather, and time capabilities into a single skill.

## Services

### Location Service
Multi-source geolocation combining GPS, System, IP, WiFi, and Cellular methods with triangulated confidence scoring.

**Methods:**
- `GPS`: 3-10m accuracy, outdoor only
- `System`: 10m-1km, OS-managed, always available
- `IP`: 1-50km, city-level, internet required
- `WiFi`: 10-100m, indoor environments
- `Cellular`: 100m-3km, rural fallback
- `Triangulated`: Weighted centroid of multiple methods

### Weather Service
Fixed-point weather forecasts with multi-source data fusion.

**Data:** Current conditions, temperature, humidity, wind, 3-7 day forecast, AQI, UV index

**Sources:** wttr.in (default), Open-Meteo (backup)

### Time Service
Multi-source time with system/NTP/web API fusion and confidence scoring.

**Precision:** ±15ms (NTP), ±500ms (web API), OS-dependent (system)

## Usage Examples

```
# Get current location weather
service=weather, method=all

# Get precise time
service=time, precision=high

# Get coordinates
service=location, method=gps
```

## Configuration
No required API keys for basic operation. Optional keys for enhanced accuracy:
- `GOOGLE_GEOLOCATION_API_KEY` (WiFi/Cellular accuracy)
- `MLS_API_KEY` (Mozilla Location Service)
- `UNWIRED_API_KEY` (Unwired Labs)

path: prompts/05-workflow-execution.md
content: # Information Services — Workflow Execution

## Workflow: Get Current Location Weather

### Step 1: Get Location
```
1. Attempt GPS (--method gps --timeout 30)
2. If GPS fails, try System (--method system --timeout 20)
3. If System fails, use IP geolocation
4. Return coordinates with confidence score
```

### Step 2: Get Weather
```
1. Query wttr.in with coordinates
2. If timeout, retry with open-meteo
3. If all fail, return error WEATHER_FAILED
4. Return weather data with source and confidence
```

### Step 3: Combine & Report
```
1. Return { location, weather, confidence } object
2. If either service failed, use partial data with lower confidence
3. Report confidence score for transparency
```

## Workflow: Time Check with NTP Precision

### Step 1: System Clock
```
1. Read local system time (instant)
2. Record as baseline
3. Proceed to NTP if precision requested
```

### Step 2: NTP Query
```
1. Query NTP server (pool.ntp.org)
2. Calculate round-trip latency
3. Compute adjusted time
4. Compare with system time
```

### Step 3: Score & Return
```
1. If NTP successful: confidence = 0.98
2. If NTP fails: confidence = 0.85 (system only)
3. Return time object with all metadata
```

## Workflow: Handle No Sources Available

### Step 1: Log the failure
```
1. Record which sources were attempted
2. Note the failure reason (no hardware, no network, etc.)
```

### Step 2: Return error with context
```
1. Set confidence = 0
2. Include error code and message
3. Suggest manual input as recovery
4. Do NOT make up or estimate data
```

path: references/location.md
content: # Location Service — Detailed Specifications

> Part of information-services skill.

---

## 1. Supported Methods

| Method | Accuracy | Use Case | API Key Required |
|--------|----------|----------|-----------------|
| **GPS** | 3-10m | Outdoor, navigation | No |
| **System** | 10m–1km | Indoor/outdoor, OS-managed | No |
| **IP** | 1-50km | City-level, quick detection | No |
| **WiFi** | 10-100m | Indoor, urban environments | Optional |
| **Cellular** | 100m-3km | Rural, GPS-denied | Optional |
| **Triangulated** | Weighted centroid | Multi-method fusion | No |

## 2. Triangulation Algorithm

When multiple methods return results:
1. Collect coordinates from each successful method
2. Weight by inverse variance (accuracy-based weighting)
3. Compute weighted centroid as final position
4. Estimate combined accuracy from residual dispersion
5. Report confidence score (0–100%)

### Output Format
```json
{
  "latitude": 39.9042,
  "longitude": 116.4074,
  "accuracy_meters": 15,
  "confidence": 0.92,
  "method": "triangulated",
  "sources": {
    "gps": {"lat": 39.9045, "lon": 116.4071, "accuracy": 5, "weight": 0.6},
    "wifi": {"lat": 39.9039, "lon": 116.4078, "accuracy": 30, "weight": 0.3},
    "ip": {"lat": 39.9042, "lon": 116.4074, "accuracy": 5000, "weight": 0.1}
  },
  "timestamp": "2026-04-26T10:30:00Z"
}
```

## 3. Command Interface

```bash
# Get location using all available methods
python scripts/locate.py

# Use specific method(s)
python scripts/locate.py --method gps
python scripts/locate.py --method system,ip,wifi

# Output format
python scripts/locate.py --format json
python scripts/locate.py --format text
```

## 4. Optional API Keys

For enhanced accuracy, configure in environment:
```bash
export GOOGLE_GEOLOCATION_API_KEY="your-key"
export MLS_API_KEY="your-key"
export UNWIRED_API_KEY="your-key"
```

## 5. Platform Notes

- **Windows:** GeoCoordinateWatcher via PowerShell (WiFi + IP + GPS fusion)
- **macOS:** CoreLocation via locationd daemon
- **Linux:** GeoClue2 via D-Bus (Wi-Fi + cell fusion)

path: references/method-patterns.md
content: # Information Services -- Method Patterns & Coordination

> Overview document for information-services skill. Service-specific details in [location.md](location.md), [weather.md](weather.md), [time.md](time.md).

---

## 1. Trigger Scenarios

| Category | Triggers |
|----------|----------|
| Location | "where am I", "my coordinates", "get location", "GPS" |
| Weather | "weather", "forecast", "temperature", "rain" |
| Time | "what time is it", "current time", "time check" |
| Combined | "weather and time", "location and forecast" |
| Emergency | "emergency location", "SOS coordinates" |

## 2. Core Identity

**Role:** Unified information services hub. Single entry point for all location, weather, and time queries.

**Behavior:**
- Route to appropriate subsystem based on service type
- Use triangulation when multiple sources available
- Report confidence score for all results
- Graceful degradation when sources unavailable

## 3. Coordination Logic

### Request Routing

```
User query → Parse intent → Route to service → Execute → Score confidence → Return
```

### Intent → Service Mapping

| Intent Keywords | Service |
|----------------|---------|
| "where", "location", "coordinates", "GPS" | location |
| "weather", "forecast", "rain", "temperature" | weather |
| "time", "clock", "date", "when" | time |
| Multiple / none | all (sequential) |

### Fallback Chains

**Location:**
GPS → System → IP → WiFi → Cellular → Error(LOC_UNAVAILABLE)

**Weather:**
Primary API → Backup API → IP-location-based → Error(WEATHER_FAILED)

**Time:**
System → NTP → Web API → Error(TIME_FAILED)

## 4. Quality Metrics

| Metric | Target |
|--------|--------|
| Location accuracy | < 100m for triangulated |
| Weather freshness | < 30 min cache |
| Time accuracy | < 1s from NTP |
| Confidence scoring | ≥ 0.80 for all results |
| Fallback success rate | > 95% |

## 5. Constraints

- No persistent storage of location data
- No credential logging in output
- Rate-limit compliance for all external APIs
- Privacy: do not log coordinates without user request

path: references/time.md
content: # Time Service — Detailed Specifications

> Part of information-services skill.

---

## 1. Trigger Scenarios

| Scenario | Example Phrase |
|----------|----------------|
| Current time | "What time is it?" |
| Time check | "Report current time with confidence" |
| Timezone conversion | "What time is it in London?" |
| Precise time | "Accurate time via NTP" |

## 2. Multi-Source Time Fusion

### Source Priority

| Priority | Source | Accuracy | Latency |
|----------|--------|----------|---------|
| 1 | System clock | OS-dependent | Instant |
| 2 | NTP | ±10ms | 50-200ms |
| 3 | Web API (worldtimeapi, etc.) | ±500ms | 100-500ms |

### Workflow

1. Query system clock (instant, baseline)
2. If precision needed, query NTP server
3. If NTP fails, query web time API
4. Combine with confidence scoring
5. Return unified result

### Confidence Scoring

| Source | Base Confidence | Notes |
|--------|----------------|-------|
| System clock | 0.85 | OS-synced, may drift |
| NTP | 0.98 | Stratum-synchronized |
| Web API | 0.92 | Server-dependent |

### Output Format

```json
{
  "datetime": "2026-04-26T22:47:00+08:00",
  "timestamp": 1743084420,
  "timezone": "Asia/Hong_Kong",
  "sources": ["system", "ntp"],
  "confidence": 0.96,
  "accuracy_ms": 15
}
```

## 3. Voice Output (Optional)

When TTS is available and requested, optionally announce time in natural language:
- "It's 10:47 PM, Saturday, April 26th."
- Timezone-aware natural speech formatting

path: references/weather.md
content: # Weather Service — Detailed Specifications

> Part of information-services skill.

---

## 1. Trigger Scenarios

| Scenario | Example Phrase |
|----------|----------------|
| Current location weather | "What's the weather here?" |
| Fixed-point forecast | "Weather in Shanghai tomorrow" |
| Manual coordinates | "Weather at 39.9N, 116.4E" |
| Time-aware location | "Weather this evening" |

## 2. Workflow

1. **Geolocation** — Use location service to get coordinates (GPS → system → IP → WiFi → cellular)
2. **Weather lookup** — Query weather API with coordinates
3. **Multi-source fusion** — Combine multiple weather sources with confidence weighting
4. **Output** — Return structured weather data with confidence score

## 3. Supported Weather Data

| Data Point | Description |
|------------|-------------|
| Temperature | Current temp in Celsius |
| Conditions | sunny, cloudy, rainy, etc. |
| Humidity | Percentage |
| Wind | Speed and direction |
| Forecast | 3-7 day outlook |
| UV Index | UV radiation level |
| AQI | Air quality index |

## 4. Sources

- wttr.in (no API key required)
- Open-Meteo (no API key required)
- Custom weather API (if configured)

## 5. Error Handling

| Error | Action |
|-------|--------|
| No location available | Fall back to IP-based location |
| Weather API timeout | Retry with alternate source |
| All sources failed | Return error with partial data |

## 6. Output Format

```json
{
  "location": {"lat": 39.9042, "lon": 116.4074},
  "current": {
    "temp_c": 18,
    "conditions": "partly cloudy",
    "humidity": 65,
    "wind_kmh": 12
  },
  "forecast": [...],
  "confidence": 0.88,
  "source": "wttr.in"
}
```

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