Skip to content

NexusScan — Development Report

Project: NexusScan v1.0.0 Type: CLI Tool (Python) Profile: Casual Source: github.com/loskylp/NexusScan Session transcript: NexusScan-TRANSCRIPT.md Retrospective: NexusScan-RETROSPECTIVE.md Date: 2026-03-17


NexusScan is a command-line utility that recursively scans a directory and reports file type distribution: counts and total sizes per extension, rendered as an ASCII table in the terminal. It was developed as the first real-world test of the Nexus SDLC framework, exercising the full agent swarm lifecycle from requirements through go-live.

The project was chosen deliberately for its simplicity — a casual-profile CLI tool with no network, no auth, and no persistence — to validate the framework’s ability to manage scope, apply appropriate ceremony, and ship a correct, tested artifact without over-engineering.


“Create a CLI tool that scans a directory and counts files by extension.”


The development ran through all six Nexus SDLC gates. Every gate required explicit human (Nexus) approval before the swarm could proceed.

GateStatusNotes
RequirementsApproved3 iterations to incorporate expanded brief and execution timer
ArchitectureApprovedWalker → Classifier → Renderer pipeline; language deferred to Builder
PlanApproved5 tasks; TASK-001 walking skeleton as first deliverable
ExecutionCompleteMid-cycle scope addition of REQ-010 and REQ-011 handled cleanly
Demo Sign-offApprovedAll scenarios validated
Go-LiveApprovedv1.0.0 released

The final requirements set evolved across three iterations. The initial prompt produced five requirements; two rounds of refinement from the expanded brief added symlink handling, execution timer, size column, and directory exclusion.

IDRequirementOrigin
REQ-001Scan target directory, default to cwdInitial
REQ-002Classify by normalized (lowercase) extension; files with no extension → (no extension)Initial
REQ-003ASCII table with box-drawing borders, sorted by frequency descending, with totalRefined
REQ-004Recursive traversal onlyInitial
REQ-005Silently ignore broken symbolic linksExpanded brief
REQ-006Invalid path → descriptive error on stderr + exit code 1Initial
REQ-007Non-interactive; all input via argumentsExpanded brief
REQ-008Display wall-clock execution time after scanUser addition
REQ-010Total size per extension, human-readable (B / KB / MB / GB)Mid-cycle user request
REQ-011--exclude <name> flag, repeatable (e.g. --exclude node_modules --exclude .git)Mid-cycle user request
NFR-001Full pipeline must scan 10,000 files in under 1 secondArchitecture gate

System metaphor: A tally clerk walking a filing cabinet — counting documents by type and printing a summary receipt.

The tool is a single-pass, stateless three-stage pipeline:

Walker → Classifier → Renderer
StageResponsibility
WalkerRecursive traversal via os.walk(); prunes excluded directories; skips broken symlinks
ClassifierExtracts and normalizes extension; accumulates count and byte total per group
RendererSorts groups by count descending; draws ASCII table; appends execution time line

Key constraints applied:

  • Reads file metadata only — never opens file contents
  • No external dependencies — Python standard library only
  • Language choice deferred to Builder with the constraint that NFR-001 must be demonstrably met

The Builder chose Python 3. os.walk() + collections.defaultdict is I/O-bound rather than CPU-bound; the performance bottleneck is filesystem access, not the Python runtime. This proved sufficient: 0.08s for 10,000 files.


The planner produced five tasks. TASK-001 (walking skeleton) was designated as the first meaningful deliverable — the tool would be fully usable after that task alone.

TaskDescriptionCoversDepends On
TASK-001Walking skeleton: Walker + Classifier + RendererREQ-001–004, 007
TASK-002Broken symlink handlingREQ-005TASK-001
TASK-003Error handling for invalid pathsREQ-006TASK-001
TASK-004Execution timerREQ-008TASK-001
TASK-005Performance benchmarkNFR-001TASK-001, 004

After TASK-001 passed, the user requested two new features (size column and --exclude flag). The swarm paused execution, ran the requirements gate again, and added TASK-006 to the front of the queue before continuing.

TaskDescriptionCoversInserted
TASK-006Size column + --exclude flag (amends core pipeline)REQ-003 rev., REQ-010, REQ-011Mid-cycle

TASK-006 also incorporated TASK-002, 003, and 004 in the same build pass. TASK-005 ran last to confirm the size stat calls did not break the performance budget.


Source: src/nexusscan.py Language: Python 3.6+ Dependencies: Standard library only (argparse, os, sys, time, collections) Lines of code: 202

walk_directory(path, exclude_dirs=None) Generator yielding regular file paths. Prunes excluded directory names from os.walk() in-place to avoid descending into them. Silently skips broken symlinks by checking os.path.islink and os.path.exists.

classify_extensions(file_paths) Iterates the generator, lowercases each extension, groups into a defaultdict accumulating [count, total_bytes]. Files with no extension are keyed as (no extension). OSError on stat is handled gracefully (size defaults to 0).

render_table(extension_data) Sorts groups by count descending (alphabetically for ties), calculates dynamic column widths, and renders an ASCII box-drawing table with header, one row per extension, and a total row. Columns: Extension, Count, Size.

main() Validates the target path, wraps the pipeline in a time.time() measurement, and prints Scan completed in N.NNs after the table. Exits with code 1 on path errors.

+----------------+-------+--------+
| Extension | Count | Size |
+----------------+-------+--------+
| .md | 50 | 48.2KB |
| .sample | 14 | 8.1KB |
| (no extension) | 13 | 2.4KB |
| .py | 1 | 4.9KB |
| .sh | 6 | 9.3KB |
+----------------+-------+--------+
| Total | 84 | 72.9KB |
+----------------+-------+--------+
Scan completed in 0.01s

Total acceptance tests: 47 across 6 test scripts Final result: 47/47 passing, 0 retries across all tasks

Test FileTaskTestsResult
test_task001.shWalking skeleton13PASS
test_task006.shSize column + --exclude13PASS
test_task002.shBroken symlink handling5PASS
test_task003.shError handling6PASS
test_task004.shExecution timer5PASS
test_task005.shPerformance benchmark5PASS — 0.08s for 10,000 files

Each test script creates isolated temporary directories, verifies stdout/stderr content and exit codes, and cleans up after itself.

Performance result: 0.08s for 10,000 files — 12× under the 1-second budget (NFR-001).


The Methodologist selected a lean swarm for a Casual-profile project, skipping the Designer, Scaffolder, Sentinel, DevOps, and Scribe agents as unnecessary ceremony for a simple CLI tool.

AgentRoleContributed
MethodologistSet profile, selected active agents, configured gatesMethodology Manifest
OrchestratorManaged hand-offs, gates, state, mid-cycle scope changeProject state, briefings, routing
AnalystExtracted and refined requirements from user inputRequirements table (3 iterations)
AuditorReviewed requirements for completeness and consistencyAudit report
ArchitectDesigned pipeline, selected Walker/Classifier/Renderer modelArchitecture overview
PlannerDecomposed architecture into tasks, set dependenciesTask plan
BuilderImplemented all six tasks in Pythonnexusscan.py, 6 acceptance test scripts
VerifierRan acceptance tests, reported pass/fail per taskVerification reports

This run exposed several real behaviors of the Nexus SDLC framework in practice.

What worked well:

  • The requirements gate caught missing details early. The two-iteration refinement (expanded brief → user additions) produced a well-specified requirements set before any code was written.
  • Mid-cycle scope addition (REQ-010, REQ-011) was handled without rework. The Orchestrator paused execution, inserted TASK-006, and resumed cleanly.
  • The planning constraint that TASK-001 must produce a fully usable tool gave the project a natural early checkpoint — the user could have stopped there with working software.
  • Zero test failures and zero retries across the full build is a meaningful signal for a Casual-profile project. No iteration loop was needed.

Friction points observed:

  • The tool permission prompts for each Bash command interrupted flow at high frequency during the Builder phase. A trust level or session-scoped permission would reduce this.
  • A context limit was hit mid-session (between TASK-005 and the verification pass), requiring a manual “continue” to resume. The Orchestrator recovered correctly by re-reading project state, but the interruption was visible.
  • Process document templates in resources/ were never filled in — the agents wrote their output directly in the conversation and to the process/ directory. The template files exist but remain empty placeholders in this run.

Terminal window
# Scan current directory
python3 src/nexusscan.py
# Scan a specific path
python3 src/nexusscan.py /path/to/directory
# Exclude directories
python3 src/nexusscan.py /path/to/directory --exclude node_modules --exclude .git
# Run all acceptance tests
for t in tests/acceptance/test_task*.sh; do bash "$t"; done

NexusScan v1.0.0 shipped with all 11 requirements satisfied, 47/47 tests passing, and performance 12× under budget. The project was completed in a single session with no task retries and one mid-cycle scope addition absorbed without rework.

As a framework validation, this run confirmed that the Casual profile produces a lean, functional process: the swarm applied enough structure to catch scope creep early and produce traceable decisions, without blocking delivery on ceremony the project didn’t need.