skills/ofajs-docs-en/SKILL.md
Complete documentation knowledge base for ofa.js framework. Use when users ask about ofa.js usage, component development, page modules, routing configuration, state management, or want to build Web applications without Node.js/Webpack.
npx skillsauth add ofajs/ofa.js ofajs-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
computed to define computed properties (ofa.js uses get keyword)query parameter in page modulesattrs and data<template page> + export default async () => ({...})<template component> + returned object must include tag fieldget xxx() {} instead of computed$.stanz()on:click="methodName" or on:click="count++"<o-fill> component<o-if> / <o-else-if> / <o-else> components:toKey="fromKey" one-way passing, sync:toKey="fromKey" two-way binding| ❌ Wrong Way | ✅ Correct Way | Description |
|------------|-----------|------|
| computed: { double() {} } | get double() {} | ofa.js uses getter to define computed properties |
| this.$route.query.id | { query } parameter | Get query parameters through function parameter |
| v-if="show" | <o-if :value="show"> | Use o-if component for conditional rendering |
| v-for="item in list" | <o-fill :value="list"> | Use o-fill component for list rendering |
| @click="handle" | on:click="handle" | Event binding uses on: prefix |
| :class="{ active: isActive }" | class:active="isActive" | Dynamic class uses class: syntax |
| style="width: {{val}}" | :style.width="val" | Inline style binding uses :style. prefix |
| v-model="value" | sync:value="value" | Two-way binding uses sync: syntax |
| props: { msg: String } | attrs: { msg: 'default' } | Component properties use attrs definition |
| methods: { foo() {} } | proto: { foo() {} } | Methods are defined in proto object |
| data() { return { count: 0 } } | data: { count: 0 } | data is an object not a function |
| .click(handler) | .on("click", handler) | Event binding uses .on() method |
| Same key in attrs and data | Keep unique | attrs and data keys cannot be duplicated |
When users need to develop features, judge in the following order:
Need to share data?
├─ Yes → Across multiple layers of components?
│ ├─ Yes → Use o-provider/o-consumer
│ └─ No → Use sync: two-way binding or : one-way passing
└─ No → Use data to define local data
Need list rendering?
├─ Yes → Use o-fill component
│ └─ Need recursive rendering?
│ ├─ Yes → Use name attribute to define template
│ └─ No → Write template directly inside o-fill
└─ No → Write template normally
Need conditional rendering?
├─ Yes → Use o-if/o-else-if/o-else components
└─ No → Write template normally
Need reusable components?
├─ Yes → Use component module (<template component> + tag field)
└─ No → Use page module (<template page>)
Need multi-page application?
├─ Yes → Use o-router + o-app
│ └─ Need nested layout?
│ ├─ Yes → Parent page uses <slot>, child page exports parent
│ └─ No → Independent page
└─ No → Single page application
| Quick Syntax | Corresponding Documentation |
|----------|----------|
| {{variable}} :html | Content Rendering |
| on:click="handler" | Event Binding |
| :prop="value" sync:prop="value" | Property Binding |
| class:active="isActive" :style.width="val" | Class/Style Binding |
| <o-if :value="condition"> | Conditional Rendering |
| <o-fill :value="list"> | List Rendering |
| get computedProp() {} | Computed Properties |
| watch: { prop() {} } | Watchers |
| ready() attached() detached() | Lifecycle |
| <template component> tag attrs | Create Component |
| export default async ({ load, url, query }) | Module Return Object Properties |
| o-provider o-consumer | Context State |
| $.stanz() | State Management |
| o-app o-router | Routes, Micro App |
| Example | Feature Points | Entry | Key Files | |------|----------|------|----------| | Counter | Data binding, events, computed properties, styles | demo.html | page.html | | Switch Component | Component definition, property passing, events, slots | demo.html | switch.html, page.html | | Todo List | Data persistence, list rendering, state management | demo.html | page.html, data.js | | File Editor | Nested component communication, o-provider, dependency injection | demo.html | page.html, filelist.html, editor.html | | SPA Routing | o-router, o-app, page animation | demo.html | app-config.js, layout.html | | SCSR Rendering | Server-side rendering, SEO, isomorphic application | home.html | app-config.js | | Shadow DOM | shadow operations, component method definition | demo.html | shadow-demo.html |
development
ofa.js 框架教程。当用户询问 ofa.js 的使用方法、组件开发、页面模块,或想要构建无需 Node.js/Webpack 的 Web 应用时使用。
development
ofa.js 框架教程。当用户询问 ofa.js 的使用方法、组件开发、页面模块,或想要构建无需 Node.js/Webpack 的 Web 应用时使用。
development
ofa.js 框架完整文档知识库。当用户询问 ofa.js 的使用方法、组件开发、页面模块、路由配置、状态管理,或想要构建无需 Node.js/Webpack 的 Web 应用时使用。
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.