Skip to content

docs: update README with typical usage flow and local development instructions#26

Merged
Bechma merged 1 commit intocyberfabric:mainfrom
Bechma:improve-readme
Apr 7, 2026
Merged

docs: update README with typical usage flow and local development instructions#26
Bechma merged 1 commit intocyberfabric:mainfrom
Bechma:improve-readme

Conversation

@Bechma
Copy link
Copy Markdown
Collaborator

@Bechma Bechma commented Apr 7, 2026

Summary by CodeRabbit

  • Documentation

    • Updated installation instructions to install the CLI from the upstream repository
    • Revised Typical Usage flow with step-by-step examples for creating, running, and adding modules
    • Added guidance for running the CLI from arbitrary directories using the -p flag
    • Added local development instructions for running the CLI from source
  • New Features

    • New projects now include SKILLS.md automatically under .agents/skills/cyberfabric/

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Updated README installation and usage instructions; changed CLI init flow to embed SKILLS.md at compile time and, after project generation, create .agents/skills/cyberfabric/ and write the embedded SKILLS.md into it.

Changes

Cohort / File(s) Summary
Documentation
README.md
Replaced local cargo install instruction with cargo install --git ...; expanded "Typical usage flow" with workspace init/run/add/config examples; added -p usage note; moved command overview to reference SKILLS.md; added "Local development" section showing cargo run -p cli -- --help.
CLI Initialization
crates/cli/src/mod/init.rs
Added const SKILLS_MD_CONTENT: &str via include_str!; after template generation, creates .agents/skills/cyberfabric/ under the new project and writes SKILLS.md there; uses anyhow::Context for directory/file error context.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 In codebeds I nibble lines so spry,

I stash a SKILLS.md beneath the sky,
.agents a burrow where knowledge sits tight,
Projects now spring with docs in the light,
Hopping through commits, oh what a delight! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: update README with typical usage flow and local development instructions' accurately describes the main changes in README.md, which update documentation with new usage flow and development instructions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟡 Minor

Prerequisite "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: uses cyberfabric instead of cargo cyberfabric.

Line 47-48 recommends using cargo cyberfabric for running, but line 68 shows an example using cyberfabric 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::write will silently overwrite an existing SKILLS.md if the user re-runs init on 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2d2a32a and a75d9a1.

📒 Files selected for processing (2)
  • README.md
  • crates/cli/src/mod/init.rs

…tructions

Signed-off-by: Bechma <19294519+Bechma@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
README.md (1)

66-67: Consider clarifying the -p flag example to avoid confusion.

The example shows both -p /tmp/cf-demo and -c /tmp/cf-demo/config/quickstart.yml, which may be confusing since the previous examples already changed into that directory. Consider either:

  1. Adding context that this example is for running from a different directory
  2. Using a relative path for the config when -p is specified: cargo cyberfabric run -p /tmp/cf-demo -c ./config/quickstart.yml

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between a75d9a1 and 4acacec.

📒 Files selected for processing (2)
  • README.md
  • crates/cli/src/mod/init.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/cli/src/mod/init.rs

@Bechma Bechma merged commit 8898f18 into cyberfabric:main Apr 7, 2026
2 checks passed
@Bechma Bechma deleted the improve-readme branch April 7, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant