@punks/cli 2.3.1 → 2.3.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 +1 -1
- package/dist/BASELINE_CHANGELOG.md +615 -0
- package/dist/CHANGELOG.md +425 -0
- package/dist/data/hooks/scaffold-update-check.mjs +18 -6
- package/dist/index.js +5613 -5373
- package/dist/skills/agnostic/cli/dp-cli/SKILL.md +8 -1
- package/dist/skills/agnostic/cli/dp-cli/references/commands.md +7 -3
- package/dist/skills/agnostic/cli/dp-cli/references/post-command-flow.md +15 -1
- package/dist/skills/agnostic/quality/review/SKILL.md +89 -0
- package/dist/skills/agnostic/research/parallel-research/SKILL.md +5 -2
- package/dist/skills/frameworks/expo/add-app-clip/SKILL.md +280 -0
- package/dist/skills/frameworks/expo/add-app-clip/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/add-app-clip/references/native-module.md +96 -0
- package/dist/skills/frameworks/expo/building-native-ui/SKILL.md +377 -0
- package/dist/skills/frameworks/expo/building-native-ui/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/animations.md +220 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/controls.md +270 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/form-sheet.md +253 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/gradients.md +106 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/icons.md +213 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/media.md +198 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/route-structure.md +229 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/search.md +248 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/storage.md +121 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/tabs.md +433 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/toolbar-and-headers.md +284 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/visual-effects.md +197 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/webgpu-three.md +605 -0
- package/dist/skills/frameworks/expo/building-native-ui/references/zoom-transitions.md +158 -0
- package/dist/skills/frameworks/expo/eas-simulator/SKILL.md +154 -0
- package/dist/skills/frameworks/expo/eas-simulator/references/controllers.md +67 -0
- package/dist/skills/frameworks/expo/eas-simulator/references/run-your-app.md +185 -0
- package/dist/skills/frameworks/expo/eas-simulator/references/troubleshooting.md +38 -0
- package/dist/skills/frameworks/expo/eas-update-insights/SKILL.md +228 -0
- package/dist/skills/frameworks/expo/eas-update-insights/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/dist/skills/frameworks/expo/eas-update-insights/references/update-insights-schema.md +69 -0
- package/dist/skills/frameworks/expo/expo-api-routes/SKILL.md +368 -0
- package/dist/skills/frameworks/expo/expo-api-routes/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-brownfield/SKILL.md +54 -0
- package/dist/skills/frameworks/expo/expo-brownfield/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/brownfield-integrated.md +526 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/brownfield-isolated.md +402 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/comparison.md +63 -0
- package/dist/skills/frameworks/expo/expo-brownfield/references/troubleshooting.md +88 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/SKILL.md +92 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/fetch.js +109 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/package.json +11 -0
- package/dist/skills/frameworks/expo/expo-cicd-workflows/scripts/validate.js +84 -0
- package/dist/skills/frameworks/expo/expo-deployment/SKILL.md +167 -0
- package/dist/skills/frameworks/expo/expo-deployment/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/app-store-metadata.md +497 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/ios-app-store.md +371 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/play-store.md +246 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/testflight.md +58 -0
- package/dist/skills/frameworks/expo/expo-deployment/references/workflows.md +160 -0
- package/dist/skills/frameworks/expo/expo-dev-client/SKILL.md +172 -0
- package/dist/skills/frameworks/expo/expo-dev-client/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-examples/SKILL.md +97 -0
- package/dist/skills/frameworks/expo/expo-examples/references/catalog.md +105 -0
- package/dist/skills/frameworks/expo/expo-module/SKILL.md +141 -0
- package/dist/skills/frameworks/expo/expo-module/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-module/references/config-plugin.md +90 -0
- package/dist/skills/frameworks/expo/expo-module/references/create-expo-module.md +206 -0
- package/dist/skills/frameworks/expo/expo-module/references/lifecycle.md +127 -0
- package/dist/skills/frameworks/expo/expo-module/references/module-config.md +48 -0
- package/dist/skills/frameworks/expo/expo-module/references/native-module.md +286 -0
- package/dist/skills/frameworks/expo/expo-module/references/native-view.md +171 -0
- package/dist/skills/frameworks/expo/expo-observe/SKILL.md +29 -0
- package/dist/skills/frameworks/expo/expo-observe/references/metrics.md +47 -0
- package/dist/skills/frameworks/expo/expo-observe/references/queries.md +342 -0
- package/dist/skills/frameworks/expo/expo-observe/references/setup.md +255 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/SKILL.md +314 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/agents/visual-grader.md +52 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/references/design-rubric.md +45 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/references/runtime-matrix.md +33 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/check-static.sh +64 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/clean-fixture.sh +56 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/generate_viewer.py +450 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/latest-sdk.sh +46 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/make-fixture.sh +95 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/make-workspace.sh +31 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-android.sh +284 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-ios.sh +132 -0
- package/dist/skills/frameworks/expo/expo-skill-eval/scripts/snapshot-web.sh +61 -0
- package/dist/skills/frameworks/expo/expo-tailwind-setup/SKILL.md +480 -0
- package/dist/skills/frameworks/expo/expo-tailwind-setup/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-ui/SKILL.md +47 -0
- package/dist/skills/frameworks/expo/expo-ui/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/expo-ui/references/drop-in-replacements.md +27 -0
- package/dist/skills/frameworks/expo/expo-ui/references/jetpack-compose.md +73 -0
- package/dist/skills/frameworks/expo/expo-ui/references/swift-ui.md +73 -0
- package/dist/skills/frameworks/expo/expo-ui/references/universal.md +73 -0
- package/dist/skills/frameworks/expo/expo-ui/scripts/list-components.js +193 -0
- package/dist/skills/frameworks/expo/native-data-fetching/SKILL.md +505 -0
- package/dist/skills/frameworks/expo/native-data-fetching/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/native-data-fetching/references/expo-router-loaders.md +341 -0
- package/dist/skills/frameworks/expo/upgrading-expo/SKILL.md +134 -0
- package/dist/skills/frameworks/expo/upgrading-expo/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/expo-av-to-audio.md +132 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/expo-av-to-video.md +160 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/native-tabs.md +124 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/new-architecture.md +79 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-19.md +79 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-compiler.md +59 -0
- package/dist/skills/frameworks/expo/upgrading-expo/references/react-navigation-to-expo-router.md +61 -0
- package/dist/skills/frameworks/expo/use-dom/SKILL.md +417 -0
- package/dist/skills/frameworks/expo/use-dom/agents/openai.yaml +4 -0
- package/dist/skills/frameworks/expo/web-to-native/SKILL.md +83 -0
- package/dist/skills/frameworks/expo/web-to-native/references/false-friends.md +119 -0
- package/dist/skills/frameworks/expo/web-to-native/references/native-patterns.md +39 -0
- package/dist/skills/frameworks/expo/web-to-native/references/run-as-goal.md +48 -0
- package/dist/skills/frameworks/expo/web-to-native/references/verify-on-device.md +45 -0
- package/dist/skills/phases/review-phase/REFERENCE.md +36 -3
- package/dist/skills/phases/review-phase/SKILL.md +18 -11
- package/package.json +1 -1
|
@@ -57,6 +57,8 @@ After `dp scaffold init`, expect `.agents/skills/requirements-grill`, `.agents/s
|
|
|
57
57
|
|
|
58
58
|
Run the requirements grill before backlog authoring. If the generated wiki root does not match the real repository layout, move or refactor it before creating durable specs, plans, or routed docs. Monorepos usually use `apps/wiki`; single-repo layouts usually use `wiki`.
|
|
59
59
|
|
|
60
|
+
Pre-existing skills are reconciled by the follow-up agent, not by the command. Inspect `.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`, and `.opencode/skills`. If `.devpunks/pre-existing-skills` exists, inspect it as blind pre-command evidence. Exact canonical directory id/name overlap keeps the HI baseline skill active: archive local evidence under `.devpunks/replaced-skills/<skill-id>/...`, then remove active local copies or mirrors. Preserve non-overlapping local skills and expose them through harness mirrors or symlinks. Use `dp report` when archived local knowledge should be proposed for HI baseline integration; semantic overlap belongs there, not command runtime.
|
|
61
|
+
|
|
60
62
|
## Scaffold Setup
|
|
61
63
|
|
|
62
64
|
After `dp scaffold setup`, expect artifacts such as:
|
|
@@ -75,6 +77,8 @@ Then author or reconcile the final repo files requested by the specs, including
|
|
|
75
77
|
|
|
76
78
|
Reconcile generated wiki guidance with the real repository layout. Do not assume a newly seeded wiki root is canonical until it matches the project boundary.
|
|
77
79
|
|
|
80
|
+
Reconcile pre-existing repo skills from the same homes as `dp scaffold init`: `.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`, and `.opencode/skills`. Commands do not detect overlap. If `.devpunks/pre-existing-skills` exists, inspect it as blind pre-command evidence. Exact name/id overlap keeps the HI baseline skill active; archive local evidence under `.devpunks/replaced-skills/<skill-id>/...` and remove active local copies or mirrors. Non-overlapping local skills remain repo-owned guidance and should stay exposed through harness mirrors or symlinks. Suggest `dp report` for archived local knowledge that should influence the shared baseline.
|
|
81
|
+
|
|
78
82
|
Use `dp scaffold setup --yes` only when the harness cannot answer interactive prompts. It accepts the resolved default pack selection; it does not add optional packs or resolve repo-policy decisions.
|
|
79
83
|
|
|
80
84
|
Before authoring prompts or plans, identify the detected core libraries whose source behavior matters. Ask the user which ones to prioritize if the choice is not obvious, then run `opensrc path <package>` or `opensrc path owner/repo` only for that focused set.
|
|
@@ -83,13 +87,16 @@ When lint specs suggest Oxlint or hooks suggest Oxfmt, treat migration as a repo
|
|
|
83
87
|
|
|
84
88
|
## Update
|
|
85
89
|
|
|
86
|
-
After `dp update`, inspect `.devpunks/scaffold-manifest.json` and the update summary.
|
|
90
|
+
After `dp update` or `dp update --check`, inspect `.devpunks/scaffold-manifest.json` and the update summary.
|
|
87
91
|
|
|
88
92
|
- `--check` reports managed-file drift without writing.
|
|
89
93
|
- `--write` refreshes scaffold-managed assets.
|
|
90
94
|
- `--yes` refreshes scaffold-managed assets without prompting and is the non-interactive apply flag.
|
|
95
|
+
- drift output can include changelog summaries; use them to explain why update/upgrade matters.
|
|
91
96
|
- pack drift is a setup decision point, not a silent auto-fix.
|
|
92
97
|
|
|
98
|
+
Apply the same pre-existing skill policy after update: the command does not detect overlap, the agent checks `.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`, `.opencode/skills`, and `.devpunks/pre-existing-skills` when present, exact name/id overlap keeps HI baseline active, non-overlaps remain mirrored, and `dp report` carries semantic overlap or baseline integration proposals.
|
|
99
|
+
|
|
93
100
|
## Report
|
|
94
101
|
|
|
95
102
|
Use `dp report` when reusable Harness friction should enter maintainer triage: stale generated guidance, confusing CLI output, missing docs, broken setup, or shared tooling issues.
|
|
@@ -18,17 +18,21 @@ It scaffolds `requirements-grill`, `write-backlog`, and the initial wiki tree, t
|
|
|
18
18
|
|
|
19
19
|
If the generated wiki root does not match the repository layout, move or refactor it before writing specs, plans, or routed docs. Monorepos usually use `apps/wiki`; single-repo layouts usually use `wiki`.
|
|
20
20
|
|
|
21
|
+
After init, the agent must reconcile pre-existing skills. The command does not detect overlap. Inspect `.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`, `.opencode/skills`, and `.devpunks/pre-existing-skills` when present; exact name/id overlap keeps HI baseline active, non-overlaps stay exposed through mirrors or symlinks, and `dp report` carries semantic overlap or baseline integration proposals.
|
|
22
|
+
|
|
21
23
|
## `dp update --check`
|
|
22
24
|
|
|
23
|
-
Use to preview managed scaffold drift from `.devpunks/scaffold-manifest.json`.
|
|
25
|
+
Use at session start when `.devpunks/` exists or to preview managed scaffold drift from `.devpunks/scaffold-manifest.json`.
|
|
24
26
|
|
|
25
|
-
Report missing, changed, or pack-drift findings. Do not write files.
|
|
27
|
+
Report CLI, baseline, missing, changed, or pack-drift findings. Do not write files. If remediation is accepted, use a subagent for `dp upgrade`, `dp update --write`, or `dp update --yes`.
|
|
26
28
|
|
|
27
29
|
## `dp update --write`
|
|
28
30
|
|
|
29
31
|
Use to refresh scaffold-managed files recorded in `.devpunks/scaffold-manifest.json`.
|
|
30
32
|
|
|
31
|
-
After writing, verify the refreshed files still fit the repo shape and any pack drift is handled intentionally.
|
|
33
|
+
After writing, verify the refreshed files still fit the repo shape and any baseline or pack drift is handled intentionally.
|
|
34
|
+
|
|
35
|
+
Also run the agent-owned pre-existing skill reconciliation check. `dp update` does not detect overlaps.
|
|
32
36
|
|
|
33
37
|
## `dp update --yes`
|
|
34
38
|
|
|
@@ -8,7 +8,8 @@ When `.devpunks/` exists, read in this order:
|
|
|
8
8
|
2. `.devpunks/AGENT-HANDOFF.md`
|
|
9
9
|
3. `.devpunks/scaffold-manifest.json`
|
|
10
10
|
4. `.devpunks/required-tools.json`
|
|
11
|
-
5. `.devpunks/
|
|
11
|
+
5. `.devpunks/settings.json`
|
|
12
|
+
6. `.devpunks/specs/**`
|
|
12
13
|
|
|
13
14
|
If a file is missing, continue with the next available artifact and say what was missing.
|
|
14
15
|
|
|
@@ -22,12 +23,17 @@ If a file is missing, continue with the next available artifact and say what was
|
|
|
22
23
|
- `.devpunks/specs/lint/**`: lint asset selection and starter config guidance.
|
|
23
24
|
- `.devpunks/specs/subagents/**`: desired subagent manifest shape.
|
|
24
25
|
|
|
26
|
+
- `.devpunks/settings.json`: project-local `cliVersion` and `baselineVersion` pins from last accepted scaffold-writing command.
|
|
27
|
+
|
|
25
28
|
## Required Follow-Through
|
|
26
29
|
|
|
27
30
|
After `dp scaffold setup`:
|
|
28
31
|
|
|
29
32
|
- Generate final root/docs/workspace `AGENTS.md` files from prompt specs.
|
|
30
33
|
- Reconcile any scaffolded wiki root with the real repo layout before writing durable docs.
|
|
34
|
+
- Reconcile pre-existing skills yourself; commands do not detect overlap. Inspect `.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`, and `.opencode/skills`. If `.devpunks/pre-existing-skills` exists, inspect it as blind pre-command evidence.
|
|
35
|
+
- Exact canonical directory id/name overlap keeps the HI baseline skill active. Archive local evidence under `.devpunks/replaced-skills/<skill-id>/...`, then remove active local copies or mirrors.
|
|
36
|
+
- Preserve non-overlapping local skills and expose them through harness mirrors or symlinks. Use `dp report` when archived local knowledge should be proposed for HI baseline integration; semantic overlap belongs there.
|
|
31
37
|
- Create sibling `CLAUDE.md` symlink mirrors for those neutral prompt files.
|
|
32
38
|
- Keep `.agents/AGENTS.md` as the shared global prompt source.
|
|
33
39
|
- Keep `.agents/skills/` as the main skill directory; only `.claude/skills` mirrors it.
|
|
@@ -38,10 +44,18 @@ After `dp scaffold setup`:
|
|
|
38
44
|
|
|
39
45
|
Do not stop after saying the files exist.
|
|
40
46
|
|
|
47
|
+
After `dp update --check` or `dp update`:
|
|
48
|
+
|
|
49
|
+
- Inspect `.devpunks/scaffold-manifest.json` and `.devpunks/settings.json`.
|
|
50
|
+
- For write modes, confirm `cliVersion` and `baselineVersion` reflect accepted project authority after writes.
|
|
51
|
+
- Verify refreshed files still fit repo shape; handle pack drift intentionally.
|
|
52
|
+
- Apply the same pre-existing skill reconciliation policy as scaffold setup. `dp update` does not detect overlaps; the agent checks the skill homes and `.devpunks/pre-existing-skills` when present, keeps HI baseline active for exact name/id overlaps, preserves non-overlaps through mirrors, and uses `dp report` for semantic overlap or baseline integration proposals.
|
|
53
|
+
|
|
41
54
|
After `dp scaffold init`:
|
|
42
55
|
|
|
43
56
|
- Do not start requirements discovery by default.
|
|
44
57
|
- Inspect the generated skills and seeded wiki root.
|
|
58
|
+
- Reconcile pre-existing skills yourself using `.agents/skills`, `.claude/skills`, `.codex/skills`, `.cursor/skills`, and `.opencode/skills`; inspect `.devpunks/pre-existing-skills` when present; the command did not detect overlap.
|
|
45
59
|
- Treat the seeded wiki root as provisional until it matches the repo layout.
|
|
46
60
|
- Move, rename, or refactor generated init output when needed so it matches the actual repository.
|
|
47
61
|
- Run `requirements-grill` before `write-backlog` only when the user actually asks for requirements or backlog generation.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Two-axis review of the diff between `HEAD` and a fixed point the user supplies:
|
|
7
|
+
|
|
8
|
+
- **Standards** — does the code conform to this repo's documented coding standards?
|
|
9
|
+
- **Spec** — does the code faithfully implement the originating issue / PRD / spec?
|
|
10
|
+
|
|
11
|
+
Both axes run as **parallel sub-agents** so they don't pollute each other's context, then this skill aggregates their findings.
|
|
12
|
+
|
|
13
|
+
The issue tracker should have been provided to you — run `/setup-matt-pocock-skills` if `docs/agents/issue-tracker.md` is missing.
|
|
14
|
+
|
|
15
|
+
## Process
|
|
16
|
+
|
|
17
|
+
### 1. Pin the fixed point
|
|
18
|
+
|
|
19
|
+
Whatever the user said is the fixed point — a commit SHA, branch name, tag, `main`, `HEAD~5`, etc. If they didn't specify one, ask for it.
|
|
20
|
+
|
|
21
|
+
Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.
|
|
22
|
+
|
|
23
|
+
Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here — not inside two parallel sub-agents.
|
|
24
|
+
|
|
25
|
+
### 2. Identify the spec source
|
|
26
|
+
|
|
27
|
+
Look for the originating spec, in this order:
|
|
28
|
+
|
|
29
|
+
1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.) — fetch via the workflow in `docs/agents/issue-tracker.md`.
|
|
30
|
+
2. A path the user passed as an argument.
|
|
31
|
+
3. A PRD/spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.
|
|
32
|
+
4. If nothing is found, ask the user where the spec is. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".
|
|
33
|
+
|
|
34
|
+
### 3. Identify the standards sources
|
|
35
|
+
|
|
36
|
+
Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.
|
|
37
|
+
|
|
38
|
+
On top of whatever the repo documents, the Standards axis always carries the **smell baseline** below — a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Two rules bind it:
|
|
39
|
+
|
|
40
|
+
- **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
|
|
41
|
+
- **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.
|
|
42
|
+
|
|
43
|
+
Each smell reads *what it is* → *how to fix*; match it against the diff:
|
|
44
|
+
|
|
45
|
+
- **Mysterious Name** — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
|
|
46
|
+
- **Duplicated Code** — the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
|
|
47
|
+
- **Feature Envy** — a method that reaches into another object's data more than its own. → move the method onto the data it envies.
|
|
48
|
+
- **Data Clumps** — the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
|
|
49
|
+
- **Primitive Obsession** — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
|
|
50
|
+
- **Repeated Switches** — the same `switch`/`if`-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
|
|
51
|
+
- **Shotgun Surgery** — one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
|
|
52
|
+
- **Divergent Change** — one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
|
|
53
|
+
- **Speculative Generality** — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
|
|
54
|
+
- **Message Chains** — long `a.b().c().d()` navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
|
|
55
|
+
- **Middle Man** — a class or function that mostly just delegates onward. → cut it, call the real target direct.
|
|
56
|
+
- **Refused Bequest** — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.
|
|
57
|
+
|
|
58
|
+
### 4. Spawn both sub-agents in parallel
|
|
59
|
+
|
|
60
|
+
Send a single message with two `Agent` tool calls. Use the `general-purpose` subagent for both.
|
|
61
|
+
|
|
62
|
+
**Standards sub-agent prompt** — include:
|
|
63
|
+
|
|
64
|
+
- The full diff command and commit list.
|
|
65
|
+
- The list of standards-source files you found in step 3, **plus the smell baseline from step 3** pasted in full — the sub-agent has no other access to it.
|
|
66
|
+
- The brief: "Report — per file/hunk where relevant — (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls — documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."
|
|
67
|
+
|
|
68
|
+
**Spec sub-agent prompt** — include:
|
|
69
|
+
|
|
70
|
+
- The diff command and commit list.
|
|
71
|
+
- The path or fetched contents of the spec.
|
|
72
|
+
- The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."
|
|
73
|
+
|
|
74
|
+
If the spec is missing, skip the Spec sub-agent and note this in the final report.
|
|
75
|
+
|
|
76
|
+
### 5. Aggregate
|
|
77
|
+
|
|
78
|
+
Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings — the two axes are deliberately separate (see _Why two axes_).
|
|
79
|
+
|
|
80
|
+
End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes — that's the reranking the separation exists to prevent.
|
|
81
|
+
|
|
82
|
+
## Why two axes
|
|
83
|
+
|
|
84
|
+
A change can pass one axis and fail the other:
|
|
85
|
+
|
|
86
|
+
- Code that follows every standard but implements the wrong thing → **Standards pass, Spec fail.**
|
|
87
|
+
- Code that does exactly what the issue asked but breaks the project's conventions → **Spec pass, Standards fail.**
|
|
88
|
+
|
|
89
|
+
Reporting them separately stops one axis from masking the other.
|
|
@@ -25,7 +25,9 @@ Use this skill only for readonly workflows. Goal: widen coverage fast, keep prom
|
|
|
25
25
|
|
|
26
26
|
- Pass raw artifacts, paths, errors, or files.
|
|
27
27
|
- Do not leak your preferred answer, suspected fix, or private conclusions unless the task truly requires them.
|
|
28
|
-
- Ask for findings, evidence, and file references.
|
|
28
|
+
- Ask for findings, evidence, primary-source citations, and file references.
|
|
29
|
+
- Prefer owning sources: official docs, source code, specs, and first-party APIs.
|
|
30
|
+
- Treat secondary write-ups as leads, not proof.
|
|
29
31
|
- For validation passes, make the prompt look like a normal user request, not a hidden test of the skill.
|
|
30
32
|
|
|
31
33
|
## Run In Parallel
|
|
@@ -39,6 +41,7 @@ Use this skill only for readonly workflows. Goal: widen coverage fast, keep prom
|
|
|
39
41
|
|
|
40
42
|
- Compare outputs against the repo, docs, or other primary artifacts.
|
|
41
43
|
- Resolve disagreements with evidence, not majority vote.
|
|
44
|
+
- Follow important claims back to their owning source before relying on them.
|
|
42
45
|
- Extract the few facts that matter, then decide locally.
|
|
43
46
|
- Close agents that are no longer needed.
|
|
44
47
|
|
|
@@ -62,7 +65,7 @@ Use this skill only for readonly workflows. Goal: widen coverage fast, keep prom
|
|
|
62
65
|
|
|
63
66
|
Return:
|
|
64
67
|
- what each subagent covered
|
|
65
|
-
- the evidence worth trusting
|
|
68
|
+
- the evidence worth trusting, with claim-level source citations
|
|
66
69
|
- conflicts or uncertainty
|
|
67
70
|
- the synthesized conclusion
|
|
68
71
|
- the next local action
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-app-clip
|
|
3
|
+
description: Add an iOS App Clip target to an Expo app. Use when the user mentions App Clip, AASA, apple-app-site-association, appclips, smart app banner, or wants to ship a lightweight iOS Clip invoked from a URL alongside their parent app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Add an App Clip to an Expo App
|
|
7
|
+
|
|
8
|
+
Adds an iOS App Clip target to an Expo project. The Clip lives in `targets/clip/`, ships alongside the parent app, and is invoked from a URL on the app's domain via an Apple App Site Association (AASA) file.
|
|
9
|
+
|
|
10
|
+
The parent app's bundle ID becomes `com.<username>.<app-name>` and the Clip's is automatically derived as `<parent>.clip` (e.g. `com.bacon.may20.clip`).
|
|
11
|
+
|
|
12
|
+
## 1. Set `bundleIdentifier` and `appleTeamId`
|
|
13
|
+
|
|
14
|
+
`bun create target` warns if these are missing. Add to `app.json`:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"expo": {
|
|
19
|
+
"ios": {
|
|
20
|
+
"bundleIdentifier": "com.<username>.<app-name>",
|
|
21
|
+
"appleTeamId": "XX57RJ5UTD"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 2. Add the App Clip target
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
bun create target clip
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This installs [`@bacons/apple-targets`](https://github.com/EvanBacon/expo-apple-targets), adds it to the `plugins` array in `app.json`, and writes:
|
|
34
|
+
|
|
35
|
+
- `targets/clip/expo-target.config.js` — the target's config plugin
|
|
36
|
+
- `targets/clip/Info.plist` — Clip Info.plist
|
|
37
|
+
- `targets/clip/AppDelegate.swift`, `Assets.xcassets`, etc.
|
|
38
|
+
|
|
39
|
+
Pick a good icon or reuse the existing one defined in the app — check it with `bunx expo config` under the `icon` or `ios.icon` key.
|
|
40
|
+
|
|
41
|
+
## 3. Wire up associated domains
|
|
42
|
+
|
|
43
|
+
The parent app and the Clip each need the Associated Domains entitlement pointing at the domain that hosts the AASA file.
|
|
44
|
+
|
|
45
|
+
In `app.json`, add both `applinks:` (parent) and `appclips:` (Clip invocation) entries:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"expo": {
|
|
50
|
+
"ios": {
|
|
51
|
+
"associatedDomains": [
|
|
52
|
+
"applinks:may20.expo.app",
|
|
53
|
+
"appclips:may20.expo.app"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
In `targets/clip/expo-target.config.js`, declare the Clip's entitlement:
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
/** @type {import('@bacons/apple-targets/app.plugin').ConfigFunction} */
|
|
64
|
+
module.exports = (config) => ({
|
|
65
|
+
type: "clip",
|
|
66
|
+
icon: "https://github.com/expo.png",
|
|
67
|
+
entitlements: {
|
|
68
|
+
"com.apple.developer.associated-domains": ["appclips:may20.expo.app"],
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> If you skip this, `expo prebuild` will print: `Apple App Clip may require the associated domains entitlement but none were found`.
|
|
74
|
+
|
|
75
|
+
## 4. Register bundle IDs and create the App Store entry
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
bunx setup-safari
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
This logs in to the Apple Developer account, registers `com.bacon.may20`, creates the App Store Connect entry, and prints:
|
|
82
|
+
|
|
83
|
+
- A starter `apple-app-site-association` JSON
|
|
84
|
+
- A `<meta name="apple-itunes-app">` tag with the iTunes app id
|
|
85
|
+
- Team ID, iTunes ID, and Bundle ID
|
|
86
|
+
|
|
87
|
+
## 5. Host the AASA file
|
|
88
|
+
|
|
89
|
+
App Clips are invoked when iOS fetches `https://<your-domain>/.well-known/apple-app-site-association` and finds a matching `appclips` entry.
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
mkdir -p public/.well-known
|
|
93
|
+
touch public/.well-known/apple-app-site-association
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Paste the JSON `setup-safari` printed, but **add an `appclips` block** for the Clip's full app ID (`<TeamID>.<ClipBundleID>`). The output of `setup-safari` only covers the parent app:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"applinks": {
|
|
101
|
+
"details": [
|
|
102
|
+
{
|
|
103
|
+
"appIDs": ["XX57RJ5UTD.com.bacon.may20"],
|
|
104
|
+
"components": [{ "/": "*", "comment": "Matches all routes" }]
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"appclips": {
|
|
109
|
+
"apps": ["XX57RJ5UTD.com.bacon.may20.clip"]
|
|
110
|
+
},
|
|
111
|
+
"activitycontinuation": {
|
|
112
|
+
"apps": ["XX57RJ5UTD.com.bacon.may20"]
|
|
113
|
+
},
|
|
114
|
+
"webcredentials": {
|
|
115
|
+
"apps": ["XX57RJ5UTD.com.bacon.may20"]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Notes:
|
|
121
|
+
|
|
122
|
+
- The file has **no extension** and **no `Content-Type` requirements** beyond being served as-is. Expo Router static export serves files in `public/` verbatim.
|
|
123
|
+
- The `appclips` block is what lets a URL on the domain launch the Clip.
|
|
124
|
+
- `webcredentials` is used for sharing credentials between the website, parent app, and the App Clip.
|
|
125
|
+
- `activitycontinuation` is optional and used for sharing the link between mobile and desktop. Must be used with `Head` from expo-router — see https://docs.expo.dev/router/advanced/apple-handoff/
|
|
126
|
+
- Notation and route-disabling details: https://sosumi.ai/documentation/xcode/supporting-associated-domains
|
|
127
|
+
|
|
128
|
+
## 6. Add the Smart App Banner meta tag
|
|
129
|
+
|
|
130
|
+
Create `src/app/+html.tsx` (Expo Router's HTML shell) and add the tag from `setup-safari`. Create the versioned template if it doesn't exist:
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
bunx expo customize src/app/+html.tsx
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Add the meta tag to the `<head>`:
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
import { ScrollViewStyleReset } from "expo-router/html";
|
|
140
|
+
|
|
141
|
+
export default function Root({ children }: { children: React.ReactNode }) {
|
|
142
|
+
return (
|
|
143
|
+
<html lang="en">
|
|
144
|
+
<head>
|
|
145
|
+
<meta charSet="utf-8" />
|
|
146
|
+
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
|
147
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
148
|
+
<meta name="apple-itunes-app" content="app-id=6771566491" />
|
|
149
|
+
<ScrollViewStyleReset />
|
|
150
|
+
</head>
|
|
151
|
+
<body>{children}</body>
|
|
152
|
+
</html>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
To make the website show the App Clip card instead of the install card, use:
|
|
158
|
+
|
|
159
|
+
```html
|
|
160
|
+
<meta
|
|
161
|
+
name="apple-itunes-app"
|
|
162
|
+
content="app-id=6771566491, app-clip-bundle-id=com.bacon.may20.clip, app-clip-display=card"
|
|
163
|
+
/>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## 7. Deploy the website
|
|
167
|
+
|
|
168
|
+
The AASA file must be live before iOS will trust the association. Use [EAS Hosting](https://docs.expo.dev/eas/hosting/):
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
bunx expo export -p web
|
|
172
|
+
eas deploy --prod
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This publishes the site (including `/.well-known/apple-app-site-association`) at `https://<slug>.expo.app`. Verify:
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
curl https://may20.expo.app/.well-known/apple-app-site-association
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## 8. Mirror permissions
|
|
182
|
+
|
|
183
|
+
Inspect the parent app's permissions after prebuild:
|
|
184
|
+
|
|
185
|
+
```sh
|
|
186
|
+
npx expo config --type introspect
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Look at the `infoPlist` object — mirror the permission keys in the App Clip's `Info.plist` so matching APIs can be used from the Clip.
|
|
190
|
+
|
|
191
|
+
Set `deploymentTarget: "17.6"` in the Clip's target config — App Clips have a higher minimum size limit in iOS 17.6.
|
|
192
|
+
|
|
193
|
+
If the app uses push notifications or location services, add to the App Clip's `Info.plist` to request the necessary permissions:
|
|
194
|
+
|
|
195
|
+
```xml
|
|
196
|
+
<key>NSAppClip</key>
|
|
197
|
+
<dict>
|
|
198
|
+
<key>NSAppClipRequestEphemeralUserNotification</key>
|
|
199
|
+
<false/>
|
|
200
|
+
<key>NSAppClipRequestLocationConfirmation</key>
|
|
201
|
+
<true/>
|
|
202
|
+
</dict>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## 9. Build and submit to TestFlight
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
bunx testflight
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
This will:
|
|
212
|
+
|
|
213
|
+
1. Generate an `eas.json` if missing.
|
|
214
|
+
2. Set up credentials for **both** targets (parent + Clip). Each gets its own provisioning profile but can share a single Distribution Certificate.
|
|
215
|
+
3. Sync capabilities — note `Enabled: Associated Domains` for the Clip target.
|
|
216
|
+
4. Build, upload, and schedule a TestFlight submission.
|
|
217
|
+
|
|
218
|
+
## 10. Configure App Clip metadata
|
|
219
|
+
|
|
220
|
+
Pull existing App Store metadata to local:
|
|
221
|
+
|
|
222
|
+
```sh
|
|
223
|
+
eas metadata:pull
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Add `apple.appClip` to `store.config.json`. Up to 3 invocation URLs can launch the Clip from a web page:
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"configVersion": 0,
|
|
231
|
+
"apple": {
|
|
232
|
+
"appClip": {
|
|
233
|
+
"defaultExperience": {
|
|
234
|
+
"action": "PLAY",
|
|
235
|
+
"releaseWithAppStoreVersion": true,
|
|
236
|
+
"reviewDetail": {
|
|
237
|
+
"invocationUrls": ["https://may20.expo.app/", null, null]
|
|
238
|
+
},
|
|
239
|
+
"info": {
|
|
240
|
+
"en-US": {
|
|
241
|
+
"subtitle": "Instantly native with Expo",
|
|
242
|
+
"headerImage": "store/apple/app-clip/en-US/asc-app-clip.png"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
The `headerImage` must be a 1800x1200 PNG with no opacity.
|
|
252
|
+
|
|
253
|
+
Push back to the store:
|
|
254
|
+
|
|
255
|
+
```sh
|
|
256
|
+
eas metadata:push
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Apple's recommended App Clip metadata guidelines: https://sosumi.ai/documentation/appclip/configuring-the-launch-experience-of-your-app-clip
|
|
260
|
+
|
|
261
|
+
## What you get
|
|
262
|
+
|
|
263
|
+
- Parent app target: `com.bacon.may20`
|
|
264
|
+
- App Clip target: `com.bacon.may20.clip`, lives in `targets/clip/`
|
|
265
|
+
- AASA hosted at `https://may20.expo.app/.well-known/apple-app-site-association`
|
|
266
|
+
- Smart App Banner meta tag on every web route
|
|
267
|
+
- Every route linked to its native counterpart
|
|
268
|
+
- TestFlight build of the parent app with the Clip embedded
|
|
269
|
+
|
|
270
|
+
Once Apple invokes the Clip from a URL on the domain, iOS opens `targets/clip/`'s entry point which loads the React Native app.
|
|
271
|
+
|
|
272
|
+
## Native detection (optional)
|
|
273
|
+
|
|
274
|
+
To let JS detect when it's running inside an App Clip and present an install prompt for the full app, create a local Expo module (`bunx create-expo-module --local`) that exposes `navigator.appClip.prompt()`.
|
|
275
|
+
|
|
276
|
+
See [./references/native-module.md](./references/native-module.md) for the Swift module, TypeScript interface, and usage.
|
|
277
|
+
|
|
278
|
+
## References
|
|
279
|
+
|
|
280
|
+
- ./references/native-module.md — Local Expo module to detect App Clip context and present the SKOverlay install prompt
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Add App Clip"
|
|
3
|
+
short_description: "Add an iOS App Clip target to an Expo app with AASA, associated domains, and TestFlight setup"
|
|
4
|
+
default_prompt: "Use $add-app-clip when adding or reviewing an iOS App Clip target for an Expo app, including bundle IDs, associated domains, AASA files, smart app banners, App Store Connect setup, and TestFlight verification."
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Native App Clip detection
|
|
2
|
+
|
|
3
|
+
Create a local Expo module so JS can detect when the app is running inside an App Clip and present the install prompt for the full app.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
bunx create-expo-module --local
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Swift module
|
|
10
|
+
|
|
11
|
+
```swift
|
|
12
|
+
import ExpoModulesCore
|
|
13
|
+
import StoreKit
|
|
14
|
+
|
|
15
|
+
internal class MissingCurrentWindowSceneException: Exception {
|
|
16
|
+
override var reason: String {
|
|
17
|
+
"Cannot determine the current window scene in which to present the modal for requesting a review."
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
internal class MissingContainerURLException: Exception {
|
|
22
|
+
override var reason: String {
|
|
23
|
+
"Cannot determine the container URL."
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public class AppClipModule: Module {
|
|
28
|
+
private static let isAppClip: Bool = {
|
|
29
|
+
if let infoPlist = Bundle.main.infoDictionary, let _ = infoPlist["NSAppClip"] as? [String: Any] {
|
|
30
|
+
return true
|
|
31
|
+
}
|
|
32
|
+
return false
|
|
33
|
+
}()
|
|
34
|
+
|
|
35
|
+
public func definition() -> ModuleDefinition {
|
|
36
|
+
Name("AppClip")
|
|
37
|
+
|
|
38
|
+
Constant("isAppClip") {
|
|
39
|
+
AppClipModule.isAppClip
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Display overlay to advertise full app.
|
|
43
|
+
// https://developer.apple.com/documentation/app_clips/recommending_your_app_to_app_clip_users
|
|
44
|
+
AsyncFunction("prompt") {
|
|
45
|
+
if #available(iOS 16, *) {
|
|
46
|
+
guard let currentScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else {
|
|
47
|
+
throw MissingCurrentWindowSceneException()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let config = SKOverlay.AppClipConfiguration(position: .bottom)
|
|
51
|
+
let overlay = SKOverlay(configuration: config)
|
|
52
|
+
overlay.present(in: currentScene)
|
|
53
|
+
}
|
|
54
|
+
}.runOnQueue(DispatchQueue.main)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## TypeScript interface
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { NativeModule, requireOptionalNativeModule } from "expo";
|
|
63
|
+
|
|
64
|
+
declare class AppClipModule extends NativeModule<{}> {
|
|
65
|
+
prompt(): void;
|
|
66
|
+
isAppClip?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const AppClipNative = requireOptionalNativeModule<AppClipModule>("AppClip");
|
|
70
|
+
|
|
71
|
+
if (AppClipNative?.isAppClip) {
|
|
72
|
+
navigator.appClip = {
|
|
73
|
+
prompt: AppClipNative.prompt,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare global {
|
|
78
|
+
interface Navigator {
|
|
79
|
+
/**
|
|
80
|
+
* Only available in an App Clip context.
|
|
81
|
+
* @expo
|
|
82
|
+
*/
|
|
83
|
+
appClip?: {
|
|
84
|
+
/** Open the SKOverlay */
|
|
85
|
+
prompt: () => void;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export {};
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Usage
|
|
94
|
+
|
|
95
|
+
- Detect App Clip context: `if (navigator.appClip) { ... }`
|
|
96
|
+
- Prompt to install the full app: `navigator.appClip?.prompt()`
|