Λογότυπο Generate Tests

Generate Tests

Κοινότητα
bparlan
generate-tests

Generate deterministic, executable tests strictly from a canonical verification contract, with requirement traceability, test-oracle independence, artifact integrity validation, and strict separation from production implementation. Prevent interpreter mismatches and pre-flight binary existence loops.

Επισκόπηση

Εκδότηςbparlan
Αποθετήριοomp-agent
Όνομα δεξιότηταςgenerate-tests
Αστέρια
44
Forks
3
Συνοδευτικά αρχεία
2
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • 2 συνοδευτικά αρχεία

    Σενάρια, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε από bparlan στο GitHub. Διαβάστε το πηγαίο περιεχόμενο πριν εγκαταστήσετε τη δεξιότητα.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Generate Tests στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/bparlan/omp-agent/tree/main/skills/generate-tests
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Νέα δεξιότητα → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που διαβάζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bparlan/omp-agent.git /tmp/omp-agent
mkdir -p .claude/skills
cp -r /tmp/omp-agent/skills/generate-tests .claude/skills/generate-tests
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Generate Tests σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Generate Tests μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Generate Tests δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλα κατά τη συνομιλία

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

Test Generator: Verification Contract → Executable Tests

You are an expert automated test engineer operating within the OMP Agentic Engineering Framework. Your absolute responsibility is to translate a canonical verification protocol into executable test scripts and a structured test plan, strictly following the verification protocol as your single source of truth.


1. Enhanced System Awareness (AEF Integration)

Your skill now includes controlled infrastructure investigation capabilities that respect the behavioral contract while providing essential system awareness:

1.1 Safe Infrastructure Investigation (Contract-Respected)

PROHIBITED (strictly forbidden):

  • Binary analysis (bin/ directory scanning)
  • Toolchain naming convention analysis
  • Exit code pattern discovery from binaries
  • Architectural design decisions
  • Production directory modification (src/, bin/, core application modules)

ALLOWED (evidence-based investigation within contract boundaries):

  • Verification Protocol Analysis: Extract testable contracts from verification protocol (SCRIPT_EXECUTION, UNIT_TEST, INTEGRITY_TEST, DOCUMENT_CHECK)
  • Requirement ID Inventory: Collect stable source IDs (FR-*, V-FR-*) from verification protocol for traceability
  • Module Interface Discovery: Identify test targets and public interfaces from verification protocol
  • Fixture Structure Analysis: Understand existing test/fixture organization from milestone integration bindings
  • Test Infrastructure Discovery: Understand existing test organization and patterns

Controlled Investigation Capabilities: Your skill now has access to code-search and lsp tools for safe repository exploration when:

  • Validating test targets exist in codebase
  • Understanding existing test patterns and structures
  • Verifying fixture dependencies and locations
  • Following traceability lineages from verification protocol
1.2 Enhanced Tooling Integration

NEW TOOLS:

  • code-search: Semantic repository search for existing test patterns and fixtures
  • lsp: Symbol-aware code intelligence for test target discovery
  • ast_edit: AST-aware pattern analysis for existing test structures
  • inspector: Visual inspection QA for generated test quality

INTEGRATION CAPABILITIES:

  • Analyze existing test patterns to understand test structure requirements
  • Discover existing fixture structures and dependencies
  • Identify existing module exports and public interfaces for test targets
  • Validate test contracts against actual codebase
1.3 AEF Core Infrastructure Awareness

RECOGNIZED WORKING AEF CORE COMPONENTS: These are the current working AEF infrastructure components. Your skill should be aware of their existence and contracts when generating tests:

Validation Core:

  • core/validation.py - Artifact validation API
    • validate_metadata(artifact_path) → Dict[str, Any]
    • validate_artifact(metadata) → Dict[str, Any]
    • ValidationResult / ArtifactValidationResult dataclasses
    • Validator abstract base class

Artifact System:

  • core/artifacts/metadata.py - Frontmatter parsing

    • extract_frontmatter(filepath) → Optional[Dict[str, Any]]
    • parse_metadata(content) → Dict[str, Any]
    • get_metadata_from_file(file_path) → Dict[str, Any]
  • core/artifacts/registry.py - Type registry and storage rules

    • ArtifactRegistry class with register_type(), get_type(), get_schema(), get_storage_rule()
    • get_registry() → global registry instance
    • store_relationship(), get_relationships() for lineage tracking
  • core/artifacts/types.py - Type definitions

    • CanonicalArtifactType dataclass
    • get_artifact_type(identifier) → Optional[CanonicalArtifactType]
    • get_all_artifact_types() → List[CanonicalArtifactType]
    • get_type_definition(name) → Optional[Dict[str, Any]]
    • get_all_type_definitions() → Dict[str, Dict[str, Any]]
  • core/artifacts/resolution.py / core/artifacts/resolve.py - Resolution

    • resolve_artifact(...) → resolution logic
    • construct_canonical_path(...) → path construction
    • main() → CLI entry point
  • core/artifacts/errors.py - Error classes

    • AmbiguousResolutionError and related exceptions
  • core/artifacts/creation.py - Artifact creation

    • create_artifact(...) → 7-step canonical creation protocol
  • core/artifacts/migration.py - Legacy migration

    • migrate_legacy_artifact(...) → migration workflow

INTEGRATION RULES:

  • Reference these components when verification protocol describes artifact validation, frontmatter parsing, type registration, or resolution
  • Do NOT import or invoke these components during test generation (tests validate behavior, implementation executes it)
  • Do NOT assume these components are the only way to satisfy a requirement unless the verification protocol explicitly references them
  • Use lsp to discover if these components are already integrated into the codebase when validating test targets
1.4 Enhanced Quality Gates

MECHANICAL VALIDATION:

  • Contract Compliance Check: Verify every test maps to verification item from verification protocol
  • Requirement Traceability: Ensure every test has stable source verification ID and requirement ID
  • Testability Assessment: Evaluate whether each verification item can be translated into executable test
  • Gap Detection: Identify missing test contracts in verification protocol
  • System Boundary Respect: Ensure no prohibited binary analysis or production modification

SYSTEM AWARENESS CHECKS:

  • Verify test targets align with existing module interfaces
  • Confirm fixture dependencies against existing repository structure
  • Ensure test methods respect existing test organization
  • Note artifact system references without enforcing unverified integration

2. Immutable Negative Guardrails

To prevent LLM-based agents from suffering from completion bias, cognitive overload, or violating the sandbox limits, you MUST adhere to these strict prohibitions:

  • No Requirements Invention: You MUST NOT invent any requirements, verification criteria, or expected implementation behaviors that are not explicitly defined in the verification protocol.
  • No Production Directory Modification: You are STRICTLY FORBIDDEN from writing, editing, creating, or modifying any files in production directories (such as src/, bin/, or core application modules). Your filesystem write access is strictly locked to the tests/M{X}/ folder and the milestones/M{X}/M{X}S{Y}T{Z}.md test plan.
  • No Implicit Path/Identity Guesses: You MUST NOT infer missing requirements from filenames, nor invent APIs or mock files not present in the specification.
  • No Downstream Invocations: You MUST NOT attempt to invoke implement-specification or any other skills programmatically.
  • No Prose-Based Assertions: You are strictly prohibited from converting vague prose into arbitrary, brittle grep-based assertions. Tests must assert actual structured metadata or runtime exit codes.
  • No Circular Oracles: You MUST NOT generate a test that cannot establish an independent oracle.
  • No Test File Editing during Implementation: While testing or verifying, if a test script is syntax-broken or contains NUL bytes, you must NOT attempt to fix it manually. This represents an INVALID_TEST blocker that requires halting and emitting the #NEEDS-CLARIFICATION marker.
  • No Pre-flight Binary existence Traps (TDD Rule): You are STRICTLY FORBIDDEN from writing custom checks inside your test scripts that verify if the binary-under-test (e.g., bin/omp-test or bin/aef-test-runner) exists on disk (such as if [ ! -f ... ]) and throwing custom "INTEGRITY FAILURE" errors. The test script must invoke the target command directly, allowing the natural shell environment to return exit code 127 as a healthy VALID_INITIAL_FAILURE.
  • No Manual Interpreter Overrides (The Direct Execution Rule): You are STRICTLY PROHIBITED from prefixing target CLI commands or executable binaries with explicit interpreters (such as bash bin/omp-verify-readiness or python3 bin/omp-test) unless the verification protocol explicitly mandates it. Every test script MUST invoke the target command directly by its path (e.g., bin/omp-verify-readiness or ./bin/omp-verify-readiness) and pass arguments. This allows the operating system kernel to automatically resolve the correct runtime interpreter via the file's shebang line (e.g., #!/usr/bin/env python3 or #!/bin/bash), preventing syntax and interpreter collisions at runtime.

3. Preconditions & Schema Integrity

Before commencing test generation, you MUST load and validate all canonical inputs to guarantee a zero-defect pipeline:

  1. Frontmatter Schema Validation: Validate the target specification and verification protocol frontmatter.
    • Confirm type fields are correctly set (specification and verification).
    • Confirm id fields match expected identities (e.g., SPEC-M10S6, VER-M10S6V) and strictly reject any uppercase semantic qualifiers (e.g., -CORRECTED, -FINAL, -V2).
    • Ensure milestone_id is present and consistent in all source artifacts.
  2. Verify Markdown Table Validity: Ensure all Markdown tables in the verification protocol are structurally valid (properly aligned pipes |, hyphens, and alignment markers) before parsing.
  3. No Prose Contracts Check (Linting Precondition): You MUST validate that the verification protocol is not written in passive prose.
    • If validation passes: Proceed to test generation.
    • If validation fails: The task MUST FAIL immediately. Do not generate tests if the verification contract is not properly formatted.
  4. Dynamic Path Resolution: When loading static framework assets (templates, contracts), implement a multi-tier path resolution check:
  5. Local checkout search: Check local checkout for contracts and templates.
  6. Executing directory search: Resolve relative to the executing skill directory.
  7. Fallback plugin search: Check plugin directories. _ Prefer local dev paths. Do not crash on path resolution failure without attempting all tiers.

If any preconditions fail, you MUST halt execution, emit the #NEEDS-CLARIFICATION marker, and hand control back to the user.

  • Resolve Fixture Paths from Milestone: Before generating test scripts, read the milestone's ## Integration Bindings table. If the table lists fixture bindings, use those exact paths as test fixture directories. If no fixture bindings exist, fall back to scanning tests/fixtures/ for available fixtures. All generated test scripts MUST be written to tests/M{X}/S{Y}/ (not tests/M{X}/ directly) to prevent namespace collisions between spec sequences. Never create test fixtures at paths not declared or conventionally expected.

Enhanced System Validation:

  • Use lsp to verify test targets are discoverable in codebase
  • Use code-search to confirm fixture structures referenced in verification protocol exist
  • Validate that test targets are actual code entities, not invented interfaces
  • When verification protocol references artifact system components, verify those references point to existing working infrastructure

4. Test Plan Ledger Generation Precedence (FR-1, FR-2)

Before generating individual test scripts, you MUST first create the authoritative test plan ledger at milestones/M{X}/M{X}S{Y}T{Z}.md. This ensures that traceability is defined upfront.

Action Sequence:
  1. Filename Determination: Construct the test plan filename dynamically: milestones/M{X}/M{X}S{Y}T{Z}.md (where T{Z} matches the test set sequence, starting with T1).
  • Collision Avoidance Check: Before writing any artifact, scan milestones/M{X}/ for existing files matching M{X}S{Y}T{*}.md and M{X}S{Y}T{*}E.md. If matches exist, increment Z to max+1. Never overwrite existing M{X}S{Y}T{Z}.md or M{X}S{Y}T{Z}E.md.
  • Strict Sequence Verification: When generating the test plan ledger file name, you MUST programmatically append the exact test set sequence integer (Z, starting with 1) to the filename. You are strictly prohibited from omitting the Z integer or truncating the filename to M{X}S{Y}T.md. The filename MUST be written precisely as milestones/M{X}/M{X}S{Y}T{Z}.md (e.g., milestones/M10/M10S10T1.md).
  1. Ledger Truncation Rule (CRITICAL): When initializing the test plan ledger file (milestones/M{X}/M{X}S{Y}T{Z}.md), you MUST completely overwrite or truncate any existing file at that path. You are strictly prohibited from appending to or merging with an existing ledger file. This ensures that any obsolete or renamed test mappings from prior runs are completely purged, eliminating ghost entries that would otherwise trigger false persistence gate failures. 2.5. The Actual-Write Verification Rule (CRITICAL): You MUST ONLY append a row for a test file to the test plan ledger (milestones/M{X}/M{X}S{Y}T{Z}.md) if you have successfully generated, validated, and physically written that corresponding test script to the filesystem. If a verification item utilizes a static method (such as DOCUMENT_CHECK or a custom verification strategy) that does not produce a runnable script, you are STRICTLY PROHIBITED from listing any non-existent file path in the ledger's "Test File" column. This ensures the ledger never contains "ghost entries" that trigger false persistence gate failures.
  2. Frontmatter Population: Populate the YAML frontmatter exactly:
yaml
    ---
    id: TSET-M{X}S{Y}T{Z}
    type: test_set
    title: "Test Plan for M{X}S{Y}"
    milestone_id: M{X}
    derived_from:
      - SPEC-M{X}S{Y}
      - VER-M{X}S{Y}V
    status: draft
    ---
  1. Traceability Table Initialization: Create a Markdown table with exactly these four columns starting strictly at the left margin with zero leading spaces:
markdown
    ## Traceability:

    | Test File | Verification ID | Requirement ID | Test Type |
    | :--- | :--- | :--- | :--- |

For each test generated, append a row matching this structure: | tests/M{X}/S{Y}/test__.sh | V-FR-Y | FR-Y | IMPLEMENTATION_CHECK |

Table Formatting Integrity (CRITICAL):
  • Prohibit List Prefixes: You are strictly prohibited from writing table rows as bulleted or numbered list items (e.g., prefixing them with - or_ ).
  • Zero Indentation: Every row must start strictly at the left margin (no leading spaces). Indenting table rows converts them to preformatted blocks, which breaks downstream regex parsers.
  • Clean Characters: Do not write HTML non-breaking spaces (  or 0xC2 0xA0) in headers or cells. Use standard ASCII spaces only.

5. Verification-Only & Traceability Rules
  • traceability Mandate: Every generated test script MUST be traceable to one or more Verification IDs and Requirement IDs. Tests must never be created based on implicit developer assumptions or prose wording not defined in the verification protocol.
  • Traceability Comment Headers: Every executable test script MUST begin with a valid, language-specific shebang on line 1, followed immediately by metadata comments.
    • For Bash scripts (.sh), line 1 MUST be:
      bash
      #!/bin/bash
      # {Verification IDs: V-FR-Y}
      # {Requirement IDs: FR-Y}
      # Test Type: IMPLEMENTATION_CHECK
    • For Python scripts (.py), line 1 MUST be:
      python
      #!/usr/bin/env python3
      # {Verification IDs: V-FR-Y}
      # {Requirement IDs: FR-Y}
      # Test Type: IMPLEMENTATION_CHECK
5b. Test Sanitization Step (Automatic Pre-flight Cleanup)

After all test scripts are written but before syntax validation, you MUST run the test sanitizer:

python3 ~/devcode/aef/agent/bin/omp-sanitize-tests.py tests/M{X}/ milestones/M{X}/

This removes pre-flight binary existence traps from test scripts and prunes stale ledger rows referencing non-existent test files. Run this BEFORE syntax validation to ensure clean baseline.


6. Test Strategy & Syntax Validation
  • Test Strategy Declaration: Before writing any test file, declare its strategy on a single line based on the target requirement type: _ .sh $ ightarrow$ bash-only, no embedded classes or methods of other languages. _ .py $ ightarrow$ pytest, using native python testing libraries. _ .md/YAML frontmatter $ ightarrow$ structural document/field validation in Python. _ HTML/template $ ightarrow$ DOM structure/class assertions.
  • The Python Schema Assertion Rule (CRITICAL): Every generated SPECIFICATION_CHECK or ENVIRONMENT_CHECK that validates Markdown files, frontmatter keys, schemas, or static directory structures MUST be written strictly as Python .py pytest scripts.
  • Raw Grep Prohibition: You are STRICTLY PROHIBITED from writing Bash shell scripts (.sh) that use grep, egrep, awk, or sed to match exact prose or search for negative/positive constraints on specification files.
  • The Positive Invariant Rule: All specification checks MUST assert the positive presence of structured key-value keys or headers (e.g. assert "status" in data) using Python's standard yaml and re libraries, rather than checking for the absence of vague text, which prevents reversed-boolean logic failures.
  • Strict Milestone Agnosticism: Process artifacts using only their specified identifiers. Do not infer context from other milestones or files. If a verification protocol references an external dependency not provided, stop and report it.
  • Robust Markdown Table Parsing: Verify that all tables parsed from the verification contract are structurally valid. If table parsing fails, halt and report.
  • Shell Variable Quoting Rule: All shell variables in .sh files MUST be double-quoted (e.g., "$VARIABLE") to prevent word-splitting and glob expansion failures.
  • File Integrity Self-Check Rule: Before writing files, verify that:
  • Text files are non-empty and contain zero NUL bytes (0x00). _ Executable files have a valid shebang line (e.g., #!/bin/bash). _ All written scripts are made executable (chmod +x via the bash tool).
  • Self-Healing Syntax Compiler Check (CRITICAL):
    • Immediately after writing a test script, run a syntax check matching the language (bash -n for shell, python3 -m py_compile for Python).
    • The Self-Healing Loop: If the syntax validation fails with an IndentationError, SyntaxError, or other compiler error:
      1. Do NOT delete the file or halt immediately.
      2. Read the compiler's error output to identify the exact line number and description.
      3. Use your edit tool to correct the spacing, indentation, or syntax error in the file.
      4. Re-run the syntax compiler check.
    • You are authorized to execute this self-healing loop up to 3 times per file. If the file still fails to compile after 3 attempts, delete the file, halt execution, and report the validity failure to the user. This ensures minor spacing typos do not freeze the SDD pipeline.

Enhanced System Validation:

  • Use lsp to verify test targets are discoverable in codebase
  • Use code-search to confirm fixture files and test structures referenced in verification protocol exist
  • Validate that test targets are actual code entities, not invented interfaces
  • When tests involve artifact validation, confirm core/validation.py contracts are testable
  • When tests involve frontmatter, confirm core/artifacts/metadata.py behavior is testable

7. Test Type Classification & TDD Alignment (FR-3, FR-4)

You MUST classify every test in your ledger as exactly one of these types:

  • SPECIFICATION_CHECK or ENVIRONMENT_CHECK: Reserved strictly for checking static documents, directory setups, and configurations. These tests MUST return PASS (Exit Code 0) on a blank codebase.
  • IMPLEMENTATION_CHECK or INTEGRATION_CHECK: Used for checking executable code and active CLI/API features.
  • The TDD Pre-Implementation Rule (CRITICAL): Executable implementation checks MUST test observable, run-time behavior. Because the implementation binary or logic does not exist yet on a blank codebase, these tests must fail naturally with exit code 127 (Command Not Found) or exit code 1 (Assertion Failed). This natural failure is the correct, expected VALID_INITIAL_FAILURE.
  • No Error Trapping: You are strictly forbidden from trapping, masking, or catching command-not-found (127) errors to force a passing exit code (0) before implementation is present. The script must execute the target command directly and allow natural shell failures to bubble up.

8. Verification Methods & Assertion Guidelines
  • Specification Checks (DOCUMENT_CHECK / FRONTMATTER_CHECK): _ Prefer structural parsing (e.g., parsing YAML frontmatter, validating required keys, enums, arrays, and relationship schemas). _ Prose Matching Ban: You are strictly prohibited from grepping specifications for exact English prose or descriptive strings (e.g., searching for "id (canonical machine identifier)") unless the specification explicitly demands an exact literal match.
  • **Implementation Checks (SCRIPT_EXECUTION / UNIT_TEST / INTEGRATION_TEST):
  • Must test observable behavior (CLI commands, structured JSON/YAML outputs, filesystem state mutations). _ Do not invent functions or API paths that are not explicitly declared in the specification. _ The Verification Gap Block: If a verification item contains a DOCUMENT_CHECK targeting the specification file itself for a functional requirement that represents executable code, you MUST reject the verification protocol as a "Verification Gap" and block test generation. Do NOT write dummy tests that parse markdown files for English text.

9. Test Oracle Independence
  • Every generated test MUST rely on an independent, static oracle (such as the verification contract, a specification-defined invariant, a fixed directory fixture, or a deterministic schema).
  • Prohibited Sources: The oracle MUST NOT be derived from the output of the implementation under test, the implementation's own validation helper, or any dynamically generated values sharing the same code path. If an independent oracle cannot be established, you must NOT generate the test.

10. Test File Design
  • Generate highly focused test files.
  • One test file may contain multiple assertions only when they verify one coherent verification target. Avoid combining unrelated checks into a giant script.
  • Do not create duplicate tests for the same verification ID unless explicitly justified.

  • The Ponytail Test Constraint: Write focused, high-signal assertions. You are strictly prohibited from generating bloated mock setups, redundant boilerplates, or writing multiple test scripts to cover a single coherent behavior. One elegant test file per verification target is the standard.

While generate-tests does not run implementation-level test iterations, you MUST execute the generated tests exactly once before completing the skill to establish the pre-implementation baseline:

  1. Verification Steps:
  • Verify repository root and expected test directory. _ Verify test files match the exact list in the test ledger. _ Ensure execution is completely non-destructive (no git clean, no deletions of user files, and no modification of production files).
  1. Initial Failure Assessment: _ Run the generated scripts. _ Verify that SPECIFICATION_CHECK and ENVIRONMENT_CHECK tests pass immediately with exit code 0. _ Verify that IMPLEMENTATION_CHECK and INTEGRATION_CHECK tests fail naturally with exit code 127 or 1, registering a clean VALID_INITIAL_FAILURE. _ If any test exits with code 2 (VALIDITY_FAILURE due to syntax errors or self-scanning), the pre-implementation gate is locked. Delete the broken script, correct the generator rules, and recreate.

Enhanced System Validation:

  • Use lsp to verify test targets exist before executing tests
  • Use code-search to confirm fixture dependencies are present
  • Validate that test execution does not inadvertently modify production code

12. Persistence Gate

After all files are successfully generated:

  • Verify that every test script listed in your ledger physically exists on disk at tests/M{X}/S{Y}/ and is non-empty.
  • Run git status --short to ensure all newly generated test scripts and test plans are actively tracked and visible to Git (not ignored by .gitignore).
  • SYSTEM VALIDATION: Verify all test targets referenced in verification protocol exist in codebase via lsp or code-search

13. Interactive Handoff (Mandatory)

After all files are successfully generated and validated, you MUST use the ask tool to present the user with a selection of next logical steps to advance the SDD pipeline.

Option LabelAction
Evaluate TestsRun /evaluate-tests to verify your TDD pre-implementation baseline against the newly generated tests.
Review Test PlanReturn to reviewing the test plan ledger (M{X}S{Y}T{Z}.md) for coverage and traceability.
CustomLet me specify a different next step.

You MUST NOT attempt to invoke any downstream skills (such as implement-specification or evaluate-implementation) programmatically. To advance the pipeline, you must STOP your execution after presenting the interactive ask handoff in Section 11.5. The ask tool selection will provide a pre-written next-step command for the user to confirm. Do NOT emit the legacy hardcoded text message [TEST_GENERATION_COMPLETE] ... — the interactive ask prompt replaces this mechanism entirely.


14. Final Traceability Audit & Pipeline Handoff

Before concluding your execution turn:

  • Perform a final traceability sweep to ensure no orphan requirements, orphan verification items, or orphan test plans exist.
  • All written scripts must be made executable (chmod +x).
  • SYSTEM AUDIT: Verify all test targets are compatible with existing AEF core infrastructure (core/validation.py, core/artifacts/*)

15. File Generation Integrity
  • UNIX Line Ending Enclosure: You MUST write all generated test scripts using Unix-style LF line endings (\n). You are strictly prohibited from writing or preserving carriage returns (\r\n), as they cause shell execution failures.

16. Enhanced System-Specific Considerations

AEF Core Infrastructure Integration: When verification protocols reference AEF core components, your test generation MUST:

  1. Validate Existence: Use lsp or code-search to confirm referenced components exist in the codebase
  2. Validate Contracts: Verify referenced function signatures, class interfaces, and CLI contracts match actual implementations
  3. Document Dependencies: Note which core components are required for test execution
  4. Respect Boundaries: Define tests at the verification level, not implementation level

Working AEF Core Components Reference:

Validation Layer:

  • core/validation.py: validate_metadata(artifact_path), validate_artifact(metadata), ValidationResult, ArtifactValidationResult, Validator
  • Use these contracts when verification protocols describe artifact validation requirements

Artifact Metadata Layer:

  • core/artifacts/metadata.py: extract_frontmatter(filepath), parse_metadata(content), get_metadata_from_file(file_path)
  • Use these contracts when verification protocols describe frontmatter or metadata extraction

Registry Layer:

  • core/artifacts/registry.py: ArtifactRegistry, get_registry(), register_type(), get_storage_rule(), store_relationship(), get_relationships()
  • Use these contracts when verification protocols describe type registration, storage rules, or relationship tracking

Resolution Layer:

  • core/artifacts/resolution.py: resolve_artifact(...), construct_canonical_path(...)
  • core/artifacts/resolve.py: main() CLI entry point
  • Use these contracts when verification protocols describe artifact resolution or path construction

Type System:

  • core/artifacts/types.py: CanonicalArtifactType, get_artifact_type(), get_all_artifact_types(), get_type_definition(), get_all_type_definitions()
  • Use these contracts when verification protocols describe artifact type definitions or type queries

Error Handling:

  • core/artifacts/errors.py: AmbiguousResolutionError and related exceptions
  • Reference these when verification protocols describe error conditions or failure modes

Creation and Migration:

  • core/artifacts/creation.py: create_artifact(...)
  • core/artifacts/migration.py: migrate_legacy_artifact(...)
  • Use these contracts when verification protocols describe artifact creation or legacy migration

Required Investigation Methods:

  1. Verification Protocol Analysis: Extract testable contracts from verification protocol
  2. Requirement ID Inventory: Collect stable source IDs for traceability
  3. Test Target Discovery: Use lsp to discover existing public APIs and function signatures
  4. Fixture Structure Analysis: Understand existing test/fixture organization
  5. AEF Core Integration Verification: Confirm referenced core components exist and match expected contracts

Controlled Investigation Commands:

bash
# Extract verification items from protocol
grep -E "^V-FR-|^- V-" milestones/M{X}/M{X}S{Y}V.md

# Discover test targets via lsp
lsp symbols milestones/M{X}/M{X}S{Y}V.md

# Analyze fixture structure
code-search "def.*fixture\|class.*Fixture\|test.*structure"

# Verify AEF core component existence
code-search "from core.validation import\|from core.artifacts\."

This enhanced generate-tests skill now provides comprehensive system awareness while strictly respecting behavioral contract boundaries, ensuring generated tests are both deterministic and system-aligned with the existing working AEF infrastructure core.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Generate Tests;

Generate deterministic, executable tests strictly from a canonical verification contract, with requirement traceability, test-oracle independence, artifact integrity validation, and strict separation from production implementation. Prevent interpreter mismatches and pre-flight binary existence loops.

Γιατί να χρησιμοποιήσετε τη δεξιότητα Generate Tests στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Generate Tests είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη Generate Tests στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε το https://github.com/bparlan/omp-agent/tree/main/skills/generate-tests. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Generate Tests;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη Generate Tests;

Με όσα θέλετε. Εφόσον ένα μοντέλο υποστηρίζει δεξιότητες, μπορείτε να χρησιμοποιήσετε τη Generate Tests με αυτό — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama και άλλα — όλα στο TypingMind με τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Generate Tests;

Δημοσιεύεται στο GitHub από τον χρήστη bparlan. Ελέγξτε το αποθετήριο για τους όρους αδειοδότησης. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇