Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pytest

sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
import pick_methods
import pick_methods # noqa: E402

CSV = """num,category,method_name,description,output_pattern
1,risk,Pre-mortem Analysis,Imagine future failure then work backwards,failure → causes → prevention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_placeholder_version_caught():


def test_no_stack_section_ok():
text = CLEAN.split("## Stack", maxsplit=1)[0]
text = CLEAN.split("## Stack")[0]
result = lint_spine.lint(text)
assert "version_pin" not in cats(result)

Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/bmad-brainstorming/scripts/brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _hsl_hex(deg: int, s: float, lt: float) -> str:
import colorsys

r, g, b = colorsys.hls_to_rgb((deg % 360) / 360, lt, s)
return f"#{round(r * 255):02x}{round(g * 255):02x}{round(b * 255):02x}"
return "#%02x%02x%02x" % (round(r * 255), round(g * 255), round(b * 255))


def category_style(cat: str) -> tuple[str, str]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest

sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
import brain
import brain # noqa: E402

CSV = """category,technique_name,description,detail
collaborative,Yes And Building,Build on every idea with "yes and" to keep momentum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
import resolve_personas as rp
import resolve_personas as rp # noqa: E402

AGENTS = {
"bmad-agent-analyst": {"name": "Mary", "icon": "📊", "title": "Analyst"},
Expand Down Expand Up @@ -43,7 +43,7 @@ def test_pure_custom_member_stays_out_of_default_room(self):
self.assertEqual(pool["morpheus"]["persona"], "riddles")

def test_custom_override_lands_on_installed_slot_not_a_new_face(self):
pool, _, _installed, custom = rp.build_pool(
pool, _, installed, custom = rp.build_pool(
AGENTS, [{"code": "analyst", "name": "Mary-Custom", "persona": "p"}])
self.assertNotIn("analyst", pool)
self.assertEqual(custom, []) # an override is not a new face
Expand All @@ -69,7 +69,7 @@ def test_brief_carries_model_and_capabilities(self):
self.assertEqual(brief["capabilities"], ["x"])

def test_non_list_party_members_is_safe(self):
pool, _, _installed, custom = rp.build_pool(AGENTS, "not-a-list")
pool, _, installed, custom = rp.build_pool(AGENTS, "not-a-list")
self.assertEqual(custom, [])
self.assertEqual(set(pool), {"bmad-agent-analyst", "bmad-agent-pm"})

Expand Down Expand Up @@ -119,7 +119,7 @@ class TestOverrideMergeFallback(unittest.TestCase):
"""When party-mode isn't installed, user override TOMLs are read directly."""

def test_arrays_append_scalars_override(self):
import tempfile
import tempfile, os
with tempfile.TemporaryDirectory() as d:
custom = Path(d) / "_bmad" / "custom"
custom.mkdir(parents=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
import resolve_party as rp
import resolve_party as rp # noqa: E402

AGENTS = {
"bmad-agent-analyst": {"name": "Mary", "icon": "📊", "title": "Analyst"},
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/bmad-retrospective/scripts/git_evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _git_log(repo, extra_args, rng):
errors="surrogateescape",
env={k: v for k, v in os.environ.items() if not k.startswith("GIT_")},
)
except Exception as exc:
except Exception as exc: # noqa: BLE001
_emit({"ok": False, "error": str(exc)}, 1)

if proc.returncode != 0:
Expand Down
17 changes: 9 additions & 8 deletions .agents/skills/bmad-retrospective/scripts/sprint_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""

import argparse
import contextlib
import hashlib
import io
import json
Expand Down Expand Up @@ -50,7 +49,7 @@ def _load_yaml(path):
# file. utf-8 is ruamel's current default, but the file is read back as
# utf-8 unconditionally, so state it rather than inherit it.
yaml.encoding = "utf-8"
with open(path, encoding="utf-8") as fh:
with open(path, "r", encoding="utf-8") as fh:
data = yaml.load(fh)
return yaml, data

Expand Down Expand Up @@ -172,7 +171,7 @@ def _load_document(path, restored=None):
_emit_error(f"{path} is not valid UTF-8: {exc}", 1, restored)
except OSError as exc:
_emit_error(str(exc), 1, restored)
except Exception as exc:
except Exception as exc: # noqa: BLE001 - report any parse error as JSON
_emit_error(str(exc), 1, restored)

if data is not None and not isinstance(data, Mapping):
Expand Down Expand Up @@ -232,8 +231,10 @@ def _atomic_write(path, payload, mode=None):
os.chmod(tmp_path, mode)
os.replace(tmp_path, path)
except BaseException:
with contextlib.suppress(OSError):
try:
os.unlink(tmp_path)
except OSError:
pass
raise
# The directory sync sits outside the try because once os.replace has
# returned, the new bytes ARE the file: a failure past that point must not
Expand Down Expand Up @@ -558,7 +559,7 @@ def cmd_update(args):
# 7. Serialize, then swap the file atomically.
try:
_atomic_write(args.file, _dump_bytes(yaml, data), original_mode)
except Exception as exc:
except Exception as exc: # noqa: BLE001
# The target is only ever touched by the final rename, so if the write
# raised, the original is still on disk byte-for-byte. Calling _restore
# here would rewrite a file that was never modified -- the one write in
Expand All @@ -572,7 +573,7 @@ def _fail(msg):

try:
_, reloaded = _load_yaml(args.file)
except Exception as exc:
except Exception as exc: # noqa: BLE001
_fail(f"re-parse failed after write: {exc}")

if reloaded is None:
Expand Down Expand Up @@ -613,7 +614,7 @@ def _fail(msg):
)

try:
with open(args.file, encoding="utf-8") as fh:
with open(args.file, "r", encoding="utf-8") as fh:
new_text = fh.read()
except (OSError, UnicodeDecodeError) as exc:
_fail(f"re-read failed after write: {exc}")
Expand Down Expand Up @@ -651,7 +652,7 @@ def _restore(path, original_bytes, mode=None):
try:
_atomic_write(path, original_bytes, mode)
return True
except Exception as exc:
except Exception as exc: # noqa: BLE001 - best-effort restore
sys.stderr.write(f"restore failed: {exc}\n")
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _write_action_fixture(tmp_path):

def _load(path):
yaml = YAML(typ="rt")
with open(path, encoding="utf-8") as fh:
with open(path, "r", encoding="utf-8") as fh:
return yaml.load(fh)


Expand Down Expand Up @@ -650,7 +650,7 @@ def test_template_round_trip_changes_only_last_updated(tmp_path):
before = source.splitlines()
after = target.read_text(encoding="utf-8").splitlines()
assert len(before) == len(after)
changed = [(b, a) for b, a in zip(before, after, strict=False) if b != a]
changed = [(b, a) for b, a in zip(before, after) if b != a]
assert len(changed) == 1, changed
assert changed[0][1] == "last_updated: 01-01-2026 09:00"
# The pre-existing action item keeps its 2-space sequence indent.
Expand Down Expand Up @@ -1096,7 +1096,7 @@ def test_set_action_status_changes_exactly_one_line(tmp_path):
before = ACTION_FIXTURE.splitlines()
after = target.read_text(encoding="utf-8").splitlines()
assert len(before) == len(after)
changed = [(b, a) for b, a in zip(before, after, strict=False) if b != a]
changed = [(b, a) for b, a in zip(before, after) if b != a]
assert changed == [(' status: "open"', ' status: "done"')], changed


Expand Down Expand Up @@ -1497,7 +1497,7 @@ def test_status_write_preserves_every_scalar_style(tmp_path):
before = STYLE_FIXTURE.splitlines()
after = target.read_text(encoding="utf-8").splitlines()
assert len(before) == len(after)
changed = [(b, a) for b, a in zip(before, after, strict=False) if b != a]
changed = [(b, a) for b, a in zip(before, after) if b != a]
assert changed == [
(' status: "open"', ' status: "done"'),
(" status: 'open'", " status: 'done'"),
Expand Down
13 changes: 7 additions & 6 deletions .agents/skills/bmad-sprint-planning/scripts/sprint_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"""

import argparse
import contextlib
import hashlib
import io
import json
Expand Down Expand Up @@ -228,7 +227,7 @@ def _load_existing(path):
if not Path(path).exists():
return yaml, None
try:
with open(path, encoding="utf-8") as fh:
with io.open(path, "r", encoding="utf-8") as fh:
data = yaml.load(fh)
except Exception as exc:
_fail(f"existing status file is not valid YAML: {exc}", status_file=str(path))
Expand Down Expand Up @@ -348,8 +347,10 @@ def _atomic_write(path, payload, mode=None):
os.chmod(tmp, mode)
os.replace(tmp, path)
except BaseException:
with contextlib.suppress(OSError):
try:
os.unlink(tmp)
except OSError:
pass
raise


Expand Down Expand Up @@ -447,9 +448,9 @@ def _meta(field, arg_value, default):
payload = _dump_bytes(yaml, doc)
_atomic_write(args.status_file, payload, original_mode)
verify_yaml = _make_yaml()
with open(args.status_file, encoding="utf-8") as fh:
with io.open(args.status_file, "r", encoding="utf-8") as fh:
reread = verify_yaml.load(fh)
if dict(reread.get("development_status") or {}) != dict(dev.items()):
if dict(reread.get("development_status") or {}) != {k: v for k, v in dev.items()}:
raise ValueError("development_status mismatch after write")
for field in ("generated", "last_updated", "project"):
if str(reread.get(field)) != str(doc[field]):
Expand Down Expand Up @@ -604,7 +605,7 @@ def cmd_validate(args):
return
yaml = _make_yaml()
try:
with open(args.status_file, encoding="utf-8") as fh:
with io.open(args.status_file, "r", encoding="utf-8") as fh:
data = yaml.load(fh)
except Exception as exc:
print(json.dumps({
Expand Down
5 changes: 0 additions & 5 deletions .opencode/commands/bmad-advanced-elicitation.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-agent-analyst.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-agent-architect.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-agent-dev.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-agent-pm.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-agent-ux-designer.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-architecture.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-brainstorming.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-build-auto.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-build.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-checkpoint-preview.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-code-review.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-correct-course.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-create-architecture.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-create-epics-and-stories.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-create-prd.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-create-story.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-customize.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-deep-recon.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-dev-auto.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-dev-story.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-document-project.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-domain-research.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-edit-prd.md

This file was deleted.

5 changes: 0 additions & 5 deletions .opencode/commands/bmad-editorial-review-prose.md

This file was deleted.

Loading
Loading