技能详情(站内镜像,无评论)
许可证:MIT-0
MIT-0 ·免费使用、修改和重新分发。无需归因。
版本:v1.0.0
统计:⭐ 0 · 27 · 0 current installs · 0 all-time installs
⭐ 0
安装量(当前) 0
🛡 VirusTotal :良性 · OpenClaw :可疑
Package:abdur-rahmaanj/shopyo
安全扫描(ClawHub)
- VirusTotal :良性
- OpenClaw :可疑
OpenClaw 评估
This is an instruction-only documentation skill for the Shopyo Flask framework, but its runtime instructions expect local CLI/tools and environment variables that the skill metadata does not declare and the skill has no source/homepage — the mismatch deserves caution.
目的
The SKILL.md documents a modular Flask framework and CLI usage (shopyo, flask, DB commands). However the skill metadata lists no source or homepage and declares no required binaries or env vars. For a CLI-oriented framework, one would expect at least 'shopyo'/'flask' as required binaries or an install instruction or a trusted source — their absence is inconsistent.
说明范围
The instructions tell the agent/user to run commands that modify the filesystem and local DB (shopyo initialise, db migrate/upgrade, clean, collectstatic). They also instruct setting env vars (SHOPYO_CONFIG_PROFILE, FLASK_ENV, FLASK_APP) that are not declared in metadata. While these actions are normal for a web framework, the skill grants no explicit constraints and the metadata omits these runtime expectations.
安装机制
No install spec and no code files are present, so the skill is instruction-only and does not install anything itself. This lowers direct install risk, but also means the SKILL.md assumes external tools are already installed from elsewhere.
证书
The metadata declares no required environment or credentials, yet the instructions reference several environment variables to control behavior. The doc also documents a default admin email/password after initialization (admin@domain.com / pass) — useful for dev but insecure if used inadvertently in a non-isolated environment.
持久
The skill does not request persistent presence (always:false) and does not modify other skills or system-wide settings. Autonomous model invocation is allowed by default but is not accompanied by extra privileges here.
安装(复制给龙虾 AI)
将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。
请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「shopyo」。简介:Modular Flask framework for building scalable, maintainable web apps with isola…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/abdur-rahmaanj/shopyo/SKILL.md
(来源:yingzhi8.cn 技能库)
SKILL.md
# Shopyo Skill
Shopyo is a modular Flask framework designed for maintainability, extensibility, and real-world scale.
## Project Structure
A typical Shopyo project:
```
/project_root
├── app.py # Entry point, defines create_app()
├── init.py # Extension initializer (db, login_manager, etc.)
├── manage.py # CLI entry point
├── config.py # Profile-based configuration
└── modules/ # Modular code
├── box__default/
│ ├── auth/
│ └── settings/
└── my_custom_module/
```
## CLI Commands
```bash
# Environment setup
export SHOPYO_CONFIG_PROFILE=development
export FLASK_ENV=development
export FLASK_APP=app.py
# New project
shopyo new myproject --demo
cd myproject
shopyo initialise
# Create module
shopyo startapp modulename [boxname]
# Create box
shopyo startbox box__name
# Run server
shopyo run
flask run --debug
# Database
shopyo initialise # Fresh start (creates db, migrations, default users)
shopyo db migrate
shopyo db upgrade
shopyo clean # Reset local database
# Static files
shopyo collectstatic [module_path] # Collect static files from modules
# Other
shopyo routes # Show all routes
shopyo audit # Find project issues
shopyo rename old_name new_name # Rename module
```
## Creating a Module
```bash
shopyo startapp blog
# or with box
shopyo startapp blog box__ecommerce
```
Creates:
```
modules/blog/
├── __init__.py
├── forms.py
├── global.py
├── info.json
├── models.py
├── view.py
├── static/
├── templates/
│ └── blog/
│ ├── blocks/
│ │ └── sidebar.html
│ ├── dashboard.html
│ └── index.html
└── tests/
├── test_blog_functional.py
└── test_blog_models.py
```
## info.json Structure
```json
{
"author": {"mail": "", "name": "", "website": ""},
"display_string": "Page",
"module_name": "page",
"type": "show",
"fa-icon": "fa fa-store",
"url_prefix": "/page",
"dashboard": "/dashboard"
}
```
## Module View Pattern
```python
from shopyo.api.module import ModuleHelp
mhelp = ModuleHelp(__file__, __name__)
blueprint = mhelp.blueprint
@blueprint.route("/")
def index():
context = mhelp.context()
context.update({'message': 'Hello'})
return mhelp.render('index.html', **context)
```
## Models Pattern
```python
from init import db
from shopyo.api.models import PkModel
class MyModel(PkModel):
__tablename__ = 'mymodel'
name = db.Column(db.String(100))
```
## Templates
Extend the base template:
```html
{% extends "shopyo_base/main_base.html" %}
{% block content %}
<h1>Hello</h1>
{% endblock %}
```
Use `yo_render`:
```python
from shopyo.api.templates import yo_render
@blueprint.route("/demo")
def demo():
return yo_render('blog/demo.html', {'key': 'value'})
```
## Shopyo API
Key imports:
```python
from shopyo.api.module import ModuleHelp, get_module, dispatch
from shopyo.api.models import PkModel
from shopyo.api.templates import yo_render
from shopyo.api.database import db
from shopyo.api.enhance import enhance_html
```
## Inter-Module Communication
Use the event system:
```python
from shopyo.api.module import dispatch
# Dispatch event
dispatch("user:registered", {"email": user.email})
# Listen for event
@dispatch("user:registered")
def send_welcome_email(email):
pass
```
## Testing
```bash
pytest
pytest -v
pytest path/to/test.py
pytest --cov=shopyo
tox
```
## Global.py Pattern
```python
available_everywhere = {"x": 1}
configs = {
"development": {"CONFIG_VAR": "DEVVALUE"},
"production": {"CONFIG_VAR": "PRODVALUE"},
"testing": {"CONFIG_VAR": "TESTVALUE"}
}
```
## Default Credentials
After `shopyo initialise`:
- URL: http://localhost:5000
- Login: http://localhost:5000/auth/login
- Email: `admin@domain.com`
- Password: `pass`
## Key Conventions
- Box folders must start with `box__`
- Modules are isolated - do not import between modules directly
- Use event system (`dispatch`) for inter-module communication
- Run `shopyo initialise` after adding/removing modules
- Static files are collected into `static/modules/` - don't edit directly
- Use `shopyo clean` to reset local development database