oh-my-agent-commandcode 0.0.0-stage → 20.38.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -2
- package/filter-test-output.sh +52 -0
- package/mods/oma.ts +347 -0
- package/package.json +30 -4
- package/skills/_shared/conditional/experiment-ledger.md +28 -0
- package/skills/_shared/conditional/exploration-loop.md +22 -0
- package/skills/_shared/conditional/quality-score.md +33 -0
- package/skills/_shared/core/anti-ai-prose.md +191 -0
- package/skills/_shared/core/api-contracts/README.md +28 -0
- package/skills/_shared/core/api-contracts/template.md +90 -0
- package/skills/_shared/core/clarification-protocol.md +23 -0
- package/skills/_shared/core/code-intelligence.md +46 -0
- package/skills/_shared/core/collaboration-policy.md +28 -0
- package/skills/_shared/core/common-checklist.md +28 -0
- package/skills/_shared/core/context-budget.md +22 -0
- package/skills/_shared/core/context-loading.md +34 -0
- package/skills/_shared/core/difficulty-guide.md +26 -0
- package/skills/_shared/core/execution-policy.md +31 -0
- package/skills/_shared/core/lessons-learned.md +33 -0
- package/skills/_shared/core/prompt-structure.md +18 -0
- package/skills/_shared/core/quality-principles.md +11 -0
- package/skills/_shared/core/session-metrics.md +35 -0
- package/skills/_shared/core/skill-routing.md +39 -0
- package/skills/_shared/core/test-approach.md +54 -0
- package/skills/_shared/core/vendor-detection.md +52 -0
- package/skills/_shared/runtime/memory-protocol.md +118 -0
- package/skills/_shared/runtime/result-contract.md +64 -0
- package/skills/_shared/ui-interaction-quality.md +133 -0
- package/skills/oma-academic-writing/SKILL.md +181 -0
- package/skills/oma-academic-writing/resources/abstract-guide.md +51 -0
- package/skills/oma-academic-writing/resources/academic-verb-tiers.md +42 -0
- package/skills/oma-academic-writing/resources/anti-ai-checklist.md +52 -0
- package/skills/oma-academic-writing/resources/hedging-guide.md +132 -0
- package/skills/oma-academic-writing/resources/sentence-structure-reference.md +151 -0
- package/skills/oma-architecture/SKILL.md +203 -0
- package/skills/oma-architecture/resources/api-evolution.md +41 -0
- package/skills/oma-architecture/resources/checklist.md +42 -0
- package/skills/oma-architecture/resources/execution-protocol.md +115 -0
- package/skills/oma-architecture/resources/methodology-selection.md +92 -0
- package/skills/oma-architecture/resources/migration-patterns.md +28 -0
- package/skills/oma-architecture/resources/output-templates.md +111 -0
- package/skills/oma-architecture/resources/stakeholder-synthesis.md +80 -0
- package/skills/oma-backend/SKILL.md +202 -0
- package/skills/oma-backend/resources/checklist.md +45 -0
- package/skills/oma-backend/resources/error-playbook.md +97 -0
- package/skills/oma-backend/resources/execution-protocol.md +39 -0
- package/skills/oma-backend/resources/orm-reference.md +61 -0
- package/skills/oma-backend/variants/node/api-template.ts +315 -0
- package/skills/oma-backend/variants/node/snippets.md +475 -0
- package/skills/oma-backend/variants/node/stack.yaml +21 -0
- package/skills/oma-backend/variants/node/tech-stack.md +33 -0
- package/skills/oma-backend/variants/python/api-template.py +378 -0
- package/skills/oma-backend/variants/python/snippets.md +199 -0
- package/skills/oma-backend/variants/python/stack.yaml +18 -0
- package/skills/oma-backend/variants/python/tech-stack.md +45 -0
- package/skills/oma-backend/variants/rust/api-template.rs +635 -0
- package/skills/oma-backend/variants/rust/snippets.md +471 -0
- package/skills/oma-backend/variants/rust/stack.yaml +20 -0
- package/skills/oma-backend/variants/rust/tech-stack.md +36 -0
- package/skills/oma-backend/variants/stack.schema.json +73 -0
- package/skills/oma-brainstorm/SKILL.md +166 -0
- package/skills/oma-brainstorm/resources/triz-lite.md +117 -0
- package/skills/oma-coordination/SKILL.md +171 -0
- package/skills/oma-db/SKILL.md +201 -0
- package/skills/oma-db/resources/anti-patterns.md +177 -0
- package/skills/oma-db/resources/checklist.md +67 -0
- package/skills/oma-db/resources/document-templates.md +107 -0
- package/skills/oma-db/resources/error-playbook.md +50 -0
- package/skills/oma-db/resources/examples.md +170 -0
- package/skills/oma-db/resources/execution-protocol.md +127 -0
- package/skills/oma-db/resources/iso-controls.md +98 -0
- package/skills/oma-db/resources/migration-playbook.md +93 -0
- package/skills/oma-db/resources/query-tuning.md +57 -0
- package/skills/oma-db/resources/vector-db.md +159 -0
- package/skills/oma-debug/SKILL.md +146 -0
- package/skills/oma-debug/resources/bug-report-template.md +327 -0
- package/skills/oma-debug/resources/checklist.md +31 -0
- package/skills/oma-debug/resources/common-patterns.md +734 -0
- package/skills/oma-debug/resources/debugging-checklist.md +364 -0
- package/skills/oma-debug/resources/error-playbook.md +94 -0
- package/skills/oma-debug/resources/execution-protocol.md +40 -0
- package/skills/oma-design/SKILL.md +135 -0
- package/skills/oma-design/resources/asset-strategy.md +34 -0
- package/skills/oma-design/resources/checklist.md +63 -0
- package/skills/oma-design/resources/data-grid.md +48 -0
- package/skills/oma-design/resources/design-md-spec.md +107 -0
- package/skills/oma-design/resources/design-tokens.md +53 -0
- package/skills/oma-design/resources/error-playbook.md +18 -0
- package/skills/oma-design/resources/execution-protocol.md +95 -0
- package/skills/oma-design/resources/external-design-skills.md +130 -0
- package/skills/oma-design/resources/getdesign-fetcher.md +104 -0
- package/skills/oma-design/resources/product-interface-review.md +59 -0
- package/skills/oma-design/resources/redesign-protocol.md +52 -0
- package/skills/oma-design/resources/stitch-integration.md +244 -0
- package/skills/oma-dev-workflow/SKILL.md +375 -0
- package/skills/oma-dev-workflow/resources/affected-checks.py +58 -0
- package/skills/oma-dev-workflow/resources/api-workflows.md +58 -0
- package/skills/oma-dev-workflow/resources/database-patterns.md +107 -0
- package/skills/oma-dev-workflow/resources/i18n-patterns.md +63 -0
- package/skills/oma-dev-workflow/resources/release-coordination.md +240 -0
- package/skills/oma-dev-workflow/resources/tooling-profiles.md +217 -0
- package/skills/oma-dev-workflow/resources/troubleshooting.md +78 -0
- package/skills/oma-dev-workflow/resources/validation-pipeline.md +246 -0
- package/skills/oma-docs/SKILL.md +77 -0
- package/skills/oma-docs/resources/commands.md +76 -0
- package/skills/oma-explanation/SKILL.md +212 -0
- package/skills/oma-explanation/resources/document-structure.md +115 -0
- package/skills/oma-explanation/resources/draft-format.md +199 -0
- package/skills/oma-explanation/resources/html-contract.md +102 -0
- package/skills/oma-frontend/SKILL.md +227 -0
- package/skills/oma-frontend/resources/angular-rules.md +110 -0
- package/skills/oma-frontend/resources/checklist.md +76 -0
- package/skills/oma-frontend/resources/error-playbook.md +125 -0
- package/skills/oma-frontend/resources/execution-protocol.md +46 -0
- package/skills/oma-frontend/resources/snippets.md +354 -0
- package/skills/oma-frontend/resources/specialized-visual-implementation.md +193 -0
- package/skills/oma-frontend/resources/tailwind-rules.md +83 -0
- package/skills/oma-frontend/resources/tech-stack.md +156 -0
- package/skills/oma-hwp/SKILL.md +166 -0
- package/skills/oma-hwp/config/hwp-config.yaml +35 -0
- package/skills/oma-hwp/resources/balanced-tables.ts +39 -0
- package/skills/oma-hwp/resources/execution-protocol.md +145 -0
- package/skills/oma-hwp/resources/flatten-tables.ts +101 -0
- package/skills/oma-hwp/resources/package.json +13 -0
- package/skills/oma-hwp/resources/troubleshooting.md +70 -0
- package/skills/oma-hwp/resources/tsconfig.json +10 -0
- package/skills/oma-hwp/resources/turndown-plugin-gfm.d.ts +9 -0
- package/skills/oma-image/SKILL.md +142 -0
- package/skills/oma-image/config/image-config.yaml +70 -0
- package/skills/oma-image/resources/checklist.md +18 -0
- package/skills/oma-image/resources/execution-protocol.md +117 -0
- package/skills/oma-image/resources/invocation.md +105 -0
- package/skills/oma-image/resources/prompt-tips.md +71 -0
- package/skills/oma-image/resources/vendor-matrix.md +90 -0
- package/skills/oma-market/SKILL.md +142 -0
- package/skills/oma-market/resources/checklist.md +12 -0
- package/skills/oma-market/resources/error-playbook.md +12 -0
- package/skills/oma-market/resources/execution-protocol.md +60 -0
- package/skills/oma-market/resources/frameworks/pestel.md +101 -0
- package/skills/oma-market/resources/frameworks/porters-5f.md +90 -0
- package/skills/oma-market/resources/frameworks/swot.md +61 -0
- package/skills/oma-market/resources/intent-rules.md +35 -0
- package/skills/oma-market/resources/output-laws.md +53 -0
- package/skills/oma-mobile/SKILL.md +168 -0
- package/skills/oma-mobile/resources/checklist.md +77 -0
- package/skills/oma-mobile/resources/error-playbook.md +198 -0
- package/skills/oma-mobile/resources/execution-protocol.md +47 -0
- package/skills/oma-mobile/resources/screen-template.dart +331 -0
- package/skills/oma-mobile/resources/screen-template.swift +239 -0
- package/skills/oma-mobile/resources/screen-template.tsx +179 -0
- package/skills/oma-mobile/resources/tech-stack.md +69 -0
- package/skills/oma-mobile/variants/README.md +45 -0
- package/skills/oma-mobile/variants/flutter/api-template.dart +461 -0
- package/skills/oma-mobile/variants/flutter/snippets.md +1353 -0
- package/skills/oma-mobile/variants/flutter/stack.yaml +21 -0
- package/skills/oma-mobile/variants/flutter/tech-stack.md +201 -0
- package/skills/oma-mobile/variants/kotlin-android/api-template.kt +182 -0
- package/skills/oma-mobile/variants/kotlin-android/snippets.md +871 -0
- package/skills/oma-mobile/variants/kotlin-android/stack.yaml +32 -0
- package/skills/oma-mobile/variants/kotlin-android/tech-stack.md +159 -0
- package/skills/oma-mobile/variants/react-native/api-template.ts +531 -0
- package/skills/oma-mobile/variants/react-native/snippets.md +1014 -0
- package/skills/oma-mobile/variants/react-native/stack.yaml +22 -0
- package/skills/oma-mobile/variants/react-native/tech-stack.md +192 -0
- package/skills/oma-mobile/variants/stack.schema.json +68 -0
- package/skills/oma-mobile/variants/swift-ios/api-template.swift +165 -0
- package/skills/oma-mobile/variants/swift-ios/snippets.md +1028 -0
- package/skills/oma-mobile/variants/swift-ios/stack.yaml +25 -0
- package/skills/oma-mobile/variants/swift-ios/tech-stack.md +174 -0
- package/skills/oma-observability/SKILL.md +225 -0
- package/skills/oma-observability/resources/anti-patterns.md +555 -0
- package/skills/oma-observability/resources/boundaries/cross-application.md +348 -0
- package/skills/oma-observability/resources/boundaries/multi-tenant.md +290 -0
- package/skills/oma-observability/resources/boundaries/release.md +372 -0
- package/skills/oma-observability/resources/boundaries/slo.md +225 -0
- package/skills/oma-observability/resources/checklist.md +123 -0
- package/skills/oma-observability/resources/examples.md +448 -0
- package/skills/oma-observability/resources/execution-protocol.md +166 -0
- package/skills/oma-observability/resources/incident-forensics.md +348 -0
- package/skills/oma-observability/resources/intent-rules.md +307 -0
- package/skills/oma-observability/resources/layers/L3-network.md +281 -0
- package/skills/oma-observability/resources/layers/L4-transport.md +299 -0
- package/skills/oma-observability/resources/layers/L7-application/crash-analytics.md +359 -0
- package/skills/oma-observability/resources/layers/L7-application/mobile-rum.md +278 -0
- package/skills/oma-observability/resources/layers/L7-application/waf.md +246 -0
- package/skills/oma-observability/resources/layers/L7-application/web-rum.md +350 -0
- package/skills/oma-observability/resources/layers/mesh.md +368 -0
- package/skills/oma-observability/resources/matrix.md +177 -0
- package/skills/oma-observability/resources/meta-observability.md +605 -0
- package/skills/oma-observability/resources/observability-as-code.md +666 -0
- package/skills/oma-observability/resources/signals/audit.md +310 -0
- package/skills/oma-observability/resources/signals/cost.md +303 -0
- package/skills/oma-observability/resources/signals/logs.md +263 -0
- package/skills/oma-observability/resources/signals/metrics.md +478 -0
- package/skills/oma-observability/resources/signals/privacy.md +351 -0
- package/skills/oma-observability/resources/signals/profiles.md +245 -0
- package/skills/oma-observability/resources/signals/traces.md +360 -0
- package/skills/oma-observability/resources/standards.md +214 -0
- package/skills/oma-observability/resources/transport/collector-topology.md +308 -0
- package/skills/oma-observability/resources/transport/otlp-grpc-vs-http.md +256 -0
- package/skills/oma-observability/resources/transport/sampling-recipes.md +297 -0
- package/skills/oma-observability/resources/transport/udp-statsd-mtu.md +167 -0
- package/skills/oma-observability/resources/vendor-categories.md +352 -0
- package/skills/oma-orchestration/SKILL.md +302 -0
- package/skills/oma-orchestration/config/cli-config.yaml +92 -0
- package/skills/oma-orchestration/resources/memory-schema.md +232 -0
- package/skills/oma-orchestration/resources/subagent-prompt-template.md +30 -0
- package/skills/oma-orchestration/scripts/parallel-run.sh +6 -0
- package/skills/oma-orchestration/scripts/spawn-agent.sh +5 -0
- package/skills/oma-orchestration/scripts/verify.sh +20 -0
- package/skills/oma-orchestration/templates/backend-task.md +19 -0
- package/skills/oma-orchestration/templates/debug-task.md +16 -0
- package/skills/oma-orchestration/templates/frontend-task.md +18 -0
- package/skills/oma-orchestration/templates/mobile-task.md +18 -0
- package/skills/oma-orchestration/templates/qa-task.md +16 -0
- package/skills/oma-orchestration/templates/tasks-example.yaml +15 -0
- package/skills/oma-pdf/SKILL.md +162 -0
- package/skills/oma-pdf/config/pdf-config.yaml +27 -0
- package/skills/oma-pdf/resources/execution-protocol.md +127 -0
- package/skills/oma-pm/SKILL.md +157 -0
- package/skills/oma-pm/resources/error-playbook.md +75 -0
- package/skills/oma-pm/resources/examples.md +439 -0
- package/skills/oma-pm/resources/execution-protocol.md +62 -0
- package/skills/oma-pm/resources/iso-planning.md +110 -0
- package/skills/oma-pm/resources/plan-phase-protocol.md +66 -0
- package/skills/oma-pm/resources/task-template.json +86 -0
- package/skills/oma-qa/SKILL.md +141 -0
- package/skills/oma-qa/resources/checklist.md +339 -0
- package/skills/oma-qa/resources/error-playbook.md +98 -0
- package/skills/oma-qa/resources/execution-protocol.md +169 -0
- package/skills/oma-qa/resources/iso-quality.md +82 -0
- package/skills/oma-qa/resources/verify-ship-protocol.md +116 -0
- package/skills/oma-recap/SKILL.md +245 -0
- package/skills/oma-recap/resources/output-formats.md +83 -0
- package/skills/oma-refactor/SKILL.md +184 -0
- package/skills/oma-refactor/resources/definition.md +108 -0
- package/skills/oma-refactor/resources/governance.md +33 -0
- package/skills/oma-refactor/resources/hotspots.py +44 -0
- package/skills/oma-refactor/resources/measurement.md +93 -0
- package/skills/oma-scholar/SKILL.md +276 -0
- package/skills/oma-scholar/config/scholar-config.yaml +79 -0
- package/skills/oma-scholar/resources/api-endpoints.md +174 -0
- package/skills/oma-scholar/resources/checklist.md +92 -0
- package/skills/oma-scholar/resources/execution-protocol.md +224 -0
- package/skills/oma-scholar/resources/fallback-providers.md +143 -0
- package/skills/oma-scholar/resources/setup-openalex.md +85 -0
- package/skills/oma-scholar/resources/sidecar-spec.md +341 -0
- package/skills/oma-scholar/resources/upstream-spec-cache.md +972 -0
- package/skills/oma-scm/SKILL.md +103 -0
- package/skills/oma-scm/resources/cm-operations.md +56 -0
- package/skills/oma-scm/resources/codeowners-playbook.md +45 -0
- package/skills/oma-scm/resources/conventional-commits.md +108 -0
- package/skills/oma-scm/resources/merge-risk.md +76 -0
- package/skills/oma-scm/resources/onboarding-risk-signals.md +71 -0
- package/skills/oma-search/SKILL.md +125 -0
- package/skills/oma-search/resources/checklist.md +36 -0
- package/skills/oma-search/resources/error-playbook.md +66 -0
- package/skills/oma-search/resources/examples.md +80 -0
- package/skills/oma-search/resources/execution-protocol.md +86 -0
- package/skills/oma-search/resources/intent-rules.md +47 -0
- package/skills/oma-search/resources/trust-registry.md +53 -0
- package/skills/oma-security/SKILL.md +172 -0
- package/skills/oma-security/resources/artex.md +108 -0
- package/skills/oma-security/resources/ci.md +134 -0
- package/skills/oma-security/resources/cisco-source.md +108 -0
- package/skills/oma-security/resources/deepsec-config.md +45 -0
- package/skills/oma-security/resources/deepsec-matchers.md +35 -0
- package/skills/oma-security/resources/deepsec-scanning.md +45 -0
- package/skills/oma-security/resources/deepsec-setup.md +41 -0
- package/skills/oma-security/resources/findings-contract.md +408 -0
- package/skills/oma-security/resources/mcp-scanning.md +122 -0
- package/skills/oma-security/resources/skill-scanning.md +106 -0
- package/skills/oma-security/resources/validation.md +71 -0
- package/skills/oma-skill-creation/SKILL.md +84 -0
- package/skills/oma-skill-creation/resources/prompt-evaluation.md +36 -0
- package/skills/oma-skill-creation/resources/ssl-lite-template.md +108 -0
- package/skills/oma-skill-creation/resources/validation-checklist.md +101 -0
- package/skills/oma-slide/SKILL.md +277 -0
- package/skills/oma-slide/resources/animation-patterns.md +245 -0
- package/skills/oma-slide/resources/assets/deck-stage.js +514 -0
- package/skills/oma-slide/resources/assets/viewport-base.css +257 -0
- package/skills/oma-slide/resources/canva-integration.md +203 -0
- package/skills/oma-slide/resources/checklist.md +46 -0
- package/skills/oma-slide/resources/design-doctrine.md +260 -0
- package/skills/oma-slide/resources/fixed-stage.md +232 -0
- package/skills/oma-slide/resources/generation-protocol.md +393 -0
- package/skills/oma-slide/resources/native-pptx.md +84 -0
- package/skills/oma-slide/resources/selection-index.json +461 -0
- package/skills/oma-slide/resources/style-presets.LICENSE +10 -0
- package/skills/oma-slide/resources/style-presets.md +520 -0
- package/skills/oma-tf-infra/SKILL.md +201 -0
- package/skills/oma-tf-infra/resources/checklist.md +53 -0
- package/skills/oma-tf-infra/resources/cost-optimization.md +574 -0
- package/skills/oma-tf-infra/resources/error-playbook.md +68 -0
- package/skills/oma-tf-infra/resources/examples.md +38 -0
- package/skills/oma-tf-infra/resources/execution-protocol.md +129 -0
- package/skills/oma-tf-infra/resources/iso-42001-infra.md +229 -0
- package/skills/oma-tf-infra/resources/multi-cloud-examples.md +241 -0
- package/skills/oma-tf-infra/resources/policy-testing-examples.md +332 -0
- package/skills/oma-translation/SKILL.md +229 -0
- package/skills/oma-translation/resources/anti-ai-patterns.md +104 -0
- package/skills/oma-translation/resources/lang/_template.md +73 -0
- package/skills/oma-translation/resources/lang/en.md +123 -0
- package/skills/oma-translation/resources/lang/ja.md +274 -0
- package/skills/oma-translation/resources/lang/ko.md +228 -0
- package/skills/oma-translation/resources/lang/zh.md +285 -0
- package/skills/oma-translation/resources/style-skills.md +104 -0
- package/skills/oma-translation/resources/translation-rubric.md +126 -0
- package/skills/oma-video/SKILL.md +229 -0
- package/skills/oma-video/config/video-config.yaml +60 -0
- package/skills/oma-video/resources/checklist.md +26 -0
- package/skills/oma-video/resources/execution-protocol.md +122 -0
- package/skills/oma-video/resources/existing-media.md +185 -0
- package/skills/oma-video/resources/hyperframes-authoring/README.md +44 -0
- package/skills/oma-video/resources/hyperframes-authoring/demo.md +31 -0
- package/skills/oma-video/resources/hyperframes-authoring/explainer.md +10 -0
- package/skills/oma-video/resources/hyperframes-authoring/shorts.md +10 -0
- package/skills/oma-video/resources/motion-principles.md +81 -0
- package/skills/oma-video/resources/mpt/driver.py +301 -0
- package/skills/oma-video/resources/prompt-tips.md +75 -0
- package/skills/oma-video/resources/script-schema.md +81 -0
- package/skills/oma-video/resources/sound-design.md +127 -0
- package/skills/oma-video/resources/strudel/package.json +11 -0
- package/skills/oma-video/resources/strudel/page.html +87 -0
- package/skills/oma-video/resources/strudel/render.mjs +295 -0
- package/skills/oma-video/resources/vendor-matrix.md +124 -0
- package/skills/oma-voice/SKILL.md +249 -0
- package/skills/oma-voice/config/voice-config.yaml +30 -0
- package/skills/oma-voice/resources/audio-processing.md +119 -0
- package/skills/oma-voice/resources/checklist.md +47 -0
- package/skills/oma-voice/resources/execution-protocol.md +215 -0
- package/skills/oma-voice/resources/prompt-tips.md +43 -0
- package/skills/oma-voice/resources/voice-matrix.md +51 -0
- package/skills/oma-voice/resources/voicestudio.md +87 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Document Structure — oma-explanation
|
|
2
|
+
|
|
3
|
+
> The structural and rhetorical contract for all generated HTML explainer documents.
|
|
4
|
+
> Read this document to understand WHAT content is generated and in what tone.
|
|
5
|
+
> For HOW the HTML is styled and behaves, see `html-contract.md`.
|
|
6
|
+
|
|
7
|
+
> **Authoring path**: write a draft and render it with `oma explain render` (see
|
|
8
|
+
> `draft-format.md`). The four sections below become panels in the same order; the renderer
|
|
9
|
+
> supplies the page shell, so the TOC and diagram-markup rules in sections 1 and 6 apply
|
|
10
|
+
> literally only to the hand-written HTML fallback. Topic-mode pages follow `draft-format.md`
|
|
11
|
+
> and are not bound to the four sections.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. Overall Shape
|
|
16
|
+
|
|
17
|
+
Every explainer document must be a **single long scrolling page**.
|
|
18
|
+
Do **not** use top-level tabs or multi-page navigation.
|
|
19
|
+
The document must begin with a Table of Contents (TOC), followed strictly by these four fixed sections in order:
|
|
20
|
+
1. **Background**
|
|
21
|
+
2. **Intuition**
|
|
22
|
+
3. **Code**
|
|
23
|
+
4. **Quiz**
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Background
|
|
28
|
+
|
|
29
|
+
The Background section establishes context before presenting any code changes. It is composed of two tiers:
|
|
30
|
+
|
|
31
|
+
- **Tier A (Deep Background)**: Broadly explains the surrounding system or architecture. Must be explicitly marked "skippable if you already know the system."
|
|
32
|
+
- **Tier B (Narrow Background)**: Directly explains the context relevant to the specific change.
|
|
33
|
+
|
|
34
|
+
*Note on Reader Level:* If the requested reader level is `reviewer`, aggressively condense Tier A (Deep Background).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 3. Intuition
|
|
39
|
+
|
|
40
|
+
The Intuition section conveys the core essence of the change without diving into full implementation details.
|
|
41
|
+
|
|
42
|
+
- **Toy-Data Examples**: Concrete toy-data examples are **mandatory**. Show, don't just tell, how the inputs and outputs change.
|
|
43
|
+
- **Visuals**: Liberally use diagrams (see Section 6) to establish mental models early.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 4. Code
|
|
48
|
+
|
|
49
|
+
The Code section is a high-level walkthrough of the changes.
|
|
50
|
+
|
|
51
|
+
- **Comprehension Order**: Group and order the code walkthrough for human comprehension. Do **not** simply list files in alphabetical or git-diff order.
|
|
52
|
+
- **Reference**: Reference code using `file:line` notation where useful.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 5. Quiz
|
|
57
|
+
|
|
58
|
+
The Quiz verifies understanding. While `html-contract.md` defines the interaction and JS behavior, this document governs question quality:
|
|
59
|
+
|
|
60
|
+
- **Count**: 5 questions by default (this count is parameterizable).
|
|
61
|
+
- **Difficulty**: Medium. Questions must be answerable only if the reader understood the substance of the change. No trick questions or gotchas.
|
|
62
|
+
- **Coverage**: Each question must target a distinct aspect of the change.
|
|
63
|
+
- **Distractors**: Wrong options (distractors) must be highly plausible.
|
|
64
|
+
- **Feedback**: **Every** option (correct and incorrect) must have accompanying feedback text explaining exactly why it is right or wrong.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 6. Diagram Families
|
|
69
|
+
|
|
70
|
+
Visual consistency is critical. Pick **2–3 diagram families** per document and **reuse** them across sections to build continuity.
|
|
71
|
+
|
|
72
|
+
### Family Catalog
|
|
73
|
+
Choose from the following conceptual families:
|
|
74
|
+
- **Simplified UI Mock**: Abstracted representation of what the user sees.
|
|
75
|
+
- **System/Data-Flow Diagram**: Component interaction flows carrying **example data** directly on the arrows.
|
|
76
|
+
- **Before/After State**: Visual comparison of the system state before and after the change.
|
|
77
|
+
|
|
78
|
+
### Format & Responsiveness Constraints
|
|
79
|
+
- Diagrams must be rendered using **HTML/CSS** or **inline SVG** only.
|
|
80
|
+
- **ASCII art is strictly forbidden.**
|
|
81
|
+
- **Responsive Container**: Every diagram must be wrapped in a `<div class="diagram-wrapper">` container with `overflow-x: auto; max-width: 100%;` to prevent horizontal clipping on mobile devices (375px+). Inline SVGs must declare `viewBox` and responsive width (`width="100%"`).
|
|
82
|
+
- **Theme-Aware Colors**: All diagram elements (borders, text, arrows, node backgrounds) MUST use CSS variables (e.g. `var(--border-color)`, `var(--text-primary)`) or `currentColor` rather than hardcoded hex colors, ensuring seamless adaptation to Dark/Light theme toggling.
|
|
83
|
+
- **Accessibility (a11y)**: Diagrams must include `role="img"` and a descriptive `aria-label` or `<title>` element summarizing the diagram flow for assistive technologies.
|
|
84
|
+
- Use semantic HTML lists (`<ul>`, `<ol>`, `<dl>`) for textual lists.
|
|
85
|
+
- **archify sidecar (optional)**: an interactive archify diagram is a *separate* `.archify.html` file linked by a plain `<a href>` — it is never embedded (no `<iframe>` / `<object>` / `<script src>`), and the inline SVG/CSS diagram above stays in place so the explainer remains complete offline. See `_shared/conditional/diagram-engine.md`.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 7. Callouts
|
|
90
|
+
|
|
91
|
+
Use styled callout blocks to highlight:
|
|
92
|
+
- Key concepts and definitions.
|
|
93
|
+
- Important edge cases and gotchas.
|
|
94
|
+
|
|
95
|
+
These should visually interrupt the prose to draw the reader's attention to critical information.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 8. Writing Style and Language
|
|
100
|
+
|
|
101
|
+
The explainer must read with authoritative clarity, smooth transitions between sections, and an engaging tone.
|
|
102
|
+
|
|
103
|
+
- **English Prose**: Aim for Martin Kleppmann-like clarity. Classic style, engaging, logically rigorous but accessible.
|
|
104
|
+
- **Punctuation restraint**: Em-dashes are limited to a handful per document. Prefer commas, colons, parentheses, or a second sentence. CJK prose avoids em-dashes entirely (mirrors the repo's `cjk-em-dash` lint rule for translated docs).
|
|
105
|
+
- **CJK Output**: Follow the `translation_voice` register configured in `.agents/oma-config.yaml`.
|
|
106
|
+
- **i18n Rules**: Prose and quiz content must be in the user's requested language. However, following `.agents/rules/i18n-guide.md`, **code blocks, identifiers, and inline code are always in English**. Do not translate technical terms or variable names.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 9. Provenance Footer
|
|
111
|
+
|
|
112
|
+
Every document must end with a provenance footer containing:
|
|
113
|
+
- **Generated-from reference**: The commit range, PR number, or branch used as input.
|
|
114
|
+
- **Generation Date**: The date in the oma-config `timezone`, falling back to the system timezone when unset.
|
|
115
|
+
- **Excluded Files**: If the diff was oversized and files were dropped, list the excluded files in a footnote. Never silently truncate.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Draft Format — `oma explain render`
|
|
2
|
+
|
|
3
|
+
> The authoring contract for explanations. You write a Markdown draft; `oma explain render`
|
|
4
|
+
> turns it into the HTML page. You never write HTML, CSS, SVG, or coordinates.
|
|
5
|
+
> For WHAT a change explainer must contain, see `document-structure.md`.
|
|
6
|
+
|
|
7
|
+
## 1. Why a draft
|
|
8
|
+
|
|
9
|
+
Layout, theme, diagram geometry, responsiveness, escaping, and the quiz script are the
|
|
10
|
+
renderer's job. They are the same on every page and they are tested. Your job is the content:
|
|
11
|
+
which panels exist, what each one says, and which relations a diagram shows.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
oma explain render draft.md # → .agents/results/explain/{YYYY-MM-DD}-{slug}.html
|
|
15
|
+
oma explain render - < draft.md # draft from stdin
|
|
16
|
+
oma explain components # list the components
|
|
17
|
+
oma explain components flow # one component's syntax and example
|
|
18
|
+
oma explain lint draft.md # prose check only, no page
|
|
19
|
+
oma explain patch <page.html> --panel C panel.md # replace one panel, keep the rest
|
|
20
|
+
oma explain patch <page.html> --panel "Call order" panel.md # or name it by title
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Write the draft to a scratch location (or pipe it); the HTML is the artifact, and it embeds
|
|
24
|
+
the draft so a later `patch` needs nothing else.
|
|
25
|
+
|
|
26
|
+
## 2. Shape of a draft
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
---
|
|
30
|
+
title: How the row planner fills a page # required (or start the body with "# Title")
|
|
31
|
+
subtitle: One sentence that says what the reader will know afterwards
|
|
32
|
+
slug: row-planner # file name; required when the title is not ASCII
|
|
33
|
+
template: sheet # sheet = grid of panels (default) | doc = one column with contents
|
|
34
|
+
theme: blueprint # blueprint (default) | card; the reader can switch on the page
|
|
35
|
+
mode: auto # auto (default) | light | dark
|
|
36
|
+
cols: 3 # grid the span hints refer to, 1-12
|
|
37
|
+
style: warn # prose check: off | warn (default) | strict
|
|
38
|
+
Scope: cli/commands/explain/render # any other key shows in the header meta line
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
One or two lead sentences: the answer first.
|
|
42
|
+
|
|
43
|
+
## Panel title {span=2 note="12 nodes"}
|
|
44
|
+
|
|
45
|
+
Markdown prose, lists, tables, and component blocks.
|
|
46
|
+
|
|
47
|
+
## Next panel
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- One `## ` heading starts one panel. Panels get letters A, B, C in order; a heading may
|
|
51
|
+
give its own (`## C Title`, `## B1 Title`), and ids must not repeat.
|
|
52
|
+
- Panel attributes, all optional: `span=N` (width hint in grid columns; `span` equal to `cols`
|
|
53
|
+
keeps the panel on its own row), `rows=N` (height in the plain grid), `note="…"` (small text
|
|
54
|
+
at the right of the head), `bare` (no head), `archify` (this panel's diagram feeds the
|
|
55
|
+
interactive sidecar, see section 5).
|
|
56
|
+
- You do not place panels. The page measures every panel and packs rows so they fill the
|
|
57
|
+
width with the least blank space, keeps the diagrams of one page at similar scales, and
|
|
58
|
+
falls back to one column on a phone. A wide table or diagram gets a wider span by itself,
|
|
59
|
+
so write `span` only for a panel that must stand out.
|
|
60
|
+
- `template: sheet` suits an overview read at a glance: 4 to 9 panels. `template: doc` suits
|
|
61
|
+
a linear explanation read top to bottom; it adds a contents list from three panels up.
|
|
62
|
+
- One idea per panel: a diagram with two sentences beats a wall of text.
|
|
63
|
+
- Prose is GitHub-flavoured Markdown, parsed by remark: `###` headings, nested and task
|
|
64
|
+
lists, tables with alignment, quotes, rules, links (inline or reference style), footnotes. An image shows only as a `data:` URI; any other image
|
|
65
|
+
becomes a link, because the page loads nothing from outside.
|
|
66
|
+
|
|
67
|
+
## 3. Components
|
|
68
|
+
|
|
69
|
+
A fenced block named after a component renders that component. Any other fence
|
|
70
|
+
(`ts`, `bash`, `json`, …) is shown as code; `diff` colours added and removed lines.
|
|
71
|
+
|
|
72
|
+
| Component | Use it for | Draft content |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| `flow` | architecture, pipelines, decisions | relations: `A -> B: label`, `group Name: A, B` |
|
|
75
|
+
| `sequence` | calls between actors over time | `From -> To: message`, `note A, B: text`, `== Phase ==` |
|
|
76
|
+
| `tree` | org chart, breakdown, file tree | indented names, `label \| note`, `*highlight` |
|
|
77
|
+
| `timeline` | history, phases, rollout | `when \| title \| detail`, `*when` for the key event |
|
|
78
|
+
| `limits` | a value against its limit | `label \| value / limit \| unit` |
|
|
79
|
+
| `annot` | a command or line of code, part by part | `[span]{note}`, `[span]{!wrong}` |
|
|
80
|
+
| `kv` | facts as a grid, or a title block | `key: value`, `* wide key: value`, `cols=N` |
|
|
81
|
+
| `callout` | the one point not to miss | `callout info\|ok\|warn\|err\|key Title` + Markdown |
|
|
82
|
+
| `quiz` | comprehension check | `? question`, `- wrong`, `+ right`, `> feedback` |
|
|
83
|
+
|
|
84
|
+
Run `oma explain components <name>` for the exact grammar before the first use in a session.
|
|
85
|
+
The essentials:
|
|
86
|
+
|
|
87
|
+
````markdown
|
|
88
|
+
```flow LR
|
|
89
|
+
(User) -> API -> Service* -> [(Orders DB)]
|
|
90
|
+
Service --> Queue: order.created
|
|
91
|
+
{Valid?} -> Service: yes
|
|
92
|
+
group Backend: API, Service
|
|
93
|
+
```
|
|
94
|
+
````
|
|
95
|
+
|
|
96
|
+
- `->` solid, `-->` dashed. A chain creates its nodes. `A -> B & C` fans out.
|
|
97
|
+
- Shapes: `(pill)` for actors and endpoints, `{diamond}` for decisions, `[(cylinder)]` for
|
|
98
|
+
stores, plain text or `[box]` for everything else. A `*` before the name marks the node
|
|
99
|
+
the panel is about. `name = Long label` gives a long label a short name.
|
|
100
|
+
- `group Name: A, B` frames related nodes. The layout keeps every other node out of the frame.
|
|
101
|
+
- A node name that holds a colon goes in brackets: `[step: one]`.
|
|
102
|
+
- Write relations only. Do not order lines to "place" nodes, and never use ASCII art.
|
|
103
|
+
- Keep a diagram under about 12 nodes and labels under about 20 characters. Split it otherwise.
|
|
104
|
+
- Put example data on the arrows (`: {sid, kind}`) when the data is the point.
|
|
105
|
+
|
|
106
|
+
````markdown
|
|
107
|
+
```sequence num
|
|
108
|
+
participants: Client, Server
|
|
109
|
+
Client -> Server: SYN
|
|
110
|
+
Server --> Client: SYN-ACK
|
|
111
|
+
== Established ==
|
|
112
|
+
note Client, Server: both sides can send
|
|
113
|
+
```
|
|
114
|
+
````
|
|
115
|
+
|
|
116
|
+
- `participants:` fixes the left-to-right order; `num` numbers the messages; `== Title ==`
|
|
117
|
+
starts a phase; a note may span several participants.
|
|
118
|
+
|
|
119
|
+
`tree` picks its shape from the content: one root with 2 to 4 children draws an org chart,
|
|
120
|
+
several roots stand side by side, and a file tree (`src/`, `main.ts`) or the `list` argument
|
|
121
|
+
gives an indented list. `timeline` runs left to right up to six events and top to bottom
|
|
122
|
+
beyond (`h` / `v` force it).
|
|
123
|
+
|
|
124
|
+
Fullwidth punctuation works wherever a colon or comma separates fields (`:`, `,`), so a
|
|
125
|
+
Chinese, Japanese, or Korean draft needs no switch of input mode.
|
|
126
|
+
|
|
127
|
+
Tables: a cell that starts with `ok`, `no`, or `warn` becomes a status badge
|
|
128
|
+
(`| Retry | ok idempotent |`). Use this for comparisons and before/after tables.
|
|
129
|
+
|
|
130
|
+
Text is always shown as written. `<sid>`, `<T>`, and HTML in a draft appear as characters;
|
|
131
|
+
nothing in a draft can inject markup.
|
|
132
|
+
|
|
133
|
+
## 4. Writing
|
|
134
|
+
|
|
135
|
+
The renderer checks the prose (`style: warn` prints warnings, `strict` fails the render):
|
|
136
|
+
|
|
137
|
+
- One fact per sentence. English: at most 25 words (20 in a numbered step). Korean: about
|
|
138
|
+
70 characters. Japanese 65, Chinese 45. At most 6 sentences in a paragraph.
|
|
139
|
+
- Plain words: "use", not "utilize"; "to", not "in order to". Name who does what instead of
|
|
140
|
+
the passive.
|
|
141
|
+
- Korean: no double passive (`되어진`, `보여지다`), no translationese (`~에 있어서`,
|
|
142
|
+
`~로부터`, `~하는 것이 가능하다`, `~에 의해`), verbs instead of `~을 수행/진행하다`, and
|
|
143
|
+
correct spellings (`됐`, `며칠`).
|
|
144
|
+
- Chinese: no light verbs (`进行验证` → `验证`), no clichés (`赋能`, `闭环`), numbers
|
|
145
|
+
instead of `若干` / `尽快`, and `大于` / `不小于` instead of `10 次以上`.
|
|
146
|
+
- Japanese: `できる` instead of `することができる`, the verb instead of `〜を行う`.
|
|
147
|
+
- The page language is detected from the draft (Hangul → Korean). Set `lang:` only to override.
|
|
148
|
+
- Fix warnings by rewriting the sentence, not by turning the check off. Counter-examples go
|
|
149
|
+
in `~~strikethrough~~` or a table row marked `no`; those are not checked.
|
|
150
|
+
|
|
151
|
+
When the render fails, the error names the draft line and prints the component's syntax and
|
|
152
|
+
an example. Fix that line and render again.
|
|
153
|
+
|
|
154
|
+
## 5. archify sidecar
|
|
155
|
+
|
|
156
|
+
`flow` and `sequence` blocks already hold a typed graph, so the renderer derives the archify
|
|
157
|
+
spec itself:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
oma explain render draft.md --archify # or diagram.explain_sidecar: true in oma-config
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- Source diagram: the first flow/sequence block of the panel marked `{archify}`, else the
|
|
164
|
+
first one in the draft. Mark the panel whose diagram is the main picture.
|
|
165
|
+
- Output: `{stem}.archify.html` (and `.archify.json`) next to the page, linked by a plain
|
|
166
|
+
anchor under that panel and in the footer. Never embedded.
|
|
167
|
+
- `flow` becomes an archify `architecture` grid and its groups become boundaries; `sequence`
|
|
168
|
+
becomes an archify `sequence` and its `== Phase ==` dividers become segments. Component
|
|
169
|
+
types come from the label and shape: name stores, queues, users, and UI as what they are.
|
|
170
|
+
- A sidecar is an extra. If archify is not installed, the diagram is too small, or
|
|
171
|
+
`deliver` fails, the page is still written and the report says why. Do not hand-author a
|
|
172
|
+
spec to work around it unless the user asks; `--no-archify` skips it.
|
|
173
|
+
|
|
174
|
+
## 6. Change explainer drafts
|
|
175
|
+
|
|
176
|
+
For a diff / PR / branch (`document-structure.md`), set `template: doc` and write the four
|
|
177
|
+
sections as panels in this order:
|
|
178
|
+
|
|
179
|
+
1. **Background** panels: surrounding system (say it is skippable), then the narrow context.
|
|
180
|
+
A `flow` or `tree` usually carries the first one.
|
|
181
|
+
2. **Intuition** panels: toy data in a table or on `flow` / `sequence` arrows; before/after
|
|
182
|
+
as a table with `no` / `ok` cells.
|
|
183
|
+
3. **Code** panels in comprehension order: a `diff` (or language) fence per step, with
|
|
184
|
+
`file:line` in the panel `note` or the sentence above it. `annot` for a single line that
|
|
185
|
+
deserves a part-by-part reading.
|
|
186
|
+
4. **Quiz** panel: one `quiz` block, 5 questions by default, feedback (`>`) on every option.
|
|
187
|
+
|
|
188
|
+
Add the provenance facts as frontmatter keys (`Source: PR #640`, `Excluded: bun.lock`), so
|
|
189
|
+
they show in the header.
|
|
190
|
+
|
|
191
|
+
## 7. After rendering
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
oma explain validate <file>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The renderer already guarantees the self-contained rule, `<pre>` code containers, themes,
|
|
198
|
+
focus states, and the quiz behaviour. The validator still matters for what you control:
|
|
199
|
+
the file name and secrets quoted in prose or code.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# HTML Explainer Contract
|
|
2
|
+
|
|
3
|
+
This resource specifies HOW the generated HTML file behaves and is validated. For content requirements, refer to the sibling `document-structure.md` file.
|
|
4
|
+
|
|
5
|
+
> Pages made by `oma explain render` meet sections 1–5 by construction (inline CSS and
|
|
6
|
+
> script under a `default-src 'none'` policy, `<pre>` code, light/dark themes, shuffled quiz
|
|
7
|
+
> with per-option feedback). For those pages this contract reduces to section 6
|
|
8
|
+
> (`oma explain validate`) and section 7 (secret gates). Sections 1–5 remain the rules for
|
|
9
|
+
> hand-written HTML.
|
|
10
|
+
|
|
11
|
+
## 1. Self-contained Rule
|
|
12
|
+
The generated HTML file MUST make ZERO external resource loads.
|
|
13
|
+
- No CDN scripts or stylesheets.
|
|
14
|
+
- No webfonts.
|
|
15
|
+
- No external images (use inline SVG or data URIs).
|
|
16
|
+
- Must open correctly offline via `file://`.
|
|
17
|
+
- **Note:** Hyperlink anchors (`<a href="https://...">`) ARE allowed. The ban covers resource-LOADING only.
|
|
18
|
+
|
|
19
|
+
## 2. Code Blocks
|
|
20
|
+
- All code blocks must use `<pre>` tags.
|
|
21
|
+
- Any custom-styled container holding code MUST declare `white-space: pre-wrap` (or `pre`).
|
|
22
|
+
- Do NOT use external syntax-highlighting libraries. Use plain theme-aware colors only.
|
|
23
|
+
|
|
24
|
+
## 3. Font Stack
|
|
25
|
+
The `Self-contained rule` supersedes any webfont suggestion in the project `design.md`. Use the following font stack:
|
|
26
|
+
1. Locally installed Pretendard, matched by family name — NOT the CSS `local()` function, which is only valid inside `@font-face src` (see the code comment below)
|
|
27
|
+
2. System CJK fonts (`Apple SD Gothic Neo` / `Noto Sans CJK`)
|
|
28
|
+
3. `system-ui` stack
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
/* Locally installed Pretendard resolves by family name; local() is only valid
|
|
32
|
+
inside @font-face src, so never use it in font-family. */
|
|
33
|
+
font-family: Pretendard, 'Pretendard Variable', 'Apple SD Gothic Neo', 'Noto Sans CJK KR', 'Noto Sans CJK JP', 'Noto Sans CJK SC', 'Noto Sans CJK TC', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 4. Layout and Accessibility (a11y)
|
|
37
|
+
- **Responsive:** Mobile-first, responsive from 375px up.
|
|
38
|
+
- **Readable Measure & Line Height:** Body text containers MUST enforce a max-width (800px–880px / ~75ch) with centered margin (`margin: 0 auto`) and generous line-height (`1.6`–`1.7`) to prevent wide-screen line stretching and ensure optimal reading rhythm.
|
|
39
|
+
- **Diagram Visuals:** Every diagram/visual MUST be wrapped in a `<div class="diagram-wrapper">` with `overflow-x: auto; max-width: 100%;` and use SVG `viewBox` / CSS variables (`var(...)`) to prevent mobile clipping and guarantee seamless Dark/Light theme switching.
|
|
40
|
+
- **Contrast:** WCAG AA contrast in BOTH light and dark themes.
|
|
41
|
+
- **Dark Mode:** Must support `prefers-color-scheme: dark` as well as explicit manual theme toggling via data attributes.
|
|
42
|
+
- **Motion:** Animations are optional and must be subtle.
|
|
43
|
+
- **Focus States:** Visible focus states are required on all interactive elements.
|
|
44
|
+
|
|
45
|
+
## 5. Quiz JS Specification
|
|
46
|
+
- Use **Vanilla JS only** (no frameworks).
|
|
47
|
+
- Options must be rendered as `<button>` elements.
|
|
48
|
+
- Clicking an option (or using Enter/Space) must reveal correct/incorrect immediately.
|
|
49
|
+
- Include per-option feedback text (explain *why* wrong answers are wrong).
|
|
50
|
+
- Feedback must be announced via an `aria-live="polite"` region for screen readers.
|
|
51
|
+
- Quiz data lives in a JS array of `{question, options: [{text, correct, feedback}]}` objects. Options are shuffled client-side (Fisher-Yates) on EVERY page load, so positions change on each refresh and no position bias can survive. Feedback stays attached to its option object, never to a rendered position, and option labels (A/B/C/D) are assigned after the shuffle.
|
|
52
|
+
- Display a final score summary at the end of the quiz.
|
|
53
|
+
- The entire quiz must be fully keyboard-navigable.
|
|
54
|
+
|
|
55
|
+
## 6. Validation Checklist (Post-generation)
|
|
56
|
+
Use `oma explain validate <file>` as the primary post-generation check. Review its reported content and structure failures. The grep commands below are supplemental spot checks; a zero-match result does not replace the validator or review of actual secret values in code excerpts.
|
|
57
|
+
Loop: fix and re-validate at most **3 iterations**, then STOP and surface the failing items to the user.
|
|
58
|
+
|
|
59
|
+
**Known false positives — do not "fix" example code.** A hit located inside a `<pre>` block that merely *quotes* a matching pattern as illustrative text (a commented-out `@import` in a "what not to do" snippet, an example `api_key` in a config walkthrough) is not a live resource load or a real secret. Log such hits as reviewed false positives in the provenance footer instead of mangling the example, and do not count them against the 3-iteration budget. Live `<head>` / `<script src>` references and actual secret values must still be fixed or gated. Do not treat every `<pre>` or `<code>` value as a false positive: actual credentials are still secrets when quoted.
|
|
60
|
+
|
|
61
|
+
- **No external resource loads** (zero matches required):
|
|
62
|
+
```bash
|
|
63
|
+
grep -E -i 'src="http|<link rel="stylesheet" href="http|@import|url\(http' {file}
|
|
64
|
+
```
|
|
65
|
+
- **Code containers compliance** (must match if code exists):
|
|
66
|
+
```bash
|
|
67
|
+
grep -E -i '<pre|white-space:\s*pre|white-space:\s*pre-wrap' {file}
|
|
68
|
+
```
|
|
69
|
+
- **Quiz script presence** (must match; `[ >]` covers attributed tags like `<script type="module">`):
|
|
70
|
+
```bash
|
|
71
|
+
grep -i -E '<script[ >]' {file}
|
|
72
|
+
```
|
|
73
|
+
- **Filename matches format** (the pattern is anchored, so check the basename, not the full path):
|
|
74
|
+
Ensure filename follows `{YYYY-MM-DD}-{slug}.html` with the date in the oma-config `timezone` (system timezone when unset).
|
|
75
|
+
```bash
|
|
76
|
+
basename "{file}" | grep -E '^[0-9]{4}-[0-9]{2}-[0-9]{2}-.+\.html$'
|
|
77
|
+
```
|
|
78
|
+
- **Final-HTML secret scan** (zero matches required, see §7):
|
|
79
|
+
```bash
|
|
80
|
+
grep -E -i '(api_key|api-key|secret|password|token|private[-_]key|connection[-_]string)\s*[=:]\s*["'\'']?[A-Za-z0-9\-_]{16,}["'\'']?' {file}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 7. Secret Gates
|
|
84
|
+
Secrets must be gated at two stages:
|
|
85
|
+
1. **Pre-generation:** Scan the collected diff.
|
|
86
|
+
2. **Post-generation:** Scan the final HTML (as background prose may quote unchanged files, the diff scan alone is insufficient).
|
|
87
|
+
|
|
88
|
+
### Secret Patterns
|
|
89
|
+
*Note: the excluded-file globs below mirror `EXCLUDED_FILE_PATTERNS` in `cli/commands/docs/sync-propose.ts` — when those globs diverge, that file wins. Content checks are implemented in `cli/commands/explain/validate.ts` and include assigned secret-like values and vendor token patterns. The minimal regex below is a supplemental diff check; the current CLI implementation defines the HTML validation behavior.*
|
|
90
|
+
|
|
91
|
+
Mirroring a MINIMAL pattern set for secret-like literal values (API keys, tokens, private keys, passwords, connection strings):
|
|
92
|
+
- **Excluded Files:** `.env`, `.env.*`, `*.pem`, `*.key`, `id_rsa`, `id_rsa*`
|
|
93
|
+
- **Regex Pattern:** `(api_key|api-key|secret|password|token|private[-_]key|connection[-_]string)\s*[=:]\s*["']?[A-Za-z0-9\-_]{16,}["']?`
|
|
94
|
+
(canonical pattern — the embedded quotes break naive single-quoted shell pasting; run it via the pre-escaped §6 "final-HTML secret scan" invocation)
|
|
95
|
+
|
|
96
|
+
**On Any Hit:**
|
|
97
|
+
- **STOP** immediately.
|
|
98
|
+
- Report the masked locations only (NEVER echo the actual value).
|
|
99
|
+
- Redacted continuation requires explicit user confirmation.
|
|
100
|
+
|
|
101
|
+
## 8. Sharing Caution
|
|
102
|
+
**Caution (informational, for the operator):** the artifact embeds code excerpts — treat it like source code when sharing externally. Embedding this caution inside the generated document itself is deferred to v2 (design 022 Tier 3); the generated footer's contract is `document-structure.md` §9 and does not include a sharing-caution line in v1.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oma-frontend
|
|
3
|
+
description: Implement or modify web UI in React, Next.js, or Angular. Use for
|
|
4
|
+
components, pages, styles, forms, and frontend state or data flows.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Frontend Agent - UI/UX Specialist
|
|
8
|
+
|
|
9
|
+
## Scheduling
|
|
10
|
+
|
|
11
|
+
### Goal
|
|
12
|
+
Build, modify, and verify React/Next.js or Angular TypeScript user interfaces that follow project architecture, design-system constraints, accessibility expectations, and existing frontend conventions.
|
|
13
|
+
|
|
14
|
+
### Intent signature
|
|
15
|
+
- User asks for UI, component, page, layout, CSS, Tailwind, shadcn, form, interaction, client state, or frontend API integration work.
|
|
16
|
+
- User needs browser-facing implementation in a React/Next.js or Angular TypeScript codebase.
|
|
17
|
+
- User asks for Angular component, directive, service, route, signal, or RxJS stream work.
|
|
18
|
+
|
|
19
|
+
### When to use
|
|
20
|
+
- Building user interfaces and components
|
|
21
|
+
- Client-side logic and state management
|
|
22
|
+
- Styling and responsive design
|
|
23
|
+
- Form validation and user interactions
|
|
24
|
+
- Integrating with backend APIs
|
|
25
|
+
|
|
26
|
+
### When NOT to use
|
|
27
|
+
- Backend API implementation → use Backend Agent
|
|
28
|
+
- Database access, migrations, or ORM setup → use Backend Agent
|
|
29
|
+
- Auth server setup (better-auth server library, DB adapters) → use Backend Agent
|
|
30
|
+
- Native mobile development → use Mobile Agent
|
|
31
|
+
|
|
32
|
+
### Expected inputs
|
|
33
|
+
- Target page, component, flow, or UI behavior
|
|
34
|
+
- Existing app structure, design tokens, component library, i18n files, and API contracts
|
|
35
|
+
- Acceptance criteria and target responsive states
|
|
36
|
+
|
|
37
|
+
### Expected outputs
|
|
38
|
+
- Frontend code changes in pages, components, hooks, styles, tests, or wrappers
|
|
39
|
+
- UI that respects project tokens, i18n, server/client boundaries, and accessibility expectations
|
|
40
|
+
- Verification results from relevant lint, typecheck, tests, or browser checks
|
|
41
|
+
|
|
42
|
+
### Dependencies
|
|
43
|
+
- React, Next.js, TypeScript, TailwindCSS v4, and `shadcn/ui` — or Angular + signals + RxJS in Angular projects (`resources/angular-rules.md`)
|
|
44
|
+
- Project sources of truth such as `packages/design-tokens`, `packages/i18n`, and shared utilities
|
|
45
|
+
- `resources/execution-protocol.md`, `resources/checklist.md`, snippets, and Tailwind rules
|
|
46
|
+
- Conditional visual implementation routes and shared interaction-quality guidance; load only for the affected capability.
|
|
47
|
+
|
|
48
|
+
### Control-flow features
|
|
49
|
+
- Branches by server/client component boundary, responsive state, component library availability, and i18n/token requirements
|
|
50
|
+
- Reads and writes frontend codebase files
|
|
51
|
+
- May call shadcn registry tools or local verification commands
|
|
52
|
+
|
|
53
|
+
## Structural Flow
|
|
54
|
+
|
|
55
|
+
### Entry
|
|
56
|
+
1. Identify target route, component, state boundary, and design-system constraints.
|
|
57
|
+
2. Read existing patterns before adding components or utilities.
|
|
58
|
+
3. Determine whether work belongs in Server Components, Client Components, wrappers, hooks, or styles.
|
|
59
|
+
|
|
60
|
+
### Scenes
|
|
61
|
+
1. **PREPARE**: Load relevant project conventions, UI requirements, and acceptance criteria.
|
|
62
|
+
2. **ACQUIRE**: Inspect existing components, tokens, i18n keys, APIs, and shadcn availability.
|
|
63
|
+
3. **ACT**: Implement UI, state, styles, validation, and integration.
|
|
64
|
+
4. **VERIFY**: Run checklist, automated checks, and browser/responsive validation when applicable.
|
|
65
|
+
5. **FINALIZE**: Summarize changed UI behavior and verification.
|
|
66
|
+
|
|
67
|
+
### Transitions
|
|
68
|
+
- If a strict shadcn primitive exists, use or wrap it before creating generic markup.
|
|
69
|
+
- If UI text is user-facing and i18n exists, add strings through the i18n source of truth.
|
|
70
|
+
- If interaction or hooks are needed, mark the boundary as Client Component.
|
|
71
|
+
- If backend contracts are missing, coordinate with backend/API planning.
|
|
72
|
+
- For a new or substantially changed admin console, dashboard, SaaS product UI, or internal tool, recommend a post-implementation `oma-design` review through `../oma-design/resources/product-interface-review.md`. This review is advisory unless the task explicitly requires design approval.
|
|
73
|
+
- For a requested GPU effect, video-scroll scene, or selected GSAP implementation, use the matching conditional extension.
|
|
74
|
+
|
|
75
|
+
### Failure and recovery
|
|
76
|
+
- If design tokens or i18n sources are missing, state assumptions and follow existing local patterns.
|
|
77
|
+
- If verification fails, fix before handoff or report the blocker.
|
|
78
|
+
- If required shadcn registry access fails, use existing local components or document fallback.
|
|
79
|
+
|
|
80
|
+
### Exit
|
|
81
|
+
- Success: UI works across target responsive states and passes relevant checks.
|
|
82
|
+
- Partial success: missing assets, backend contracts, or verification gaps are explicit.
|
|
83
|
+
|
|
84
|
+
## Logical Operations
|
|
85
|
+
|
|
86
|
+
### Actions
|
|
87
|
+
| Action | SSL primitive | Evidence |
|
|
88
|
+
|--------|---------------|----------|
|
|
89
|
+
| Inspect existing frontend patterns | `READ` | Components, routes, hooks, styles |
|
|
90
|
+
| Select component and state approach | `SELECT` | Server/client and shadcn workflow |
|
|
91
|
+
| Implement UI code | `WRITE` | TSX, CSS, hooks, wrappers |
|
|
92
|
+
| Validate form/data contracts | `VALIDATE` | Zod/forms/API schemas |
|
|
93
|
+
| Call shadcn or verification tools | `CALL_TOOL` | Registry, lint, typecheck, tests |
|
|
94
|
+
| Compare responsive states | `COMPARE` | Desktop/mobile behavior |
|
|
95
|
+
| Report result | `NOTIFY` | Final summary |
|
|
96
|
+
|
|
97
|
+
### Tools and instruments
|
|
98
|
+
- React, Next.js, TypeScript, TailwindCSS v4, shadcn/ui
|
|
99
|
+
- `ahooks` or `@mantine/hooks`, `es-toolkit`, `nuqs`, TanStack Query, Jotai/Zustand, TanStack React Form, `zod`
|
|
100
|
+
- Angular (standalone + signals), RxJS + `rxjs/testing` (`TestScheduler` marble tests) in Angular projects
|
|
101
|
+
- Lint, typecheck, tests, and browser inspection when applicable
|
|
102
|
+
|
|
103
|
+
### Canonical workflow path
|
|
104
|
+
Use the configured code-intelligence provider to locate files and inspect symbols
|
|
105
|
+
or content. For Serena, use `find_file`, `search_for_pattern`,
|
|
106
|
+
`get_symbols_overview`, and `find_symbol`. Native search is limited to the
|
|
107
|
+
provider exclusions and non-code paths permitted by the project's search policy.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
For a specialized visual capability, use `resources/specialized-visual-implementation.md`.
|
|
111
|
+
For affected motion, touch, component feedback, or interaction performance, use
|
|
112
|
+
`../_shared/ui-interaction-quality.md`. Ordinary UI work does not preload these paths.
|
|
113
|
+
|
|
114
|
+
Then run the project's frontend verification commands, typically lint, typecheck, tests, and browser/responsive checks when the UI changes.
|
|
115
|
+
|
|
116
|
+
### Resource scope
|
|
117
|
+
| Scope | Resource target |
|
|
118
|
+
|-------|-----------------|
|
|
119
|
+
| `CODEBASE` | Frontend routes, components, styles, hooks, tests |
|
|
120
|
+
| `LOCAL_FS` | Design tokens, i18n files, resource references |
|
|
121
|
+
| `PROCESS` | Build, lint, typecheck, test, browser commands |
|
|
122
|
+
| `NETWORK` | Backend APIs or registry tools when required |
|
|
123
|
+
|
|
124
|
+
### Preconditions
|
|
125
|
+
- Target UI behavior and affected frontend area are identifiable.
|
|
126
|
+
- Required design tokens, i18n, and API contracts are available or assumptions are stated.
|
|
127
|
+
|
|
128
|
+
### Effects and side effects
|
|
129
|
+
- Mutates frontend source, styles, tests, and possibly i18n keys.
|
|
130
|
+
- May add dependencies or shadcn components only when justified by project conventions.
|
|
131
|
+
- Does not edit `components/ui/*` directly.
|
|
132
|
+
|
|
133
|
+
### Guardrails
|
|
134
|
+
Apply framework, library, architecture, and data-model defaults only when the target project has no established choice. Scoped edits do not authorize a stack migration or unrelated infrastructure.
|
|
135
|
+
1. Follow the existing React, Next.js, TypeScript, and FSD-lite architecture in the target project.
|
|
136
|
+
2. Use `shadcn/ui` primitives and wrappers for UI work; treat `components/ui/*` as read-only.
|
|
137
|
+
3. Keep server/client boundaries explicit: Server Components for static/layout work, Client Components for interaction and hooks.
|
|
138
|
+
4. Use project sources of truth for design tokens, i18n strings, and shared utilities before adding local alternatives.
|
|
139
|
+
5. Run the execution checklist before handoff and include relevant verification results.
|
|
140
|
+
6. **Self-describing file names**: every new file follows the File Naming convention in `../../rules/frontend.md` §Naming Conventions — domain + role readable from the basename alone (`order-summary-card.tsx`, `use-order-polling.ts`, `cart.atoms.ts`). Grab-bag names (`utils.ts`, `helpers.ts`, `misc.ts`) and version suffixes (`*-v2`, `*-final`) are banned.
|
|
141
|
+
7. **Request proxy convention**: when the target project uses Next.js 16+ with `proxy.ts`, preserve that convention. Check the installed framework version and routing before recommending a file rename. Diagnose wiring from code and tests.
|
|
142
|
+
8. Use the project's Link prefetch policy; adjust specific routes only when measured behavior or the task requires it.
|
|
143
|
+
9. **Angular projects follow `resources/angular-rules.md`**: standalone components + `OnPush` + signals-first, `inject()` DI, lazy routes, new control flow. **Any non-trivial RxJS pipeline MUST ship with a marble test (`TestScheduler` from `rxjs/testing`)** — a stream without a marble test fails review. React/Next.js-specific rules (shadcn workflow, `proxy.ts`, Libraries table below) do not apply in Angular projects.
|
|
144
|
+
|
|
145
|
+
### Libraries
|
|
146
|
+
|
|
147
|
+
React/Next.js projects only — Angular projects use the Angular-native equivalents in `resources/angular-rules.md` (signals, typed Reactive Forms, `HttpClient`/`httpResource`, RxJS with mandatory marble tests).
|
|
148
|
+
|
|
149
|
+
| Category | Library |
|
|
150
|
+
|----------|---------|
|
|
151
|
+
| Framework | New-project default: `next@16+` (App Router) + `react@19+`; preserve existing project versions |
|
|
152
|
+
| Date | `luxon` |
|
|
153
|
+
| Styling | `TailwindCSS v4` + `shadcn/ui` (Base UI engine; see `resources/tech-stack.md`) |
|
|
154
|
+
| Hooks | `ahooks` (default) or `@mantine/hooks` (standalone, SSR-safe; no Mantine UI required); pre-made hooks preferred; pick one per project, don't mix |
|
|
155
|
+
| Utils | `es-toolkit` (first choice) |
|
|
156
|
+
| Types | `type-fest` (TS type utilities not in the standard lib: `SetRequired`, `Merge`, `JsonValue`, `Promisable`, etc.; built-in `Partial`/`Pick`/`Omit` stay first choice) |
|
|
157
|
+
| State (URL) | `nuqs` |
|
|
158
|
+
| State (Server) | `TanStack Query`; default is `orval`-generated hooks from the OpenAPI spec (`client: react-query`); hand-write hooks only for spec-less endpoints (see `resources/tech-stack.md` §Server State) |
|
|
159
|
+
| State (Client) | `Jotai` or `Zustand` (intent-based, no default; minimize use — see `resources/tech-stack.md`) |
|
|
160
|
+
| Forms | `@tanstack/react-form` (v1+; pass zod schemas directly via Standard Schema; do not add the v0-only `@tanstack/zod-form-adapter` to v1 projects) + `zod` (v4) |
|
|
161
|
+
| Auth | `better-auth`; client code imports only the client SDK, never server libraries or database adapters |
|
|
162
|
+
| Animation | New-project default: `motion` with imports from `motion/react`; preserve an existing animation library for scoped edits |
|
|
163
|
+
|
|
164
|
+
### Shadcn Workflow
|
|
165
|
+
|
|
166
|
+
- **Engine default: Base UI** (`components.json` → `style: "base-*"`). Radix (`radix-*`) is a
|
|
167
|
+
reasoned fallback for existing Radix codebases only; no big-bang migration. Details in
|
|
168
|
+
`resources/tech-stack.md` §shadcn/ui Primitive Engine.
|
|
169
|
+
|
|
170
|
+
1. Search: `shadcn_search_items_in_registries`
|
|
171
|
+
2. Review: `shadcn_get_item_examples_from_registries`
|
|
172
|
+
3. Install: `shadcn_get_add_command_for_items`
|
|
173
|
+
|
|
174
|
+
### Server vs Client Components
|
|
175
|
+
|
|
176
|
+
- **Server Components**: Layouts, marketing pages, SEO metadata (`generateMetadata`, `sitemap`)
|
|
177
|
+
- **Client Components**: Interactive features and `useQuery` hooks
|
|
178
|
+
- **Mutations**: one owner per write. Server Actions for form-shaped, revalidate-only flows; TanStack Query for cache-coupled or non-form writes (`resources/tech-stack.md` §Mutations)
|
|
179
|
+
|
|
180
|
+
### UI Implementation (Shadcn/UI)
|
|
181
|
+
|
|
182
|
+
- **Usage**: Prefer strict shadcn primitives (`Card`, `Sheet`, `Typography`, `Table`) over `div` or generic classes.
|
|
183
|
+
- **Responsiveness**: Use `Drawer` (mobile) vs `Dialog` (desktop) via `useResponsive`.
|
|
184
|
+
<!-- oma-docs:ignore-start -->
|
|
185
|
+
- **Customization**: Treat `components/ui/*` as read-only. Create wrappers (e.g., `components/common/ProductButton.tsx`) or use `cva` composition. Never edit `components/ui/button.tsx` directly.
|
|
186
|
+
<!-- oma-docs:ignore-end -->
|
|
187
|
+
|
|
188
|
+
### Sources of Truth
|
|
189
|
+
|
|
190
|
+
- **DESIGN.md** (project root): visual system source of truth; read Section 9 (Agent Prompt Guide) verbatim for component prompts when present
|
|
191
|
+
- **Design Tokens**: `packages/design-tokens` (OKLCH); never hardcode colors
|
|
192
|
+
- **i18n strings**: `packages/i18n`; never hardcode UI text
|
|
193
|
+
- **Custom utilities**: check `es-toolkit` first; if implementing custom logic, use the project or task coverage target and risk-relevant tests
|
|
194
|
+
|
|
195
|
+
### Designer Collaboration
|
|
196
|
+
|
|
197
|
+
- **Sync**: Map code variables to Figma layer names
|
|
198
|
+
- **UX**: Ensure key actions are visible "Above the Fold"
|
|
199
|
+
|
|
200
|
+
### Stack Reference
|
|
201
|
+
|
|
202
|
+
Project stack conventions live in dedicated files. **Read these before coding**; they are not optional appendix material.
|
|
203
|
+
|
|
204
|
+
| File | Owns |
|
|
205
|
+
|---|---|
|
|
206
|
+
| `resources/tech-stack.md` | Framework versions, Next.js 16 `proxy.ts` + React Compiler conventions, Server Actions vs TanStack Query mutation policy, optional provider examples |
|
|
207
|
+
| `resources/tailwind-rules.md` | Design tokens, focus states, Tailwind v4 `@theme` syntax |
|
|
208
|
+
| `resources/snippets.md` | React 19 hook patterns, TanStack Query/Form, a11y card |
|
|
209
|
+
| `resources/angular-rules.md` | Angular standalone/OnPush/signals conventions, RxJS marble-test policy (MANDATORY for streams) |
|
|
210
|
+
|
|
211
|
+
To extend: add `resources/<name>.md` and append a row above.
|
|
212
|
+
|
|
213
|
+
## References
|
|
214
|
+
- `../oma-design/resources/product-interface-review.md`: recommended design review after substantial product-interface implementation.
|
|
215
|
+
- Specialized visual implementation: `resources/specialized-visual-implementation.md` (requested CanvasUI GPU effect, Scroll World scene, or selected GSAP implementation)
|
|
216
|
+
- Interaction quality: `../_shared/ui-interaction-quality.md` (motion, feedback, touch, interruption, or performance changes)
|
|
217
|
+
- Local code tools: `../_shared/core/code-intelligence.md` (code search/navigation)
|
|
218
|
+
|
|
219
|
+
- Project frontend rules (MUST load before review/implementation): `../../rules/frontend.md`
|
|
220
|
+
- Execution steps (follow for the selected task): `resources/execution-protocol.md`
|
|
221
|
+
- Checklist (run before handoff): `resources/checklist.md`
|
|
222
|
+
- Error recovery: `resources/error-playbook.md`
|
|
223
|
+
- Context loading: `../_shared/core/context-loading.md`
|
|
224
|
+
- Clarification: `../_shared/core/clarification-protocol.md`
|
|
225
|
+
- Context budget: `../_shared/core/context-budget.md`
|
|
226
|
+
- Lessons learned: `../_shared/core/lessons-learned.md` (matching prior failure or requested retrospective)
|
|
227
|
+
- Observability handoff: `../oma-observability/SKILL.md` §Integrations — Core Web Vitals, SSR→client trace propagation, INP profiling
|