agentleFS
openbkn-aiopenbkn-ai/bkn-sdk/skills/create-bkn/SKILL.md

create-bkn

Skill18 starsChanged 4 months agoApache-2.0View on GitHub

Guides creation of BKN (Business Knowledge Network) definition files following v2.0.1 spec. Covers network, object_type, relation_type, action_type, concept_group. Use when creating knowledge networks, BKN files, object types, relation types, action types, concept groups, or when user asks to model business knowledge in BKN format. When the openbkn skill is also loaded, use it to run the openbkn CLI (auth, bkn push) after files exist.

  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep heading order per spec

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create BKN

Generate well-formed BKN directories (Markdown + YAML frontmatter) per v2.0.1.

Works with the openbkn skill

create-bkn authors the .bkn tree; the openbkn skill runs openbkn auth login and openbkn bkn push / pull after files exist.

What is BKN

BKN is Markdown + YAML frontmatter for schema; one file per definition under typed subfolders. Details (sections, required tables, types) live in references/SPECIFICATION.llm.md.

Directory layout

{network_dir}/
├── SKILL.md
├── network.bkn
├── CHECKSUM                 # optional; SDK may generate
├── object_types/
├── relation_types/
├── action_types/
├── concept_groups/
└── data/                    # optional sample data; not read by `openbkn bkn validate`/`push`

Workflow

  1. Gather requirements — objects, relations, actions, optional concept groups
  2. Read spec — references/SPECIFICATION.llm.md (format rules, sections, frontmatter types)
  3. Pick templates — copy/adapt from assets/templates/ (network_type.bkn.template, object_type.bkn.template, …)
  4. Create network.bkn — root file; align with Network Overview
  5. Create object_types/*.bkn — one file per object, {id}.bkn
  6. Create relation_types/*.bkn — one file per relation
  7. Create action_types/*.bkn — one file per action
  8. Create concept_groups/*.bkn — optional
  9. Update network.bkn — list all IDs in Network Overview
  10. Add root SKILL.md in the BKN directory — same folder as network.bkn (this is not the create-bkn skill file); agent-facing guide for that network (see Delivered BKN: root SKILL.md)
  11. Review (MUST) — cross-check Validation checklist and Business rules placement; fix IDs, cross-refs, headings
  12. Validate (MUST) — openbkn bkn validate <dir> (see Validation)
  13. Import (optional) — openbkn bkn push <dir>

Import (openbkn CLI)

Requires the openbkn CLI from @openbkn/bkn-sdk (npm install -g @openbkn/bkn-sdk; Node.js 22.19.0+). push uses tar; on macOS COPYFILE_DISABLE=1 is set by the tool.

  • Platform auth — Don't pre-check with openbkn auth status; run openbkn bkn push directly (validate is offline and needs no login). Only when it fails with 401 / not authorized, run openbkn auth login <platform-url> and retry.
  • BKN validation — If workflow step 12 (openbkn bkn validate <dir>) already succeeded for this directory, do not repeat validate before push unless you changed .bkn files. If you have not validated yet, run validate before push.
openbkn bkn push <dir> [--branch main]

Export: openbkn bkn pull <kn-id> [<dir>]. More subcommands: openbkn bkn --help (see the openbkn skill if loaded).

Validation

openbkn bkn validate <dir> — must pass before delivery or upload. It loads network.bkn and sibling .bkn files. Success prints counts; on failure fix .bkn files and re-run.

A capabilities: section in network.bkn never fails validation or push. Read capabilities.skipped and the warnings instead: an entry listed there binds on no platform, and a malformed section is ignored whole. After push, the answer's capabilities.skipped names what this platform could not resolve.

Per-type reference

KindSpec (section)TemplateExample (k8s)
Networkknowledge_network in specassets/templates/network_type.bkn.templatereferences/examples/k8s-network/network.bkn
Objectobject_typeassets/templates/object_type.bkn.templatereferences/examples/k8s-network/object_types/pod.bkn
Relationrelation_typeassets/templates/relation_type.bkn.templatereferences/examples/k8s-network/relation_types/pod_belongs_node.bkn
Actionaction_typeassets/templates/action_type.bkn.templatereferences/examples/k8s-network/action_types/restart_pod.bkn
Concept groupconcept_groupassets/templates/concept_group.bkn.templatereferences/examples/k8s-network/concept_groups/k8s.bkn

Full rules and optional sections: references/SPECIFICATION.llm.md.

Naming conventions

  • ID: lowercase, digits, underscores; file: {id}.bkn under the matching folder
  • Headings: # network title, ## type block, ### section, #### logic property
  • Frontmatter: at least type, id, name (see spec for each type)

Business rules placement

Rules must sit in spec-defined places so import persists them. Full wording: references/SPECIFICATION.llm.md.

  • Network-level — prose in network.bkn right after # {title} (before structured sections like ## Network Overview)
  • Type-level — prose in each type file after ## ObjectType: / ## RelationType: / … and before the first ###; never in frontmatter
  • Property-level — in Data Properties table Description column
  • No extra sections — do not add Markdown outside the standard sections; parsers may drop unparsed content on import

Validation checklist

  • network.bkn at root; frontmatter matches spec
  • Every .bkn has valid YAML frontmatter (type, id, name)
  • Files live under folders matching type (object_types/, relation_types/, …); filename = {id}.bkn
  • Network Overview lists all definition IDs — no missing/extra
  • Relations/actions reference existing object-type IDs; concept groups list only existing objects
  • Parameter binding Source ∈ property | input | const; YAML blocks (e.g. trigger) parse
  • Heading hierarchy has no skipped levels
  • Business rules only in allowed places (see Business rules placement)

Output rules

  1. Emit raw .bkn content — do not wrap the whole file in a fenced markdown block
  2. Reuse IDs consistently across relations/actions
  3. IDs: lowercase + underscores; display text Chinese unless asked otherwise
  4. Keep heading order per spec

Examples

  • references/examples/k8s-network/ — modular sample (objects, relations, actions, concept group)

Delivered BKN: root SKILL.md

When you build a knowledge network directory {network_dir}/, add {network_dir}/SKILL.md at the root (alongside network.bkn). Short overview + index tables with file paths (object | path | relation | path | action | path) so agents route to the right .bkn without scanning. Optional: topology sketch, usage scenarios. Example: references/examples/k8s-network/SKILL.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.