Files
maoshen 81632c1b35 docs: 添加项目文档和 AgentSkills
- 添加架构文档 (ARCHITECTURE.md)
- 添加 API 文档 (API.md)
- 添加文档索引 (docs/README.md)
- 添加部署技能 (skills/city-manual-deploy/SKILL.md)
- 添加测试技能 (skills/city-manual-test/SKILL.md)
- 添加内容管理技能 (skills/city-manual-content/SKILL.md)
2026-04-12 13:36:21 +00:00

4.8 KiB
Raw Permalink Blame History

Skill: city-manual-content

Description

城市手册内容管理技能。用于管理城市内容、文章和特色服务。

Location

/root/.openclaw/workspace/city-manual/skills/city-manual-content/

Capabilities

  • 创建和编辑文章
  • 管理特色服务
  • 内容审核
  • 版块管理
  • 内容导入导出

Usage

当用户提到以下关键词时激活此技能:

  • "创建文章"
  • "编辑内容"
  • "管理特色服务"
  • "内容审核"
  • "版块管理"

Database Schema

文章表 (articles_article)

CREATE TABLE articles_article (
    id SERIAL PRIMARY KEY,
    title VARCHAR(200) NOT NULL,
    content TEXT NOT NULL,
    region_id INTEGER REFERENCES regions_region(id),
    category VARCHAR(50),
    author_id INTEGER REFERENCES users_user(id),
    moderator_id INTEGER REFERENCES users_user(id),
    status VARCHAR(20),
    view_count INTEGER DEFAULT 0,
    created_at TIMESTAMP,
    updated_at TIMESTAMP
);

特色服务表 (services_featuredservice)

CREATE TABLE services_featuredservice (
    id SERIAL PRIMARY KEY,
    name VARCHAR(200) NOT NULL,
    description TEXT,
    region_id INTEGER REFERENCES regions_region(id),
    category VARCHAR(50),
    address VARCHAR(500),
    contact VARCHAR(200),
    rating DECIMAL(3,2),
    status VARCHAR(20),
    author_id INTEGER REFERENCES users_user(id),
    created_at TIMESTAMP,
    updated_at TIMESTAMP
);

Content Categories

文章分类

  • history - 历史
  • culture - 文化
  • practical - 实用信息
  • life - 生活指南

特色服务分类

  • clothing - 衣
  • food - 食
  • accommodation - 住
  • transportation - 行
  • entertainment - 娱乐
  • tourism - 旅游
  • culture - 文化

Workflows

内容创建流程

1. 用户创建内容
   ↓
2. 保存到数据库status=draft
   ↓
3. 提交审核status=pending
   ↓
4. 版主初审
   ↓
5. AI 审核
   ↓
6. 发布status=published

内容审核规则

版主审核权限:

  • 版主只能审核管辖范围内的内容
  • 上级版主可以审核下级版块内容
  • 管理员可以审核所有内容

AI 审核规则:

  • 检查敏感词
  • 检查内容质量
  • 检查重复内容
  • 检查违规信息

Commands

创建文章

cd /root/.openclaw/workspace/city-manual/backend
python manage.py shell

>>> from apps.articles.models import Article
>>> article = Article.objects.create(
...     title="文章标题",
...     content="文章内容",
...     region_id=1,
...     category="history",
...     author_id=1,
...     status="draft"
... )

批量导入内容

import json

with open('content.json', 'r', encoding='utf-8') as f:
    data = json.load(f)

for item in data:
    Article.objects.create(
        title=item['title'],
        content=item['content'],
        region_id=item['region_id'],
        category=item['category'],
        status='published'
    )

内容审核

# 版主审核
article = Article.objects.get(id=1)
article.moderator_id = 1
article.moderator_reviewed_at = timezone.now()
article.moderator_status = 'approved'
article.status = 'pending_ai'
article.save()

# AI 审核
article.ai_status = 'approved'
article.ai_reviewed_at = timezone.now()
article.status = 'published'
article.save()

内容导出

import json
from django.core.serializers import serialize

articles = Article.objects.filter(status='published')
data = serialize('python', articles)

with open('articles_export.json', 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False, indent=2)

Content Templates

城市信息模板

# {城市名称}

## 基础信息
- 地理位置:
- 人口:
- 气候:
- 行政区划:

## 历史
{城市历史介绍}

## 文化
- 方言:
- 习俗:
- 节庆:
- 特色小吃:

## 实用信息
- 交通:
- 教育:
- 医疗:
- 商业:

## 生活推荐
- 餐厅:
- 景点:
- 活动:
- 攻略:

特色服务模板

# {服务名称}

## 基本信息
- 分类:
- 地址:
- 联系方式:
- 营业时间:

## 介绍
{服务详细介绍}

## 特色
{服务特色}

## 评价
{用户评价摘要}

## 图片
[图片链接]

Quality Guidelines

内容质量标准

  1. 准确性

    • 信息真实可靠
    • 数据来源可查
    • 及时更新
  2. 完整性

    • 关键信息不缺失
    • 结构清晰
    • 分类正确
  3. 可读性

    • 语言流畅
    • 格式规范
    • 排版美观
  4. 实用性

    • 对用户有价值
    • 信息可操作
    • 本地化特色

审核检查清单

  • 标题准确反映内容
  • 内容无错别字
  • 分类正确
  • 图片清晰
  • 联系方式有效
  • 无违规内容
  • 无敏感信息
  • 格式规范

References