2 Commits
Author SHA1 Message Date
Brian dc9fbb14f3 feat(core-tools): add bmad-shard-pro and bmad-ingest (#3161)
* feat(core-tools): add bmad-shard-pro to make long documents navigable for agents

Assesses a long document and recommends leaving it, adding a contents list
with line ranges, splitting it word for word into a map and shards, or
rewriting unstructured input (transcripts, chat exports, notes) into cited
subject shards. shard_tool.py outlines, converts, builds, maps, indexes and
checks: faithful splits rebuild the source exactly, rewritten statements must
cite real source lines or cues, and maps stay within the first 200 lines.
The original is kept frozen in .source/ and updates go through the skill.

Registers the skill in bmod-core-tools and its help, updates the prfaq
artifact analyzer for the new sharded layout, and documents the skill.

* refactor(core-tools): narrow bmad-shard-pro to faithful outcomes

Shard-pro now leaves a document, adds a contents list with line ranges, or
splits it word for word; it never rewrites content. The rewrite path, its
writer and checker subagents, derived shards, citation checks and the
convert command are removed. Transcripts, chat exports and email threads go
to bmad-ingest, and other formats are converted to markdown first.

Adds trigger and baseline eval cases for the skill.

* feat(core-tools): add bmad-ingest to turn raw input into cited notes

bmad-ingest turns a transcript, a chat or email thread, a voice memo or a
long document into a note an agent can act on instead of the raw. The
original is kept unchanged in {output_folder}/raw, every item in the note
points back to where it sits in the raw, and a review pass checks the note
against the raw before it is done. Another skill can call it and link the
note it returns, so a PRD's inputs land in its own sources/ folder.

Notes follow templates chosen by their description. Core tools ship meeting,
thread, voice-memo, document and one-on-one; the method module adds standup,
retrospective, sprint-review, discovery-workshop and user-interview. Teams
add their own in _bmad/custom/ingest-templates, people in
~/.bmad/ingest-templates, or any module in an ingest-templates folder.

The template lister moves into the shared scripts as list_templates.py, with
--folder for the folder a module ships, category in its output, ~ expanded,
and missing local paths reported. Shard-pro recommends bmad-ingest.

* fix(core-tools): tell bmad-ingest to rerun setup when the template lister is missing

* fix(core-tools): address review findings in shard-pro, ingest and the template lister

shard_tool.py: a rebuild reads the frozen copy even when the main file sits
at the original path; build refuses to overwrite a file it did not write or
to give a shard a name it writes itself, and gives clashing sub-map names
distinct pages; a plan must start at the top, hold shards and fit each map
page in the reading window; a closing fence must match its opener; a
contents refresh stops when a section's first line now matches two places;
check warns about links the split moved away from their targets.

bmad-ingest gives notes for different raws distinct names. The template
lister decodes GitHub paths before encoding them, and its home-folder tests
set USERPROFILE for Windows. The ingest reference entry is split into short
sentences.

* fix(toolsmith): make eval fixtures portable and refuse absolute paths

run_evals.py accepted absolute fixture paths in its format doc but refused
them when staging, so such cases crashed, and a missing fixture only warned
before running the case without its input. Fixtures are now paths relative
to the project root or the cases file, or a GitHub file URL pinned to a ref,
fetched through gh into the run folder. Absolute and ~ paths and missing
fixtures stop the run before any case starts, with a message saying why.

scan_paths.py now checks the fixture entries in a skill's eval cases, and
leaves ~/.bmad/ alone as BMad's own per-user folder. The shard-pro cases
point at the sample-data repo at a pinned commit instead of a local path.

* fix(toolsmith): refuse fixtures that would land on one path, and lint fixtures as the runner does

Two GitHub fixtures with the same file name landed on the same workspace
path, so one silently replaced the other; the runner now stops before any
case runs. scan_paths.py checked eval fixtures with its general absolute-path
pattern, which missed /tmp paths and let ~/.bmad through; it now applies the
runner's own test, so lint catches every fixture the runner would refuse.

* fix: confine fetched eval fixtures and keep ingest from overwriting files

run_evals.py refuses a GitHub fixture URL whose path or ref holds '..', and
writes each fetched file only inside the run's fixtures folder. bmad-ingest
gives a second original with the same date and slug its own raw name, never
writes a note over a file that is not this raw's earlier note, and, when the
template lister is missing, asks the bmad skill to update the install rather
than only rerunning setup from an old copy.

* docs(core-tools): add help topics for ingest and shard-pro and how they fit together

help/ingest.md and help/shard-pro.md give the help agent what it needs to
suggest each skill and answer questions about it. help.md routes between
them: raw input to ingest, a kept document to shard-pro, preparing large
inputs before a PRD or other planning work, and giving a sharded document to
any skill as its main file. The method help says the same for planning
skills.
2026-10-31 21:22:02 -05:00
Brian fc6a41c673 feat(toolsmith): default to a single-skill module and start prose from one sentence (#3158)
* feat(toolsmith): make a single-skill module the default for one skill

Registration is settled from the registry and shown in the read-back
instead of asked. A skill joins a module only when the user is working on
that module, named it, or chose its prefix. A bmod-<code> record folder is
never written for one skill.

* fix(toolsmith): ask whether a skill is part of a module

Single-skill module stays the offered guess, but discovery now asks whether
the skill joins a module or more skills are planned. A planned module settles
its code and prefix on the first skill, so nothing is renamed later.

* feat(toolsmith): read any agent's session logs and offer customization in from-logs

The agent finds its own logs and confirms the location instead of assuming
Claude Code. A corrected installed skill can be offered as a bmad-customize
change instead of a new skill.

* refactor(toolsmith): split discover into short sections and cut what a model infers

Registration gets its own section, the five things and other enumerable
items become lists, and the read-back carries the consumer and bar.

* feat(toolsmith): start prose from one sentence and hold one topic to a paragraph

The canon, leanness lens and cut roles now default to the one-sentence
version of a passage and split mixed topics. The pre-pass reports long
paragraphs and sentences.

* refactor(toolsmith): cut prompt files to one topic per paragraph and inline ecosystem into ship

Every route, mode and shape file is split into short paragraphs, bullets
and cases, with what a model would infer removed. ecosystem.md only ever
loaded from ship.md, so its content now lives there.

* feat(toolsmith): let a memory agent add its name to its description at First Breath

* fix(toolsmith): close a Markdown fence only on its own marker in the pre-pass

* fix(toolsmith): let a single-skill module grow into a multi-skill module

* fix(toolsmith): write dependencies to the table the module shape uses

* feat(toolsmith): restore a memory agent's name after an update and skip global installs

* docs(toolsmith): bring the help up to date and route to cut mode

* refactor(toolsmith): call the read-back the Smithy execution plan and add help on sharing and subagents

* docs(toolsmith): write the Toolsmith docs to replace the builder site
2026-10-31 19:01:43 -05:00