prime-radiant-inc/greenfield/behavioral-spec-writing

Claude Code and agent skill by prime-radiant-inc/greenfield

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Layer 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.

Install

npx vskill@latest install prime-radiant-inc/greenfield/behavioral-spec-writing

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as prime-radiant-inc/greenfield/behavioral-spec-writing.

Behavioral Spec Writing

Layer 3 transforms Layer 2 synthesis (module map, feature inventory, architecture doc, API surface, behavioral summaries) into specifications detailed enough that a developer can reimplement the target WITHOUT seeing the original code. This skill carries all methodology for deep-dive-analyzer, contract-extractor, behavior-documenter, and user-journey-analyzer.

Layer 3 Pipeline Overview

dot
digraph layer3_pipeline {
rankdir=TB;
compound=true;
"Layer 2 synthesis complete" [shape=doublecircle];
"Layer 3 complete — proceed to Gate 1" [shape=doublecircle];
subgraph cluster_phase1 {
label="Phase 1: Per-Module Deep Dives (parallel across modules)";
style=dashed;
"deep-dive-analyzer: Module A" [shape=box];
"deep-dive-analyzer: Module B" [shape=box];
"deep-dive-analyzer: Module N" [shape=box];
}
subgraph cluster_phase2 {
label="Phase 2: Cross-Cutting Documentation (parallel)";
style=dashed;
"contract-extractor: external + integration contracts" [shape=box];
"behavior-documenter: behavioral domain synthesis" [shape=box];
"user-journey-analyzer: end-to-end journeys" [shape=box];
}
"Layer 2 synthesis complete" -> "deep-dive-analyzer: Module A";
"Layer 2 synthesis complete" -> "deep-dive-analyzer: Module B";
"Layer 2 synthesis complete" -> "deep-dive-analyzer: Module N";
"deep-dive-analyzer: Module A" -> "contract-extractor: external + integration contracts" [lhead=cluster_phase2];
"deep-dive-analyzer: Module B" -> "behavior-documenter: behavioral domain synthesis" [lhead=cluster_phase2];
"deep-dive-analyzer: Module N" -> "user-journey-analyzer: end-to-end journeys" [lhead=cluster_phase2];
"contract-extractor: external + integration contracts" -> "Layer 3 complete — proceed to Gate 1";
"behavior-documenter: behavioral domain synthesis" -> "Layer 3 complete — proceed to Gate 1";
"user-journey-analyzer: end-to-end journeys" -> "Layer 3 complete — proceed to Gate 1";
}

Phase 1 runs deep-dive-analyzer in parallel across every module from the module map. Each instance produces a per-module behavioral specification.

Phase 2 runs three agents in parallel. They consume Phase 1 output plus Layer 2 synthesis to produce contracts, behavioral documentation, and user journeys.


Input Sources

Required (from Layer 2 synthesis)
PathWhat It Contains
workspace/raw/synthesis/module-map.mdModule inventory: name, description, priority, dependencies
workspace/raw/synthesis/features/Feature inventory across all sources
workspace/raw/synthesis/architecture/Architecture document: component relationships
workspace/raw/synthesis/api/API surface: all discovered interfaces
workspace/raw/synthesis/behavioral-summaries/Merged intelligence from all Layer 1 modes
workspace/raw/synthesis/reimplementation-essentials.mdCompact summary for the implementer: happy path, edge cases, dependency contracts
Consulted (from Layer 1 raw intelligence)
PathWhat It ContainsOrigin
workspace/raw/source/analysis/Source code analysis (chunk analysis, function analysis)RAW
workspace/public/docs/Official documentation findingsPUBLIC
workspace/public/ecosystem/SDK and ecosystem analysisPUBLIC
workspace/public/community/Community intelligence (forums, tutorials, issues)PUBLIC
workspace/raw/runtime/Runtime observations (CLI, web UI, behavior)RAW
workspace/raw/binary/Binary analysis findingsRAW

Claims supported by multiple independent intelligence sources earn confirmed confidence.


Per-Module Behavioral Specification (deep-dive-analyzer)

This is the primary Layer 3 deliverable. Each module in the module map gets a complete behavioral specification written to workspace/raw/specs/modules/{module-name}.md.

Black Box Methodology (CRITICAL)

You read source code to understand behavior. You NEVER reference source code in specs.

Even though you analyze code, your output must read as if you only observed the system externally. The test: "Can someone implement this from my spec alone, never having seen the source?"

What You NEVER Include (Implementation Details)
ContaminationExampleWhy Forbidden
Internal function namesparseArgs(), loadConfig()Implementation detail
Internal variable names_configKey, configMapImplementation detail
Internal class namesConfigLoader, SettingsReaderImplementation detail
Minified identifiersa(), x1, Qz, sp, r0Implementation detail
Line numbers"at line 234"Implementation detail
Source file paths"in src/cli.ts"Implementation detail
Code structure"calls X then Y"Implementation detail
Module counts"52 modules", "8 components"Structural leak
IPC channel namestask-completed, sync-channelInternal messaging
Store property namesstore.documentBody, useActiveDocumentState management internals
Feature flag namesFF_NEW_INDEX_FORMAT, ff_batch_commit_v2, isEnabled('feature')Internal gating — describe what the gate controls, not its name
Telemetry event namesrequest_rate_limited, job_timeout_warningInternal analytics — describe what is measured, not the event name
CSS class names.toolbar__button, styled.ButtonStyling implementation
Database schema details (app-owned)CREATE TABLE sessions, column namesStorage implementation — but see External System Exception below
Internal filenamesauth-handler.ts, session.jsSource organization
External System Exception (NON-NEGOTIABLE)

When the target application depends on external systems it does not own — shared databases, third-party APIs, CLI tools it shells out to, file formats imposed by other systems, hardware interfaces — the details of those systems are behavioral constraints, not implementation details.

The test: Can the reimplementor redesign this interface? If NO (it's external/shared/imposed), treat its details as external contracts and INCLUDE them. If YES (the app owns it), treat them as implementation details and EXCLUDE them.

Examples of external constraints that MUST be preserved:

  • External database schemas: table names, column names, cardinalities, naming collisions, derivation relationships, join-correctness constraints — because the reimplementation must query the same schema
  • Third-party API contracts: endpoint paths, request/response field names, pagination schemes, rate limits, auth flows — because the reimplementation must call the same API
  • External CLI tools: command names, flag names, output formats — because the reimplementation must invoke the same tools
  • Imposed file formats: field names, encoding rules, version headers — because the reimplementation must read/write the same files
  • Hardware/protocol constraints: register layouts, packet formats, timing requirements — because the reimplementation must talk to the same hardware

Document external system contracts in dedicated files under workspace/raw/specs/contracts/ (see Contract Extraction section). These contracts flow through to the implementer unchanged.

What You ALWAYS Include (Behavioral Interfaces)
Behavioral ElementExampleWhy Included
Environment variablesDATABASE_URL, DEBUGExternal API
CLI flags--format, --workersExternal API
Config file keysupstreams, log_levelExternal API
API field namesrequest_id, batch_sizeProtocol spec
File paths (user-facing)~/.app/config.tomlBehavioral contract
Protocol namesSSE, gRPC, OAuthBehavioral contract
Error messages"Error: Invalid API key"UX contract
HTTP headers/codesAuthorization, 200, 401Protocol spec
Dependency API contractsesbuild.transform(code, {loader: 'ts'})How target talks to its dependencies

The rule: If a user or external system needs to know it, INCLUDE it. If only the code needs to know it, EXCLUDE it.

Transformation Examples

WRONG:

Entry point: main() at src/cli.ts:45
Calls parseArgs() which returns Config object
Variable requestId = generateUUID()

RIGHT:

Entry point: Command-line invocation
Behavior:
1. Parse arguments into configuration
2. Generate session identifier (UUID v4 format)
3. Initialize modules based on config
Session ID: UUID v4, generated once at startup, immutable
SPEC ID Format

Every behavioral claim gets a unique ID: SPEC-{DOMAIN}-{NNN}

Where {DOMAIN} is a short uppercase token for the behavioral domain (use tokens that describe exposed behavior, NOT internal module names) and {NNN} is a zero-padded sequential number starting at 001.

Pick tokens that describe the target's exposed behavior. The set below is a starting vocabulary; delete what doesn't apply and add tokens that do.

Domain TokenCovers
CLICommand-line parsing, flags, subcommands, exit codes
CONFIGConfiguration loading, merging, defaults, validation
AUTHAPI keys, OAuth, tokens, credentials
APIWire protocol, streaming, retries, headers, request/response handling
OUTPUTTerminal rendering, formatting, progress indicators, themes
DATAData models, storage, serialization
NETNetwork, HTTP, WebSocket, protocols
UIUser interface elements, layouts, interaction flows

For any behavior the starting set doesn't cover, create a descriptive token — for example: CACHE, MIGRATE, HEALTH, LOADER, WATCH, AUDIO, PARSER, SYNC, PLUGIN, SESSION, TOOL. Tokens describe the target's actual surface; a speech-to-text app probably needs AUDIO and UI; a web service probably needs NET and DATA; a code-loading tool probably needs PARSER and CONFIG. Don't carry tokens you don't need.

If a module's behavior spans multiple domains, use multiple tokens (one per behavioral block). IDs MUST be unique across the entire spec file. Examples: SPEC-CLI-001, SPEC-CONFIG-042, SPEC-API-003, SPEC-AUDIO-007.

Requirement Levels (IETF RFC 2119)

Every behavioral claim in the spec MUST be annotated with a requirement level:

  • MUST -- Absolute requirement. The implementation is non-compliant if this is not satisfied. The implementer MUST exhibit this behavior.
  • SHOULD -- Recommended. There may be valid reasons to deviate, but the implications must be understood and divergence requires documented rationale.
  • MAY -- Optional. The implementation can choose to include or omit this behavior.

Apply requirement levels to every entry point behavior, every decision tree outcome, every error condition, and every state transition. If a claim lacks a requirement level, it is ambiguous and must be clarified.

Spec Structure Template

Each per-module spec covers the following sections. All sections are required; write "Not applicable" or "Stateless" where a section genuinely does not apply, but never omit sections.

1. Overview

2-3 paragraphs: what the module does from a user/system perspective, why it exists, key responsibilities.

2. Behavioral Interfaces
Exposed Capabilities

For each capability this module makes available:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
255
Repository forks
25
7-day trend score
28

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/prime-radiant-inc/greenfield/behavioral-spec-writing/badge)](https://verified-skill.com/skills/prime-radiant-inc/greenfield/behavioral-spec-writing)

Something wrong with this skill or its page? Tell us.