opencode-workflow/skills/challenge-architecture/SKILL.md

223 lines
7.8 KiB
Markdown
Raw Normal View History

2026-04-10 09:24:59 +00:00
---
name: challenge-architecture
2026-04-10 14:39:08 +00:00
description: "Silent audit and batch review of architecture decisions. Validates traceability, scalability, consistency, security, integration, observability, and detects over/under-engineering. Updates the single architecture file in place."
2026-04-10 09:24:59 +00:00
---
2026-04-10 14:39:08 +00:00
Perform a silent, structured audit of the architecture document against the PRD. Produce a single batch review with fixed output groups. Apply all fixes directly to the architecture file. Do not ask interactive questions.
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
**Announce at start:** "I'm using the challenge-architecture skill to audit and review the architecture."
2026-04-10 09:24:59 +00:00
## Primary Input
2026-04-10 11:28:45 +00:00
- `docs/architecture/{feature}.md`
- `docs/prd/{feature}.md`
2026-04-10 09:24:59 +00:00
2026-04-10 09:34:54 +00:00
## Primary Output (STRICT PATH)
2026-04-10 09:24:59 +00:00
2026-04-10 11:28:45 +00:00
- Updated `docs/architecture/{feature}.md`
2026-04-10 09:34:54 +00:00
2026-04-10 14:39:08 +00:00
This is the **only** file artifact in the Architect pipeline. Review findings and fixes are applied directly to this file. No intermediate files are written.
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
## Audit Mode
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
This skill operates in **silent audit / batch review** mode:
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
- Read the architecture document and PRD in full
- Perform all validation phases silently
- Produce a single structured review with all findings grouped into fixed categories
- Apply all fixes directly to the architecture document
- Do NOT ask questions one at a time or interactively prompt the user
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
## Audit Phases
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
Perform the following validations silently, collecting all findings before producing the review.
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
### Phase 1: Traceability
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
For every architectural element, verify it traces back to at least one PRD requirement:
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
- Every API endpoint serves a PRD functional requirement
- Every DB table serves a data requirement from FRs or NFRs
- Every service boundary serves a domain responsibility from the PRD scope
- Every async flow serves a PRD requirement
- Every error handling strategy serves a PRD edge case or NFR
- Every consistency decision serves a PRD requirement
- Every security boundary serves a security or compliance requirement
- Every integration boundary serves an external system requirement
- Every observability decision serves an NFR
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
### Phase 2: Coverage
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
For every PRD requirement, verify it is covered by the architecture:
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
- Every functional requirement has at least one architectural component
- Every NFR has at least one architectural decision
- Every edge case has an error handling strategy
- Every acceptance criterion has architectural support
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
### Phase 3: Scalability
2026-04-10 11:28:45 +00:00
- Can each service scale independently?
- Are there single points of failure?
- Are there bottlenecks that prevent horizontal scaling?
2026-04-10 14:39:08 +00:00
- Is database scaling addressed?
2026-04-10 11:28:45 +00:00
- Are there unbounded data growth scenarios?
2026-04-10 14:39:08 +00:00
### Phase 4: Consistency
2026-04-10 11:28:45 +00:00
- Is the consistency model explicit for each data domain?
- Are eventual consistency windows acceptable for the use case?
- Are race conditions identified and mitigated?
- Is idempotency designed for operations that require it?
- Are distributed transaction boundaries clear?
- Is the deduplication strategy sound?
- Are retry semantics defined for all async operations?
- Is the outbox pattern used where needed?
- Are saga/compensation patterns defined for multi-step operations?
2026-04-10 14:39:08 +00:00
### Phase 5: Security
2026-04-10 11:28:45 +00:00
- Are authentication boundaries clearly defined?
2026-04-10 14:39:08 +00:00
- Is authorization modeled correctly?
2026-04-10 11:28:45 +00:00
- Is service-to-service authentication specified?
- Is token propagation defined?
2026-04-10 14:39:08 +00:00
- Is tenant isolation defined (for multi-tenant systems)?
2026-04-10 11:28:45 +00:00
- Is secret management addressed?
- Are there data exposure risks in API responses?
- Is audit logging specified for sensitive operations?
2026-04-10 14:39:08 +00:00
### Phase 6: Integration
2026-04-10 11:28:45 +00:00
- Are all external system integrations identified?
2026-04-10 14:39:08 +00:00
- Is the integration pattern appropriate for each?
- Are rate limits and quotas addressed?
- Are failure modes defined for each integration?
2026-04-10 11:28:45 +00:00
- Are retry strategies defined for transient failures?
- Is data transformation between systems addressed?
2026-04-10 14:39:08 +00:00
### Phase 7: Observability
2026-04-10 11:28:45 +00:00
- Are logs, metrics, and traces all specified?
- Is correlation ID propagation defined across services?
- Are SLOs defined for critical operations?
- Are alert conditions and thresholds specified?
- Can the system be debugged end-to-end from logs and traces?
2026-04-10 14:39:08 +00:00
### Phase 8: Data Integrity
2026-04-10 11:28:45 +00:00
- Are there scenarios where data could be lost?
- Are transaction boundaries appropriate?
- Are there scenarios where data could become inconsistent?
2026-04-10 14:39:08 +00:00
- Is data ownership clear?
2026-04-10 11:28:45 +00:00
- Are cascading deletes or updates handled correctly?
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
### Phase 9: Over-Engineering Detection
2026-04-10 09:24:59 +00:00
- Services that could be modules
2026-04-10 14:39:08 +00:00
- Patterns applied without PRD justification
- Storage choices exceeding requirements
2026-04-10 09:24:59 +00:00
- Async processing where sync would suffice
2026-04-10 14:39:08 +00:00
- Abstraction layers without clear benefit
- Consistency guarantees stronger than requirements
- Security boundaries more complex than the threat model
2026-04-10 11:28:45 +00:00
- Observability granularity beyond operational need
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
### Phase 10: Under-Engineering Detection
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
- Missing error handling for PRD edge cases
- Missing idempotency for operations requiring it
- Missing NFR accommodations
- Missing async processing for non-blocking requirements
- Missing security boundaries where the PRD requires them
2026-04-10 09:24:59 +00:00
- Missing observability for critical operations
2026-04-10 11:28:45 +00:00
- Missing consistency model specification
- Missing integration failure handling
- Missing retry strategies for external dependencies
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
## Review Output Format
After completing all audit phases, produce a single structured review section. Append or update the `## Architecture Review` section in `docs/architecture/{feature}.md` with the following fixed groups:
2026-04-10 11:28:45 +00:00
```markdown
## Architecture Review
2026-04-10 14:39:08 +00:00
### Traceability Gaps
List every architectural element that cannot be traced to a PRD requirement, and every PRD requirement not covered by the architecture.
| Element / Requirement | Issue | Proposed Fix |
|----------------------|-------|-------------|
| ... | Untraceable / Uncovered | ... |
### Missing Decisions
List required architectural decisions that are absent or incomplete.
- [ ] ...
### Over-Engineering
List elements that exceed what the PRD requires.
- ... (specific item, why it is over-engineered, proposed simplification)
### Under-Engineering
List PRD requirements that lack adequate architectural support.
- ... (specific requirement, what is missing, proposed addition)
2026-04-10 11:28:45 +00:00
### Risks
2026-04-10 14:39:08 +00:00
2026-04-10 11:28:45 +00:00
| Risk | Impact | Likelihood | Mitigation |
|------|--------|-----------|------------|
| ... | High/Medium/Low | High/Medium/Low | ... |
2026-04-10 14:39:08 +00:00
### Required Revisions
2026-04-10 11:28:45 +00:00
2026-04-10 14:39:08 +00:00
Numbered list of all changes that MUST be applied before handoff:
2026-04-10 11:28:45 +00:00
2026-04-10 14:39:08 +00:00
1. ...
2. ...
2026-04-10 11:28:45 +00:00
```
2026-04-10 14:39:08 +00:00
After producing the review, apply all Required Revisions directly to `docs/architecture/{feature}.md`.
## Gate Decision
After applying revisions, evaluate the final state:
- **PASS** — All revisions applied, no remaining blockers
- **CONDITIONAL PASS** — Minor gaps remain but do not block Planner handoff
- **FAIL** — Significant revision required; return to `design-architecture`
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
Record the gate decision at the end of the Architecture Review section.
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
If FAIL, do NOT proceed to `finalize-architecture`. The architecture must be redesigned in `design-architecture` first.
2026-04-10 09:24:59 +00:00
2026-04-10 14:39:08 +00:00
If PASS or CONDITIONAL PASS, proceed to `finalize-architecture`.
2026-04-10 09:24:59 +00:00
## Guardrails
2026-04-10 14:39:08 +00:00
This is a pure validation and revision skill.
2026-04-10 09:24:59 +00:00
Do:
2026-04-10 14:39:08 +00:00
- Audit the architecture silently and produce a single batch review
- Validate traceability, scalability, consistency, security, integration, observability
2026-04-10 09:24:59 +00:00
- Detect over-engineering and under-engineering
2026-04-10 14:39:08 +00:00
- Propose specific fixes for all identified issues
- Apply all fixes directly to `docs/architecture/{feature}.md`
- Record the gate decision
2026-04-10 09:24:59 +00:00
Do not:
2026-04-10 14:39:08 +00:00
- Ask questions interactively
2026-04-10 09:24:59 +00:00
- Change PRD requirements or scope
- Design architecture from scratch
- Make implementation-level decisions
- Break down tasks or create milestones
2026-04-10 09:34:54 +00:00
- Write test cases
2026-04-10 11:28:45 +00:00
- Produce any file artifact other than `docs/architecture/{feature}.md`
## Transition
2026-04-10 14:39:08 +00:00
If gate decision is PASS or CONDITIONAL PASS, invoke `finalize-architecture` for final completeness check and format validation.