All skills
boshu2 avatar

/domain

@fdf7de6
by Boboshu2/agentops446 stars
42

Clarify domain terms, bounded contexts and repository conventions. Use when: naming, rule ownership or Go and other language standards are unclear; avoid a broad survey.

Use this Skill: https://skilld.dev/gh/boshu2/agentops/domain

This session only. Nothing lands on disk.

referencesstandardsrust.md

≈648 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Rust Standards (Tier 1)

Required

  • cargo fmt (automatic)
  • cargo clippy passes (no warnings)
  • All public items documented (rustdoc)

Error Handling

  • Use Result<T, E> for fallible operations
  • Implement custom errors with thiserror or anyhow
  • Never unwrap() in library code (OK in tests/bins)
  • Use ? operator for error propagation

Adapter Recursion Guard

  • Subprocess adapters that can invoke their own kernel must set a guard env var on every child command: <TOOL>_IN_PROGRESS=1.
  • Kernel entry must reject re-entry when that env var is already present.
  • This is a two-end check: set-on-spawn plus check-at-entry. One end alone is not enough.
  • Source pattern: commit 97e16fe, bead mo-l1tyqp.23, and MTO_SKILL_AUDIT_IN_PROGRESS from the Mt Olympus skill-audit adapter fix.
pub const GUARD_ENV: &str = "MY_TOOL_IN_PROGRESS";

fn command() -> std::process::Command {
    let mut cmd = std::process::Command::new("sh");
    cmd.env(GUARD_ENV, "1");
    cmd
}

fn entry() -> Result<(), MyError> {
    if std::env::var_os(GUARD_ENV).is_some() {
        return Err(MyError::Recursion);
    }
    Ok(())
}

Ownership & Borrowing

  • Prefer references over cloning
  • Use &str in function params over String
  • Add explicit lifetime annotations when needed
  • Clone sparingly and document why

Common Issues

Pattern Problem Fix
unwrap() Panic on None/Err Use ? or pattern match
Mutable statics Data races Use once_cell or Mutex
String allocation Performance Use &str in function params
Lifetime errors Borrow checker reject Add explicit lifetimes
Unsafe block Memory unsafety Add // SAFETY: comment
Excessive .clone() Performance waste Use references or Cow<T>

Unsafe Code

  • Always add // SAFETY: comment explaining invariants
  • Minimize unsafe scope
  • Prefer safe abstractions

Security

  • Minimize unsafe blocks — each needs // SAFETY: justification
  • Use secrecy::Secret<T> for sensitive values (prevents accidental logging)
  • Validate all external input before deserialization (serde validators)
  • Prefer ring or rustls over OpenSSL bindings

Documentation

  • All public items must have rustdoc comments (///)
  • Include # Examples section in doc comments for complex APIs
  • Use #![deny(missing_docs)] in library crates
  • Run cargo doc --no-deps to verify doc builds

Testing

  • cargo test (built-in)
  • cargo test --doc (doc tests)
  • Use #[cfg(test)] modules
  • cargo bench for benchmarks

Source: SKILL.md on GitHub

No alerts8d3 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    The skill is a domain-driven design utility for reconciling ubiquitous language. It includes validation scripts and comprehensive engineering standards. No security risks were identified.

  • Socket8d

    No alerts

  • Snyk8d

    Risk: LOW · No issues

Signed by skilld at fdf7de6. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated last week

README badge

README badge for boshu2/agentops/domain