ln-637-test-structure-auditor — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited ln-637-test-structure-auditor (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Paths: File paths (references/,../ln-*) are relative to this skill directory.
Type: L3 Worker
Specialized worker auditing test file organization, orphan tests, fragmented duplicates, and layout drift for maintainability as the test suite grows.
MOVE, MERGE, or DELETE_ORPHANMANDATORY READ: Load references/audit_worker_core_contract.md.
Receives contextStore with: tech_stack, testFilesMetadata (ALL types -- both automated and manual), codebase_root, output_dir, domain_mode, all_domains.
Note: Unlike other workers that receive type-filtered metadata, this worker receives ALL test files because directory structure analysis requires the full picture of where both automated and manual tests are placed.
Detection policy: use two-layer detection (candidate scan, then context verification); load references/two_layer_detection.md only when the verification method is ambiguous.
1) Parse Context: Extract test file list, output_dir, codebase_root, domain info from contextStore 2) Map Source Structure: Glob source directories (src/, app/, lib/) to build source domain/module tree 3) Map Test Structure: Group test files by parent directory, count files per directory, classify locations 4) Scan Checks (Layer 1): Run 6 audit checks (see Audit Rules) using Glob/Grep patterns 5) Context Analysis (Layer 2 -- MANDATORY): For each candidate finding, apply Layer 2 filters (see each check) 6) Collect Findings: Record violations with severity, location, effort, action, recommendation 7) Calculate Score: Count violations by severity, calculate compliance score (X/10) 8) Write Report: Build full markdown report in memory per references/templates/audit_worker_report_template.md, write to {output_dir}/ln-637--global.md in single Write call 9) Return Summary: Return minimal summary to coordinator (see Output Format)
What: Detect which test organization pattern the project uses and check for unintentional mixing
Detection:
src/users/users.test.ts)tests/users/users.test.ts mirrors src/users/)tests/ or __tests__/)tests/manual/ (informational, not flagged)Layer 2:
tests/automated/integration/). Check if deviation correlates with test typeSeverity: MEDIUM if hybrid without clear type-based rule (>30% of same-type tests deviate from dominant pattern)
Recommendation: Standardize test placement -- choose one pattern per test type and document in testing guidelines Action: MOVE
Effort: L
What: Detect orphaned test files (source file deleted but test remains) and mismatched paths
Detection:
users.test.ts -> users.ts or users/index.tstest_payments.py -> payments.pyLayer 2:
test_utils.ts, test_helpers.py)Severity: MEDIUM for orphaned tests (dead code), LOW for path mismatches
Recommendation: Delete orphaned tests or update to match current source structure Action: DELETE_ORPHAN when the source behavior no longer exists; otherwise MOVE
Effort: S
What: Detect test directories with excessive file count that would benefit from subdirectory grouping
Detection:
node_modules, dist, build)test_auth_*.py -> auth/ subdirectory)Layer 2:
tests/manual/ (manual test structure has separate conventions)Severity: MEDIUM (>20 files), LOW (15-20 files)
Recommendation: Group tests into subdirectories by domain/feature. Suggest specific grouping based on file name analysis:
# Before (flat):
tests/test_auth_login.py, tests/test_auth_tokens.py, tests/test_users_crud.py, ...
# After (grouped):
tests/auth/test_login.py, tests/auth/test_tokens.py, tests/users/test_crud.py, ...Effort: M Action: MOVE
What: Check whether test directory grouping mirrors source domain structure
Detection:
all_domains or scanned src/) with test directory namestests/{domain}/ directory existssrc/{domain}/Layer 2:
domain_mode="global" or <2 source domains)Severity: MEDIUM for domains with >5 source files but no test group, LOW otherwise
Recommendation: Create test directory/group for domain to maintain structural alignment
Effort: M Action: MOVE
What: Detect which co-location pattern the project uses and flag inconsistencies
Detection:
Layer 2:
Severity: MEDIUM if >20% of same-type tests deviate from dominant placement pattern
Recommendation: Consolidate test placement -- move deviating tests to follow the project's dominant pattern
Effort: M-L Action: MOVE
What: Detect duplicate or near-duplicate tests scattered across files where one canonical test would be easier to maintain
Detection:
Layer 2:
ln-632; this worker only owns structural fragmentationSeverity: MEDIUM when duplicate structure increases maintenance cost, LOW for small localized duplication
Recommendation: Merge duplicate tests into one canonical location or shared helper when it preserves product signal
Effort: S-M Action: MERGE
MANDATORY READ: Load references/audit_scoring.md.
Severity mapping:
MANDATORY READ: Load references/templates/audit_worker_report_template.md.
Write JSON summary per references/audit_summary_contract.md. In managed mode the caller passes both runId and summaryArtifactPath; in standalone mode the worker generates its own run-scoped artifact path per shared contract.
Write report to {output_dir}/ln-637--global.md with category: "Test Maintainability" and checks: layout_pattern, test_source_mapping, flat_dir_growth, domain_grouping, colocation_consistency, fragmented_duplicates.
Return summary per references/audit_summary_contract.md.
When summaryArtifactPath is absent, write the standalone runtime summary under .hex-skills/runtime-artifacts/runs/{run_id}/evaluation-worker/{worker}--{identifier}.json and optionally echo the same summary in structured output.
Report written: .hex-skills/runtime-artifacts/runs/{run_id}/audit-report/ln-637--global.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)Apply the already-loaded references/audit_worker_core_contract.md.
.test. vs .spec.) is out of scope -- do not duplicateMOVE, MERGE, or DELETE_ORPHAN.Apply the already-loaded references/audit_worker_core_contract.md.
{output_dir}/ln-637--global.md (atomic single Write call)Version: 1.0.0 Last Updated: 2026-03-15
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.