bmad-method 6.10.1-next.45 → 6.10.1-next.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/package.json +1 -1
  2. package/src/bmm-skills/agents/bmad-agent-analyst/customize.toml +3 -3
  3. package/src/bmm-skills/module-help.csv +1 -2
  4. package/src/bmm-skills/plan/bmad-document-project/SKILL.md +4 -56
  5. package/src/bmm-skills/plan/bmad-generate-project-context/SKILL.md +4 -75
  6. package/src/bmm-skills/plan/bmad-project-context/SKILL.md +74 -0
  7. package/src/bmm-skills/plan/bmad-project-context/customize.toml +25 -0
  8. package/src/bmm-skills/plan/bmad-project-context/evals/cases.json +345 -0
  9. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/AGENTS.md +6 -0
  10. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/_bmad/context.yaml +2 -0
  11. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/legacy/README.md +3 -0
  12. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/package.json +18 -0
  13. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/planning/decisions.md +14 -0
  14. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/pnpm-lock.yaml +8 -0
  15. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/src/lib/money.ts +5 -0
  16. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/src/repos/orders.ts +11 -0
  17. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-brownfield/src/routes/webhooks.ts +7 -0
  18. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-greenfield/spec.md +15 -0
  19. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-monorepo/README.md +4 -0
  20. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-monorepo/apps/web/package.json +7 -0
  21. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-monorepo/apps/web/src/conventions.md +2 -0
  22. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-monorepo/package.json +12 -0
  23. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-monorepo/services/billing/package.json +6 -0
  24. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-monorepo/services/billing/src/handlers.ts +3 -0
  25. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/context/.memlog.md +9 -0
  26. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/context/index.md +4 -0
  27. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/context/integer-cents.md +11 -0
  28. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/context/kernel.md +8 -0
  29. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/context/repository-pattern.md +10 -0
  30. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/package.json +18 -0
  31. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/planning/decisions.md +14 -0
  32. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/src/lib/currency.ts +5 -0
  33. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-refresh/src/routes/webhooks.ts +7 -0
  34. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-standalone/package.json +18 -0
  35. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-standalone/planning/decisions.md +14 -0
  36. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-standalone/src/lib/money.ts +5 -0
  37. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-workspace/obeya/registry.yaml +10 -0
  38. package/src/bmm-skills/plan/bmad-project-context/evals/files/fixture-workspace/proj-a/src/client.ts +2 -0
  39. package/src/bmm-skills/plan/bmad-project-context/evals/triggers.json +42 -0
  40. package/src/bmm-skills/plan/bmad-project-context/references/bundle-contract.md +48 -0
  41. package/src/bmm-skills/plan/bmad-project-context/references/interrogation-guide.md +11 -0
  42. package/src/bmm-skills/plan/bmad-project-context/references/kernel-contract.md +49 -0
  43. package/src/bmm-skills/plan/bmad-project-context/references/placement.md +13 -0
  44. package/src/bmm-skills/plan/bmad-project-context/scripts/context.py +657 -0
  45. package/src/bmm-skills/plan/bmad-project-context/scripts/tests/test_context.py +47 -0
  46. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/__pycache__/sprint_plan.cpython-311.pyc +0 -0
  47. package/src/bmm-skills/plan/bmad-sprint-planning/scripts/tests/__pycache__/test_sprint_plan.cpython-311-pytest-9.1.1.pyc +0 -0
  48. package/src/bmm-skills/ship/bmad-retrospective/scripts/__pycache__/sprint_status.cpython-311.pyc +0 -0
  49. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_git_evidence.cpython-311-pytest-9.1.1.pyc +0 -0
  50. package/src/bmm-skills/ship/bmad-retrospective/scripts/tests/__pycache__/test_sprint_status.cpython-311-pytest-9.1.1.pyc +0 -0
  51. package/src/core-skills/bmad-review/references/lens-adversarial.md +0 -1
  52. package/src/scripts/__pycache__/config_utils.cpython-311.pyc +0 -0
  53. package/src/scripts/context.py +657 -0
  54. package/src/scripts/tests/__pycache__/test_config_utils.cpython-311.pyc +0 -0
  55. package/src/scripts/tests/__pycache__/test_resolve_config.cpython-311.pyc +0 -0
  56. package/src/scripts/tests/__pycache__/test_resolve_customization.cpython-311.pyc +0 -0
  57. package/src/scripts/tests/test_context.py +572 -0
  58. package/src/bmm-skills/plan/bmad-document-project/checklist.md +0 -245
  59. package/src/bmm-skills/plan/bmad-document-project/customize.toml +0 -41
  60. package/src/bmm-skills/plan/bmad-document-project/documentation-requirements.csv +0 -12
  61. package/src/bmm-skills/plan/bmad-document-project/instructions.md +0 -128
  62. package/src/bmm-skills/plan/bmad-document-project/templates/deep-dive-template.md +0 -345
  63. package/src/bmm-skills/plan/bmad-document-project/templates/index-template.md +0 -169
  64. package/src/bmm-skills/plan/bmad-document-project/templates/project-overview-template.md +0 -103
  65. package/src/bmm-skills/plan/bmad-document-project/templates/project-scan-report-schema.json +0 -160
  66. package/src/bmm-skills/plan/bmad-document-project/templates/source-tree-template.md +0 -135
  67. package/src/bmm-skills/plan/bmad-document-project/workflows/deep-dive-instructions.md +0 -300
  68. package/src/bmm-skills/plan/bmad-document-project/workflows/deep-dive-workflow.md +0 -34
  69. package/src/bmm-skills/plan/bmad-document-project/workflows/full-scan-instructions.md +0 -1108
  70. package/src/bmm-skills/plan/bmad-document-project/workflows/full-scan-workflow.md +0 -34
  71. package/src/bmm-skills/plan/bmad-generate-project-context/customize.toml +0 -41
  72. package/src/bmm-skills/plan/bmad-generate-project-context/project-context-template.md +0 -21
  73. package/src/bmm-skills/plan/bmad-generate-project-context/steps/step-01-discover.md +0 -186
  74. package/src/bmm-skills/plan/bmad-generate-project-context/steps/step-02-generate.md +0 -321
  75. package/src/bmm-skills/plan/bmad-generate-project-context/steps/step-03-complete.md +0 -284
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "bmad-method",
4
- "version": "6.10.1-next.45",
4
+ "version": "6.10.1-next.47",
5
5
  "description": "Breakthrough Method of Agile AI-driven Development",
6
6
  "keywords": [
7
7
  "agile",
@@ -100,6 +100,6 @@ description = "Working Backwards PRFAQ challenge — forge and stress-test produ
100
100
  skill = "bmad-prfaq"
101
101
 
102
102
  [[agent.menu]]
103
- code = "DP"
104
- description = "Analyze an existing project to produce documentation for human and LLM consumption"
105
- skill = "bmad-document-project"
103
+ code = "PC"
104
+ description = "Curate the verified project context AI agents load kernel + knowledge bundle (ingest, query, audit)"
105
+ skill = "bmad-project-context"
@@ -1,7 +1,6 @@
1
1
  module,skill,display-name,menu-code,description,action,args,phase,preceded-by,followed-by,required,output-location,outputs
2
2
  BMad Method,_meta,,,,,,,,,false,https://docs.bmad-method.org/llms.txt,
3
- BMad Method,bmad-document-project,Document Project,DP,Analyze an existing project to produce useful documentation.,,,anytime,,,false,project-knowledge,*
4
- BMad Method,bmad-generate-project-context,Generate Project Context,GPC,Scan existing codebase to generate a lean LLM-optimized project-context.md. Essential for brownfield projects.,,,anytime,,,false,output_folder,project context
3
+ BMad Method,bmad-project-context,Project Context,PC,"Curate the verified project context AI agents load: a small always-loaded kernel plus a knowledge bundle. Ingest (brownfield or greenfield), query, and audit — replaces document-project and generate-project-context.",,,anytime,,,false,project_knowledge,kernel.md + context bundle
5
4
  BMad Method,bmad-build,Build,BD,Official Phase 4 implementation loop: clarify intent plan implement review and present.,,,ship,bmad-sprint-planning,bmad-code-review,true,implementation_artifacts,spec and project implementation
6
5
  BMad Method,bmad-spec,Spec,SPC,"Use to distill any intent input (brief, PRD, transcript, brain dump, design folder, mixed multi-source) into a succinct, no-fluff SPEC.md contract + companions that downstream work derives from. Locks the WHAT before the HOW. Works for software, game design, research, editorial, policy, business, anything intent-bearing. Validation mode also available.",,[path],anytime,,,false,{output_folder}/specs/spec-{slug},SPEC.md + companion files
7
6
  BMad Method,bmad-correct-course,Correct Course,CC,Navigate significant changes. May recommend start over update PRD redo architecture sprint planning or correct epics and stories.,,,anytime,,,false,planning_artifacts,change proposal
@@ -1,62 +1,10 @@
1
1
  ---
2
2
  name: bmad-document-project
3
- description: 'Document brownfield projects for AI context. Use when the user says "document this project" or "generate project docs"'
3
+ description: 'Deprecated forwards to bmad-project-context. Use when the user says "document this project" or "generate project docs"'
4
4
  ---
5
5
 
6
- # Document Project Workflow
6
+ # DEPRECATED forwards to bmad-project-context
7
7
 
8
- **Goal:** Document brownfield projects for AI context.
8
+ Tell the user: this skill is deprecated — `bmad-project-context` now owns this job, and instead of generating documentation volume it curates a small verified context system (an always-loaded kernel plus a knowledge bundle). Invoke `bmad-project-context` next time.
9
9
 
10
- **Your Role:** Project documentation specialist.
11
-
12
- ## Conventions
13
-
14
- - Bare paths (e.g. `instructions.md`) resolve from the skill root.
15
- - `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
16
- - `{project-root}`-prefixed paths resolve from the project working directory.
17
- - `{skill-name}` resolves to the skill directory's basename.
18
-
19
- ## On Activation
20
-
21
- ### Step 1: Resolve the Workflow Block
22
-
23
- Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
24
-
25
- **If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
26
-
27
- 1. `{skill-root}/customize.toml` — defaults
28
- 2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
29
- 3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
30
-
31
- Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
32
-
33
- ### Step 2: Execute Prepend Steps
34
-
35
- Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
36
-
37
- ### Step 3: Load Persistent Facts
38
-
39
- Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
40
-
41
- ### Step 4: Load Config
42
-
43
- Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
44
- - Use `{user_name}` for greeting
45
- - Use `{communication_language}` for all communications
46
- - Use `{document_output_language}` for output documents
47
- - Use `{planning_artifacts}` for output location and artifact scanning
48
- - Use `{project_knowledge}` for additional context scanning
49
-
50
- ### Step 5: Greet the User
51
-
52
- Greet `{user_name}` (if you have not already), speaking in `{communication_language}`.
53
-
54
- ### Step 6: Execute Append Steps
55
-
56
- Execute each entry in `{workflow.activation_steps_append}` in order.
57
-
58
- Activation is complete. If `activation_steps_prepend` or `activation_steps_append` were non-empty, confirm every entry was executed in order before proceeding. Do not begin the main workflow until all activation steps have been completed.
59
-
60
- ## Execution
61
-
62
- Read fully and follow: `./instructions.md`
10
+ Then invoke `bmad-project-context` with **ingest** intent, forwarding the user's original request and any paths or documents they supplied, verbatim. It takes the workflow from here.
@@ -1,81 +1,10 @@
1
1
  ---
2
2
  name: bmad-generate-project-context
3
- description: 'Create project-context.md with AI rules. Use when the user says "generate project context" or "create project context"'
3
+ description: 'Deprecated — forwards to bmad-project-context. Use when the user says "generate project context" or "create project context"'
4
4
  ---
5
5
 
6
- # Generate Project Context Workflow
6
+ # DEPRECATED forwards to bmad-project-context
7
7
 
8
- **Goal:** Create a concise, optimized `project-context.md` file containing critical rules, patterns, and guidelines that AI agents must follow when implementing code. This file focuses on unobvious details that LLMs need to be reminded of.
8
+ Tell the user: this skill is deprecated — `bmad-project-context` now owns this job. Instead of one generated `project-context.md`, it curates a small verified context system (an always-loaded kernel plus a knowledge bundle); any existing `project-context.md` keeps loading and becomes a mining source. Invoke `bmad-project-context` next time.
9
9
 
10
- **Your Role:** You are a technical facilitator working with a peer to capture the essential implementation rules that will ensure consistent, high-quality code generation across all AI agents working on the project.
11
-
12
- ## Conventions
13
-
14
- - Bare paths (e.g. `steps/step-01-discover.md`) resolve from the skill root.
15
- - `{skill-root}` resolves to this skill's installed directory (where `customize.toml` lives).
16
- - `{project-root}`-prefixed paths resolve from the project working directory.
17
- - `{skill-name}` resolves to the skill directory's basename.
18
-
19
- ## WORKFLOW ARCHITECTURE
20
-
21
- This uses **micro-file architecture** for disciplined execution:
22
-
23
- - Each step is a self-contained file with embedded rules
24
- - Sequential progression with user control at each step
25
- - Document state tracked in frontmatter
26
- - Focus on lean, LLM-optimized content generation
27
- - You NEVER proceed to a step file if the current step file indicates the user must approve and indicate continuation.
28
-
29
- ## On Activation
30
-
31
- ### Step 1: Resolve the Workflow Block
32
-
33
- Run: `python3 {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`
34
-
35
- **If the script fails**, resolve the `workflow` block yourself by reading these three files in base → team → user order and applying the same structural merge rules as the resolver:
36
-
37
- 1. `{skill-root}/customize.toml` — defaults
38
- 2. `{project-root}/_bmad/custom/{skill-name}.toml` — team overrides
39
- 3. `{project-root}/_bmad/custom/{skill-name}.user.toml` — personal overrides
40
-
41
- Any missing file is skipped. Scalars override, tables deep-merge, arrays of tables keyed by `code` or `id` replace matching entries and append new entries, and all other arrays append.
42
-
43
- ### Step 2: Execute Prepend Steps
44
-
45
- Execute each entry in `{workflow.activation_steps_prepend}` in order before proceeding.
46
-
47
- ### Step 3: Load Persistent Facts
48
-
49
- Treat every entry in `{workflow.persistent_facts}` as foundational context you carry for the rest of the workflow run. Entries prefixed `file:` are paths or globs under `{project-root}` — load the referenced contents as facts. All other entries are facts verbatim.
50
-
51
- ### Step 4: Load Config
52
-
53
- Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
54
- - Use `{user_name}` for greeting
55
- - Use `{communication_language}` for all communications
56
- - Use `{document_output_language}` for output documents
57
- - Use `{planning_artifacts}` for output location and artifact scanning
58
- - Use `{project_knowledge}` for additional context scanning
59
-
60
- ### Step 5: Greet the User
61
-
62
- Greet `{user_name}`, speaking in `{communication_language}`.
63
-
64
- ### Step 6: Execute Append Steps
65
-
66
- Execute each entry in `{workflow.activation_steps_append}` in order.
67
-
68
- Activation is complete. If `activation_steps_prepend` or `activation_steps_append` were non-empty, confirm every entry was executed in order before proceeding. Do not begin the main workflow until all activation steps have been completed.
69
-
70
- ## Paths
71
-
72
- - `output_file` = `{output_folder}/project-context.md`
73
-
74
- ## Execution
75
-
76
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
77
- - ✅ YOU MUST ALWAYS WRITE all artifact and document content in `{document_output_language}`
78
-
79
- Load and execute `./steps/step-01-discover.md` to begin the workflow.
80
-
81
- **Note:** Input document discovery and initialization protocols are handled in step-01-discover.md.
10
+ Then invoke `bmad-project-context` with **ingest** intent, forwarding the user's original request and any inputs they supplied (architecture doc, spec, preferences), verbatim. It takes the workflow from here.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: bmad-project-context
3
+ description: 'Curate and maintain verified project context for AI agents. Use when the user says "project context", "document project", "generate project context", "refresh context", or "audit context"'
4
+ ---
5
+
6
+ # Overview
7
+
8
+ You are the curator of everything the code can't say. This skill builds and maintains a project's context system: a tiny always-loaded **kernel** and a **bundle** of small verified knowledge entries — architecture rationale, unobvious conventions, landmines, org requirements. The governing thesis, backed by measurement: generated documentation makes agents worse; a curated minimum of verified, non-derivable truths makes them better. So you curate the minimum non-derivable set and never describe what the code already says.
9
+
10
+ Works with a full BMad install or standalone in any repo with no framework at all.
11
+
12
+ **Args:** intent (`ingest` | `query` | `audit`); `--auto` for headless; a scope path to bound the run; placement (`bmad` | `agent-files` | `both`); a bundle-root override; extra source paths or URLs to mine. Supplied values are used directly and skip their questions. Script interface: `uv run {skill-root}/scripts/context.py --help`.
13
+
14
+ ## Resolution rules
15
+
16
+ - Bare paths and `{skill-root}` (e.g. `references/kernel-contract.md`) resolve from this skill's installed directory.
17
+ - `{project-root}` → the project working directory.
18
+
19
+ ## On Activation
20
+
21
+ 1. Resolve customization: `uv run {project-root}/_bmad/scripts/resolve_customization.py --skill {skill-root} --key workflow`. On failure, read `{skill-root}/customize.toml` directly and use defaults. Execute `{workflow.activation_steps_prepend}`; treat `{workflow.persistent_facts}` entries as standing context (`file:` = paths/globs to load, others verbatim).
22
+ 2. Mechanics: every mechanical fact comes from the script, never from guessing. If `{project-root}/_bmad/scripts/context.py` is missing (standalone repo), run `uv run {skill-root}/scripts/context.py bootstrap` once — it installs itself there. All later calls: `uv run {project-root}/_bmad/scripts/context.py <command>` (`--json` on any command for machine reads; `--help` for the full interface).
23
+ 3. Config comes from one resolution, never hand-merged: `uv run {project-root}/_bmad/scripts/context.py config --json`. It delegates to the installed BMad resolver (`resolve_config.py`) when present and otherwise falls back through the legacy and standalone config files itself, so the script and this session can never disagree about paths. Read `{user_name}`, `{communication_language}` (use it every turn), `{document_output_language}`, `{project_knowledge}`, `{output_folder}` (standalone default `_bmad-output`), and `context_placement` from its output.
24
+ 4. **First run** (no kernel at `{project_knowledge}/kernel.md`), interactive only: load `references/placement.md` and settle the bundle location and placement there. In auto mode: detect (BMad install → bmad, else agent-files), record `context_placement`, don't ask.
25
+ 5. Init or resume the memlog at `{project_knowledge}/.memlog.md` (`uv run {project-root}/_bmad/scripts/memlog.py init --path ...` if absent; if present, read it once — it is the record of every prior run, and refresh diffs against it instead of starting over). If `memlog.py` itself is missing (standalone repo), append one-line typed entries to the same file directly — append-only, never rewritten.
26
+ 6. Detect intent — **ingest** (build or refresh; the default), **query** (answer from the bundle), **audit** (shrink and re-verify) — and greet `{user_name}`. For interactive ingest, ask what they bring before anything scans: sources outside the repo (org handbooks, wiki or Notion exports, prior architecture docs, MCP knowledgebases) and any area to focus on — note the paths for subagent scanning, don't read them now; when a named source is huge, ask one bounding question rather than scanning it whole. Fold `{workflow.external_sources}` entries into the same source list. Auto mode skips the ask, scans what's discoverable, and logs that as an assumption. Execute `{workflow.activation_steps_append}`.
27
+
28
+ ## Engine disciplines — every intent, every mode
29
+
30
+ - Every user decision, confirmed claim, rejected claim, and idea lands in the memlog the moment it happens — never batched for session end.
31
+ - **Orchestrate the scanning.** Discovery is yours to plan with whatever tools fit, but make good use of parallel subagents: they scan, returning claims with evidence paths and an inferred|needs-confirmation mark; you interrogate and decide, and never grind a large tree through your own context.
32
+
33
+ ## Writing rules — every kernel line, entry, and compass
34
+
35
+ - **Succinct to the point of discomfort.** Every sentence costs context in every future session. If a line can be shorter, it isn't done.
36
+ - **Present truth only.** State what *is*, never the story of the edit — "we removed X because..." is banned prose. Git and the memlog hold history; supersession is a dated frontmatter field.
37
+ - **No reference without a link.** Every mentioned decision, doc, file, or system carries a path, `[[project:entry]]` link, or URL a fresh context can follow. "As previously discussed" is banned.
38
+
39
+ ## Ingest
40
+
41
+ The outcome: a kernel within its instruction budget and bundle entries for what earned depth — every claim verified (user-confirmed or path-checked, interactive only; auto mode writes the same content marked `generated`) before it's written as truth. Contracts govern the artifacts: load `references/kernel-contract.md` and `references/bundle-contract.md` before writing either.
42
+
43
+ **Brownfield:** discover the repo however you judge best, then fan out the source scan (trust ladder: code and configs are ground truth; planning docs next — an ARCHITECTURE-SPINE is the premier source; existing docs folders, org docs, and MCP knowledgebases are untrusted until verified against code). Then interrogate in chunked rounds per `references/interrogation-guide.md` — confirmations first, then only the genuinely unknowable. Never ask what a scan could answer. A bloated docs folder is a source to strip-mine, then recommend archiving.
44
+
45
+ **Greenfield:** same pipeline seeded from a bmad-spec artifact or planning doc (or pure interview). If a genuinely contested decision surfaces — real tradeoffs, multiple viable shapes — say it deserves `bmad-architecture` rather than making the call: decisions are born there; they *live* here.
46
+
47
+ **Refresh:** ingest with existing artifacts — read the memlog, run `sweep`, diff instead of restarting, never re-ask what a prior run settled. Sweep findings resolve against code, not prose: when a path a claim names is gone, the claim is updated to the new reality or removed/marked superseded — re-pointing its `sources` at documents that merely mention it is laundering, not verification. Total size must hold or shrink.
48
+
49
+ **Scope:** whole repo or a component; in a monorepo, global truths go in the root kernel, component truths in that component's compass. After writing: `index`, then `validate` — its stats block is the measured budget check; an over-budget finding means cut, never raise. Under agent-files/both placement, `sync --dry-run` first and show which files it will touch (confirm on the session's first sync; auto mode skips the ask and logs the written list to the memlog), then `sync`. Close with a fresh-eyes polish pass: a subagent holding only the written artifacts and the two contract files — none of this conversation — returns proposed cuts and rewrites (line, which test it fails, replacement or delete); apply or override, logging overrides to the memlog. The writer who just heard every line justified cannot honestly run the pruning test on it. If subagents are unavailable, run the pass yourself against the contracts. Log the run's summary to the memlog and offer a face artifact.
50
+
51
+ ## Query
52
+
53
+ Answer a question from the bundle without loading all of it: resolve through `index.md`, and return only the relevant entries with their trust metadata (`verified`/`generated`, sources, staleness — staleness read from `sweep --json`, never recomputed; field semantics in `references/bundle-contract.md`). Anything outside this repo — a `[[project:entry]]` link, a question about another project — goes through `resolve <name>` only, which returns a local path, SHA, and freshness; never crawl the filesystem or workspace for another project's context, because the same query must work when that project isn't checked out. Never dump the bundle. If the bundle can't answer, say so — don't improvise an answer the context doesn't hold.
54
+
55
+ ## Audit
56
+
57
+ Keep the set small and true: run `validate` and `sweep` — sweep's `missing` list is the path-check for every claim naming a file, and validate's stats block measures the kernel budget — and apply the pruning test to every kernel line — *would removing this line change agent behavior?* If no, it goes. Entries that paraphrase readable code are deleted; unconfirmed `generated` entries are queued for confirmation. Load `references/bundle-contract.md` before mutating any entry — the frontmatter it acts on is defined there. Where an obeya is configured, propose batched promotion of `org-candidate` entries. Audit ends with the context smaller or equal, never larger — present proposed deletions for confirmation (interactive) before removing; in auto mode deletions proceed and every removal lands in the memlog as a typed entry.
58
+
59
+ ## Modes
60
+
61
+ Interactive is the default: the user is the oracle, in chunked rounds. **Auto mode** (headless, or on request) accepts inferences without confirmation — everything it writes, including path-checked claims, is marked `generated`, never `verified` (`verified` asserts a human was in the loop), and every assumption lands in the memlog. A headless invocation may supply intent (`ingest`|`query`|`audit`), a scope path, a placement, and a bundle root — supplied values are used directly; only genuinely absent ones are inferred, each inference logged as an `assumption`. When invoked headless: never ask; if intent is neither supplied nor inferable, halt with a `blocked` JSON status and `reason`. End with JSON:
62
+
63
+ ```json
64
+ {"status": "complete", "intent": "ingest", "kernel": "docs/kernel.md",
65
+ "bundle": "docs/", "memlog": "docs/.memlog.md", "placement": "agent-files"}
66
+ ```
67
+
68
+ ## Face artifacts
69
+
70
+ On request after any intent, generate a human-readable face of the context — always asking its purpose first so it fits (a slide deck for one subsystem, a website of everything, a service explainer). Faces are written outside the bundle (default `{output_folder}`), never indexed, never cited as a source, and regenerated rather than maintained: the organized, indexed markdown is the only source of truth.
71
+
72
+ ## Finalize
73
+
74
+ Distill the memlog — every meaningful entry captured in an artifact or set aside as noise — confirm `validate` exits clean, tell the user what exists where (and what was *not* created, if kernel-only). When `AGENTS.md` carries the kernel, say plainly: if your harness doesn't auto-load `AGENTS.md`, make the context file it does load pull this one in (e.g. a `CLAUDE.md` containing `@AGENTS.md`). Then run `{workflow.on_complete}` if non-empty.
@@ -0,0 +1,25 @@
1
+ # DO NOT EDIT -- overwritten on every update.
2
+ #
3
+ # Workflow customization surface for bmad-project-context.
4
+ # Team overrides: {project-root}/_bmad/custom/bmad-project-context.toml
5
+ # Personal overrides: {project-root}/_bmad/custom/bmad-project-context.user.toml
6
+ #
7
+ # Merge rules: scalars override (last layer wins); arrays append.
8
+
9
+ [workflow]
10
+
11
+ # --- Universal defaults ---
12
+ activation_steps_prepend = []
13
+ activation_steps_append = []
14
+ # Deliberately empty: the file this skill wants standing (the kernel) is only
15
+ # knowable after config resolves, and the usual **/project-context.md glob is
16
+ # this skill's own superseded output. Users append their own facts.
17
+ persistent_facts = []
18
+ on_complete = ""
19
+
20
+ # Standing outside-the-repo sources fed into every ingest fan-out at their
21
+ # trust-ladder rank (untrusted until verified against code). Append-only.
22
+ # Entries: "file:{project-root}/..." or "file:/abs/path" for docs,
23
+ # "skill:name" to consult a skill, plain text for a standing fact,
24
+ # "tool:name" for an MCP knowledgebase.
25
+ external_sources = []