Track and update action item status from natural language updates like 'Seanのメールには返信しておいた' or 'Lu対応予定'. Integrates with daily-comms-ops workflow. Use when managing action items across communication channels.
safe-by-default-architect
再発しやすい危険な実装パターンを、安全側に倒れる標準パターン・禁止事項・共通層・静的ルール候補へ 変換するスキル。ORM強制、deny-by-default認可、サービス経由I/O、永続化確認後の成功表示などを設計する。レビューで危険コードを見つけるのではなく、危険コードを書きにくくする設計標準を作ることが目的。
Use when turning repeated defect patterns into safe architectural defaults, forbidden-to-safe mapping tables, common layer designs, and enforceable static analysis rules.
含まれるファイル(10)
- SKILL.md12.5 KB
- assets/architecture_decision_record_template.md9.7 KB
- assets/forbidden_to_safe_mapping_template.md6.0 KB
- assets/safe_standard_template.md5.5 KB
- assets/static_rule_candidate_template.md7.8 KB
- references/boundary_hardening_guide.md15.6 KB
- references/exception_policy.md11.9 KB
- references/forbidden_patterns.md14.9 KB
- references/safe_pattern_catalog.md13.3 KB
- references/static_rule_design_guide.md11.6 KB
SKILL.md(原文)
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Safe By Default Architect
Overview
This skill converts recurring dangerous implementation patterns into safe architectural defaults and enforceable standards. Rather than catching unsafe code during review, it designs the codebase so that the safe way is the easy way and the dangerous way requires deliberate effort.
The core philosophy: If a developer can accidentally write dangerous code, the architecture has failed.
Scope Boundary: This skill designs standards, abstractions, and rules. For reviewing existing code against those standards, use critical-code-reviewer. For investigating incidents caused by unsafe patterns, use incident-rca-specialist.
When to Use
- Repeated defects of the same class appear across multiple PRs or services
- Raw SQL, opt-in authorization, or direct file path construction appears in controller/route layers
- No common service layer exists for cross-cutting concerns (auth, file I/O, datetime handling)
- You need to convert RCA findings into enforceable coding standards
- Static analysis rules (lint/semgrep/custom checks) need to be designed
- A "forbidden patterns" list needs to be paired with approved alternatives
- Architecture Decision Records need to codify safe defaults
- A new project or module needs safe-by-default foundations from day one
Inputs
- RCA reports, bug tickets, or critical review findings
- Coding guidelines and architecture documents (if any)
- Technology stack information (language, framework, ORM, tooling)
- Static analysis / lint configuration (if any)
- Relevant code fragments showing dangerous patterns
Outputs
- Safe Pattern Catalog -- approved patterns per category with rationale
- Forbidden Pattern List -- anti-patterns with danger classification and alternatives
- Common Layer Design -- shared services and abstraction recommendations
- Static Rule Candidate List -- lint/semgrep rule proposals with false positive assessment
- Exception Handling Rule -- when and how to approve deviations
- Review Checklist Addendum -- additions to existing code review checklists
Prerequisites
- Defect/RCA data available: Bug reports, RCA findings, or review findings that reveal recurring unsafe patterns
- Technology stack identified: Language, framework, ORM, and tooling context
- Existing standards accessible: Current coding guidelines, lint configuration, and architecture documents (if any)
- Stakeholder alignment: Agreement that architectural enforcement is needed (not just documentation)
Workflows
Workflow 1: Recurring Pattern Aggregation (再発パターン集約)
Collect and consolidate recurring dangerous patterns from defect data.
- Gather inputs: RCA reports, bug tickets, critical review findings, security scan results
- Extract each distinct dangerous pattern with:
- Pattern name: Short identifier (e.g., "raw-sql-concatenation")
- Frequency: How often this pattern has caused issues
- Example code: Representative code snippet from actual incidents
- Affected components: Which modules, layers, or services are impacted
- Deduplicate patterns that are variations of the same root issue
- Load
references/safe_pattern_catalog.mdand check if existing safe patterns cover the identified dangers - Output: Consolidated pattern inventory (aim for 10-30 distinct patterns)
Workflow 2: Danger Classification (危険理由分類)
Classify each dangerous pattern by its threat mechanism.
- Load
references/forbidden_patterns.mdfor the classification taxonomy - Assign each pattern to one or more danger categories:
- Injection / Bypass / Traversal: Attacker-controlled input reaches sensitive operations
- Silent Corruption: Data is modified or lost without error or notification
- Environment Divergence: Behavior differs between dev/staging/production
- Hidden Dependency: Implicit coupling that breaks under change
- Human Error Amplification: Design makes mistakes easy and recovery hard
- Unverifiable Behavior: Cannot confirm correctness through testing alone
- Rank patterns by:
frequency x blast_radius x detection_difficulty - Identify patterns that span multiple danger categories (highest priority)
- Output: Classified and ranked danger inventory
Workflow 3: Safe Standard Definition (標準パターン定義)
Define the approved safe replacement for each forbidden pattern.
- Load
references/safe_pattern_catalog.mdfor reference patterns - For each dangerous pattern, define:
- Forbidden practice: What is explicitly prohibited
- Approved pattern: The safe alternative developers must use
- Required abstraction: Common layer, wrapper, or service that enforces safety
- Minimum contract test: The test that proves the safe pattern is used
- Static rule candidate: How to detect violations automatically
- Review checkpoint: What reviewers must verify
- Use
assets/safe_standard_template.mdto document each standard - Use
assets/forbidden_to_safe_mapping_template.mdto create the mapping table - Validate that every forbidden pattern has a concrete, usable alternative
Workflow 4: Safe Default Decision (安全デフォルト決定)
Establish the project-wide safe defaults that apply universally.
- Load
references/boundary_hardening_guide.mdfor boundary-specific guidance - Define safe defaults for each boundary:
- Query construction: ORM / parameterized queries only; raw SQL prohibited by default
- Authorization: Deny-by-default; every endpoint requires explicit permission grant
- File operations: Service-layer abstraction only; no direct path construction
- Persistence confirmation: UI success message only after persistence is confirmed
- DateTime handling: UTC-aware normalization at persistence boundary
- Row/data access: Named/object access preferred; positional access prohibited
- Dependency loading: Explicit injection; no implicit service locator or global state
- Idempotency: All write operations must be idempotent or explicitly marked non-idempotent
- For each default, document:
- The default behavior (what happens when developer does nothing special)
- The escape hatch (how to override when genuinely needed)
- The enforcement mechanism (lint rule, wrapper API, framework constraint)
- Output: Safe defaults specification document
Workflow 5: Common Layer and Exception Design (共通層+例外条件)
Design the shared infrastructure that makes safe defaults easy and define exception policies.
- Load
references/exception_policy.mdfor exception handling guidance - Design common layer placement:
- Which abstraction layer hosts each safe wrapper (middleware, service, repository, utility)
- Interface contracts that enforce safe usage
- Extension points for legitimate edge cases
- Define exception conditions:
- When raw SQL is allowed: Performance-critical reporting, database-specific migrations, vendor-mandated queries
- When deny-by-default can be relaxed: Public-facing read-only endpoints with explicit annotation
- When direct file access is permitted: Build scripts, CLI tools, infrastructure automation
- Classify exceptions by approval level:
- Review-required: Peer review with documented justification in code comment
- Approval-required: Tech lead or security team sign-off with ADR
- Prohibited: No exception allowed (e.g., SQL concatenation with user input)
- Use
assets/architecture_decision_record_template.mdto document each decision - Output: Common layer design + exception policy document
Workflow 6: Operational Rule Deployment (ルール運用化)
Convert standards into enforceable, operational rules.
- Load
references/static_rule_design_guide.mdfor rule design guidance - Create static analysis rule candidates:
- Use
assets/static_rule_candidate_template.mdfor each rule - Classify by tool suitability: lint, semgrep, regex, custom AST checker
- Assess false positive risk and design suppression mechanisms
- Use
- Create coding standard document entries:
- Rule ID, severity, rationale, examples (good and bad)
- Link to corresponding safe pattern and forbidden pattern
- Create review checklist addendum:
- Checklist items that map to each safe default
- Explicit connection to
critical-code-reviewerskill checkpoints
- Plan rollout strategy:
- Phase 1: Warning-only rules on new code
- Phase 2: Error-level rules on new code
- Phase 3: Codebase-wide enforcement with legacy migration
- Output: Static rule candidates + coding standard entries + review checklist + rollout plan
Resources
| Resource | Type | Purpose | When to Load |
|---|---|---|---|
references/safe_pattern_catalog.md | Reference | Safe patterns by category (query, auth, file, datetime, etc.) | Workflow 1, 3 |
references/forbidden_patterns.md | Reference | Forbidden patterns with danger classification and alternatives | Workflow 2, 3 |
references/boundary_hardening_guide.md | Reference | Boundary-specific hardening techniques (controller, API, DB, file, time, env) | Workflow 4 |
references/static_rule_design_guide.md | Reference | Lint/semgrep/regex rule design, false positive reduction | Workflow 6 |
references/exception_policy.md | Reference | Exception conditions, approval levels, documentation requirements | Workflow 5 |
assets/safe_standard_template.md | Template | Per-rule documentation (forbidden/approved/abstraction/test/review) | Workflow 3 |
assets/forbidden_to_safe_mapping_template.md | Template | Anti-pattern to safe replacement mapping table | Workflow 3 |
assets/static_rule_candidate_template.md | Template | Static analysis rule specification | Workflow 6 |
assets/architecture_decision_record_template.md | Template | ADR for safe default decisions and exceptions | Workflow 5 |
Best Practices
Safe Defaults Philosophy
- Make the safe way the easy way: If the safe pattern requires more code or effort than the dangerous one, adoption will fail. Design wrappers and abstractions that are more convenient than raw access.
- Forbid, do not discourage: "Prefer ORM" is ignored; "Raw SQL triggers CI failure" is enforced. Use enforcement mechanisms, not suggestions.
- Pair every prohibition with an alternative: A forbidden pattern list without approved alternatives creates frustration and workarounds. Every "don't" needs a "do this instead."
Incremental Adoption
- Start with the highest-frequency, highest-impact patterns (typically 3-5 rules cover 80% of recurring defects)
- Roll out as warnings first, then errors, then codebase-wide enforcement
- Provide migration tooling or codemods for existing violations
- Track adoption metrics: violation count over time, exception request frequency
Exception Governance
- Exceptions are expected and healthy; zero exceptions usually means the rules are too loose
- Every exception must be documented in code (comment with justification) and tracked (ADR or ticket)
- Distinguish between "review-required" (peer review suffices) and "approval-required" (tech lead/security sign-off)
- Periodically review exception patterns; frequent exceptions to the same rule may indicate the rule needs refinement
Connection to Review Process
- Safe default rules should map directly to
critical-code-reviewerchecklist items - Reviewers should verify not just correctness but also standard compliance
- Automated checks should run before human review to reduce reviewer burden
- Review findings that reveal new unsafe patterns should feed back into Workflow 1
Static Rule Quality
- Prioritize precision over recall: a rule with many false positives will be disabled
- Design rules that are auto-fixable when possible (provide the safe replacement automatically)
- Include suppression mechanisms with mandatory justification comments
- Test rules against the existing codebase before enabling enforcement
レビュー
まだレビューはありません。使ってみた感想をお寄せください。
同じリポジトリのスキル
概要と使いどころ
AI活用提案の専門コンサルタントスキル。LLM・AIエージェントの活用事例知識を基に、業界別、部門別、シーン別に最適なAI導入提案を行います。システム化、業務改善、効率化を得意とし、具体的な活用事例、期待効果、導入ステップを含む実践的な提案を提供します。Use when proposing AI/LLM adoption strategies for specific industries, departments, or business scenarios.
Generate AI-powered BPO service proposals for Japanese companies in the US market. Use when creating outsourcing proposals with AI service menus, ROI estimation, implementation roadmaps, and bilingual (JA/EN) proposal documents for 在米日系企業向けAI実装.
日本語の概要は準備中です。原文の説明を表示しています。
AI(LLM)が生成した日本語テキストの「AI臭」を検出・診断し、人間らしい文章にリライトするスキル。 Use when: 「AIっぽい文章を直して」「人間らしくリライトして」「AI臭を消して」「この文章をもっと自然にして」 「テキストのAI感を減らして」「機械っぽさを取りたい」 "make this sound more human", "remove AI tone", "humanize this text", "detect if this is AI-generated". 6つのAI特有パターン(視覚的マーカー、単調なリズム、マニュアル的構成、非コミット姿勢、抽象語の濫用、 定型メタファー)を正規表現ベースで検出し、0-100のAI臭スコアを算出。3つの人間化技法 (バランスを崩す・客観を崩す・論理を崩す)でリライトを実行する。 Note: 検出スクリプトは日本語テキスト専用。英語テキストの場合はClaude自身がreferences/を参照して分析・リライトする。
Generate audit-ready internal control design documents from As-Is business process inventories. Produces control IDs, assertion mappings, procedures, SoD analysis, KPIs, materiality thresholds, and implementation roadmaps. Use when building internal controls for new audit engagements, SOX/J-SOX compliance, or process improvement initiatives.
日本語の概要は準備中です。原文の説明を表示しています。
Review audit-related documents (control design documents, bottleneck analyses, requirements definitions, etc.) for quality, scoring them 0-100 with a severity-rated findings list. Use when reviewing audit documents, checking control design quality, or verifying cross-document consistency. Supports documents governed by US GAAP, IFRS, or J-GAAP.
日本語の概要は準備中です。原文の説明を表示しています。