meko-bmad-publish — Publish finalized BMad artifacts to Meko (Claude Code)
Close the improvement loop: after BMad finalizes a workflow's local files, store
the finalized artifacts and one concise learning summary in Meko so a later
BMad workflow can recall them. This runs only when publishing was enabled by
meko-bmad-setup (explicit consent).
Inputs
workflow-name (required) — the BMad workflow that finished, e.g. bmad-prd.
artifact-paths (required) — finalized local file paths BMad just wrote.
completion-summary (required) — a concise, output-only summary of the run's
durable decisions, constraints, and open questions.
Preconditions
- Run only after BMad has successfully finalized its local files. Never
publish partial or in-progress output.
- An active
datapack_id must be present (read from SessionStart context, never
invented), along with agent_id and conversation_id.
- Local BMad artifacts are authoritative and untouched. This skill never
deletes, moves, or invalidates them, even on partial failure.
Path safety — reject before uploading
Resolve each artifact path and permit uploads only from the project root and
the configured BMad output directories. Reject (skip and flag) any file that:
- Resolves outside the project root or configured output dirs (path traversal).
- Is a symlink escaping those roots.
- Looks credential-like or is a hidden secret file (e.g.
.env, *.pem,
*.key, id_rsa, credentials, .npmrc, .netrc, dotfiles holding
secrets).
- Has unsupported content, or exceeds Meko's 5 MB upload limit.
See references/publishing.md for the full allow/deny
rules and the dedup marker format.
Procedure
- Validate every artifact path against the rules above. Build the permitted
list; record each rejected file with its reason.
- Upload each permitted file with
artifact_put, preserving the original
filename and MIME type. Content-hash idempotency means re-uploading an
unchanged file is a no-op that returns the same hash. Collect returned hashes.
- Compute the dedup marker for this run (see publishing.md) and
memory_search for it. If a summary with that marker already exists, skip the
write — do not create a duplicate.
- Store one summary via
memory_add containing: workflow, project, durable
decisions, constraints, open questions, and the returned artifact hashes.
Attach metadata source=meko-bmad, module version, workflow name, and the
artifact hashes. Embed the stable dedup marker in the memory body.
- Never place full document bodies in memory.
- Never repost captured conversation turns — automatic capture already
records the session; this is an output-only summary.
- Report uploaded hashes, skipped/rejected files with reasons, and whether
the summary was written or deduplicated. Report partial failures plainly —
never delete, move, or invalidate any local BMad artifact.
Graceful degradation
If Meko is unavailable, or artifact_put / memory_add fails, report the
failure and stop. The local BMad output remains complete and valid. Publishing
is never a completion dependency for the BMad workflow.
1---2name: meko-bmad-publish3description: Publishes finalized BMad artifacts and one concise learning summary to the active Meko datapack after a BMad workflow has written its local output. Uploads permitted files via artifact_put and stores a single deduplicated memory_add summary of the durable decisions, constraints, open questions, and artifact hashes. Triggers on the BMad menu code "MP", when a BMad workflow's external_handoffs directive asks to publish to Meko, or when the user says "publish these BMad artifacts to Meko".4license: Apache-2.05---6<!--7Licensed to YugabyteDB, Inc. under one or more contributor license agreements.8See the NOTICE file distributed with this work for additional information9regarding copyright ownership. YugabyteDB licenses this file to you under10the Apache License, Version 2.0 (the "License"); you may not use this file11except in compliance with the License. You may obtain a copy of the License at1213 http://www.apache.org/licenses/LICENSE-2.01415Unless required by applicable law or agreed to in writing, software distributed16under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR17CONDITIONS OF ANY KIND, either express or implied. See the License for the18specific language governing permissions and limitations under the License.19-->2021# meko-bmad-publish — Publish finalized BMad artifacts to Meko (Claude Code)2223Close the improvement loop: after BMad finalizes a workflow's local files, store24the finalized artifacts and one concise learning summary in Meko so a later25BMad workflow can recall them. This runs **only** when publishing was enabled by26`meko-bmad-setup` (explicit consent).2728## Inputs2930- `workflow-name` (required) — the BMad workflow that finished, e.g. `bmad-prd`.31- `artifact-paths` (required) — finalized local file paths BMad just wrote.32- `completion-summary` (required) — a concise, output-only summary of the run's33 durable decisions, constraints, and open questions.3435## Preconditions3637- Run **only after** BMad has successfully finalized its local files. Never38 publish partial or in-progress output.39- An active `datapack_id` must be present (read from SessionStart context, never40 invented), along with `agent_id` and `conversation_id`.41- **Local BMad artifacts are authoritative and untouched.** This skill never42 deletes, moves, or invalidates them, even on partial failure.4344## Path safety — reject before uploading4546Resolve each artifact path and permit uploads **only** from the project root and47the configured BMad output directories. Reject (skip and flag) any file that:4849- Resolves outside the project root or configured output dirs (path traversal).50- Is a symlink escaping those roots.51- Looks credential-like or is a hidden secret file (e.g. `.env`, `*.pem`,52 `*.key`, `id_rsa`, `credentials`, `.npmrc`, `.netrc`, dotfiles holding53 secrets).54- Has unsupported content, or exceeds Meko's **5 MB** upload limit.5556See [references/publishing.md](references/publishing.md) for the full allow/deny57rules and the dedup marker format.5859## Procedure60611. **Validate** every artifact path against the rules above. Build the permitted62 list; record each rejected file with its reason.632. **Upload** each permitted file with `artifact_put`, preserving the original64 filename and MIME type. Content-hash idempotency means re-uploading an65 unchanged file is a no-op that returns the same hash. Collect returned hashes.663. **Compute the dedup marker** for this run (see publishing.md) and67 `memory_search` for it. If a summary with that marker already exists, skip the68 write — do not create a duplicate.694. **Store one summary** via `memory_add` containing: workflow, project, durable70 decisions, constraints, open questions, and the returned artifact hashes.71 Attach metadata `source=meko-bmad`, module version, workflow name, and the72 artifact hashes. Embed the stable dedup marker in the memory body.73 - **Never** place full document bodies in memory.74 - **Never** repost captured conversation turns — automatic capture already75 records the session; this is an output-only summary.765. **Report** uploaded hashes, skipped/rejected files with reasons, and whether77 the summary was written or deduplicated. Report partial failures plainly —78 never delete, move, or invalidate any local BMad artifact.7980## Graceful degradation8182If Meko is unavailable, or `artifact_put` / `memory_add` fails, report the83failure and stop. The local BMad output remains complete and valid. Publishing84is never a completion dependency for the BMad workflow.