Skip to content
wuxing-dress-colors logo

五行穿衣功能開發指南

wuxing-dress-colors

五行穿衣功能開發指南。包含天干地支計算、五行穿衣吉凶算法、星座運勢相位計算。當用戶需要:(1) 開發五行相關功能、(2) 農曆/干支計算、(3) 占星學星座運勢時使用此 skill。

NeverSight/skills_feed0installs215stars

SKILL.md

Full skill instructions

五行穿衣功能開發指南

專案資訊(新架構 2026-01-17)

項目路徑/​URL
Webhook URLhttps://lt4.mynet.com.tw/​linebot/​wuxing/​webhook.php
伺服器路徑/​home/​lt4.mynet.com.tw/​public_html/​linebot/​wuxing/
核心程式庫/​home/​lt4.mynet.com.tw/​linebot_core/

檔案結構

/​home/​lt4.mynet.com.tw/​public_html/​linebot/​wuxing/
├── config.php               # 獨立設定
├── webhook.php              # Webhook 入口
├── handlers/
│   └── MainHandler.php      # 主處理器
├── lunar.php                # 農曆轉換、天干地支計算
├── wuxing.php               # 五行吉凶、星座運勢、Flex Message
└── data/
    ├── sessions.json
    └── analytics.json

核心算法

1. 五行穿衣 - 使用日地支(非日天干)

重要:五行穿衣的標準算法是使用「日地支」而非「日天干」。

日地支五行對應:
子、亥 → 水
丑、辰、未、戌 → 土
寅、卯 → 木
巳、午 → 火
申、酉 → 金

五行吉凶公式:

大吉色(旺運)= 我生者(當日五行所生的五行)
次吉色(好運)= 與當日五行相同
平平色 = 剋我者
較差色(耗能)= 生我者
不宜色(NG)= 我剋者

五行相生順序:木 → 火 → 土 → 金 → 水 → 木

範例計算:

  • 午日(午=火)
  • 大吉 = 火生土 → 土(黃色系)✓
  • 次吉 = 火 → 火(紅色系)
  • 不宜 = 火剋金 → 金(白色系)

參考來源:

2. 星座運勢 - 基於占星學相位理論

使用當日太陽星座計算各星座吉凶:

相位與吉凶對應:

相位角度元素關係吉凶
Trine(三分相)120°同元素特吉
Sextile(六分相)60°相容元素次吉
Square(四分相)90°挑戰元素注意

元素分組:

  • 火象:白羊、獅子、射手
  • 土象:金牛、處女、魔羯
  • 風象:雙子、天秤、水瓶
  • 水象:巨蟹、天蠍、雙魚

元素相容關係:

  • 火 ↔ 風(相容)
  • 土 ↔ 水(相容)
  • 火 × 水、土 × 風(挑戰)

參考來源:

時區問題

伺服器可能使用 UTC 時區,導致日期計算錯誤。

解決方案:在程式開頭設定時區

date_default_timezone_set('Asia/​Taipei');

即時產圖時間參考

方法耗時適用場景
Flex Message 色塊< 5ms簡單色彩展示 ✅
PHP GD 文字圖10-50ms動態文字 ✅
QuickChart API100-500ms圖表 ⚠️
外部 AI 繪圖5-30秒❌ 需異步

LINE Webhook 建議在 1 秒內回應

關鍵函數

lunar.php

  • LunarCalendar::solarToLunar($year, $month, $day) - 西曆轉農曆
  • LunarCalendar::getGanZhi($year, $month, $day) - 取得干支(含 dayZhiIdx)
  • LunarCalendar::getFullDateInfo() - 取得完整日期資訊

wuxing.php

  • WuXing::calculateDressColors($dayZhiIdx) - 計算五行穿衣顏色
  • WuXing::calculateZodiacHoroscope($month, $day) - 計算星座運勢
  • WuXing::generateFlexMessage() - 產生今日 Flex Message
  • WuXing::generateTomorrowFlexMessage() - 產生明日 Flex Message

相關 Skill

  • linebot-architecture:LINE Bot 架構規範(Flex Message 限制和技巧請參考此 skill)
  • linebot-setup:LINE Bot 設定與除錯
  • quiz-builder:題庫系統專用指南

More skills from NeverSight

devops-deployer logo
NeverSight/skills_feed

devops-deployer

Comprehensive DevOps and deployment workflow that orchestrates infrastructure automation, CI/CD pipelines, container orchestration, and cloud deployment. Handles everything from infrastructure as code and pipeline setup to monitoring, scaling, and disaster recovery.

215 1
View
avnu logo
NeverSight/skills_feed

avnu

Integrate avnu SDK for Starknet DeFi: token swaps with best-price routing, DCA recurring buys, native staking, gasless transactions via paymaster, and market data. Use when building Starknet trading, DEX aggregation, or DeFi automation features.

215 0
View
post-to-x logo
NeverSight/skills_feed

post-to-x

发布内容和文章到 X (Twitter)。支持带图片的普通推文和 X Articles(长文)。使用真实的 Chrome 和 CDP 来绕过自动化检测。

215 0
View
ralph-prompt-builder logo
NeverSight/skills_feed

ralph-prompt-builder

Master orchestrator for generating Ralph Wiggum-compatible prompts. Analyzes task requirements and routes to appropriate generator (single-task, multi-task, project, or research). Use when you need to create any Ralph loop prompt and want automatic selection of the right generator.

215 0
View
branch-comparison logo
NeverSight/skills_feed

branch-comparison

Use when the user asks to compare branches, analyze git diffs, review changes between branches, update specifications based on code changes, or analyze what changed. Triggers on keywords like "compare branches", "git diff", "what changed", "branch comparison", "code changes", "spec update".

215 0
View
fastapi-development logo
NeverSight/skills_feed

fastapi-development

Build high-performance FastAPI applications with async routes, validation, dependency injection, security, and automatic API documentation. Use when developing modern Python APIs with async support, automatic OpenAPI documentation, and high performance requirements.

215 0
View
zendesk-chat logo
NeverSight/skills_feed

zendesk-chat

Enables Claude to manage Zendesk Chat conversations, support tickets, and customer service operations

215 0
View
forge logo
NeverSight/skills_feed

forge

Mine transcripts for knowledge - decisions, learnings, failures, patterns. Triggers: "forge insights", "mine transcripts", "extract knowledge".

215 0
View
mixpanel logo
NeverSight/skills_feed

mixpanel

Track product analytics and user behavior with Mixpanel's event-based platform.

215 0
View
ocpp logo
NeverSight/skills_feed

ocpp

OCPP protocol reference for EV charging infrastructure development. Covers OCPP 2.0.1 and OCPP 1.6J. Use when working with OCPP messages, charging station code, CSMS/Central System backends, smart charging, transaction handling, or EV charging protocols. Activates on keywords: OCPP, charging stat...

215 0
View
bee-collect logo
NeverSight/skills_feed

bee-collect

Gather scattered ideas into organized GitHub issues. The bee collects pollen from every flower, checks if the hive already has it, and carefully deposits new work in the comb for later. Never edits code—only organizes the work ahead. Use when creating issues from TODOs or planning work.

215 0
View
vercel-react-native-skills logo
NeverSight/skills_feed

vercel-react-native-skills

Comprehensive best practices for React Native and Expo applications. Contains rules across multiple categories covering performance, animations, UI patterns, and platform-specific optimizations.

215 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View