Autonomous Coding Workflows
This guide shows real-world EdgeCrab workflows that go beyond simple Q&A. Each pattern is a prompt strategy plus a set of skills that produces reliable results.
Pattern 1 — Bug Hunt
Section titled “Pattern 1 — Bug Hunt”Goal: Find and fix a regression without knowing which file it’s in.
There's a regression where authenticated users are being logged out after 5 minuteseven though the session should last 24 hours. Find the root cause and fix it.What EdgeCrab does:
- Searches codebase for session-related code (
web_search-free) - Reads session configuration files
- Reads the authentication middleware
- Reads recent commit history (
git log --oneline -20) - Narrows to the likely commit with
git show - Reads the changed lines
- Proposes and implements a fix
- Offers to run the test suite
Tips:
- Include a reproduction step in your prompt if you have one
- Name the feature area when you know it (“in the session expiry logic”)
Pattern 2 — Guided Refactor
Section titled “Pattern 2 — Guided Refactor”Goal: Rename a type across the entire codebase safely.
Rename the Rust type `UserRecord` to `User` throughout the entire codebase.Run cargo check after each file to confirm no new errors. If cargo check fails,fix any type mismatches before moving on.What EdgeCrab does:
- Finds all occurrences with
file_search - Renames each file with
file_write - Runs
cargo checkafter each batch - Fixes any resulting type errors
- Reports a summary of all changed files
With a skill: Create a rust-rename-type skill with these steps pre-written so you can invoke it with a single line: Rename UserRecord to User using the rust-rename-type skill.
Pattern 3 — Test Generation
Section titled “Pattern 3 — Test Generation”Goal: Write a comprehensive test suite for an under-tested module.
The `edgecrab-security` crate has no tests for the SSRF guard. Write a comprehensivetest suite covering: private IP ranges (IPv4 and IPv6), DNS-based bypasses, validpublic URLs, and edge cases. Use Rust's built-in test framework.What EdgeCrab does:
- Reads the SSRF guard implementation (
edgecrab-security/src/ssrf.rs) - Reads any existing tests for context
- Identifies the main code paths and edge cases
- Writes test functions covering all identified cases
- Runs
cargo test -p edgecrab-securityto verify they pass
Pattern 4 — Documentation Run
Section titled “Pattern 4 — Documentation Run”Goal: Add inline documentation to all public API items.
Add Rust doc comments (///) to every public function, struct, and enum inedgecrab-core/src/agent.rs. Comments should explain what the item does,not just restate the name. Add examples for the most important functions.What EdgeCrab does:
- Reads the file to understand the public API
- Writes documentation for each item
- Runs
cargo doc --no-depsto verify it renders correctly - Checks for any
cargo clippy -- -D warningsdoc-comment issues
Pattern 5 — Security Audit
Section titled “Pattern 5 — Security Audit”Goal: Find security issues in a specific module.
Perform a security audit of the file tool implementation inedgecrab-tools/src/tools/file.rs. Focus on path traversal, symlink attacks,and TOCTOU races. Cite specific line numbers for any issues found.Even better with the security-review skill:
Use the security-review skill to audit edgecrab-tools/src/tools/file.rs.Pattern 6 — Codebase Onboarding
Section titled “Pattern 6 — Codebase Onboarding”Goal: Understand an unfamiliar codebase quickly.
I'm new to this codebase. Start with the top-level Cargo.toml and workdown: explain what each crate does, how they depend on each other, andwhat the overall data flow is from a user prompt to a tool call. Draw anASCII architecture diagram at the end.What EdgeCrab does:
- Reads
Cargo.toml(workspace manifest) - Reads each crate’s
Cargo.tomlandsrc/lib.rsorsrc/main.rs - Understands the dependency graph
- Summarizes the architecture
- Produces an ASCII diagram
Pattern 7 — CI Failure Triage
Section titled “Pattern 7 — CI Failure Triage”Goal: Diagnose and fix a failing CI build without running CI yourself.
The CI build is failing. Here's the error output:[paste CI output]
Find the root cause, fix it, and make sure `cargo test` passes locally beforeyou're done.What EdgeCrab does:
- Parses the error output
- Reads the relevant source files
- Identifies the root cause
- Implements a fix
- Runs
cargo testto confirm it passes
Chaining Workflows
Section titled “Chaining Workflows”For complex multi-step projects, give EdgeCrab an explicit plan:
We're going to refactor the auth module to use JWT. Here's the plan:
1. Read all files in src/auth/ to understand the current implementation2. Design the new JWT-based approach and explain it to me before touching code3. After my approval, implement the changes one file at a time4. Write tests for the new implementation5. Run cargo test and fix any failures6. Summarize all changes in a PR description format
Start with step 1.The explicit numbered plan gives EdgeCrab a clear loop termination condition and lets you review the design before any code is written.
Prompt Tips for Best Results
Section titled “Prompt Tips for Best Results”| Do | Don’t |
|---|---|
| Specify the file or module name when you know it | Give open-ended “improve this codebase” |
| Ask for tests to be run after changes | Trust the agent to self-validate without running tests |
| Request a summary of changes at the end | Let the loop end without a completion report |
| Give constraints (“don’t modify the test files”) | Let constraints be implied |
| Provide context (“this broke after commit abc123”) | Make the agent guess the context |
Workflow Pattern Summary
Section titled “Workflow Pattern Summary”| Pattern | Best For | Key Prompt Element |
|---|---|---|
| Bug Hunt | Regressions, unknown root cause | Symptom + expected behaviour |
| Guided Refactor | Rename, extract, restructure | Old name → New name + “run check after each file” |
| Test Generation | Missing tests, edge-case coverage | Module path + coverage goals |
| Documentation Run | Public API doc comments | File path + quality bar |
| Security Audit | Module-level hardening | File path + threat categories |
| Codebase Onboarding | Unfamiliar repo | ”Start with Cargo.toml, explain each crate” |
| CI Failure Triage | Broken CI, pasted error log | Paste full error + “fix and run tests” |
Pro Tips
Section titled “Pro Tips”- Give a termination condition: “You’re done when
cargo test --workspacepasses” prevents the agent from over-iterating. - Ask for a diff summary at the end: “Summarize all changed files and why” produces useful commit message material.
- Use a skill for repeat workflows: Patterns 1–7 above can each be packaged as a skill so you invoke them with one line instead of a multi-sentence prompt.
- Set
max_iterationshigher for large refactors: A 50-file rename needs more loop iterations. UseEDGECRAB_MAX_ITERATIONS=150or--max-iterations 150for big tasks. - Gate on human review for destructive ops: Prepend “Don’t delete or overwrite any file without showing me the change and asking for confirmation first” to any large-scale workflow.
What if the agent is stuck in a loop?
Use /stop to cancel the current run. Then either refine your prompt or set a lower max_iterations to force an early summary.
Can I chain skills with inline instructions?
Yes: Use the security-review skill on src/auth/, then use the test-generation skill to write tests for any issues you find.
How do I resume a workflow that was cancelled?
Use /retry to resend the last message, or start a new message with “Continue where you left off” if the session history is intact.
What is a session?
A session is the conversation history for a single edgecrab run context. Sessions are stored in ~/.edgecrab/state.db.
See Also
Section titled “See Also”- Skills System — package any pattern as a reusable skill
- Slash Commands —
/stop,/retry, and live session controls - Sessions — session persistence and the
--session-idflag