tech-talk
Technical codebase analysis with A-F grades across 9 categories. Self-contained iOS/Swift audit with automated grep scanning, verification, and Issue Rating Tables. Triggers: "tech talk", "tech report card", "grade my codebase", "technical audit", "sitrep".
Terry Nyberg · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add Terryc21/sitrep --skill tech-talk技能说明
name: tech-talk description: 'Technical codebase analysis with A-F grades across 9 categories. Self-contained iOS/Swift audit with automated grep scanning, verification, and Issue Rating Tables. Triggers: "tech talk", "tech report card", "grade my codebase", "technical audit", "sitrep".' version: 3.1.0 author: Terry Nyberg license: Apache-2.0 allowed-tools: [Glob, Grep, Read, Write, AskUserQuestion] metadata: tier: analysis category: analysis
Tech-Talk Report Card Generator
YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.
Generate a technical report card with A-F grades across 9 categories for iOS/Swift codebases.
All findings use the Issue Rating Table format. Do not use prose severity tags like [HIGH] or [MED] — always render the full rating table.
Step 1: Before Starting
📖 Run the opening interview from ../shared/session-setup.md § Opening interview.
It defines the CLAUDE.md and Timeline questions (plus the timeline grading adjustment)
shared by all report-card skills.
Focus question — specific to this skill. Use this as the third question:
{
"question": "Any categories to emphasize or skip?",
"header": "Focus",
"options": [
{"label": "Full analysis (Recommended)", "description": "Grade all 9 categories"},
{"label": "Skip accessibility", "description": "Not prioritizing accessibility now"},
{"label": "Emphasize performance", "description": "Users report slowness or battery drain"},
{"label": "Emphasize security", "description": "Handling sensitive data or preparing for review"}
],
"multiSelect": true
}
CLAUDE.md summary depth for this skill: 3-5 technical bullets.
Freshness
📖 Read ../shared/scan-discipline.md § Freshness and follow it. In short: current
source only, never .agents//scratch//prior reports, with one exception for reading a
previous report's grades only in Step 2. The shared file is authoritative — do not
re-inline the rule here.
Step 2: Trend Check
Check for a previous report to enable grade trend comparison:
Glob pattern=".agents/research/*-tech-reportcard.md"
If found, read ONLY the grade summary line from the most recent report. Do not read or reuse any findings — those must come fresh from scanning.
Step 3: Codebase Exploration
Scan the project structure and key configuration files:
- Project metrics — File counts, LOC (estimate via
wc -l), targets, schemes - Architecture — Main modules, patterns (MVC/MVVM/etc.), frameworks used
- App purpose — What the app does, primary user flows
- State management — How data flows between layers (@Observable, SwiftData, etc.)
Step 4: Automated Scans
Run all grep patterns below before compiling findings. Every section includes false-positive guidance — read flagged files before reporting any finding.
4.1 Architecture
# Large files (>500 lines) — maintainability signal
# After finding files, check line counts with wc -l
Glob pattern="**/*.swift"
# Missing @MainActor on ObservableObject
# FALSE POSITIVE: ObservableObject subclass that delegates to @MainActor property is fine
Grep pattern="class.*:.*ObservableObject" glob="**/*.swift"
# Deep view body nesting — read file and check body complexity
# Only flag if view body exceeds ~80 lines or has >3 levels of conditional nesting
Grep pattern="var body.*some View" glob="**/*View*.swift"
4.2 Code Quality
# Force casts — crash risk
# FALSE POSITIVE: as! in test code or after is/guard let check is safe
Grep pattern="as!" glob="**/*.swift"
# Force unwraps (excluding IBOutlets and test files)
# FALSE POSITIVE: dictionary literals, known-safe patterns, test assertions
Grep pattern="[^I]!" glob="**/*.swift"
# Bare try? swallowing errors silently
# FALSE POSITIVE: try? in optional chaining where nil is the expected fallback
# INTENTIONAL: try? for operations where failure is acceptable (e.g., file deletion, optional conversion)
Grep pattern="try\?" glob="**/*.swift"
# TODO/FIXME/HACK markers — self-documented technical debt
# These are INTENTIONAL markers, not bugs. Count them for code health grading
# but do not list individual TODOs as issues in the Issue Rating Table
Grep pattern="(TODO|FIXME|HACK|XXX):" glob="**/*.swift"
4.3 Security
# Hardcoded secrets
Grep pattern="(api[_-]?key|apikey|secret[_-]?key|client[_-]?secret|password|token)\s*[:=]\s*[\"'][^\"']+[\"']" glob="**/*.swift" -i
# Sensitive data in UserDefaults
Grep pattern="(UserDefaults|@AppStorage).*\b(password|token|secret|apiKey|credential)" glob="**/*.swift" -i
# HTTP URLs (non-HTTPS)
# FALSE POSITIVE: http://localhost, XML namespace URIs, protocol-detection logic
Grep pattern="http://" glob="**/*.swift"
# Logging sensitive data
Grep pattern="(print|NSLog|os_log|Logger).*\b(password|token|secret|key|credential)" glob="**/*.swift" -i
4.4 Performance
NOTE: These patterns produce CANDIDATES. Verify each by reading the file.
# @Query without predicate (full table scans)
# CLASSIFY: COUNT_ONLY (.count access → use fetchCount), FILTER_THEN_USE, or FULL_ACCESS
# INTENTIONAL: views that genuinely need all records (e.g., "show all items" list) are OK
Grep pattern="@Query\s+(private\s+)?var" glob="**/*.swift"
# Main thread file I/O
# FALSE POSITIVE: FileManager in async methods or Task.detached is fine
# Only flag synchronous file I/O in view body, computed properties, or onAppear
Grep pattern="(FileManager|Data\(contentsOf|String\(contentsOf)" glob="**/*View*.swift"
# Missing [weak self] in closures
# ⚠️ NO LOOKAHEAD — see "Regex constraint" below. These return every closure with a
# capture list; you must read each hit and check whether the list contains weak/unowned.
# FALSE POSITIVE: SwiftUI struct views don't need weak self — only flag in classes
Grep pattern="\{\s*\[" glob="**/*ViewModel*.swift"
Grep pattern="\{\s*\[" glob="**/*Manager*.swift"
Gre
阅读完整来源 ↗