/greenfield:test-suite-analysisfrom greenfield
Extracts behavioral intelligence from test suites: detects frameworks, reads test code, extracts behavioral claims with Given/When/Then mapping, classifies e2e vs unit tests.
Ships in greenfield. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Extract behavioral intelligence from test suites. Tests are executable specifications -- they encode what the system MUST do in a form that can be verified. A passing test is a confirmed behavioral contract.
Test suite analysis activates when:
This mode runs independently of all other intelligence sources. All output is RAW (test code references internal implementation details).
Tests are the only source type that is simultaneously:
A single end-to-end test is worth more than a page of documentation because the test is verified by CI on every commit.
Identify the test framework(s) in use before analyzing test code. Different frameworks use different assertion styles, test organization, and execution models.
| Framework | Language | Detection Signals |
|---|---|---|
| Jest | JavaScript/TypeScript | jest.config.*, describe( / it( / expect( in __tests__/ or *.test.*, @jest/globals imports |
| Playwright | JavaScript/TypeScript | playwright.config.*, @playwright/test imports, page.goto( / page.click( |
| Cypress | JavaScript/TypeScript | cypress.config.*, cypress/ directory, cy.visit( / cy.get( |
| pytest | Python | conftest.py, pytest.ini / pyproject.toml with [tool.pytest], files named test_*.py / *_test.py, assert statements |
| Go testing | Go | *_test.go files, testing.T / testing.B parameters, go test in CI config |
| RSpec | Ruby | .rspec, spec/ directory, spec_helper.rb, describe / it / expect blocks |
| JUnit | Java/Kotlin | @Test annotations, src/test/ directory, assertEquals / assertThat calls |
| XCTest | Swift/Objective-C | XCTestCase subclasses, func test*() methods, XCTAssert* calls |
| Catch2 | C++ | #include <catch2/catch.hpp>, TEST_CASE( / SECTION( / REQUIRE( macros |
# Check for test configuration files
ls -la jest.config.* playwright.config.* cypress.config.* .rspec pytest.ini 2>/dev/null
# Check pyproject.toml for pytest config
grep -l '\[tool\.pytest' pyproject.toml 2>/dev/null
# Find test directories
find . -maxdepth 3 -type d \( -name "__tests__" -o -name "test" -o -name "tests" -o -name "spec" -o -name "cypress" \) 2>/dev/null
# Find test files by naming convention
find . -maxdepth 4 -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" -o -name "*_test.*" \) 2>/dev/null | head -50
# Count test files per pattern
echo "Jest/Mocha-style:" && find . -name "*.test.*" -o -name "*.spec.*" 2>/dev/null | wc -l
echo "Python-style:" && find . -name "test_*.py" -o -name "*_test.py" 2>/dev/null | wc -l
echo "Go-style:" && find . -name "*_test.go" 2>/dev/null | wc -l
echo "JUnit-style:" && find . -path "*/src/test/*" -name "*.java" 2>/dev/null | wc -l
Write detection results to workspace/raw/test-evidence/test-inventory.md.
Read test files directly and extract behavioral claims. This strategy always works -- it requires no working environment, no dependencies, and no execution.
# Build complete inventory of test files with metadata
find . -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" -o -name "*_test.*" -o -name "*_test.go" \) 2>/dev/null | while read f; do
lines=$(wc -l < "$f")
echo "$lines $f"
done | sort -rn
For each test file, extract the assertions -- these are the behavioral contracts:
# Jest/Mocha assertions
grep -n "expect\|assert\|should\|toBe\|toEqual\|toContain\|toThrow\|toHaveBeenCalled" "$TEST_FILE"
# pytest assertions
grep -n "assert \|assert_\|assertEqual\|assertRaises\|pytest.raises" "$TEST_FILE"
# Go test assertions
grep -n "t\.Error\|t\.Fatal\|t\.Log\|assert\.\|require\." "$TEST_FILE"
# RSpec assertions
grep -n "expect\|should\|is_expected\|eq(\|include(\|raise_error" "$TEST_FILE"
Transform test code into behavioral claims using Given/When/Then structure:
For each test case (it(, test(, func Test*, def test_*), extract:
## Test: "should reject expired tokens"
**Given:** A token with expiry date in the past
**When:** The token is validated via `checkPermissions()`
**Then:**
- Returns false
- Sets error to "TOKEN_EXPIRED"
- Does not call the downstream service
**Source:** `auth.test.ts:45-62`
**Confidence:** confirmed (test assertion is an explicit behavioral contract)
Not all tests carry equal behavioral intelligence value:
| Test Type | Detection Signals | Behavioral Value |
|---|---|---|
| End-to-end (e2e) | Browser automation, HTTP requests to running server, multi-service interaction | High -- tests the system as a user experiences it |
| Integration | Database connections, external service calls, multi-module interaction | High -- tests behavioral contracts between components |
| Functional | Single module tested with real dependencies | Medium -- tests module-level behavioral contracts |
| Unit | Mocked dependencies, isolated function tests | Lower -- tests implementation contracts, not user-visible behavior |
| Snapshot | toMatchSnapshot(), toMatchInlineSnapshot() | Low -- captures output format, not behavioral intent |
Focus extraction effort on e2e and integration tests first. Unit tests fill in details after the behavioral surface is mapped.
Tests are the richest source of edge case documentation. Look for:
# Boundary value tests
grep -n "boundary\|limit\|max\|min\|overflow\|underflow\|zero\|empty\|null\|undefined" "$TEST_FILE" -i
# Error condition tests
grep -n "error\|fail\|reject\|throw\|invalid\|unauthorized\|forbidden\|timeout" "$TEST_FILE" -i
# Concurrency tests
grep -n "concurrent\|parallel\|race\|deadlock\|lock\|mutex\|async\|await" "$TEST_FILE" -i
# Special character and encoding tests
grep -n "unicode\|utf\|encoding\|escape\|special\|whitespace" "$TEST_FILE" -i
Write behavioral claims to workspace/raw/test-evidence/behavioral-claims.md.
Write e2e flow documentation to workspace/raw/test-evidence/e2e-flows.md.
Write edge case documentation to workspace/raw/test-evidence/edge-cases.md.
Execute the test suite and observe its behavior. This strategy requires a working environment with all dependencies installed. It produces higher-confidence claims but has higher setup cost.
Before attempting test execution:
beforeAll, setUp, fixtures, factories)# Jest
npx jest --verbose --no-coverage 2>&1 | tee workspace/raw/test-evidence/run-output.txt
# pytest
python -m pytest -v --tb=long 2>&1 | tee workspace/raw/test-evidence/run-output.txt
# Go
go test -v ./... 2>&1 | tee workspace/raw/test-evidence/run-output.txt
# RSpec
bundle exec rspec --format documentation 2>&1 | tee workspace/raw/test-evidence/run-output.txt
During test execution, capture:
# Capture network activity during tests (if strace/dtrace available)
strace -e trace=network -f npx jest 2> workspace/raw/test-evidence/network-trace.txt
# Capture file I/O during tests
strace -e trace=file -f npx jest 2> workspace/raw/test-evidence/file-trace.txt
Failed tests are behavioral intelligence:
Record every failure with:
All claims from test suite analysis use source=test-suite:
- Expired tokens are rejected with a TOKEN_EXPIRED error
<!-- cite: source=test-suite, ref=src/auth/__tests__/auth.test.ts:45-62, confidence=confirmed, agent=test-analyzer -->
Unlike source code analysis (where claims are typically inferred), behavioral claims extracted directly from test assertions are confirmed. A test assertion is an explicit, executable behavioral contract. The developer who wrote expect(result).toBe(42) is asserting that this behavior is required.
Every behavioral claim gets an inline citation immediately after the claim. The ref field should be <file-path>:<line-range>.
workspace/raw/test-evidence/
test-inventory.md # Framework detection, test file inventory, classification
behavioral-claims.md # Behavioral claims in Given/When/Then format
e2e-flows.md # End-to-end flow documentation from e2e/integration tests
edge-cases.md # Edge cases, boundary conditions, error handling from tests
run-output.txt # Raw test execution output (if Strategy 2 was used)
workspace/raw/.<!-- cite: --> comment immediately after the claim. Never defer citation to a later step.What SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/analysis-pipelineReverse engineering - multi-source product intelligence analysis with provenance tracking. Master methodology for all analysis agents./autonomous-discoveryLayer 1 intelligence source discovery - auto-detect available sources, search for public information, negotiate with user, produce inventory manifest/behavioral-spec-writingLayer 3 deep documentation methodology. Per-module behavioral specifications, external and behavioral integration contracts, behavior documentation, end-to-end user journey analysis. Transforms Layer 2 synthesis into implementable behavioral specifications. Loaded by the analyzer agent during Layer 3./binary-analysisLayer 1 methodology for extracting behavioral intelligence from compiled binaries, bytecode archives, managed assemblies, and bundled applications. Covers artifact identification, string extraction strategy, decompilation workflows, provenance requirements, and handoff to source code mode./community-intelligenceLayer 1 skill for community intelligence gathering. Search channels, extraction methodology, consensus analysis, version-aware behavioral changes, structural contamination guard. Loaded by the analyzer agent for community intelligence gathering./container-executionInfrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions, interaction patterns.greenfield@prime-radiant-marketplace is listed by prime-radiant-inc/prime-radiant-marketplace — review the source before installing
npx claudepluginhub prime-radiant-inc/prime-radiant-marketplace --plugin greenfieldOther plugins' skills for the same job