app
AI Flow
Public Made by Adomby adom
Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board.
← Commit history
Merge PR #257: 0.2.1: project-page makes a standalone page (project-page-standalone-0.2.1 -> main) merge
Showing changes introduced by the merge (against its first parent).
4 files changed
+13−5
crates/adom-aiflow/src/main.rs+4−3@@ -125,7 +125,8 @@ enum Cmd { Parts { #[arg(long)] bom: Option<String>, #[arg(long)] show: bool, #[arg(long, default_value_t = 4)] dwell: u64 }, /// `project-page --page <owner/slug> [--create]`: revision 1 of the board's project page before any EDA work: a README that says what the board is with the component table, and a KiCad PCM repository of every part (an Adom Cloud Library, exported and repackaged for KiCad's Plugin and Content Manager). Opens the page in Hydrogen. ProjectPage { #[arg(long)] page: String, /// push every visited step's sub-readme and the README's "How this board was built" section now (each step's is also pushed in the background when the run leaves it)- #[arg(long)] sync: bool, #[arg(long)] create: bool, #[arg(long)] private: bool, #[arg(long)] title: Option<String>, #[arg(long)] brief: Option<String>, #[arg(long)] replace_readme: bool, #[arg(long)] no_push: bool },+ #[arg(long)] sync: bool, #[arg(long)] create: bool, /// the page already exists and is this same board's own page (an earlier run of it); refused otherwise+ #[arg(long)] existing: bool, #[arg(long)] private: bool, #[arg(long)] title: Option<String>, #[arg(long)] brief: Option<String>, #[arg(long)] replace_readme: bool, #[arg(long)] no_push: bool }, /// `pcm check`: the project page's PCM package is installed in the test box's KiCad (kicad_pcm_list), so the schematic can use every part. Install it first with kicad_pcm_add_repository + kicad_pcm_install (the URLs project-page printed). Pcm { #[arg(value_parser = ["check"])] what: String }, /// `schematic check --sch <file.kicad_sch>`: the from-scratch KiCad schematic, drawn in KiCad: kicad-cli ERC with no errors, every BOM reference on the sheet, every part from the project's PCM library (PCM_<lib>). Records the schematic for the netlist check that follows the board.@@ -2712,7 +2713,7 @@ fn main() { } ok(&format!("every part is on the wiki ({} parts):\n{}", rows.len(), list.join("\n")), &["Next: `step project-page`, then `project-page --page <owner/slug> --create`: the board's page, revision 1, with the component table and the KiCad PCM repository.".into()]); }- Cmd::ProjectPage { page, sync, create, private, title, brief, replace_readme, no_push } => {+ Cmd::ProjectPage { page, sync, create, existing, private, title, brief, replace_readme, no_push } => { let t = thread(&cli); let mut r = load_run(&cli); if *sync {@@ -2729,7 +2730,7 @@ fn main() { let (spec, req) = (spec_soft(&r), requirements_of(&r)); let title = title.clone().or_else(|| req["title"].as_str().map(str::to_string)).or_else(|| spec["title"].as_str().map(str::to_string)).unwrap_or_else(|| sequence::title(&r.data)); let brief = brief.clone().or_else(|| req["summary"].as_str().or(req["description"].as_str()).map(str::to_string)).unwrap_or_else(|| title.clone());- let cfg = json!({"run": dir.display().to_string(), "page": page, "title": title, "brief": brief, "summary": req["description"].as_str().unwrap_or(""), "parts": parts["parts"], "create": create, "push": !no_push, "private": private, "replaceReadme": replace_readme, "version": "1.0.0"});+ let cfg = json!({"run": dir.display().to_string(), "page": page, "title": title, "brief": brief, "summary": req["description"].as_str().unwrap_or(""), "parts": parts["parts"], "create": create, "push": !no_push, "private": private, "replaceReadme": replace_readme, "existing": existing, "version": "1.0.0"}); let cfgp = dir.join("project-page").join("config.json"); let _ = std::fs::create_dir_all(cfgp.parent().unwrap()); std::fs::write(&cfgp, serde_json::to_string_pretty(&cfg).unwrap()).unwrap();
docs/release-0.2.1.mdadded+3@@ -0,0 +1,3 @@+# adom-aiflow 0.2.1++`project-page` refuses a page that already exists unless `--existing` says it is this same board's own page: a new board always gets its own standalone page, and one board's library never lands on another page.
skills/adom-aiflow/SKILL.md+1−1@@ -217,7 +217,7 @@ A KiCad run that starts with no board (`intake` with no `start --board`) follows 1. **`sourcing check --bom design/bom.csv`** as above. 2. **`step parts`, `parts --show`**: every BOM row with an MPN is matched to its Adom wiki component page; one Hydrogen tab ("Parts ยท <run>") steps through the pages so the viewer sees the parts picked. A part with no page: make it with the wiki-component skill (datasheet symbol, footprint, STEP; verified), run `parts --show` again. Never swap in a similar part to dodge a missing page.-3. **`step project-page`, `project-page --page <owner>/<slug> --create`**: revision 1 of the board's one project page before any EDA work: a README saying what the board is, the component table (references, value, MPN, manufacturer, each part's wiki page) and a KiCad PCM repository of every part (an Adom Cloud Library of the parts, exported and repackaged for KiCad's Plugin and Content Manager, served from the page at `/api/pages/<owner>/<slug>/files/pcm/repository.json`). Later revisions update this same page (aiflow-project-page skill); never a second page for the board.+3. **`step project-page`, `project-page --page <owner>/<slug> --create`**: revision 1 of the board's one project page before any EDA work: a README saying what the board is, the component table (references, value, MPN, manufacturer, each part's wiki page) and a KiCad PCM repository of every part (an Adom Cloud Library of the parts, exported and repackaged for KiCad's Plugin and Content Manager, served from the page at `/api/pages/<owner>/<slug>/files/pcm/repository.json`). A new board always gets a new, standalone page (a new slug, `--create`); `project-page` refuses an existing page unless `--existing` says it is this same board's own page. Later revisions update this same page (aiflow-project-page skill); never a second page for the board. 4. **`step library`**: install the parts in KiCad on the test box: `kicad_pcm_add_repository {"url": <repositoryUrl>}`, `kicad_pcm_install {"repositoryUrl": ..., "identifier": ...}` (both printed by `project-page`), restart KiCad, then **`pcm check`** (the package is in `kicad_pcm_list`). The library is `PCM_<slug>`. 5. **`step schematic`**: draw the schematic in KiCad's schematic editor, on camera: `kicad_open_schematic`, `kicad_sch_place_symbol` (symbols from `PCM_<slug>`), `kicad_sch_wire`, `kicad_sch_label`, `kicad_sch_set_property`; save; **`schematic check --sch <project>.kicad_sch`** passes when kicad-cli ERC has no errors, every BOM reference is on the sheet and every part comes from the project library. Never write the `.kicad_sch` with a script of your own: the viewer is meant to see it drawn. 6. Simulate (as in the Fusion lane), then make the board in KiCad (Update PCB from Schematic, the outline), save it and attach it (`start --board ... --spec ...` on the same `--run`), `step components` and on.
tools/project-page.py+5−1@@ -155,7 +155,11 @@ def main(): work = os.path.join(cfg["run"], "project-page"); os.makedirs(work, exist_ok=True) page_url = f"https://wiki.adom.inc/{owner}/{slug}" created = False- if cfg.get("push") and not page_exists(cfg["page"]): # a dry run (--no-push) builds everything locally+ exists = cfg.get("push") and page_exists(cfg["page"])+ if exists and not cfg.get("existing"):+ # a new board gets its own new page: never add one board's library to another board's (or anyone's) page+ raise SystemExit(json.dumps({"ok": False, "error": f"{cfg['page']} already exists. A new board gets its own new page: choose a new slug (--create). Pass --existing only when that page is this same board's own page from an earlier run."}))+ if cfg.get("push") and not exists: # a dry run (--no-push) builds everything locally if not cfg.get("create"): raise SystemExit(json.dumps({"ok": False, "error": f"{cfg['page']} does not exist; pass --create to make it"})) args = ["adom-wiki", "page", "create", slug, "--type", "hardware", "--kind", "board", "--title", cfg["title"], "--brief", cfg["brief"][:200],