Skip to content

Add Node.js and WASM skill templates to skill create#29

Open
mduongvandinh wants to merge 1 commit intoRightNow-AI:mainfrom
mduongvandinh:feat/skill-templates
Open

Add Node.js and WASM skill templates to skill create#29
mduongvandinh wants to merge 1 commit intoRightNow-AI:mainfrom
mduongvandinh:feat/skill-templates

Conversation

@mduongvandinh
Copy link

Summary

  • openfang skill create now generates proper templates for Node.js and WASM runtimes
  • Fix manifest entry path being hardcoded to src/main.py regardless of runtime

Changes

  • Node.js template: stdin JSON processing with async/await and for await stdin chunks
  • WASM template: Rust source targeting wasm32-wasi with serde_json and build instructions
  • Manifest fix: entry field now correctly set per runtime (src/main.py, src/index.js, src/lib.rs)
  • Fallback improvement: unknown runtimes generate full Python template instead of useless one-liner
  • WASM hint: prints Cargo.toml setup instructions after creating WASM skill

Test plan

  • cargo build --workspace --lib passes
  • cargo clippy -p openfang-cli --all-targets -- -D warnings zero warnings
  • cargo fmt --all --check clean

Files changed

  • crates/openfang-cli/src/main.rs (+85, -9)

openfang skill create now generates proper entry point templates for
node (stdin JSON processing with async/await) and wasm (wasm32-wasi
with serde_json). The manifest entry path is set correctly per runtime
instead of always defaulting to src/main.py. Unknown runtimes now
generate a full Python template as fallback instead of a stub comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant