ma-agents 3.5.6 → 3.6.1

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 (53) hide show
  1. package/.ma-agents.json +10 -0
  2. package/AGENTS.md +97 -0
  3. package/MANIFEST.yaml +3 -0
  4. package/README.md +52 -9
  5. package/_bmad-output/implementation-artifacts/21-10-profile-reconfigure.md +30 -6
  6. package/_bmad-output/implementation-artifacts/21-11-profile-uninstall.md +2 -1
  7. package/_bmad-output/implementation-artifacts/21-2-universal-instruction-block-expansion.md +217 -62
  8. package/_bmad-output/implementation-artifacts/21-3-roomodes-template-bmad-modes.md +196 -73
  9. package/_bmad-output/implementation-artifacts/21-4-agents-md-template-opencode.md +242 -53
  10. package/_bmad-output/implementation-artifacts/21-5-clinerules-template-extension.md +180 -41
  11. package/_bmad-output/implementation-artifacts/21-6-onprem-layered-guardrails.md +250 -75
  12. package/_bmad-output/implementation-artifacts/21-7-bmad-persona-phase-prefix.md +221 -89
  13. package/_bmad-output/implementation-artifacts/21-8-vllm-reference-doc-readme.md +121 -63
  14. package/_bmad-output/implementation-artifacts/21-9-tests-validation.md +332 -61
  15. package/_bmad-output/implementation-artifacts/bug-bmad-recompile-fails-on-airgapped-network.md +112 -0
  16. package/_bmad-output/implementation-artifacts/sprint-status.yaml +3 -2
  17. package/bin/cli.js +59 -0
  18. package/docs/deployment/vllm-nemotron.md +130 -0
  19. package/lib/agents.js +17 -2
  20. package/lib/bmad-customize/bmm-analyst.customize.yaml +8 -0
  21. package/lib/bmad-customize/bmm-architect.customize.yaml +2 -0
  22. package/lib/bmad-customize/bmm-dev.customize.yaml +2 -0
  23. package/lib/bmad-customize/bmm-pm.customize.yaml +2 -0
  24. package/lib/bmad-customize/bmm-qa.customize.yaml +2 -0
  25. package/lib/bmad-customize/bmm-quick-flow-solo-dev.customize.yaml +8 -0
  26. package/lib/bmad-customize/bmm-sm.customize.yaml +2 -0
  27. package/lib/bmad-customize/bmm-tech-writer.customize.yaml +2 -0
  28. package/lib/bmad-customize/bmm-ux-designer.customize.yaml +2 -0
  29. package/lib/bmad.js +326 -1
  30. package/lib/installer.js +629 -43
  31. package/lib/merge/roomodes.js +125 -0
  32. package/lib/profile.js +25 -2
  33. package/lib/reconfigure.js +334 -0
  34. package/lib/templates/agents-md.template.md +67 -0
  35. package/lib/templates/clinerules.template.md +13 -0
  36. package/lib/templates/instruction-block-onprem.template.md +86 -0
  37. package/lib/templates/instruction-block-universal.template.md +29 -0
  38. package/lib/templates/roomodes.template.yaml +96 -0
  39. package/lib/uninstall.js +314 -0
  40. package/package.json +4 -3
  41. package/test/agents-md.test.js +398 -0
  42. package/test/bmad-extension.test.js +2 -2
  43. package/test/bmad-persona-phase-prefix.test.js +271 -0
  44. package/test/clinerules.test.js +339 -0
  45. package/test/instruction-block.test.js +388 -0
  46. package/test/integration-verification.test.js +2 -2
  47. package/test/migration-validation.test.js +2 -2
  48. package/test/offline-recompile.test.js +267 -0
  49. package/test/onprem-injection.test.js +425 -32
  50. package/test/onprem-layer.test.js +419 -0
  51. package/test/reconfigure.test.js +436 -0
  52. package/test/roomodes.test.js +343 -0
  53. package/test/uninstall.test.js +402 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "manifestVersion": "1.2.0",
3
+ "agent": null,
4
+ "agents": [
5
+ null
6
+ ],
7
+ "scope": "project",
8
+ "skills": {},
9
+ "profile": "standard"
10
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,97 @@
1
+ <!-- Generated by ma-agents. Edit outside the MA-AGENTS-START/END markers to preserve your changes. -->
2
+ # Project Agent Instructions
3
+
4
+ This file is auto-discovered by OpenCode and any agent that respects `AGENTS.md`.
5
+ It establishes universal safety rules, text-vs-file discipline, and BMAD phase
6
+ discipline for every agent operating in this project.
7
+
8
+ ## Universal Rules
9
+
10
+ The universal rules block below is stamped and maintained by ma-agents. Edit
11
+ outside the HTML-comment `MA-AGENTS` start and end markers to preserve your
12
+ own additions — content inside the markers is regenerated on every install.
13
+
14
+ <!-- MA-AGENTS-START -->
15
+ # AI Agent Skills - Planning Instruction
16
+
17
+ You have access to a library of skills in your skills directory. Before starting any task:
18
+
19
+ 1. Read the skill manifest at .opencode/skills/MANIFEST.yaml
20
+ 2. Based on the task description, select which skills are relevant
21
+ 3. Read only the selected skill files
22
+ 4. Then proceed with the task
23
+
24
+ Always load skills marked with always_load: true.
25
+ Do not load skills that are not relevant to the current task.
26
+
27
+ ## Respond in TEXT vs. create FILES
28
+
29
+ Choose your response medium deliberately. Defaulting to file creation when the user asked a question is a common failure mode — especially for coding agents running in web UIs.
30
+
31
+ - **Create or modify FILES when the user's request contains file-action keywords:** `create`, `write`, `generate`, `build`, `implement` (and obvious synonyms such as `add`, `produce`, `refactor`, `fix`, `update <file>`). These signal a concrete artifact is expected.
32
+ - **Respond in TEXT when the request contains text-response keywords:** `what do you think`, `how should we`, `discuss`, `opinion` (and obvious synonyms such as `explain`, `why`, `should I`, `compare`, `recommend`). These signal that a conversation is expected, not a deliverable.
33
+ - **If unsure, respond in TEXT.** A text answer can always be followed by file creation on confirmation; an unwanted file cannot be cleanly undone.
34
+ - **Never create `response.md`, `output.md`, or any similarly named scratch file as a reply.** A reply belongs in the chat transcript, not on disk.
35
+ - **Confirm file paths before writing.** When you are about to create or modify a file whose path the user has not explicitly named, state the intended path in text and wait for confirmation, unless the path is unambiguous from the task context.
36
+
37
+ ## BMAD phase discipline
38
+
39
+ BMAD-METHOD organizes work into declared phases (analysis, planning, architecture, story-creation, implementation, review). Respect the currently declared phase.
40
+
41
+ - **Do not skip ahead to implementation during planning.** If the project is in a planning phase — or the user has asked for requirements, architecture, or a story — produce planning artifacts, not code.
42
+ - **Do not retroactively plan after you have already coded.** If implementation has already started, flag the gap instead of fabricating back-dated planning documents.
43
+ - The declared phase is established by the active skill, the story status, or an explicit statement from the user. When none of these is available, ask before assuming.
44
+ <!-- MA-AGENTS-END -->
45
+
46
+ ## Critical Behavior Rules
47
+
48
+ These rules are non-negotiable across every profile and every agent.
49
+
50
+ - **Never create files in `~/.claude/` or any user home directory.** All
51
+ project artifacts must land inside the current working directory. Home-
52
+ directory writes cross-contaminate between projects and are a common source
53
+ of secret/config leakage.
54
+ - **Never write outside the project root without an explicit user request
55
+ naming the absolute path.** "Write to disk" means the project, not the
56
+ operator's machine.
57
+ - **Do not modify files you did not read first.** Read the current content
58
+ before proposing or performing an edit — blind writes silently destroy user
59
+ work.
60
+
61
+ ## BMAD Phase Declaration
62
+
63
+ BMAD-METHOD organizes work into four phases. Respect the currently declared
64
+ phase; do not skip ahead to the next phase without a phase transition signal
65
+ from the user, the active skill, or the story status.
66
+
67
+ - **Discovery / PM (analysis, planning).** Deliverables: product briefs,
68
+ PRDs, market and domain research, epics and stories lists. Do NOT produce
69
+ code, architecture diagrams, or implementation artifacts in this phase.
70
+ When asked "what do you think", respond in text.
71
+ - **Architecture.** Deliverables: solution design, component boundaries,
72
+ data-flow, interface contracts. Do NOT write application code or skill
73
+ implementations. Narrate decisions and capture them as documents.
74
+ - **Tech Lead / Stories.** Deliverables: individual story files with full
75
+ acceptance criteria, task breakdowns, and dev notes. Do NOT begin
76
+ implementation — stories are contracts the implementer consumes later.
77
+ - **Implementation.** Deliverables: code, tests, and the Dev Agent Record on
78
+ the story file. At this phase, write files. Do NOT retroactively fabricate
79
+ planning documents for code that already exists — flag the gap instead.
80
+
81
+ When no phase is declared (no active skill, no story in progress, no explicit
82
+ user statement), ask before assuming.
83
+
84
+ ## Project BMAD Output Structure
85
+
86
+ BMAD artifacts live under `_bmad-output/` (or the paths configured in
87
+ `_bmad/bmm/config.yaml` when present). The install-time resolver logs the
88
+ resolved paths on each run; consult that log output if in doubt.
89
+
90
+ - **Planning artifacts** — PRDs, product briefs, market and domain research.
91
+ - **Architecture artifacts** — solution design, component boundaries. May be
92
+ co-located with planning artifacts when no separate directory is configured.
93
+ - **Implementation artifacts (stories)** — individual story files and their
94
+ Dev Agent Records.
95
+
96
+ Always consult the `MANIFEST.yaml` referenced inside the universal block above
97
+ for the full list of installed skills and their locations.
package/MANIFEST.yaml ADDED
@@ -0,0 +1,3 @@
1
+ # MANIFEST.yaml
2
+
3
+ skills:
package/README.md CHANGED
@@ -36,8 +36,9 @@ Skills are written in a **unified generic format** and stored in this package. W
36
36
  3. Copies the skill and its resources into the target agent's directory
37
37
  4. Renames resource directories to match the agent's native structure (e.g., `references/` becomes `docs/` for Cline)
38
38
  5. **Generates `MANIFEST.yaml`**: A central discovery file for the agent to find all installed skills.
39
- 6. **Updates Instructions**: Injects planning hints into agent files (e.g., `CLAUDE.md`, `.clinerules`) to ensure the agent uses the skills.
40
- 7. **BMAD-METHOD Integration**: Automatically detects and integrates with [BMAD-METHOD](https://docs.bmad-method.org/), applying project-specific customizations and orchestration.
39
+ 6. **Updates Instruction Blocks**: Stamps a universal planning-instruction block into every agent's instruction file (`CLAUDE.md`, `.clinerules`, `.cline/clinerules.md`, `.roo/rules/00-ma-agents.md`, `AGENTS.md`) between `<!-- MA-AGENTS-START -->` / `<!-- MA-AGENTS-END -->` markers. User content outside the markers is preserved. On-prem profile additionally stamps guardrails for local LLMs.
40
+ 7. **BMAD Roo Code Modes**: Generates `.roomodes` with 4 BMAD planning-mode custom modes (`bmad-pm`, `bmad-architect`, `bmad-techlead`, `bmad-dev`), each with `fileRegex` restrictions that enforce planning-phase file access at the application layer.
41
+ 8. **BMAD-METHOD Integration**: Automatically detects and integrates with [BMAD-METHOD](https://docs.bmad-method.org/), applying project-specific customizations and orchestration.
41
42
 
42
43
  ```
43
44
  Generic (this repo) Installed Output
@@ -103,6 +104,37 @@ The file is version-controlled as part of `_bmad-output/` project knowledge. Com
103
104
 
104
105
  ---
105
106
 
107
+ ## On-Prem / Air-Gapped Deployment
108
+
109
+ When running AI coding agents against a locally-hosted LLM (e.g., Nemotron Super 49B on vLLM), `ma-agents install` asks a one-time profile question at setup:
110
+
111
+ ```
112
+ ? Profile (standard / on-prem):
113
+ ```
114
+
115
+ Your answer is persisted in `.ma-agents.json` under the `profile` field and is read on every subsequent install, update, or reconfigure. The manifest also records the `toolVersion` (ma-agents version) and `bmadVersion` (bundled bmad-method version) on every install, making it easy to verify what ran last. The `standard` profile produces the same output as always; the `on-prem` profile additionally stamps on-prem-specific guardrails into every agent's instruction block — including `/no_think` directives for planning personas, `str_replace_editor` prohibition, and home-directory write restrictions.
116
+
117
+ To change your profile after initial setup: `npx ma-agents reconfigure`
118
+ To remove all on-prem profile artifacts: `npx ma-agents uninstall --profile-artifacts`
119
+
120
+ ### What the on-prem profile stamps
121
+
122
+ | File | What is added |
123
+ |------|--------------|
124
+ | `CLAUDE.md` | Universal instruction block + on-prem guardrails (inside `MA-AGENTS-START/END` markers) |
125
+ | `.roo/rules/00-ma-agents.md` | Same block for Roo Code |
126
+ | `.clinerules` + `.cline/clinerules.md` | Same block for Cline |
127
+ | `AGENTS.md` | Same block for OpenCode |
128
+ | `opencode.json` | Additive entry in `instructions[]` array |
129
+ | `.roomodes` | 4 BMAD planning modes with `fileRegex` phase enforcement |
130
+ | `_bmad/_config/agents/bmm-*.customize.yaml` | Per-persona phase prefix: planning personas get `/no_think` prefix; dev personas get careful-coding prefix |
131
+
132
+ The standard profile stamps the universal block only (no `/no_think`, no `str_replace_editor` prohibition, no home-dir restriction).
133
+
134
+ For vLLM server configuration, quantization tradeoffs, per-phase sampling parameters, and the `str_replace_editor` hallucination mitigation, see [`docs/deployment/vllm-nemotron.md`](docs/deployment/vllm-nemotron.md).
135
+
136
+ ---
137
+
106
138
  ## Supported Coding Tools
107
139
 
108
140
  Skills can be installed into any of these AI coding agents:
@@ -246,6 +278,8 @@ npx ma-agents status # Show installed skills and paths
246
278
  npx ma-agents list # List all available skills
247
279
  npx ma-agents agents # List supported agents
248
280
  npx ma-agents uninstall <skill> <agents> # Direct uninstall
281
+ npx ma-agents reconfigure # Re-run profile prompt and re-stamp all artifacts
282
+ npx ma-agents uninstall --profile-artifacts # Remove on-prem profile content from all agent files
249
283
  ```
250
284
 
251
285
  ### The Update Process
@@ -573,16 +607,25 @@ ma-agents/
573
607
  ├── bin/
574
608
  │ └── cli.js # CLI entry point (wizard + commands)
575
609
  ├── lib/
576
- │ ├── agents.js # Agent configurations and paths
577
- │ ├── installer.js # Skill discovery and installation logic
578
- │ ├── bmad.js # BMAD-METHOD integration and injection logic
610
+ │ ├── agents.js # Agent configurations, paths, and extraInstructionTemplates
611
+ │ ├── installer.js # Skill installation, instruction-block stamping, marker management
612
+ │ ├── bmad.js # BMAD-METHOD integration, recompile, persona phase prefix
613
+ │ ├── profile.js # Profile persistence (getProfile / setProfile / resolveProfile / clearProfile)
614
+ │ ├── reconfigure.js # ma-agents reconfigure — re-stamp profile-dependent artifacts
615
+ │ ├── uninstall.js # ma-agents uninstall --profile-artifacts
616
+ │ ├── merge/
617
+ │ │ └── roomodes.js # YAML merger for .roomodes slug collision / user-slug preservation
618
+ │ ├── templates/
619
+ │ │ ├── instruction-block-universal.template.md # Universal planning-instruction block
620
+ │ │ ├── instruction-block-onprem.template.md # On-prem guardrails append (profile=on-prem)
621
+ │ │ ├── roomodes.template.yaml # 4 BMAD Roo Code modes with fileRegex
622
+ │ │ ├── agents-md.template.md # AGENTS.md for OpenCode
623
+ │ │ ├── clinerules.template.md # .clinerules expansion for Cline
624
+ │ │ └── project-context.template.md # project-context.md generation template
625
+ │ ├── bmad-customize/ # Per-persona customize.yaml with phase: + on_prem_phase_prefix:
579
626
  │ ├── bmad-cache/ # Pre-bundled BMAD external modules (bmb, cis, gds, tea)
580
627
  │ ├── bmad-customizations/ # BMAD persona templates (.md) and YAML configs
581
628
  │ ├── bmad-extension/ # Extension module: sprint management, bug tracking, agent skills
582
- │ │ ├── skills/ # SKILL.md packages (add-sprint, generate-backlog, etc.)
583
- │ │ ├── workflows/ # Legacy workflow copies (redirects to SKILL.md)
584
- │ │ ├── module.yaml # Extension module definition
585
- │ │ └── module-help.csv # Skill registry with descriptions and output paths
586
629
  │ ├── bmad-workflows/ # Specialized BMAD playbooks (SRE, Cyber, etc.)
587
630
  │ └── mil498-templates/ # MIL-STD-498 DID library (SRS, SSS, SSDD, etc.)
588
631
  ├── scripts/
@@ -1,6 +1,6 @@
1
1
  # Story 21.10: Profile Reconfigure
2
2
 
3
- Status: ready-for-dev
3
+ Status: Review
4
4
 
5
5
  ## Story
6
6
 
@@ -117,21 +117,45 @@ Match the existing test layout (node:test or mocha-style — verify by reading o
117
117
 
118
118
  ### Epic 21 Cross-Story Context
119
119
 
120
- **Story 21.10 (this):** Reconfigure subcommand — escape hatch for a previously-persisted profile. Depends on Stories 21.1 (profile API), 21.2 (marker injection + backup convention), 21.3 (slug-stomp protection), 21.5 (dual-file drift detection), 21.6 (on-prem layer composition — the actual content being re-stamped). Runs after 21.6 in the execution order; must exist before 21.9's end-to-end tests so the round-trip test (21.9 AC #1 (f)) can exercise the real command instead of manual `.ma-agents.json` edits.
120
+ **Story 21.10 (this):** Reconfigure subcommand — escape hatch for a previously-persisted profile. Depends on Stories 21.1 (profile API), 21.2 (marker injection + backup convention), 21.3 (slug-stomp protection), 21.4 (`AGENTS.md` template + `markdown-markers` merger — re-stamped on profile flip), 21.5 (dual-file drift detection), 21.6 (on-prem layer composition — the actual content being re-stamped), 21.7 (BMAD persona `on_prem_phase_prefix` — re-composed when profile flips, per Task 3.3). Runs after 21.6 in the execution order; must exist before 21.9's end-to-end tests so the round-trip test (21.9 AC #1 (f)) can exercise the real command instead of manual `.ma-agents.json` edits.
121
121
 
122
122
  ## Dev Agent Record
123
123
 
124
124
  ### Agent Model Used
125
- _(to be filled by dev agent)_
125
+ Claude Opus 4.6 (1M context) bmad-dev-story flow.
126
126
 
127
127
  ### Debug Log References
128
- _(to be filled by dev agent)_
128
+ - `.roomodes` slug-divergence comparison deliberately strips `customInstructions` because installed files already carry the profile-composed universal block; a profile flip legitimately rewrites that field. `whenToUse`, `roleDefinition`, `groups`, `name` are the user-editable surfaces the check catches. Documented inline in `lib/reconfigure.js::checkRoomodesSlugDivergence`.
129
+ - `updateAgentInstructions` is invoked with `yesMode: true` from the reconfigure loop so per-file drift prompts do not re-ask after the global `Continue?` confirmation (AC #7). The installer's `handleMarkerBlockDrift` still emits the pinned WARNING line and writes the canonical `<target>.backup-<ISO>` sibling (AC #8).
130
+ - `appendProfileHistory` does a fresh read-modify-write of `.ma-agents.json` so it composes with `setProfile`'s write — no parallel JSON-IO path. Cap enforcement is `shift()`-based (oldest-first eviction).
129
131
 
130
132
  ### Completion Notes List
131
- _(to be filled by dev agent)_
133
+ - New `lib/reconfigure.js` orchestrator exports `reconfigure({ projectRoot, argv, promptsLib, now })` plus three named error classes (`RoomodesSlugDivergenceError`, `ManifestNotFoundError`, `ReconfigureYesRejectedError`) and the `PROFILE_HISTORY_CAP` constant (20).
134
+ - `bin/cli.js` registers the `reconfigure` verb and routes to `handleReconfigure`, which maps each error class to a user-facing exit(1) message. `--yes` on reconfigure exits nonzero with the pinned message verbatim (AC #6).
135
+ - Re-stamp reuses the canonical `updateAgentInstructions` path from `lib/installer.js`; zero forked logic. Backups are produced by the installer's existing drift handler using the canonical `buildBackupFilename` helper owned by Story 21.2.
136
+ - `checkRoomodesSlugDivergence` throws `RoomodesSlugDivergenceError` when any ma-agents-owned slug present in the existing `.roomodes` differs from the shipped template on non-customInstructions fields; `--force-roomodes-overwrite` bypasses the check (AC #9). `.clinerules` dual-file drift is delegated to Story 21.5's `checkClinerulesDualFileDrift` (no override, AC #10).
137
+ - `profileHistory` append uses a fresh read-modify-write that composes with `setProfile`'s write — capped at 20, oldest-first eviction (AC #11). Missing-field start is handled (first reconfigure creates the array).
138
+ - Prompt shape mirrors Story 21.1's wizard prompt (same two choices) but with `initial` set to the persisted value's row and the message `Current profile: <value>. Change to?` per AC #2.
139
+
140
+ ### Adversarial Review Findings
141
+
142
+ | # | Layer | Severity | Finding | Disposition |
143
+ |---|-------|----------|---------|-------------|
144
+ | 1 | Cynical | P1 | setProfile runs BEFORE re-stamp loop; mid-flight re-stamp failure leaves profile+artifacts out of sync | Accepted — story explicitly lists "Auto-rollback" as out of scope; `profileHistory` append is gated on full loop success so forensic log does not falsely record a partial reconfigure |
145
+ | 2 | Cynical | P2 | `--yes` detection is string-includes on argv; benign for reconfigure (no positional args) | Accepted — same pattern as installer; reconfigure AC #1 forbids positional args |
146
+ | 3 | Edge-case | P1 | Slug-divergence check drops `customInstructions` from the compare | Correct by design — installer-stamped `customInstructions` carries the composed block which legitimately changes per profile; other fields remain user-edit detectors. Test 8.7 exercises `whenToUse` drift |
147
+ | 4 | Cynical | P2 | `appendProfileHistory` is read-modify-write, not atomic rename | Accepted — matches `setProfile`'s write pattern; reconfigure is interactive-only so concurrency isn't a realistic vector |
148
+ | 5 | Edge-case | P2 | Same-value short-circuit when `persistedProfile === undefined` requires user to pick a value; cannot short-circuit to undefined | Accepted — prompt choices are `on-prem` | `standard` only; chosenProfile is always a concrete value |
149
+ | 6 | Edge-case | P2 | No help-text doc for `--force-roomodes-overwrite` | **Fixed** — added Reconfigure options block in `showHelp()` |
132
150
 
133
151
  ### File List
134
- _(to be filled by dev agent)_
152
+ - CREATED: `lib/reconfigure.js`
153
+ - CREATED: `test/reconfigure.test.js` (12 tests, all passing)
154
+ - MODIFIED: `bin/cli.js` (new `reconfigure` case + `handleReconfigure` + help text)
155
+ - MODIFIED: `package.json` (added `test/reconfigure.test.js` to npm test script)
156
+ - MODIFIED: `_bmad-output/implementation-artifacts/21-10-profile-reconfigure.md` (Dev Agent Record / File List / Change Log)
135
157
 
136
158
  ## Change Log
159
+ - 2026-04-15: Story 21.10 implemented — reconfigure CLI verb + orchestrator + slug/dual-file guards + profileHistory append. Status ready-for-dev → review.
160
+ - 2026-04-15: Upstream dependency list completed per adversarial-review finding — added Stories 21.4 (`AGENTS.md` re-stamping surface), 21.7 (BMAD persona phase prefix re-composition). Restores Dependencies bidirectionality with those stories' downstream lists.
137
161
  - 2026-04-14: Story created (Epic 21, Story 21.10). Closes adversarial-review Findings #5 and #7 (no escape hatch for persisted profile; CI-default silent-downgrade trap).
@@ -129,7 +129,7 @@ Story 21.1 AC #1 pinned `lib/profile.js` to exactly three exports: `getProfile`,
129
129
 
130
130
  ### Epic 21 Cross-Story Context
131
131
 
132
- **Story 21.11 (this):** Uninstall subcommand — rollback path for profile-dependent content. Depends on Stories 21.1 (profile API — extends it), 21.2 (marker injection + backup convention), 21.3 (slug list + audit log), 21.6 (on-prem layer composition — reverses it), 21.10 (`profileHistory` field — preserves + appends). Runs LAST in the Epic 21 execution order (after 21.9) because the 21.9 end-to-end test harness needs uninstall as part of round-trip coverage, and uninstall must not land before all upstream stamping work is committable.
132
+ **Story 21.11 (this):** Uninstall subcommand — rollback path for profile-dependent content. Depends on Stories 21.1 (profile API — extends it), 21.2 (marker injection + backup convention), 21.3 (slug list + audit log), 21.4 (`AGENTS.md` — removes the ma-agents-stamped file / marker block), 21.5 (`.clinerules` + `.cline/clinerules.md` — removes both Cline rule files' ma-agents marker blocks), 21.6 (on-prem layer composition — reverses it), 21.7 (BMAD persona `on_prem_phase_prefix` — strips prefix when uninstalling profile artifacts), 21.10 (`profileHistory` field — preserves + appends). Runs LAST in the Epic 21 execution order (after 21.9) because the 21.9 end-to-end test harness needs uninstall as part of round-trip coverage, and uninstall must not land before all upstream stamping work is committable.
133
133
 
134
134
  ## Dev Agent Record
135
135
 
@@ -146,4 +146,5 @@ _(to be filled by dev agent)_
146
146
  _(to be filled by dev agent)_
147
147
 
148
148
  ## Change Log
149
+ - 2026-04-15: Upstream dependency list completed per adversarial-review finding — added Stories 21.4 (`AGENTS.md` removal surface), 21.5 (`.clinerules` dual-file removal surface), 21.7 (BMAD persona phase-prefix strip on uninstall). Restores Dependencies bidirectionality with those stories' downstream lists.
149
150
  - 2026-04-14: Story created (Epic 21, Story 21.11). Closes adversarial-review Finding #17 (no uninstall / rollback path).