- Introduced `kicad_cli.sh` for local and Docker-based kicad-cli execution. - Created `schops.py` for schematic operations including ERC, BOM, netlist exports, and bulk edits. - Added README.md for schops with installation and usage instructions. - Included requirements.txt for necessary Python packages. - Implemented rules engine for applying field defaults and renaming nets. - Added tests for rules engine functionality. - Introduced scope guard script to enforce file modification policies based on PR labels. - Created watch script to monitor KiCad files and trigger hardware gate on changes.
33 lines
980 B
Python
33 lines
980 B
Python
#!/usr/bin/env python3
|
|
"""Compose a Codex prompt from repo context + sanitized issue."""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
BASE = Path(__file__).resolve().parents[2]
|
|
|
|
def read(p: str) -> str:
|
|
return (BASE / p).read_text(encoding="utf-8")
|
|
|
|
def main():
|
|
if len(sys.argv) != 3:
|
|
print("usage: compose_codex_prompt.py <issue_txt> <out_prompt_md>", file=sys.stderr)
|
|
return 2
|
|
issue = Path(sys.argv[1]).read_text(encoding="utf-8")
|
|
base = read(".github/codex/prompts/issue_to_pr_base.md")
|
|
out = (
|
|
base
|
|
+ "\n\n## Repo context pointers\n"
|
|
+ "- constraints: `specs/constraints.yaml`\n"
|
|
+ "- specs flow: `specs/README.md`\n"
|
|
+ "- standards: `standards/README.md`\n"
|
|
+ "- BMAD gates: `bmad/gates/gate_s0.md`, `bmad/gates/gate_s1.md`\n"
|
|
+ "\n\n-----BEGIN_ISSUE_TEXT-----\n"
|
|
+ issue
|
|
+ "\n-----END_ISSUE_TEXT-----\n"
|
|
)
|
|
Path(sys.argv[2]).write_text(out, encoding="utf-8")
|
|
return 0
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|