The Problem

Developers often need a repeatable way to understand how an existing application works and then generate a new, compliant version. Existing tools are either limited to a single platform or require manual inspection and coding. This repo offers a single‑stack solution that automatically studies, builds, and validates a target, reducing manual effort and the risk of hidden bugs.

What This Does

The project is a portfolio of five Rust‑based tools that together provide a clean‑room “study‑build‑verify” workflow.

  • crates/ai contains the core agent logic that drives the coding agent, exposing functions like call, journal, and investigation.
  • crates/analysis supplies parsers and inspectors (e.g., js_inventory.rs and web_har.rs) that read the target’s artifacts.
  • crates/engine implements the runtime environment, session state, and tool registry (registry.rs).
  • apps/craft-anything is the CLI entry point that orchestrates a run.
  • apps/craft-anything-web provides a web UI that visualizes the audit trail and build status.

How It Is Wired

Execution starts at main in apps/craft-anything/src/main.rs. From there, the pick_adapter flow loads the target, then run in apps/craft-anything-cli/src/main.rs is invoked, which calls ai in crates/ai/src/lib.rs. The ai path triggers the call function that drives the agent, which in turn calls the investigation routine that uses analysis modules to collect evidence. The traced path main -> run -> ai -> build_model shows that the engine performs a network call to an Anthropic model (anthropic::Anthropic::new). The largest blast‑radius functions are is_empty (200 calls), path (186 calls), and call (167 calls). These serve as central utilities; changes affect many modules. The call graph has no cycles, so dependencies are acyclic, simplifying refactors.

File‑by‑file responsibility (top 5):

  • crates/ai/src/agent.rs – 68 functions, 27 calls, drives the agent.
  • crates/engine/src/registry.rs – 19 functions, 2 types, registers tools.
  • crates/analysis/src/standin.rs – 43 functions, 14 calls, provides heuristics.
  • crates/engine/src/session.rs – 32 functions, 5 types, manages state.
  • crates/engine/src/lib.rs – 24 functions, 5 types, offers runtime helpers.

How To Use It

Setup

git clone https://github.com/moses-y/craft-anything
cd craft-anything
cargo build --release

The Cargo workspace pulls all crates; Cargo.lock ensures deterministic versions.

Configuration Set the Anthropic API key in ~/.config/craft-anything/anthropic.toml (not present by default; create it). Example:

[anthropic]
api_key = "YOUR_KEY"

Running

./target/release/craft-anything run --target https://example.com

run is defined in apps/craft-anything-cli/src/main.rs. For a web UI:

./target/release/craft-anything-web

The server starts on localhost:8000 (see apps/craft-anything-web/src/main.rs).

Real-World Use

A DevOps engineer can point the tool at a legacy web app, let the agent rebuild it in Rust, and then compare screenshots across screen widths. The workflow could be scripted in CI to ensure every new release stays functionally identical to the original.

craft-anything-web --target https://old-site.com
# CI job validates the generated project against the live site

Code Health & Issues

  • High (Cognitive Load) – 43 deep‑nested files (crates/ai/src/cli_agents/adapters/antigravity.rs, etc.).
  • High (Duplicated Code) – 181 repeated 6‑line blocks across 86 files.
  • High (Oversized Files) – 15 files > 1500 lines (crates/engine/src/tools/adb_tools.rs).
  • Medium (Resource Safety) – 1 file opens a file without a context manager (assets/app-icon/trace.py).

CI & SDLC

  • GitHub Actions workflows exist (.github/workflows/*.yml) but lack a test step and pin actions to a SHA.
  • Dependabot is not configured; vulnerability scans are absent.
  • Workflow jobs lack timeout-minutes.
  • Secrets are committed in xtask/src/secrets.rs.

These findings are static analysis results and not opinions.

The Bottom Line

Craft Anything is a cohesive Rust ecosystem that automates the study‑build‑verify cycle for any software. Its modular design and clear entry points make it approachable, but the codebase suffers from cognitive load, duplication, and missing CI safeguards. Teams that need rapid, repeatable rebuilding of existing apps and are willing to invest in refactoring will benefit most.