Skip to content
Skills Library
Programming · Testing

component-patterns

/component-patterns

Per-component-type verification approaches. Use when generating verification scripts for different component types.

Repository
the-bulwark ↗
Licence
MIT
Last repository change
23.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
7
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 23.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Per-component-type verification approaches. Use when generating verification scripts for different component types.

Original author description

Per-component-type verification approaches. Use when generating verification scripts for different component types.

How it works

  1. Purpose
  2. When to Use
  3. Component Type Detection
  4. Pattern Reference Files
  5. Usage Instructions
  6. Quick Reference: Component to Pattern
  7. Key Principle: Real Verification
  8. Diagnostic Output
Original SKILL.md headings · 127 lines, 591 words
SKILL.md preview
---
name: component-patterns
description: Per-component-type verification approaches. Use when generating verification scripts for different component types.
user-invocable: false
allowed-tools:
  - Read
  - Write
version: 1.0.0
author: "Ashay Kubal @ Qball Inc."
---

# Component Patterns

## Purpose

Provide verification strategies for different component types. This skill defines how to
test real behavior for CLIs, servers, parsers, processes, databases, and external APIs.

## When to Use

Load this skill when:
- Generating verification scripts via bulwark-verify skill
- Determining how to test a specific component type
- Implementing test-audit Step 7 rewrites

---

## Component Type Detection

Analyze the code to determine component type based on these indicators:

| Indicators | Component Type | Pattern Reference |
|------------|----------------|-------------------|
| Imports `child_process`, has `spawn`/`exec`/`execSync` | Process Spawner | `references/pattern-process-spawner.md` |
| Imports `http`/`https`/`express`/`fastify`/`koa`, has `listen()` | HTTP Server | `references/pattern-http-server.md` |
| Imports `fs`, reads/parses files, has parse functions | File Parser | `references/pattern-file-parser.md` |
| Has CLI argument parsing (`process.argv`, `yargs`, `commander`, `argparse`) | CLI Command | `references/pattern-cli-command.md` |
| Imports database driver (`pg`, `mysql`, `mongoose`, `sqlite`, `prisma`) | Database | `references/pattern-database.md` |
| Makes outbound HTTP calls (`fetch`, `axios`, `got`, `requests`) | External API | `references/pattern-external-api.md` |

---

## Pattern Reference Files

Each pattern reference contains:
- **Strategy**: High-level approach for testing the component type
- **Templates**: Ready-to-use verification script templates in Bash, Node/Jest, and Python/pytest
- **Placeholders**: Variables to substitute with component-specific values

### Available Patterns

| Pattern | File | Languages |
|---------|------|-----------|
| CLI Command | `references/pattern-cli-command.md` | Bash, Node, Python |
| HTTP Server | `references/pattern-http-server.md` | Bash, Node (supertest), Python |
| File Parser | `references/pattern-file-parser.md` | Bash, Node, Python |
| Process Spawner | `references/pattern-process-spawner.md` | Bash, Node |
| Database | `references/pattern-database.md` | Node, Python, Bash (SQLite) |
| External API | `references/pattern-external-api.md` | Node (MSW), Python (responses) |

---

## Usage Instructions

### Step 1: Detect Component Type

Analyze the target component code using the detection table above.

### Step 2: Load Pattern Reference

Read the appropriate pattern file from `references/`:

```
Read skills/component-patterns/references/pattern-{type}.md
```

### Step 3: Select Template

Choose the template that matches the project language:
- **Node projects** (`package.json` present): Use Node/Jest template
- **Python projects** (`pyproject.toml` or `setup.py` present): Use Python/pytest template
- **Generic/Other**: Use Bash template

### Step 4: Substitute Placeholders

Replace all `{placeholder}` values with component-specific information:

| Common Placeholders | Description |
|---------------------|-------------|
| `{component_name}` | Name of the component being tested |
| `{component_path}` | Import path to the module |
| `{port}` | Network port (for servers/processes) |
| `{expected_value}` | Expected output to verify |

---

## Quick Reference: Component to Pattern

| Component Type | Verification Strategy | Key Assertion |
|----------------|----------------------|---------------|
| CLI Command | Spawn, capture stdout/stderr | Exit code + output text |
| HTTP Server | Start, HTTP request, verify response | Status code + response body |
| File Parser | Create input, parse, check structure | Parsed fields + values |
| Process Spawner | Spawn, check port/pid, verify behavior | Process alive + responds |
| Database | Setup DB, execute ops, query state | Records exist/modified |
| External API | MSW intercept, real fetch, check result | Response data matches |

---

## Key Principle: Real Verification

All patterns follow the same principle: **verify observable output, not mock calls**.

| Anti-Pattern | Real Pattern |
|--------------|--------------|
| `expect(spawn).toHaveBeenCalled()` | `expect(await checkPort(8080)).toBe(true)` |
| `expect(fs.writeFile).toHaveBeenCalled()` | `expect(fs.existsSync(path)).toBe(true)` |
| `expect(fetch).toHaveBeenCalledWith(url)` | `const resp = await fetch(url); expect(resp.status).toBe(200)` |
| `expect(db.save).toHaveBeenCalled()` | `const found = await db.find(id); expect(found).toBeDefined()` |

---

## Diagnostic Output

Write diagnostic output to `logs/diagnostics/component-patterns-{YYYYMMDD-HHMMSS}.yaml`:

```yaml
skill: component-patterns
timestamp: {ISO-8601}
diagnostics:
  component_type_detected: cli|http|file-parser|process|database|api
  pattern_applied: "CLI Command Verification"
  template_language: bash|node|python
  files_analyzed: 1
  completion_status: success
```
Files in this package (7)
  • SKILL.md 5 KB
  • references/pattern-cli-command.md 3 KB
  • references/pattern-database.md 4 KB
  • references/pattern-external-api.md 4 KB
  • references/pattern-file-parser.md 4 KB
  • references/pattern-http-server.md 4 KB
  • references/pattern-process-spawner.md 3 KB

Versions

RepositoryScoreLicence
This page · QBall-Inc/the-bulwark100MIT
krishna-modi12/frontend-design-pro100MIT
armanzeroeight/fastagent-plugins95MIT

Database snapshot: 13.11.2026 · package version 8d53cd49d5d1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100react-component-patterns
    Build modern React component architecture with composition patterns. Use when designing reusable React components, applying composition patterns, or structuring component hierarchies.
  • 100ink-component-patterns
    Use when building terminal UIs with Ink component patterns for React-based CLI applications.
  • 100react-component
    Use when writing or editing a React component. Covers preferred patterns for functional components, prop types, and styling.
  • 100web-component-design
    Master React, Vue, and Svelte component patterns including CSS-in-JS, composition strategies, and reusable component architecture. Use when building UI component libraries, designing component APIs, or implementing frontend design systems.
  • 100web-component-design
    Master React, Vue, and Svelte component patterns including CSS-in-JS, composition strategies, and reusable component architecture. Use when building UI component libraries, designing component APIs, or implementing frontend design systems.
  • 95gameobject-component-list-all
    List C# class names extended from UnityEngine.Component. Use this to find component type names for 'gameobject-component-add' tool. Results are paginated to avoid overwhelming responses.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.