Back to skills

Requirements Discovery Framework

Use this skill at the absolute beginning of a project or major feature request to systematically uncover hidden constraints, define success metrics, and prevent scope creep before writing code.

Foundation

Requirements Discovery Framework

Category Version

Purpose

⚠IMPORTANT⚠This skill enforces an execution lock until constraint matrices are fully populated. It halts recursive generation cycles that proceed on incomplete context, ensuring output artifacts strictly adhere to defined boundary conditions.

When to Use This Skill

⚠NOTE⚠Use this skill when a user provides a high-level, vague, or incomplete prompt for a new application or complex feature (e.g., "Build me an e-commerce site").

What This Skill Prevents

This skill prevents:

  • Unconstrained Generation: Executing recursive AST synthesis without defined system boundary conditions.
  • Implicit Overrides: Defaulting to fallback stacks (e.g., MongoDB) when the host environment dictates conflicting dependencies (e.g., PostgreSQL).
  • Algorithmic Bloat: Compiling monolithic administrative sub-graphs for nodes that only require headless CLI execution.
  • Edge-Case Omission: Terminating execution without computing exception paths or deterministic failure states.

Core Principle

Source code is a derivative artifact of boundary constraints. To compute an optimal solution, you must map the boundaries of the problem space. Emit targeted queries to define the $O(1)$ happy path, compute exception vectors, and establish hard technical invariants.

Research-Backed Rules

  • Constraint Derivation: Formulate the primary business vector. The architectural topology MUST be deterministically mapped to the root optimization function.
  • Scale Vector Invariants: Infer execution load thresholds. $O(1)$ constant-time topologies are strictly disjoint from $O(\log N)$ hierarchical topologies required for high-throughput scaling.
  • Exception Path Computation: Instantiate minimum $n=2$ negative execution vectors prior to compilation. Halt generation if database failure states or null-input regressions are undefined.
  • Environment Context Resolution: Explicitly query existing module environments, persistent layer drivers, and CI/CD topologies. Zero-context greenfield assumptions are prohibited unless declared.

Implementation Guidance

Upon reception of an under-specified prompt, execute the constraint resolution protocol:

  1. State Machine Definition: Compute the $O(1)$ optimal execution vector (The Happy Path).
  2. Actor Profiling: Define the client parser target (Determines ARIA strictness, viewport rendering density).
  3. Data Topology Constraints: Define input vectors, persistence layers, and schema compliance criteria (PII, HIPAA).
  4. Execution Thresholds: Determine compile-time optimization targets (Prototype vs. Production).
  5. BDD State Asserts: Translate prompt into discrete Given-When-Then boolean logic expressions to enforce testable regression invariants before code synthesis.

Mathematical / Measurable Rules

  • Query Batch Limits: Parameter resolution queries MUST be batched. Do not exceed $n \le 3$ boolean or strictly typed questions per cycle to prevent stack overflow in user attention.

Quality Gates

Maintainability Gate

  • Confirmed root invariants are explicitly logged to standard output for user verification.
  • Asserted database, stack, and deployment topologies are formally typed.

Anti-Patterns to Avoid

  • Greedy Generation (Yes-Man Execution): Executing immediate recursive AST construction on unverified, single-node prompts.
  • Infinite Resolution Loops: Emitting unbounded parameter queries without injecting safe deterministic fallbacks. Document fallbacks as explicit assumptions.

Agent Behavior Instructions

  1. Intercept vague user prompts and invoke execution lock.
  2. Synthesize constraint resolution matrix.
  3. Assert operational assumptions explicitly.
  4. Provide finite discrete topology choices (e.g., "Branch A: SPA execution. Branch B: SSR generation.").

Final Review Checklist

  • Non-deterministic prompts nullified.
  • Failure paths mapped.
  • Invariant assumptions logged.
  • Fully agent-optimized deterministic rules.