layer1-patterns

A code-scanning guide that finds places in a SwiftUI app where users can open screens, sheets, or trigger actions. It builds an inventory of tappable entry points.

In plain words
What is it for?
Use it to inspect a SwiftUI codebase, find navigation and sheet triggers, and document the user actions that need testing.
Why use it?
It helps prevent missed interactions during a workflow audit by searching for known UI patterns, including patterns that may no longer exist.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/terryc21/workflow-audit/layer1-patterns
Clone the repo
git clone --depth 1 https://github.com/Terryc21/workflow-audit
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,169 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01169
Opus 5 $0.00000 $0.00584
Sonnet 5 $0.00000 $0.00234
Haiku 4.5 $0.00000 $0.00117

Measured yesterday against content hash a59e191ef414, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

layer1-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/workflow-audit/agents/layer1-patterns.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Layer 1: Pattern Discovery

Note: Examples in this file (sheet enum names, "Discovered: 29 cases in DashboardSheetType," the "Learnings from Stuffolio Scan" section) are drawn from a real workflow-audit run on the Stuffolio codebase. They are illustrative — substitute the equivalent patterns from your own project. A full sample scan lives in examples/sample-stuffolio-scan/.

Overview

Layer 1 scans the codebase for UI entry points - places where users can trigger navigation, sheets, or actions. The goal is to create a complete inventory of "things users can tap."

SwiftUI Entry Point Patterns

1. Promotion Cards (HIGH VALUE — may be absent)

Feature discovery cards on dashboard. These are prime workflow audit targets.

# File-based search (grep -l)
PromotionCard\s*\(
CompactPromotionCard\s*\(

# Content extraction (grep -o with context)
PromotionCard\s*\([\s\S]*?title:\s*"([^"]+)"

Note: This pattern may return 0 matches if promotion cards have been removed from the codebase. This is expected — report as "Pattern no longer present (0 matches)" rather than silently skipping.

2. Sheet Triggers (HIGH VALUE)

Central sheet management via enum. Best pattern for auditing.

# Find all sheet case assignments
activeSheet\s*=\s*\.(\w+)

# Find sheet enum definition
enum\s+\w*Sheet\w*\s*:\s*\w+\s*\{[\s\S]*?\}

Discovered: 29 cases in DashboardSheetType, 70+ trigger sites

3. Context Menus (MEDIUM VALUE)

Long-press / right-click actions on list items.

\.contextMenu\s*\{

Discovered: 12 files with context menus

4. Swipe Actions (MEDIUM VALUE)

Swipe gestures on list rows.

\.swipeActions

Discovered: 9 files with swipe actions

5. Navigation Links (MEDIUM VALUE)

Direct navigation without sheets.

NavigationLink\s*\(

Discovered: 6 files (relatively rare - app prefers sheets)

6. Boolean State Triggers (LOW VALUE - TOO BROAD)

The showing\w+ = true pattern matches 155 files. Too noisy for automated scanning.

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 138 lines · 0 tokens per session scan A a59e191ef414

Subscribe to this mod's changes

layer1-patterns is an agent published in the GitHub repository Terryc21/workflow-audit (58 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,169 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.