From typescript
Use when asked by the user to invoke the TypeScript architecture audit skill
How this skill is triggered — by the user, by Claude, or both
Slash command
/typescript:auditing-typescript-architectureThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Invoke the `typescript:standardizing-typescript-architecture` skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
Invoke the typescript:standardizing-typescript-architecture skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
Standards are pre-loaded above. Check for spx/local/typescript-architecture.md at the repository root and read it if it exists, applying it as repo-local routing to the product's governing specs and decisions. A local overlay supplements skill behavior; it does not declare product truth.
<context_loading> For spec-tree work items: Load complete ADR/PDR hierarchy before reviewing.
If you're reviewing ADRs for a spec-tree work item (enabler/outcome), ensure complete architectural context is loaded:
spec-tree:contextualizing with the node pathThe spec-tree:contextualizing skill provides:
Review focus:
## Verification (### Audit) include testability constraints (DI, no mocking)?If NOT working on spec-tree work item: Proceed directly with ADR review using provided architectural decision.
</context_loading>
/standardizing-typescript-architecture, then spx/local/typescript-architecture.md if present, for canonical conventions## Verification -- must include testability constraints as ALWAYS/NEVER rules under ### Audit; must NOT include level assignment tables<failure_modes>
These are real failures from past audits. Study them to avoid repeating them.
Approved code that passed linters but had a design flaw. The auditor trusted the tooling output (Phase 1 equivalent) and skimmed the ## Verification rules. The ADR mandated DI for all external calls, but the Verification rules were so vague ("use good practices") that they couldn't catch anything. A Verification rule that cannot falsify non-conforming code is not a rule.
Rejected an ADR for a false positive. The auditor flagged a parameter in a DI interface as "dead code" because it wasn't used in the example. The parameter was required by a Protocol contract that other implementations relied on. Before flagging dead parameters in interfaces, check if the interface is implemented elsewhere.
Missed mocking hidden behind DI. The ADR said "dependency injection" but described injecting vi.fn() as the controlled implementation. This is still mocking -- DI is the delivery mechanism, but vi.fn() is a mock. Correct DI injects a controlled real implementation (a simple function or object), not a mock framework spy.
Distracted by style while missing a logic flaw. The auditor spent review time on naming conventions and formatting while a branch condition in the Verification rules was inverted -- the ALWAYS and NEVER were swapped. Comprehension (understanding what the ADR actually says) must come before style concerns.
Accepted temporal language because it was in the Rationale section. The auditor assumed Rationale was exempt from atemporal voice because it explains "why." It is not exempt. "After evaluating options, we decided..." narrates decision history. Atemporal: "X was rejected because Y violates Z."
Flagged a phantom section but missed the real problem. The auditor correctly rejected a Testing Strategy section but didn't check whether ## Verification had equivalent testability constraints. Removing a phantom section is not enough -- the testability constraints must appear somewhere in the ADR (under ### Audit).
</failure_modes>
<principles_to_enforce>
All canonical conventions are in /standardizing-typescript-architecture. Read it first. The audit checks these specific concerns:
1. Section structure -- Only authoritative sections from the ADR template. See <adr_sections> in /standardizing-typescript-architecture for the complete list. Flag any section not in that list.
2. Testability in Verification -- The ## Verification section must include ALWAYS/NEVER rules under ### Audit that enable appropriate testing. See <testability_in_verification> in /standardizing-typescript-architecture for the correct pattern. Level assignment tables and Testing Strategy sections are violations.
3. Atemporal voice -- ADRs state architectural truth in ALL sections. See <atemporal_voice> in /standardizing-typescript-architecture for temporal patterns to reject and rewrite examples.
4. Mocking prohibition -- No mocking language anywhere in the ADR. See <di_patterns> in /standardizing-typescript-architecture for what to check and correct ADR language.
5. Level accuracy -- When the ## Verification rules reference testing levels, verify against /testing definitions. See <level_context> in /standardizing-typescript-architecture. Key rule: SaaS services jump l1 to l3 (no l2).
6. Anti-patterns -- Check for content that does not belong in an ADR. See <anti_patterns> in /standardizing-typescript-architecture for the full table.
</principles_to_enforce>
<output_format>
Emit the verdict as JSON conforming to the canonical schema in plugins/spec-tree/skills/auditing/scripts/verdict.py. The skill's entire output is the JSON verdict. The caller captures the JSON and routes it through emit_verdict.py with the requested --format (defaulting to markdown+json for PR-comment delivery).
The skill's overall is PASS iff every concern row is PASS or UNKNOWN (N/A maps to UNKNOWN); FAIL if any concern is FAIL. Findings carry severity REJECT for blocking violations.
{
"schema_version": 1,
"skill": "auditing-typescript-architecture",
"target": "<adr-path>",
"overall": "PASS | FAIL | UNKNOWN",
"rows": [
{ "name": "section-structure", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "testability-in-verification", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "atemporal-voice", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "mocking-prohibition", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "level-accuracy", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "anti-patterns", "status": "PASS | FAIL | UNKNOWN", "findings": [] },
{ "name": "ancestor-consistency", "status": "PASS | FAIL | UNKNOWN", "findings": [] }
],
"metadata": { "branch": "<branch>" }
}
Each finding's rule field carries the violation pattern (e.g., phantom-section, temporal-voice, mocking-language); file is the ADR path; message carries the one-line "why this fails". Include the correct-approach code sample and required-changes summary directly in the finding's message field — the JSON verdict is the complete output of this skill.
</output_format>
<what_to_avoid>
Don't:
## VerificationDo:
/standardizing-typescript-architecture section names (e.g., <testability_in_verification>, <atemporal_voice>)/testing section names for level rules (e.g., "Stage 2 Five Factors")</what_to_avoid>
<example_review>
Read ${CLAUDE_SKILL_DIR}/references/example-audit.md for a complete REJECTED review showing all concern types: phantom Testing Strategy section, missing testability in ## Verification, mocking language, and temporal voice violations.
</example_review>
<success_criteria> Review is complete when:
/standardizing-typescript-architecture and spx/local/typescript-architecture.md (if present) before starting review## Verification includes testability constraints (ALWAYS/NEVER for DI, no mocking)</success_criteria>
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub outcomeeng/plugins --plugin typescript