Date: 2026-03-03 Reviewer: Claude Scope: Full codebase review against the long-term vision of design-document-driven autonomous builds
The goal is a system where:
- A human hands crosslink a design document describing the software to build.
- Crosslink kicks off one or more autonomous agents to implement the design.
- Agents test rigorously and ensure the output meets the spec.
- Before starting, agents identify shortfalls in the document — ambiguities, missing details, contradictions — and report them back for resolution.
- The human reviews a structured report of what was built, what was validated, and what couldn't be resolved.
The kickoff system is the centerpiece. It provides:
- Full lifecycle management: worktree creation → agent identity → prompt generation → tmux/container launch → monitoring → stop.
- Convention detection: auto-detects Rust, Node, Python, Go projects and configures test/lint commands accordingly.
- Three verification tiers:
local(run tests),ci(push + draft PR + wait for CI),thorough(CI + adversarial self-review). - Dual execution modes: local tmux sessions and container-based execution (Docker/Podman).
- Safety model: agents can never push to remote, hooks gate commits to require active issues, containers provide process isolation.
| Strength | Detail |
|---|---|
| Prompt engineering | build_prompt() generates a comprehensive KICKOFF.md with environment info, blocked actions, step-by-step instructions, and verification phases |
| Tool sandboxing | build_allowed_tools() constructs a whitelist of exactly which Bash commands the agent may use, based on detected project conventions |
| Monitoring | kickoff status, kickoff logs, /check skill provide multiple ways to inspect running agents |
| Sentinel files | .kickoff-status written by agent on completion (DONE / CI_FAILED) — simple, reliable signaling |
- Event-sourced hub branch (
crosslink/hub) with deterministic compaction via total ordering keys. - Per-agent event logs — conflict-free concurrent writes (no merge conflicts on append).
- Lock system with stale detection (30-min heartbeat timeout), retry-on-push-conflict (3 attempts), and graceful offline degradation.
- V2 layout with per-issue lock files eliminates the single-file contention bottleneck of V1.
| Layer | Count | Coverage |
|---|---|---|
Unit tests (db.rs) |
77 | Core CRUD, integrity, cascades, SQL injection defense |
Property-based tests (db.rs) |
14 | Roundtrip invariants, idempotency, cycle detection |
| CLI integration tests | 146 | All major commands, security edge cases, complex workflows |
| Fuzz targets | 12 | State machine fuzzing, all subsystems, nightly extended runs |
| CI workflows | 3 | Feature branch (fast), main (full), nightly (fuzz) |
The database layer and CLI are production-grade tested. Property-based testing with regression databases and state-machine fuzzing are notably strong.
- Git-backed markdown pages with YAML frontmatter (title, tags, sources, contributors).
- Multi-agent sync with accept-both merge conflict resolution.
- CLI-accessible:
crosslink knowledge add|show|list|edit|remove|search. - TUI browser tab for interactive reading.
- Rules system (
.crosslink/rules/) guides agents to search knowledge before researching externally.
- Agent-scoped sessions with handoff notes for cross-session continuity.
- Breadcrumb actions (
session action "...") survive context compression. - Auto-lock-release on session end.
- Hook-injected context at session start (previous handoff, ready issues, knowledge summary).
| Metric | Value | Assessment |
|---|---|---|
| Total source lines (Rust) | ~15,000+ | Substantial |
| CLI commands | 70+ (including subcommands) | Comprehensive |
| Test cases | 255+ | Strong for core, gaps in agent layer |
| Fuzz targets | 12 | Excellent |
| CI workflows | 3 (feature, main, nightly) | Good coverage |
| Supported languages (convention detection) | 6 (Rust, Node, Python, Go, Make, Just) | Good |
| Supported container runtimes | 2 (Docker, Podman) | Good |
| Knowledge pages (current) | 6 | Early stage |
| Schema version | 14 | Mature migration system |
Current: Kickoff accepts a one-line text description (crosslink kickoff run "add batch retry logic").
Needed: Accept a structured design document and parse it into the agent's working context.
What's missing:
- No
--doc <path>flag onkickoff runto ingest a design document. - No document parser that extracts structured sections (requirements, acceptance criteria, architecture, API contracts, open questions).
- No mechanism to break a document into sub-issues for parallel agent work.
- No validation step that checks whether the document has sufficient detail before launching an agent.
Impact: Without this, the human must manually translate design documents into text descriptions, losing structure, acceptance criteria, and traceability.
Current: Kickoff launches immediately. The --dry-run flag prints the prompt but performs no analysis.
Needed: A pre-flight phase where the agent reads the design document, identifies gaps, and produces a structured report before writing any code.
What's missing:
- No "analysis only" execution mode.
- No structured output format for document gaps (e.g., "Section 3.2 specifies a REST API but does not define error response schemas").
- No feedback mechanism to route the gap analysis back to the human and block until resolved.
- No distinction between "blocking gaps" (can't proceed) and "advisory gaps" (can proceed with assumptions).
Impact: Agents will start building with incomplete information, discover gaps mid-implementation, and either guess wrong or stall. Early gap detection saves significant rework.
Current: Agents run tests, run linters, and optionally self-review for debug code. Verification answers "does it work?" but not "does it match the spec?"
Needed: Post-build validation that checks each requirement from the design document and reports pass/fail/partial status.
What's missing:
- No extraction of acceptance criteria from design documents into a machine-checkable format.
- No post-build verification phase that maps implementation to requirements.
- No structured result reporting (per-requirement status with evidence).
- No diff between "what was specified" and "what was built."
Impact: The human must manually verify spec compliance after every kickoff — the most tedious part of the review process and the part most likely to miss regressions.
Severity: High. The most critical code for the vision — the agent orchestration, coordination, and execution layers — has zero unit tests.
| Module | Lines | Unit Tests | Risk |
|---|---|---|---|
kickoff.rs |
1,170 | 0 | High — core orchestration |
container.rs |
700+ | 0 | High — container execution |
shared_writer.rs |
1,700+ | 0 | High — multi-agent writes |
sync.rs |
860+ | 0 | High — hub synchronization |
signing.rs |
~200 | 0 | High — cryptographic ops |
knowledge.rs |
~1,800 | 0 | Medium — knowledge management |
tui/* |
~2,000+ | 0 | Medium — interactive dashboard |
| Total untested | ~8,400+ | 0 |
The database layer (db.rs) has 77 unit tests + 14 proptests — excellent. But shared_writer.rs alone is larger than db.rs and has no tests at all.
Recommendation: Extract pure functions from side-effectful code. Functions like build_prompt(), build_allowed_tools(), detect_conventions(), slug generation, and lock conflict resolution are all unit-testable without mocking file systems or git.
Current: Agents communicate via crosslink comments (free-text). Status is a sentinel file containing DONE or CI_FAILED.
Needed: Machine-readable build reports that capture:
- Which tests passed/failed (with output).
- Which spec requirements were verified.
- What the agent couldn't resolve.
- Time spent per phase (exploration, implementation, testing, review).
- Files created/modified with rationale.
Impact: Without structured reports, evaluating kickoff results requires reading through git diffs, comment trails, and agent logs manually. This doesn't scale to multiple concurrent agents.
Current: Session start hook says "6 pages available, search with CLI." Agents must explicitly run crosslink knowledge search and crosslink knowledge show.
Needed: Relevant knowledge pages auto-injected into agent context based on the issue or design document being worked on.
What's missing:
- No MCP resource server for knowledge (agents access pages only via CLI round-trips).
- No auto-injection of relevant pages based on issue tags or design doc references.
- No bulk import tool for design document libraries.
- No structured metadata queries (filter by multiple tags, date ranges, contributors).
| Finding | Severity | Location | Recommendation |
|---|---|---|---|
main.rs is 1,600+ lines with a monolithic match statement |
Medium | main.rs |
Refactor dispatch into module-level handlers; main.rs should only parse args and route |
Stale locks require manual locks steal — no auto-recovery |
Medium | lock_check.rs:81-86 |
Add configurable auto-steal after N×stale_timeout with audit trail |
| Lock check → work start has a timing race | Medium | session.rs:169-170 |
Atomic lock-claim-and-start operation to close the window |
| Clock skew warns but doesn't block | Low | compaction.rs:24 |
Consider blocking on skew > configurable threshold for critical operations |
| Push retry exhaustion silently falls back to local-only | Medium | shared_writer.rs:237-291 |
Surface a visible warning when sync fails, so agents don't silently diverge |
| No timeout on container builds | Low | container.rs:181-236 |
Add --build-timeout to prevent hung builds from blocking kickoff |
| Pattern | Assessment |
|---|---|
| Event sourcing with deterministic compaction | Excellent — enables replay, audit, and conflict-free multi-agent writes |
| SSH-based commit signing with trust chain | Solid — agent keys separate from user keys, trust requires explicit approval |
| Graceful degradation (multi-agent → single-agent → offline) | Good — every operation has a fallback path |
| Convention detection for project-specific tooling | Practical — avoids manual configuration for standard projects |
| Hook-gated safety (no push, gated commit) | Strong — defense in depth against agent mistakes |
| Offline-first local IDs (negative = local) | Clever — enables offline work without ID conflicts |
Goal: Make the agent orchestration layer trustworthy enough to build on.
Changes:
-
Extract pure functions from
kickoff.rs:build_prompt()— takes aKickoffConfigstruct, returnsString. Testable without filesystem.build_allowed_tools()— takesProjectConventions, returns tool list. Testable without filesystem.detect_conventions()— takes a list of file existence checks, returns conventions. Mockable.- Slug generation / sanitization — pure string transformation.
-
Add unit tests for extracted functions:
- Prompt contains correct issue ID, branch name, blocked commands.
- Allowed tools include project-specific commands when conventions detected.
- Convention detection handles mixed projects (Rust + Python).
- Slug generation handles Unicode, long strings, special characters.
-
Add unit tests for
shared_writer.rslock logic:- Lock claim succeeds when no contention.
- Lock claim returns
Contendedwhen another agent holds. - Lock release is idempotent.
- Stale detection uses correct timeout.
-
Add integration tests for kickoff lifecycle:
--dry-runproduces valid KICKOFF.md.- Worktree creation succeeds and is in correct location.
- Status command reports correctly for non-existent / running / completed agents.
Estimated scope: ~20 new test functions, ~500 lines of test code.
Goal: Kickoff can accept and parse structured design documents.
Changes:
-
Define the design document format:
# Feature: <title> ## Summary <1-3 sentence overview> ## Requirements - REQ-1: <requirement description> - REQ-2: <requirement description> ## Acceptance Criteria - [ ] AC-1: <testable criterion> - [ ] AC-2: <testable criterion> ## Architecture <How it should be built — modules, data flow, integration points> ## API Contract (optional) <Endpoint definitions, request/response schemas> ## Open Questions (optional) - Q1: <question that needs answering before or during implementation> ## Out of Scope - <what this feature does NOT include>
-
Add
--doc <path>flag tokickoff run:- Parse the document into sections.
- Inject requirements and acceptance criteria into KICKOFF.md as a structured checklist.
- If
## Open Questionssection is non-empty, include them in the prompt with instructions to resolve or escalate.
-
Store design documents as knowledge pages:
crosslink knowledge add --from-doc <path>to import a design document.- Auto-tag with issue ID for traceability.
- Agents working on the issue automatically get the design doc in context.
-
Add
crosslink kickoff plan <doc>subcommand:- Launches agent in analysis-only mode.
- Agent reads the doc, explores the codebase, and produces a gap report.
- No code changes allowed — only comments on the crosslink issue.
- Outputs structured JSON:
{ "gaps": [...], "assumptions": [...], "estimated_subtasks": [...] }.
Estimated scope: ~800 lines of new Rust code + document format specification.
Goal: Agents verify their work against the original spec, not just "does it compile."
Changes:
-
Extract acceptance criteria at kickoff time:
- Parse
## Acceptance Criteriafrom the design document. - Write criteria to
.kickoff-criteria.jsonin the worktree (excluded from git). - Include criteria in KICKOFF.md as a numbered checklist.
- Parse
-
Add a validation phase to the agent workflow:
- After implementation and testing, agent reads
.kickoff-criteria.json. - For each criterion, agent writes a verdict:
pass,fail,partial,not_applicable,needs_clarification. - Verdicts written to
.kickoff-report.json.
- After implementation and testing, agent reads
-
Add
crosslink kickoff report <agent-id>command:- Reads
.kickoff-report.jsonfrom the agent's worktree. - Displays human-readable summary.
--jsonflag for machine consumption.
- Reads
-
Integrate spec validation into verification tiers:
local: Run tests + validate criteria locally.ci: Tests + criteria + CI pipeline.thorough: Tests + criteria + CI + adversarial review + spec compliance check.
Estimated scope: ~600 lines of new Rust code + modifications to build_prompt().
Goal: Machine-readable build reports for evaluating kickoff results at scale.
Changes:
-
Define the kickoff report format:
{ "agent_id": "driver--feature-slug", "issue_id": 42, "status": "completed", "phases": { "exploration": { "duration_s": 120, "files_read": 34 }, "planning": { "duration_s": 60, "comments_added": 2 }, "implementation": { "duration_s": 480, "files_modified": 8, "lines_added": 340, "lines_removed": 45 }, "testing": { "duration_s": 90, "tests_run": 146, "tests_passed": 146, "tests_failed": 0 }, "review": { "duration_s": 45, "issues_found": 1, "issues_fixed": 1 } }, "criteria_results": [ { "id": "AC-1", "verdict": "pass", "evidence": "Test test_batch_retry covers this" }, { "id": "AC-2", "verdict": "partial", "note": "Implemented for HTTP errors only, not timeouts" } ], "unresolved_questions": [ { "question": "Q1 from design doc", "resolution": "Assumed X based on existing patterns" } ], "commits": ["abc1234", "def5678"], "files_changed": ["src/retry.rs", "src/batch.rs", "tests/retry_test.rs"] } -
Instrument the agent prompt to produce this report:
- Add a final step to KICKOFF.md: "Write
.kickoff-report.jsonwith structured results." - Template the JSON schema into the prompt so agents know the exact format.
- Add a final step to KICKOFF.md: "Write
-
Add
crosslink kickoff reportwith formatting options:- Table view (terminal), JSON output, markdown summary.
- Aggregated view across multiple agents:
crosslink kickoff report --all.
Estimated scope: ~400 lines of new Rust code + prompt modifications.
Goal: Design documents and research automatically flow into agent context.
Changes:
-
MCP resource server for knowledge:
- Expose knowledge pages as MCP resources.
- Agents can read pages without CLI round-trips.
- Auto-refresh when pages are updated by other agents.
-
Auto-injection based on issue context:
- When an issue has a
design-doc:<slug>label, auto-inject that knowledge page into the agent's session context. - The session start hook reads issue labels and injects matching pages.
- When an issue has a
-
Bulk import for design document libraries:
crosslink knowledge import <directory>— imports all markdown files, auto-tags, preserves directory structure as tag hierarchy.- Supports frontmatter or infers metadata from filename/path.
-
Structured knowledge queries:
crosslink knowledge search --tag architecture --since 2026-01— filter by tag and date range.crosslink knowledge search --contributor <agent-id>— find what a specific agent learned.
Estimated scope: ~1,200 lines of new code (MCP server + CLI enhancements).
| Priority | Phase | Rationale |
|---|---|---|
| 1 | Phase 1: Testing Foundation | Can't safely extend untested orchestration code |
| 2 | Phase 2: Design Document Support | Core enabler for the entire vision |
| 3 | Phase 3: Spec Validation Loop | Closes the "did it meet the spec?" gap |
| 4 | Phase 4: Structured Reporting | Makes results evaluable at scale |
| 5 | Phase 5: Knowledge Integration | Quality-of-life improvement, not a blocker |
Phases 2 and 3 could be developed in parallel by separate agents once Phase 1 is complete.
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Design doc format is too rigid for real-world documents | Medium | High | Start with a minimal format and iterate; allow freeform sections alongside structured ones |
| Agents produce unreliable spec validation verdicts | High | Medium | Use adversarial self-review: a second pass challenges each verdict with counter-evidence |
| Structured reporting adds too much prompt overhead | Low | Medium | Keep the JSON schema small; only require top-level fields, make details optional |
| MCP knowledge server adds latency | Low | Low | Cache pages locally; only fetch on change |
| Parallel sub-task agents create merge conflicts | Medium | High | Use the existing worktree-per-agent model; final merge is human-reviewed |
| Dependency | Status | Notes |
|---|---|---|
| Kickoff system | Implemented | Core orchestration in place |
| Multi-agent coordination | Implemented | Hub branch, locks, event sourcing all working |
| Convention detection | Implemented | Rust, Node, Python, Go, Make, Just supported |
| Container execution | Implemented | Docker and Podman support |
| Knowledge repository | Implemented | Git-backed, CLI-accessible, TUI browser |
| MCP infrastructure | Implemented | Provider-neutral knowledge and agent-prompt servers ship for Claude and Codex |
| Design document parser | Not started | New capability |
| Spec validation engine | Not started | New capability |
| Structured report system | Not started | New capability |
| Component | File | Lines |
|---|---|---|
| Kickoff orchestration | crosslink/src/commands/kickoff.rs |
1,170 |
| Container management | crosslink/src/commands/container.rs |
700+ |
| Multi-agent writes | crosslink/src/shared_writer.rs |
1,700+ |
| Hub synchronization | crosslink/src/sync.rs |
860+ |
| Lock management | crosslink/src/locks.rs |
400 |
| Lock enforcement | crosslink/src/lock_check.rs |
100 |
| Event system | crosslink/src/events.rs |
200 |
| Compaction engine | crosslink/src/compaction.rs |
200 |
| Database layer | crosslink/src/db.rs |
2,900 |
| Knowledge manager | crosslink/src/knowledge.rs |
1,800 |
| Session management | crosslink/src/commands/session.rs |
240 |
| Agent identity | crosslink/src/identity.rs |
100 |
| CLI entry point | crosslink/src/main.rs |
1,600+ |
| Kickoff skill | crosslink/resources/claude/commands/kickoff.md |
68 |
| Check skill | crosslink/resources/claude/commands/check.md |
141 |
| Session start hook | crosslink/resources/agent/hooks/session-start.py |
provider-neutral |
| Dockerfile | crosslink/resources/container/Dockerfile |
36 |
| Container entrypoint | crosslink/resources/container/entrypoint.sh |
99 |
| Test Suite | Count | File |
|---|---|---|
| Unit tests (db) | 77 | crosslink/src/db.rs:1523-2595 |
| Property tests (db) | 14 | crosslink/src/db.rs:2596-2867 |
| CLI integration | 146 | crosslink/tests/cli_integration.rs |
| Tested module | 6 | crosslink/src/commands/tested.rs:17-113 |
| Fuzz: create_issue | 1 | crosslink/fuzz/fuzz_targets/fuzz_create_issue.rs |
| Fuzz: search | 1 | crosslink/fuzz/fuzz_targets/fuzz_search.rs |
| Fuzz: import | 1 | crosslink/fuzz/fuzz_targets/fuzz_import.rs |
| Fuzz: dependency_graph | 1 | crosslink/fuzz/fuzz_targets/fuzz_dependency_graph.rs |
| Fuzz: state_machine | 1 | crosslink/fuzz/fuzz_targets/fuzz_state_machine.rs |
| Fuzz: cli_output | 1 | crosslink/fuzz/fuzz_targets/fuzz_cli_output.rs |
| Fuzz: comments | 1 | crosslink/fuzz/fuzz_targets/fuzz_comments.rs |
| Fuzz: labels | 1 | crosslink/fuzz/fuzz_targets/fuzz_labels.rs |
| Fuzz: update_operations | 1 | crosslink/fuzz/fuzz_targets/fuzz_update_operations.rs |
| Fuzz: milestones | 1 | crosslink/fuzz/fuzz_targets/fuzz_milestones.rs |
| Fuzz: subissues | 1 | crosslink/fuzz/fuzz_targets/fuzz_subissues.rs |
| Fuzz: relations | 1 | crosslink/fuzz/fuzz_targets/fuzz_relations.rs |
| Total | 255+ |