{"record":{"id":"ba17ef12d8e32eaa","repo":"nikivdev/code","slug":"no-flow-toml-found-in-current-directory","errorCode":null,"errorMessage":"No flow.toml found in current directory","messagePattern":"No flow\\.toml found in current directory","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/skills.rs","lineNumber":1320,"sourceCode":"        if !existed {\n            created += 1;\n        } else if should_write || normalized {\n            updated += 1;\n        }\n\n        write_task_skill_metadata(&skill_dir, task, options)?;\n    }\n\n    Ok((created, updated))\n}\n\n/// Sync flow.toml tasks as skills.\nfn sync_skills() -> Result<()> {\n    let cwd = std::env::current_dir()?;\n    let flow_toml = cwd.join(\"flow.toml\");\n\n    if !flow_toml.exists() {\n        bail!(\"No flow.toml found in current directory\");\n    }\n\n    // Load flow.toml\n    let cfg = config::load(&flow_toml)?;\n\n    let skills_dir = get_skills_dir()?;\n    let normalized = normalize_skill_files(&skills_dir)?;\n    let options = resolve_skill_sync_options(cfg.skills.as_ref());\n    let (created, updated) = sync_tasks_to_skills(&skills_dir, &cfg.tasks, options)?;\n\n    // Ensure symlinks exist for Claude Code and Codex\n    ensure_symlinks()?;\n\n    println!(\"Synced {} tasks from flow.toml\", cfg.tasks.len());\n    if created > 0 {\n        println!(\"  Created: {}\", created);\n    }\n    if updated > 0 {","sourceCodeStart":1302,"sourceCodeEnd":1338,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/skills.rs#L1302-L1338","documentation":"sync_skills syncs tasks from a flow.toml file in the current directory into the skills directory. Before doing anything it checks cwd.join(\"flow.toml\").exists(); if the file is absent it bails immediately. This is a plain precondition failure: the command was run outside a directory containing a flow.toml.","triggerScenarios":"Running the `sync` command from a directory with no flow.toml; being in a subdirectory of the project instead of the project root; flow.toml renamed or deleted; typo'd working directory.","commonSituations":"Developer runs the CLI from home directory or repo root when flow.toml lives in a subfolder; CI working directory set to the wrong path; project uses a different config filename after a migration.","solutions":["cd to the directory containing flow.toml and rerun the sync command","Create a flow.toml in the current directory if one is intended","Support an explicit --config <path> flag or FLOW_TOML env var so cwd doesn't matter","Fix CI/IDE working-directory configuration to point at the project root"],"exampleFix":"// before: depends entirely on cwd\nlet cwd = std::env::current_dir()?;\nlet flow_toml = cwd.join(\"flow.toml\");\n// after: allow explicit override\nlet flow_toml = std::env::var_os(\"FLOW_TOML\")\n    .map(std::path::PathBuf::from)\n    .unwrap_or_else(|| std::env::current_dir().unwrap().join(\"flow.toml\"));","handlingStrategy":"validation","validationCode":"let flow_toml = std::path::Path::new(\"flow.toml\");\nif !flow_toml.exists() {\n    return Err(anyhow::anyhow!(\n        \"No flow.toml in {} — run from the project root\",\n        std::env::current_dir()?.display()\n    ));\n}","typeGuard":null,"tryCatchPattern":"match sync_skills() {\n    Ok(()) => println!(\"skills synced\"),\n    Err(e) if e.to_string().contains(\"No flow.toml\") => {\n        eprintln!(\"Run this command from the directory containing flow.toml\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always run the sync command from the project root containing flow.toml","Set the working directory explicitly in CI configs and IDE run configurations","Check for flow.toml with a quick `test -f flow.toml` before invoking","Support an explicit config path flag so cwd dependence disappears"],"tags":["config","filesystem","flow-toml","cli"],"backgroundTag":"missing-config-file","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}