analysis-pipeline
Reverse engineering - multi-source product intelligence analysis with provenance tracking. Master methodology for all analysis…
Layer 1 skill for extracting behavioral intelligence from test suites. Framework detection, test code reading strategy, test execution strategy, behavioral claim extraction with Given/When/Then mapping, e2e vs unit value classification. Loaded by the analyzer agent during Layer
Claude Code
$ npx -y skills add prime-radiant-inc/greenfield --skill test-suite-analysis --agent claude-code
Codex
$ npx skills add prime-radiant-inc/greenfield --skill test-suite-analysis -a codex -y
Cursor
$ npx skills add prime-radiant-inc/greenfield --skill test-suite-analysis -a cursor -y
Gemini CLI
$ npx skills add prime-radiant-inc/greenfield --skill test-suite-analysis -a gemini-cli -y
GitHub Copilot
$ npx skills add prime-radiant-inc/greenfield --skill test-suite-analysis -a github-copilot -y
OpenCode
$ npx skills add prime-radiant-inc/greenfield --skill test-suite-analysis -a opencode -y
Windsurf
$ npx skills add prime-radiant-inc/greenfield --skill test-suite-analysis -a windsurf -y
name: test-suite-analysis description: Layer 1 skill for extracting behavioral intelligence from test suites. Framework detection, test code reading strategy, test execution strategy, behavioral claim extraction with Given/When/Then mapping, e2e vs unit value classification. Loaded by the analyzer agent during Layer 1.
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 | | Integra
Reverse engineer clean behavioral specs from any codebase. Greenfield reads source code, documentation, SDKs, runtime behavior, and binaries, then produces behavioral specifications, test vectors, acceptance criteria, and a full provenance trail.
Reverse engineering - multi-source product intelligence analysis with provenance tracking. Master methodology for all analysis…
Layer 1 intelligence source discovery - auto-detect available sources, search for public information, negotiate with user,…
Layer 3 deep documentation methodology. Per-module behavioral specifications, external and behavioral integration contracts,…
Layer 1 methodology for extracting behavioral intelligence from compiled binaries, bytecode archives, managed assemblies, and…
Layer 1 skill for community intelligence gathering. Search channels, extraction methodology, consensus analysis, version-aware…
Infrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.