AI Agent Skills

Mashiane

Expert
Licensed User
Longtime User

atinagestion

New Member
Hey! I saw the AgentSkills spec you shared — looks quite interesting for structuring AI capabilities.

Have you managed to create any skill already or test one in a real workflow? I’m curious how practical it is once you move from the documentation to an actual implementation.
 

Mashiane

Expert
Licensed User
Longtime User
Awesome question. In one of our conversations in the forum I was provided with an 'llm' file that one can use. So yesteday after finding this 'skills' thread, i went to Notebook.llm and poked around. I fed it some of the stuff on the "Learn" section of our b4x website.

Anyway to cut a longs story shot, this is an llm file that i am building as I go along during the development of the new B4XDaisy UI Kit for b4a. Its stored in my project folder as I am using VS Code to create this new b4xlib im working on. Funny enough, Im using b4a when the app crashes to find the error logs because ive set everything such that its able to install directly from vscode to my device, take screen shots, record videos and do all sorts of things.

B4X:
SithasoDaisyUIKit workspace findings (updated: 2026-02-16)

1) Register new modules in B4A project file
- When adding new .bas modules under B4A, also update B4A/SithasoDaisyUIKit.b4a:
  - Add ModuleN entries.
  - Increment NumberOfModules.
- Symptom if missed:
  - "Unknown type: <classname>" during compile/parse.

2) HorizontalScrollView Initialize signature in B4A
- Correct order: HorizontalScrollView.Initialize(PanelHeight, EventName)
- Example:
  - hsv.Initialize(0, "hsv")
- Common mistake:
  - hsv.Initialize("hsv", 0) -> runtime NumberFormatException ("For input string: \"hsv\"").

3) install.ps1 validation
- Do not trust BUILD_STATUS alone.
- Confirm no parser/compiler exceptions in output and confirm APK exists at:
  - C:\b4a\workspace\SithasoDaisyUIKit\B4A\Objects\SithasoDaisyUIKit.apk

4) B4XDaisyDiv styling/events
- B4XDaisyDiv now supports:
  - Click event: EventName_Click(Tag As Object)
  - BorderStyle: none|hidden|solid|double|dashed|dotted|groove|ridge|inset|outset
  - BorderReliefStrength (0..100)
  - AutoReliefByStyle (True/False)

5) B4X custom class member syntax nuance
- Even when `B4XDashboard` defines `setWidth/getWidth`, using `Dashboard.Width = "100%"` may fail with:
  - "Unknown member: width"
- Use explicit setter methods instead:
  - `Dashboard.setWidth("100%")`
  - `Dashboard.setHeight("100%")`

6) Android video capture helper
- Added `record.ps1` in project root.
- Modes:
  - `.\record.ps1 -Action once -DurationSec 10`
  - `.\record.ps1 -Action start`
  - `.\record.ps1 -Action stop`
- Outputs videos to:
  - `B4A\screenshots\latest-record.mp4`
  - `B4A\screenshots\screenrec-yyyyMMdd-HHmmss.mp4`
- record.ps1 now supports extended once-recording by chunking 180s max segments: .\record.ps1 -Action once -DurationSec 181 -> SEGMENTS=2

7) B4X custom view baseline (from B4XCustomViewsV2_5)
- Prefer XUI CustomView template (`mBase As B4XView`, `DesignerCreateView(Base As Object, ...)`) even for mono-platform projects.
- Keep standard lifecycle signatures:
  - `Initialize(Callback As Object, EventName As String)`
  - `DesignerCreateView(Base As Object, Lbl As Label, Props As Map)`
  - `Base_Resize(Width As Double, Height As Double)` for layout updates.
- In `DesignerCreateView`, preserve Tag pattern:
  - `mTag = mBase.Tag`
  - `mBase.Tag = Me`
  - expose `setTag/getTag` for external Tag access.
- Use `#DesignerProperty` + defaults (safe access via `Props.GetDefault` equivalent helpers) to avoid old-layout breakage.
- Expose public properties with `setX/getX` naming.
- Raise external events with `xui.SubExists(...)` + `CallSub2/CallSub3`.
- Provide `AddToParent` / `AddToParentAt` for code-based creation.

8) XUI baseline (from B4XXUIV2_5)
- Prefer `B4XView` as the common wrapper in component internals, and switch to native objects only where platform-specific APIs are needed.
- Use `dip` for geometry and spacing across platforms; do not use `dip` for font sizes (`xui.CreateDefaultFont(Size)` expects plain size values).
- Normalize mixed color objects with `xui.PaintOrColorToColor(...)` when values may come from designer/native paint types (especially for B4J compatibility).
- For cross-platform callback checks, use `xui.SubExists(mCallBack, mEventName & "_EventName", NumberOfArguments)` with matching `CallSub...` calls.
- Remember `B4XCanvas` updates require `Invalidate`, and call `Release` where relevant for lifecycle hygiene.
- Keep in mind slight stroke rendering differences between B4J and B4A/B4i when using `DrawPath` and thick outlines.
- `xui.CreatePanel(...)` creates a clipping container; in B4A it must be created from an Activity context.
- Use XUI-compatible controls/patterns when native views differ across platforms (for example: `xCustomListView`, `B4XSwitch`, `B4XComboBox`, `B4XSeekBar`).

9) Graphics baseline (from B4XGraphicsV2_5)
- Prefer XUI graphics (`B4XCanvas`, `B4XPath`, `B4XRect`, `B4XBitmap`) for shared component code.
- `B4XCanvas` draws on `B4XView` panel/pane containers (not ImageViews). Keep a dedicated draw panel when needed.
- After drawing with `B4XCanvas`, call `cvs.Invalidate` to commit changes.
- If a host view is resized, release/recreate drawing resources as needed (`Canvas.Release` + reinitialize pattern).
- Use `dip` for coordinates and sizes in drawing code for B4A consistency.
- Be aware of transparency differences: B4J transparent draw behavior differs; `ClearRect` is the reliable way to clear areas.
- Use `MeasureText` for precise text centering/baseline math instead of hardcoded offsets.
- For heavy pixel operations, use `BitmapCreator` (BC) and keep units in pixels (no dip units in BC workflows).
- BC performance tips: skip blending when possible, prefer async draw tasks for complex composites.
- BC path types differ from `B4XPath` (`BCPath` is separate); do not mix path object types.

10) B4XPages baseline (from B4XPagesCrossPlatformProjectsV2_5)
- B4XPages classes are regular classes: pages are not paused/destroyed independently; state is kept until process kill.
- Put one-time UI setup in `B4XPage_Created`; use `B4XPage_Appear/Disappear` for visibility-driven refresh/sync.
- Handle app lifecycle in `B4XPage_Background` / `B4XPage_Foreground` (save volatile state in Background).
- Use `B4XPages.AddPage("Id", PageInstance)` once, and navigate with `B4XPages.ShowPage("Id")`.
- Access other pages directly with typed references from `B4XPages.GetPage("Id")`; avoid unnecessary `CallSubDelayed`.
- For close/back handling use `B4XPage_CloseRequest` (B4A/B4J) and return True/False explicitly.
- Keep `Main` template code unchanged in B4XPages projects; place shared logic in page classes instead.
- Use relative links for shared modules and parent-folder structure so edits propagate across B4A/B4i/B4J projects.
- In B4A, note the documented orientation constraint for the single host activity (lock orientation if required by app flow).
- Navigation-stack debugging tip: verify expected stack behavior per platform when combining `ShowPage` + `ClosePage` (B4i stack behavior differs in some flows).

So Codex is using this each time based on the 'skills' it learns from here, so it also builds the document itself, when I tell it to and when we 'both' learn something.

I hope Ive answered you.
 
Top