一键导入
alps
Create, validate, and improve ALPS profiles. Generate from natural language (nl2alps), validate existing profiles, and get improvement suggestions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create, validate, and improve ALPS profiles. Generate from natural language (nl2alps), validate existing profiles, and get improvement suggestions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | alps |
| description | Create, validate, and improve ALPS profiles. Generate from natural language (nl2alps), validate existing profiles, and get improvement suggestions. |
Generate, validate, and improve ALPS profiles for RESTful API design.
Goal: An ALPS that someone unfamiliar with the app can read and understand.
States = What the user sees
ProductList - viewing a list of productsProductDetail - viewing one productCart - viewing cart contentsTransitions = What the user does
goProductDetail - select a productdoAddToCart - add to cartSelf-documenting
title explains the purposedoc describes behavior and side effectsNo unreachable states
Necessary and sufficient
This skill responds to natural language requests:
Ontology - Semantic descriptors (data elements)
type="semantic" (default)id, title, and optionally doc and def (schema.org link)Taxonomy - State descriptors (screens/pages)
Choreography - Transition descriptors (actions)
type="safe" - Read operations (GET)type="unsafe" - Create operations (POST) - not idempotenttype="idempotent" - Update/Delete operations (PUT/DELETE)rt (return type) pointing to target state| Type | Prefix | Example |
|---|---|---|
| Safe transition | go | goToHome, goProductList, goSearchProducts |
| Unsafe transition | do | doCreateUser, doAddToCart, doLogin |
| Idempotent transition | do | doUpdateUser, doDeleteItem, doRemoveFromCart |
| State/Page | PascalCase | HomePage, ProductDetail, ShoppingCart |
| Semantic field | camelCase | userId, productName, createdAt |
IMPORTANT: Safe transitions (go*) MUST include the target state name in their id.
rt="#ProductList" → id must be goProductList (or goToProductList)rt="#UserProfile" → id must be goUserProfile (or goToUserProfile)Invalid examples:
goStart with rt="#ProductList" - Wrong! Should be goProductListgoNext with rt="#Checkout" - Wrong! Should be goCheckoutThis rule ensures consistency and makes the diagram self-documenting. When a transition has no source state (entry point), it will be displayed as originating from UnknownState in the diagram.
Context clues for AI inference:
PUT (Update) indicators:
update, edit, modify, change, set, replacedoUpdateProfile, doEditComment, doSetQuantityDELETE indicators:
delete, remove, cancel, clear, destroydoDeleteUser, doRemoveFromCart, doCancelOrderIdentify Entities (Ontology)
Identify States (Taxonomy)
Identify Transitions (Choreography)
Add Documentation
titledoc explaining behaviordef)Add Tags for Organization
search, product, cart, checkout, order, account, review)flow- prefix (e.g., flow-purchase, flow-register, flow-return)"tag": ["cart", "flow-purchase"]Add Semantic Descriptors to Transitions
{"id": "goProductDetail", "type": "safe", "rt": "#ProductDetail", "tag": ["product"], "descriptor": [
{"href": "#productId"}
]},
{"id": "doAddToCart", "type": "unsafe", "rt": "#Cart", "tag": ["cart", "flow-purchase"], "descriptor": [
{"href": "#productId"},
{"href": "#quantity"},
{"href": "#selectedVariant"}
]}
MANDATORY: Validate After Generation
asd --validate <file> to validate (outputs JSON per validation-result.json schema)Generate JSON format by default. Use XML only if explicitly requested.
{
"$schema": "https://alps-io.github.io/schemas/alps.json",
"alps": {
"title": "Application Title",
"doc": {"value": "Description of the application"},
"descriptor": [
// Ontology: semantic fields
{"id": "fieldName", "title": "Human Title", "doc": {"value": "Description"}},
// Taxonomy: states
{"id": "StateName", "title": "State Title", "descriptor": [
{"href": "#fieldName"},
{"href": "#transitionName"}
]},
// Choreography: transitions
{"id": "goToState", "type": "safe", "rt": "#TargetState", "title": "Navigate to State"},
{"id": "doAction", "type": "unsafe", "rt": "#ResultState", "title": "Perform Action",
"descriptor": [{"href": "#requiredField"}]}
]
}
}
Use asd --validate <file> to validate ALPS profiles. Output conforms to the validation-result.json schema.
goStart with rt="#ProductList" should be goProductList)Input: "Create an ALPS for a simple blog with posts and comments"
Output:
{
"$schema": "https://alps-io.github.io/schemas/alps.json",
"alps": {
"title": "Simple Blog",
"doc": {"value": "ALPS profile for a blog application with posts and comments"},
"descriptor": [
{"id": "postId", "title": "Post ID", "def": "https://schema.org/identifier"},
{"id": "title", "title": "Post Title", "def": "https://schema.org/headline"},
{"id": "body", "title": "Post Body", "def": "https://schema.org/articleBody"},
{"id": "authorName", "title": "Author Name", "def": "https://schema.org/author"},
{"id": "createdAt", "title": "Created Date", "def": "https://schema.org/dateCreated"},
{"id": "commentId", "title": "Comment ID"},
{"id": "commentBody", "title": "Comment Text"},
{"id": "Home", "title": "Home Page", "descriptor": [
{"href": "#goPostList"}
]},
{"id": "PostList", "title": "Post List", "descriptor": [
{"href": "#postId"},
{"href": "#title"},
{"href": "#authorName"},
{"href": "#goPostDetail"},
{"href": "#goHome"}
]},
{"id": "PostDetail", "title": "Post Detail", "descriptor": [
{"href": "#postId"},
{"href": "#title"},
{"href": "#body"},
{"href": "#authorName"},
{"href": "#createdAt"},
{"href": "#Comment"},
{"href": "#goPostList"},
{"href": "#doCreateComment"}
]},
{"id": "Comment", "title": "Comment", "descriptor": [
{"href": "#commentId"},
{"href": "#commentBody"},
{"href": "#authorName"},
{"href": "#createdAt"},
{"href": "#doDeleteComment"}
]},
{"id": "goHome", "type": "safe", "rt": "#Home", "title": "Go to Home"},
{"id": "goPostList", "type": "safe", "rt": "#PostList", "title": "View Post List"},
{"id": "goPostDetail", "type": "safe", "rt": "#PostDetail", "title": "View Post Detail",
"descriptor": [{"href": "#postId"}]},
{"id": "doCreatePost", "type": "unsafe", "rt": "#PostDetail", "title": "Create Post",
"descriptor": [{"href": "#title"}, {"href": "#body"}]},
{"id": "doUpdatePost", "type": "idempotent", "rt": "#PostDetail", "title": "Update Post",
"descriptor": [{"href": "#postId"}, {"href": "#title"}, {"href": "#body"}]},
{"id": "doDeletePost", "type": "idempotent", "rt": "#PostList", "title": "Delete Post",
"descriptor": [{"href": "#postId"}]},
{"id": "doCreateComment", "type": "unsafe", "rt": "#PostDetail", "title": "Add Comment",
"descriptor": [{"href": "#postId"}, {"href": "#commentBody"}]},
{"id": "doDeleteComment", "type": "idempotent", "rt": "#PostDetail", "title": "Delete Comment",
"descriptor": [{"href": "#commentId"}]}
]
}
}
Generated ALPS profiles can be visualized using app-state-diagram:
# Generate HTML diagram
asd profile.json
# Generate with watch mode
asd --watch profile.json
# Generate markdown documentation
asd --mode=markdown profile.json
tag attribute to group related descriptors