docs: update README with typical usage flow and local development instructions#26
Conversation
📝 WalkthroughWalkthroughUpdated README installation and usage instructions; changed CLI init flow to embed Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant CLI
participant TemplateGen as Template Generator
participant FS as File System
User->>CLI: run `cyberfabric mod init` (new project)
CLI->>TemplateGen: generate project template at path
TemplateGen-->>CLI: generation complete
CLI->>FS: create dir `.agents/skills/cyberfabric/`
FS-->>CLI: dir created (or error)
CLI->>FS: write `SKILLS.md` (embedded content)
FS-->>CLI: file written (or error)
CLI->>User: print success message
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
9-10:⚠️ Potential issue | 🟡 MinorPrerequisite "local clone" is no longer required for installation.
The prerequisites list "A local clone of this repository," but the updated installation command on line 22 uses
cargo install --git, which clones the repository automatically. A local clone is only needed for local development (covered separately in lines 112-118).📝 Suggested fix
### Prerequisites - Rust toolchain with `cargo` -- A local clone of this repository🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 9 - 10, Remove or update the prereqs bullet that reads "A local clone of this repository" in the prerequisites list so it no longer claims a local clone is required for installation; either delete that bullet or replace it with a note that a local clone is only necessary for local development (referencing the existing installation section using `cargo install --git` on line 22 and the development section around lines 112-118) to avoid confusion.
🧹 Nitpick comments (2)
README.md (1)
67-68: Minor inconsistency: usescyberfabricinstead ofcargo cyberfabric.Line 47-48 recommends using
cargo cyberfabricfor running, but line 68 shows an example usingcyberfabric run. Consider aligning for consistency, or explicitly note that both forms work interchangeably.📝 Suggested alignment
You can run the tool from any directory by specifying the path to the workspace with the `-p` flag. The default will be -the current directory. `cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml` +the current directory. `cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml`🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 67 - 68, The README example is inconsistent: replace or clarify the command string 'cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml' so it matches the earlier recommendation to use 'cargo cyberfabric' (e.g., change to 'cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml') or add a short parenthetical explaining that both 'cargo cyberfabric ...' and the direct 'cyberfabric ...' invocation are interchangeable; update the single-line example accordingly to keep the document consistent with the earlier guidance.crates/cli/src/mod/init.rs (1)
76-84: Consider the overwrite behavior for SKILLS.md.
std::fs::writewill silently overwrite an existingSKILLS.mdif the user re-runsiniton the same path or has manually modified the file. This may be intentional, but if preserving user modifications is desired, consider checking if the file exists first.The error handling with contextual messages is well done.
💡 Optional: Check before overwriting
let skills_md_path = agents_skills_dir.join("SKILLS.md"); + if !skills_md_path.exists() { std::fs::write(&skills_md_path, SKILLS_MD_CONTENT) .context("failed to write SKILLS.md to .agents/skills/cyberfabric/")?; + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/cli/src/mod/init.rs` around lines 76 - 84, The current init flow unconditionally uses std::fs::write to create SKILLS.md under agents_skills_dir, which will silently overwrite any existing file; update the logic around skills_md_path so you first check whether SKILLS.md already exists (using skills_md_path.exists() or attempt opening with OpenOptions::create_new) and only write SKILLS_MD_CONTENT if the file does not exist, otherwise skip writing (or return a clear message/prompt) to preserve user modifications; keep the same contextual error handling (the existing .context(...) calls) and reference agents_skills_dir, skills_md_path, SKILLS_MD_CONTENT and the current std::fs::write call when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@README.md`:
- Around line 9-10: Remove or update the prereqs bullet that reads "A local
clone of this repository" in the prerequisites list so it no longer claims a
local clone is required for installation; either delete that bullet or replace
it with a note that a local clone is only necessary for local development
(referencing the existing installation section using `cargo install --git` on
line 22 and the development section around lines 112-118) to avoid confusion.
---
Nitpick comments:
In `@crates/cli/src/mod/init.rs`:
- Around line 76-84: The current init flow unconditionally uses std::fs::write
to create SKILLS.md under agents_skills_dir, which will silently overwrite any
existing file; update the logic around skills_md_path so you first check whether
SKILLS.md already exists (using skills_md_path.exists() or attempt opening with
OpenOptions::create_new) and only write SKILLS_MD_CONTENT if the file does not
exist, otherwise skip writing (or return a clear message/prompt) to preserve
user modifications; keep the same contextual error handling (the existing
.context(...) calls) and reference agents_skills_dir, skills_md_path,
SKILLS_MD_CONTENT and the current std::fs::write call when making the change.
In `@README.md`:
- Around line 67-68: The README example is inconsistent: replace or clarify the
command string 'cyberfabric run -p /tmp/cf-demo -c
/tmp/cf-demo/config/quickstart.yml' so it matches the earlier recommendation to
use 'cargo cyberfabric' (e.g., change to 'cargo cyberfabric run -p /tmp/cf-demo
-c /tmp/cf-demo/config/quickstart.yml') or add a short parenthetical explaining
that both 'cargo cyberfabric ...' and the direct 'cyberfabric ...' invocation
are interchangeable; update the single-line example accordingly to keep the
document consistent with the earlier guidance.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d6e4be92-1878-4ca0-b6ef-6f75e41f2274
📒 Files selected for processing (2)
README.mdcrates/cli/src/mod/init.rs
…tructions Signed-off-by: Bechma <19294519+Bechma@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
README.md (1)
66-67: Consider clarifying the-pflag example to avoid confusion.The example shows both
-p /tmp/cf-demoand-c /tmp/cf-demo/config/quickstart.yml, which may be confusing since the previous examples already changed into that directory. Consider either:
- Adding context that this example is for running from a different directory
- Using a relative path for the config when
-pis specified:cargo cyberfabric run -p /tmp/cf-demo -c ./config/quickstart.ymlThe current example is technically correct but could be clearer for users.
📝 Suggested revision for clarity
-You can run the tool from any directory by specifying the path to the workspace with the `-p` flag. The default will be -the current directory. `cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml` +You can run the tool from any directory by specifying the path to the workspace with the `-p` flag (defaults to the current directory): + +```bash +# From any directory, specify workspace root with -p and use relative config path +cargo cyberfabric run -p /tmp/cf-demo -c ./config/quickstart.yml +```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 66 - 67, Clarify the README example that uses the -p flag by updating the example command to indicate it's run from a different directory or by using a relative config path; specifically, change the example line that currently shows "cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml" to either add a comment like "From any directory" or replace the config argument with a relative path such as using -c ./config/quickstart.yml so the relationship between -p (workspace path) and -c (config path) is unambiguous.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@README.md`:
- Around line 66-67: Clarify the README example that uses the -p flag by
updating the example command to indicate it's run from a different directory or
by using a relative config path; specifically, change the example line that
currently shows "cargo cyberfabric run -p /tmp/cf-demo -c
/tmp/cf-demo/config/quickstart.yml" to either add a comment like "From any
directory" or replace the config argument with a relative path such as using -c
./config/quickstart.yml so the relationship between -p (workspace path) and -c
(config path) is unambiguous.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 19110a83-2d10-47ab-8fc3-1a382cbbb036
📒 Files selected for processing (2)
README.mdcrates/cli/src/mod/init.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/cli/src/mod/init.rs
Summary by CodeRabbit
Documentation
New Features