# Make an app that a friend can keep

Ask your agent to build one small tool for a particular person. Describe one action, what should be saved on that device, and what the next person receives. For example, two players could use a counter on one phone, save the running score between games and share the empty app with another pair.

## Get the tools

Agents should also read the [installable workflow source](SKILL.md). Whole-client Android, Windows or Linux composition has separate identity, signing and first-run constraints in [distribution composition](distribution.md); ordinary creators should ship a Function Package instead.

To work on Lanlet itself, clone the [public product source](https://github.com/lanlet/lanlet) with `git clone https://github.com/lanlet/lanlet.git`. Its README is the authoritative path for restoring dependencies, running the Core and UI tests, and building Android, Windows and Linux from the neutral source tree. The included counter is a source-build input, not an official game. Forks must replace the official application identity, branding and signing configuration before distribution.

The [source inventory](../catalog.json) identifies exact files, versions and SHA-256 hashes. When starting from the repository, get published files from [official GitHub Releases](https://github.com/lanlet/lanlet.github.io/releases). On the [live website](https://lanlet.org/catalog.json), each published item has a verified releaseUrl; other items have a null link. Production software is distributed by GitHub Releases. If you do not yet have the CLI, you can still package the [two-file source example](example.md) using standard ZIP. From inside its app directory run `python3 -m zipfile -c ../example.score-button-1.0.0.lanlet manifest.json index.html`, then `python3 -m zipfile -t ../example.score-button-1.0.0.lanlet`. For a larger app include every local asset at its original relative path. Host import and device behavior need separate validation with the intended Lanlet version. A local rehearsal identifies its separate loopback release mirror explicitly. Get `linux-cli` on Linux x64 or `windows-cli` on Windows x64. Select the asset named in the inventory and verify the full SHA-256 before running the tool. On Linux use `sha256sum lanlet-linux-x64`; on Windows use `Get-FileHash .\lanlet-windows-x64.exe -Algorithm SHA256`. Use the actual inventory status when describing the build to the recipient.

The shell examples use Linux. Save the verified executable as `lanlet`, then run `chmod +x ./lanlet`. In PowerShell use `.\lanlet-windows-x64.exe` and a working directory on a local drive. Work in a fresh folder. The [score button source example](example.md) contains a complete offline app with a manifest. The [snapshot license](LICENSE.txt) accompanies the product specifications.

## Build and run

1. Put your deployable HTML, scripts, styles, offline assets and any required notices in `app/`. Bundle dependencies locally. Place a file named `manifest.json` directly inside it. Give your own creation its own ID.

   ```json
   {"id":"friends.score","name":"Table score","version":"1.0.0","entry":"index.html"}
   ```

2. Build a standard ZIP and start a private Host. `--port 0` selects a free directory port. When using the source example, substitute its own ID.

   ```sh
   ./lanlet pack app friends.score-1.0.0.lanlet
   ./lanlet check friends.score-1.0.0.lanlet
   ./lanlet --data library-a install friends.score-1.0.0.lanlet
   ./lanlet --data library-a serve --port 0
   ```

3. Open the printed directory URL, then the app. Exercise the main action. Keep loopback connected, block external requests in the browser and reload. Check the saved state and that every required resource loaded locally. Use localStorage or IndexedDB for device-specific state, with storage keys stable across app updates. For multiplayer, test with two separate browser sessions; consult the [Host Service spec](spec/host.md) before adding shared files or WebSockets.

4. Keep the ID, bump the version to `1.0.1`, make a visible change and repeat pack/check/install into `library-a`. Open the same app URL again and confirm the earlier state survives. Stop the first Host before starting another Host for the same ID on this machine.

5. Export and test delivery into a fresh library and browser profile.

   ```sh
   ./lanlet --data library-a export friends.score to-friend.lanlet
   ./lanlet check to-friend.lanlet
   cmp friends.score-1.0.1.lanlet to-friend.lanlet
   ./lanlet --data library-b install to-friend.lanlet
   ./lanlet --data library-b serve --port 0
   ```

6. Deliver the exported file, hash, ID, version, rights/credits, network needs and tested platform. A recipient with Lanlet installed on Android opens the file, confirms import, and launches the app. If the file opener does not list Lanlet, save it and choose it in Lanlet’s app library. The recipient starts with their own data. ZIP-compatible channels can carry the identical bytes with a `.zip` name.

[Package specification](spec/pack.md) · [Manifest field schema](manifest.schema.json) · [简体中文](start.zh.md)
