@clawhub-bytesagain3-5bff6becb8
拼多多商品文案。标题优化、详情页、SKU描述、百亿补贴文案、价格战策略、评价回复、秒杀文案。Pinduoduo listing generator with title optimization, detail page, SKU descriptions, pricing strategy, review re...
--- version: "2.0.0" name: Pinduoduo Listing description: "拼多多商品文案。标题优化、详情页、SKU描述、百亿补贴文案、价格战策略、评价回复、秒杀文案。Pinduoduo listing generator with title optimization." 拼多多商品文案。标题优化、详情页、SKU描述、百亿补贴文案、价格战策略、评价回复、秒杀文案。Pinduoduo listing generator with title optimization, detail page, SKU descriptions, pricing strategy, review replies, seckill copy. 拼多多运营、电商文案、商品上架、价格策略、凑单满减。Use when listing products on Pinduoduo. author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Pinduoduo Listing 拼多多商品文案。标题优化、详情页、SKU描述、百亿补贴文案、价格战策略、评价回复、秒杀文案。Pinduoduo listing generator with title optimization, detail page, SKU descriptions, pricing strategy, review replies, seckill copy. 拼多多运营、电商文案、商品上架、价格策略、凑单满减。Use when listing products on Pinduoduo. ## 与手动操作对比 | | 手动 | 使用本工具 | |---|---|---| | 时间 | 数小时 | 几分钟 | | 专业度 | 取决于经验 | 专业级输出 | | 一致性 | 易遗漏 | 标准化模板 | ## 专业建议 - ``` - 引流款(亏本/微利)→ 走量款(微利)→ 利润款(主要盈利)→ 形象款(品牌溢价) - % 40% 30% 10% - ``` - 引流款拉低起售价,吸引点击和搜索排名 --- *Pinduoduo Listing by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Commands Run `pinduoduo-listing help` to see all available commands. FILE:scripts/pdd.sh #!/usr/bin/env bash # pdd.sh - 拼多多商品标题和文案生成器 set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" CMD="-help" shift 2>/dev/null || true python3 - "$CMD" "$@" << 'PYTHON_EOF' # -*- coding: utf-8 -*- import sys import random def show_help(): print(""" ==================================== 拼多多文案生成器 pdd.sh ==================================== 用法: pdd.sh title "产品名" "关键词1,关键词2" 拼多多标题(强调性价比) pdd.sh desc "产品名" 商品描述(突出实惠、划算) pdd.sh group "产品名" "价格" 拼团文案 pdd.sh compare "产品名" "竞品价格" 价格对比文案 pdd.sh price-war "产品名" "竞品价格" 价格策略(定价+凑单满减设计) pdd.sh review-reply "评价类型" 评价回复(好评/差评/追评) pdd.sh seckill "产品名" 秒杀/限时购文案 pdd.sh help 显示本帮助 示例: pdd.sh title "无线充电器" "快充,苹果,安卓通用" pdd.sh desc "无线充电器" pdd.sh group "无线充电器" "29.9" pdd.sh compare "无线充电器" "99" pdd.sh price-war "无线充电器" "89" pdd.sh review-reply "好评" pdd.sh review-reply "差评" pdd.sh seckill "无线充电器" """) def gen_title(product, keywords_str): keywords = [k.strip() for k in keywords_str.split(",") if k.strip()] print("=" * 50) print(" 拼多多爆款标题生成 - {}".format(product)) print("=" * 50) print("") print("关键词: {}".format(", ".join(keywords))) print("") pdd_prefixes = ["【百亿补贴】", "【限时秒杀】", "【工厂直发】", "【全网最低】", "【今日特价】", "【拼团价】"] pdd_modifiers = ["超值", "特惠", "划算", "实惠", "厂家直销", "批发价", "清仓"] pdd_suffixes = ["包邮", "买一送一", "限时抢购", "拼团更便宜", "厂家直发"] for i in range(5): prefix = random.choice(pdd_prefixes) mod = random.choice(pdd_modifiers) kw_sample = random.sample(keywords, min(len(keywords), random.randint(1, max(1, len(keywords))))) suffix = random.choice(pdd_suffixes) title = "{prefix}{product} {mod} {kws} {suffix}".format( prefix=prefix, product=product, mod=mod, kws=" ".join(kw_sample), suffix=suffix ) if len(title) > 30: title = title[:30] print("标题{num}: {title}".format(num=i+1, title=title)) print(" 字数: {n}字".format(n=len(title))) print("") print("💡 拼多多标题技巧:") print(" - 突出「价格优势」和「性价比」") print(" - 加入「百亿补贴」「工厂直发」等拼多多特色词") print(" - 关键词覆盖要广,利于搜索曝光") print(" - 避免敏感词和极限词(最、第一等)") def gen_desc(product): print("=" * 50) print(" 拼多多商品描述 - {}".format(product)) print("=" * 50) print("") descs = [ { "style": "实惠型", "text": ( "🔥 {product} | 工厂直发,省去中间商差价!\n\n" "💰 为什么我们的价格这么低?\n" "因为我们是厂家直营!没有经销商加价,没有品牌溢价,\n" "把省下来的钱全部让利给消费者!\n\n" "✅ 品质保证\n" " · 与大牌同厂同线生产\n" " · 严格质检,残次品绝不出厂\n" " · 支持7天无理由退换\n\n" "✅ 超值体验\n" " · 买到就是赚到\n" " · 自用送人都合适\n" " · 拼团价更便宜\n\n" "📦 全国包邮 | 48小时发货 | 售后无忧" ).format(product=product), }, { "style": "促销型", "text": ( "🎉 {product} 限时特惠,手慢无!\n\n" "⏰ 活动时间有限,抢完即恢复原价!\n\n" "🌟 产品亮点:\n" " 1. 大牌品质,平民价格\n" " 2. 厂家直供,品质看得见\n" " 3. 老客复购率超高,好评如潮\n" " 4. 拼团购买更划算\n\n" "💪 我们的承诺:\n" " ✅ 正品保障,假一赔十\n" " ✅ 7天无理由退换\n" " ✅ 全国包邮(偏远地区除外)\n" " ✅ 专业客服,有问必答\n\n" "👉 别犹豫了,这个价格真的不会再有了!" ).format(product=product), }, { "style": "口碑型", "text": ( "📢 {product} | 10万+买家的共同选择!\n\n" "💬 买家真实评价:\n" " 「这个价格能买到这个品质,真的绝了」\n" " 「已经是第三次回购了,品质稳定」\n" " 「推荐给朋友,都说物超所值」\n" " 「比实体店便宜太多了,品质一样」\n\n" "📊 数据说话:\n" " · 累计销量 100000+\n" " · 好评率 98.6%\n" " · 复购率 45%\n\n" "🤝 我们的底气:\n" " 源头厂家 → 没有中间商 → 价格最实惠\n" " 严格品控 → 出厂必检 → 品质有保障\n\n" " 这就是为什么大家都选我们的{product}!" ).format(product=product), }, ] for i, d in enumerate(descs): print("版本{} [{}]:".format(i + 1, d["style"])) print(d["text"]) print("") print("-" * 50) print("") print("💡 拼多多描述技巧:") print(" - 强调性价比,让用户觉得「超值」") print(" - 多用emoji和分段,提高可读性") print(" - 加入买家评价/数据增加信任感") print(" - 制造紧迫感,促进立即下单") def gen_group(product, price): print("=" * 50) print(" 拼团文案 - {}".format(product)) print(" 拼团价: {}元".format(price)) print("=" * 50) print("") try: price_num = float(price) original_price = round(price_num * random.uniform(2.0, 3.5), 1) save = round(original_price - price_num, 1) except (ValueError, TypeError): price_num = 0 original_price = 0 save = 0 templates = [ { "style": "紧迫型", "text": ( "🔥🔥🔥 {product} 拼团特惠!\n\n" "💰 原价: ¥{original} → 拼团价: ¥{price}\n" "💸 立省: ¥{save}!\n\n" "⏰ 仅剩最后50个名额!\n" "👥 已有2846人参与拼团\n\n" "🎯 拼团规则:\n" " · 2人即可成团\n" " · 24小时内未成团自动退款\n" " · 拼团成功立享超低价\n\n" "👉 赶紧叫上好友一起拼!" ).format(product=product, price=price, original=original_price, save=save), }, { "style": "分享型", "text": ( "📣 好物分享!{product}拼团价只要¥{price}!\n\n" "原价¥{original}的{product},\n" "现在拼团只要¥{price},省了¥{save}!\n\n" "💡 分享给朋友一起买更划算:\n" " · 自用省钱\n" " · 送人体面\n" " · 拼团还能赚优惠券\n\n" "🔗 长按分享给好友,一起拼更划算!\n" "⏰ 限时活动,拼完即止!" ).format(product=product, price=price, original=original_price, save=save), }, { "style": "社交型", "text": ( "💬 「你们那个{product}多少钱买的?」\n" "💬 「¥{price}!拼多多拼团买的!」\n" "💬 「这么便宜?!链接给我!」\n\n" "😏 这就是拼团的魅力!\n\n" "原价 ¥{original} 的{product}\n" "拼团价只要 ¥{price}\n" "省下的 ¥{save} 够吃好几顿饭了!\n\n" "👥 找个小伙伴一起拼吧!\n" "拼成就发货,拼不成全额退款,零风险!" ).format(product=product, price=price, original=original_price, save=save), }, ] for i, t in enumerate(templates): print("方案{} [{}]:".format(i + 1, t["style"])) print(t["text"]) print("") print("-" * 50) print("") print("💡 拼团文案技巧:") print(" - 突出价格对比,让省钱一目了然") print(" - 制造紧迫感(限量、限时)") print(" - 降低分享门槛(2人成团)") print(" - 强调零风险(不成团退款)") def gen_compare(product, competitor_price): print("=" * 50) print(" 价格对比文案 - {}".format(product)) print(" 竞品价格: ¥{}".format(competitor_price)) print("=" * 50) print("") try: comp_price = float(competitor_price) our_prices = [ round(comp_price * 0.3, 1), round(comp_price * 0.4, 1), round(comp_price * 0.5, 1), ] except (ValueError, TypeError): comp_price = 100 our_prices = [30, 40, 50] templates = [ { "style": "直接对比型", "text": ( "📊 {product} 价格大对比!\n\n" "某猫旗舰店: ¥{comp}\n" "某东自营: ¥{comp2}\n" "我们的价格: ¥{our} 🔥\n\n" "同样的{product},同样的品质,\n" "我们直接省了 ¥{save}!\n\n" "💡 为什么这么便宜?\n" " ✅ 工厂直发,0中间商\n" " ✅ 不打广告,省下推广费\n" " ✅ 薄利多销,走量取胜\n\n" "品质一样,价格砍半,何必多花冤枉钱?" ).format( product=product, comp=comp_price, comp2=round(comp_price * 0.9, 1), our=our_prices[1], save=round(comp_price - our_prices[1], 1) ), }, { "style": "算账型", "text": ( "🧮 帮你算笔账!{product}\n\n" "别家卖 ¥{comp},我们卖 ¥{our}\n" "省下 ¥{save},你可以:\n" " 🍜 吃 {meals} 顿好的\n" " 🎬 看 {movies} 场电影\n" " ☕ 喝 {coffees} 杯奶茶\n\n" "同样品质为什么要多花钱?\n" "省下来的钱改善生活不好吗?\n\n" "精打细算不是抠门,是聪明!\n" "👉 聪明人都在拼多多买{product}!" ).format( product=product, comp=comp_price, our=our_prices[1], save=round(comp_price - our_prices[1], 1), meals=int((comp_price - our_prices[1]) / 15), movies=int((comp_price - our_prices[1]) / 35), coffees=int((comp_price - our_prices[1]) / 12), ), }, { "style": "品质证明型", "text": ( "🤔 「便宜没好货?」{product}用事实说话!\n\n" "💰 价格对比:\n" " 品牌专柜: ¥{comp}\n" " 我们: ¥{our}\n\n" "🔬 品质对比:\n" " ✅ 同厂同线生产\n" " ✅ 相同原材料\n" " ✅ 相同工艺标准\n" " ✅ 相同质检流程\n\n" "唯一的区别?我们没有品牌溢价!\n\n" "📋 我们敢承诺:\n" " · 7天无理由退换\n" " · 假一赔十\n" " · 运费险保障\n\n" "低价≠低质,工厂直供就是这么有底气!" ).format(product=product, comp=comp_price, our=our_prices[1]), }, ] for i, t in enumerate(templates): print("方案{} [{}]:".format(i + 1, t["style"])) print(t["text"]) print("") print("-" * 50) print("") print("💡 价格对比文案技巧:") print(" - 用具体数字说话,避免模糊对比") print(" - 解释低价原因,消除「便宜没好货」顾虑") print(" - 把省下的钱换算成具体场景更有冲击力") print(" - 注意不要直接点名竞品品牌(法律风险)") def gen_price_war(product, competitor_price): print("=" * 60) print(" 拼多多价格战策略 - {}".format(product)) print(" 竞品价格: ¥{}".format(competitor_price)) print("=" * 60) print("") try: comp = float(competitor_price) except (ValueError, TypeError): comp = 100.0 # 定价策略 print("💰 【定价策略分析】") print("") strategies = [ { "name": "低价引流款", "price": round(comp * 0.35, 1), "desc": "亏本引流,靠其他SKU盈利", "margin": "-15%~-5%", "scene": "新店开业/冲销量/抢坑位", }, { "name": "平价走量款", "price": round(comp * 0.50, 1), "desc": "微利走量,快速积累销量和评价", "margin": "5%~15%", "scene": "日常主推/百亿补贴申报", }, { "name": "性价比主推款", "price": round(comp * 0.65, 1), "desc": "合理利润,主力盈利款", "margin": "20%~35%", "scene": "店铺利润担当/品质款", }, { "name": "品质溢价款", "price": round(comp * 0.80, 1), "desc": "品质升级,赚取品牌溢价", "margin": "35%~50%", "scene": "品牌旗舰/礼盒装/组合装", }, ] for s in strategies: print(" 📊 {} | 建议价: ¥{} | 利润率: {}".format(s["name"], s["price"], s["margin"])) print(" 策略: {} | 适用: {}".format(s["desc"], s["scene"])) print("") # 凑单满减设计 print("🎫 【凑单满减设计】") print("") base_price = round(comp * 0.50, 0) tiers = [ {"threshold": int(base_price * 2 + 1), "discount": int(base_price * 0.15)}, {"threshold": int(base_price * 3 + 1), "discount": int(base_price * 0.35)}, {"threshold": int(base_price * 5 + 1), "discount": int(base_price * 0.65)}, ] print(" 基于主推价 ¥{:.0f} 的满减梯度:".format(base_price)) print("") for t in tiers: print(" 🔸 满{}减{} → 客单价提升至¥{}+,利润增加约¥{}".format( t["threshold"], t["discount"], t["threshold"], int(t["threshold"] * 0.15))) print("") print(" 📋 凑单引导文案:") print(" · 「再凑¥XX即可享满减优惠!推荐搭配→」") print(" · 「买2件更划算!第2件立减¥XX!」") print(" · 「凑单神器!小件好物,满减凑单首选」") print("") # SKU定价矩阵 print("📐 【SKU定价矩阵】") print("") print(" 建议设置3-5个SKU,形成价格梯度:") print("") sku_matrix = [ {"name": "基础款/体验装", "price": round(comp * 0.30, 1), "purpose": "拉低起售价,吸引点击"}, {"name": "标准款/热销装", "price": round(comp * 0.50, 1), "purpose": "主力销售款,性价比最高"}, {"name": "升级款/家庭装", "price": round(comp * 0.65, 1), "purpose": "提升客单价,利润贡献"}, {"name": "豪华款/礼盒装", "price": round(comp * 0.85, 1), "purpose": "品质形象款,高利润"}, ] for sku in sku_matrix: print(" ├ {} → ¥{} | {}".format(sku["name"], sku["price"], sku["purpose"])) print("") # 竞争应对 print("⚔️ 【竞品应对策略】") print("") print(" 当竞品降价时:") print(" ✅ 不盲目跟价,先分析竞品是否可持续") print(" ✅ 用赠品/组合装替代直接降价") print(" ✅ 突出差异化卖点(材质/工艺/售后)") print(" ✅ 申请百亿补贴/限时秒杀获取流量") print("") print(" 当竞品涨价时:") print(" ✅ 保持现价,突出性价比优势") print(" ✅ 适当提价但幅度小于竞品") print(" ✅ 加大推广投入,抢占竞品流量") print("") print("-" * 60) print("💡 拼多多定价技巧:") print(" - 起售价(最低SKU)决定搜索排名展示价") print(" - 设置「凑单专区」帮买家凑满减") print(" - 活动报名要求最低价,日常可略高") print(" - 多多进宝佣金设置10-30%获取更多推手流量") def gen_review_reply(review_type): print("=" * 60) print(" 拼多多评价回复模板 - {}".format(review_type)) print("=" * 60) print("") rt = review_type.lower().replace(" ", "") if "好评" in rt or "好" in rt or "positive" in rt: print("👍 【好评感谢回复】(5套模板)") print("") templates = [ "亲,感谢您的认可和好评!能得到您的肯定是我们最大的动力~我们家还有很多好物,欢迎常来逛逛!有任何需要随时联系我们哦,祝您生活愉快!❤️", "谢谢亲的五星好评!看到您满意我们太开心了!下次购买记得找客服领专属老客优惠券哦~期待您的再次光临!😊", "亲爱的,非常感谢您的好评!您的支持是我们坚持做好产品的动力!已经为您备注VIP老客身份,下次下单享专属折扣!🌟", "哇,收到好评好开心!感谢亲的认可~我们会继续保持品质,不辜负每一位客户的信任。记得收藏店铺,新品上架第一时间通知您!💕", "亲,您的好评让我们整个团队都备受鼓舞!每一份认可都是我们前进的动力。欢迎推荐给身边的朋友,好东西值得分享!🎉", ] for i, t in enumerate(templates, 1): print(" 回复{}: {}".format(i, t)) print("") print(" 📌 好评回复加分项:") print(" · 提及老客优惠,引导复购") print(" · 邀请收藏店铺,增加粉丝") print(" · 鼓励分享推荐,获取新客") print(" · 根据评价内容个性化回复(别复制粘贴)") elif "差评" in rt or "差" in rt or "negative" in rt: print("⚠️ 【差评化解回复】(5套模板)") print("") templates = [ "亲,非常抱歉给您带来不好的体验!您的问题我们已经记录并会认真改进。为了弥补您的损失,请您联系在线客服(工作时间9:00-22:00),我们会为您提供满意的解决方案,绝对让您不白花这份钱!🙏", "亲爱的,看到您的评价我们非常心痛和自责。这不是我们产品应有的表现,我们深表歉意!请您私聊客服,我们承诺:① 全额退款 ② 补发新品 ③ 额外补偿,您选一个最方便的方案!💪", "亲,首先真诚向您道歉!您反馈的问题我们高度重视,已经安排品控部门紧急排查。为了不耽误您的时间,请联系客服,我们5分钟内响应,一定给您一个满意的交代!❤️", "非常对不起亲!您的体验是我们的失职。我们不找借口,只想尽快帮您解决问题。请联系客服说「差评处理」,我们有专人对接,优先为您处理,不让您多等一分钟!", "亲,这条差评我们全组都看了,非常惭愧。我们已经针对您提到的问题制定了整改方案。现在最重要的是帮您解决问题——请联系客服,退款/换货/补偿任您选择,我们诚意满满!🙏", ] for i, t in enumerate(templates, 1): print(" 回复{}: {}".format(i, t)) print("") print(" 📌 差评化解要点:") print(" · 先道歉,不解释不辩解") print(" · 给出明确解决方案(退/换/补)") print(" · 引导私聊,避免公开争论") print(" · 处理完毕后礼貌请求修改评价") print(" · 24小时内回复,体现重视") elif "追评" in rt or "追" in rt or "followup" in rt: print("🔄 【追评引导话术】") print("") print(" 📌 主动引导追评(下单后7-15天发送):") print("") templates = [ "亲,您好!您购买的宝贝用了有一段时间了,使用感受还满意吗?如果方便的话,希望您能追评分享一下使用体验,帮助更多买家做参考。追评后联系客服领取5元无门槛优惠券哦~ 感谢支持!❤️", "Hi亲~ 还记得前几天买的宝贝吗?用得怎么样呀?如果觉得不错,麻烦花1分钟追评一下,写上真实感受就好。追评晒图还能领取精美小礼品,感谢您!😊", "亲爱的,您的使用体验对其他买家很重要!如果宝贝用着满意,希望您能追评告诉大家。我们为追评用户准备了专属福利:① 5元返现 ② 下次购买9折 ③ 新品试用资格。任选其一!🎁", ] for i, t in enumerate(templates, 1): print(" 方案{}: {}".format(i, t)) print("") print(" 📌 追评引导时机:") print(" · 确认收货后3天:产品初体验") print(" · 使用7-15天后:深度体验反馈") print(" · 节日/大促前:积累评价为活动蓄力") print("") print(" 📌 追评激励方式:") print(" · 追评返现(2-5元红包)") print(" · 追评送券(下次购买可用)") print(" · 晒图追评额外奖励") print(" · 视频追评最高奖励") else: # 通用模板——按类型混合输出 print("📋 【评价回复通用模板库】") print("") print(" 类型: {}".format(review_type)) print(" 提示: 使用 review-reply \"好评/差评/追评\" 获取专项模板") print("") print(" 通用好评回复: 亲,感谢您的认可!您的满意就是我们最大的动力~❤️") print(" 通用差评回复: 亲,非常抱歉!请联系客服,我们一定给您满意的解决方案!🙏") print(" 通用追评引导: 亲,用了一段时间感觉如何?期待您的追评分享~🎁") print("") print("-" * 60) print("💡 评价管理技巧:") print(" - 好评要及时感谢,坏评要24小时内处理") print(" - 不要用千篇一律的回复,尽量个性化") print(" - 差评处理后请求修改,态度比补偿更重要") print(" - 定期分析评价关键词,改进产品和服务") def gen_seckill(product): print("=" * 60) print(" 拼多多秒杀/限时购文案 - {}".format(product)) print("=" * 60) print("") # 秒杀标题 print("⚡ 【秒杀标题】(5套方案)") print("") titles = [ "【限时秒杀】{} 全网底价!XX点开抢,手慢无!".format(product), "【闪电特惠】{} 直降XX元!限量XXX件,抢完即止!".format(product), "【限时抢购】{} 1元起抢!每天10点/20点准时开抢!".format(product), "【今日特价】{} 工厂清仓价!最后XXX件,卖完恢复原价!".format(product), "【秒杀预告】{} 明天XX点开抢!先领券再抢更划算!".format(product), ] for i, t in enumerate(titles, 1): print(" {}. {}".format(i, t)) print("") # 秒杀详情文案 print("📝 【秒杀详情页文案】") print("") print(" ┌──────────────────────────────────────┐") print(" │ ⚡ 限时秒杀 · {} │".format(product)) print(" │ │") print(" │ 💰 秒杀价: ¥XX(原价¥XX) │") print(" │ ⏰ 活动时间: XX:00 - XX:00 │") print(" │ 📦 限量: XXX件 │") print(" │ 🔥 已抢: XX% │") print(" │ │") print(" │ ✅ 正品保障 ✅ 极速发货 │") print(" │ ✅ 7天无理由 ✅ 运费险 │") print(" └──────────────────────────────────────┘") print("") # 秒杀倒计时话术 print("⏰ 【秒杀倒计时文案】") print("") countdown = [ {"time": "开抢前1小时", "text": "距离{}秒杀开始还有1小时!先加购物车,到点直接抢!".format(product)}, {"time": "开抢前10分钟", "text": "倒计时10分钟!{}秒杀马上开始!打开拼多多等着抢!".format(product)}, {"time": "开抢前1分钟", "text": "最后60秒!{}秒杀即将开抢!手指放在按钮上!".format(product)}, {"time": "开抢中", "text": "开抢了!{}秒杀进行中!库存剩XX件,手速决定一切!".format(product)}, {"time": "库存告急", "text": "最后XX件!{}秒杀即将售罄!犹豫=错过!赶紧下单!".format(product)}, ] for c in countdown: print(" ⏱ [{}] {}".format(c["time"], c["text"])) print("") # 秒杀朋友圈/群分享文案 print("📣 【分享引流文案】(发群/朋友圈)") print("") shares = [ "🔥 拼多多秒杀预告!{}只要¥XX!限量XXX件!XX点准时开抢→ [链接]".format(product), "⚡ 天呐!{}居然只要¥XX!秒杀价比日常便宜一半!快去抢→ [链接]".format(product), "刚抢到一个{},秒杀价¥XX!还有库存,手速快的冲→ [链接]".format(product), "帮你们踩过雷了!这个{}是真的好用,现在秒杀才¥XX,闭眼入→ [链接]".format(product), ] for i, s in enumerate(shares, 1): print(" {}. {}".format(i, s)) print("") # 秒杀运营建议 print("📋 【秒杀运营节奏】") print("") print(" 开抢前48小时: 提交秒杀报名,准备好库存") print(" 开抢前24小时: 社群+朋友圈预热,发预告文案") print(" 开抢前2小时: 再次提醒,引导加购物车") print(" 开抢时: 实时播报库存,制造紧张感") print(" 售罄后: 发「售罄」截图,为下次秒杀预热") print(" 结束后: 引导买家评价,积累口碑") print("") print("-" * 60) print("💡 秒杀技巧:") print(" - 秒杀价建议是日常价的50-70%,冲击力才够") print(" - 库存不宜过多,制造稀缺感(100-500件最佳)") print(" - 选择10:00/14:00/20:00等流量高峰时段") print(" - 提前在社群/朋友圈预热,秒杀效果翻倍") print(" - 秒杀款要关联推荐利润款,提升整体收益") def main(): args = sys.argv[1:] if not args: show_help() return cmd = args[0] if cmd == "help": show_help() elif cmd == "title": if len(args) < 3: print("用法: pdd.sh title \"产品名\" \"关键词1,关键词2\"") sys.exit(1) gen_title(args[1], args[2]) elif cmd == "desc": if len(args) < 2: print("用法: pdd.sh desc \"产品名\"") sys.exit(1) gen_desc(args[1]) elif cmd == "group": if len(args) < 3: print("用法: pdd.sh group \"产品名\" \"价格\"") sys.exit(1) gen_group(args[1], args[2]) elif cmd == "compare": if len(args) < 3: print("用法: pdd.sh compare \"产品名\" \"竞品价格\"") sys.exit(1) gen_compare(args[1], args[2]) elif cmd == "price-war": if len(args) < 3: print("用法: pdd.sh price-war \"产品名\" \"竞品价格\"") sys.exit(1) gen_price_war(args[1], args[2]) elif cmd == "review-reply": if len(args) < 2: print("用法: pdd.sh review-reply \"好评/差评/追评\"") sys.exit(1) gen_review_reply(args[1]) elif cmd == "seckill": if len(args) < 2: print("用法: pdd.sh seckill \"产品名\"") sys.exit(1) gen_seckill(args[1]) else: print("未知命令: {}".format(cmd)) print("运行 pdd.sh help 查看帮助") sys.exit(1) if __name__ == "__main__": main() PYTHON_EOF echo "" echo " Powered by BytesAgain | bytesagain.com | [email protected]" FILE:scripts/script.sh #!/usr/bin/env bash # pinduoduo-listing - Content creation and optimization assistant set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/pinduoduo-listing}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF pinduoduo-listing v$VERSION Content creation and optimization assistant Usage: pinduoduo-listing <command> [args] Commands: draft Create draft headline Generate headlines outline Content outline seo SEO tips schedule Content schedule hooks Opening hooks cta Call to action repurpose Repurpose content metrics Content metrics ideas Content ideas help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_draft() { echo " Draft: $1 Target: -800 words" _log "draft" "-" } cmd_headline() { echo " 1. How to $1 2. $1: Complete Guide 3. Why $1 Matters" _log "headline" "-" } cmd_outline() { echo " 1. Intro | 2. Problem | 3. Solution | 4. Examples | 5. CTA" _log "outline" "-" } cmd_seo() { echo " Keywords: $1 | Title tag | Meta desc | H1-H3 | Internal links" _log "seo" "-" } cmd_schedule() { echo " Mon: Research | Tue: Write | Wed: Edit | Thu: Publish | Fri: Promote" _log "schedule" "-" } cmd_hooks() { echo " Question | Statistic | Story | Bold claim | Controversy" _log "hooks" "-" } cmd_cta() { echo " Subscribe | Share | Comment | Try it | Learn more" _log "cta" "-" } cmd_repurpose() { echo " Blog -> Thread -> Video -> Carousel -> Newsletter" _log "repurpose" "-" } cmd_metrics() { echo " Views | Clicks | Shares | Time on page | Conversions" _log "metrics" "-" } cmd_ideas() { echo " How-to | Listicle | Case study | Interview | Comparison" _log "ideas" "-" } case "-help" in draft) shift; cmd_draft "$@" ;; headline) shift; cmd_headline "$@" ;; outline) shift; cmd_outline "$@" ;; seo) shift; cmd_seo "$@" ;; schedule) shift; cmd_schedule "$@" ;; hooks) shift; cmd_hooks "$@" ;; cta) shift; cmd_cta "$@" ;; repurpose) shift; cmd_repurpose "$@" ;; metrics) shift; cmd_metrics "$@" ;; ideas) shift; cmd_ideas "$@" ;; help|-h) show_help ;; version|-v) echo "pinduoduo-listing v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # 拼多多运营实战技巧 💡 ## 一、定价策略(拼多多核心竞争力) ### 1. 价格带分析 ``` 引流款(亏本/微利)→ 走量款(微利)→ 利润款(主要盈利)→ 形象款(品牌溢价) 20% 40% 30% 10% ``` - 引流款拉低起售价,吸引点击和搜索排名 - 走量款积累销量和评价,申请活动资格 - 利润款是店铺盈利核心,SKU设置要巧妙 - 形象款提升品牌调性,支撑价格体系 ### 2. SKU定价技巧 - 最低SKU决定搜索展示价(越低越好) - 最低SKU可以设置小规格/体验装 - 主推SKU放在第2-3个位置(黄金位) - SKU间价格梯度≤50%(太大用户不信) - 用「已售XX件」标签引导选择高价SKU ### 3. 价格战应对 - ❌ 不要盲目跟价(陷入死循环) - ✅ 用赠品替代降价(成本可控) - ✅ 用组合装/家庭装拉高客单价 - ✅ 申请百亿补贴获取官方流量扶持 - ✅ 差异化卖点让用户觉得「值这个价」 ## 二、百亿补贴与活动 ### 4. 百亿补贴申报 - 价格要求:全网最低价(含淘宝/京东) - 好评率≥95%(4.5星以上) - 发货时效≤48小时 - 退货率<行业平均 - 申报成功后流量增长200%+ ### 5. 限时秒杀运营 ``` 预热(24h前) → 开抢(准时) → 热卖中 → 售罄/结束 社群预告 实时播报 从众引导 下次预热 ``` - 秒杀价=日常价×50-70%才有冲击力 - 库存100-500件最佳(太多没紧迫感) - 选10:00/14:00/20:00流量高峰时段 - 秒杀款关联利润款,提升整体收益 ### 6. 拼多多活动矩阵 | 活动 | 折扣力度 | 流量级别 | 报名门槛 | |------|---------|---------|---------| | 百亿补贴 | 最低 | 🔥🔥🔥🔥🔥 | 高 | | 限时秒杀 | 高 | 🔥🔥🔥🔥 | 中 | | 9块9特卖 | 极高 | 🔥🔥🔥 | 低 | | 品牌日 | 中 | 🔥🔥🔥🔥 | 高 | | 领券中心 | 低 | 🔥🔥 | 低 | ## 三、凑单与满减设计 ### 7. 满减梯度设计 - 第一档:≈1.5倍客单价(引导多买1件) - 第二档:≈2.5倍客单价(引导凑单购买) - 第三档:≈4倍客单价(批量/囤货用户) - 满减金额=门槛×8-15%(太多亏钱,太少没吸引力) ### 8. 凑单技巧 - 设置「凑单专区」,小件好物方便凑单 - 商品详情页底部推荐凑单商品 - 客服主动推荐凑单搭配 - 凑单商品选高利润小件(利润不被摊薄) ## 四、评价管理 ### 9. 评价策略 - 新品期前30个评价决定权重 - 带图评价权重>纯文字评价 - 追评权重>首次评价 - 视频评价效果最好 - 评价关键词影响搜索排名 ### 10. 差评化解流程 ``` 发现差评(1h内) → 电话沟通 → 提供方案 → 客户确认 → 引导修改 态度诚恳 退/换/补 快速执行 礼貌请求 ``` - 差评回复不是给差评用户看的,是给其他买家看的 - 回复要展示:道歉+原因+解决方案+改进承诺 - 不要在评价区争论,引导私聊解决 - 差评率>3%会严重影响搜索权重 ### 11. 好评引导 - 包裹里放好评卡(返现2-3元,避免违规) - 收货后发消息引导评价 - 晒图评价额外奖励 - 追评引导(7-15天后) - 把好评截图放详情页增加信任 ## 五、流量获取 ### 12. 自然搜索优化 - 标题覆盖核心搜索词(不要照抄竞品) - 销量×好评率=搜索排名核心因子 - 新品期有流量扶持窗口(前14天) - 每天稳定出单比突然爆单更有利于排名 - 动销率影响整店权重 ### 13. 多多进宝(推手推广) - 佣金设置10-30%(太低没人推) - 优惠券面额要有吸引力 - 活动期间临时提高佣金 - 配合专属推广链接追踪效果 - 头部推手能带来爆发式流量 ### 14. 直播带货 - 拼多多直播流量正在爆发期 - 开播时间固定,培养粉丝习惯 - 直播间价格要比详情页低 - 用福袋/抽奖留人,提高在线时长 - 每场直播覆盖新品+爆款+清仓 ## 六、供应链与发货 ### 15. 发货时效管理 - 拼多多对发货时效要求严格 - 超时发货会罚款(订单金额5-10%) - 虚假发货(无物流信息)处罚更重 - 建议备货周转≤3天 - 大促前提前备货到仓 ### 16. 包裹体验 - 外包装干净无破损 - 放好评卡+小赠品(成本0.5-1元) - 附使用说明/温馨提示卡 - 发货后发消息通知客户 - 物流异常主动联系客户 --- 📌 **拼多多核心公式**:低价引流 × 品质保障 × 极致服务 = 长期盈利 不要只打价格战,品质和服务才是复购的基础! > 使用 `pdd.sh help` 查看所有可用命令
淘宝商品文案。宝贝标题、详情页文案、主图文案、促销活动、关键词挖掘、大促文案。Taobao listing generator with product titles, detail pages, keyword mining, promotion copy. 淘宝运营、天猫文案、商品标题优化、关键词挖掘、双11...
--- version: "2.0.0" name: Taobao Listing description: "淘宝商品文案。宝贝标题、详情页文案、主图文案、促销活动、关键词挖掘、大促文案。Taobao listing generator with product titles, detail pages." 淘宝商品文案。宝贝标题、详情页文案、主图文案、促销活动、关键词挖掘、大促文案。Taobao listing generator with product titles, detail pages, keyword mining, promotion copy. 淘宝运营、天猫文案、商品标题优化、关键词挖掘、双11文案、618文案、聚划算。Use when listing products on Taobao. author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Taobao Listing 淘宝商品文案。宝贝标题、详情页文案、主图文案、促销活动、关键词挖掘、大促文案。Taobao listing generator with product titles, detail pages, keyword mining, promotion copy. 淘宝运营、天猫文案、商品标题优化、关键词挖掘、双11文案、618文案、聚划算。Use when listing products on Taobao. ## 推荐工作流 ``` 需求分析 → 选择命令 → 输入描述 → 获取结果 → 调整优化 ``` ## 专业建议 - ``` - 核心词 + 属性词 + 长尾词 + 热搜词 + 促销词 - ``` - 核心词放最前面(权重最高位置) - 属性词紧跟核心词(材质/功能/风格) --- *Taobao Listing by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com - Run `taobao-listing help` for all commands ## Commands Run `taobao-listing help` to see all available commands. FILE:scripts/script.sh #!/usr/bin/env bash # taobao-listing - Content creation and optimization assistant set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/taobao-listing}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF taobao-listing v$VERSION Content creation and optimization assistant Usage: taobao-listing <command> [args] Commands: draft Create draft headline Generate headlines outline Content outline seo SEO tips schedule Content schedule hooks Opening hooks cta Call to action repurpose Repurpose content metrics Content metrics ideas Content ideas help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_draft() { echo " Draft: $1 Target: -800 words" _log "draft" "-" } cmd_headline() { echo " 1. How to $1 2. $1: Complete Guide 3. Why $1 Matters" _log "headline" "-" } cmd_outline() { echo " 1. Intro | 2. Problem | 3. Solution | 4. Examples | 5. CTA" _log "outline" "-" } cmd_seo() { echo " Keywords: $1 | Title tag | Meta desc | H1-H3 | Internal links" _log "seo" "-" } cmd_schedule() { echo " Mon: Research | Tue: Write | Wed: Edit | Thu: Publish | Fri: Promote" _log "schedule" "-" } cmd_hooks() { echo " Question | Statistic | Story | Bold claim | Controversy" _log "hooks" "-" } cmd_cta() { echo " Subscribe | Share | Comment | Try it | Learn more" _log "cta" "-" } cmd_repurpose() { echo " Blog -> Thread -> Video -> Carousel -> Newsletter" _log "repurpose" "-" } cmd_metrics() { echo " Views | Clicks | Shares | Time on page | Conversions" _log "metrics" "-" } cmd_ideas() { echo " How-to | Listicle | Case study | Interview | Comparison" _log "ideas" "-" } case "-help" in draft) shift; cmd_draft "$@" ;; headline) shift; cmd_headline "$@" ;; outline) shift; cmd_outline "$@" ;; seo) shift; cmd_seo "$@" ;; schedule) shift; cmd_schedule "$@" ;; hooks) shift; cmd_hooks "$@" ;; cta) shift; cmd_cta "$@" ;; repurpose) shift; cmd_repurpose "$@" ;; metrics) shift; cmd_metrics "$@" ;; ideas) shift; cmd_ideas "$@" ;; help|-h) show_help ;; version|-v) echo "taobao-listing v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/taobao.sh #!/usr/bin/env bash # taobao.sh - 淘宝商品标题和详情页文案生成器 set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" CMD="-help" shift 2>/dev/null || true python3 - "$CMD" "$@" << 'PYTHON_EOF' # -*- coding: utf-8 -*- import sys import random import datetime def show_help(): print(""" ==================================== 淘宝商品文案生成器 taobao.sh ==================================== 用法: taobao.sh title "产品名" "关键词1,关键词2" 生成淘宝爆款标题(30字内) taobao.sh selling-point "产品名" 五大卖点提炼 taobao.sh detail "产品名" ["材质,尺寸,功能"] 详情页文案(卖点+场景+信任+促销) taobao.sh review-reply "评价内容" 评价回复话术 taobao.sh keyword "产品名" 关键词挖掘(核心词+长尾词+属性词+热搜词) taobao.sh promotion "活动类型" 促销文案(双11/618/聚划算/日常促销) taobao.sh help 显示本帮助 示例: taobao.sh title "蓝牙耳机" "降噪,运动,长续航" taobao.sh selling-point "蓝牙耳机" taobao.sh detail "蓝牙耳机" "ABS材质,入耳式,主动降噪" taobao.sh detail "蓝牙耳机" taobao.sh review-reply "音质不错,就是续航短了点" taobao.sh keyword "蓝牙耳机" taobao.sh promotion "双11" taobao.sh promotion "618" taobao.sh promotion "聚划算" """) def gen_title(product, keywords_str): keywords = [k.strip() for k in keywords_str.split(",") if k.strip()] prefixes = ["【爆款推荐】", "【热销榜单】", "【品质之选】", "【限时特惠】", "【新品首发】", "【TOP1爆款】"] modifiers = ["正品", "新款", "升级版", "旗舰", "加强版", "热卖", "必备"] suffixes = ["包邮", "送运费险", "顺丰包邮", "7天无理由", "当日发货"] print("=" * 50) print(" 淘宝爆款标题生成 - {}".format(product)) print("=" * 50) print("") print("关键词: {}".format(", ".join(keywords))) print("") for i in range(5): prefix = random.choice(prefixes) mod = random.choice(modifiers) kw_sample = random.sample(keywords, min(len(keywords), random.randint(1, max(1, len(keywords))))) suffix = random.choice(suffixes) title = "{prefix}{product}{mod} {kws} {suffix}".format( prefix=prefix, product=product, mod=mod, kws=" ".join(kw_sample), suffix=suffix ) # 淘宝标题限30字,去掉多余 if len(title) > 30: title = title[:30] print("标题{num}: {title}".format(num=i+1, title=title)) print(" 字数: {n}字".format(n=len(title))) print("") print("💡 技巧提示:") print(" - 核心关键词放前面,长尾词放后面") print(" - 避免重复词,每个字都要有搜索价值") print(" - 标题不超过30个字(含标点)") def gen_selling_points(product): categories = [ {"name": "品质保障", "templates": [ "{product}精选优质原料,品质看得见", "严格质检,{product}每一件都经得起考验", "大牌同厂同质,{product}品质有保障", ]}, {"name": "功能亮点", "templates": [ "{product}多功能设计,一物多用更实用", "创新升级,{product}使用体验全面提升", "核心技术加持,{product}性能远超同价位", ]}, {"name": "用户体验", "templates": [ "{product}人体工学设计,舒适度拉满", "操作简单,{product}老人小孩都能轻松使用", "贴心细节设计,{product}处处为你着想", ]}, {"name": "性价比", "templates": [ "工厂直发,{product}省去中间商差价", "同品质中价格最优,{product}真正物超所值", "买到就是赚到,{product}超高性价比之选", ]}, {"name": "售后服务", "templates": [ "{product}7天无理由退换,购物零风险", "专业客服团队,{product}售后无忧", "质量问题免费换新,{product}买得放心用得安心", ]}, ] print("=" * 50) print(" 五大卖点提炼 - {}".format(product)) print("=" * 50) print("") for idx, cat in enumerate(categories): template = random.choice(cat["templates"]) point = template.format(product=product) print("卖点{num} [{cat}]".format(num=idx+1, cat=cat["name"])) print(" ✅ {}".format(point)) print("") print("-" * 50) print("📋 卖点使用建议:") print(" - 主图上突出卖点1-2") print(" - 详情页依次展开5个卖点") print(" - 每个卖点配合实拍图/对比图更有说服力") def gen_detail(product, attrs_str=""): attrs = [a.strip() for a in attrs_str.split(",") if a.strip()] if attrs_str else [] print("=" * 50) print(" 详情页文案 - {}".format(product)) print("=" * 50) print("") # 开场引导 print("【开场引导】") hooks = [ "还在为选择{product}而纠结?看完这篇你就知道该怎么选!", "一款好的{product},到底好在哪里?往下看就知道了!", "为什么10万+买家都选择了这款{product}?答案就在详情里!", ] print(" {}".format(random.choice(hooks).format(product=product))) print("") # 产品属性(如果提供了) if attrs: print("【产品参数】") print(" 产品名称: {}".format(product)) for attr in attrs: print(" · {}".format(attr)) print("") # ===== 升级:卖点提炼 ===== print("【核心卖点提炼】") selling_modules = [ {"icon": "🏆", "title": "品质保障", "points": [ "精选优质原材料,源头品控", "通过国家权威检测认证", "大牌同厂同线,品质看得见", ]}, {"icon": "⚡", "title": "功能亮点", "points": [ "创新技术加持,体验全面升级", "多功能合一,一物多用更省心", "核心性能远超同价位竞品", ]}, {"icon": "💎", "title": "细节设计", "points": [ "人体工学设计,舒适度拉满", "每个细节反复打磨,匠心品质", "包装精美,自用送人两相宜", ]}, ] for mod in selling_modules: print(" {icon} {title}".format(icon=mod["icon"], title=mod["title"])) point = random.choice(mod["points"]) print(" → {}的{},{}".format(product, mod["title"].lower(), point)) print("") # ===== 升级:场景描述 ===== print("【使用场景】") scenes = [ {"scene": "居家日常", "desc": "在家使用{product},享受舒适便捷的生活体验。无论是独处还是与家人共享,都能感受到它带来的品质提升。"}, {"scene": "办公通勤", "desc": "上班族的必备好物!{product}陪你从早忙到晚,高效又省心,同事都问你哪里买的。"}, {"scene": "出行旅游", "desc": "出门在外也少不了{product},轻便易携,随时随地都能用。旅途中的贴心伴侣,让出行更加从容。"}, {"scene": "送礼佳选", "desc": "精美包装+实用品质,{product}作为礼物送人特别有面子。收到的人都会夸你眼光好!"}, ] for s in scenes: print(" 🎯 {} | {}".format(s["scene"], s["desc"].format(product=product))) print("") # ===== 升级:信任背书 ===== print("【信任背书】") print(" 📊 数据说话:") print(" · 累计销量 {}+".format(random.choice(["5万", "10万", "50万", "100万"]))) print(" · 好评率 {:.1f}%".format(random.uniform(97.5, 99.8))) print(" · 复购率 {:.0f}%".format(random.uniform(35, 65))) print("") print(" 🏅 权威认证:") print(" · 通过国家质量检测") print(" · ISO9001质量管理体系认证") print(" · 正品保障,假一赔十") print("") print(" 💬 买家真实评价:") reviews_pool = [ "「用了之后再也回不去了,强烈推荐!」", "「这个价格买到这个品质,真的绝了」", "「已经第三次回购了,品质一直在线」", "「推荐给朋友,都说物超所值」", "「比实体店便宜还好用,下次还来」", ] for r in random.sample(reviews_pool, 3): print(" {}".format(r)) print("") # ===== 升级:促销引导 ===== print("【促销引导】") print(" 🔥 限时福利(不要错过!)") print(" 💰 现在下单立享限时折扣") print(" 🎁 前{}名下单赠送精美赠品".format(random.choice(["100", "200", "500"]))) print(" 📦 全国包邮,当天发货") print(" 🛡️ 7天无理由退换 + 运费险保障") print("") print(" ⏰ 优惠倒计时中,手慢无!") print(" 👉 立即下单,锁定特惠价格!") print("") # 购买保障 print("【购买保障】") print(" ✅ 正品保证,假一赔十") print(" ✅ 7天无理由退换货") print(" ✅ 运费险保障,退货免运费") print(" ✅ 专业客服,售前售后全程服务") print("") print(" 🔥 现在下单还有限时优惠,手慢无!") def gen_review_reply(review): print("=" * 50) print(" 评价回复话术生成") print("=" * 50) print("") print("原始评价: {}".format(review)) print("") # 判断情感倾向 positive_words = ["好", "不错", "满意", "喜欢", "棒", "值", "推荐", "快", "舒服", "方便", "实用"] negative_words = ["差", "坏", "破", "慢", "贵", "假", "不好", "退", "烂", "垃圾", "失望", "骗"] pos_count = sum(1 for w in positive_words if w in review) neg_count = sum(1 for w in negative_words if w in review) if neg_count > pos_count: sentiment = "negative" elif pos_count > 0: sentiment = "positive" else: sentiment = "neutral" if sentiment == "positive": replies = [ "亲,感谢您的认可和好评!您的满意是我们最大的动力~我们会继续努力,为您提供更好的产品和服务!有任何需要随时联系我们哦,祝您生活愉快!❤️", "谢谢亲的好评!看到您喜欢真的太开心了!我们家还有很多好物,欢迎常来逛逛~有问题随时找我们,一定给您满意的答复!😊", "亲爱的,非常感谢您的认可!能得到您的好评是我们莫大的荣幸~我们会持续优化产品,期待您的再次光临!🌟", ] elif sentiment == "negative": replies = [ "亲,非常抱歉给您带来了不好的体验,我们深表歉意!看到您的反馈我们非常重视,已经第一时间安排专人跟进处理。请您联系我们的客服,我们一定给您一个满意的解决方案!您的意见是我们改进的动力!🙏", "亲爱的顾客,对于您遇到的问题我们深感抱歉!这不是我们产品应有的表现,我们会立即排查原因并改进。请您放心,我们一定负责到底,麻烦联系在线客服,我们马上为您处理!💪", "亲,真的很抱歉让您失望了!您反馈的问题我们已经记录并会认真改进。为了弥补给您造成的不便,请联系客服,我们会为您提供补偿方案。感谢您的宝贵意见,我们一定做得更好!❤️", ] else: replies = [ "亲,感谢您的评价和反馈!我们会认真对待每一条建议,不断优化产品。有任何使用上的问题都可以随时咨询我们客服,我们一定竭诚为您服务!😊", "谢谢亲的评价!您的每一条反馈对我们都很重要,我们会持续改进。如有任何问题,随时联系我们,祝您生活愉快!🌟", "亲爱的,感谢您花时间给我们评价!我们会根据您的反馈不断提升产品和服务质量。期待您的再次光临,有问题随时找我们哦!❤️", ] print("情感判断: {}".format( "好评 👍" if sentiment == "positive" else ("差评 ⚠️" if sentiment == "negative" else "中评 💬") )) print("") for i, reply in enumerate(replies): print("回复方案{}: ".format(i + 1)) print(" {}".format(reply)) print("") print("-" * 50) print("💡 回复技巧:") print(" - 好评: 真诚感谢 + 邀请复购") print(" - 差评: 诚恳道歉 + 解决方案 + 引导私聊") print(" - 中评: 感谢反馈 + 表示改进") print(" - 回复时效: 24小时内回复效果最佳") def gen_keyword(product): print("=" * 60) print(" 淘宝关键词挖掘 - {}".format(product)) print("=" * 60) print("") # 核心词 print("📌 【核心词】(搜索量最大,竞争最激烈)") core_words = [ product, "{}正品".format(product), "{}旗舰店".format(product), "{}品牌".format(product), "{}官方".format(product), ] for i, w in enumerate(core_words, 1): stars = random.randint(3, 5) print(" {}. {} | 竞争度: {} | 建议出价: ¥{:.1f}".format( i, w, "★" * stars + "☆" * (5 - stars), random.uniform(1.5, 8.0))) print("") # 长尾词 print("🔍 【长尾词】(精准流量,转化率高)") long_tail_patterns = [ "{}什么牌子好", "{}推荐", "{}排行榜", "{}怎么选", "{}哪个好", "{}性价比高", "{}评测", "{}对比", "{}2024新款", "{}平价替代", "{}学生党", "{}送礼", ] selected_long = random.sample(long_tail_patterns, 8) for i, pat in enumerate(selected_long, 1): word = pat.format(product) conv_rate = random.uniform(2.5, 12.0) print(" {}. {} | 预估转化率: {:.1f}%".format(i, word, conv_rate)) print("") # 属性词 print("🏷️ 【属性词】(描述产品特征,提升相关性)") attr_categories = { "材质": ["纯棉", "真皮", "不锈钢", "硅胶", "ABS", "实木", "陶瓷", "合金"], "风格": ["简约", "复古", "日系", "韩版", "ins风", "轻奢", "国潮", "商务"], "功能": ["多功能", "便携", "折叠", "智能", "防水", "升级版", "加厚", "静音"], "人群": ["男士", "女士", "儿童", "学生", "孕妇", "老人", "情侣", "送礼"], "场景": ["家用", "办公", "户外", "旅行", "车载", "宿舍", "厨房", "卧室"], } for cat_name, words in attr_categories.items(): selected = random.sample(words, min(4, len(words))) combos = ["{} {}".format(product, w) for w in selected] print(" 📂 {}: {}".format(cat_name, " | ".join(combos))) print("") # 热搜词/趋势词 print("🔥 【热搜趋势词】(蹭热度,抢流量)") trend_patterns = [ "{}2024新款", "{}爆款", "{}网红同款", "{}明星同款", "{}直播间", "{}李佳琦推荐", "{}小红书推荐", "{}抖音爆款", "{}好物推荐", "{}必买清单", "{}双11", "{}618", ] selected_trends = random.sample(trend_patterns, 8) for i, pat in enumerate(selected_trends, 1): heat = random.randint(5000, 50000) print(" {}. {} | 搜索热度: {:,}".format(i, pat.format(product), heat)) print("") # 标题组合建议 print("=" * 60) print("💡 【标题组合公式】") print(" 公式: 核心词 + 属性词 + 长尾词 + 热搜词") print("") print(" 示例标题组合:") combos = [ "【{}】{} {} {}".format( random.choice(["新款", "爆款", "热销"]), product, random.choice(["简约", "多功能", "便携", "升级版"]), random.choice(["学生党", "家用", "送礼", "网红同款"]) ), "{} {} {} {}".format( product, random.choice(["正品", "旗舰", "品牌"]), random.choice(["2024新款", "ins风", "韩版"]), random.choice(["包邮", "顺丰包邮", "送运费险"]) ), "【{}】{} {} {} {}".format( random.choice(["限时特惠", "TOP1爆款", "品质之选"]), product, random.choice(["高品质", "加厚", "防水"]), random.choice(["男女通用", "情侣款", "学生"]), random.choice(["包邮", "7天无理由", "当日发货"]) ), ] for i, c in enumerate(combos, 1): title = c[:30] print(" {}. {} ({}字)".format(i, title, len(title))) print("") print("-" * 60) print("💡 关键词使用技巧:") print(" - 标题中核心词放最前面,权重最高") print(" - 长尾词布局在标题中后段,精准引流") print(" - 属性词自然融入,提高搜索相关性") print(" - 热搜词适度使用,避免堆砌被降权") print(" - 定期更新关键词,跟踪搜索趋势变化") print(" - 避免空格分割关键词(淘宝用紧密排列)") def gen_promotion(event_type): print("=" * 60) print(" 淘宝促销文案 - {}".format(event_type)) print("=" * 60) print("") event_lower = event_type.lower().replace(" ", "") # 双11 if "双11" in event_lower or "双十一" in event_lower or "1111" in event_lower: print("🎉 【双11狂欢节促销文案】") print("") print("📌 主标题方案:") titles = [ "双11狂欢价!全年最低,错过等一年!", "11.11巅峰盛典 | 爆款直降,买到就是赚到!", "双十一提前购!预售锁定底价,尾款人冲!", ] for i, t in enumerate(titles, 1): print(" {}. {}".format(i, t)) print("") print("📌 活动节奏:") print(" 🔸 预售期(10.24-10.31): 付定金立减,定金翻倍") print(" 🔸 预热期(11.01-11.10): 加购物车,领满减券") print(" 🔸 爆发期(11.11当天): 全场最低价,限时秒杀") print(" 🔸 返场期(11.12-11.13): 错过补货,最后机会") print("") print("📌 促销话术:") print(" · 「全年仅此一次的价格,手慢无!」") print(" · 「预售已抢XX件,库存告急!」") print(" · 「付定金立省XX元,尾款还能叠加满减!」") print(" · 「去年双11 XX分钟售罄,今年备货翻倍!」") print(" · 「双11不买=亏钱!全年最低到手价!」") print("") print("📌 详情页Banner文案:") print(" 「双11巅峰钜惠 | 到手价¥XX | 买1送1 | 前100名加赠」") print(" 「11.11狂欢盛典 | 跨店满300减50 | 叠加店铺券再减XX」") # 618 elif "618" in event_lower: print("🎉 【618年中大促文案】") print("") print("📌 主标题方案:") titles = [ "618年中狂欢!半年最低价,买它!", "6.18大促来袭 | 年中清仓,爆款直降!", "618提前抢!预售开启,定金膨胀翻3倍!", ] for i, t in enumerate(titles, 1): print(" {}. {}".format(i, t)) print("") print("📌 活动节奏:") print(" 🔸 种草期(6.01-6.15): 加购领券,提前锁价") print(" 🔸 开门红(6.16-6.17): 限时秒杀,前N件半价") print(" 🔸 高潮日(6.18当天): 全场最低价,巅峰狂欢") print(" 🔸 返场期(6.19-6.20): 错过补购,尾货清仓") print("") print("📌 促销话术:") print(" · 「年中大促,半年等一回!」") print(" · 「618价到了!比日常省XX元!」") print(" · 「开门红秒杀!前100名半价!」") print(" · 「满减+券+赠品,三重优惠叠加!」") print(" · 「618必囤清单第一名!不买后悔!」") # 聚划算 elif "聚划算" in event_lower or "juhuasuan" in event_lower: print("🎉 【聚划算专场文案】") print("") print("📌 主标题方案:") titles = [ "聚划算限时秒杀!全网底价,拼手速!", "聚划算团购价 | 人越多越便宜!", "聚划算品牌日 | 正品保障,价格击穿!", ] for i, t in enumerate(titles, 1): print(" {}. {}".format(i, t)) print("") print("📌 聚划算文案模板:") print(" · 「聚划算独家价,比日常省XX%!」") print(" · 「限时24小时!过期恢复原价!」") print(" · 「已有XXXX人参团,库存仅剩XX件!」") print(" · 「品牌授权,假一赔十,放心购!」") print(" · 「团购价到手¥XX,日常价¥XX,省¥XX!」") print("") print("📌 详情页必备元素:") print(" ✅ 聚划算LOGO + 限时标签") print(" ✅ 价格对比条(划线价 vs 聚划算价)") print(" ✅ 已参团人数实时展示") print(" ✅ 倒计时组件") print(" ✅ 赠品/满减信息突出展示") # 日常促销(默认) else: print("🎉 【{}促销文案】".format(event_type)) print("") print("📌 主标题方案:") titles = [ "{}特惠 | 限时折扣,错过不再有!".format(event_type), "{} | 爆款直降,买到就是赚到!".format(event_type), "{}福利来袭 | 全场满减,优惠享不停!".format(event_type), ] for i, t in enumerate(titles, 1): print(" {}. {}".format(i, t)) print("") print("📌 促销话术模板:") print(" · 「限时特惠,倒计时XX小时!」") print(" · 「库存告急!仅剩最后XX件!」") print(" · 「满XX减XX,上不封顶!」") print(" · 「前100名下单赠送精美礼品!」") print(" · 「老客专享价,比新客再省XX元!」") print(" · 「收藏加购领5元无门槛券!」") print("") print("📌 日常促销工具箱:") print(" 🔸 满减券: 满99减10 / 满199减30 / 满299减50") print(" 🔸 限时折: 前1小时8折 / 前100件7折") print(" 🔸 搭配购: 买A+B立减XX元 / 第二件半价") print(" 🔸 赠品策: 买就送 / 满额送 / 评价晒单送") print(" 🔸 会员价: VIP专享价 / 老客回馈价") print("") print("-" * 60) print("💡 促销文案通用技巧:") print(" - 突出价格对比(原价 vs 活动价),让优惠一目了然") print(" - 制造紧迫感(限时、限量、倒计时)") print(" - 叠加优惠(满减+券+赠品),提升客单价") print(" - 用数据说话(已售XX件、XX人加购)") print(" - 主图必须有活动氛围(红色/橙色+促销标签)") print(" - 提前设置购物车营销和收藏有礼") def main(): args = sys.argv[1:] if not args: show_help() return cmd = args[0] if cmd == "help": show_help() elif cmd == "title": if len(args) < 3: print("用法: taobao.sh title \"产品名\" \"关键词1,关键词2\"") sys.exit(1) gen_title(args[1], args[2]) elif cmd == "selling-point": if len(args) < 2: print("用法: taobao.sh selling-point \"产品名\"") sys.exit(1) gen_selling_points(args[1]) elif cmd == "detail": if len(args) < 2: print("用法: taobao.sh detail \"产品名\" [\"材质,尺寸,功能\"]") sys.exit(1) attrs_str = args[2] if len(args) >= 3 else "" gen_detail(args[1], attrs_str) elif cmd == "keyword": if len(args) < 2: print("用法: taobao.sh keyword \"产品名\"") sys.exit(1) gen_keyword(args[1]) elif cmd == "promotion": if len(args) < 2: print("用法: taobao.sh promotion \"活动类型\"") print("支持: 双11, 618, 聚划算, 或任意活动名称") sys.exit(1) gen_promotion(args[1]) elif cmd == "review-reply": if len(args) < 2: print("用法: taobao.sh review-reply \"评价内容\"") sys.exit(1) gen_review_reply(args[1]) else: print("未知命令: {}".format(cmd)) print("运行 taobao.sh help 查看帮助") sys.exit(1) if __name__ == "__main__": main() PYTHON_EOF echo "" echo " Powered by BytesAgain | bytesagain.com | [email protected]" FILE:tips.md # 淘宝运营实战技巧 💡 ## 一、标题优化(搜索SEO核心) ### 1. 标题30字黄金公式 ``` 核心词 + 属性词 + 长尾词 + 热搜词 + 促销词 ``` - 核心词放最前面(权重最高位置) - 属性词紧跟核心词(材质/功能/风格) - 长尾词填充中段(精准匹配用户搜索) - 热搜词蹭流量(2024新款/网红同款) - 促销词收尾(包邮/7天无理由) ### 2. 标题常见错误 - ❌ 关键词重复(浪费字数) - ❌ 用空格分割关键词(淘宝用紧密排列) - ❌ 堆砌极限词(最好/第一/国家级) - ❌ 品牌词侵权(用别人的品牌名) - ❌ 标题太短(不到20字就浪费了曝光机会) ### 3. 关键词来源 - 淘宝搜索下拉词(免费,最真实的用户搜索) - 生意参谋-市场洞察(付费,数据最准) - 直通车关键词工具(免费,竞争度数据) - 竞品标题拆解(免费,看对手用什么词) - 小红书/抖音热词(跨平台蹭流量) ## 二、详情页转化率优化 ### 4. 详情页5屏法则 - 第1屏:核心卖点+促销信息(留住用户) - 第2屏:产品细节展示(建立品质感) - 第3屏:使用场景+对比(激发购买欲) - 第4屏:买家秀/评价精选(信任背书) - 第5屏:售后保障+促销引导(消除顾虑) ### 5. 主图点击率提升 - 第1张主图决定搜索点击率(最重要!) - 白底图适合类目搜索,场景图适合推荐流量 - 主图加卖点文字但不超过图片面积20% - 与竞品主图做差异化(颜色/角度/构图) - 定期更换测试,找到最优主图 ### 6. 详情页信任体系 - 品牌授权书/质检报告(硬信任) - 销量数据/好评率(数据信任) - 买家秀精选(社交信任) - 退换货承诺/运费险(保障信任) - 客服响应速度(服务信任) ## 三、促销活动运营 ### 7. 大促节奏(双11/618) ``` 预售期 → 预热期 → 爆发期 → 返场期 (蓄客) (加购) (成交) (收尾) ``` - 预售期:定金膨胀,锁定精准客户 - 预热期:加购有礼,扩大潜客池 - 爆发期:全场最低价,集中成交 - 返场期:清尾货,抓犹豫客户 ### 8. 日常促销工具箱 - 满减券:提升客单价(满199减30) - 限时折:制造紧迫感(前1小时8折) - 搭配购:关联销售(买A+B减XX) - 赠品策:提升价值感(买就送/满额送) - 会员价:提升复购率(老客专享价) ### 9. 聚划算/淘抢购报名 - 提前15天报名,准备充足库存 - 价格必须是近30天最低价 - 主图要求白底图,无牛皮癣 - 好评率≥97%才有资格 - 报名文案突出性价比和品质 ## 四、关键词布局策略 ### 10. 关键词分层投放 ``` 核心大词(流量大,竞争激烈)→ 直通车精准投放 长尾词(流量精准,竞争小)→ 标题自然搜索优化 属性词(提高相关性)→ 标题+详情页布局 热搜词(时效性强)→ 跟踪更新,及时布局 ``` ### 11. 关键词数据分析 - 搜索人气:越高越好(有人搜) - 点击率:>3%算合格(有人点) - 转化率:>2%算合格(有人买) - 竞争度:人气/在线商品数(蓝海指标) - 每周更新关键词,淘汰效果差的 ## 五、评价管理 ### 12. 好评引导策略 - 包裹内放好评卡(返现2-5元) - 确认收货后自动发感谢短信 - 追评引导(使用7天后发提醒) - 晒图好评额外返现 - 视频好评最高返现 ### 13. 差评处理黄金72小时 - 0-4小时:电话联系,了解原因 - 4-24小时:提供解决方案(退/换/补) - 24-48小时:方案执行+确认满意 - 48-72小时:礼貌请求修改评价 - 72小时后:公开回复展示诚意 ## 六、数据化运营 ### 14. 核心数据指标 ``` 曝光量 → 点击率 → 加购率 → 转化率 → 复购率 (标题) (主图) (详情) (价格) (品质) ``` - 每个环节都有优化空间 - 找到最薄弱的环节重点优化 - 行业平均值作为参考基准 ### 15. 竞品分析方法 - 找到品类TOP10竞品 - 分析标题关键词布局 - 对比价格带和SKU设计 - 研究主图和详情页策略 - 学习评价和买家秀运营 --- 📌 **记住**:淘宝运营 = 流量(标题+关键词) × 转化(详情+价格) × 复购(品质+服务) 三个环节缺一不可,持续优化才能持续增长! > 使用 `taobao.sh help` 查看所有可用命令
Shopify建站助手。店铺搭建、主题定制、产品管理、SEO优化、应用推荐、上线检查。Shopify store builder with setup, theme, product, SEO, apps.
--- version: "2.0.0" name: shopify-helper description: "Shopify建站助手。店铺搭建、主题定制、产品管理、SEO优化、应用推荐、上线检查。Shopify store builder with setup, theme, product, SEO, apps." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # shopify-helper Shopify建站助手。店铺搭建、主题定制、产品管理、SEO优化、应用推荐、上线检查。Shopify store builder with setup, theme, product, SEO, apps, launch checklist. Shopify、独立站、DTC品牌、电商建站。Use when building or optimizing Shopify stores. ## 如何使用 1. 选择你需要的功能命令 2. 输入你的具体需求描述 3. 获取专业的输出结果 4. 根据需要调整和完善 ## 命令速查 ``` setup setup theme theme product product seo seo app app launch launch ``` ## 专业建议 - 店铺搭建 (setup)**: 按流程一步步设置,别跳步骤 - 主题定制 (theme)**: 先选好主题再定制,减少返工 - 产品管理 (product)**: 产品图片+描述是核心竞争力 - SEO优化 (seo)**: 建站初期就要考虑SEO - 应用推荐 (app)**: 别装太多APP,影响速度 --- *shopify-helper by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Commands Run `shopify-helper help` to see all available commands. FILE:scripts/script.sh #!/usr/bin/env bash # shopify-helper - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/shopify-helper}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF shopify-helper v$VERSION Multi-purpose utility tool Usage: shopify-helper <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "shopify-helper v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/shopify.sh #!/usr/bin/env bash # Shopify Helper — Shopify建站助手 # Usage: bash shopify.sh <command> [args...] set -euo pipefail CMD="-help" shift 2>/dev/null || true INPUT="$*" case "$CMD" in setup) cat <<'PROMPT' ## 🏪 Shopify店铺搭建 ### 建站流程 **Step 1: 注册和基础设置** 1. 注册Shopify账号 (shopify.com) 2. 选择套餐 | 套餐 | 月费 | 交易费 | 适合 | |------|------|--------|------| | Basic | $39/月 | 2.9%+30¢ | 新手/小店 | | Shopify | $105/月 | 2.6%+30¢ | 成长期 | | Advanced | $399/月 | 2.4%+30¢ | 规模化 | | Plus | $2300/月 | 定制 | 大品牌 | **Step 2: 店铺基本信息** - [ ] 店铺名称 - [ ] 品牌Logo (推荐尺寸: 250×250px) - [ ] 品牌色彩 (主色+辅色+强调色) - [ ] 联系邮箱 - [ ] 联系电话 - [ ] 公司地址 **Step 3: 域名设置** ``` 选项A: 购买新域名 (通过Shopify或GoDaddy) 选项B: 连接已有域名 域名建议: - 简短好记 - 与品牌一致 - .com优先 - 避免连字符和数字 ``` **Step 4: 支付设置** | 支付方式 | 覆盖 | 费率 | |----------|------|------| | Shopify Payments | 20+国家 | 最低 | | PayPal | 全球 | 2.9%+30¢ | | Stripe | 40+国家 | 2.9%+30¢ | | 支付宝/微信 | 中国 | 需集成 | **Step 5: 物流设置** - 配送区域和费率 - 发货地址 - 包装重量预设 - 免费配送规则 **Step 6: 税务设置** - 美国各州销售税 (自动计算) - 欧盟VAT - 其他国家税务 **Step 7: 法律页面** - [ ] Privacy Policy (隐私政策) - [ ] Terms of Service (服务条款) - [ ] Refund Policy (退款政策) - [ ] Shipping Policy (配送政策) 💡 Shopify可自动生成法律页面模板 PROMPT echo "" echo "📌 输入信息: -请提供店铺类型和需求" ;; theme) cat <<'PROMPT' ## 🎨 Shopify主题定制 ### 免费主题推荐 | 主题 | 风格 | 适合品类 | 特点 | |------|------|----------|------| | Dawn | 简约现代 | 通用 | 官方默认,性能最佳 | | Craft | 手工艺 | 手工/艺术 | 故事感强 | | Crave | 餐饮 | 食品/饮品 | 美食风格 | | Sense | 美妆 | 美妆/护肤 | 精致优雅 | | Ride | 运动 | 运动/户外 | 活力动感 | | Refresh | 健康 | 保健/养生 | 清新自然 | ### 付费主题推荐 | 主题 | 价格 | 适合 | 特点 | |------|------|------|------| | Prestige | $350 | 高端品牌 | 奢华感 | | Impact | $350 | 潮牌 | 视觉冲击 | | Symmetry | $350 | 通用 | 均衡布局 | | Impulse | $350 | 时尚 | 画册感 | ### 主题定制要点 **1. 首页结构** ``` Header (导航+Logo+购物车) ↓ Hero Banner (大图+CTA) ↓ Featured Collection (精选系列) ↓ About/Story (品牌故事) ↓ Testimonials (客户评价) ↓ Newsletter (邮件订阅) ↓ Footer (链接+社交媒体) ``` **2. 色彩系统** | 用途 | 建议 | |------|------| | 主色 | 品牌色,用于Logo/按钮 | | 背景色 | 白色或浅灰 | | 文字色 | 深灰(#333) | | CTA按钮 | 对比色,醒目 | | 链接色 | 与品牌色一致 | **3. 字体选择** | 用途 | 推荐 | |------|------| | 标题 | Playfair Display / Montserrat | | 正文 | Open Sans / Lato / Roboto | | 中文 | Noto Sans SC / 思源黑体 | **4. 图片规范** | 位置 | 推荐尺寸 | 格式 | |------|----------|------| | Hero Banner | 1920×800px | JPG/WebP | | 产品图 | 2048×2048px | PNG(白底) | | Collection | 1024×1024px | JPG | | Blog | 1200×628px | JPG | | Logo | 250×250px | PNG(透明) | | Favicon | 32×32px | ICO/PNG | ### 移动端优化 - 按钮大小≥44px (手指可触) - 文字≥16px (不用放大) - 图片压缩 (TinyPNG) - 汉堡菜单简洁 - 底部固定购买栏 PROMPT echo "" echo "📌 输入信息: -请提供品牌风格和偏好" ;; product) cat <<'PROMPT' ## 📦 产品管理 ### 产品上架清单 **1. 基本信息** - [ ] 产品标题 (SEO友好) - [ ] 产品描述 (HTML/Rich Text) - [ ] 产品类型 (Product Type) - [ ] 供应商 (Vendor) - [ ] 标签 (Tags) - [ ] 系列 (Collections) **2. 产品图片** | 要求 | 标准 | |------|------| | 数量 | 5-8张 | | 主图 | 白底/正面 | | 尺寸 | 2048×2048px | | 格式 | JPG/PNG/WebP | | 大小 | <5MB | | 内容 | 正面/侧面/细节/场景/尺寸对比 | **3. 价格设置** | 字段 | 说明 | |------|------| | Price | 售价 | | Compare at price | 原价(划线价) | | Cost per item | 成本(不显示) | | 利润率 | 自动计算 | **4. 库存管理** - SKU编码规则: [品类]-[款式]-[颜色]-[尺码] - 示例: TS-V1-BLK-L (T恤-V1款-黑色-L码) - 跟踪库存数量 - 低库存提醒 **5. 变体设置 (Variants)** ``` 尺寸: S / M / L / XL / XXL 颜色: 黑色 / 白色 / 蓝色 材质: 纯棉 / 混纺 每个变体可设置: - 独立价格 - 独立库存 - 独立SKU - 独立图片 ``` **6. 产品描述模板** ```html <h3>产品特点</h3> <ul> <li>✅ 卖点1 — 详细描述</li> <li>✅ 卖点2 — 详细描述</li> <li>✅ 卖点3 — 详细描述</li> </ul> <h3>产品规格</h3> <table> <tr><td>材质</td><td>XXX</td></tr> <tr><td>尺寸</td><td>XXX</td></tr> <tr><td>重量</td><td>XXX</td></tr> </table> <h3>使用场景</h3> <p>场景描述...</p> <h3>包装清单</h3> <ul> <li>产品 × 1</li> <li>说明书 × 1</li> </ul> ``` ### 批量管理 - 使用CSV批量导入 - Shopify Matrixify APP - 批量编辑价格/库存 PROMPT echo "" echo "📌 输入信息: -请提供产品信息以创建listing" ;; seo) cat <<'PROMPT' ## 🔍 Shopify SEO优化 ### 核心SEO设置 **1. 页面SEO** | 页面 | Title格式 | Meta Description | |------|-----------|-----------------| | 首页 | 品牌名 - 核心定位 | 50-160字符描述 | | 产品页 | 产品名 - 品牌 | 产品卖点摘要 | | 系列页 | 系列名 - 品牌 | 系列描述 | | 博客页 | 文章标题 - 品牌 | 文章摘要 | **2. URL结构** ``` ✅ 好的URL: /products/wireless-bluetooth-earbuds /collections/summer-dresses /blogs/style-guide/how-to-wear-linen ❌ 差的URL: /products/product-1234 /collections/all ``` **3. 图片SEO** - 文件名: wireless-earbuds-black.jpg (非IMG_1234.jpg) - Alt标签: "Brand wireless Bluetooth earbuds in black with charging case" - 压缩: <500KB (使用TinyPNG) - 格式: WebP优先 **4. 网站速度** | 优化项 | 方法 | |--------|------| | 图片优化 | WebP格式+压缩 | | APP精简 | 只保留必要APP | | 代码优化 | 移除不用的JS/CSS | | CDN | Shopify自带CDN | | 懒加载 | 图片延迟加载 | | 目标 | PageSpeed分数>80 | **5. 内容营销 (博客)** ``` 建站初期发布10-20篇高质量博客: - 产品使用指南 - 行业知识科普 - 穿搭/搭配建议 - 常见问题解答 - 品牌故事 每篇1000-2000词 包含内部链接到产品页 ``` **6. 结构化数据** ```json { "@type": "Product", "name": "产品名", "image": "图片URL", "description": "描述", "offers": { "price": "价格", "availability": "InStock" }, "aggregateRating": { "ratingValue": "4.5", "reviewCount": "120" } } ``` ### SEO检查工具 | 工具 | 用途 | 价格 | |------|------|------| | Google Search Console | 搜索表现 | 免费 | | Google Analytics | 流量分析 | 免费 | | Ahrefs | 外链分析 | $99+/月 | | SEMrush | 关键词研究 | $129+/月 | | Plug in SEO (APP) | 站内SEO检查 | 免费版有 | ### 技术SEO清单 - [ ] sitemap.xml (Shopify自动生成) - [ ] robots.txt (Shopify自动管理) - [ ] SSL证书 (Shopify自带) - [ ] 301重定向 (URL变更时) - [ ] 规范化标签 (canonical) - [ ] 移动端适配 (响应式) - [ ] 页面速度优化 - [ ] 结构化数据标记 PROMPT echo "" echo "📌 输入信息: -请提供SEO优化需求" ;; app) cat <<'PROMPT' ## 📱 Shopify APP推荐 ### 必装APP (基础功能) | APP名称 | 功能 | 价格 | 优先级 | |---------|------|------|--------| | Judge.me | 产品评价 | 免费起 | ★★★★★ | | Klaviyo | 邮件营销 | 免费起 | ★★★★★ | | Google Channel | Google购物广告 | 免费 | ★★★★★ | | Facebook Channel | FB/IG广告 | 免费 | ★★★★★ | | Shopify Inbox | 在线客服 | 免费 | ★★★★ | | DSers | AliExpress代发 | 免费起 | ★★★★(代发) | ### 营销增长 | APP名称 | 功能 | 价格 | |---------|------|------| | Privy | 弹窗/优惠券 | 免费起 | | Smile.io | 会员积分 | 免费起 | | ReferralCandy | 推荐返利 | $49/月 | | Omnisend | 全渠道营销 | 免费起 | | SMSBump | 短信营销 | 免费起 | ### 转化优化 | APP名称 | 功能 | 价格 | |---------|------|------| | Shogun | 页面编辑器 | $39/月 | | ReConvert | 感谢页优化 | 免费起 | | Frequently Bought | 关联推荐 | 免费起 | | Loox | 图片评价 | $9.99/月 | | Tidio | AI客服 | 免费起 | ### SEO工具 | APP名称 | 功能 | 价格 | |---------|------|------| | Plug in SEO | SEO检查 | 免费起 | | JSON-LD for SEO | 结构化数据 | $9.99/月 | | Smart SEO | 自动Meta/Alt | 免费起 | ### 运营管理 | APP名称 | 功能 | 价格 | |---------|------|------| | Matrixify | 批量导入导出 | 免费起 | | Inventory Planner | 库存预测 | $99/月 | | ShipStation | 物流管理 | $9.99/月 | | QuickBooks | 财务对接 | 集成 | ### APP安装建议 ``` ⚠️ 注意事项: 1. 不要安装超过15-20个APP 2. 每安装一个APP测试网站速度 3. 卸载不用的APP(残留代码手动清理) 4. 优先选择评分4.5+的APP 5. 先用免费版本测试 6. 定期审查APP必要性 ``` PROMPT echo "" echo "📌 输入信息: -请提供店铺类型以推荐APP" ;; launch) cat <<'PROMPT' ## 🚀 上线前检查清单 ### 一、基础设置 - [ ] 域名已连接并正常访问 - [ ] SSL证书已启用 (HTTPS) - [ ] Favicon已设置 - [ ] 店铺名称正确 - [ ] 联系信息完整 - [ ] 时区和货币正确 ### 二、页面检查 - [ ] 首页加载正常 - [ ] 导航菜单完整 - [ ] 产品页面正常 - [ ] 购物车功能正常 - [ ] 结账流程顺畅 - [ ] 404页面已定制 - [ ] 法律页面已创建 - [ ] Privacy Policy - [ ] Terms of Service - [ ] Refund Policy - [ ] Shipping Policy ### 三、产品检查 - [ ] 所有产品已上架 - [ ] 产品图片高清 - [ ] 产品描述完整 - [ ] 价格正确 - [ ] 库存数量准确 - [ ] 变体设置正确 - [ ] 产品系列分类正确 ### 四、支付和物流 - [ ] 支付方式已测试 - [ ] 测试订单已完成 - [ ] 物流费率已设置 - [ ] 税务设置正确 - [ ] 退款政策清晰 - [ ] 订单确认邮件正常 ### 五、SEO和营销 - [ ] 页面Title和Description已优化 - [ ] 图片Alt标签已添加 - [ ] Google Analytics已安装 - [ ] Facebook Pixel已安装 - [ ] Google Search Console已验证 - [ ] 社交媒体链接正确 - [ ] 邮件订阅功能正常 ### 六、移动端 - [ ] 手机端显示正常 - [ ] 触控元素可点击 - [ ] 图片加载快速 - [ ] 结账流程手机友好 - [ ] 底部导航正常 ### 七、速度和安全 - [ ] PageSpeed分数>80 - [ ] 图片已压缩 - [ ] 不必要的APP已卸载 - [ ] GDPR合规 (Cookie提示) - [ ] 管理员二次验证开启 ### 八、上线后待办 - [ ] 密码保护已移除 - [ ] 发布到Google Search Console - [ ] 提交sitemap - [ ] 发布社交媒体公告 - [ ] 开启广告投放 - [ ] 设置库存提醒 - [ ] 安排第一批推广活动 ### 上线时间建议 | 建议 | 原因 | |------|------| | 周二-周四上线 | 避免周末客服不在 | | 上午10点 | 有时间处理问题 | | 非节假日 | 减少物流延迟 | | 预留一周测试 | 发现并修复问题 | PROMPT echo "" echo "📌 输入信息: -请提供店铺状态以定制检查清单" ;; help|*) cat <<'EOF' Shopify Helper — Shopify建站助手 Usage: bash shopify.sh <command> [args...] Commands: setup 店铺搭建 — 基础设置和配置 theme 主题定制 — 主题选择和定制 product 产品管理 — 产品上架和管理 seo SEO优化 — 搜索引擎优化 app 应用推荐 — 必备和好用的APP launch 上线检查 — Launch Checklist Examples: bash shopify.sh setup "服装品牌独立站" bash shopify.sh theme "简约风格" bash shopify.sh product "产品上架流程" bash shopify.sh seo "独立站SEO" bash shopify.sh app "必装应用" bash shopify.sh launch "上线前检查" Powered by BytesAgain | bytesagain.com | [email protected] EOF ;; esac FILE:tips.md # Shopify Helper — Tips ## 使用建议 1. **店铺搭建 (setup)**: 按流程一步步设置,别跳步骤 2. **主题定制 (theme)**: 先选好主题再定制,减少返工 3. **产品管理 (product)**: 产品图片+描述是核心竞争力 4. **SEO优化 (seo)**: 建站初期就要考虑SEO 5. **应用推荐 (app)**: 别装太多APP,影响速度 6. **上线检查 (launch)**: 上线前必须过一遍检查清单 ## 最佳实践 - 先免费试用14天,确认适合再付费 - 从免费主题开始,Dawn主题够用 - 产品图片统一风格,白底或场景图 - 页面加载速度<3秒,影响转化率 - 移动端体验优先(70%+流量来自手机) - 安装Google Analytics和Facebook Pixel
环境变量配置管理。.env模板生成(Node/Python/Go/Docker)、验证、环境变量生成、多环境合并、加密建议、文档化。Environment variable config manager with templates, validation, generation, multi-env merge...
--- version: "2.0.0" name: Env Config Manager description: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. Use when you need env config capabilities. Triggers on: env config." 环境变量配置管理。.env模板生成(Node/Python/Go/Docker)、验证、环境变量生成、多环境合并、加密建议、文档化。Environment variable config manager with templates, validation, generation, multi-env merge, encryption, documentation. .env、配置管理、环境变量。 author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Env Config Manager 环境变量配置管理。.env模板生成(Node/Python/Go/Docker)、验证、环境变量生成、多环境合并、加密建议、文档化。Environment variable config manager with templates, validation, generation, multi-env merge, encryption, documentation. .env、配置管理、环境变量。 ## 使用场景 > 💡 无论你是新手还是专业人士,都能快速上手 ## 可用命令 - **template** — template - **validate** — validate - **generate** — generate - **merge** — merge - **encrypt** — encrypt - **document** — document ## 专业建议 - 每个项目都有 `.env.example`(不含真实值) - `.env` 加入 `.gitignore` - 变量名全大写下划线分隔: `DATABASE_URL` - 布尔值用 `true/false` 不用 `1/0` - 生产环境不要用 .env 文件,用环境变量注入 --- *Env Config Manager by BytesAgain* ## Commands - `compose` — ============================================ - `decode` — Execute decode - `diff` — Execute diff - `encode` — Execute encode - `fastapi` — ============================================ - `gitignore` — Execute gitignore - `golang` — ============================================ - `lint` — Execute lint - `node` — Execute node - `nodejs` — ============================================ - `nuxt` — ============================================ - `sort` — 🔑 .env.example 中有但 .env 中缺少的键: --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help env-config help # Run env-config run ``` FILE:scripts/env.sh #!/usr/bin/env bash # Env Config — .env file manager and generator # Usage: env.sh <command> [options] set -euo pipefail CMD="-help"; shift 2>/dev/null || true # Parse flags PROJECT="node" FILE=".env" OUTPUT="" KEY="" VALUE="" while [[ $# -gt 0 ]]; do case "$1" in --project) PROJECT="$2"; shift 2 ;; --file) FILE="$2"; shift 2 ;; --output) OUTPUT="$2"; shift 2 ;; --key) KEY="$2"; shift 2 ;; --value) VALUE="$2"; shift 2 ;; *) shift ;; esac done gen_init() { case "$PROJECT" in node|express|nodejs) cat <<'ENV' # ============================================ # Node.js / Express 环境变量 # 复制为 .env 使用,切勿提交到 Git! # ============================================ # ---- 应用配置 ---- NODE_ENV=development PORT=3000 HOST=0.0.0.0 APP_NAME=my-app APP_URL=http://localhost:3000 LOG_LEVEL=debug # ---- 数据库 ---- DB_HOST=localhost DB_PORT=5432 DB_NAME=myapp_dev DB_USER=postgres DB_PASSWORD=changeme DB_SSL=false # DATABASE_URL=postgresql://DB_USER:DB_PASSWORD@DB_HOST:DB_PORT/DB_NAME # ---- Redis ---- REDIS_HOST=localhost REDIS_PORT=6379 REDIS_PASSWORD= # REDIS_URL=redis://localhost:6379 # ---- JWT / 认证 ---- JWT_SECRET=change-this-to-a-random-64-char-string JWT_EXPIRES_IN=7d REFRESH_TOKEN_EXPIRES_IN=30d # ---- 邮件 ---- SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER= SMTP_PASSWORD= [email protected] # ---- 存储 (S3/OSS) ---- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_REGION=us-east-1 AWS_S3_BUCKET= # ---- 第三方 API ---- OPENAI_API_KEY= STRIPE_SECRET_KEY= STRIPE_WEBHOOK_SECRET= # ---- CORS ---- CORS_ORIGINS=http://localhost:3000,http://localhost:5173 # ---- 速率限制 ---- RATE_LIMIT_WINDOW_MS=900000 RATE_LIMIT_MAX=100 ENV ;; python|django|flask|fastapi) cat <<'ENV' # ============================================ # Python (Django/Flask/FastAPI) 环境变量 # 复制为 .env 使用 # ============================================ # ---- 应用配置 ---- APP_ENV=development DEBUG=True SECRET_KEY=change-this-to-a-random-secret-key ALLOWED_HOSTS=localhost,127.0.0.1 # ---- 数据库 ---- DB_ENGINE=django.db.backends.postgresql DB_NAME=myapp_dev DB_USER=postgres DB_PASSWORD=changeme DB_HOST=localhost DB_PORT=5432 DATABASE_URL=postgresql://postgres:changeme@localhost:5432/myapp_dev # ---- Redis ---- REDIS_URL=redis://localhost:6379/0 CELERY_BROKER_URL=redis://localhost:6379/1 # ---- 邮件 ---- EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_USE_TLS=True EMAIL_HOST_USER= EMAIL_HOST_PASSWORD= # ---- 存储 ---- AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_STORAGE_BUCKET_NAME= AWS_S3_REGION_NAME=us-east-1 # ---- API Keys ---- OPENAI_API_KEY= SENTRY_DSN= # ---- CORS ---- CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8080 ENV ;; react|vue|vite|nextjs|nuxt) cat <<'ENV' # ============================================ # 前端项目 (React/Vue/Next.js/Nuxt) 环境变量 # VITE_* 或 NEXT_PUBLIC_* 前缀暴露给浏览器 # ============================================ # ---- 应用配置 ---- # Vite 项目用 VITE_ 前缀 VITE_APP_TITLE=My App VITE_APP_VERSION=1.0.0 # Next.js 项目用 NEXT_PUBLIC_ 前缀 # NEXT_PUBLIC_APP_TITLE=My App # ---- API 配置 ---- VITE_API_BASE_URL=http://localhost:3000/api VITE_API_TIMEOUT=10000 # ---- 认证 ---- VITE_AUTH_DOMAIN= VITE_AUTH_CLIENT_ID= # ---- 分析/监控 ---- VITE_GA_TRACKING_ID= VITE_SENTRY_DSN= # ---- 功能开关 ---- VITE_FEATURE_DARK_MODE=true VITE_FEATURE_I18N=false # ---- 构建配置(不暴露给浏览器)---- GENERATE_SOURCEMAP=false ANALYZE=false ENV ;; go|golang) cat <<'ENV' # ============================================ # Go 项目环境变量 # ============================================ # ---- 应用 ---- APP_ENV=development APP_PORT=8080 APP_HOST=0.0.0.0 APP_DEBUG=true APP_NAME=myapp # ---- 数据库 ---- DB_DRIVER=postgres DB_HOST=localhost DB_PORT=5432 DB_NAME=myapp_dev DB_USER=postgres DB_PASSWORD=changeme DB_SSLMODE=disable DB_MAX_CONNS=25 DB_MAX_IDLE_CONNS=5 # ---- Redis ---- REDIS_ADDR=localhost:6379 REDIS_PASSWORD= REDIS_DB=0 # ---- JWT ---- JWT_SECRET=change-me JWT_EXPIRY=24h # ---- 日志 ---- LOG_LEVEL=debug LOG_FORMAT=json ENV ;; docker|compose) cat <<'ENV' # ============================================ # Docker Compose 环境变量 # ============================================ # ---- 项目 ---- COMPOSE_PROJECT_NAME=myproject COMPOSE_FILE=docker-compose.yml # ---- 应用 ---- APP_PORT=3000 APP_ENV=production # ---- 数据库 ---- POSTGRES_USER=postgres POSTGRES_PASSWORD=changeme POSTGRES_DB=myapp POSTGRES_PORT=5432 # ---- Redis ---- REDIS_PORT=6379 REDIS_PASSWORD= # ---- Nginx ---- NGINX_PORT=80 NGINX_SSL_PORT=443 # ---- 日志 ---- LOG_DRIVER=json-file LOG_MAX_SIZE=10m LOG_MAX_FILE=3 ENV ;; *) cat <<ENV # ============================================ # 通用环境变量模板 # 项目类型: PROJECT # ============================================ APP_ENV=development APP_PORT=3000 APP_SECRET=change-this-secret DB_HOST=localhost DB_PORT=5432 DB_NAME=myapp DB_USER=root DB_PASSWORD=changeme REDIS_URL=redis://localhost:6379 LOG_LEVEL=debug ENV ;; esac } gen_gitignore() { cat <<'GITIGNORE' # ---- 环境变量文件 ---- .env .env.local .env.*.local .env.development .env.production .env.staging # 保留示例文件 !.env.example !.env.sample GITIGNORE } validate_env() { local file="-.env" if [[ ! -f "$file" ]]; then echo "❌ 文件不存在: $file" exit 1 fi local errors=0 local warnings=0 local line_num=0 local keys=() echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo " 🔍 验证 .env 文件: $file" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" while IFS= read -r line || [[ -n "$line" ]]; do line_num=$((line_num + 1)) # Skip empty lines and comments [[ -z "$line" || "$line" =~ ^[[:space:]]*# ]] && continue # Check format: KEY=VALUE if ! echo "$line" | grep -qE '^[A-Za-z_][A-Za-z0-9_]*=' 2>/dev/null; then echo "❌ 第line_num行: 格式错误 → $line" errors=$((errors + 1)) continue fi local key="line%%=*" local value="line#*=" # Check duplicate keys local existing_key for existing_key in "keys[@]+"${keys[@]"}"; do if [[ "$existing_key" == "$key" ]]; then echo "⚠️ 第line_num行: 重复的键 → $key" warnings=$((warnings + 1)) fi done keys+=("$key") # Check empty values if [[ -z "$value" ]]; then echo "⚠️ 第line_num行: 空值 → $key" warnings=$((warnings + 1)) fi # Check common security issues case "$key" in *PASSWORD*|*SECRET*|*KEY*|*TOKEN*) if [[ "$value" == "changeme" || "$value" == "password" || "$value" == "123456" || "$value" == "secret" ]]; then echo "🔐 第line_num行: 不安全的默认值 → $key=$value" warnings=$((warnings + 1)) fi ;; esac done < "$file" echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo " 📊 结果: line_num行 | ❌ errors个错误 | ⚠️ warnings个警告" if [[ $errors -eq 0 && $warnings -eq 0 ]]; then echo " ✅ 文件格式正确!" fi echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" } encrypt_env() { local file="-.env" if [[ ! -f "$file" ]]; then echo "❌ 文件不存在: $file" exit 1 fi echo "# ============================================" echo "# Base64 编码 — file" echo "# 用 env.sh decrypt --file <file> 解码" echo "# 注意:Base64 不是加密,仅做简单混淆!" echo "# ============================================" base64 < "$file" echo "" echo "# ✅ 已编码 $(wc -l < "$file") 行" } decrypt_env() { local file="-.env" if [[ ! -f "$file" ]]; then echo "❌ 文件不存在: $file" exit 1 fi # Strip comment lines, then decode grep -v '^#' "$file" | base64 -d 2>/dev/null || { echo "❌ 解码失败:文件可能不是有效的 Base64 编码" exit 1 } } gen_compare() { echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo " 📋 .env vs .env.example 对比" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" local env_file=".env" local example_file=".env.example" [[ -f "$env_file" ]] || { echo "❌ 缺少 .env"; exit 1; } [[ -f "$example_file" ]] || { echo "❌ 缺少 .env.example"; exit 1; } # Extract keys local env_keys example_keys env_keys=$(grep -E '^[A-Za-z_]' "$env_file" | cut -d= -f1 | sort) example_keys=$(grep -E '^[A-Za-z_]' "$example_file" | cut -d= -f1 | sort) echo "" echo "🔑 .env.example 中有但 .env 中缺少的键:" comm -23 <(echo "$example_keys") <(echo "$env_keys") | while read -r key; do echo " ⚠️ $key" done || echo " ✅ 无缺失" echo "" echo "➕ .env 中有但 .env.example 中没有的键:" comm -13 <(echo "$example_keys") <(echo "$env_keys") | while read -r key; do echo " ℹ️ $key" done || echo " ✅ 无多余" } case "$CMD" in init|generate|gen) gen_init ;; validate|check|lint) validate_env ;; encrypt|encode) encrypt_env ;; decrypt|decode) decrypt_env ;; gitignore) gen_gitignore ;; compare|diff) gen_compare ;; *) cat <<'EOF' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚙️ Env Config — .env 文件管理工具 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 命令 说明 ────────────────────────────────────────── init 生成 .env 模板 --project TYPE 项目类型: node, python, react, vue, go, docker (默认: node) validate 验证 .env 文件格式 --file PATH 文件路径 (默认: .env) encrypt Base64 编码 .env 文件 --file PATH 文件路径 decrypt Base64 解码还原 --file PATH 文件路径 gitignore 生成 .gitignore 片段 compare 对比 .env 与 .env.example 示例: env.sh init --project node env.sh init --project python env.sh init --project react env.sh validate --file .env env.sh encrypt --file .env > .env.encoded env.sh decrypt --file .env.encoded EOF ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # env-config - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/env-config}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF env-config v$VERSION Multi-purpose utility tool Usage: env-config <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "env-config v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Env Config Manager — tips.md ## .env 最佳实践 1. 每个项目都有 `.env.example`(不含真实值) 2. `.env` 加入 `.gitignore` 3. 变量名全大写下划线分隔: `DATABASE_URL` 4. 布尔值用 `true/false` 不用 `1/0` 5. 生产环境不要用 .env 文件,用环境变量注入 ## 常见框架配置 ### Node.js (dotenv) ``` PORT=3000 NODE_ENV=development DATABASE_URL=postgresql://user:pass@localhost:5432/db JWT_SECRET=change_me_in_production ``` ### Python (python-dotenv) ``` FLASK_ENV=development SECRET_KEY=change_me SQLALCHEMY_DATABASE_URI=sqlite:///app.db REDIS_URL=redis://localhost:6379/0 ``` ### Docker Compose ``` COMPOSE_PROJECT_NAME=myapp POSTGRES_USER=admin POSTGRES_PASSWORD=change_me POSTGRES_DB=myapp ```
数据库设计助手。表设计、范式化、索引策略、迁移脚本、测试数据、ER图描述。Database designer with normalization, indexing, migration, seeding, ER diagrams. 数据库、MySQL。
---
version: "2.0.0"
name: Database Designer
description: "Database Design Helper - 数据库设计助手. Use when you need database design capabilities. Triggers on: database design."
数据库设计助手。表设计、范式化、索引策略、迁移脚本、测试数据、ER图描述。Database designer with normalization, indexing, migration, seeding, ER diagrams. 数据库、MySQL。
author: BytesAgain
homepage: https://bytesagain.com
source: https://github.com/bytesagain/ai-skills
---
# Database Designer
数据库设计助手。表设计、范式化、索引策略、迁移脚本、测试数据、ER图描述。Database designer with normalization, indexing, migration, seeding, ER diagrams. 数据库、MySQL。
## 推荐工作流
```
需求分析 → 选择命令 → 输入描述 → 获取结果 → 调整优化
```
## 可用命令
- **design** — design
- **normalize** — normalize
- **index** — index
- **migrate** — migrate
- **seed** — seed
- **diagram** — diagram
---
*Database Designer by BytesAgain*
---
💬 Feedback & Feature Requests: https://bytesagain.com/feedback
Powered by BytesAgain | bytesagain.com
- Run `database-design help` for commands
- No API keys needed
- Run `database-design help` for all commands
## Commands
Run `database-design help` to see all available commands.
## When to Use
- Quick database tasks from terminal
- Automation pipelines
FILE:scripts/db.sh
#!/usr/bin/env bash
# Database Design Helper - Generates SQL schemas, ER diagrams, and indexes
# Usage: db.sh <command> [options]
set -euo pipefail
DATE=$(date +"%Y-%m-%d")
show_help() {
cat <<'EOF'
Database Design Helper - 数据库设计助手
Commands:
schema --table <name> --fields "field1:type,field2:type,..."
Generate CREATE TABLE statement
er-diagram --tables "table1,table2,table3"
Generate a text-based ER diagram
index --table <name> --fields "field1,field2" [--unique] [--name <index_name>]
Generate CREATE INDEX statement
seed --table <name> --fields "field1:type,field2:type" [--rows 10]
Generate INSERT statements with sample data
migration --table <name> --action <add|drop|modify> --field "name:type"
Generate ALTER TABLE migration
help
Show this help message
Field Types:
int, bigint, varchar, text, boolean, date, datetime, timestamp,
decimal, float, json, uuid, enum(val1|val2|val3)
Options:
--table Table name
--fields Comma-separated field definitions (name:type)
--tables Comma-separated table names (for ER diagram)
--unique Create unique index
--name Custom index name
--rows Number of sample rows to generate (default: 5)
--engine Database engine: mysql, postgres, sqlite (default: mysql)
EOF
}
TABLE=""
FIELDS=""
TABLES=""
UNIQUE=""
INDEX_NAME=""
ROWS=5
ENGINE="mysql"
ACTION=""
FIELD=""
parse_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
--table) TABLE="$2"; shift 2 ;;
--fields) FIELDS="$2"; shift 2 ;;
--tables) TABLES="$2"; shift 2 ;;
--unique) UNIQUE="UNIQUE "; shift ;;
--name) INDEX_NAME="$2"; shift 2 ;;
--rows) ROWS="$2"; shift 2 ;;
--engine) ENGINE="$2"; shift 2 ;;
--action) ACTION="$2"; shift 2 ;;
--field) FIELD="$2"; shift 2 ;;
*) shift ;;
esac
done
}
map_type() {
local field_type="$1"
local engine="-mysql"
case "$engine" in
postgres)
case "$field_type" in
int) echo "INTEGER" ;;
bigint) echo "BIGINT" ;;
varchar) echo "VARCHAR(255)" ;;
text) echo "TEXT" ;;
boolean) echo "BOOLEAN" ;;
date) echo "DATE" ;;
datetime) echo "TIMESTAMP" ;;
timestamp) echo "TIMESTAMP WITH TIME ZONE" ;;
decimal) echo "DECIMAL(10,2)" ;;
float) echo "DOUBLE PRECISION" ;;
json) echo "JSONB" ;;
uuid) echo "UUID" ;;
enum*) echo "VARCHAR(50)" ;;
*) echo "VARCHAR(255)" ;;
esac
;;
sqlite)
case "$field_type" in
int|bigint) echo "INTEGER" ;;
varchar|text|uuid) echo "TEXT" ;;
boolean) echo "INTEGER" ;;
date|datetime|timestamp) echo "TEXT" ;;
decimal|float) echo "REAL" ;;
json) echo "TEXT" ;;
enum*) echo "TEXT" ;;
*) echo "TEXT" ;;
esac
;;
*) # mysql
case "$field_type" in
int) echo "INT" ;;
bigint) echo "BIGINT" ;;
varchar) echo "VARCHAR(255)" ;;
text) echo "TEXT" ;;
boolean) echo "TINYINT(1)" ;;
date) echo "DATE" ;;
datetime) echo "DATETIME" ;;
timestamp) echo "TIMESTAMP" ;;
decimal) echo "DECIMAL(10,2)" ;;
float) echo "FLOAT" ;;
json) echo "JSON" ;;
uuid) echo "CHAR(36)" ;;
enum*)
local vals
vals=$(echo "$field_type" | sed "s/enum(//;s/)//;s/|/','/g")
echo "ENUM('vals')"
;;
*) echo "VARCHAR(255)" ;;
esac
;;
esac
}
generate_schema() {
parse_args "$@"
if [[ -z "$TABLE" || -z "$FIELDS" ]]; then
echo "Error: --table and --fields are required"
echo "Usage: db.sh schema --table users --fields \"id:int,name:varchar,email:varchar\""
exit 1
fi
local auto_increment="AUTO_INCREMENT"
local engine_suffix=" ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
local timestamp_default="CURRENT_TIMESTAMP"
local id_type
id_type=$(map_type "int" "$ENGINE")
case "$ENGINE" in
postgres)
auto_increment=""
engine_suffix=""
;;
sqlite)
auto_increment="AUTOINCREMENT"
engine_suffix=""
;;
esac
echo "-- ============================================================"
echo "-- Table: TABLE"
echo "-- Generated: DATE"
echo "-- Engine: ENGINE"
echo "-- ============================================================"
echo ""
if [[ "$ENGINE" == "postgres" ]]; then
echo "CREATE TABLE IF NOT EXISTS \"TABLE\" ("
else
echo "CREATE TABLE IF NOT EXISTS \`TABLE\` ("
fi
# Parse fields
IFS=',' read -ra field_array <<< "$FIELDS"
local total=#field_array[@]
local count=0
local has_id=false
for field_def in "field_array[@]"; do
local fname ftype
fname=$(echo "$field_def" | cut -d: -f1 | xargs)
ftype=$(echo "$field_def" | cut -d: -f2 | xargs)
local sql_type
sql_type=$(map_type "$ftype" "$ENGINE")
count=$((count + 1))
local nullable="NOT NULL"
local extra=""
if [[ "$fname" == "id" ]]; then
has_id=true
if [[ "$ENGINE" == "postgres" ]]; then
sql_type="SERIAL"
extra=" PRIMARY KEY"
nullable=""
else
extra=" auto_increment PRIMARY KEY"
fi
fi
local comma=","
# Don't add comma yet - we'll add timestamps and closing
if [[ "$ENGINE" == "postgres" ]]; then
echo " \"fname\" sql_type nullableextracomma"
else
echo " \`fname\` sql_type nullableextracomma"
fi
done
# Add timestamps
if [[ "$ENGINE" == "postgres" ]]; then
echo " \"created_at\" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,"
echo " \"updated_at\" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP"
elif [[ "$ENGINE" == "sqlite" ]]; then
echo " \`created_at\` TEXT NOT NULL DEFAULT (datetime('now')),"
echo " \`updated_at\` TEXT NOT NULL DEFAULT (datetime('now'))"
else
echo " \`created_at\` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,"
echo " \`updated_at\` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
fi
echo ")engine_suffix;"
echo ""
# Add helpful comments
echo "-- Suggested indexes:"
for field_def in "field_array[@]"; do
local fname
fname=$(echo "$field_def" | cut -d: -f1 | xargs)
if [[ "$fname" == "email" || "$fname" == "username" || "$fname" == "phone" ]]; then
if [[ "$ENGINE" == "postgres" ]]; then
echo "-- CREATE UNIQUE INDEX idx_TABLE_fname ON \"TABLE\" (\"fname\");"
else
echo "-- CREATE UNIQUE INDEX idx_TABLE_fname ON \`TABLE\` (\`fname\`);"
fi
elif [[ "$fname" == *"_id" || "$fname" == "status" || "$fname" == "type" ]]; then
if [[ "$ENGINE" == "postgres" ]]; then
echo "-- CREATE INDEX idx_TABLE_fname ON \"TABLE\" (\"fname\");"
else
echo "-- CREATE INDEX idx_TABLE_fname ON \`TABLE\` (\`fname\`);"
fi
fi
done
}
generate_er_diagram() {
parse_args "$@"
if [[ -z "$TABLES" ]]; then
echo "Error: --tables is required"
echo "Usage: db.sh er-diagram --tables \"users,orders,products\""
exit 1
fi
IFS=',' read -ra table_array <<< "$TABLES"
echo "==============================================================="
echo " Entity-Relationship Diagram (Text)"
echo " Generated: DATE"
echo "==============================================================="
echo ""
# Generate table boxes with common fields
for tbl in "table_array[@]"; do
tbl=$(echo "$tbl" | xargs)
local width=45
local border
border=$(printf '%*s' $width '' | tr ' ' '─')
echo "┌border┐"
printf "│ %-$((width - 2))s │\n" "tbl^^"
echo "├border┤"
# Generate sensible default fields based on table name
printf "│ %-$((width - 2))s │\n" "PK id INT (AUTO_INCREMENT)"
case "$tbl" in
user*|member*|account*)
printf "│ %-$((width - 2))s │\n" " username VARCHAR(50)"
printf "│ %-$((width - 2))s │\n" " email VARCHAR(255)"
printf "│ %-$((width - 2))s │\n" " password_hash VARCHAR(255)"
printf "│ %-$((width - 2))s │\n" " phone VARCHAR(20)"
printf "│ %-$((width - 2))s │\n" " avatar_url VARCHAR(500)"
printf "│ %-$((width - 2))s │\n" " status ENUM(active,disabled)"
;;
order*)
printf "│ %-$((width - 2))s │\n" "FK user_id INT → users.id"
printf "│ %-$((width - 2))s │\n" " order_no VARCHAR(32)"
printf "│ %-$((width - 2))s │\n" " total_amount DECIMAL(10,2)"
printf "│ %-$((width - 2))s │\n" " status ENUM(pending,paid,shipped)"
printf "│ %-$((width - 2))s │\n" " payment_method VARCHAR(20)"
printf "│ %-$((width - 2))s │\n" " shipping_addr TEXT"
;;
product*|item*)
printf "│ %-$((width - 2))s │\n" "FK category_id INT → categories.id"
printf "│ %-$((width - 2))s │\n" " name VARCHAR(200)"
printf "│ %-$((width - 2))s │\n" " description TEXT"
printf "│ %-$((width - 2))s │\n" " price DECIMAL(10,2)"
printf "│ %-$((width - 2))s │\n" " stock INT"
printf "│ %-$((width - 2))s │\n" " sku VARCHAR(50)"
printf "│ %-$((width - 2))s │\n" " status ENUM(active,inactive)"
;;
categor*)
printf "│ %-$((width - 2))s │\n" "FK parent_id INT → categories.id"
printf "│ %-$((width - 2))s │\n" " name VARCHAR(100)"
printf "│ %-$((width - 2))s │\n" " slug VARCHAR(100)"
printf "│ %-$((width - 2))s │\n" " sort_order INT"
;;
comment*|review*)
printf "│ %-$((width - 2))s │\n" "FK user_id INT → users.id"
printf "│ %-$((width - 2))s │\n" "FK product_id INT → products.id"
printf "│ %-$((width - 2))s │\n" " content TEXT"
printf "│ %-$((width - 2))s │\n" " rating TINYINT"
;;
payment*)
printf "│ %-$((width - 2))s │\n" "FK order_id INT → orders.id"
printf "│ %-$((width - 2))s │\n" " amount DECIMAL(10,2)"
printf "│ %-$((width - 2))s │\n" " method VARCHAR(20)"
printf "│ %-$((width - 2))s │\n" " transaction_id VARCHAR(100)"
printf "│ %-$((width - 2))s │\n" " status ENUM(pending,completed)"
;;
*)
printf "│ %-$((width - 2))s │\n" " name VARCHAR(255)"
printf "│ %-$((width - 2))s │\n" " description TEXT"
printf "│ %-$((width - 2))s │\n" " status VARCHAR(20)"
;;
esac
printf "│ %-$((width - 2))s │\n" " created_at TIMESTAMP"
printf "│ %-$((width - 2))s │\n" " updated_at TIMESTAMP"
echo "└border┘"
echo ""
done
# Generate relationships
echo "───────────────────────────────────────────────"
echo " Relationships / 关系"
echo "───────────────────────────────────────────────"
echo ""
# Auto-detect relationships
local rel_count=0
for tbl in "table_array[@]"; do
tbl=$(echo "$tbl" | xargs)
case "$tbl" in
order*)
echo " users ──┤1:N├── orders"
echo " (一个用户可以有多个订单)"
rel_count=$((rel_count + 1))
;;
product*)
for other in "table_array[@]"; do
other=$(echo "$other" | xargs)
if [[ "$other" == order* ]]; then
echo " orders ──┤N:M├── products (via order_items)"
echo " (订单和产品是多对多关系)"
rel_count=$((rel_count + 1))
fi
done
;;
comment*|review*)
echo " users ──┤1:N├── tbl"
echo " (一个用户可以有多条评论)"
rel_count=$((rel_count + 1))
;;
payment*)
echo " orders ──┤1:1├── payments"
echo " (一个订单对应一条支付记录)"
rel_count=$((rel_count + 1))
;;
esac
done
if [[ $rel_count -eq 0 ]]; then
echo " (No automatic relationships detected."
echo " Add FK fields like user_id, order_id to define relationships.)"
fi
echo ""
echo "───────────────────────────────────────────────"
echo " Legend / 图例"
echo "───────────────────────────────────────────────"
echo " PK = Primary Key FK = Foreign Key"
echo " 1:1 = One to One 1:N = One to Many"
echo " N:M = Many to Many"
echo " ──┤├── = Relationship connector"
}
generate_index() {
parse_args "$@"
if [[ -z "$TABLE" || -z "$FIELDS" ]]; then
echo "Error: --table and --fields are required"
echo "Usage: db.sh index --table users --fields \"email\" [--unique]"
exit 1
fi
local field_list
field_list=$(echo "$FIELDS" | xargs)
# Generate index name if not provided
if [[ -z "$INDEX_NAME" ]]; then
local sanitized
sanitized=$(echo "$field_list" | tr ',' '_' | tr -d ' ')
INDEX_NAME="idx_TABLE_sanitized"
fi
echo "-- ============================================================"
echo "-- Index: INDEX_NAME"
echo "-- Table: TABLE"
echo "-- Fields: field_list"
echo "-- Generated: DATE"
echo "-- ============================================================"
echo ""
# Format fields for SQL
local formatted_fields=""
IFS=',' read -ra idx_fields <<< "$field_list"
for i in "!idx_fields[@]"; do
local f
f=$(echo "idx_fields[$i]" | xargs)
if [[ $i -gt 0 ]]; then
formatted_fields+=", "
fi
if [[ "$ENGINE" == "postgres" ]]; then
formatted_fields+="\"f\""
else
formatted_fields+="\`f\`"
fi
done
if [[ "$ENGINE" == "postgres" ]]; then
echo "CREATE UNIQUEINDEX INDEX_NAME"
echo " ON \"TABLE\" (formatted_fields);"
else
echo "CREATE UNIQUEINDEX INDEX_NAME"
echo " ON \`TABLE\` (formatted_fields);"
fi
echo ""
echo "-- To drop this index:"
if [[ "$ENGINE" == "postgres" ]]; then
echo "-- DROP INDEX IF EXISTS INDEX_NAME;"
else
echo "-- DROP INDEX INDEX_NAME ON \`TABLE\`;"
fi
echo ""
echo "-- To check index usage (MySQL):"
echo "-- EXPLAIN SELECT * FROM \`TABLE\` WHERE idx_fields[0] = 'value';"
echo "-- SHOW INDEX FROM \`TABLE\`;"
}
generate_seed() {
parse_args "$@"
if [[ -z "$TABLE" || -z "$FIELDS" ]]; then
echo "Error: --table and --fields are required"
echo "Usage: db.sh seed --table users --fields \"id:int,name:varchar,email:varchar\" --rows 10"
exit 1
fi
echo "-- ============================================================"
echo "-- Seed data for: TABLE"
echo "-- Generated: DATE"
echo "-- ============================================================"
echo ""
IFS=',' read -ra field_array <<< "$FIELDS"
local field_names=()
local field_types=()
for field_def in "field_array[@]"; do
local fname ftype
fname=$(echo "$field_def" | cut -d: -f1 | xargs)
ftype=$(echo "$field_def" | cut -d: -f2 | xargs)
field_names+=("$fname")
field_types+=("$ftype")
done
# Build field name list
local names_str=""
for i in "!field_names[@]"; do
if [[ $i -gt 0 ]]; then names_str+=", "; fi
names_str+="\`field_names[$i]\`"
done
echo "INSERT INTO \`TABLE\` (names_str) VALUES"
local names=("Alice" "Bob" "Charlie" "Diana" "Eve" "Frank" "Grace" "Henry" "Ivy" "Jack")
local domains=("example.com" "test.com" "demo.org" "sample.net" "mock.io")
for row in $(seq 1 "$ROWS"); do
local values=""
for i in "!field_types[@]"; do
if [[ $i -gt 0 ]]; then values+=", "; fi
local fname="field_names[$i]"
local ftype="field_types[$i]"
case "$ftype" in
int|bigint)
if [[ "$fname" == "id" ]]; then
values+="row"
elif [[ "$fname" == *"_id" ]]; then
values+="$((RANDOM % 5 + 1))"
else
values+="$((RANDOM % 1000))"
fi
;;
varchar|text)
if [[ "$fname" == "name" || "$fname" == "username" ]]; then
values+="'names[$((row - 1)) % ${#names[@]]}'"
elif [[ "$fname" == "email" ]]; then
local n="names[$((row - 1)) % ${#names[@]]}"
local d="domains[$((row - 1)) % ${#domains[@]]}"
values+="'$(echo "$n" | tr '[:upper:]' '[:lower:]')@d'"
elif [[ "$fname" == "phone" ]]; then
values+="'+1-555-$(printf '%04d' $((RANDOM % 10000)))'"
elif [[ "$fname" == "status" ]]; then
local statuses=("active" "inactive" "pending")
values+="'statuses[$((RANDOM % 3))]'"
else
values+="'Sample fname row'"
fi
;;
boolean)
values+="$((RANDOM % 2))"
;;
date)
values+="'2024-$(printf '%02d' $((RANDOM % 12 + 1)))-$(printf '%02d' $((RANDOM % 28 + 1)))'"
;;
datetime|timestamp)
values+="NOW()"
;;
decimal|float)
values+="$((RANDOM % 1000)).$((RANDOM % 100))"
;;
*)
values+="'value_row'"
;;
esac
done
if [[ $row -eq $ROWS ]]; then
echo " (values);"
else
echo " (values),"
fi
done
}
generate_migration() {
parse_args "$@"
if [[ -z "$TABLE" || -z "$ACTION" || -z "$FIELD" ]]; then
echo "Error: --table, --action, and --field are required"
echo "Usage: db.sh migration --table users --action add --field \"avatar:varchar\""
exit 1
fi
local fname ftype
fname=$(echo "$FIELD" | cut -d: -f1 | xargs)
ftype=$(echo "$FIELD" | cut -d: -f2 -s | xargs)
local sql_type
sql_type=$(map_type "-varchar" "$ENGINE")
echo "-- ============================================================"
echo "-- Migration: ACTION fname on TABLE"
echo "-- Generated: DATE"
echo "-- ============================================================"
echo ""
echo "-- Up migration"
case "$ACTION" in
add)
echo "ALTER TABLE \`TABLE\` ADD COLUMN \`fname\` sql_type;"
;;
drop)
echo "ALTER TABLE \`TABLE\` DROP COLUMN \`fname\`;"
;;
modify)
echo "ALTER TABLE \`TABLE\` MODIFY COLUMN \`fname\` sql_type;"
;;
*)
echo "-- Error: Unknown action 'ACTION'. Use: add, drop, modify"
exit 1
;;
esac
echo ""
echo "-- Down migration (rollback)"
case "$ACTION" in
add)
echo "ALTER TABLE \`TABLE\` DROP COLUMN \`fname\`;"
;;
drop)
echo "-- WARNING: Cannot auto-generate rollback for DROP (data lost)"
echo "-- ALTER TABLE \`TABLE\` ADD COLUMN \`fname\` sql_type;"
;;
modify)
echo "-- WARNING: Cannot auto-generate rollback for MODIFY"
echo "-- ALTER TABLE \`TABLE\` MODIFY COLUMN \`fname\` <original_type>;"
;;
esac
}
# Main command router
CMD="-help"
shift 2>/dev/null || true
case "$CMD" in
schema)
generate_schema "$@"
;;
er-diagram|er|erd)
generate_er_diagram "$@"
;;
index|idx)
generate_index "$@"
;;
seed)
generate_seed "$@"
;;
migration|migrate)
generate_migration "$@"
;;
help|--help|-h)
show_help
;;
*)
echo "Error: Unknown command '$CMD'"
echo "Run 'db.sh help' for usage information."
exit 1
;;
esac
FILE:scripts/script.sh
#!/usr/bin/env bash
# database-design - Data processing and analysis toolkit
set -euo pipefail
VERSION="2.0.0"
DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/database-design}"
DB="$DATA_DIR/data.log"
mkdir -p "$DATA_DIR"
show_help() {
cat << EOF
database-design v$VERSION
Data processing and analysis toolkit
Usage: database-design <command> [args]
Commands:
query Query data
import Import data file
export Export results
transform Transform data
validate Validate data
stats Basic statistics
schema Show schema
sample Show sample data
clean Clean/deduplicate
dashboard Quick dashboard
help Show this help
version Show version
Data: \$DATA_DIR
EOF
}
_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }
cmd_query() {
echo " Query: $*"
_log "query" "-"
}
cmd_import() {
echo " Importing: $1"
_log "import" "-"
}
cmd_export() {
echo " Exporting to: -stdout"
_log "export" "-"
}
cmd_transform() {
echo " Transforming: $1 -> $2"
_log "transform" "-"
}
cmd_validate() {
echo " Validating schema..."
_log "validate" "-"
}
cmd_stats() {
echo " Records: $(wc -l < "$DB" 2>/dev/null || echo 0)"
_log "stats" "-"
}
cmd_schema() {
echo " Fields: id, name, value, timestamp"
_log "schema" "-"
}
cmd_sample() {
[ -f "$DB" ] && head -5 "$DB" || echo "No data"
_log "sample" "-"
}
cmd_clean() {
echo " Cleaning data..."
_log "clean" "-"
}
cmd_dashboard() {
echo " Total: $(wc -l < "$DB" 2>/dev/null || echo 0) records"
_log "dashboard" "-"
}
case "-help" in
query) shift; cmd_query "$@" ;;
import) shift; cmd_import "$@" ;;
export) shift; cmd_export "$@" ;;
transform) shift; cmd_transform "$@" ;;
validate) shift; cmd_validate "$@" ;;
stats) shift; cmd_stats "$@" ;;
schema) shift; cmd_schema "$@" ;;
sample) shift; cmd_sample "$@" ;;
clean) shift; cmd_clean "$@" ;;
dashboard) shift; cmd_dashboard "$@" ;;
help|-h) show_help ;;
version|-v) echo "database-design v$VERSION" ;;
*) echo "Unknown: $1"; show_help; exit 1 ;;
esac
FILE:tips.md
# Database Designer - tips.md
## Quick Reference
Webpack/Vite配置生成。项目配置、插件、Loader、优化、代码分割、迁移。Webpack/Vite config generator with plugins, loaders, optimization, code splitting. Webpack、Vite、构建工具。
--- version: "2.0.0" name: Webpack Config description: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. Use when you need webpack config capabilities. Triggers on: webpack config." Webpack/Vite配置生成。项目配置、插件、Loader、优化、代码分割、迁移。Webpack/Vite config generator with plugins, loaders, optimization, code splitting. Webpack、Vite、构建工具。 author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Webpack Config Webpack/Vite配置生成。项目配置、插件、Loader、优化、代码分割、迁移。Webpack/Vite config generator with plugins, loaders, optimization, code splitting. Webpack、Vite、构建工具。 ## 推荐工作流 ``` 需求分析 → 选择命令 → 输入描述 → 获取结果 → 调整优化 ``` ## 命令速查 ``` create create plugin plugin loader loader optimize optimize split split migrate migrate ``` --- *Webpack Config by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com - Run `webpack-config help` for all commands ## Commands Run `webpack-config help` to see all available commands. ## When to Use - Quick webpack tasks from terminal - Automation pipelines FILE:scripts/script.sh #!/usr/bin/env bash # webpack-config - Developer workflow automation tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/webpack-config}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF webpack-config v$VERSION Developer workflow automation tool Usage: webpack-config <command> [args] Commands: init Initialize project check Run checks build Build project test Run tests deploy Deploy guide config Configuration status Project status template Code template docs Documentation clean Clean artifacts help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_init() { echo " Project initialized in $(pwd)" _log "init" "-" } cmd_check() { echo " Running lint + type check + tests..." _log "check" "-" } cmd_build() { echo " Building..." _log "build" "-" } cmd_test() { echo " Running test suite..." _log "test" "-" } cmd_deploy() { echo " Deploy: build -> test -> stage -> prod" _log "deploy" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: checking project health..." _log "status" "-" } cmd_template() { echo " Template for: $1" _log "template" "-" } cmd_docs() { echo " Generating docs..." _log "docs" "-" } cmd_clean() { echo " Cleaned build artifacts" _log "clean" "-" } case "-help" in init) shift; cmd_init "$@" ;; check) shift; cmd_check "$@" ;; build) shift; cmd_build "$@" ;; test) shift; cmd_test "$@" ;; deploy) shift; cmd_deploy "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; template) shift; cmd_template "$@" ;; docs) shift; cmd_docs "$@" ;; clean) shift; cmd_clean "$@" ;; help|-h) show_help ;; version|-v) echo "webpack-config v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/webpack.sh #!/usr/bin/env bash # Webpack Config Generator — generates real webpack.config.js # Usage: webpack.sh <command> [options] set -euo pipefail CMD="-help"; shift 2>/dev/null || true # Parse flags TYPE="vanilla" ENTRY="./src/index.js" OUTPUT="dist" PORT="8080" LOADER_TYPE="" SOURCEMAP="true" HASH="true" MODE="production" while [[ $# -gt 0 ]]; do case "$1" in --type) TYPE="$2"; shift 2 ;; --entry) ENTRY="$2"; shift 2 ;; --output) OUTPUT="$2"; shift 2 ;; --port) PORT="$2"; shift 2 ;; --loader) LOADER_TYPE="$2"; shift 2 ;; --no-hash) HASH="no"; shift ;; --no-sourcemap) SOURCEMAP="false"; shift ;; --mode) MODE="$2"; shift 2 ;; *) shift ;; esac done hash_suffix() { if [[ "$HASH" == "yes" ]]; then echo ".[contenthash:8]" fi } gen_vanilla() { local h h=$(hash_suffix) cat <<JS // ============================================ // Webpack 配置 — Vanilla JS // 生成时间: $(date '+%Y-%m-%d %H:%M:%S') // ============================================ // 安装依赖: // npm init -y // npm install -D webpack webpack-cli webpack-dev-server // npm install -D html-webpack-plugin mini-css-extract-plugin // npm install -D css-loader style-loader babel-loader @babel/core @babel/preset-env // npm install -D copy-webpack-plugin terser-webpack-plugin css-minimizer-webpack-plugin const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const isDev = process.env.NODE_ENV !== 'production'; module.exports = { mode: isDev ? 'development' : 'production', entry: 'ENTRY', output: { path: path.resolve(__dirname, 'OUTPUT'), filename: isDev ? 'js/[name].js' : 'js/[name]h.js', clean: true, // 构建前清空 output 目录 publicPath: '/', }, devtool: isDev ? 'eval-cheap-module-source-map' : SOURCEMAP ? 'source-map' : false, devServer: { port: PORT, hot: true, open: true, historyApiFallback: true, // SPA 路由支持 compress: true, client: { overlay: { errors: true, warnings: false }, }, }, module: { rules: [ // JavaScript — Babel { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'], cacheDirectory: true, }, }, }, // CSS { test: /\.css$/, use: [ isDev ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader', ], }, // 图片 { test: /\.(png|jpe?g|gif|svg|webp|avif)$/i, type: 'asset', parser: { dataUrlCondition: { maxSize: 8 * 1024 } }, generator: { filename: 'images/[name]h[ext]' }, }, // 字体 { test: /\.(woff2?|eot|ttf|otf)$/i, type: 'asset/resource', generator: { filename: 'fonts/[name]h[ext]' }, }, ], }, plugins: [ new HtmlWebpackPlugin({ template: './public/index.html', title: 'My App', minify: !isDev ? { removeComments: true, collapseWhitespace: true, removeAttributeQuotes: true, } : false, }), !isDev && new MiniCssExtractPlugin({ filename: 'css/[name]h.css', }), ].filter(Boolean), optimization: { minimizer: [ new TerserPlugin({ terserOptions: { compress: { drop_console: true } } }), new CssMinimizerPlugin(), ], splitChunks: { chunks: 'all', cacheGroups: { vendor: { test: /[\\\\/]node_modules[\\\\/]/, name: 'vendor', chunks: 'all', }, }, }, }, resolve: { extensions: ['.js', '.json'], alias: { '@': path.resolve(__dirname, 'src'), }, }, stats: isDev ? 'minimal' : 'normal', }; JS } gen_react() { local h h=$(hash_suffix) cat <<JS // ============================================ // Webpack 配置 — React // 生成时间: $(date '+%Y-%m-%d %H:%M:%S') // ============================================ // 安装依赖: // npm install react react-dom // npm install -D webpack webpack-cli webpack-dev-server // npm install -D html-webpack-plugin mini-css-extract-plugin // npm install -D babel-loader @babel/core @babel/preset-env @babel/preset-react // npm install -D css-loader style-loader sass-loader sass // npm install -D terser-webpack-plugin css-minimizer-webpack-plugin // npm install -D @pmmmwh/react-refresh-webpack-plugin react-refresh const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin'); const isDev = process.env.NODE_ENV !== 'production'; module.exports = { mode: isDev ? 'development' : 'production', entry: 'ENTRY', output: { path: path.resolve(__dirname, 'OUTPUT'), filename: isDev ? 'js/[name].js' : 'js/[name]h.js', chunkFilename: isDev ? 'js/[name].chunk.js' : 'js/[name]h.chunk.js', clean: true, publicPath: '/', }, devtool: isDev ? 'eval-cheap-module-source-map' : SOURCEMAP ? 'source-map' : false, devServer: { port: PORT, hot: true, open: true, historyApiFallback: true, compress: true, client: { overlay: { errors: true, warnings: false }, }, }, module: { rules: [ // JSX / JS — Babel + React { test: /\.(js|jsx)$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: [ '@babel/preset-env', ['@babel/preset-react', { runtime: 'automatic' }], ], plugins: isDev ? [require.resolve('react-refresh/babel')] : [], cacheDirectory: true, }, }, }, // CSS { test: /\.css$/, use: [ isDev ? 'style-loader' : MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { modules: { auto: true } } }, ], }, // SCSS/SASS { test: /\.s[ac]ss$/, use: [ isDev ? 'style-loader' : MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { modules: { auto: true } } }, 'sass-loader', ], }, // 图片 { test: /\.(png|jpe?g|gif|svg|webp)$/i, type: 'asset', parser: { dataUrlCondition: { maxSize: 10 * 1024 } }, generator: { filename: 'images/[name]h[ext]' }, }, // 字体 { test: /\.(woff2?|eot|ttf|otf)$/i, type: 'asset/resource', generator: { filename: 'fonts/[name]h[ext]' }, }, ], }, plugins: [ new HtmlWebpackPlugin({ template: './public/index.html', favicon: './public/favicon.ico', }), isDev && new ReactRefreshPlugin(), !isDev && new MiniCssExtractPlugin({ filename: 'css/[name]h.css', chunkFilename: 'css/[name]h.chunk.css', }), ].filter(Boolean), optimization: { minimize: !isDev, minimizer: [ new TerserPlugin({ terserOptions: { compress: { drop_console: true, drop_debugger: true } }, }), new CssMinimizerPlugin(), ], splitChunks: { chunks: 'all', cacheGroups: { react: { test: /[\\\\/]node_modules[\\\\/](react|react-dom)[\\\\/]/, name: 'react-vendor', priority: 20, }, vendor: { test: /[\\\\/]node_modules[\\\\/]/, name: 'vendor', priority: 10, }, }, }, runtimeChunk: 'single', }, resolve: { extensions: ['.js', '.jsx', '.json'], alias: { '@': path.resolve(__dirname, 'src'), '@components': path.resolve(__dirname, 'src/components'), '@pages': path.resolve(__dirname, 'src/pages'), '@utils': path.resolve(__dirname, 'src/utils'), }, }, stats: isDev ? 'minimal' : 'normal', }; JS } gen_vue() { local h h=$(hash_suffix) cat <<JS // ============================================ // Webpack 配置 — Vue 3 // 生成时间: $(date '+%Y-%m-%d %H:%M:%S') // ============================================ // 安装依赖: // npm install vue@3 // npm install -D webpack webpack-cli webpack-dev-server // npm install -D vue-loader@next @vue/compiler-sfc // npm install -D html-webpack-plugin mini-css-extract-plugin // npm install -D babel-loader @babel/core @babel/preset-env // npm install -D css-loader style-loader sass-loader sass // npm install -D terser-webpack-plugin css-minimizer-webpack-plugin const path = require('path'); const { VueLoaderPlugin } = require('vue-loader'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const { DefinePlugin } = require('webpack'); const isDev = process.env.NODE_ENV !== 'production'; module.exports = { mode: isDev ? 'development' : 'production', entry: 'ENTRY', output: { path: path.resolve(__dirname, 'OUTPUT'), filename: isDev ? 'js/[name].js' : 'js/[name]h.js', chunkFilename: isDev ? 'js/[name].chunk.js' : 'js/[name]h.chunk.js', clean: true, publicPath: '/', }, devtool: isDev ? 'eval-cheap-module-source-map' : SOURCEMAP ? 'source-map' : false, devServer: { port: PORT, hot: true, open: true, historyApiFallback: true, compress: true, }, module: { rules: [ // Vue SFC { test: /\.vue$/, loader: 'vue-loader', }, // JavaScript { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'], cacheDirectory: true, }, }, }, // CSS { test: /\.css$/, use: [ isDev ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader', ], }, // SCSS { test: /\.s[ac]ss$/, use: [ isDev ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader', ], }, // 图片 { test: /\.(png|jpe?g|gif|svg|webp)$/i, type: 'asset', parser: { dataUrlCondition: { maxSize: 10 * 1024 } }, generator: { filename: 'images/[name]h[ext]' }, }, // 字体 { test: /\.(woff2?|eot|ttf|otf)$/i, type: 'asset/resource', generator: { filename: 'fonts/[name]h[ext]' }, }, ], }, plugins: [ new VueLoaderPlugin(), new HtmlWebpackPlugin({ template: './public/index.html', }), new DefinePlugin({ __VUE_OPTIONS_API__: JSON.stringify(true), __VUE_PROD_DEVTOOLS__: JSON.stringify(false), __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(false), }), !isDev && new MiniCssExtractPlugin({ filename: 'css/[name]h.css', }), ].filter(Boolean), optimization: { minimize: !isDev, minimizer: [ new TerserPlugin({ terserOptions: { compress: { drop_console: true } } }), new CssMinimizerPlugin(), ], splitChunks: { chunks: 'all', cacheGroups: { vue: { test: /[\\\\/]node_modules[\\\\/](vue|@vue)[\\\\/]/, name: 'vue-vendor', priority: 20, }, vendor: { test: /[\\\\/]node_modules[\\\\/]/, name: 'vendor', priority: 10, }, }, }, }, resolve: { extensions: ['.vue', '.js', '.json'], alias: { '@': path.resolve(__dirname, 'src'), }, }, stats: isDev ? 'minimal' : 'normal', }; JS } gen_typescript() { local h h=$(hash_suffix) cat <<JS // ============================================ // Webpack 配置 — TypeScript // 生成时间: $(date '+%Y-%m-%d %H:%M:%S') // ============================================ // 安装依赖: // npm install -D webpack webpack-cli webpack-dev-server // npm install -D ts-loader typescript // npm install -D html-webpack-plugin mini-css-extract-plugin // npm install -D css-loader style-loader // npm install -D terser-webpack-plugin css-minimizer-webpack-plugin // npx tsc --init # 生成 tsconfig.json const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const isDev = process.env.NODE_ENV !== 'production'; module.exports = { mode: isDev ? 'development' : 'production', entry: './src/index.ts', output: { path: path.resolve(__dirname, 'OUTPUT'), filename: isDev ? 'js/[name].js' : 'js/[name]h.js', clean: true, publicPath: '/', }, devtool: isDev ? 'eval-cheap-module-source-map' : SOURCEMAP ? 'source-map' : false, devServer: { port: PORT, hot: true, open: true, historyApiFallback: true, }, module: { rules: [ // TypeScript { test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/, }, // CSS { test: /\.css$/, use: [ isDev ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader', ], }, // 图片 { test: /\.(png|jpe?g|gif|svg|webp)$/i, type: 'asset', parser: { dataUrlCondition: { maxSize: 8 * 1024 } }, }, ], }, plugins: [ new HtmlWebpackPlugin({ template: './public/index.html' }), !isDev && new MiniCssExtractPlugin({ filename: 'css/[name]h.css' }), ].filter(Boolean), optimization: { minimizer: [new TerserPlugin(), new CssMinimizerPlugin()], splitChunks: { chunks: 'all' }, }, resolve: { extensions: ['.ts', '.tsx', '.js', '.json'], alias: { '@': path.resolve(__dirname, 'src') }, }, }; JS } gen_add_loader() { case "-" in css) cat <<'JS' // ---- CSS Loader 配置 ---- // npm install -D css-loader style-loader mini-css-extract-plugin // 在 module.rules 中添加: { test: /\.css$/, use: [ process.env.NODE_ENV !== 'production' ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader', ], }, // CSS Modules: { test: /\.module\.css$/, use: [ 'style-loader', { loader: 'css-loader', options: { modules: true } }, ], }, JS ;; sass|scss) cat <<'JS' // ---- SASS/SCSS Loader 配置 ---- // npm install -D sass-loader sass css-loader style-loader // 在 module.rules 中添加: { test: /\.s[ac]ss$/i, use: [ 'style-loader', // 生产环境换 MiniCssExtractPlugin.loader 'css-loader', 'sass-loader', ], }, JS ;; babel) cat <<'JS' // ---- Babel Loader 配置 ---- // npm install -D babel-loader @babel/core @babel/preset-env // 在 module.rules 中添加: { test: /\.m?js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'], // React 项目加: '@babel/preset-react' // TypeScript 加: '@babel/preset-typescript' cacheDirectory: true, }, }, }, JS ;; typescript|ts) cat <<'JS' // ---- TypeScript Loader 配置 ---- // npm install -D ts-loader typescript // npx tsc --init (生成 tsconfig.json) // 在 module.rules 中添加: { test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/, }, // 在 resolve.extensions 中添加: // extensions: ['.ts', '.tsx', '.js', '.json'], JS ;; image|images) cat <<'JS' // ---- 图片资源配置 (Webpack 5 内置) ---- // 无需安装额外 loader // 在 module.rules 中添加: { test: /\.(png|jpe?g|gif|svg|webp|avif)$/i, type: 'asset', parser: { dataUrlCondition: { maxSize: 8 * 1024, // 8KB 以下转 base64 }, }, generator: { filename: 'images/[name].[contenthash:8][ext]', }, }, JS ;; font|fonts) cat <<'JS' // ---- 字体资源配置 ---- { test: /\.(woff2?|eot|ttf|otf)$/i, type: 'asset/resource', generator: { filename: 'fonts/[name].[contenthash:8][ext]', }, }, JS ;; *) cat <<'EOF' 可用 loader 类型: css CSS / CSS Modules sass SASS/SCSS babel Babel (ES6+) typescript TypeScript image 图片资源 font 字体资源 用法: webpack.sh add-loader --type <type> EOF ;; esac } case "$CMD" in init|generate|gen) case "$TYPE" in vanilla|js) gen_vanilla ;; react) gen_react ;; vue) gen_vue ;; typescript|ts) gen_typescript ;; *) echo "可用类型: vanilla, react, vue, typescript" echo "用法: webpack.sh init --type <type>" ;; esac ;; add-loader|loader|add) gen_add_loader ;; *) cat <<'EOF' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📦 Webpack Config Generator — 使用指南 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 命令 说明 ────────────────────────────────────────── init 生成完整 webpack.config.js --type TYPE 项目类型: vanilla (默认) react vue typescript --entry PATH 入口文件 (默认: ./src/index.js) --output DIR 输出目录 (默认: dist) --port NUM 开发服务器端口 (默认: 8080) --no-hash 文件名不加 hash --no-sourcemap 不生成 sourcemap add-loader 添加 loader 配置片段 --type TYPE loader 类型: css, sass, babel, typescript, image, font 示例: webpack.sh init --type react --port 3000 webpack.sh init --type vue --entry ./src/main.js webpack.sh init --type typescript webpack.sh init --type vanilla --no-hash webpack.sh add-loader --type sass webpack.sh add-loader --type typescript EOF ;; esac FILE:tips.md # Webpack Config - tips.md ## Quick Reference
UI组件HTML/CSS代码生成。表单、表格、卡片、模态框、导航栏,输出完整可运行HTML文件。UI component generator: form, table, card, modal.
--- version: "2.0.0" name: ui-component description: "UI组件HTML/CSS代码生成。表单、表格、卡片、模态框、导航栏,输出完整可运行HTML文件。UI component generator: form, table, card, modal." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # ui-component UI组件HTML/CSS代码生成。表单、表格、卡片、模态框、导航栏,输出完整可运行HTML文件。UI component generator: form, table, card, modal, navbar as standalone HTML files. ## 核心特点 🎯 **精准** — 针对具体场景定制化输出 📋 **全面** — 多个命令覆盖完整工作流 🇨🇳 **本土化** — 完全适配中文用户习惯 ## 可用命令 - **generate** — generate - **form** — form - **table** — table - **card** — card - **modal** — modal - **navbar** — navbar ## 专业建议 - 一致性** — 同一项目使用统一的圆角、间距、配色 - 可访问性** — 表单加label,按钮有焦点样式,对比度达标 - 响应式** — 移动端优先,用相对单位(rem/%) - 简洁** — 少即是多,不加无意义装饰 - | 需求 | 推荐命令 | --- *ui-component by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help ui-component help # Run ui-component run ``` - Run `ui-component help` for all commands ## Commands Run `ui-component help` to see all available commands. FILE:scripts/script.sh #!/usr/bin/env bash # ui-component - Design reference and helper tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/ui-component}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF ui-component v$VERSION Design reference and helper tool Usage: ui-component <command> [args] Commands: palette Color palette font Font pairing layout Layout template icon Icon reference spacing Spacing guide breakpoint Responsive breakpoints contrast Contrast checker shadow Shadow presets mockup Mockup template checklist Design checklist help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_palette() { echo " Primary: #2563EB | Secondary: #7C3AED | Accent: #F59E0B" _log "palette" "-" } cmd_font() { echo " Heading: Inter/Poppins | Body: Open Sans/Lato" _log "font" "-" } cmd_layout() { echo " Grid: 12-col | Spacing: 8px base | Max-width: 1200px" _log "layout" "-" } cmd_icon() { echo " Libraries: Heroicons | Lucide | Phosphor | Tabler" _log "icon" "-" } cmd_spacing() { echo " xs:4 sm:8 md:16 lg:24 xl:32 2xl:48" _log "spacing" "-" } cmd_breakpoint() { echo " sm:640 md:768 lg:1024 xl:1280 2xl:1536" _log "breakpoint" "-" } cmd_contrast() { echo " Check: webaim.org/resources/contrastchecker" _log "contrast" "-" } cmd_shadow() { echo " sm: 0 1px 2px | md: 0 4px 6px | lg: 0 10px 15px" _log "shadow" "-" } cmd_mockup() { echo " Tool: Figma | Sketch | Adobe XD" _log "mockup" "-" } cmd_checklist() { echo " [ ] Consistent spacing | [ ] Color contrast | [ ] Mobile responsive" _log "checklist" "-" } case "-help" in palette) shift; cmd_palette "$@" ;; font) shift; cmd_font "$@" ;; layout) shift; cmd_layout "$@" ;; icon) shift; cmd_icon "$@" ;; spacing) shift; cmd_spacing "$@" ;; breakpoint) shift; cmd_breakpoint "$@" ;; contrast) shift; cmd_contrast "$@" ;; shadow) shift; cmd_shadow "$@" ;; mockup) shift; cmd_mockup "$@" ;; checklist) shift; cmd_checklist "$@" ;; help|-h) show_help ;; version|-v) echo "ui-component v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/ui.sh #!/usr/bin/env bash # ui-component — HTML/CSS组件生成器 set -euo pipefail CMD="-help"; shift 2>/dev/null || true; INPUT="$*" # Parse flags STYLE="vanilla" for arg in $INPUT; do case "$arg" in --tailwind) STYLE="tailwind" ;; --bootstrap) STYLE="bootstrap" ;; --vanilla) STYLE="vanilla" ;; esac done show_help() { cat << 'EOF' 🎨 UI Component Generator Commands: button [--tailwind|--bootstrap] — Button components card [--tailwind|--bootstrap] — Card components navbar [--tailwind|--bootstrap] — Navigation bar modal [--tailwind|--bootstrap] — Modal/dialog form [--tailwind|--bootstrap] — Form components table [--tailwind|--bootstrap] — Data table hero [--tailwind|--bootstrap] — Hero section footer [--tailwind|--bootstrap] — Footer section grid [--tailwind|--bootstrap] — Grid layout alert [--tailwind|--bootstrap] — Alert/notification help — Show this help EOF } cmd_button() { case "$STYLE" in tailwind) cat << 'EOF' <!-- Tailwind CSS Buttons --> <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> Primary </button> <button class="bg-transparent hover:bg-blue-500 text-blue-700 font-semibold hover:text-white py-2 px-4 border border-blue-500 hover:border-transparent rounded"> Outline </button> <button class="bg-gray-300 text-gray-500 font-bold py-2 px-4 rounded cursor-not-allowed" disabled> Disabled </button> <button class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full"> Danger Pill </button> <button class="bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-6 rounded-lg shadow-lg transform hover:scale-105 transition"> Success with Animation </button> <button class="group relative bg-gradient-to-r from-purple-500 to-pink-500 text-white font-bold py-3 px-6 rounded-lg"> <span class="group-hover:opacity-0 transition">Hover Me</span> <span class="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition">✨ Magic!</span> </button> EOF ;; bootstrap) cat << 'EOF' <!-- Bootstrap Buttons --> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-outline-secondary">Outline</button> <button type="button" class="btn btn-danger btn-lg">Large Danger</button> <button type="button" class="btn btn-success btn-sm">Small Success</button> <button type="button" class="btn btn-warning rounded-pill px-4">Warning Pill</button> <button type="button" class="btn btn-dark" disabled>Disabled</button> <div class="btn-group" role="group"> <button type="button" class="btn btn-primary">Left</button> <button type="button" class="btn btn-primary">Middle</button> <button type="button" class="btn btn-primary">Right</button> </div> EOF ;; *) cat << 'EOF' <!-- Vanilla CSS Buttons --> <style> .btn { padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; } .btn-primary { background: #3b82f6; color: white; } .btn-primary:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4); } .btn-outline { background: transparent; color: #3b82f6; border: 2px solid #3b82f6; } .btn-outline:hover { background: #3b82f6; color: white; } .btn-danger { background: #ef4444; color: white; } .btn-danger:hover { background: #dc2626; } .btn-ghost { background: transparent; color: #6b7280; } .btn-ghost:hover { background: #f3f4f6; } .btn:disabled { opacity: 0.5; cursor: not-allowed; } .btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; } .btn-group .btn:first-child { border-radius: 6px 0 0 6px; } .btn-group .btn:last-child { border-radius: 0 6px 6px 0; } </style> <button class="btn btn-primary">Primary</button> <button class="btn btn-outline">Outline</button> <button class="btn btn-danger">Danger</button> <button class="btn btn-ghost">Ghost</button> <button class="btn btn-primary" disabled>Disabled</button> <div class="btn-group"> <button class="btn btn-primary">Left</button> <button class="btn btn-primary">Mid</button> <button class="btn btn-primary">Right</button> </div> EOF ;; esac } cmd_card() { case "$STYLE" in tailwind) cat << 'EOF' <!-- Tailwind Card --> <div class="max-w-sm rounded-xl overflow-hidden shadow-lg bg-white"> <img class="w-full h-48 object-cover" src="https://via.placeholder.com/400x200" alt="Cover"> <div class="px-6 py-4"> <h3 class="font-bold text-xl mb-2 text-gray-800">Card Title</h3> <p class="text-gray-600 text-base">Card description goes here with some details.</p> </div> <div class="px-6 pt-2 pb-4"> <span class="inline-block bg-blue-100 text-blue-800 rounded-full px-3 py-1 text-sm font-semibold mr-2">#tag1</span> <span class="inline-block bg-green-100 text-green-800 rounded-full px-3 py-1 text-sm font-semibold">#tag2</span> </div> </div> EOF ;; *) cat << 'EOF' <!-- Vanilla CSS Card --> <style> .card { max-width: 380px; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.1); background: white; transition: transform 0.2s; } .card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.15); } .card img { width: 100%; height: 200px; object-fit: cover; } .card-body { padding: 20px; } .card-body h3 { margin: 0 0 8px; font-size: 20px; color: #1f2937; } .card-body p { margin: 0 0 16px; color: #6b7280; line-height: 1.5; } .card-tags { padding: 0 20px 20px; } .tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-right: 8px; } .tag-blue { background: #dbeafe; color: #1d4ed8; } .tag-green { background: #dcfce7; color: #166534; } </style> <div class="card"> <img src="https://via.placeholder.com/400x200" alt="Cover"> <div class="card-body"> <h3>Card Title</h3> <p>Card description with details about the content.</p> </div> <div class="card-tags"> <span class="tag tag-blue">#design</span> <span class="tag tag-green">#ui</span> </div> </div> EOF ;; esac } cmd_navbar() { cat << 'EOF' <!-- Responsive Navigation Bar --> <style> .navbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 64px; background: #1f2937; color: white; } .navbar-brand { font-size: 20px; font-weight: 700; text-decoration: none; color: white; } .navbar-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; } .navbar-links a { color: #d1d5db; text-decoration: none; font-size: 14px; transition: color 0.2s; } .navbar-links a:hover { color: white; } .navbar-cta { padding: 8px 16px; background: #3b82f6; color: white; border: none; border-radius: 6px; cursor: pointer; } @media(max-width:768px) { .navbar-links { display: none; } } </style> <nav class="navbar"> <a href="#" class="navbar-brand">Brand</a> <ul class="navbar-links"> <li><a href="#">Home</a></li> <li><a href="#">Features</a></li> <li><a href="#">Pricing</a></li> <li><a href="#">About</a></li> </ul> <button class="navbar-cta">Get Started</button> </nav> EOF } cmd_modal() { cat << 'EOF' <!-- Modal / Dialog --> <style> .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; } .modal { background: white; border-radius: 12px; padding: 32px; max-width: 480px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: modalIn 0.3s; } @keyframes modalIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } } .modal h2 { margin: 0 0 8px; font-size: 22px; } .modal p { color: #6b7280; margin: 0 0 24px; } .modal-actions { display: flex; gap: 12px; justify-content: flex-end; } .modal-actions button { padding: 10px 20px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; } .btn-cancel { background: #f3f4f6; color: #374151; } .btn-confirm { background: #3b82f6; color: white; } </style> <div class="modal-overlay"> <div class="modal"> <h2>Confirm Action</h2> <p>Are you sure you want to proceed? This action cannot be undone.</p> <div class="modal-actions"> <button class="btn-cancel" onclick="this.closest('.modal-overlay').remove()">Cancel</button> <button class="btn-confirm">Confirm</button> </div> </div> </div> EOF } cmd_form() { cat << 'EOF' <!-- Form Components --> <style> .form { max-width: 420px; padding: 32px; background: white; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); } .form-group { margin-bottom: 20px; } .form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: #374151; } .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; box-sizing: border-box; } .form-group input:focus, .form-group textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); } .form-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; } .form-submit { width: 100%; padding: 12px; background: #3b82f6; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; } .form-submit:hover { background: #2563eb; } </style> <form class="form"> <div class="form-group"> <label>Email</label> <input type="email" placeholder="[email protected]"> <div class="form-hint">We'll never share your email.</div> </div> <div class="form-group"> <label>Password</label> <input type="password" placeholder="••••••••"> </div> <div class="form-group"> <label>Role</label> <select><option>Developer</option><option>Designer</option><option>Manager</option></select> </div> <div class="form-group"> <label>Message</label> <textarea rows="3" placeholder="Tell us more..."></textarea> </div> <button type="submit" class="form-submit">Submit</button> </form> EOF } cmd_table() { cat << 'EOF' <!-- Data Table --> <style> .data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); } .data-table th { background: #f9fafb; padding: 12px 16px; text-align: left; font-size: 12px; text-transform: uppercase; color: #6b7280; border-bottom: 2px solid #e5e7eb; } .data-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; font-size: 14px; } .data-table tr:hover { background: #f9fafb; } .badge { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; } .badge-green { background: #dcfce7; color: #166534; } .badge-yellow { background: #fef9c3; color: #854d0e; } .badge-red { background: #fee2e2; color: #991b1b; } </style> <table class="data-table"> <thead><tr><th>Name</th><th>Email</th><th>Status</th><th>Role</th></tr></thead> <tbody> <tr><td>Jane Cooper</td><td>[email protected]</td><td><span class="badge badge-green">Active</span></td><td>Admin</td></tr> <tr><td>John Smith</td><td>[email protected]</td><td><span class="badge badge-yellow">Pending</span></td><td>Editor</td></tr> <tr><td>Bob Wilson</td><td>[email protected]</td><td><span class="badge badge-red">Inactive</span></td><td>Viewer</td></tr> </tbody> </table> EOF } cmd_hero() { cat << 'EOF' <!-- Hero Section --> <style> .hero { padding: 80px 24px; text-align: center; background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%); color: white; } .hero h1 { font-size: 48px; font-weight: 800; margin: 0 0 16px; line-height: 1.1; } .hero h1 span { background: linear-gradient(90deg, #60a5fa, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .hero p { font-size: 20px; color: #94a3b8; max-width: 600px; margin: 0 auto 32px; } .hero-buttons { display: flex; gap: 16px; justify-content: center; } .hero-btn { padding: 14px 28px; border-radius: 8px; font-size: 16px; font-weight: 600; text-decoration: none; } .hero-btn-primary { background: #3b82f6; color: white; } .hero-btn-ghost { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.2); } </style> <section class="hero"> <h1>Build <span>Amazing</span> Products</h1> <p>The all-in-one platform for modern teams to ship faster and collaborate better.</p> <div class="hero-buttons"> <a href="#" class="hero-btn hero-btn-primary">Get Started Free</a> <a href="#" class="hero-btn hero-btn-ghost">Watch Demo →</a> </div> </section> EOF } cmd_footer() { cat << 'EOF' <!-- Footer --> <style> .footer { background: #111827; color: #9ca3af; padding: 48px 24px 24px; } .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; max-width: 1200px; margin: 0 auto; } .footer-brand h3 { color: white; font-size: 20px; margin: 0 0 12px; } .footer-brand p { font-size: 14px; line-height: 1.6; } .footer-col h4 { color: white; font-size: 14px; margin: 0 0 16px; } .footer-col a { display: block; color: #9ca3af; text-decoration: none; font-size: 14px; margin-bottom: 8px; } .footer-col a:hover { color: white; } .footer-bottom { border-top: 1px solid #1f2937; margin-top: 32px; padding-top: 24px; text-align: center; font-size: 13px; } </style> <footer class="footer"> <div class="footer-grid"> <div class="footer-brand"><h3>Brand</h3><p>Building the future, one component at a time.</p></div> <div class="footer-col"><h4>Product</h4><a href="#">Features</a><a href="#">Pricing</a><a href="#">Docs</a></div> <div class="footer-col"><h4>Company</h4><a href="#">About</a><a href="#">Blog</a><a href="#">Careers</a></div> <div class="footer-col"><h4>Legal</h4><a href="#">Privacy</a><a href="#">Terms</a></div> </div> <div class="footer-bottom">© 2024 Brand. All rights reserved.</div> </footer> EOF } cmd_grid() { cat << 'EOF' <!-- Responsive Grid Layout --> <style> .grid-demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; padding: 24px; } .grid-item { background: white; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); } .grid-item h3 { margin: 0 0 8px; font-size: 18px; } .grid-item p { margin: 0; color: #6b7280; font-size: 14px; } </style> <div class="grid-demo"> <div class="grid-item"><h3>Feature 1</h3><p>Description of the first feature.</p></div> <div class="grid-item"><h3>Feature 2</h3><p>Description of the second feature.</p></div> <div class="grid-item"><h3>Feature 3</h3><p>Description of the third feature.</p></div> <div class="grid-item"><h3>Feature 4</h3><p>Description of the fourth feature.</p></div> </div> EOF } cmd_alert() { cat << 'EOF' <!-- Alert / Notification Components --> <style> .alert { padding: 16px 20px; border-radius: 8px; margin-bottom: 12px; display: flex; align-items: flex-start; gap: 12px; font-size: 14px; } .alert-icon { font-size: 20px; flex-shrink: 0; } .alert-info { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; } .alert-success { background: #f0fdf4; color: #166534; border-left: 4px solid #22c55e; } .alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; } .alert-error { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; } .alert strong { display: block; margin-bottom: 4px; } </style> <div class="alert alert-info"><span class="alert-icon">ℹ️</span><div><strong>Information</strong>A new version is available. Please update.</div></div> <div class="alert alert-success"><span class="alert-icon">✅</span><div><strong>Success</strong>Your changes have been saved successfully.</div></div> <div class="alert alert-warning"><span class="alert-icon">⚠️</span><div><strong>Warning</strong>Your subscription expires in 3 days.</div></div> <div class="alert alert-error"><span class="alert-icon">❌</span><div><strong>Error</strong>Failed to process payment. Please try again.</div></div> EOF } case "$CMD" in help|--help|-h) show_help ;; button|btn) cmd_button ;; card) cmd_card ;; navbar|nav) cmd_navbar ;; modal|dialog) cmd_modal ;; form) cmd_form ;; table) cmd_table ;; hero) cmd_hero ;; footer) cmd_footer ;; grid|layout) cmd_grid ;; alert|notification) cmd_alert ;; *) echo "Unknown command: $CMD"; show_help; exit 1 ;; esac FILE:tips.md # UI Component Tips 🧩 ## 设计原则 1. **一致性** — 同一项目使用统一的圆角、间距、配色 2. **可访问性** — 表单加label,按钮有焦点样式,对比度达标 3. **响应式** — 移动端优先,用相对单位(rem/%) 4. **简洁** — 少即是多,不加无意义装饰 ## 组件选择指南 | 需求 | 推荐命令 | |------|----------| | 用户输入数据 | `form` | | 展示列表数据 | `table` | | 展示产品/内容 | `card` | | 弹出确认/提示 | `modal` | | 页面导航 | `navbar` | ## 风格说明 - **basic** — 干净简约,适合任何项目 - **modern** — 圆角+阴影+渐变,当代感 - **minimal** — 极简,只有必要元素 - **glassmorphism** — 毛玻璃效果,适合深色背景 ## 自定义建议 生成的HTML是起点,可以自由修改: - 颜色 → 搜索替换CSS变量 - 字体 → 修改font-family - 间距 → 调整padding/margin - 动画 → 添加transition/animation ## 浏览器兼容 生成的代码支持所有现代浏览器(Chrome, Firefox, Safari, Edge)。 部分glassmorphism效果需要 `backdrop-filter` 支持。 Powered by BytesAgain | bytesagain.com | [email protected]
文本改写/降重、学术改写、简化表达、正式化、扩写、前后对比。Paraphrase, rewrite for academic tone, simplify, formalize, expand.
--- version: "2.0.0" name: paraphraser description: "文本改写/降重、学术改写、简化表达、正式化、扩写、前后对比。Paraphrase, rewrite for academic tone, simplify, formalize, expand." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # paraphraser 文本改写/降重、学术改写、简化表达、正式化、扩写、前后对比。Paraphrase, rewrite for academic tone, simplify, formalize, expand, and compare text versions. ## 常见问题 **Q: 这个工具适合谁用?** A: 任何需要paraphraser的人,无论是个人还是企业用户。 **Q: 输出格式是什么?** A: 主要输出Markdown格式,方便复制和编辑。 ## 可用命令 - **rewrite** — rewrite - **academic** — academic - **simplify** — simplify - **formal** — formal - **expand** — expand - **compare** — compare ## 专业建议 - 降重改写**:替换同义词 + 调整句式 + 改变语序,三管齐下效果最佳 - 学术改写**:注意使用被动语态、专业术语、限定性表达("一定程度上"、"在某种意义上") - 简化表达**:想象你在给一个10岁小孩解释,去掉所有行话 - 正式化**:去掉口语化表达、网络用语,使用书面语 - 扩写**:从 What/Why/How/Example 四个维度扩展 --- *paraphraser by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help paraphraser help # Run paraphraser run ``` ## Commands Run `paraphraser help` to see all available commands. FILE:scripts/paraphrase.sh #!/usr/bin/env bash # paraphraser — 文本改写助手 # Usage: bash paraphrase.sh <command> [text...] # Powered by BytesAgain set -euo pipefail CMD="-help" shift 2>/dev/null || true INPUT="$*" case "$CMD" in rewrite) cat <<'PROMPT' ## 文本改写/降重 请对以下文本进行改写,要求: 1. **保持原意**:核心信息和观点不变 2. **充分改写**:替换同义词、调整句式结构、改变语序 3. **自然流畅**:改写后的文本要通顺自然,不能生硬 4. **降重目标**:确保与原文的文字重复率低于 20% ### 改写策略 - 同义词替换:用近义词替代原文用词 - 句式变换:主动↔被动、长句↔短句、陈述↔反问 - 语序调整:调整分句顺序、调整修饰语位置 - 概括与展开:适当概括冗长表达,或展开简略表达 ### 待改写文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "1. **改写结果**:完整的改写文本" echo "2. **改写说明**:列出主要改写手法(3-5条)" echo "3. **预估降重率**:估算与原文的差异程度" ;; academic) cat <<'PROMPT' ## 学术风格改写 请将以下文本改写为学术风格,要求: 1. **学术用语**:使用专业术语和学术表达 2. **严谨表述**:添加限定词、避免绝对化表达 3. **被动语态**:适当使用被动语态和无人称表达 4. **逻辑严密**:添加因果、转折等逻辑连接词 5. **规范格式**:符合学术写作规范 ### 学术改写要点 - 口语 → 书面语("很多" → "大量"、"觉得" → "认为") - 模糊 → 精确("最近" → "近年来"、"一些" → "若干") - 主观 → 客观("我认为" → "研究表明"、"显然" → "据分析") - 简单 → 专业(使用领域术语替代通俗表达) ### 待改写文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "1. **学术版本**:改写后的学术风格文本" echo "2. **术语标注**:标注使用的专业术语及含义" echo "3. **改写对照**:关键改写点的原文→学术版对照" ;; simplify) cat <<'PROMPT' ## 简化表达 请将以下文本简化为通俗易懂的表达,要求: 1. **去专业化**:用日常用语替代专业术语 2. **短句优先**:长句拆分为短句,每句一个意思 3. **具象化**:抽象概念用具体例子或比喻说明 4. **口语化**:适当使用口语化表达,让读者感到亲切 5. **目标读者**:初中生也能看懂 ### 简化策略 - 专业术语 → 日常用语(附括号解释如必要) - 长难句 → 多个短句 - 抽象概念 → 生活化比喻或例子 - 复杂逻辑 → 分步骤说明(第一、第二……) - 删除不必要的修饰和限定 ### 待简化文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "1. **简化版本**:通俗易懂的改写" echo "2. **术语解释**:原文中专业术语的白话解释" echo "3. **一句话总结**:用一句话概括核心意思" ;; formal) cat <<'PROMPT' ## 正式化改写 请将以下文本改写为正式、规范的表达,适用于公文/商务/正式场合: 1. **书面语**:去除所有口语、网络用语、俚语 2. **规范用词**:使用标准书面用语 3. **严肃语气**:保持专业、严肃、得体的语气 4. **结构清晰**:逻辑分明、层次清楚 5. **敬语得体**:适当使用敬语和谦辞 ### 正式化要点 - "搞定" → "完成"、"弄" → "处理/实施" - "挺好的" → "较为理想"、"没问题" → "可以接受" - "咱们" → "我们"、"你" → "您/贵方" - 去掉语气词("吧"、"呢"、"啊") - 去掉网络用语("yyds"、"绝绝子"、"666") ### 待改写文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "1. **正式版本**:正式化改写结果" echo "2. **修改标注**:标注口语→正式的关键替换" echo "3. **适用场景**:建议适用的场景(公文/邮件/汇报等)" ;; expand) cat <<'PROMPT' ## 文本扩写 请对以下文本进行扩写,丰富内容和论述: 1. **增加论据**:补充支持观点的事实、数据或案例 2. **详细阐述**:对关键概念进行深入解释 3. **添加过渡**:增加段落间的过渡和衔接 4. **丰富维度**:从多个角度分析(原因、影响、对策等) 5. **扩写比例**:扩展到原文的 2-3 倍篇幅 ### 扩写策略 - **What**:是什么?定义和解释核心概念 - **Why**:为什么?分析原因和背景 - **How**:怎么做?具体方法和步骤 - **Example**:举例子,用实际案例支撑 - **Impact**:影响是什么?短期和长期影响 - **Comparison**:对比分析,正反两面 ### 待扩写文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "1. **扩写结果**:完整的扩写文本" echo "2. **扩展要点**:列出新增的内容要点" echo "3. **字数对比**:原文 vs 扩写后字数" ;; compare) cat <<'PROMPT' ## 改写对比分析 请对以下原文和改写版本进行详细对比分析: 1. **差异标注**:标出所有改动之处 2. **改写手法**:分析使用了哪些改写技巧 3. **语义保持**:评估是否保持了原意 4. **质量评分**:从多个维度评分 ### 对比维度 - **用词变化**:哪些词被替换,替换是否恰当 - **句式变化**:句式结构有什么改变 - **语序变化**:语序是否调整,效果如何 - **信息保持**:是否有信息丢失或增加 - **流畅度**:改写后是否更流畅/自然 ### 待对比文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" cat <<'FORMAT' 1. **逐句对比表**: | 原文 | 改写 | 改写手法 | |------|------|----------| | ... | ... | ... | 2. **综合评分**(满分10分): - 降重效果:_/10 - 语义保持:_/10 - 流畅度:_/10 - 总评:_/10 3. **改进建议**:可以进一步优化的地方 FORMAT ;; help|--help|-h|"") cat <<'HELP' ╔══════════════════════════════════════════════╗ ║ 📝 Paraphraser — 文本改写助手 ║ ╠══════════════════════════════════════════════╣ ║ ║ ║ Commands: ║ ║ rewrite 改写文本/降重 ║ ║ academic 学术风格改写 ║ ║ simplify 简化表达,通俗易懂 ║ ║ formal 正式化改写 ║ ║ expand 扩写文本,丰富内容 ║ ║ compare 对比原文和改写版本 ║ ║ help 显示此帮助菜单 ║ ║ ║ ║ Usage: ║ ║ bash paraphrase.sh <command> [text] ║ ║ ║ ║ Examples: ║ ║ bash paraphrase.sh rewrite 这个方案不错 ║ ║ bash paraphrase.sh academic 社交媒体影响 ║ ║ bash paraphrase.sh simplify 专业术语文本 ║ ║ ║ ╚══════════════════════════════════════════════╝ Powered by BytesAgain | bytesagain.com | [email protected] HELP ;; *) echo "❌ Unknown command: $CMD" echo "Run 'bash paraphrase.sh help' for usage." exit 1 ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # paraphraser - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/paraphraser}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF paraphraser v$VERSION Multi-purpose utility tool Usage: paraphraser <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "paraphraser v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Paraphraser Tips ## 改写技巧 1. **降重改写**:替换同义词 + 调整句式 + 改变语序,三管齐下效果最佳 2. **学术改写**:注意使用被动语态、专业术语、限定性表达("一定程度上"、"在某种意义上") 3. **简化表达**:想象你在给一个10岁小孩解释,去掉所有行话 4. **正式化**:去掉口语化表达、网络用语,使用书面语 5. **扩写**:从 What/Why/How/Example 四个维度扩展 ## 常见场景 - **论文降重**:用 `rewrite` 或 `academic`,避免查重率过高 - **公文改写**:用 `formal`,确保符合公文规范 - **科普文章**:用 `simplify`,让专业内容大众化 - **内容充实**:用 `expand`,让薄弱段落更有说服力 - **质量检查**:用 `compare`,对比改写前后效果 ## 注意事项 - 改写不是翻译,要保持原文的核心信息 - 学术改写需注意引用规范 - 简化时不要丢失关键信息 - 扩写要有实质内容,避免注水
校对/错别字检查、语法纠错、文风统一、一致性检查、可读性评分、校对报告。Proofreading with typo detection, grammar correction, style consistency, readability scoring.
--- version: "2.0.0" name: proofreader description: "校对/错别字检查、语法纠错、文风统一、一致性检查、可读性评分、校对报告。Proofreading with typo detection, grammar correction, style consistency, readability scoring." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # proofreader 校对/错别字检查、语法纠错、文风统一、一致性检查、可读性评分、校对报告。Proofreading with typo detection, grammar correction, style consistency, readability scoring, and full reports. ## 常见问题 **Q: 这个工具适合谁用?** A: 任何需要proofreader的人,无论是个人还是企业用户。 **Q: 输出格式是什么?** A: 主要输出Markdown格式,方便复制和编辑。 ## 命令列表 | 命令 | 功能 | |------|------| | `check` | check | | `grammar` | grammar | | `style` | style | | `consistency` | consistency | | `readability` | readability | | `report` | report | ## 专业建议 - 分层校对**:先查错别字,再查语法,最后查风格——分开检查更不容易遗漏 - 朗读检验法**:读出声来,不通顺的地方往往就是有问题的地方 - 反向阅读法**:从最后一段往前读,强制关注每个句子本身 - 一致性清单**:建立术语表,确保全文统一 - 的地得**:形容词+的+名词、副词+地+动词、动词+得+补语 --- *proofreader by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help proofreader help # Run proofreader run ``` ## Commands Run `proofreader help` to see all available commands. FILE:scripts/proofread.sh #!/usr/bin/env bash # proofreader — 校对助手 # Usage: bash proofread.sh <command> [text...] # Powered by BytesAgain set -euo pipefail CMD="-help" shift 2>/dev/null || true INPUT="$*" case "$CMD" in check) cat <<'PROMPT' ## 全面校对 请对以下文本进行全面校对,检查所有类型的错误: ### 检查清单 1. **错别字/拼写**:找出所有拼写错误和错别字 2. **语法错误**:主谓搭配、时态、语态、句式结构 3. **标点符号**:标点使用是否正确、是否遗漏 4. **用词不当**:是否有用词不准确或搭配不当 5. **重复冗余**:是否有不必要的重复表达 6. **格式问题**:数字、日期、单位的格式是否规范 ### 中文特别检查 - 的/地/得 使用是否正确 - 在/再、做/作、即/既 等易混字 - 中文标点 vs 英文标点混用 - 全角/半角混用 ### 英文特别检查 - Subject-verb agreement - Tense consistency - Article usage (a/an/the) - Comma splices and run-on sentences ### 待校对文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" cat <<'FORMAT' ### 输出格式 1. **错误列表**: | # | 位置 | 原文 | 错误类型 | 修改建议 | |---|------|------|----------|----------| | 1 | ... | ... | 错别字 | ... | 2. **修改后全文**:标注所有修改的完整文本 3. **错误统计**:各类错误数量汇总 FORMAT ;; grammar) cat <<'PROMPT' ## 语法纠错 请专注检查以下文本的语法错误: ### 中文语法检查点 1. **主谓搭配**:主语和谓语是否搭配 2. **成分残缺**:是否缺少必要的句子成分 3. **语序不当**:定语、状语位置是否正确 4. **搭配不当**:动宾搭配、主谓搭配是否合理 5. **逻辑错误**:前后是否矛盾、因果是否成立 6. **关联词**:关联词使用是否正确(虽然…但是、不仅…而且) ### 英文语法检查点 1. **Subject-verb agreement** 2. **Tense consistency** 3. **Pronoun reference** 4. **Parallel structure** 5. **Dangling modifiers** 6. **Comma splices / run-on sentences** ### 待检查文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "1. **语法错误列表**:每个错误的位置、原文、错误类型、修改建议" echo "2. **修正后全文**:语法修正后的完整文本" echo "3. **语法知识点**:涉及的语法规则简要说明" ;; style) cat <<'PROMPT' ## 文风统一检查 请检查以下文本的文风是否统一,并提供调整建议: ### 文风检查维度 1. **语体一致**:是否混用了口语和书面语 2. **人称一致**:人称代词是否统一(我/我们/本文) 3. **时态一致**:(英文)时态是否前后一致 4. **语气一致**:是否忽正式忽随意 5. **术语一致**:同一概念是否用了不同的词 6. **句式风格**:长短句比例是否协调 ### 文风参考 - **学术**:严谨、客观、被动语态多 - **商务**:专业、礼貌、结构清晰 - **新闻**:客观、简洁、倒金字塔 - **文学**:生动、富有表现力 - **技术**:精确、步骤化、术语规范 ### 待检查文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "1. **文风诊断**:当前文本的文风特征" echo "2. **不一致之处**:列出文风不统一的地方" echo "3. **统一建议**:按目标文风给出修改建议" echo "4. **修改后文本**:文风统一后的版本" ;; consistency) cat <<'PROMPT' ## 一致性检查 请检查以下文本(或文档)的一致性问题: ### 一致性检查清单 1. **术语一致**: - 同一概念是否使用了不同的词(如"用户/客户/使用者"混用) - 中英文术语是否统一 2. **格式一致**: - 数字格式(阿拉伯数字 vs 汉字数字) - 日期格式 - 标点风格(中文标点 vs 英文标点) - 列表编号格式 3. **大小写一致**(英文): - 专有名词大小写 - 标题大小写规则 4. **标点一致**: - 顿号 vs 逗号的使用 - 引号风格(""vs「」) - 省略号格式 5. **称谓一致**: - 人称是否统一 - 敬语使用是否一致 ### 待检查文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" cat <<'FORMAT' ### 输出格式 1. **不一致项列表**: | # | 类型 | 出现位置 | 变体1 | 变体2 | 建议统一为 | |---|------|----------|-------|-------|------------| | 1 | 术语 | 第2/5段 | 用户 | 客户 | 用户 | 2. **一致性评分**:_/100 3. **修正建议**:优先级排序的修正清单 FORMAT ;; readability) cat <<'PROMPT' ## 可读性评分与优化 请评估以下文本的可读性,并提供优化建议: ### 可读性评估维度 #### 中文可读性指标 1. **平均句长**:每句平均字数(建议 15-25 字) 2. **段落长度**:每段行数(建议 3-5 行) 3. **生僻字比例**:非常用汉字占比 4. **被动句比例**:被动语态占比(建议 < 20%) 5. **长句比例**:超过 40 字的句子占比 6. **连接词使用**:逻辑连接是否充分 #### 英文可读性指标 1. **Flesch Reading Ease**:0-100 分(60-70 为标准) 2. **Flesch-Kincaid Grade Level**:对应年级水平 3. **Average sentence length** 4. **Average word length (syllables)** 5. **Passive voice percentage** #### 通用指标 1. **标题和小标题**:是否有清晰的结构层次 2. **列表使用**:是否善用列表提高可读性 3. **视觉节奏**:长短段落是否交错 4. **信息密度**:每段是否信息过载 ### 待评估文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" cat <<'FORMAT' ### 输出格式 1. **可读性评分卡**: | 指标 | 当前值 | 建议值 | 评级 | |------|--------|--------|------| | 平均句长 | 32字 | 15-25字 | ⚠️ | | ... | ... | ... | ... | 2. **总体评分**:_/100(附目标读者定位) 3. **优化建议**:按优先级列出改进建议 4. **优化示例**:选择最需要改进的段落给出修改示例 FORMAT ;; report) cat <<'PROMPT' ## 完整校对报告 请为以下文本生成一份完整的校对报告,涵盖所有检查维度: ### 报告结构 #### 一、概览 - 文本基本信息(字数、段落数、句子数) - 总体质量评分 - 关键问题摘要 #### 二、错别字与拼写 - 所有拼写错误列表 - 修改建议 #### 三、语法问题 - 语法错误列表 - 修改建议及语法规则说明 #### 四、标点与格式 - 标点错误 - 格式不规范之处 #### 五、文风与一致性 - 文风诊断 - 不一致之处 #### 六、可读性 - 可读性评分 - 优化建议 #### 七、修改后全文 - 所有修改已标注的完整文本 #### 八、总结 - 错误统计汇总 - 整体评价 - 优先改进建议 ### 待校对文本 PROMPT if [ -n "$INPUT" ]; then echo "" echo "$INPUT" fi echo "" echo "### 输出格式" echo "按上述报告结构输出完整校对报告,使用 Markdown 格式" ;; help|--help|-h|"") cat <<'HELP' ╔══════════════════════════════════════════════╗ ║ 🔍 Proofreader — 校对助手 ║ ╠══════════════════════════════════════════════╣ ║ ║ ║ Commands: ║ ║ check 全面校对(错字+语法+标点) ║ ║ grammar 专注语法纠错 ║ ║ style 文风统一检查 ║ ║ consistency 一致性检查(术语/格式) ║ ║ readability 可读性评分与优化 ║ ║ report 生成完整校对报告 ║ ║ help 显示此帮助菜单 ║ ║ ║ ║ Usage: ║ ║ bash proofread.sh <command> [text] ║ ║ ║ ║ Examples: ║ ║ bash proofread.sh check 检查这段文字 ║ ║ bash proofread.sh grammar He don't know ║ ║ bash proofread.sh readability 评估可读性 ║ ║ ║ ╚══════════════════════════════════════════════╝ Powered by BytesAgain | bytesagain.com | [email protected] HELP ;; *) echo "❌ Unknown command: $CMD" echo "Run 'bash proofread.sh help' for usage." exit 1 ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # proofreader - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/proofreader}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF proofreader v$VERSION Multi-purpose utility tool Usage: proofreader <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "proofreader v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Proofreader Tips ## 校对技巧 1. **分层校对**:先查错别字,再查语法,最后查风格——分开检查更不容易遗漏 2. **朗读检验法**:读出声来,不通顺的地方往往就是有问题的地方 3. **反向阅读法**:从最后一段往前读,强制关注每个句子本身 4. **一致性清单**:建立术语表,确保全文统一 ## 中文常见错误 - **的地得**:形容词+的+名词、副词+地+动词、动词+得+补语 - **在/再**:在=位置/进行中,再=又/重复 - **做/作**:做=具体动作,作=抽象行为 - **常见错别字**:即/既、需/须、像/象、以/已 ## 英文常见错误 - **Their/There/They're** - **Its/It's** - **Affect/Effect** - **Then/Than** - **Subject-verb agreement** ## 可读性指标 - **中文**:平均句长、生僻字比例、被动句占比 - **英文**:Flesch-Kincaid Grade Level、Gunning Fog Index - **通用**:段落长度、标题层级、列表使用
论文写作助手。论文大纲生成、文献综述框架、摘要生成、引用格式转换、格式规范检查、答辩准备。Thesis helper with outline generation, literature review, abstract writing, citation formatting, style guide.
--- version: "2.0.0" name: thesis-helper description: "论文写作助手。论文大纲生成、文献综述框架、摘要生成、引用格式转换、格式规范检查、答辩准备。Thesis helper with outline generation, literature review, abstract writing, citation formatting, style guide." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # thesis-helper 论文写作助手。论文大纲生成、文献综述框架、摘要生成、引用格式转换、格式规范检查、答辩准备。Thesis helper with outline generation, literature review, abstract writing, citation formatting, style guide, defense preparation. ## 速查表 See commands above. ## 命令速查 ``` outline outline literature literature abstract abstract cite cite format format defense defense ``` > 💡 小技巧:先用 `help` 查看所有命令,再选择最适合的 ## 专业建议 - 论文大纲**:输入研究主题,生成多级大纲结构 - 文献综述**:按时间线或主题分类组织文献框架 - 摘要生成**: - 中文摘要:200-300字 - 英文摘要:150-250 words --- *thesis-helper by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com - Run `thesis-helper help` for commands - No API keys needed ## Commands Run `thesis-helper help` to see all available commands. FILE:scripts/script.sh #!/usr/bin/env bash # thesis-helper - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/thesis-helper}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF thesis-helper v$VERSION Multi-purpose utility tool Usage: thesis-helper <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "thesis-helper v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/thesis.sh #!/usr/bin/env bash # thesis.sh — 论文工具(真实生成版) # Usage: bash thesis.sh <command> [args...] # Commands: outline, cite, abstract, format, defense, checklist set -euo pipefail CMD="-help" shift 2>/dev/null || true INPUT="$*" # ── 论文大纲生成 ── generate_outline() { local title="-研究题目" local level="-本科" local field="-计算机科学" echo "# 📑 论文大纲 — title" echo "" echo "> 层次: level" echo "> 学科: field" echo "> 生成时间: $(date '+%Y-%m-%d %H:%M')" echo "" # 根据层次调整大纲深度 local word_target pages_target ref_count case "$level" in 本科|bachelor) word_target="10000-15000" pages_target="30-50" ref_count="30+" ;; 硕士|master) word_target="30000-50000" pages_target="60-100" ref_count="60+" ;; 博士|phd) word_target="80000-100000" pages_target="150-300" ref_count="100+" ;; *) word_target="8000-15000" pages_target="20-40" ref_count="20+" ;; esac cat <<EOF ## 论文基本信息 | 项目 | 要求 | |------|------| | 题目 | title | | 层次 | level | | 学科 | field | | 字数要求 | word_target字 | | 页数参考 | pages_target页 | | 参考文献 | ≥ref_count篇 | ## 论文结构 ### 前置部分 - [ ] 封面(题目、姓名、导师、日期) - [ ] 诚信声明 - [ ] 摘要(中文,300-500字) - [ ] Abstract(英文摘要) - [ ] 关键词 / Keywords(3-5个) - [ ] 目录 - [ ] 图表目录(如有) ### 第一章 绪论 (约level级: $([ "$level" = "本科" ] && echo "2000" || echo "5000")字) #### 1.1 研究背景 - 宏观背景:field领域的发展现状 - 行业/社会需求:为什么这个问题重要 - 现有不足:当前方案的局限性 #### 1.2 研究目的与意义 - 理论意义:填补什么理论空白 - 实践意义:解决什么实际问题 - 创新点(2-3个): 1. [方法创新/模型创新] 2. [应用创新/场景创新] 3. [视角创新/跨学科创新] #### 1.3 国内外研究现状 - 国外研究:按时间/流派梳理 - 国内研究:按时间/方向梳理 - 研究述评:总结现有研究的不足 #### 1.4 研究内容与方法 - 研究内容:本文要做什么(分章概述) - 研究方法: - [ ] 文献分析法 - [ ] 实验法 - [ ] 问卷调查法 - [ ] 案例研究法 - [ ] 对比分析法 - [ ] 定量/定性分析 #### 1.5 论文组织结构 - 技术路线图(建议画流程图) ### 第二章 相关理论与技术基础 (约$([ "$level" = "本科" ] && echo "2000" || echo "4000")字) #### 2.1 核心概念定义 - 概念A的定义与演变 - 概念B的定义与界定 #### 2.2 理论基础 - 理论1:[名称]——核心观点与适用性 - 理论2:[名称]——核心观点与适用性 #### 2.3 技术基础 - 技术/方法1:原理与特点 - 技术/方法2:原理与特点 #### 2.4 本章小结 ### 第三章 [方案设计/模型构建/方法论] (核心章节1) #### 3.1 总体设计/整体框架 - 设计思路 - 架构图 #### 3.2 [模块/方法]详细设计 - 3.2.1 [子模块1] - 3.2.2 [子模块2] - 3.2.3 [子模块3] #### 3.3 关键技术/算法 - 算法描述(伪代码/流程图) - 复杂度分析 #### 3.4 本章小结 ### 第四章 [实验/实现/案例分析] (核心章节2) #### 4.1 实验环境/研究设计 - 硬件/软件环境 - 数据集/样本说明 - 评估指标 #### 4.2 实验过程/实现过程 - 步骤1 - 步骤2 - 步骤3 #### 4.3 结果与分析 - 结果展示(表格+图表) - 对比分析 - 显著性检验(如适用) #### 4.4 讨论 - 结果解释 - 与现有方法的对比 - 局限性说明 #### 4.5 本章小结 ### 第五章 总结与展望 (约$([ "$level" = "本科" ] && echo "1000" || echo "2000")字) #### 5.1 研究总结 - 主要工作回顾(3-5条) - 创新点总结 #### 5.2 研究不足 - 客观承认局限(2-3点) #### 5.3 未来展望 - 短期改进方向 - 长期研究方向 ### 后置部分 - [ ] 参考文献(ref_count篇以上) - [ ] 附录(代码/问卷/详细数据) - [ ] 致谢 --- ## 📊 章节字数分配 | 章节 | 占比 | 字数估算 | |------|------|---------| | 第一章 绪论 | 15-20% | - | | 第二章 基础 | 15% | - | | 第三章 设计 | 25-30% | - | | 第四章 实验 | 25-30% | - | | 第五章 总结 | 5-10% | - | EOF } # ── 参考文献格式 ── generate_citation() { local style="-gb" local type="-all" echo "# 📚 参考文献格式模板" echo "" echo "> 格式标准: style^^" echo "> 生成时间: $(date '+%Y-%m-%d %H:%M')" echo "" case "$style" in gb|gbt7714|国标) cat <<'EOF' ## GB/T 7714-2015 格式(中国国标) ### 期刊论文 [J] ``` [序号] 作者1, 作者2, 作者3, 等. 文章题目[J]. 期刊名, 年, 卷(期): 起始页-结束页. ``` 示例: ``` [1] 张三, 李四. 深度学习在自然语言处理中的应用研究[J]. 计算机学报, 2024, 47(3): 621-635. [2] SMITH J, JOHNSON A B. Deep learning for NLP: A survey[J]. Nature Machine Intelligence, 2023, 5(2): 108-120. ``` ### 学位论文 [D] ``` [序号] 作者. 题名[D]. 城市: 学校名, 年. ``` 示例: ``` [3] 王五. 基于Transformer的文本分类方法研究[D]. 北京: 清华大学, 2024. ``` ### 专著/图书 [M] ``` [序号] 作者. 书名[M]. 版次. 出版地: 出版社, 年: 页码. ``` 示例: ``` [4] GOODFELLOW I, BENGIO Y, COURVILLE A. Deep Learning[M]. Cambridge: MIT Press, 2016: 326-366. [5] 周志华. 机器学习[M]. 北京: 清华大学出版社, 2016. ``` ### 会议论文 [C] ``` [序号] 作者. 题名[C]// 会议名. 城市: 出版者, 年: 页码. ``` 示例: ``` [6] VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need[C]// Proc. of NeurIPS 2017. Long Beach: Curran Associates, 2017: 5998-6008. ``` ### 网络资源 [EB/OL] ``` [序号] 作者. 题名[EB/OL]. (发布日期)[引用日期]. URL. ``` 示例: ``` [7] OpenAI. GPT-4 Technical Report[EB/OL]. (2023-03-15)[2024-01-10]. https://arxiv.org/abs/2303.08774. ``` ### 专利 [P] ``` [序号] 发明人. 专利名[P]. 专利号, 公告日期. ``` ### 标准 [S] ``` [序号] 标准号. 标准名称[S]. 出版地: 出版者, 年. ``` EOF ;; apa) cat <<'EOF' ## APA 7th Edition 格式 ### 期刊论文 ``` Author, A. A., & Author, B. B. (Year). Title of article. Title of Periodical, Volume(Issue), Page–Page. https://doi.org/xxxxx ``` 示例: ``` Smith, J., & Johnson, A. B. (2023). Deep learning for NLP: A survey. Nature Machine Intelligence, 5(2), 108-120. https://doi.org/10.1038/s42256-023-00612-2 ``` ### 图书 ``` Author, A. A. (Year). Title of work: Capital letter also for subtitle (Edition). Publisher. ``` ### 网络资源 ``` Author, A. A. (Year, Month Day). Title of page. Site Name. URL ``` ### 注意事项 - 作者超过20人时,列出前19个...后列最后1个 - DOI用https://doi.org/格式 - 悬挂缩进(首行不缩进,其余缩进0.5英寸) EOF ;; ieee) cat <<'EOF' ## IEEE 格式 ### 期刊论文 ``` [1] A. Author and B. Author, "Title of article," Title of Journal, vol. X, no. X, pp. xxx-xxx, Month Year. ``` ### 会议论文 ``` [2] A. Author, "Title of paper," in Proc. Conference Name, City, Country, Year, pp. xxx-xxx. ``` ### 注意事项 - 按引用顺序编号[1], [2], [3]... - 作者名缩写在前: J. Smith - 标题用引号,期刊/会议名斜体 EOF ;; esac } # ── 摘要模板 ── generate_abstract() { local title="-研究题目" local field="-计算机" cat <<EOF # 📋 摘要模板 — title > 生成时间: $(date '+%Y-%m-%d %H:%M') ## 中文摘要(300-500字) ### 结构化模板 **[背景]** 随着field领域的快速发展,[问题/需求]日益凸显。[现有方法]虽然在[某方面]取得了一定成效,但仍存在[不足1]和[不足2]等问题。 **[目的]** 本文针对[具体问题],提出了一种基于[方法/技术]的[解决方案名称],旨在[解决什么/提升什么]。 **[方法]** 首先,[方法步骤1,如"构建了...模型"];其次,[方法步骤2,如"设计了...算法"];最后,[方法步骤3,如"通过...进行了验证"]。 **[结果]** 实验结果表明,所提方法在[评估指标1]上达到了[具体数值],相比[对比方法]提升了[X]%;在[评估指标2]上,[具体结果]。 **[结论]** 本研究证明了[核心结论],为[领域/方向]提供了[理论/实践]参考。 **关键词:** [词1];[词2];[词3];[词4];[词5] --- ## English Abstract ### Structured Template **[Background]** With the rapid development of [field], [problem] has become increasingly prominent. Although [existing methods] have achieved certain results in [aspect], [limitation1] and [limitation2] remain as challenges. **[Objective]** This paper proposes a [method]-based [solution name] to address [specific problem], aiming to [goal]. **[Methods]** First, [step1]; Second, [step2]; Finally, [step3]. **[Results]** Experimental results demonstrate that the proposed method achieves [metric1] of [value], outperforming [baseline] by [X]%. For [metric2], [specific results]. **[Conclusions]** This study validates [core conclusion] and provides [theoretical/practical] insights for [field/direction]. **Keywords:** [word1]; [word2]; [word3]; [word4]; [word5] --- ## ⚠️ 摘要写作原则 | 原则 | 说明 | |------|------| | ✅ 独立性 | 不需要看正文就能理解 | | ✅ 完整性 | 包含目的、方法、结果、结论 | | ✅ 客观性 | 避免主观评价(如"创新性地") | | ✅ 具体性 | 有具体数据和结果 | | ❌ 不引用文献 | 摘要中不出现[1]这类引用 | | ❌ 不用图表 | 不引用"如图X所示" | | ❌ 不用缩写 | 首次出现写全称 | | ❌ 不要套话 | 避免"具有重要意义"等空话 | EOF } # ── 答辩准备 ── generate_defense() { local title="-论文题目" local duration="-15" cat <<EOF # 🎤 答辩准备 — title > 答辩时长: duration分钟 + Q&A > 生成时间: $(date '+%Y-%m-%d %H:%M') ## PPT时间分配 | 环节 | 时长 | 页数 | 内容 | |------|------|------|------| | 开场 | 1min | 1-2页 | 自我介绍+题目 | | 背景 | 2min | 2-3页 | 为什么做+现状 | | 方法 | $(echo "scale=0; $duration * 40 / 100" | bc)min | 5-8页 | 怎么做(核心) | | 结果 | $(echo "scale=0; $duration * 25 / 100" | bc)min | 3-5页 | 做出了什么 | | 总结 | 1min | 1-2页 | 结论+贡献+不足 | | 致谢 | 0.5min | 1页 | 感谢 | | **共计** | **durationmin** | **13-21页** | | ## PPT制作要点 1. **每页一个核心观点** — 不要堆砌文字 2. **图表 > 文字** — 框架图、流程图、对比表 3. **字体≥24pt** — 确保后排看得清 4. **动画慎用** — 简洁>花哨 5. **页码要有** — 方便老师提问时定位 ## 常见答辩问题(准备30个) ### 研究动机类 1. 为什么选择这个题目? 2. 这个研究的实际应用场景是什么? 3. 你的研究有什么创新点? ### 方法类 4. 为什么选择这个方法而不是[替代方法]? 5. 你的方法和[XXX]方法有什么区别? 6. 算法的时间/空间复杂度是多少? 7. 参数是怎么选择的?有做消融实验吗? ### 实验类 8. 数据集/样本是怎么获取的?有代表性吗? 9. 评估指标为什么选这几个? 10. 实验结果的统计显著性如何? 11. 在什么情况下你的方法会失效? ### 理论类 12. [核心概念]你是怎么定义的? 13. 你的理论基础是什么? 14. 这个模型的假设条件是什么? ### 挑战类 15. 研究过程中遇到的最大困难是什么? 16. 如果重新做,你会怎么改进? 17. 你的研究有什么局限性? ### 延伸类 18. 未来打算怎么继续这个研究? 19. 你的研究对[相关领域]有什么启示? 20. 如果数据量增加10倍,方法还适用吗? ## 答辩技巧 ### 陈述阶段 - ⏰ 提前演练3遍,控制时间 - 📝 准备逐字稿但不要念 - 👀 看评委,不要只看屏幕 - 🎯 重点讲创新点和结果 ### Q&A阶段 - ✅ 听完问题再回答(可以重复确认) - ✅ 不知道就诚实说:"这个角度我没有深入考虑,感谢老师的建议" - ✅ 回答要有结构:先结论,再解释 - ❌ 不要和评委争论 - ❌ 不要说"论文里写了"——评委可能没看到那个部分 EOF } # ── 完成度检查清单 ── generate_checklist() { local level="-本科" cat <<EOF # ✅ 论文完成度检查清单 — level > 打 [x] 表示已完成 ## 格式检查 - [ ] 封面信息完整(题目、姓名、学号、导师、日期) - [ ] 页码正确(摘要用罗马数字,正文用阿拉伯数字) - [ ] 目录自动生成且页码正确 - [ ] 字体字号符合模板(宋体/Times New Roman) - [ ] 行距符合要求(通常1.5倍) - [ ] 页边距正确(通常上下2.5cm,左3cm,右2cm) - [ ] 章节编号连续正确 - [ ] 图表编号连续且有标题 - [ ] 公式编号右对齐 ## 内容检查 - [ ] 摘要300-500字,包含目的/方法/结果/结论 - [ ] 英文摘要与中文摘要对应 - [ ] 关键词3-5个 - [ ] 绪论有研究背景/意义/现状/方法/结构 - [ ] 文献综述覆盖近5年的重要文献 - [ ] 研究方法描述清晰可复现 - [ ] 实验结果有数据支撑 - [ ] 结论不超出实验结果范围 - [ ] 致谢真诚得体 ## 参考文献检查 - [ ] 格式统一(GB/T 7714 或学校要求的格式) - [ ] 数量满足要求(level: $([ "$level" = "本科" ] && echo "≥30" || echo "≥60")篇) - [ ] 英文文献占比合理(≥30%) - [ ] 近5年文献占比(≥50%) - [ ] 正文中都有引用(没有"僵尸文献") - [ ] 引用序号连续 ## 学术规范检查 - [ ] 查重率符合要求(通常<20%) - [ ] 引用标注正确(非抄袭) - [ ] 数据/图表来源标注 - [ ] 无AI生成痕迹(语言自然) - [ ] 无低级语法错误 - [ ] 术语使用一致 ## 提交前 - [ ] 导师审阅通过 - [ ] PDF格式导出无乱码 - [ ] 文件命名规范(姓名_学号_毕业论文) - [ ] 备份存档(至少2份) - [ ] 答辩PPT准备完成 - [ ] 打印装订(如需要) EOF } # ── 帮助 ── show_help() { cat <<'HELP' 📝 论文工具 — thesis.sh 用法: bash thesis.sh <command> [args...] 命令: outline <题目> [本科|硕士|博士] [学科] → 生成完整论文大纲(含章节字数分配) cite [gb|apa|ieee] [类型] → 参考文献格式模板(含示例) abstract <题目> [学科] → 摘要写作模板(中英文+写作原则) defense <题目> [答辩时长] → 答辩准备(PPT分配+20个常见问题+技巧) checklist [本科|硕士|博士] → 论文完成度检查清单 help → 显示帮助 示例: bash thesis.sh outline "基于深度学习的图像分类" 硕士 计算机科学 bash thesis.sh cite gb bash thesis.sh cite apa bash thesis.sh abstract "区块链在供应链中的应用" 管理学 bash thesis.sh defense "我的论文题目" 15 bash thesis.sh checklist 本科 💡 特色: - 根据学位层次自动调整大纲深度和字数 - GB/T 7714 + APA + IEEE 三种引用格式 - 结构化摘要模板(中英双语) - 答辩准备含20+常见问题 - 完成度清单(一键自查) HELP } case "$CMD" in outline) IFS='|' read -ra A <<< "$(echo "$INPUT" | sed 's/ */|/g')" generate_outline "-" "-本科" "-计算机" ;; cite) IFS=' ' read -ra A <<< "$INPUT" generate_citation "-gb" "-all" ;; abstract) IFS='|' read -ra A <<< "$(echo "$INPUT" | sed 's/ */|/g')" generate_abstract "-" "-计算机" ;; defense) IFS='|' read -ra A <<< "$(echo "$INPUT" | sed 's/ */|/g')" generate_defense "-" "-15" ;; checklist) generate_checklist "-本科" ;; help|*) show_help ;; esac FILE:tips.md # Thesis Helper Tips ## 使用技巧 1. **论文大纲**:输入研究主题,生成多级大纲结构 2. **文献综述**:按时间线或主题分类组织文献框架 3. **摘要生成**: - 中文摘要:200-300字 - 英文摘要:150-250 words - 包含研究背景、方法、结果、结论 4. **引用格式**: - APA (美国心理学会) - MLA (现代语言协会) - Chicago (芝加哥格式) - GB/T 7714 (中国国标) - IEEE (电气电子工程师学会) 5. **格式规范**:字体、字号、行距、页边距、页眉页脚 6. **答辩准备**:常见问题预测、PPT结构建议、时间分配 ## 论文结构参考 1. 封面 2. 摘要(中英文) 3. 目录 4. 绪论/引言 5. 文献综述 6. 研究方法 7. 实验/分析 8. 结论 9. 参考文献 10. 致谢 11. 附录
Spaced repetition study tool with deck management. Use when you need flashcard.
--- name: Flashcard description: "Spaced repetition study tool with deck management. Use when you need flashcard." version: "2.0.0" author: "BytesAgain" homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills tags: ["flashcard","study","learning","spaced-repetition","education","memory","quiz","anki"] categories: ["Education", "Productivity", "Personal Management"] --- # Flashcard Study smarter with spaced repetition. Cards you struggle with come up more often. ## Commands - `create <deck>` — Create a new flashcard deck - `add <deck> <front> <back>` — Add a card to a deck - `study <deck>` — Study weakest cards first - `correct <deck>` — Mark current card as correct - `wrong <deck>` — Mark current card as wrong (will repeat sooner) - `decks` — List all decks with card counts - `stats` — Overall study statistics - `help` — Show commands ## Usage Examples ```bash flashcard create Spanish flashcard add Spanish "hola" "hello" flashcard add Spanish "gracias" "thank you" flashcard study Spanish flashcard correct Spanish flashcard decks flashcard stats ``` --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com FILE:scripts/flash.sh #!/usr/bin/env bash # flash.sh — Flashcard learning system # Usage: bash flash.sh <command> [input] # Commands: create, review, quiz, export, spaced, stats set -euo pipefail CMD="-help" shift 2>/dev/null || true INPUT="$*" case "$CMD" in create) cat << 'PROMPT' You are a flashcard creation expert. Generate flashcards based on the user's topic. ## Rules 1. Each flashcard has a FRONT (question/prompt) and BACK (answer/explanation) 2. One concept per card — keep it atomic 3. Use clear, concise language 4. Include mnemonics or memory aids where helpful 5. Number each card sequentially ## Output Format For each flashcard: ### Card [N] **Front:** [Question or prompt] **Back:** [Answer or explanation] **Tip:** [Memory aid or connection to other knowledge] --- ## Task PROMPT if [ -n "$INPUT" ]; then echo "Create flashcards for: $INPUT" echo "" echo "Generate 10 flashcards by default unless a specific number is requested." echo "Include a mix of definition cards, concept cards, and application cards." else echo "The user wants to create flashcards but didn't specify a topic." echo "Ask them: what subject/topic would you like flashcards for? How many cards?" fi ;; review) cat << 'PROMPT' You are a spaced repetition review coach. Help the user review their flashcards effectively. ## Review Strategy 1. Present cards in order of urgency (most likely to be forgotten first) 2. For each card, show the FRONT first 3. After user responds, reveal the BACK 4. Rate recall quality: Again (1) / Hard (2) / Good (3) / Easy (4) 5. Adjust next review interval based on rating ## Ebbinghaus Intervals - New card → Review in 1 day - Rating 1 (Again) → Review in 10 minutes - Rating 2 (Hard) → Review in 1 day - Rating 3 (Good) → Current interval × 2.5 - Rating 4 (Easy) → Current interval × 3.5 ## Output Format Present a review session plan: ### Review Session **Cards due today:** [N] **New cards:** [N] **Review cards:** [N] Then present each card: **Card [N] — [Category]** > Front: [Question] [Wait for response, then reveal] > Back: [Answer] **Rate your recall:** Again / Hard / Good / Easy **Next review:** [Date based on rating] ## Task PROMPT if [ -n "$INPUT" ]; then echo "Set up a review session for: $INPUT" else echo "Set up a general review session. Ask the user what subject or card set they want to review." fi ;; quiz) cat << 'PROMPT' You are a quiz master using flashcard content. Create an interactive quiz from flashcards. ## Quiz Modes 1. **Multiple Choice** — Show front, provide 4 options (1 correct + 3 distractors) 2. **Fill in the Blank** — Remove key term, user fills it in 3. **True/False** — Make statements, some correct, some with subtle errors 4. **Matching** — Match fronts to backs 5. **Free Recall** — Show front, user types answer freely ## Output Format ### 🎯 Flashcard Quiz **Topic:** [Subject] **Questions:** [N] **Mode:** [Quiz type] --- **Q1.** [Question] - A) [Option] - B) [Option] - C) [Option] - D) [Option] **Q2.** [Question] Fill in: ___________ [Continue for all questions] --- ### Answer Key **Q1.** [Correct answer] — [Brief explanation] **Q2.** [Correct answer] — [Brief explanation] ### Score Summary Provide scoring guide: [Correct]/[Total] = [Percentage] ## Task PROMPT if [ -n "$INPUT" ]; then echo "Generate a quiz for: $INPUT" echo "Default: 10 questions, mixed question types, medium difficulty." else echo "The user wants a quiz. Ask them: what topic? How many questions? What question types?" fi ;; export) cat << 'PROMPT' You are a flashcard export specialist. Convert flashcards to different formats. ## Supported Export Formats ### 1. Markdown (.md) ```markdown ## [Topic] Flashcards ### Card 1 **Q:** [Front] **A:** [Back] --- ``` ### 2. Anki TSV (Tab-Separated Values) - Format: front[TAB]back[TAB]tags - One card per line - Ready for Anki import (File → Import) - Include header comment: #separator:tab ``` #separator:tab #html:false #tags column:3 [Front] [Back] [tag1 tag2] ``` ### 3. CSV Format ``` "front","back","category","difficulty" "Question 1","Answer 1","Topic","medium" ``` ### 4. Quizlet Import Format - Front and back separated by TAB - Cards separated by newline ## Task PROMPT if [ -n "$INPUT" ]; then echo "Export flashcards: $INPUT" echo "Detect the desired format from input. Default to Anki TSV if not specified." else echo "The user wants to export flashcards. Ask: what topic/cards? What format (Markdown/Anki/CSV/Quizlet)?" fi ;; spaced) cat << 'PROMPT' You are a spaced repetition schedule planner. Create an optimal review schedule. ## Spaced Repetition Algorithm (SM-2 Based) ### Default Intervals - Day 1: Learn new cards - Day 2: First review (1 day after) - Day 4: Second review (2 days after) - Day 7: Third review (3 days after) - Day 15: Fourth review (8 days after) - Day 30: Fifth review (15 days after) - Day 60: Sixth review (30 days after) ### Adjustment Factors - Easy material: intervals × 1.3 - Hard material: intervals × 0.7 - Mixed: use default intervals ## Output Format ### 📅 Spaced Repetition Plan **Topic:** [Subject] **Total Cards:** [N] **Duration:** [Days] **Daily New Cards:** [N] | Day | Date | New Cards | Review Cards | Total Study | Est. Time | |-----|------|-----------|--------------|-------------|-----------| | 1 | ... | 20 | 0 | 20 | 15 min | | 2 | ... | 20 | 20 | 40 | 25 min | | ... | ... | ... | ... | ... | ... | ### Weekly Summary - Week 1: [Cards learned] / [Cards reviewed] / [Est. hours] - Week 2: ... ### Tips - Best review times: morning (9-11am) or evening (7-9pm) - Review before bed for better consolidation - Never skip a scheduled review day ## Task PROMPT if [ -n "$INPUT" ]; then echo "Create a spaced repetition plan for: $INPUT" else echo "The user wants a spaced repetition schedule. Ask: what topic? How many cards? How many days?" fi ;; stats) cat << 'PROMPT' You are a learning analytics expert. Analyze flashcard study statistics and provide insights. ## Metrics to Track & Report ### Session Stats - Cards studied today - New cards learned - Cards reviewed - Average recall rate - Study time estimate ### Progress Stats - Total cards in deck - Cards mastered (interval > 30 days) - Cards learning (interval 1-30 days) - Cards new (not yet studied) - Overall completion percentage ### Performance Analysis - Strongest categories (highest recall rate) - Weakest categories (lowest recall rate, most "Again" ratings) - Improvement trend over time - Predicted mastery date ## Output Format ### 📊 Learning Statistics Report #### Overview | Metric | Value | |--------|-------| | Total Cards | [N] | | Mastered | [N] ([%]) | | Learning | [N] ([%]) | | New | [N] ([%]) | | Avg Recall Rate | [%] | #### Performance by Category | Category | Cards | Mastered | Recall Rate | Status | |----------|-------|----------|-------------|--------| | [Cat 1] | [N] | [N] | [%] | 🟢/🟡/🔴 | #### Recommendations 1. Focus on: [weakest category] 2. Review schedule: [suggestion] 3. Daily goal: [cards per day to finish by target] #### Streak & Motivation 🔥 Study streak: [N] days 📈 This week vs last week: [comparison] ## Task PROMPT if [ -n "$INPUT" ]; then echo "Generate learning statistics for: $INPUT" else echo "The user wants learning stats. Generate a sample report template and ask what specific data they want to analyze." fi ;; help|*) cat << 'HELP' ╔══════════════════════════════════════════════╗ ║ 📇 Flashcard Learning System ║ ╠══════════════════════════════════════════════╣ ║ ║ ║ Commands: ║ ║ create — 创建闪卡 ║ ║ review — 复习闪卡(间隔复习) ║ ║ quiz — 测验模式 ║ ║ export — 导出(Markdown/Anki/CSV) ║ ║ spaced — 间隔复习计划 ║ ║ stats — 学习统计分析 ║ ║ ║ ║ Usage: ║ ║ bash flash.sh create "Python基础 10张" ║ ║ bash flash.sh review "Day 3" ║ ║ bash flash.sh quiz "随机20题" ║ ║ bash flash.sh export "Anki格式" ║ ║ bash flash.sh spaced "30天计划" ║ ║ bash flash.sh stats "本周报告" ║ ║ ║ ╚══════════════════════════════════════════════╝ Powered by BytesAgain | bytesagain.com | [email protected] HELP ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # flashcard - Learning and study assistant set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/flashcard}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF flashcard v$VERSION Learning and study assistant Usage: flashcard <command> [args] Commands: learn Start learning quiz Quick quiz flashcard Flashcards review Review session progress Track progress roadmap Learning roadmap resource Find resources note Take note summary Topic summary test Self test help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_learn() { echo " Topic: $1 Estimated: -1 hour" _log "learn" "-" } cmd_quiz() { echo " Q1: What is $1? Q2: How does $1 work? Q3: When to use $1?" _log "quiz" "-" } cmd_flashcard() { echo " Front: $1 Back: [answer] Saved to $DATA_DIR" _log "flashcard" "-" } cmd_review() { echo " Review: spaced repetition (1d, 3d, 7d, 14d, 30d)" _log "review" "-" } cmd_progress() { echo " Sessions: $(wc -l < "$DB" 2>/dev/null || echo 0)" _log "progress" "-" } cmd_roadmap() { echo " 1. Basics (week 1-2) 2. Practice (week 3-4) 3. Projects (week 5+)" _log "roadmap" "-" } cmd_resource() { echo " Books | Videos | Courses | Practice sites" _log "resource" "-" } cmd_note() { echo "$(date) | $*" >> "$DB"; echo " Noted: $*" _log "note" "-" } cmd_summary() { echo " Summary of: $1" _log "summary" "-" } cmd_test() { echo " Testing knowledge of: $1" _log "test" "-" } case "-help" in learn) shift; cmd_learn "$@" ;; quiz) shift; cmd_quiz "$@" ;; flashcard) shift; cmd_flashcard "$@" ;; review) shift; cmd_review "$@" ;; progress) shift; cmd_progress "$@" ;; roadmap) shift; cmd_roadmap "$@" ;; resource) shift; cmd_resource "$@" ;; note) shift; cmd_note "$@" ;; summary) shift; cmd_summary "$@" ;; test) shift; cmd_test "$@" ;; help|-h) show_help ;; version|-v) echo "flashcard v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Flashcard Tips ## 使用技巧 1. **创建闪卡时**:指定主题和数量,如"Python基础 10张",AI会生成正反面内容 2. **复习模式**:基于艾宾浩斯遗忘曲线安排复习时间 3. **测验模式**:随机打乱顺序,支持选择题和填空题 4. **导出格式**: - Markdown:适合笔记软件(Obsidian、Notion) - Anki:生成TSV格式,直接导入Anki 5. **间隔复习**:自动计算下次复习时间(1天→3天→7天→15天→30天) 6. **学习统计**:追踪正确率、复习次数、薄弱知识点 ## 最佳实践 - 每张闪卡只包含一个知识点 - 正面用问题,反面用答案 - 定期导出备份 - 结合测验模式检验学习效果
笔记整理助手。康奈尔笔记法、卡片盒笔记(Zettelkasten)、思维导图笔记、会议笔记、课堂笔记、笔记整理。Note-taking with Cornell method, Zettelkasten, mind maps, meeting notes, lecture notes.
--- version: "2.0.0" name: note-taker description: "笔记整理助手。康奈尔笔记法、卡片盒笔记(Zettelkasten)、思维导图笔记、会议笔记、课堂笔记、笔记整理。Note-taking with Cornell method, Zettelkasten, mind maps, meeting notes, lecture notes." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Note-Taker A productivity and task management tool. Add items, manage a to-do list, set priorities, track daily and weekly views, set reminders, view statistics, clear completed tasks, and export data — all from the command line with persistent local storage. ## Commands ### Task Management | Command | Description | Usage | |---------|-------------|-------| | `add` | Add a new item to your task list | `note-taker add <text>` | | `list` | List all current items | `note-taker list` | | `done` | Mark an item as completed | `note-taker done <item>` | | `priority` | Set priority level for an item | `note-taker priority <item> <level>` | | `clear` | Clear all completed items from the list | `note-taker clear` | ### Views & Planning | Command | Description | Usage | |---------|-------------|-------| | `today` | Show today's items and schedule | `note-taker today` | | `week` | Show the weekly overview | `note-taker week` | | `remind` | Set a reminder for an item | `note-taker remind <item> <time>` | ### Data & Management | Command | Description | Usage | |---------|-------------|-------| | `stats` | Show total item count and statistics | `note-taker stats` | | `export` | Export all data to stdout | `note-taker export` | | `help` | Show the built-in help message | `note-taker help` | | `version` | Print the current version (v2.0.0) | `note-taker version` | ## How It Works - **`add`** appends a date-stamped line to the data file and confirms with "Added: ..." - **`list`** prints all items from the data file, or "(empty)" if nothing exists yet - **`done`** marks a given item as completed and logs the action - **`priority`** assigns a priority level (default: medium) to the specified item - **`today`** filters the data file for today's date and displays matching items - **`week`** shows a weekly overview of scheduled items - **`remind`** sets a reminder for an item at a specified time (default: tomorrow) - **`stats`** prints the total line count from the data file - **`clear`** removes completed items from the active list - **`export`** dumps the entire data file contents to stdout ## Data Storage All data is stored locally in `~/.local/share/note-taker/`: - **`data.log`** — the main data file containing all items (one per line, date-prefixed) - **`history.log`** — tracks all command activity with timestamps - Entries in data.log are formatted as `YYYY-MM-DD <content>` - Set `NOTE_TAKER_DIR` environment variable to change the data directory - Also respects `XDG_DATA_HOME` if set (defaults to `~/.local/share`) ## Requirements - Bash (any modern version) - No external dependencies — pure shell script - Works on Linux and macOS - Standard Unix utilities: `date`, `wc`, `grep`, `cat` ## When to Use 1. **Daily task tracking** — use `add` to capture tasks throughout the day, `today` to see what's on your plate, and `done` to check off completed work 2. **Weekly planning sessions** — use `week` for an overview, `priority` to rank what matters most, and `remind` for upcoming deadlines 3. **Quick capture from terminal** — when you're already in the terminal and want to jot something down without switching apps, `add` is instant 4. **Reviewing progress** — use `list` to see everything, `stats` for totals, and `export` to pipe data into other tools for analysis 5. **Maintaining a clean list** — use `clear` to remove completed items and keep your active list focused on what still needs attention ## Examples ```bash # Add a new task note-taker add "Review pull request for auth module" # Add another task note-taker add "Prepare slides for Friday meeting" # List all tasks note-taker list # Mark a task as done note-taker done "Review pull request for auth module" # Set priority on a task note-taker priority "Prepare slides for Friday meeting" high # See what's on for today note-taker today # Set a reminder note-taker remind "Submit expense report" "Friday 5pm" # View statistics note-taker stats # Export all data for backup note-taker export > backup.txt ``` ## Output Commands print concise confirmations to stdout. `list` and `export` output the full data file. `stats` shows a total count. All actions are also logged to `history.log` for auditing. Redirect output with standard shell operators: `note-taker list > tasks.txt`. ## Configuration | Variable | Description | Default | |----------|-------------|---------| | `NOTE_TAKER_DIR` | Override the data directory path | `~/.local/share/note-taker` | | `XDG_DATA_HOME` | XDG base directory (used if `NOTE_TAKER_DIR` is not set) | `~/.local/share` | --- Powered by BytesAgain | bytesagain.com | [email protected] FILE:scripts/note.sh #!/usr/bin/env bash # note.sh — 笔记整理助手 # Usage: bash note.sh <command> [args...] set -euo pipefail CMD="-help" shift 2>/dev/null || true show_help() { cat <<'HELP' Note Taker 📝 — 笔记整理助手 用法: bash note.sh <command> [args...] 命令: cornell 康奈尔笔记法模板 zettel 卡片盒笔记(Zettelkasten) mindmap 文字版思维导图 meeting 结构化会议笔记 lecture 课堂/讲座笔记 organize 笔记整理和优化 示例: bash note.sh cornell bash note.sh mindmap bash note.sh meeting Powered by BytesAgain | bytesagain.com | [email protected] HELP } cmd_cornell() { cat <<'EOF' ## 📓 康奈尔笔记法 (Cornell Notes) 请AI将内容整理为康奈尔笔记格式: ### 输入信息 - **主题**: [用户提供] - **来源**: [课堂/书籍/讲座/视频] - **原始内容/要点**: [用户提供] ### 康奈尔笔记模板 ```markdown # 📓 康奈尔笔记: [主题] 📅 日期: [日期] 📖 来源: [来源] 🏷️ 标签: #[标签1] #[标签2] ┌─────────────────────────────────────────┐ │ 线索栏 (Cue) │ 笔记栏 (Notes) │ │ (课后填写) │ (课中记录) │ ├──────────────────┼──────────────────────┤ │ │ │ │ ❓ [关键问题1] │ • [要点1] │ │ │ - [细节a] │ │ │ - [细节b] │ │ │ │ │ ❓ [关键问题2] │ • [要点2] │ │ │ - [细节a] │ │ │ - [例子] │ │ │ │ │ 💡 [关键概念1] │ • [要点3] │ │ │ - [细节a] │ │ │ - [公式/定义] │ │ │ │ │ 🔗 [关联知识] │ • [要点4] │ │ │ - [细节] │ │ │ │ ├──────────────────┴──────────────────────┤ │ 总结 (Summary) — 用自己的话概括 │ │ │ │ [2-3句话总结本页核心内容] │ │ [这部分内容与___的关系是___] │ │ [我还想了解___] │ └─────────────────────────────────────────┘ ``` ### 使用步骤 1. **课中**: 在笔记栏速记要点 2. **课后24h**: 填写线索栏(关键词/问题) 3. **课后24h**: 写底部总结(不看笔记尝试) 4. **复习时**: 遮住右侧,看线索回忆内容 EOF } cmd_zettel() { cat <<'EOF' ## 🗃️ 卡片盒笔记 (Zettelkasten) 请AI将内容转化为Zettelkasten卡片: ### 输入信息 - **原始内容**: [用户提供] - **来源**: [书籍/文章/想法/对话] ### 卡片类型 #### 📖 文献笔记 (Literature Note) ```markdown --- id: L-[YYYYMMDD]-[序号] type: literature source: "[作者]. [书名/文章]. [年份]" created: [日期] tags: [#标签1, #标签2] --- ## 原文要点 > "[原文引用]" (p.XX) ## 我的理解 [用自己的话重述,不要抄原文] ## 关联 - 支持: [[卡片ID]] — [为什么关联] - 反驳: [[卡片ID]] — [为什么矛盾] - 延伸: [[卡片ID]] — [如何拓展] ``` #### 💡 永久笔记 (Permanent Note) ```markdown --- id: P-[YYYYMMDD]-[序号] type: permanent created: [日期] tags: [#标签1, #标签2] links: [相关卡片ID列表] --- ## [一句话标题——概括核心想法] [用完整的句子表达一个独立想法] [这个想法应该脱离原文也能理解] ## 论据/支撑 - [来自 L-xxx: ...] - [来自 L-yyy: ...] - [个人经验: ...] ## 应用场景 - [何时可以用这个想法] ## 关联卡片 - [[P-xxx]] — [关系说明] - [[P-yyy]] — [关系说明] ``` #### 📋 项目笔记 (Project Note) ```markdown --- id: PJ-[项目名]-[序号] type: project project: [项目名称] created: [日期] status: [进行中/已完成] --- ## 项目: [名称] ### 相关永久笔记 - [[P-xxx]]: [如何应用] - [[P-yyy]]: [如何应用] ### 待办 - [ ] ___ - [ ] ___ ### 进展记录 - [日期]: [进展] ``` ### Zettelkasten原则 1. 每张卡片只写**一个想法** 2. 用**自己的话**写,不抄原文 3. 建立**链接**比分类更重要 4. 定期**漫游**卡片发现新连接 5. 从**文献笔记**提炼**永久笔记** EOF } cmd_mindmap() { cat <<'EOF' ## 🧠 思维导图 (文字版) 请AI将内容整理为文字版思维导图: ### 输入信息 - **中心主题**: [用户提供] - **深度**: [2-4层] ### 思维导图模板 ``` 🧠 [中心主题] │ ┌────────────────┼────────────────┐ │ │ │ 📌 [分支1] 📌 [分支2] 📌 [分支3] │ │ │ ┌────┼────┐ ┌────┼────┐ ┌────┼────┐ │ │ │ │ │ │ │ │ │ [1.1][1.2][1.3] [2.1][2.2][2.3] [3.1][3.2][3.3] ``` ### 缩进版(更适合Markdown) ```markdown # 🧠 [中心主题] ## 📌 [分支1: ___] - [子话题1.1] - [细节a] - [细节b] - [子话题1.2] - [细节a] - [子话题1.3] ## 📌 [分支2: ___] - [子话题2.1] - [细节a] - [细节b] - [子话题2.2] - [子话题2.3] ## 📌 [分支3: ___] - [子话题3.1] - [子话题3.2] - [子话题3.3] ## 🔗 交叉关联 - [分支1.2] ↔ [分支3.1]: [关系说明] - [分支2.3] → [分支1.1]: [关系说明] ``` ### 思维导图原则 1. 中心主题用**一个词/短语** 2. 一级分支控制在**3-7个** 3. 每个节点用**关键词**(不用完整句子) 4. 加**图标/颜色标签**区分类别 5. 从**整体到细节**展开 EOF } cmd_meeting() { cat <<'EOF' ## 🤝 会议笔记模板 请AI整理会议内容: ### 输入信息 - **会议主题**: [用户提供] - **参与者**: [用户提供] - **会议内容**: [用户提供/录音转文字] ### 会议笔记模板 ```markdown # 🤝 会议纪要: [主题] 📅 日期: [日期] [时间] 📍 地点: [线上/线下+地点] 👥 参与人: [列表] 📝 记录人: [姓名] --- ## 📋 会议议题 ### 1. [议题一] **讨论内容:** - [观点/意见1] — [提出人] - [观点/意见2] — [提出人] - [观点/意见3] — [提出人] **结论:** [最终决定/共识] ### 2. [议题二] **讨论内容:** - ... **结论:** [最终决定/共识] --- ## ✅ 行动项 (Action Items) | 序号 | 任务 | 负责人 | 截止日期 | 状态 | |------|------|--------|----------|------| | 1 | [具体任务] | [姓名] | [日期] | ⬜ 待开始 | | 2 | [具体任务] | [姓名] | [日期] | ⬜ 待开始 | | 3 | [具体任务] | [姓名] | [日期] | ⬜ 待开始 | ## ❓ 遗留问题 - [问题1] — 待[谁]确认 - [问题2] — 下次会议讨论 ## 📅 下次会议 - 时间: [日期时间] - 议题: [预定主题] --- 发送给: [相关人员列表] ``` EOF } cmd_lecture() { cat <<'EOF' ## 🎓 课堂/讲座笔记 请AI整理课堂或讲座内容: ### 输入信息 - **课程/讲座名**: [用户提供] - **讲师**: [用户提供] - **内容**: [用户提供/录音转文字] ### 课堂笔记模板 ```markdown # 🎓 课堂笔记: [课程名] 📅 日期: [日期] 第[X]课 👨🏫 讲师: [姓名] 📖 章节: [第X章 章节名] 🏷️ 标签: #[科目] #[主题] --- ## 📝 课程大纲 1. [主题1] 2. [主题2] 3. [主题3] ## 📖 知识点 ### 知识点1: [标题] **定义**: [精确定义] **解释**: [用自己的话] **例子**: - [例子1] - [例子2] **公式/模型** (如适用): > [公式或模型描述] ⚠️ **易错点**: [常见误区] --- ### 知识点2: [标题] **定义**: ... **解释**: ... **例子**: ... --- ## 💡 课堂亮点 - [老师强调的重点1] - [有趣的案例/故事] - [补充的课外知识] ## ❓ 我的疑问 1. [还没理解的部分] 2. [想进一步了解的] ## 🔗 关联知识 - 与[前面课程/其他科目]的联系: ... ## 📚 课后任务 - [ ] [作业1] - [ ] [复习章节: pp.XX-XX] - [ ] [预习下节: 第X章] ## ✍️ 总结 (用3句话概括) 1. ___ 2. ___ 3. ___ --- ⏰ 复习计划: 今晚/3天后/7天后/30天后 ``` EOF } cmd_organize() { cat <<'EOF' ## 🗂️ 笔记整理工具 请AI帮助整理和优化现有笔记: ### 输入信息 - **原始笔记**: [用户粘贴] - **整理目标**: [结构化/精简/扩展/分类/链接] ### 整理服务菜单 #### 1. 结构化整理 将零散笔记整理为清晰结构: - 提取核心主题 - 按逻辑分组 - 添加层级标题 - 补充过渡语 #### 2. 精简压缩 将冗长笔记精简为要点: - 删除重复内容 - 提炼关键词 - 缩减为原文1/3 - 保留核心信息 #### 3. 扩展补充 在现有笔记基础上扩展: - 补充解释 - 添加例子 - 关联知识 - 补充背景 #### 4. 分类打标 为笔记添加分类标签: ```markdown 🏷️ 标签建议: - 主题: #[主题标签] - 类型: #笔记 / #想法 / #待办 / #参考 - 状态: #进行中 / #已完成 / #待复习 - 优先级: #重要 / #普通 - 来源: #书籍 / #课程 / #会议 / #灵感 ``` #### 5. 链接发现 在笔记之间发现关联: ``` 笔记A ↔ 笔记B: [共同主题/互补观点] 笔记C → 笔记D: [因果关系/发展顺序] 笔记E ≠ 笔记F: [矛盾观点/需要调和] ``` ### 整理原则 1. **保留原意**: 不改变作者的核心想法 2. **增加可找性**: 让笔记容易被搜索到 3. **建立连接**: 孤立的笔记没有价值 4. **定期复习**: 整理的目的是为了复习 5. **输出导向**: 笔记最终要服务于行动/创作 EOF } case "$CMD" in cornell) cmd_cornell ;; zettel) cmd_zettel ;; mindmap) cmd_mindmap ;; meeting) cmd_meeting ;; lecture) cmd_lecture ;; organize) cmd_organize ;; help|--help|-h) show_help ;; *) echo "❌ 未知命令: $CMD" echo "" show_help exit 1 ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # note-taker - Productivity and task management tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/note-taker}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF note-taker v$VERSION Productivity and task management tool Usage: note-taker <command> [args] Commands: add Add item list List items done Mark done priority Set priority today Today view week Week view remind Set reminder stats Statistics clear Clear completed export Export help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_done() { echo " Completed: $1" _log "done" "-" } cmd_priority() { echo " $1 -> priority: -medium" _log "priority" "-" } cmd_today() { echo " Today $(date +%Y-%m-%d):"; grep "$(date +%Y-%m-%d)" "$DB" 2>/dev/null || echo " Nothing scheduled" _log "today" "-" } cmd_week() { echo " This week overview" _log "week" "-" } cmd_remind() { echo " Reminder: $1 at -tomorrow" _log "remind" "-" } cmd_stats() { echo " Total: $(wc -l < "$DB" 2>/dev/null || echo 0)" _log "stats" "-" } cmd_clear() { echo " Cleared completed items" _log "clear" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } case "-help" in add) shift; cmd_add "$@" ;; list) shift; cmd_list "$@" ;; done) shift; cmd_done "$@" ;; priority) shift; cmd_priority "$@" ;; today) shift; cmd_today "$@" ;; week) shift; cmd_week "$@" ;; remind) shift; cmd_remind "$@" ;; stats) shift; cmd_stats "$@" ;; clear) shift; cmd_clear "$@" ;; export) shift; cmd_export "$@" ;; help|-h) show_help ;; version|-v) echo "note-taker v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Note Taker Tips 📝 ## 笔记方法论速查 ### 康奈尔笔记法 (Cornell) - 页面分3区: 右侧(笔记)、左侧(线索)、底部(总结) - 课后24小时内完成线索栏和总结 - 复习时遮住右侧,用线索回忆 ### 卡片盒笔记法 (Zettelkasten) - 每张卡片只写一个想法 - 用唯一ID编号 - 建立卡片间的链接 - 分类: 文献笔记→永久笔记→项目笔记 ### 思维导图 - 中心主题放中间 - 一级分支3-7个 - 用关键词而非句子 - 加图标和颜色区分 ### 高效笔记原则 1. **不要逐字抄**: 用自己的话 2. **用缩写符号**: →(导致) ∵(因为) ∴(所以) 3. **留空白**: 方便后续补充 4. **及时复习**: 24h/3d/7d/30d 5. **数字化**: 方便搜索和链接 ## 常用符号系统 | 符号 | 含义 | |------|------| | ⭐ | 重要 | | ❓ | 疑问 | | 💡 | 灵感 | | ⚠️ | 注意 | | 📎 | 参考资料 | | ✅ | 待办/已完成 | | → | 导致/引向 | | ↔ | 相互关联 |
Guided meditation with breathing exercises and session tracking. Use when practicing mindfulness.
--- name: "meditation-guide" version: "3.0.0" description: "Guided meditation with breathing exercises and session tracking. Use when practicing mindfulness." author: "BytesAgain" homepage: "https://bytesagain.com" --- # meditation-guide Guided meditation with breathing exercises and session tracking. Use when practicing mindfulness. ## Commands ### `breathe` ```bash scripts/script.sh breathe <pattern> ``` ### `timer` ```bash scripts/script.sh timer <minutes> ``` ### `guide` ```bash scripts/script.sh guide <type> ``` ### `history` ```bash scripts/script.sh history ``` ### `streak` ```bash scripts/script.sh streak ``` ### `start` ```bash scripts/script.sh start <minutes> ``` ## Data Storage Data stored in `~/.local/share/meditation-guide/`. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/meditate.sh #!/usr/bin/env bash # meditation-guide — 冥想与正念工具 set -euo pipefail CMD="-help"; shift 2>/dev/null || true; INPUT="$*" run_python() { python3 << 'PYEOF' import sys, time, hashlib, math from datetime import datetime cmd = sys.argv[1] if len(sys.argv) > 1 else "help" inp = " ".join(sys.argv[2:]) if len(sys.argv) > 2 else "" BREATHING = { "478": {"name": "4-7-8 Breathing", "desc": "Calming technique", "inhale": 4, "hold": 7, "exhale": 8, "cycles": 4}, "box": {"name": "Box Breathing", "desc": "Focus & calm", "inhale": 4, "hold": 4, "exhale": 4, "hold2": 4, "cycles": 4}, "energize": {"name": "Energizing Breath", "desc": "Quick energy boost", "inhale": 2, "hold": 0, "exhale": 2, "cycles": 10}, "relaxing": {"name": "Deep Relaxation", "desc": "Before sleep", "inhale": 5, "hold": 3, "exhale": 7, "cycles": 6}, "wim-hof": {"name": "Wim Hof Method", "desc": "30 power breaths + hold", "inhale": 2, "hold": 0, "exhale": 2, "cycles": 30}, } MEDITATIONS = { "body-scan": {"duration": 10, "steps": [ "Close your eyes. Take 3 deep breaths.", "Focus on the top of your head. Notice any tension.", "Move attention to your forehead, eyebrows, eyes. Relax.", "Jaw, neck, shoulders. Let tension melt away.", "Arms, hands, fingers. Feel warmth spreading.", "Chest, belly. Notice your breathing rhythm.", "Lower back, hips. Release any tightness.", "Thighs, knees, calves. Feel grounded.", "Feet, toes. Feel connected to the earth.", "Whole body. Sit with this feeling of completeness.", ]}, "mindfulness": {"duration": 5, "steps": [ "Sit comfortably. Close your eyes.", "Focus on your breath. In... Out...", "When thoughts arise, notice them without judgment.", "Label them: thinking, planning, remembering...", "Gently return focus to your breath.", "Notice sounds around you. Accept them.", "Feel the air on your skin.", "Return to breath. In... Out...", ]}, "gratitude": {"duration": 5, "steps": [ "Close your eyes. Take 3 deep breaths.", "Think of one person you are grateful for.", "Feel the warmth of that gratitude.", "Think of one thing that happened today you appreciate.", "Think of one ability you have that you are thankful for.", "Hold all three gratitudes together.", "Send silent thanks to each one.", "Open your eyes. Carry this feeling forward.", ]}, "focus": {"duration": 8, "steps": [ "Sit upright. Close your eyes.", "Choose one word or phrase as your anchor.", "Breathe in deeply. On exhale, silently repeat your word.", "If mind wanders, notice, and return to your word.", "Continue for 3 minutes.", "Now shift: count breaths from 1 to 10.", "If you lose count, start over at 1.", "This trains single-pointed concentration.", ]}, } PROMPTS = [ "What am I feeling right now, without judging it?", "What would I do today if fear were not a factor?", "Name three things I can see, hear, and feel right now.", "What am I holding onto that I can release?", "How can I show kindness to myself today?", "What lesson is this difficult moment teaching me?", "If my body could speak, what would it say?", "What brings me peace? How can I create more of it?", "Am I living according to my values today?", "What would my wisest self advise me right now?", "What am I grateful for that I usually overlook?", "How does my breathing feel right now?", ] def cmd_breathe(): pattern = inp.strip().lower() if inp else "478" if pattern not in BREATHING: print("Available: {}".format(", ".join(BREATHING.keys()))) return b = BREATHING[pattern] print("=" * 45) print(" {} ".format(b["name"])) print(" {}".format(b["desc"])) print("=" * 45) print("") total_time = 0 for c in range(1, b["cycles"] + 1): line = " Cycle {}: ".format(c) line += "INHALE({}s)".format(b["inhale"]) total_time += b["inhale"] if b.get("hold", 0) > 0: line += " > HOLD({}s)".format(b["hold"]) total_time += b["hold"] line += " > EXHALE({}s)".format(b["exhale"]) total_time += b["exhale"] if b.get("hold2", 0): line += " > HOLD({}s)".format(b["hold2"]) total_time += b["hold2"] print(line) print("") print(" Total time: ~{}s ({:.1f} min)".format(total_time, total_time/60)) print(" Tip: Set a timer and follow the rhythm") def cmd_meditate(): mtype = inp.strip().lower() if inp else "mindfulness" if mtype not in MEDITATIONS: print("Available: {}".format(", ".join(MEDITATIONS.keys()))) return m = MEDITATIONS[mtype] print("=" * 50) print(" {} Meditation (~{} min)".format(mtype.replace("-", " ").title(), m["duration"])) print("=" * 50) print("") interval = m["duration"] * 60 // len(m["steps"]) for i, step in enumerate(m["steps"], 1): mins = i * interval // 60 secs = i * interval % 60 print(" [{:02d}:{:02d}] Step {}: {}".format(mins, secs, i, step)) print("") print(" Set a timer for {} minutes.".format(m["duration"])) print(" Ring a bell/chime at the end.") def cmd_journal(): seed = int(hashlib.md5(datetime.now().strftime("%Y%m%d").encode()).hexdigest()[:8], 16) idx1 = seed % len(PROMPTS) idx2 = (seed + 7) % len(PROMPTS) idx3 = (seed + 13) % len(PROMPTS) print("=" * 50) print(" Mindfulness Journal — {}".format(datetime.now().strftime("%Y-%m-%d"))) print("=" * 50) print("") print(" Today's Prompts:") print("") print(" 1. {}".format(PROMPTS[idx1])) print("") print(" 2. {}".format(PROMPTS[idx2])) print("") print(" 3. {}".format(PROMPTS[idx3])) print("") print(" Take 5-10 minutes to reflect and write freely.") print(" No right or wrong answers.") def cmd_timer(): minutes = int(inp) if inp and inp.isdigit() else 5 total = minutes * 60 print("=" * 40) print(" Meditation Timer: {} minutes".format(minutes)) print("=" * 40) print("") print(" Start: {}".format(datetime.now().strftime("%H:%M:%S"))) end = datetime.now() end_time = end.replace(second=end.second + total) if total < 60 else end print(" Suggested schedule:") intervals = [0, total//4, total//2, total*3//4, total] labels = ["Begin", "Quarter", "Halfway", "Three-quarter", "End - ring bell"] for t, l in zip(intervals, labels): m = t // 60 s = t % 60 print(" {:02d}:{:02d} — {}".format(m, s, l)) def cmd_streak(): print("=" * 45) print(" Meditation Streak Tracker") print("=" * 45) print("") print(" Track your daily practice:") print("") now = datetime.now() for i in range(7): d = now.replace(day=now.day - i) if now.day - i > 0 else now day_str = d.strftime("%a %m/%d") print(" {} [ ] ___ minutes Type: ___".format(day_str)) print("") print(" Weekly Goal: 5+ sessions") print(" Monthly Goal: 20+ sessions") print(" Tips: Start with 5min, build to 20min") commands = { "breathe": cmd_breathe, "meditate": cmd_meditate, "journal": cmd_journal, "timer": cmd_timer, "streak": cmd_streak, } if cmd == "help": print("Meditation & Mindfulness Guide") print("") print("Commands:") print(" breathe [pattern] — Guided breathing (478/box/energize/relaxing/wim-hof)") print(" meditate [type] — Guided meditation (body-scan/mindfulness/gratitude/focus)") print(" journal — Daily mindfulness journal prompts") print(" timer [minutes] — Meditation timer with intervals") print(" streak — Practice streak tracker") elif cmd in commands: commands[cmd]() else: print("Unknown: {}".format(cmd)) print("") print("Powered by BytesAgain | bytesagain.com") PYEOF } run_python "$CMD" $INPUT FILE:scripts/script.sh #!/usr/bin/env bash set -euo pipefail VERSION="3.0.0" SCRIPT_NAME="meditation-guide" DATA_DIR="$HOME/.local/share/meditation-guide" mkdir -p "$DATA_DIR" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Powered by BytesAgain | bytesagain.com | [email protected] _info() { echo "[INFO] $*"; } _error() { echo "[ERROR] $*" >&2; } die() { _error "$@"; exit 1; } cmd_breathe() { local pattern="-" [ -z "$pattern" ] && die "Usage: $SCRIPT_NAME breathe <pattern>" echo 'Breathing (-4-7-8): Inhale 2%%[-_]*s, Hold, Exhale'; echo 'Press Ctrl+C to stop' } cmd_timer() { local minutes="-" [ -z "$minutes" ] && die "Usage: $SCRIPT_NAME timer <minutes>" echo 'Meditation timer: -10 minutes'; echo 'Starting...'; sleep $((-10*60)) 2>/dev/null && echo 'Session complete' } cmd_guide() { local type="-" [ -z "$type" ] && die "Usage: $SCRIPT_NAME guide <type>" case -calm in calm) echo 'Focus on breath. Let thoughts pass like clouds.';; focus) echo 'Choose one point of focus. Return gently when distracted.';; *) echo 'Available: calm, focus, sleep, body-scan';; esac } cmd_history() { cat $DATA_DIR/sessions.jsonl 2>/dev/null | tail -10 } cmd_streak() { echo 'Sessions: '$(wc -l < $DATA_DIR/sessions.jsonl 2>/dev/null || echo 0) } cmd_start() { local minutes="-" [ -z "$minutes" ] && die "Usage: $SCRIPT_NAME start <minutes>" echo '{"duration":'-10',"date":"'$(date +%Y-%m-%d)'"}' >> $DATA_DIR/sessions.jsonl && echo 'Session logged' } cmd_help() { echo "$SCRIPT_NAME v$VERSION" echo "" echo "Commands:" printf " %-25s\n" "breathe <pattern>" printf " %-25s\n" "timer <minutes>" printf " %-25s\n" "guide <type>" printf " %-25s\n" "history" printf " %-25s\n" "streak" printf " %-25s\n" "start <minutes>" printf " %%-25s\n" "help" echo "" echo "Powered by BytesAgain | bytesagain.com | [email protected]" } cmd_version() { echo "$SCRIPT_NAME v$VERSION"; } main() { local cmd="-help" case "$cmd" in breathe) shift; cmd_breathe "$@" ;; timer) shift; cmd_timer "$@" ;; guide) shift; cmd_guide "$@" ;; history) shift; cmd_history "$@" ;; streak) shift; cmd_streak "$@" ;; start) shift; cmd_start "$@" ;; help) cmd_help ;; version) cmd_version ;; *) die "Unknown: $cmd" ;; esac } main "$@" FILE:tips.md # Meditation Guide - tips.md ## Quick Reference
First aid reference guide with emergency procedures and kit checklists. Use when looking up first aid instructions.
--- name: "first-aid" version: "3.0.0" description: "First aid reference guide with emergency procedures and kit checklists. Use when looking up first aid instructions." author: "BytesAgain" homepage: "https://bytesagain.com" --- # first-aid First aid reference guide with emergency procedures and kit checklists. Use when looking up first aid instructions. ## Commands ### `guide` ```bash scripts/script.sh guide <condition> ``` ### `emergency` ```bash scripts/script.sh emergency ``` ### `kit` ```bash scripts/script.sh kit ``` ### `list` ```bash scripts/script.sh list ``` ### `search` ```bash scripts/script.sh search <keyword> ``` ### `quiz` ```bash scripts/script.sh quiz ``` ## Data Storage Data stored in `~/.local/share/first-aid/`. --- *Powered by BytesAgain | bytesagain.com | [email protected]* FILE:scripts/script.sh #!/usr/bin/env bash set -euo pipefail VERSION="3.0.0" SCRIPT_NAME="first-aid" DATA_DIR="$HOME/.local/share/first-aid" mkdir -p "$DATA_DIR" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Powered by BytesAgain | bytesagain.com | [email protected] _info() { echo "[INFO] $*"; } _error() { echo "[ERROR] $*" >&2; } die() { _error "$@"; exit 1; } cmd_guide() { local condition="-" [ -z "$condition" ] && die "Usage: $SCRIPT_NAME guide <condition>" case $2 in burn) echo 'Cool with water 10-20min, cover with sterile dressing';; choking) echo 'Back blows, abdominal thrusts (Heimlich)';; bleeding) echo 'Apply direct pressure, elevate, call 911 if severe';; cpr) echo 'Check response, call 911, 30 compressions : 2 breaths';; *) echo 'Consult medical professional for $2';; esac } cmd_emergency() { echo 'Emergency: 911 (US) / 120 (CN) / 999 (UK) / 112 (EU)' } cmd_kit() { echo 'First Aid Kit: bandages, gauze, tape, antiseptic, scissors, gloves, CPR mask, aspirin' } cmd_list() { echo 'Topics: burn, choking, bleeding, cpr, fracture, poison, shock, heatstroke' } cmd_search() { local keyword="-" [ -z "$keyword" ] && die "Usage: $SCRIPT_NAME search <keyword>" echo 'Searching: $2' } cmd_quiz() { echo 'Q: What is the ratio for CPR compressions to breaths? A: 30:2' } cmd_help() { echo "$SCRIPT_NAME v$VERSION" echo "" echo "Commands:" printf " %-25s\n" "guide <condition>" printf " %-25s\n" "emergency" printf " %-25s\n" "kit" printf " %-25s\n" "list" printf " %-25s\n" "search <keyword>" printf " %-25s\n" "quiz" printf " %%-25s\n" "help" echo "" echo "Powered by BytesAgain | bytesagain.com | [email protected]" } cmd_version() { echo "$SCRIPT_NAME v$VERSION"; } main() { local cmd="-help" case "$cmd" in guide) shift; cmd_guide "$@" ;; emergency) shift; cmd_emergency "$@" ;; kit) shift; cmd_kit "$@" ;; list) shift; cmd_list "$@" ;; search) shift; cmd_search "$@" ;; quiz) shift; cmd_quiz "$@" ;; help) cmd_help ;; version) cmd_version ;; *) die "Unknown: $cmd" ;; esac } main "$@"
产品描述生成器。产品文案撰写、SEO优化、卖点提炼、竞品对比、多语言本地化。Product description writer with SEO, bullet points, comparison.
--- version: "2.0.0" name: product-desc description: "产品描述生成器。产品文案撰写、SEO优化、卖点提炼、竞品对比、多语言本地化。Product description writer with SEO, bullet points, comparison." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # product-desc 产品描述生成器。产品文案撰写、SEO优化、卖点提炼、竞品对比、多语言本地化。Product description writer with SEO, bullet points, comparison, localization. 产品描述、产品文案、卖点、电商文案。Use when writing product descriptions. ## 使用场景 > 💡 无论你是新手还是专业人士,都能快速上手 ## 可用命令 - **write** — write - **optimize** — optimize - **seo** — seo - **bullet** — bullet - **compare** — compare - **localize** — localize ## 专业建议 - 文案撰写 (write)**: 提供产品名+特点,生成吸引人的描述 - 文案优化 (optimize)**: 粘贴现有描述,获得改进建议 - SEO优化 (seo)**: 提供产品和目标关键词,优化搜索排名 - 卖点提炼 (bullet)**: 提炼5-7个核心卖点 - 竞品对比 (compare)**: 突出差异化优势 --- *product-desc by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help product-desc help # Run product-desc run ``` ## Commands Run `product-desc help` to see all available commands. FILE:scripts/desc.sh #!/usr/bin/env bash # Product Desc — 产品描述生成器 # Usage: bash desc.sh <command> [args...] set -euo pipefail CMD="-help" shift 2>/dev/null || true INPUT="$*" case "$CMD" in write) cat <<'PROMPT' ## ✍️ 产品描述撰写 ### 产品描述框架 **1. 一句话卖点 (Hook)** > [用最吸引人的一句话概括产品核心价值] **2. 产品概述 (2-3段)** ``` 第一段:场景+痛点+解决方案 "你是否遇到过[痛点场景]?[产品名]专为[目标用户]设计, 帮你轻松[解决的问题]。" 第二段:核心功能+差异化 "[产品名]采用[技术/材质/工艺],具备[核心功能1]、 [核心功能2]和[核心功能3],[与竞品的差异化优势]。" 第三段:信任背书+行动号召 "已有[数量]用户选择信赖。[限时优惠/赠品/保障], 立即下单,享受[承诺]!" ``` **3. 核心卖点 (Bullet Points)** - ✅ 【卖点1】具体好处 — 支撑数据/细节 - ✅ 【卖点2】具体好处 — 支撑数据/细节 - ✅ 【卖点3】具体好处 — 支撑数据/细节 - ✅ 【卖点4】具体好处 — 支撑数据/细节 - ✅ 【卖点5】具体好处 — 支撑数据/细节 **4. 规格参数** | 参数 | 数值 | |------|------| | 产品名称 | | | 型号 | | | 尺寸 | | | 重量 | | | 材质 | | | 颜色 | | | 包装清单 | | **5. 使用场景** - 🏠 居家场景:... - 💼 办公场景:... - 🏃 户外场景:... - 🎁 送礼场景:... **6. 常见问答 (FAQ)** - Q: [常见问题1]? A: [解答] - Q: [常见问题2]? A: [解答] ### 不同平台风格 | 平台 | 风格特点 | 字数 | |------|----------|------| | 淘宝/天猫 | 活泼、促销感、emoji多 | 500-1000字 | | 京东 | 专业、参数详细 | 800-1500字 | | 拼多多 | 直白、性价比 | 300-500字 | | 亚马逊 | 简洁专业、英文 | 200-400词 | | 独立站 | 品牌故事感 | 300-600词 | PROMPT echo "" echo "📌 输入信息: -请提供产品名称和核心特点" ;; optimize) cat <<'PROMPT' ## 🔧 产品描述优化 ### 优化检查清单 **内容质量** - [ ] 标题包含核心关键词 - [ ] 开头3行能抓住注意力 - [ ] 卖点用"好处"而非"功能"表述 - [ ] 包含具体数字和数据 - [ ] 有使用场景描述 - [ ] 有社会证明(销量/评价/认证) - [ ] 有明确的行动号召(CTA) **SEO检查** - [ ] 标题包含主关键词 - [ ] 描述自然融入长尾关键词 - [ ] 关键词密度2-5% - [ ] 无关键词堆砌 - [ ] 图片有ALT标签 **可读性** - [ ] 段落短小(3-4行) - [ ] 使用项目符号 - [ ] 有小标题分隔 - [ ] 无错别字和语法错误 - [ ] 排版整洁 **说服力** - [ ] 解决了用户痛点 - [ ] 有差异化卖点 - [ ] 价格锚定或价值对比 - [ ] 消除购买顾虑(退换/保修) - [ ] 紧迫感(限时/限量) ### 优化前后对比模板 ``` ❌ 优化前: "我们的耳机音质好" ✅ 优化后: "40mm钛合金振膜,还原98%原声细节,连续播放32小时" ❌ 优化前: "质量很好" ✅ 优化后: "通过10万次折叠测试,3年质保,30天无理由退换" ``` 请提供现有产品描述,我来诊断并优化。 PROMPT echo "" echo "📌 输入信息: -请粘贴需要优化的产品描述" ;; seo) cat <<'PROMPT' ## 🔍 产品SEO优化 ### 关键词策略 **1. 关键词分类** | 类型 | 示例 | 搜索量 | 竞争度 | 转化率 | |------|------|--------|--------|--------| | 核心词 | 蓝牙耳机 | 高 | 高 | 低 | | 长尾词 | 降噪蓝牙耳机跑步用 | 中 | 低 | 高 | | 场景词 | 跑步用的耳机 | 中 | 中 | 高 | | 品牌词 | XX品牌耳机 | 低 | 低 | 最高 | | 属性词 | 无线入耳式耳机 | 中 | 中 | 中 | **2. 标题优化公式** ``` 淘宝: 品牌+核心词+属性1+属性2+场景+长尾词 "[品牌]蓝牙耳机 无线降噪 运动跑步 超长续航入耳式" 亚马逊: 品牌+产品+关键特性+适用场景 "Brand Wireless Earbuds, Active Noise Cancelling, 32H Battery, IPX5" 独立站: 差异化特性+产品名 "Ultra-Light Noise Cancelling Wireless Earbuds" ``` **3. 描述中关键词布局** | 位置 | 优先级 | 建议 | |------|--------|------| | 标题 | ★★★★★ | 包含1-2个核心词 | | 首段 | ★★★★ | 自然融入核心词 | | Bullet | ★★★★ | 每条含1个长尾词 | | 描述正文 | ★★★ | 密度2-5% | | 后台搜索词 | ★★★★ | 补充同义词 | **4. SEO评分表** | 维度 | 权重 | 评分标准 | |------|------|----------| | 关键词覆盖 | 30% | 核心词+长尾词完整度 | | 标题优化 | 25% | 结构、字数、关键词 | | 内容质量 | 20% | 原创性、信息量 | | 用户体验 | 15% | 可读性、结构化 | | 技术规范 | 10% | 图片ALT、meta标签 | PROMPT echo "" echo "📌 输入信息: -请提供产品和目标关键词" ;; bullet) cat <<'PROMPT' ## 🎯 卖点提炼 (Bullet Points) ### Bullet Point 撰写公式 **公式1: Benefit + Feature + Proof** > ✅ 【超长续航】一次充电使用32小时 — 通勤一周不用充电 **公式2: Scenario + Solution** > ✅ 【通勤降噪】地铁嘈杂?ANC主动降噪消除95%环境音 **公式3: Problem + Contrast** > ✅ 【告别缠线】无线蓝牙5.3,10米稳定连接不断线 ### Bullet Point 模板 (5-7条) 1. **核心卖点** — 产品最大差异化优势 > ✅ 【___】___ 2. **技术/品质** — 材质、工艺、认证 > ✅ 【___】___ 3. **便捷/体验** — 使用体验优势 > ✅ 【___】___ 4. **耐用/安全** — 品质保障 > ✅ 【___】___ 5. **适用场景** — 使用场景覆盖 > ✅ 【___】___ 6. **售后保障** — 信任背书 > ✅ 【___】___ ### 不同平台Bullet要求 | 平台 | 数量 | 字数/条 | 格式要求 | |------|------|---------|----------| | 淘宝 | 5-8 | 15-25字 | 【标签】描述 | | 亚马逊 | 5 | 200字符内 | 首字母大写+句子 | | 独立站 | 4-6 | 不限 | ✅/✓ 前缀 | | 京东 | 5-10 | 20-30字 | 数字+效果 | ### 卖点优先级排序 ``` 1. 解决痛点的能力 (最重要) 2. 差异化优势 (你有别人没有) 3. 用户最关心的参数 4. 品质/安全保障 5. 售后/服务承诺 ``` 请提供产品信息,我帮你提炼卖点。 PROMPT echo "" echo "📌 输入信息: -请提供产品名称和特点" ;; compare) cat <<'PROMPT' ## ⚔️ 竞品对比文案 ### 对比表模板 | 维度 | 我们的产品 | 竞品A | 竞品B | |------|-----------|-------|-------| | 价格 | ¥___ | ¥___ | ¥___ | | 核心功能1 | ✅ | ✅ | ❌ | | 核心功能2 | ✅ | ❌ | ✅ | | 核心功能3 | ✅ | ❌ | ❌ | | 材质/品质 | | | | | 售后保障 | | | | | 用户评分 | | | | ### 对比文案策略 **策略1: 直接对比 (适合有明显优势时)** > "同等价位唯一支持XX功能的产品" > "比同类产品轻40%,但续航多50%" **策略2: 类比对比 (适合新品类)** > "如果说XX是SUV,那我们就是跑车" > "XX的品质,XX 1/3 的价格" **策略3: 用户视角对比** > "用过3款同类产品后,我最终选了这款,因为..." > "从XX换到我们产品的用户反馈:..." **策略4: 场景对比** | 场景 | 我们 | 竞品 | |------|------|------| | 日常通勤 | ✅ 降噪+长续航 | ⚠️ 续航不够 | | 运动健身 | ✅ 防水IPX5 | ❌ 不防水 | | 会议通话 | ✅ 双麦降噪 | ⚠️ 通话模糊 | ### 注意事项 ⚠️ 不要诋毁竞品,用事实说话 ⚠️ 对比维度要对消费者有意义 ⚠️ 避免虚假宣传,数据要可验证 ⚠️ 突出"为什么选我们"而非"别人多差" PROMPT echo "" echo "📌 输入信息: -请提供要对比的产品信息" ;; localize) cat <<'PROMPT' ## 🌍 产品描述本地化 ### 本地化不等于翻译 | 维度 | 翻译 | 本地化 | |------|------|--------| | 语言 | 字面翻译 | 符合当地表达习惯 | | 文化 | 直译 | 文化适配 | | 计量 | 保持原单位 | 转换当地单位 | | 货币 | 保持原货币 | 当地货币 | | 节日 | 保持原文 | 当地节日营销 | | 法规 | 忽略 | 符合当地法规标注 | ### 主要市场本地化要点 **🇺🇸 美国市场** - 英寸/磅/华氏度 - 强调价值主张和个人体验 - FDA/FCC认证标注 - 简洁直接,少用花哨修辞 **🇯🇵 日本市场** - 厘米/克/摄氏度 - 敬语表达,详细规格 - 安全认证 (PSE等) - 强调品质和细节 **🇩🇪 德国/欧洲市场** - 公制单位 - CE认证必须 - GDPR合规标注 - 理性风格,技术参数详细 **🇰🇷 韩国市场** - 公制单位 - KC认证 - 美妆/时尚风格化表达 - 社交媒体口碑重要 ### 本地化清单 - [ ] 产品名称本地化 - [ ] 描述文案本地化 - [ ] 计量单位转换 - [ ] 货币转换 - [ ] 法规认证标注 - [ ] 文化敏感词检查 - [ ] 当地SEO关键词研究 - [ ] 本地用户评价收集 - [ ] 售后政策本地化 请提供产品描述和目标市场/语言。 PROMPT echo "" echo "📌 输入信息: -请提供产品描述和目标语言/市场" ;; help|*) cat <<'EOF' Product Desc — 产品描述生成器 Usage: bash desc.sh <command> [args...] Commands: write 文案撰写 — 完整产品描述生成 optimize 文案优化 — 现有描述优化改进 seo SEO优化 — 关键词和搜索优化 bullet 卖点提炼 — Bullet Points生成 compare 竞品对比 — 产品对比文案 localize 多语言 — 本地化翻译和适配 Examples: bash desc.sh write "无线蓝牙耳机" bash desc.sh optimize "现有产品描述文本" bash desc.sh seo "智能手表 运动" bash desc.sh bullet "扫地机器人" bash desc.sh compare "产品A vs 产品B" bash desc.sh localize "产品描述 英语" Powered by BytesAgain | bytesagain.com | [email protected] EOF ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # product-desc - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/product-desc}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF product-desc v$VERSION Multi-purpose utility tool Usage: product-desc <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "product-desc v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # Product Desc — Tips ## 使用建议 1. **文案撰写 (write)**: 提供产品名+特点,生成吸引人的描述 2. **文案优化 (optimize)**: 粘贴现有描述,获得改进建议 3. **SEO优化 (seo)**: 提供产品和目标关键词,优化搜索排名 4. **卖点提炼 (bullet)**: 提炼5-7个核心卖点 5. **竞品对比 (compare)**: 突出差异化优势 6. **多语言 (localize)**: 不只是翻译,是文化适配 ## 最佳实践 - 先讲好处(benefit)再说功能(feature) - 用具体数字增加说服力 - 加入使用场景帮助客户想象 - 针对不同平台调整风格(淘宝/亚马逊/独立站) - A/B测试不同版本,用数据说话
保密协议生成器。双向/单向NDA、员工保密、审查、模板库。NDA generator with mutual, unilateral, employee versions. 保密协议、NDA。
---
version: "2.0.0"
name: NDA Generator
description: "NDA Generator - 保密协议生成器. Use when you need nda generator capabilities. Triggers on: nda generator."
保密协议生成器。双向/单向NDA、员工保密、审查、模板库。NDA generator with mutual, unilateral, employee versions. 保密协议、NDA。
author: BytesAgain
homepage: https://bytesagain.com
source: https://github.com/bytesagain/ai-skills
---
# NDA Generator
保密协议生成器。双向/单向NDA、员工保密、审查、模板库。NDA generator with mutual, unilateral, employee versions. 保密协议、NDA。
## 推荐工作流
```
需求分析 → 选择命令 → 输入描述 → 获取结果 → 调整优化
```
## 可用命令
- **create** — create
- **mutual** — mutual
- **unilateral** — unilateral
- **employee** — employee
- **review** — review
- **template** — template
---
*NDA Generator by BytesAgain*
---
💬 Feedback & Feature Requests: https://bytesagain.com/feedback
Powered by BytesAgain | bytesagain.com
- Run `nda-generator help` for all commands
## Commands
Run `nda-generator help` to see all available commands.
## When to Use
- when you need quick nda generator from the command line
- to automate nda tasks in your workflow
## Output
Returns formatted output to stdout. Redirect to a file with `nda-generator run > output.txt`.
FILE:scripts/nda.sh
#!/usr/bin/env bash
# NDA Generator - Generates complete Non-Disclosure Agreement documents
# Usage: nda.sh <command> [options]
set -euo pipefail
DATE=$(date +"%Y-%m-%d")
YEAR=$(date +"%Y")
show_help() {
cat <<'EOF'
NDA Generator - 保密协议生成器
Commands:
generate --party1 "Company A" --party2 "Company B" [--duration "2 years"]
Generate a complete NDA document
mutual [--party1 "Company A"] [--party2 "Company B"] [--duration "2 years"]
Generate a mutual (bilateral) NDA
unilateral [--discloser "Company A"] [--recipient "Company B"] [--duration "2 years"]
Generate a unilateral (one-way) NDA
help
Show this help message
Options:
--party1 First party name (default: [PARTY 1])
--party2 Second party name (default: [PARTY 2])
--discloser Disclosing party (for unilateral, default: [DISCLOSING PARTY])
--recipient Receiving party (for unilateral, default: [RECEIVING PARTY])
--duration Duration of confidentiality obligations (default: 2 years)
--governing Governing law jurisdiction (default: People's Republic of China)
⚠️ DISCLAIMER: For reference only. Consult a qualified lawyer before use.
EOF
}
parse_args() {
PARTY1="[PARTY 1]"
PARTY2="[PARTY 2]"
DISCLOSER="[DISCLOSING PARTY]"
RECIPIENT="[RECEIVING PARTY]"
DURATION="2 years"
GOVERNING="the People's Republic of China"
while [[ $# -gt 0 ]]; do
case "$1" in
--party1) PARTY1="$2"; shift 2 ;;
--party2) PARTY2="$2"; shift 2 ;;
--discloser) DISCLOSER="$2"; shift 2 ;;
--recipient) RECIPIENT="$2"; shift 2 ;;
--duration) DURATION="$2"; shift 2 ;;
--governing) GOVERNING="$2"; shift 2 ;;
*) shift ;;
esac
done
}
disclaimer() {
cat <<'EOF'
================================================================================
⚠️ DISCLAIMER / 免责声明
This document is generated for reference purposes only and does not constitute
legal advice. Consult a qualified attorney before executing any legal agreement.
本文档仅供参考,不构成法律建议。签署任何法律协议前请咨询专业律师。
================================================================================
EOF
}
generate_mutual() {
parse_args "$@"
cat <<ENDDOC
================================================================================
MUTUAL NON-DISCLOSURE AGREEMENT
双向保密协议 (NDA)
================================================================================
Date / 日期: DATE
BETWEEN:
Party A / 甲方: PARTY1
(hereinafter referred to as "Party A")
AND:
Party B / 乙方: PARTY2
(hereinafter referred to as "Party B")
(Each individually a "Party" and collectively the "Parties")
--------------------------------------------------------------------------------
RECITALS / 前言
--------------------------------------------------------------------------------
WHEREAS, the Parties wish to explore a potential business relationship
(the "Purpose") and in connection therewith, each Party may disclose to the
other Party certain confidential and proprietary information;
NOW, THEREFORE, in consideration of the mutual covenants and agreements set
forth herein, and for other good and valuable consideration, the receipt and
sufficiency of which are hereby acknowledged, the Parties agree as follows:
--------------------------------------------------------------------------------
1. DEFINITION OF CONFIDENTIAL INFORMATION
保密信息的定义
--------------------------------------------------------------------------------
1.1 "Confidential Information" means any and all non-public information,
whether in written, oral, electronic, visual, or other form, disclosed
by either Party (the "Disclosing Party") to the other Party (the
"Receiving Party"), including but not limited to:
(a) Trade secrets, inventions, patents, copyrights, trademarks, and
other intellectual property;
(b) Business plans, strategies, forecasts, and financial information;
(c) Customer lists, supplier information, and market data;
(d) Technical data, designs, algorithms, software, and source code;
(e) Employee information and organizational structures;
(f) Any information marked as "Confidential," "Proprietary," or
with similar designation.
1.2 Confidential Information shall NOT include information that:
(a) Is or becomes publicly available through no fault of the
Receiving Party;
(b) Was already known to the Receiving Party prior to disclosure,
as evidenced by written records;
(c) Is independently developed by the Receiving Party without use
of the Confidential Information;
(d) Is lawfully obtained from a third party without breach of any
confidentiality obligation;
(e) Is required to be disclosed by law, regulation, or court order,
provided the Receiving Party gives prompt notice to the
Disclosing Party.
--------------------------------------------------------------------------------
2. OBLIGATIONS OF THE RECEIVING PARTY
接收方的义务
--------------------------------------------------------------------------------
2.1 The Receiving Party shall:
(a) Hold all Confidential Information in strict confidence;
(b) Not disclose any Confidential Information to any third party
without the prior written consent of the Disclosing Party;
(c) Use the Confidential Information solely for the Purpose;
(d) Take all reasonable measures to protect the confidentiality of
the Confidential Information, using at least the same degree of
care it uses to protect its own confidential information, but
in no event less than reasonable care;
(e) Limit access to Confidential Information to those employees,
agents, or advisors who have a need to know and who are bound
by confidentiality obligations no less restrictive than this
Agreement.
2.2 The Receiving Party shall promptly notify the Disclosing Party upon
discovery of any unauthorized use or disclosure of Confidential
Information.
--------------------------------------------------------------------------------
3. TERM AND DURATION
期限与持续时间
--------------------------------------------------------------------------------
3.1 This Agreement shall be effective from the date first written above and
shall continue for a period of DURATION (the "Term"), unless earlier
terminated by either Party upon thirty (30) days' written notice.
3.2 The confidentiality obligations under this Agreement shall survive the
termination or expiration of this Agreement for an additional period of
DURATION from the date of termination or expiration.
--------------------------------------------------------------------------------
4. RETURN OF MATERIALS
材料归还
--------------------------------------------------------------------------------
4.1 Upon termination of this Agreement or upon request by the Disclosing
Party, the Receiving Party shall promptly:
(a) Return all originals and copies of Confidential Information; or
(b) Destroy all Confidential Information in its possession and
certify such destruction in writing.
4.2 Notwithstanding the foregoing, the Receiving Party may retain one (1)
archival copy solely for compliance and legal purposes, subject to
ongoing confidentiality obligations.
--------------------------------------------------------------------------------
5. NO LICENSE OR WARRANTY
无许可或保证
--------------------------------------------------------------------------------
5.1 Nothing in this Agreement grants the Receiving Party any license or
rights in or to the Confidential Information, except the limited right
to use it for the Purpose.
5.2 ALL CONFIDENTIAL INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED.
--------------------------------------------------------------------------------
6. REMEDIES
救济措施
--------------------------------------------------------------------------------
6.1 The Parties acknowledge that any breach of this Agreement may cause
irreparable harm for which monetary damages would be inadequate. The
Disclosing Party shall be entitled to seek injunctive relief, specific
performance, or other equitable remedies in addition to any other
remedies available at law.
--------------------------------------------------------------------------------
7. GOVERNING LAW AND DISPUTE RESOLUTION
适用法律与争议解决
--------------------------------------------------------------------------------
7.1 This Agreement shall be governed by and construed in accordance with
the laws of GOVERNING.
7.2 Any dispute arising out of or in connection with this Agreement shall
first be resolved through friendly negotiation. If negotiation fails
within thirty (30) days, the dispute shall be submitted to the
competent court of the jurisdiction where the Disclosing Party is
domiciled.
--------------------------------------------------------------------------------
8. GENERAL PROVISIONS
一般条款
--------------------------------------------------------------------------------
8.1 Entire Agreement: This Agreement constitutes the entire agreement
between the Parties with respect to the subject matter hereof and
supersedes all prior negotiations, representations, and agreements.
8.2 Amendments: No modification of this Agreement shall be effective unless
made in writing and signed by both Parties.
8.3 Severability: If any provision of this Agreement is found to be invalid
or unenforceable, the remaining provisions shall continue in full force
and effect.
8.4 Assignment: Neither Party may assign this Agreement without the prior
written consent of the other Party.
8.5 Counterparts: This Agreement may be executed in counterparts, each of
which shall be deemed an original.
--------------------------------------------------------------------------------
SIGNATURES / 签署
--------------------------------------------------------------------------------
For and on behalf of PARTY1:
Signature: _________________________
Name: _________________________
Title: _________________________
Date: _________________________
For and on behalf of PARTY2:
Signature: _________________________
Name: _________________________
Title: _________________________
Date: _________________________
ENDDOC
disclaimer
}
generate_unilateral() {
parse_args "$@"
# If party1/party2 provided but not discloser/recipient, use them
if [[ "$DISCLOSER" == "[DISCLOSING PARTY]" && "$PARTY1" != "[PARTY 1]" ]]; then
DISCLOSER="$PARTY1"
fi
if [[ "$RECIPIENT" == "[RECEIVING PARTY]" && "$PARTY2" != "[PARTY 2]" ]]; then
RECIPIENT="$PARTY2"
fi
cat <<ENDDOC
================================================================================
UNILATERAL NON-DISCLOSURE AGREEMENT
单向保密协议 (NDA)
================================================================================
Date / 日期: DATE
BETWEEN:
Disclosing Party / 披露方: DISCLOSER
(hereinafter referred to as the "Disclosing Party")
AND:
Receiving Party / 接收方: RECIPIENT
(hereinafter referred to as the "Receiving Party")
--------------------------------------------------------------------------------
RECITALS / 前言
--------------------------------------------------------------------------------
WHEREAS, the Disclosing Party possesses certain confidential and proprietary
information that it wishes to disclose to the Receiving Party for the purpose
of evaluating a potential business relationship (the "Purpose");
WHEREAS, the Receiving Party agrees to receive such information under the
terms and conditions set forth in this Agreement;
NOW, THEREFORE, the Parties agree as follows:
--------------------------------------------------------------------------------
1. DEFINITION OF CONFIDENTIAL INFORMATION
保密信息的定义
--------------------------------------------------------------------------------
1.1 "Confidential Information" means all non-public information disclosed
by the Disclosing Party to the Receiving Party, whether in written,
oral, electronic, or other form, including but not limited to:
(a) Trade secrets, know-how, inventions, and intellectual property;
(b) Business operations, plans, strategies, and financial data;
(c) Technical specifications, designs, and source code;
(d) Customer and supplier information;
(e) Any materials marked "Confidential" or reasonably understood
to be confidential given the nature of the information.
1.2 Exclusions: Confidential Information does not include information that:
(a) Is or becomes publicly known through no breach of this Agreement;
(b) Was known to the Receiving Party before disclosure;
(c) Is independently developed without reference to Confidential
Information;
(d) Is received from a third party free of confidentiality obligations;
(e) Is required to be disclosed by applicable law or regulation.
--------------------------------------------------------------------------------
2. OBLIGATIONS OF THE RECEIVING PARTY
接收方的义务
--------------------------------------------------------------------------------
2.1 The Receiving Party agrees to:
(a) Maintain all Confidential Information in strict confidence;
(b) Not disclose Confidential Information to any third party without
prior written consent of the Disclosing Party;
(c) Use Confidential Information only for the Purpose described above;
(d) Protect Confidential Information with at least the same degree of
care used for its own confidential information, but no less than
reasonable care;
(e) Restrict access to authorized personnel who need to know and who
are bound by similar confidentiality obligations.
2.2 The Receiving Party shall immediately notify the Disclosing Party of
any suspected or actual unauthorized disclosure or use.
--------------------------------------------------------------------------------
3. TERM
期限
--------------------------------------------------------------------------------
3.1 This Agreement is effective from the date above and continues for
DURATION, unless terminated earlier by the Disclosing Party with
thirty (30) days' written notice.
3.2 Confidentiality obligations survive termination for DURATION.
--------------------------------------------------------------------------------
4. RETURN OF MATERIALS
材料归还
--------------------------------------------------------------------------------
4.1 Upon request or termination, the Receiving Party shall return or
destroy all Confidential Information and certify destruction in writing.
--------------------------------------------------------------------------------
5. NO RIGHTS GRANTED
未授予权利
--------------------------------------------------------------------------------
5.1 No license, intellectual property rights, or other rights are granted
to the Receiving Party under this Agreement except the limited right to
review Confidential Information for the Purpose.
5.2 All Confidential Information remains the property of the Disclosing
Party.
--------------------------------------------------------------------------------
6. REMEDIES
救济措施
--------------------------------------------------------------------------------
6.1 The Receiving Party acknowledges that breach may cause irreparable
harm. The Disclosing Party is entitled to seek injunctive relief and
other equitable remedies in addition to any legal remedies.
--------------------------------------------------------------------------------
7. GOVERNING LAW
适用法律
--------------------------------------------------------------------------------
7.1 This Agreement is governed by the laws of GOVERNING.
7.2 Disputes shall be resolved through negotiation first, then submitted
to the competent court where the Disclosing Party is domiciled.
--------------------------------------------------------------------------------
8. GENERAL PROVISIONS
一般条款
--------------------------------------------------------------------------------
8.1 This Agreement is the entire agreement on this subject matter.
8.2 Amendments must be in writing and signed by both Parties.
8.3 Invalid provisions do not affect remaining provisions.
8.4 No assignment without written consent.
--------------------------------------------------------------------------------
SIGNATURES / 签署
--------------------------------------------------------------------------------
Disclosing Party / 披露方: DISCLOSER
Signature: _________________________
Name: _________________________
Title: _________________________
Date: _________________________
Receiving Party / 接收方: RECIPIENT
Signature: _________________________
Name: _________________________
Title: _________________________
Date: _________________________
ENDDOC
disclaimer
}
# Main command router
CMD="-help"
shift 2>/dev/null || true
case "$CMD" in
generate|mutual)
generate_mutual "$@"
;;
unilateral)
generate_unilateral "$@"
;;
help|--help|-h)
show_help
;;
*)
echo "Error: Unknown command '$CMD'"
echo "Run 'nda.sh help' for usage information."
exit 1
;;
esac
FILE:scripts/script.sh
#!/usr/bin/env bash
# nda-generator - Multi-purpose utility tool
set -euo pipefail
VERSION="2.0.0"
DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/nda-generator}"
DB="$DATA_DIR/data.log"
mkdir -p "$DATA_DIR"
show_help() {
cat << EOF
nda-generator v$VERSION
Multi-purpose utility tool
Usage: nda-generator <command> [args]
Commands:
run Execute main function
config Configuration
status Show status
init Initialize
list List items
add Add entry
remove Remove entry
search Search
export Export data
info Show info
help Show this help
version Show version
Data: \$DATA_DIR
EOF
}
_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }
cmd_run() {
echo " Running: $1"
_log "run" "-"
}
cmd_config() {
echo " Config: $DATA_DIR/config.json"
_log "config" "-"
}
cmd_status() {
echo " Status: ready"
_log "status" "-"
}
cmd_init() {
echo " Initialized in $DATA_DIR"
_log "init" "-"
}
cmd_list() {
[ -f "$DB" ] && cat "$DB" || echo " (empty)"
_log "list" "-"
}
cmd_add() {
echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*"
_log "add" "-"
}
cmd_remove() {
echo " Removed: $1"
_log "remove" "-"
}
cmd_search() {
grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1"
_log "search" "-"
}
cmd_export() {
[ -f "$DB" ] && cat "$DB" || echo "No data"
_log "export" "-"
}
cmd_info() {
echo " Version: $VERSION | Data: $DATA_DIR"
_log "info" "-"
}
case "-help" in
run) shift; cmd_run "$@" ;;
config) shift; cmd_config "$@" ;;
status) shift; cmd_status "$@" ;;
init) shift; cmd_init "$@" ;;
list) shift; cmd_list "$@" ;;
add) shift; cmd_add "$@" ;;
remove) shift; cmd_remove "$@" ;;
search) shift; cmd_search "$@" ;;
export) shift; cmd_export "$@" ;;
info) shift; cmd_info "$@" ;;
help|-h) show_help ;;
version|-v) echo "nda-generator v$VERSION" ;;
*) echo "Unknown: $1"; show_help; exit 1 ;;
esac
FILE:tips.md
# NDA Generator - tips.md
## Quick Reference
服务条款生成器。SaaS/电商/App服务条款、更新通知、白话版。Terms of service generator. 服务条款、用户协议。
--- version: "2.0.0" name: Terms of Service description: "Terms of Service Generator - 服务条款生成器. Use when you need terms of service capabilities. Triggers on: terms of service." 服务条款生成器。SaaS/电商/App服务条款、更新通知、白话版。Terms of service generator. 服务条款、用户协议。 author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # Terms of Service 服务条款生成器。SaaS/电商/App服务条款、更新通知、白话版。Terms of service generator. 服务条款、用户协议。 ## 常见问题 **Q: 这个工具适合谁用?** A: 任何需要terms of service的人,无论是个人还是企业用户。 **Q: 输出格式是什么?** A: 主要输出Markdown格式,方便复制和编辑。 ## 命令速查 ``` generate generate saas saas ecommerce ecommerce app app update update plain plain ``` --- *Terms of Service by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com - Run `terms-of-service help` for all commands ## Commands Run `terms-of-service help` to see all available commands. ## When to Use - Quick terms tasks from terminal - Automation pipelines ## When to Use - Quick terms tasks from terminal - Automation pipelines FILE:scripts/script.sh #!/usr/bin/env bash # terms-of-service - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/terms-of-service}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF terms-of-service v$VERSION Multi-purpose utility tool Usage: terms-of-service <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "terms-of-service v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/tos.sh #!/usr/bin/env bash # Terms of Service Generator - Generates complete TOS documents # Usage: tos.sh <command> [options] set -euo pipefail DATE=$(date +"%Y-%m-%d") YEAR=$(date +"%Y") show_help() { cat <<'EOF' Terms of Service Generator - 服务条款生成器 Commands: generate --company "MyApp" --website "myapp.com" Generate a complete Terms of Service saas --company "MyApp" --website "myapp.com" Generate SaaS-specific Terms of Service help Show this help message Options: --company Company or app name (default: [COMPANY NAME]) --website Website URL (default: [WEBSITE URL]) --email Contact email (default: [CONTACT EMAIL]) --governing Governing law jurisdiction (default: People's Republic of China) ⚠️ DISCLAIMER: For reference only. Consult a qualified lawyer before use. EOF } COMPANY="[COMPANY NAME]" WEBSITE="[WEBSITE URL]" EMAIL="[CONTACT EMAIL]" GOVERNING="the People's Republic of China" parse_args() { while [[ $# -gt 0 ]]; do case "$1" in --company) COMPANY="$2"; shift 2 ;; --website) WEBSITE="$2"; shift 2 ;; --email) EMAIL="$2"; shift 2 ;; --governing) GOVERNING="$2"; shift 2 ;; *) shift ;; esac done } disclaimer() { cat <<'EOF' ================================================================================ ⚠️ DISCLAIMER / 免责声明 This document is generated for reference purposes only and does not constitute legal advice. Consult a qualified attorney before use. 本文档仅供参考,不构成法律建议。请咨询专业律师后使用。 ================================================================================ EOF } generate_standard() { parse_args "$@" cat <<ENDDOC ================================================================================ TERMS OF SERVICE 服务条款 ================================================================================ Last Updated / 最后更新: DATE Welcome to COMPANY. These Terms of Service ("Terms") govern your access to and use of WEBSITE and any related services (collectively, the "Service") provided by COMPANY ("we," "us," or "our"). By accessing or using the Service, you agree to be bound by these Terms. If you do not agree to all of these Terms, do not use the Service. -------------------------------------------------------------------------------- 1. ACCEPTANCE OF TERMS 接受条款 -------------------------------------------------------------------------------- 1.1 By creating an account, accessing, or using the Service, you confirm that you have read, understood, and agree to be bound by these Terms and our Privacy Policy. 1.2 If you are using the Service on behalf of an organization, you represent that you have authority to bind that organization to these Terms. 1.3 You must be at least 16 years old (or the applicable age of consent in your jurisdiction) to use the Service. -------------------------------------------------------------------------------- 2. DESCRIPTION OF SERVICE 服务描述 -------------------------------------------------------------------------------- 2.1 COMPANY provides [describe your service here]. Features may be added, modified, or removed at our discretion. 2.2 We reserve the right to modify, suspend, or discontinue the Service (or any part thereof) at any time, with or without notice. 2.3 We shall not be liable to you or any third party for any modification, suspension, or discontinuation of the Service. -------------------------------------------------------------------------------- 3. USER ACCOUNTS 用户账户 -------------------------------------------------------------------------------- 3.1 Registration: You may need to create an account to access certain features. You agree to provide accurate, current, and complete information during registration. 3.2 Account Security: You are responsible for maintaining the security of your account credentials. You agree to: • Keep your password confidential • Notify us immediately of any unauthorized access • Not share your account with others 3.3 Account Termination: We may suspend or terminate your account if: • You violate these Terms • You provide false information • Your account has been inactive for 12+ months • Required by law -------------------------------------------------------------------------------- 4. USER CONTENT 用户内容 -------------------------------------------------------------------------------- 4.1 Ownership: You retain ownership of content you submit to the Service ("User Content"). 4.2 License: By submitting User Content, you grant COMPANY a worldwide, non-exclusive, royalty-free, sublicensable license to use, reproduce, modify, distribute, and display such content in connection with operating the Service. 4.3 Responsibility: You are solely responsible for your User Content. You represent that: • You own or have rights to submit the content • The content does not infringe third-party rights • The content does not violate any laws 4.4 Prohibited Content: You may not submit content that: • Is illegal, harmful, threatening, abusive, or harassing • Infringes intellectual property rights • Contains viruses or malicious code • Is spam, advertising, or solicitation (unless permitted) • Violates any person's privacy • Is misleading or fraudulent 4.5 Removal: We reserve the right to remove any User Content at our discretion, without notice. -------------------------------------------------------------------------------- 5. INTELLECTUAL PROPERTY 知识产权 -------------------------------------------------------------------------------- 5.1 Our IP: The Service, including its design, features, content, code, trademarks, and logos, is owned by COMPANY and protected by intellectual property laws. 5.2 Restrictions: You may not: • Copy, modify, or distribute the Service • Reverse engineer, decompile, or disassemble the Service • Remove any proprietary notices • Use our trademarks without written permission 5.3 Feedback: Any feedback or suggestions you provide may be used by us without obligation or compensation to you. -------------------------------------------------------------------------------- 6. PROHIBITED USES 禁止行为 -------------------------------------------------------------------------------- You agree NOT to: (a) Use the Service for any unlawful purpose (b) Violate any applicable laws or regulations (c) Attempt to gain unauthorized access to any part of the Service (d) Interfere with or disrupt the Service or servers (e) Use automated systems (bots, scrapers) without permission (f) Impersonate any person or entity (g) Collect personal information of other users without consent (h) Use the Service to send spam or unsolicited messages (i) Circumvent any access controls or security measures (j) Use the Service in a manner that could damage our reputation -------------------------------------------------------------------------------- 7. PAYMENT TERMS 支付条款 -------------------------------------------------------------------------------- 7.1 Fees: Certain features may require payment. All fees are listed on our pricing page and are in [USD/RMB/EUR]. 7.2 Billing: You authorize us to charge your payment method for fees incurred. Charges are non-refundable unless stated otherwise. 7.3 Price Changes: We may change fees upon 30 days' notice. Continued use after price changes constitutes acceptance. 7.4 Taxes: You are responsible for all applicable taxes. 7.5 Late Payments: Late payments may result in service suspension and may accrue interest at 1.5% per month or the maximum rate permitted by law. -------------------------------------------------------------------------------- 8. DISCLAIMERS 免责声明 -------------------------------------------------------------------------------- 8.1 THE SERVICE IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. 8.2 We do not warrant that: • The Service will be uninterrupted, timely, secure, or error-free • Results obtained from the Service will be accurate or reliable • Defects will be corrected • The Service is free of viruses or harmful components -------------------------------------------------------------------------------- 9. LIMITATION OF LIABILITY 责任限制 -------------------------------------------------------------------------------- 9.1 TO THE MAXIMUM EXTENT PERMITTED BY LAW, COMPANY SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, DATA, USE, OR GOODWILL. 9.2 OUR TOTAL LIABILITY SHALL NOT EXCEED THE AMOUNT YOU PAID TO US IN THE 12 MONTHS PRECEDING THE CLAIM, OR \$100 (USD), WHICHEVER IS GREATER. 9.3 These limitations apply regardless of the theory of liability (contract, tort, strict liability, or otherwise). -------------------------------------------------------------------------------- 10. INDEMNIFICATION 赔偿 -------------------------------------------------------------------------------- You agree to indemnify, defend, and hold harmless COMPANY, its officers, directors, employees, agents, and affiliates from any claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising from: (a) Your use of the Service (b) Your violation of these Terms (c) Your violation of any third-party rights (d) Your User Content -------------------------------------------------------------------------------- 11. GOVERNING LAW AND DISPUTES 适用法律与争议解决 -------------------------------------------------------------------------------- 11.1 These Terms are governed by the laws of GOVERNING. 11.2 Any dispute shall first be resolved through good-faith negotiation for at least 30 days. 11.3 If negotiation fails, disputes shall be submitted to the competent court in the jurisdiction of COMPANY's principal place of business. 11.4 Notwithstanding the above, either party may seek injunctive relief in any court of competent jurisdiction. -------------------------------------------------------------------------------- 12. CHANGES TO TERMS 条款变更 -------------------------------------------------------------------------------- 12.1 We may modify these Terms at any time. Material changes will be communicated via email or prominent notice on the Service at least 30 days before taking effect. 12.2 Your continued use of the Service after changes constitute acceptance of the modified Terms. 12.3 If you do not agree to modified Terms, you must stop using the Service and close your account. -------------------------------------------------------------------------------- 13. GENERAL PROVISIONS 一般条款 -------------------------------------------------------------------------------- 13.1 Entire Agreement: These Terms, together with our Privacy Policy, constitute the entire agreement between you and COMPANY. 13.2 Severability: If any provision is found unenforceable, the remaining provisions remain in effect. 13.3 Waiver: Failure to enforce any right does not constitute a waiver. 13.4 Assignment: You may not assign these Terms without our written consent. We may assign freely. 13.5 Force Majeure: We are not liable for failure to perform due to circumstances beyond our reasonable control. 13.6 Notices: We may send notices via email to your registered address or by posting on the Service. -------------------------------------------------------------------------------- 14. CONTACT INFORMATION 联系方式 -------------------------------------------------------------------------------- For questions about these Terms: Company: COMPANY Website: WEBSITE Email: EMAIL ENDDOC disclaimer } generate_saas() { parse_args "$@" cat <<ENDDOC ================================================================================ SAAS TERMS OF SERVICE / SaaS服务条款 ================================================================================ Last Updated / 最后更新: DATE These SaaS Terms of Service ("Agreement") govern your subscription to and use of the software-as-a-service platform provided by COMPANY ("Provider," "we," "us") accessible at WEBSITE (the "Platform"). By subscribing to or using the Platform, you ("Customer," "you") agree to this Agreement. -------------------------------------------------------------------------------- 1. DEFINITIONS / 定义 -------------------------------------------------------------------------------- "Authorized Users" — individuals permitted by Customer to access the Platform under Customer's subscription. "Customer Data" — all data uploaded, submitted, or generated by Customer or Authorized Users through the Platform. "Documentation" — user guides, API documentation, and help materials provided by Provider. "Service Level Agreement (SLA)" — the uptime and performance commitments set forth in Section 7. "Subscription Term" — the period during which Customer has access to the Platform, as specified in the applicable Order Form. "Order Form" — the document specifying the subscription plan, number of users, pricing, and term. -------------------------------------------------------------------------------- 2. GRANT OF LICENSE / 许可授予 -------------------------------------------------------------------------------- 2.1 Provider grants Customer a non-exclusive, non-transferable, limited right to access and use the Platform during the Subscription Term, subject to this Agreement. 2.2 The license is limited to: • The number of Authorized Users specified in the Order Form • Internal business purposes of Customer • Features included in Customer's subscription plan 2.3 Customer shall not: • Sublicense, resell, or distribute access to the Platform • Allow unauthorized users to access the Platform • Use the Platform to develop a competing product • Exceed usage limits specified in the Order Form -------------------------------------------------------------------------------- 3. CUSTOMER DATA / 客户数据 -------------------------------------------------------------------------------- 3.1 Ownership: Customer retains all rights in Customer Data. Provider does not claim ownership of Customer Data. 3.2 License: Customer grants Provider a limited license to use Customer Data solely to provide and improve the Platform. 3.3 Data Protection: Provider shall implement reasonable security measures to protect Customer Data, including: • Encryption in transit (TLS 1.2+) and at rest (AES-256) • Regular backups (daily, retained for 30 days) • Access controls and audit logging • Compliance with applicable data protection laws 3.4 Data Portability: Customer may export Customer Data at any time in standard formats (CSV, JSON, or via API). 3.5 Data Deletion: Upon termination, Provider shall delete Customer Data within 30 days, unless retention is required by law. Customer may request data export before termination. -------------------------------------------------------------------------------- 4. SUBSCRIPTION AND PAYMENT / 订阅与付款 -------------------------------------------------------------------------------- 4.1 Fees: Customer shall pay subscription fees as specified in the Order Form. Fees are due in advance on a [monthly/annual] basis. 4.2 Payment Terms: Invoices are due within 30 days of issue date. Late payments accrue interest at 1.5% per month. 4.3 Price Increases: Provider may increase fees upon 60 days' written notice before the next renewal term. 4.4 Taxes: Fees are exclusive of taxes. Customer is responsible for applicable sales, use, VAT, or other taxes. 4.5 Refunds: No refunds for partial periods unless required by law. 4.6 Suspension: Provider may suspend access for unpaid fees after 15 days' written notice. -------------------------------------------------------------------------------- 5. SUPPORT AND MAINTENANCE / 支持与维护 -------------------------------------------------------------------------------- 5.1 Standard Support: Included in all plans: • Email support: Response within 24 business hours • Documentation and knowledge base access • Community forum access 5.2 Premium Support (if applicable): • Priority email support: Response within 4 business hours • Phone/video support during business hours • Dedicated account manager • Custom training sessions 5.3 Maintenance: Provider shall perform scheduled maintenance during off-peak hours with at least 48 hours' advance notice. Emergency maintenance may be performed without notice. -------------------------------------------------------------------------------- 6. AVAILABILITY AND SLA / 可用性与SLA -------------------------------------------------------------------------------- 6.1 Uptime Commitment: Provider commits to 99.9% monthly uptime for the Platform ("Uptime SLA"), measured as: Uptime % = (Total Minutes - Downtime Minutes) / Total Minutes × 100 6.2 Exclusions: The following are excluded from downtime calculations: • Scheduled maintenance windows • Force majeure events • Issues caused by Customer's systems or third-party services • Features in beta or preview 6.3 Service Credits: If monthly uptime falls below the SLA: • 99.0% - 99.9%: 10% credit on monthly fee • 95.0% - 99.0%: 25% credit on monthly fee • Below 95.0%: 50% credit on monthly fee Credits must be requested within 30 days. Maximum credit per month shall not exceed 50% of monthly fees. Credits are the sole remedy for SLA breaches. 6.4 Status Page: Real-time status is available at [status page URL]. -------------------------------------------------------------------------------- 7. INTELLECTUAL PROPERTY / 知识产权 -------------------------------------------------------------------------------- 7.1 Provider IP: The Platform, including all code, designs, algorithms, documentation, and trademarks, is owned by Provider. 7.2 Customer IP: Customer Data and Customer's pre-existing intellectual property remain Customer's property. 7.3 Feedback: Suggestions or feedback from Customer may be used by Provider without restriction or compensation. -------------------------------------------------------------------------------- 8. CONFIDENTIALITY / 保密 -------------------------------------------------------------------------------- 8.1 Each party agrees to keep confidential all non-public information received from the other party. 8.2 Confidential information does not include information that is: • Publicly available through no fault of the receiving party • Already known before disclosure • Independently developed • Received from a third party without restriction 8.3 Obligations survive for 3 years after termination. -------------------------------------------------------------------------------- 9. WARRANTIES AND DISCLAIMERS / 保证与免责 -------------------------------------------------------------------------------- 9.1 Provider warrants that the Platform will perform materially in accordance with the Documentation during the Subscription Term. 9.2 EXCEPT AS EXPRESSLY SET FORTH ABOVE, THE PLATFORM IS PROVIDED "AS IS." PROVIDER DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -------------------------------------------------------------------------------- 10. LIMITATION OF LIABILITY / 责任限制 -------------------------------------------------------------------------------- 10.1 NEITHER PARTY SHALL BE LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES. 10.2 PROVIDER'S TOTAL LIABILITY SHALL NOT EXCEED THE FEES PAID BY CUSTOMER IN THE 12 MONTHS PRECEDING THE CLAIM. 10.3 These limitations do not apply to: • Breach of confidentiality obligations • Infringement of intellectual property rights • Customer's payment obligations • Gross negligence or willful misconduct -------------------------------------------------------------------------------- 11. TERM AND TERMINATION / 期限与终止 -------------------------------------------------------------------------------- 11.1 Term: This Agreement begins on the effective date and continues for the Subscription Term specified in the Order Form. 11.2 Auto-Renewal: The subscription automatically renews for successive terms of equal length unless either party provides 30 days' written notice before the end of the current term. 11.3 Termination for Cause: Either party may terminate if the other: • Materially breaches and fails to cure within 30 days of notice • Becomes insolvent or files for bankruptcy 11.4 Effects of Termination: • Customer's access to the Platform ceases • Customer may export data for 30 days after termination • Provider deletes Customer Data after the export period • Accrued payment obligations survive termination -------------------------------------------------------------------------------- 12. GOVERNING LAW / 适用法律 -------------------------------------------------------------------------------- This Agreement is governed by the laws of GOVERNING. Disputes shall be resolved through negotiation, then mediation, then arbitration or litigation in the jurisdiction of Provider's principal place of business. -------------------------------------------------------------------------------- 13. GENERAL / 一般条款 -------------------------------------------------------------------------------- 13.1 Entire Agreement: This Agreement and any Order Forms constitute the entire agreement. 13.2 Amendments: Must be in writing and signed by both parties. 13.3 Severability: Invalid provisions do not affect remaining terms. 13.4 Assignment: Neither party may assign without consent, except in connection with a merger or acquisition. 13.5 Force Majeure: Neither party is liable for failure due to events beyond reasonable control. 13.6 Notices: Must be in writing to the addresses specified in the Order Form. -------------------------------------------------------------------------------- 14. CONTACT / 联系方式 -------------------------------------------------------------------------------- Provider: COMPANY Website: WEBSITE Email: EMAIL ENDDOC disclaimer } # Main command router CMD="-help" shift 2>/dev/null || true case "$CMD" in generate) generate_standard "$@" ;; saas) generate_saas "$@" ;; help|--help|-h) show_help ;; *) echo "Error: Unknown command '$CMD'" echo "Run 'tos.sh help' for usage information." exit 1 ;; esac FILE:tips.md # Terms of Service - tips.md ## Quick Reference
HR工具包。招聘流程、入职办理、离职管理、制度规范、员工手册、HR模板库。HR toolkit with recruitment, onboarding, offboarding, policy, handbook.
--- version: "2.0.0" name: hr-toolkit description: "HR工具包。招聘流程、入职办理、离职管理、制度规范、员工手册、HR模板库。HR toolkit with recruitment, onboarding, offboarding, policy, handbook." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # hr-toolkit HR工具包。招聘流程、入职办理、离职管理、制度规范、员工手册、HR模板库。HR toolkit with recruitment, onboarding, offboarding, policy, handbook, templates. 人力资源、招聘、入职、离职、制度、员工手册。Use when managing HR processes. ## 推荐工作流 ``` 需求分析 → 选择命令 → 输入描述 → 获取结果 → 调整优化 ``` ## 命令列表 | 命令 | 功能 | |------|------| | `recruit` | recruit | | `onboard` | onboard | | `offboard` | offboard | | `policy` | policy | | `handbook` | handbook | | `template` | template | ## 专业建议 - 招聘 (recruit)**: 提供职位名称、级别、部门信息,生成更精准的JD和面试流程 - 入职 (onboard)**: 指定员工姓名和职位,生成个性化入职清单 - 离职 (offboard)**: 包含离职原因分类,帮助做好知识交接 - 制度 (policy)**: 支持考勤、休假、报销、行为规范等多种制度类型 - 手册 (handbook)**: 指定公司类型(创业公司/大厂/外企),生成匹配风格的手册 --- *hr-toolkit by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Commands Run `hr-toolkit help` to see all available commands. FILE:scripts/hr.sh #!/usr/bin/env bash # HR Toolkit — HR工具包 # Usage: bash hr.sh <command> [args...] set -euo pipefail CMD="-help" shift 2>/dev/null || true INPUT="$*" case "$CMD" in recruit) cat <<'PROMPT' ## 📋 招聘流程管理 请根据以下框架生成招聘相关内容: ### 1. 职位描述 (JD) - **职位名称**: [根据输入确定] - **部门/团队**: - **汇报对象**: - **职位概述**: (2-3句话描述核心职责) ### 2. 任职要求 - **必备条件** (Must Have): - 学历要求 - 工作经验 (年限+领域) - 核心技能 (3-5项) - **加分项** (Nice to Have): - 额外技能 - 行业经验 - 证书资质 ### 3. 薪资福利 - 薪资范围 (市场参考) - 福利清单 - 成长空间 ### 4. 面试流程 | 轮次 | 面试官 | 时长 | 重点评估 | |------|--------|------|----------| | 初筛 | HR | 30min | 基本匹配度、薪资期望 | | 一面 | 直属上级 | 60min | 专业能力、项目经验 | | 二面 | 部门负责人 | 45min | 综合素质、文化匹配 | | 终面 | VP/CEO | 30min | 战略认同、价值观 | ### 5. 面试评估表 | 维度 | 权重 | 评分(1-5) | 备注 | |------|------|-----------|------| | 专业能力 | 30% | | | | 项目经验 | 25% | | | | 沟通表达 | 15% | | | | 团队协作 | 15% | | | | 文化匹配 | 15% | | | ### 6. 面试题库 - 行为面试题 (STAR法则) × 5 - 专业技能题 × 5 - 情景模拟题 × 3 PROMPT echo "" echo "📌 输入信息: -请提供职位名称和要求" ;; onboard) cat <<'PROMPT' ## 🎉 入职办理清单 ### 阶段一:入职前 (T-3天) - [ ] 发送正式offer邮件 - [ ] 准备劳动合同 - [ ] 创建企业邮箱账号 - [ ] 准备工位和办公设备 - [ ] 申请系统权限 (OA/项目管理/代码仓库) - [ ] 通知团队新成员信息 - [ ] 指定入职引导人 (Buddy) ### 阶段二:入职当天 (Day 1) - [ ] 前台迎接,发放工卡 - [ ] 签署劳动合同及保密协议 - [ ] 办公设备领取和配置 - [ ] HR制度宣讲 (考勤/休假/报销) - [ ] 部门介绍和团队见面 - [ ] 午餐安排 (团队欢迎午餐) - [ ] 发送欢迎邮件 (全员/部门) ### 阶段三:首周 (Week 1) - [ ] 公司文化和业务介绍 - [ ] 产品/技术架构培训 - [ ] 开发环境搭建 (技术岗) - [ ] 分配首个任务/项目 - [ ] Buddy 每日 check-in - [ ] 周末1:1面谈 (直属上级) ### 阶段四:首月 (Month 1) - [ ] 完成岗位必修培训 - [ ] 参与至少一个完整项目/迭代 - [ ] 与跨部门关键人建立联系 - [ ] 月末试用期评估面谈 - [ ] 收集入职体验反馈 ### 欢迎信模板 ``` Hi [姓名], 欢迎加入[公司名]!我们非常高兴你成为团队的一员。 你的入职引导人是[Buddy姓名],有任何问题都可以找ta。 入职第一天请带好身份证原件和银行卡,9:30到前台报到。 期待与你一起创造精彩! [HR姓名] 人力资源部 ``` PROMPT echo "" echo "📌 输入信息: -请提供新员工姓名和职位" ;; offboard) cat <<'PROMPT' ## 👋 离职管理流程 ### 1. 离职申请 - 确认离职类型:主动离职 / 协商解除 / 合同到期 - 确认最后工作日 (法定提前30天/试用期3天) - 书面离职申请签收 ### 2. 离职面谈 **面谈要点:** - 离职原因 (真实原因挖掘) - 对公司/团队的建议 - 是否有挽留可能 - 竞业限制确认 **常见离职原因分类:** | 类别 | 具体原因 | 改进建议 | |------|----------|----------| | 薪资 | 低于市场/涨幅不满意 | 薪资调研/调薪机制 | | 发展 | 晋升受阻/技能停滞 | 职业通道/培训 | | 管理 | 与上级关系/管理风格 | 管理培训/团队调整 | | 文化 | 加班/氛围/价值观 | 文化建设/制度优化 | | 个人 | 家庭/健康/搬迁 | 弹性政策/远程 | ### 3. 工作交接清单 - [ ] 编写工作交接文档 - [ ] 项目进度和待办事项移交 - [ ] 客户/供应商关系交接 - [ ] 文档和资料归档 - [ ] 代码/设计稿权限移交 - [ ] 密码和账号交接 ### 4. 行政事项 - [ ] 归还办公设备 (电脑/工卡/钥匙) - [ ] 关闭系统权限和企业邮箱 - [ ] 社保/公积金减员 - [ ] 工资结算 (含未休年假折算) - [ ] 开具离职证明 - [ ] 人事档案/社保转移 ### 5. 离职证明模板 ``` 离职证明 兹证明[姓名],身份证号[XXX],于[入职日期]至[离职日期] 在本公司[部门]担任[职位]。 现已办理完毕全部离职手续,双方劳动关系已解除。 特此证明。 [公司名称](盖章) [日期] ``` PROMPT echo "" echo "📌 输入信息: -请提供员工姓名和离职情况" ;; policy) cat <<'PROMPT' ## 📜 公司制度规范生成 请指定制度类型,生成对应规范文档: ### 可选制度类型 1. **考勤制度** — 工作时间、打卡、迟到早退、旷工处理 2. **休假制度** — 年假、病假、事假、婚假、产假等 3. **报销制度** — 差旅、招待、办公用品、审批流程 4. **行为规范** — 着装、保密、利益冲突、社交媒体 5. **绩效考核** — 考核周期、指标、评分、结果应用 6. **晋升制度** — 职级体系、晋升条件、评审流程 7. **远程办公** — 申请条件、工作要求、设备支持 ### 制度文档结构 ``` 一、目的和适用范围 二、定义和术语 三、具体规定 3.1 [核心条款] 3.2 [操作细则] 3.3 [特殊情况处理] 四、违规处理 五、附则 - 生效日期 - 解释权归属 - 版本记录 ``` ### 注意事项 - 确保符合当地劳动法规 - 条款清晰无歧义 - 包含员工签收确认 - 定期审查更新 (建议每半年) PROMPT echo "" echo "📌 输入信息: -请指定制度类型,如考勤、休假、报销等" ;; handbook) cat <<'PROMPT' ## 📖 员工手册生成 ### 员工手册完整框架 **第一章:公司概况** - 1.1 公司简介和发展历程 - 1.2 使命、愿景、价值观 - 1.3 组织架构 - 1.4 企业文化 **第二章:入职指南** - 2.1 入职流程 - 2.2 试用期规定 - 2.3 劳动合同 - 2.4 薪酬结构 **第三章:考勤管理** - 3.1 工作时间 - 3.2 打卡制度 - 3.3 加班管理 - 3.4 出差管理 **第四章:休假制度** - 4.1 法定节假日 - 4.2 年假 - 4.3 病假/事假 - 4.4 婚假/产假/陪产假 - 4.5 其他假期 **第五章:薪酬福利** - 5.1 薪资结构 - 5.2 社保公积金 - 5.3 商业保险 - 5.4 员工福利 - 5.5 调薪机制 **第六章:绩效管理** - 6.1 考核周期 - 6.2 考核方式 - 6.3 结果应用 **第七章:培训发展** - 7.1 培训体系 - 7.2 职业发展通道 - 7.3 晋升机制 **第八章:行为规范** - 8.1 职业道德 - 8.2 保密制度 - 8.3 利益冲突 - 8.4 反骚扰政策 **第九章:离职管理** - 9.1 离职类型 - 9.2 离职流程 - 9.3 竞业限制 **附录** - 常用表格 - 联系方式 - 版本记录 请根据公司类型(创业公司/中型企业/大型企业/外企)调整内容风格和详细程度。 PROMPT echo "" echo "📌 输入信息: -请提供公司类型和行业" ;; template) cat <<'PROMPT' ## 📝 HR模板库 ### 可用模板列表 **招聘类** 1. Offer Letter (录用通知书) 2. 面试评估表 3. 背景调查授权书 4. 实习协议 **合同类** 5. 劳动合同 (标准版) 6. 保密协议 (NDA) 7. 竞业限制协议 8. 劳务合同 **日常管理类** 9. 转正申请表 10. 调岗通知书 11. 警告信 12. 奖励通知 **离职类** 13. 离职申请表 14. 工作交接单 15. 离职证明 16. 离职面谈记录 **其他** 17. 员工信息登记表 18. 培训签到表 19. 满意度调查问卷 20. 年度评估表 请指定模板名称或编号,生成完整内容(含填写示例)。 PROMPT echo "" echo "📌 输入信息: -请指定模板名称或编号" ;; help|*) cat <<'EOF' HR Toolkit — HR工具包 Usage: bash hr.sh <command> [args...] Commands: recruit 招聘流程管理 — JD生成、面试流程、评估表 onboard 入职办理 — 入职清单、欢迎信、培训安排 offboard 离职管理 — 离职流程、交接清单、离职面谈 policy 制度规范 — 考勤、休假、报销、行为规范 handbook 员工手册 — 完整员工手册生成 template HR模板库 — 常用HR文档模板 Examples: bash hr.sh recruit "senior backend engineer" bash hr.sh onboard "张三 产品经理" bash hr.sh policy "考勤" bash hr.sh template "offer letter" Powered by BytesAgain | bytesagain.com | [email protected] EOF ;; esac FILE:scripts/script.sh #!/usr/bin/env bash # hr-toolkit - Multi-purpose utility tool set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/hr-toolkit}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF hr-toolkit v$VERSION Multi-purpose utility tool Usage: hr-toolkit <command> [args] Commands: run Execute main function config Configuration status Show status init Initialize list List items add Add entry remove Remove entry search Search export Export data info Show info help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_run() { echo " Running: $1" _log "run" "-" } cmd_config() { echo " Config: $DATA_DIR/config.json" _log "config" "-" } cmd_status() { echo " Status: ready" _log "status" "-" } cmd_init() { echo " Initialized in $DATA_DIR" _log "init" "-" } cmd_list() { [ -f "$DB" ] && cat "$DB" || echo " (empty)" _log "list" "-" } cmd_add() { echo "$(date +%Y-%m-%d) $*" >> "$DB"; echo " Added: $*" _log "add" "-" } cmd_remove() { echo " Removed: $1" _log "remove" "-" } cmd_search() { grep -i "$1" "$DB" 2>/dev/null || echo " Not found: $1" _log "search" "-" } cmd_export() { [ -f "$DB" ] && cat "$DB" || echo "No data" _log "export" "-" } cmd_info() { echo " Version: $VERSION | Data: $DATA_DIR" _log "info" "-" } case "-help" in run) shift; cmd_run "$@" ;; config) shift; cmd_config "$@" ;; status) shift; cmd_status "$@" ;; init) shift; cmd_init "$@" ;; list) shift; cmd_list "$@" ;; add) shift; cmd_add "$@" ;; remove) shift; cmd_remove "$@" ;; search) shift; cmd_search "$@" ;; export) shift; cmd_export "$@" ;; info) shift; cmd_info "$@" ;; help|-h) show_help ;; version|-v) echo "hr-toolkit v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:tips.md # HR Toolkit — Tips ## 使用建议 1. **招聘 (recruit)**: 提供职位名称、级别、部门信息,生成更精准的JD和面试流程 2. **入职 (onboard)**: 指定员工姓名和职位,生成个性化入职清单 3. **离职 (offboard)**: 包含离职原因分类,帮助做好知识交接 4. **制度 (policy)**: 支持考勤、休假、报销、行为规范等多种制度类型 5. **手册 (handbook)**: 指定公司类型(创业公司/大厂/外企),生成匹配风格的手册 6. **模板 (template)**: 常用HR文档一键生成,支持中英文 ## 最佳实践 - 招聘JD要包含薪资范围,提升投递率 - 入职清单分为"入职前/入职当天/入职首周/入职首月"四个阶段 - 离职面谈模板要中性客观,收集真实反馈 - 制度文档建议每半年审查更新一次 - 员工手册要有版本号和更新日期
SOP标准操作流程编写工具。创建SOP、流程图、检查清单、审核评估、模板库、培训材料。SOP writer with create, flowchart, checklist, audit, template.
--- version: "2.0.0" name: sop-writer description: "SOP标准操作流程编写工具。创建SOP、流程图、检查清单、审核评估、模板库、培训材料。SOP writer with create, flowchart, checklist, audit, template." author: BytesAgain homepage: https://bytesagain.com source: https://github.com/bytesagain/ai-skills --- # sop-writer SOP标准操作流程编写工具。创建SOP、流程图、检查清单、审核评估、模板库、培训材料。SOP writer with create, flowchart, checklist, audit, template, and training materials. ## 与手动操作对比 | | 手动 | 使用本工具 | | Command | Description | |---------|-------------| | `create` | 创建完整SOP文档(目的/范围/职责/步骤/记录) | | `flowchart` | 生成ASCII/Mermaid流程图 | | `checklist` | 从SOP提取执行检查清单 | | `audit` | SOP审核评估(完整性/合规性/可执行性) | | `template` | SOP模板库(按行业/场景) | | `train` | 生成培训材料(测试题/操作手册/快速指南) | ## 命令列表 | 命令 | 功能 | |------|------| | `create` | create | | `flowchart` | flowchart | | `checklist` | checklist | | `audit` | audit | | `template` | template | | `train` | train | ## 专业建议 - Identify the process to document - Run: `bash scripts/sop.sh <command> [process] [industry]` - Present the structured SOP document - Offer enhancements: flowchart, checklist, training materials - Document Control** — version, date, author, approver --- *sop-writer by BytesAgain* --- 💬 Feedback & Feature Requests: https://bytesagain.com/feedback Powered by BytesAgain | bytesagain.com ## Examples ```bash # Show help sop-writer help # Run sop-writer run ``` ## Commands Run `sop-writer help` to see all available commands. FILE:scripts/script.sh #!/usr/bin/env bash # sop-writer - Content creation and optimization assistant set -euo pipefail VERSION="2.0.0" DATA_DIR="-${XDG_DATA_HOME:-$HOME/.local/share/sop-writer}" DB="$DATA_DIR/data.log" mkdir -p "$DATA_DIR" show_help() { cat << EOF sop-writer v$VERSION Content creation and optimization assistant Usage: sop-writer <command> [args] Commands: draft Create draft headline Generate headlines outline Content outline seo SEO tips schedule Content schedule hooks Opening hooks cta Call to action repurpose Repurpose content metrics Content metrics ideas Content ideas help Show this help version Show version Data: \$DATA_DIR EOF } _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } cmd_draft() { echo " Draft: $1 Target: -800 words" _log "draft" "-" } cmd_headline() { echo " 1. How to $1 2. $1: Complete Guide 3. Why $1 Matters" _log "headline" "-" } cmd_outline() { echo " 1. Intro | 2. Problem | 3. Solution | 4. Examples | 5. CTA" _log "outline" "-" } cmd_seo() { echo " Keywords: $1 | Title tag | Meta desc | H1-H3 | Internal links" _log "seo" "-" } cmd_schedule() { echo " Mon: Research | Tue: Write | Wed: Edit | Thu: Publish | Fri: Promote" _log "schedule" "-" } cmd_hooks() { echo " Question | Statistic | Story | Bold claim | Controversy" _log "hooks" "-" } cmd_cta() { echo " Subscribe | Share | Comment | Try it | Learn more" _log "cta" "-" } cmd_repurpose() { echo " Blog -> Thread -> Video -> Carousel -> Newsletter" _log "repurpose" "-" } cmd_metrics() { echo " Views | Clicks | Shares | Time on page | Conversions" _log "metrics" "-" } cmd_ideas() { echo " How-to | Listicle | Case study | Interview | Comparison" _log "ideas" "-" } case "-help" in draft) shift; cmd_draft "$@" ;; headline) shift; cmd_headline "$@" ;; outline) shift; cmd_outline "$@" ;; seo) shift; cmd_seo "$@" ;; schedule) shift; cmd_schedule "$@" ;; hooks) shift; cmd_hooks "$@" ;; cta) shift; cmd_cta "$@" ;; repurpose) shift; cmd_repurpose "$@" ;; metrics) shift; cmd_metrics "$@" ;; ideas) shift; cmd_ideas "$@" ;; help|-h) show_help ;; version|-v) echo "sop-writer v$VERSION" ;; *) echo "Unknown: $1"; show_help; exit 1 ;; esac FILE:scripts/sop.sh #!/usr/bin/env bash set -euo pipefail CMD="-help" PROCESS="-general" INDUSTRY="-general" show_help() { cat <<'HELP' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 SOP Writer — 标准操作流程生成器 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Usage: bash sop.sh <command> [process] [industry] Commands: create 创建完整SOP文档(目的/范围/职责/步骤/记录) flowchart 生成ASCII/Mermaid流程图 checklist 从SOP提取执行检查清单 audit SOP审核评估(完整性/合规性/可执行性) template SOP模板库(按行业/场景) train 生成培训材料(测试题/操作手册/快速指南) Options: process 流程名称 (onboarding/deployment/incident/general) industry 行业 (tech/manufacturing/healthcare/food/general) Examples: bash sop.sh create onboarding tech bash sop.sh flowchart deployment general bash sop.sh checklist incident tech Powered by BytesAgain | bytesagain.com | [email protected] HELP } cmd_create() { local process="$1" industry="$2" local today today=$(date +%Y-%m-%d) cat <<EOF # 📋 Standard Operating Procedure ## Document Control | Field | Value | |-------|-------| | **SOP Title** | process 标准操作流程 | | **Document ID** | SOP-$(echo "$process" | tr '[:lower:]' '[:upper:]')-001 | | **Version** | 1.0 | | **Effective Date** | today | | **Review Date** | $(date -d "+1 year" +%Y-%m-%d 2>/dev/null || date -v+1y +%Y-%m-%d 2>/dev/null || echo "Next Year") | | **Department** | {{department}} | | **Author** | {{author}} | | **Approver** | {{approver}} | | **Industry** | industry | | **Classification** | Internal / Confidential | --- ## 1. Purpose 目的 本SOP旨在规范 **process** 流程,确保: - 操作标准化、可重复 - 质量一致性 - 合规性要求满足 - 知识传承与培训便利化 --- ## 2. Scope 范围 **适用于:** - {{applicable_teams}} 团队/部门 - {{applicable_scenarios}} 场景 **不适用于:** - {{exclusions}} --- ## 3. Definitions 术语定义 | 术语 | 定义 | |------|------| | {{term_1}} | {{definition_1}} | | {{term_2}} | {{definition_2}} | --- ## 4. Responsibilities 职责 (RACI) | 活动 | R (执行) | A (审批) | C (咨询) | I (知会) | |------|----------|----------|----------|----------| | 发起流程 | {{role}} | {{role}} | — | — | | 执行操作 | {{role}} | — | {{role}} | — | | 审核确认 | — | {{role}} | — | {{role}} | | 归档记录 | {{role}} | — | — | {{role}} | --- ## 5. Procedure 操作步骤 ### 5.1 准备阶段 | 步骤 | 操作 | 负责人 | 标准/注意事项 | |------|------|--------|---------------| | 1 | {{action}} | {{role}} | {{criteria}} | | 2 | {{action}} | {{role}} | {{criteria}} | ### 5.2 执行阶段 | 步骤 | 操作 | 负责人 | 标准/注意事项 | |------|------|--------|---------------| | 3 | {{action}} | {{role}} | {{criteria}} | | 4 | {{action}} | {{role}} | {{criteria}} | | 5 | {{action}} | {{role}} | {{criteria}} | ### 5.3 验证阶段 | 步骤 | 操作 | 负责人 | 标准/注意事项 | |------|------|--------|---------------| | 6 | {{action}} | {{role}} | {{criteria}} | | 7 | {{action}} | {{role}} | {{criteria}} | ### 5.4 收尾阶段 | 步骤 | 操作 | 负责人 | 标准/注意事项 | |------|------|--------|---------------| | 8 | {{action}} | {{role}} | {{criteria}} | --- ## 6. Exception Handling 异常处理 | 异常情况 | 处理方式 | 升级路径 | 时限 | |----------|----------|----------|------| | {{exception}} | {{handling}} | {{escalation}} | {{timeline}} | --- ## 7. Records 记录 | 记录名称 | 保存位置 | 保存期限 | 负责人 | |----------|----------|----------|--------| | {{record}} | {{location}} | {{retention}} | {{owner}} | --- ## 8. KPIs 关键指标 | 指标 | 目标值 | 计算方式 | 监测频率 | |------|--------|----------|----------| | 完成时间 | {{target}} | 从发起到完成 | 每次 | | 一次通过率 | ≥95% | 无返工次数/总次数 | 每月 | | 合规率 | 100% | 合规次数/总次数 | 每季 | --- ## 9. References 参考文件 - {{reference_1}} - {{reference_2}} --- ## 10. Revision History 修订历史 | 版本 | 日期 | 修订内容 | 修订人 | |------|------|----------|--------| | 1.0 | today | 初始版本 | {{author}} | --- > ⚡ 提示:使用 \`bash sop.sh flowchart\` 生成流程图 > 📝 提示:使用 \`bash sop.sh checklist\` 生成执行清单 EOF } cmd_flowchart() { local process="$1" industry="$2" cat <<EOF # 📊 Flowchart — process ## Mermaid Diagram \`\`\`mermaid flowchart TD A[🚀 Start: process] --> B{Prerequisite Check} B -->|Pass| C[Step 1: Prepare] B -->|Fail| B1[Address Prerequisites] B1 --> B C --> D[Step 2: Execute] D --> E{Quality Check} E -->|Pass| F[Step 3: Review & Approve] E -->|Fail| D1[Rework] D1 --> D F --> G{Approval} G -->|Approved| H[Step 4: Document & Archive] G -->|Rejected| F1[Address Feedback] F1 --> D H --> I[✅ Complete] \`\`\` --- ## ASCII Flowchart \`\`\` ┌─────────────────┐ │ 🚀 START │ └────────┬────────┘ │ ┌────────▼────────┐ │ Prerequisites │ │ met? │──── No ──→ [Fix Issues] ──┐ └────────┬────────┘ │ │ Yes │ ┌────────▼────────┐ │ │ Step 1: Prepare │ ◄─────────────────────────┘ └────────┬────────┘ │ ┌────────▼────────┐ │ Step 2: Execute │ ◄─────┐ └────────┬────────┘ │ │ │ ┌────────▼────────┐ │ │ Quality Check │ │ │ passed? │── No ─┘ └────────┬────────┘ │ Yes ┌────────▼────────┐ │ Step 3: Review │ │ & Approve │──── Rejected ──→ [Rework] ──┐ └────────┬────────┘ │ │ Approved │ ┌────────▼────────┐ │ │ Step 4: Archive │ ◄───────────────────────────┘ └────────┬────────┘ │ ┌────────▼────────┐ │ ✅ COMPLETE │ └─────────────────┘ \`\`\` --- ## Decision Points Summary | # | Decision | Yes Path | No Path | |---|----------|----------|---------| | 1 | Prerequisites met? | Proceed to Step 1 | Fix issues, retry | | 2 | Quality check passed? | Proceed to Review | Rework, re-execute | | 3 | Approval granted? | Archive & Complete | Address feedback | > 💡 Copy the Mermaid code into any Mermaid-compatible tool to render the diagram. EOF } cmd_checklist() { local process="$1" industry="$2" cat <<EOF # ✅ Execution Checklist — process **Process:** process | **Industry:** industry **Date:** __________ | **Executor:** __________ --- ## Pre-Execution (准备阶段) - [ ] 确认所有前置条件满足 - [ ] 获取必要的权限和审批 - [ ] 准备所需工具/材料/文档 - [ ] 通知相关人员 - [ ] 确认回退方案就绪 ## Execution (执行阶段) - [ ] **Step 1:** __________ - [ ] 子步骤 1.1 - [ ] 子步骤 1.2 - [ ] 验证点 ✓ - [ ] **Step 2:** __________ - [ ] 子步骤 2.1 - [ ] 子步骤 2.2 - [ ] 验证点 ✓ - [ ] **Step 3:** __________ - [ ] 子步骤 3.1 - [ ] 子步骤 3.2 - [ ] 验证点 ✓ ## Verification (验证阶段) - [ ] 功能/质量验证通过 - [ ] 性能/指标符合预期 - [ ] 无异常错误或告警 - [ ] 相关方确认结果 ## Post-Execution (收尾阶段) - [ ] 更新相关文档 - [ ] 记录执行时间和结果 - [ ] 通知利益相关方完成 - [ ] 归档操作记录 - [ ] 总结经验教训 (如有) --- ## Sign-off 签字 | Role | Name | Signature | Date | |------|------|-----------|------| | 执行人 | __________ | __________ | __________ | | 审核人 | __________ | __________ | __________ | | 批准人 | __________ | __________ | __________ | --- ## Exceptions Log 异常记录 | # | 异常描述 | 处理方式 | 处理人 | 时间 | |---|----------|----------|--------|------| | 1 | | | | | | 2 | | | | | EOF } cmd_audit() { local process="$1" industry="$2" cat <<EOF # 🔍 SOP Audit Report — process **Audit Date:** $(date +%Y-%m-%d) **Industry:** industry **Auditor:** __________ --- ## Audit Dimensions (评估维度) ### 1. Completeness 完整性 (权重30%) | Check Item | Status | Score (1-5) | Notes | |------------|--------|-------------|-------| | 目的明确 | ⬜ | /5 | | | 范围界定清晰 | ⬜ | /5 | | | 职责分配明确(RACI) | ⬜ | /5 | | | 步骤详细可执行 | ⬜ | /5 | | | 异常处理覆盖 | ⬜ | /5 | | | 记录要求明确 | ⬜ | /5 | | | 参考文件完整 | ⬜ | /5 | | | 版本控制规范 | ⬜ | /5 | | ### 2. Compliance 合规性 (权重25%) | Check Item | Status | Score (1-5) | Notes | |------------|--------|-------------|-------| | 符合行业标准 | ⬜ | /5 | | | 满足法规要求 | ⬜ | /5 | | | 安全规范覆盖 | ⬜ | /5 | | | 数据保护合规 | ⬜ | /5 | | ### 3. Executability 可执行性 (权重25%) | Check Item | Status | Score (1-5) | Notes | |------------|--------|-------------|-------| | 新员工可独立执行 | ⬜ | /5 | | | 步骤无歧义 | ⬜ | /5 | | | 工具/资源可获取 | ⬜ | /5 | | | 时间估算合理 | ⬜ | /5 | | ### 4. Maintainability 可维护性 (权重20%) | Check Item | Status | Score (1-5) | Notes | |------------|--------|-------------|-------| | 定期审查机制 | ⬜ | /5 | | | 版本管理规范 | ⬜ | /5 | | | 变更流程明确 | ⬜ | /5 | | | 格式统一标准 | ⬜ | /5 | | --- ## Overall Score | Dimension | Weight | Score | Weighted | |-----------|--------|-------|----------| | Completeness | 30% | /5 | | | Compliance | 25% | /5 | | | Executability | 25% | /5 | | | Maintainability | 20% | /5 | | | **Total** | **100%** | | **/5** | ## Rating Scale | Score | Rating | Action | |-------|--------|--------| | 4.5-5.0 | ⭐ Excellent | Maintain, minor tweaks | | 3.5-4.4 | ✅ Good | Minor improvements | | 2.5-3.4 | ⚠️ Fair | Significant revision needed | | 1.0-2.4 | ❌ Poor | Major rewrite required | --- ## Recommendations 改进建议 1. __________ 2. __________ 3. __________ EOF } cmd_template() { local process="$1" industry="$2" cat <<EOF # 📚 SOP Template Library **Industry:** industry --- ## Available Templates by Category ### 🏢 General Business | Template | Use Case | Complexity | |----------|----------|------------| | Employee Onboarding | 新员工入职流程 | ⭐⭐ | | Employee Offboarding | 员工离职流程 | ⭐⭐ | | Purchase Request | 采购申请流程 | ⭐ | | Travel Reimbursement | 差旅报销 | ⭐ | | Document Approval | 文件审批流程 | ⭐⭐ | ### 💻 Tech / IT | Template | Use Case | Complexity | |----------|----------|------------| | Code Deployment | 代码发布上线 | ⭐⭐⭐ | | Incident Response | 故障响应处理 | ⭐⭐⭐ | | Server Provisioning | 服务器配置 | ⭐⭐ | | Access Control | 权限管理 | ⭐⭐ | | Backup & Recovery | 备份与恢复 | ⭐⭐⭐ | ### 🏭 Manufacturing | Template | Use Case | Complexity | |----------|----------|------------| | Quality Inspection | 质量检验 | ⭐⭐ | | Equipment Maintenance | 设备维护 | ⭐⭐ | | Material Receipt | 物料验收 | ⭐⭐ | | Production Changeover | 产线切换 | ⭐⭐⭐ | ### 🏥 Healthcare | Template | Use Case | Complexity | |----------|----------|------------| | Patient Intake | 患者接诊 | ⭐⭐ | | Medication Administration | 给药流程 | ⭐⭐⭐ | | Sterilization | 消毒灭菌 | ⭐⭐ | | Emergency Response | 急救响应 | ⭐⭐⭐ | --- > 💡 Use \`bash sop.sh create <process> <industry>\` to generate a full SOP from any template. EOF } cmd_train() { local process="$1" industry="$2" cat <<EOF # 🎓 Training Materials — process **Industry:** industry **Generated:** $(date +%Y-%m-%d) --- ## Quick Reference Card (口袋指南) ### process — 快速指南 \`\`\` ┌─────────────────────────────────────┐ │ 📋 process Quick Reference │ ├─────────────────────────────────────┤ │ │ │ Step 1: __________ │ │ Step 2: __________ │ │ Step 3: __________ │ │ Step 4: __________ │ │ │ │ ⚠️ Key Reminders: │ │ • __________ │ │ • __________ │ │ │ │ 🆘 Emergency Contact: │ │ • __________ │ └─────────────────────────────────────┘ \`\`\` --- ## Knowledge Test (培训测验) ### Multiple Choice (单选题) **Q1.** process的第一步是什么? - A) __________ - B) __________ - C) __________ - D) __________ **Q2.** 发现异常情况时,应首先? - A) 自行处理 - B) 记录并上报 - C) 忽略继续操作 - D) 联系外部供应商 **Q3.** 操作记录应保存多长时间? - A) 1个月 - B) 6个月 - C) 1年 - D) 按公司规定 ### True/False (判断题) **Q4.** ⬜ 所有操作步骤可以根据经验自行调整顺序 **Q5.** ⬜ 异常情况必须记录在案 ### Short Answer (简答题) **Q6.** 请列出process的3个关键验证点。 **Q7.** 如果在步骤X遇到Y情况,你会如何处理? --- ## Training Completion Record | Item | Details | |------|---------| | 培训人 | __________ | | 培训日期 | __________ | | 培训师 | __________ | | 考试得分 | ____ / 100 | | 实操评估 | ⬜ 通过 ⬜ 需复训 | | 签字 | __________ | EOF } case "$CMD" in create) cmd_create "$PROCESS" "$INDUSTRY" ;; flowchart) cmd_flowchart "$PROCESS" "$INDUSTRY" ;; checklist) cmd_checklist "$PROCESS" "$INDUSTRY" ;; audit) cmd_audit "$PROCESS" "$INDUSTRY" ;; template) cmd_template "$PROCESS" "$INDUSTRY" ;; train) cmd_train "$PROCESS" "$INDUSTRY" ;; help|--help|-h) show_help ;; *) echo "❌ Unknown command: $CMD" echo "Run 'bash sop.sh help' for usage." exit 1 ;; esac FILE:tips.md # SOP Writer — Prompt Tips ## When User Asks for SOP Documents 1. Identify the process to document 2. Run: `bash scripts/sop.sh <command> [process] [industry]` 3. Present the structured SOP document 4. Offer enhancements: flowchart, checklist, training materials ## SOP Structure (ISO-aligned) 1. **Document Control** — version, date, author, approver 2. **Purpose** — why this SOP exists 3. **Scope** — what it covers and doesn't 4. **Responsibilities** — RACI matrix 5. **Procedure** — step-by-step with decision points 6. **Records** — what to document and retain 7. **References** — related docs and standards 8. **Revision History** — change log ## Key Principles - **Clarity** — a new employee should understand it - **Measurability** — include KPIs and acceptance criteria - **Traceability** — every step should produce a record - **Compliance** — align with relevant standards (ISO 9001, etc.) - **Visual aids** — flowcharts > walls of text