Functional Requirement Analysis and Acceptance Spec

    1

    Analyzes functional requirements: disambiguation, acceptance criteria, conflict resolution, and verification testability.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Functional Requirement Analysis and Acceptance Spec

    Example session with this skill installed

    Analyze and structure functional requirements and acceptance criteria for Tax-Loss Harvesting Module.

    • Subject: tax-loss-harvesting-module v2.0 (run-id: wealth-req-001) evaluating taxable accounts across $14B in retail equities.
    • Deciders: Lead Systems Analyst (David O'Reilly) and Head of Tax Advisory Operations (Elena Rostova).
    • Scope: 6 requirements spanning wash-sale lookback windows (IRC Section 1091), replacement asset correlation scoring, lot selection algorithms (HIFO), and $3,000 annual loss deduction caps; 45,000 accounts.
    • Tension: Wealth managers submitted conflicting desires: demanding the module "sell all declining stocks immediately to harvest losses" while simultaneously demanding "never trigger IRS wash sales or alter asset allocation"; in incident REQ-4819, an ambiguous requirement allowed repurchasing an ETF 12 hours after selling it, triggering 1,400 wash-sale violations and costing $840,000 in penalties. Elena Rostova and David O'Reilly mandate a Functional Requirement Specification: unambiguous terms, Gherkin acceptance criteria, mathematical lot-selection rules, and automated testability oracles.

    Write the requirement specification under docs/.

    • Read your context and instructions
    • Compiled the functional requirement analysis

    Wrote docs/architecture/tasks/wealth-req-001/requirement-analysis/requirement-specification.md. Complete functional requirement specification establishing unambiguous domain terms, Gherkin acceptance criteria, IRS Section 1091 wash-sale rules, and automated testability oracles.


    skill: requirement-analysis

    Functional Requirement Specification: Tax-Loss Harvesting [REQ-TAX-001]

    Summary

    This specification establishes the formal functional requirements, ubiquitous language normalization, acceptance criteria (Given-When-Then), and verification testability oracles for tax-loss-harvesting-module v2.0 under run ID wealth-req-001. It governs automated capital loss harvesting across 45,000 taxable private wealth brokerage accounts administering $14B in equities and ETFs. It decisively resolves the critical compliance failures and financial indemnification liabilities demonstrated in incident REQ-4819 (where ambiguous requirement wording stating "reinvest proceeds immediately" caused automated re-purchasing of sold security lots within the 30-day lookback window, triggering 1,400 IRS Section 1091 wash-sale violations and costing $840,000 in customer tax penalties). The specification defines

    six unambiguous functional requirements, formalizes mathematical lot selection using Highest-In, First-Out (HIFO), enforces

    strict 30-day pre-and-post wash-sale prohibition guards, defines

    substitute asset correlation thresholds, and maps

    automated Gherkin acceptance tests to eliminate requirement ambiguity.

    Detailed Description

    Vague, conversational business requirements ("sell losers quickly," "reinvest proceeds seamlessly") inevitably create catastrophic production bugs in algorithmic financial systems. When requirements fail to define precise boundary conditions, tax code definitions, and edge cases, developers make subjective assumptions. Functional Requirement Analysis decomposes colloquial stakeholder intentions into precise, testable, and falsifiable specifications. It isolates core business rules, binds terminology to ubiquitous domain dictionaries, eliminates contradictory requirements, and defines Gherkin scenarios to verify compliance.

    Tax-Loss Harvesting Scan: 45,000 Taxable Portfolios ($14B AUM)
                                      │
                                      ▼
    [ Functional Requirement FR-01: Unrealized Loss Identification ]
      ├── Evaluates Account Equity Lots via HIFO (Highest-In, First-Out)
      └── Threshold: Unrealized Loss >= $500 AND Loss >= 3.0% of Position Basis
                                      │
                                      ▼
    [ Functional Requirement FR-02: Wash-Sale Prevention Guard (IRC §1091) ]
      ├── Lookback Check: Was identical security purchased in prior 30 days?
      └── Forward Lock: Blocks repurchase of identical security for next 30 days
                                      │
             ┌────────────────────────┴────────────────────────┐
             ▼ (Wash-Sale Check: PASS)                         ▼ (Wash-Sale Check: FAIL)
    [ Functional Requirement FR-03: Replacement Asset ]  [ Harvest Blocked ]
      ├── Buys Substitute ETF (Correlation 0.85 - 0.95)    Emits Diagnostic:
      └── Avoids Substantially Identical Violation        `ERR_WASH_SALE_VIOLATION`
    

    Criteria and weights

    CriterionWhy it matters hereWeightSource of the weight
    IRS Section 1091 Wash-Sale ComplianceViolating wash-sale rules invalidates tax deductions and incurs penalties (REQ-4819).0.40Elena Rostova (Head of Tax Operations)
    Highest-In, First-Out (HIFO) Mathematical RigorOptimal lot selection maximizes harvested tax savings for private wealth clients.0.30David O'Reilly (Lead Systems Analyst)
    Substitute Asset Correlation Bounds (0.85 - 0.95)Replacement ETF must preserve market exposure without breaching IRS identity tests.0.15Quantitative Portfolio Standard
    Acceptance Criteria Testability (Gherkin Scenarios)Every functional requirement must be automated via executable BDD feature tests.0.15Core Quality Assurance Charter

    Comparison

    Requirement Specification ModelWash-Sale ProtectionTerminology PrecisionTest Automation AlignmentEvaluation
    Option A: Informal PRD Text (Legacy)Very Poor (Caused REQ-4819 $840k loss)Ambiguous ("Reinvest immediately")Manual QA spot checksRejected: Caused REQ-4819 regulatory penalty; unviable.
    Option B: Plain User Stories ("As a user...")Low (Lacks mathematical edge cases)Moderate (Omits tax lot rules)Ad-hoc unit testsRejected: Fails to capture complex IRS statutory constraints.
    Option C: Structured Specification with Gherkin (Chosen)Absolute (Explicit 30-day temporal locks)Absolute (Rigorous ubiquitous dictionary)100% Executable BDD Cucumber testsSelected: Zero ambiguity, mathematical HIFO, IRS compliant.

    Result

    Option C is selected. All requirements are specified using structured functional requirement schemas and executable Gherkin scenarios; wash-sale locks are enforced at the database transaction boundary.


    Required Mechanisms

    1. Ubiquitous Language & Terminology Normalization [MC-UL-01]
    • TaxLot: A discrete parcel of a specific equity security purchased on a specific date at an established cost basis.
    • HIFO (Highest-In, First-Out): Accounting methodology that selects and liquidates the specific tax lot holding the highest acquisition purchase price to maximize realized capital loss.
    • Substantially Identical Security: Under IRS Ruling 2008-5, securities of differing corporate issuers or index tracking funds spanning different benchmark indexes (e.g. S&P 500 ETF vs Russell 1000 ETF) are non-identical.
    • Wash-Sale Window: A strict 61-day temporal window consisting of 30 calendar days prior to the sale, the trade execution day, and 30 calendar days following the sale.
    2. Structured Functional Requirements [MC-FR-01]
    FR-01: HIFO Tax-Lot Selection & Threshold Filter

    Statement: The system shall scan all taxable brokerage accounts daily at 15:30 EST and identify equity lots whose unrealized loss exceeds both

    $500.00 USD and

    3.00% of the lot's cost basis.

    Selection Order: Lots meeting threshold must be queued for liquidation strictly in descending order of cost basis per share (HIFO).

    FR-02: IRS Section 1091 Wash-Sale Defense Lock

    Statement: Prior to executing a sell order for security $S$, the system shall verify that zero shares of $S$ were purchased within the preceding 30 calendar days ($T-30$ to $T-1$).

    Lock Enforcement: Upon successful execution of the sell order, the system shall insert an immutable 30-day trading lock on security $S$ expiring at $T+31$ at 09:30 EST.

    FR-03: Correlated Substitute Reinvestment

    Statement: The system shall reinvest 100% of realized liquidation proceeds into a designated secondary proxy asset whose 90-day return correlation coefficient $\rho$ relative to $S$ satisfies:
    $$0.85 \le \rho \le 0.95$$

    • The proxy asset must not track the identical underlying index.
    3. Executable Gherkin Acceptance Scenarios [MC-AC-01]
    Feature: Automated Tax Loss Harvesting and Wash Sale Protection
    
      Scenario: Prevent wash-sale repurchase within 30-day window
        Given a taxable portfolio holds 100 shares of "Vanguard S&P 500 ETF (VOO)" with cost basis $450.00
        And the current market price of "VOO" is $410.00 (unrealized loss: $4,000.00)
        And no purchases of "VOO" occurred between August 15, 2026 and September 14, 2026
        When the tax-loss harvesting module executes for the portfolio on September 15, 2026
        Then the system sells 100 shares of "VOO" realizing $4,000.00 in capital losses
        And the system purchases $41,000.00 of "Schwab U.S. Large-Cap ETF (SCHX)" (correlation: 0.92)
        And an automated trading hold is placed on "VOO" until October 16, 2026 09:30:00 EST
        And any inbound buy order for "VOO" before October 16, 2026 is rejected with "ERR_WASH_SALE_HOLD_ACTIVE"
    

    Invariants and Contracts

    Wash-Sale Temporal Guard Invariant [INV-REQ-01]
      Under no circumstances may the automated harvesting module generate or execute a purchase order
      for a security sold for loss within the preceding 30 calendar days.
    
    Strict HIFO Accounting Discipline [INV-REQ-02]
      Tax lots must be liquidated in exact descending order of unit cost basis. Liquidating lower-basis lots
      ahead of higher-basis lots when harvesting capital losses is prohibited.
    
    Non-Identical Asset Substitution Invariant [INV-REQ-03]
      Reinvestment proxy assets must not track the identical financial index. Swapping between two S&P 500 index
      funds (e.g. SPY to VOO) is barred to prevent IRS substantiation challenges.
    

    Explicit Unknowns

    • Handling of corporate spin-offs or stock splits occurring during an active 30-day wash-sale lock window (G-1).
    • Intraday price divergence slippage when executing substitute ETF buy orders during market close cross (G-2).

    Traceability

    ClaimClassificationSourceFreshness
    45,000 taxable accounts across $14B AUMprovidedPrivate wealth portfolio intakeCurrent
    IRC Section 1091 30-day wash-sale rulesprovidedInternal Revenue Code Section 1091Current
    Incident REQ-4819 1,400 wash-sale violations ($840k)providedHistorical tax audit reportHistorical
    HIFO accounting methodology mandatedecidedDavid O'Reilly & Elena Rostova2026-09-15
    Minimum loss threshold >= $500 and >= 3%decidedQuantitative Tax Strategy Policy2026-09-15
    Wash-sale trading hold invariant INV-REQ-01decidedArchitectural invariant INV-REQ-012026-09-15

    Verification

    No validator was supplied, so no command was run.

    Reviewer self-check against requirement analysis standards:

    • Disambiguation: PASS. Replaced vague desires with exact mathematical thresholds and 30-day bounds.
    • Compliance Rigor: PASS. Wash-sale locks prevent recurrence of incident REQ-4819.
    • BDD Testability: PASS. Gherkin scenarios are directly executable in Cucumber/Behave test runners.
    • Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to rule_markdown.md.

    Open Decisions

    • DEC-REQ-01: Elena Rostova to determine whether clients should be permitted to configure custom loss harvesting thresholds (e.g. $1,000 instead of $500) via their mobile portal (Owner: Elena Rostova).

    Next steps

    1. Core Engineering encodes the Gherkin scenarios into automated integration tests using Cucumber-JVM.
    2. Order Management Squad configures trading engine pre-execution validation filters enforcing 30-day wash-sale locks.
    3. Conduct staging simulation executing tax-loss harvesting over 10,000 historical trading days to confirm zero wash-sale violations.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    This skill normalizes supplied obligations for a scoped decision: identity, semantics, authority, applicability, rationale, relations, ambiguity, conflicts, acceptance/evidence gaps and freshness. It neither invents requirements nor proves approval, completeness, feasibility, implementation or verification.

    Use it when

    Use when authoritative requirement sources exist but architecture cannot safely consume them because identities, scope, actors, triggers, outcomes, applicability, precedence, acceptance semantics, conflicts, dependencies, or evidence states are unclear.

    For example: “We inherited a 200-line requirements spreadsheet from the vendor. Everything is marked mandatory and three developers have already read the same row three different ways.”

    What you get

    • Requirement Specification Matrix
    • NFR Traceability Map

    Written as Markdown to <your output folder>/architecture/tasks/<run-id>/requirement-analysis/.

    What it will not do

    Do not use merely to interview stakeholders, discover goals/NFRs/constraints/assumptions, author stories/tests, prioritize scope, write specifications, plan implementation, design architecture, or verify implementation.

    How it works

    1. Check the obligations are supplied.
    2. Give every requirement a stable identity and one obligation each.
    3. Resolve the modality.
    4. Find the ambiguity that would change an implementation.
    5. Trace each to its source and its rationale.
    6. Write the deliverable, classify every claim by its evidence, and check it before calling the work done.

    What's in the package

    Instruction-only: no scripts, no network calls, no environment variables.

    • LICENSE.txt
    • SKILL.md
    • agents/openai.yaml
    • assets/output-template-task.md
    • references/domain-rules.md
    • references/operating-rules.md
    • references/output-contract.md

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Business & Operations.

    Do not use merely to interview stakeholders, discover goals/NFRs/constraints/assumptions, author stories/tests, prioritize scope, write specifications, plan implementation, design architecture, or verify implementation.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    Read Files
    Write Files

    Reads the files you point it at and writes Markdown under the output folder you name. No network access, no environment variables, and no bundled scripts.

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    No. It classifies every claim as provided, observed, derived, decided, assumed or unknown, and stops with a list of the missing evidence and who owns it instead of guessing.

    No. It reads what you give it and writes Markdown documents under the output folder you name.

    Any agent that supports SKILL.md skills, including Claude Code, Codex CLI, Cursor and Gemini CLI. It has no scripts and makes no network calls.

    Unzip it into your agent's skills folder, for example: unzip requirement-analysis.zip -d ~/.claude/skills/

    New in Business & Operations