Initialize or export a microfeed theme
Prefer the clone-free npx @microfeed/cli manage launcher from any working
directory. A user who is already working inside a trusted microfeed clone may
use the project-owned yarn manage command instead. Use one prefix consistently
for the whole task. Read the theme section of
docs/manage-cli.md before using an unfamiliar
option.
Choose the repository identity
Run npx @microfeed/cli manage instances --json and select the exact saved instance the
user named. If several instances remain plausible, report their names and
ask the user to choose.
Use theme init when the user wants a new independently versioned theme
based on the site's effective appearance:
npx @microfeed/cli manage theme init <output-directory> --instance <instance-name> --json
Let the CLI choose the initial local.<directory-name> package ID unless
the user supplied a package ID, name, version, or author. The command
initializes Git by default; pass --no-git only when the user wants another
tool to initialize the repository.
Use theme export when the user wants to preserve one exact installed
package identity. Export the active installed version by default:
npx @microfeed/cli manage theme export --active --instance <instance-name> --git --json
When the user names an immutable theme ID, replace --active with that ID.
Let the CLI choose .microfeed/themes/<package-id>-<version>/ unless the
user supplied another empty output directory.
Read the JSON result and report the source selection, package ID, version,
output directory, and Git-initialization state. For export, also report the
exact immutable theme ID.
Initialization and export are read-only for the instance. Never install,
activate, deactivate, delete, or otherwise change a live theme as part of this
workflow. Git initialization does not stage, commit, create a remote, or push.
Verify the standalone repository
- Change into the returned output directory and read
README.md, THEME.md,
microfeed-theme.json, and both generated schemas completely.
- Run
yarn install, then yarn validate and yarn test. Do not use
dependencies from the parent microfeed workspace.
- Start
yarn preview with the bundled fixtures. Use --feed-url only when a
public feed is needed. Confirm the printed local URL responds, then stop the
preview process and confirm it exited.
- Show
git status and propose an initial commit message after every check
passes. Stop before staging, committing, creating a remote, pushing, or
opening a pull request unless the user explicitly requests those actions.
Handle failures safely
- Never delete, empty, or overwrite a non-empty destination. Use another
collision-resistant directory only with the user's approval.
- If Git initialization fails, keep and inspect the completed scaffold. Do not
rerun export into that now-non-empty directory.
- If no installed version is active during export, explain that
theme init
can derive a new identity from the effective fallback; do not silently
substitute it for an immutable export.
- If dependency installation is blocked, inspect the generated compatibility
range and local Yarn configuration. Do not disable package gates globally or
preapprove packages other than
@microfeed/theme-kit.
- Keep exports under
.microfeed/themes/ when they should share the coding
workspace. Do not use disposable dist/ output. Warn that ignored-file
cleanup can remove the local repository until it is committed and pushed
elsewhere.
At handoff, list the exact commands run and all remaining local-only state.
1---2name: export-microfeed-theme3description: Initialize or export a microfeed theme from a saved instance into an independent local repository, then install, validate, test, and preview it safely. Use when a coding agent is asked to initialize, export, copy, fork, inspect, or begin developing the active or a specific installed theme from a microfeed instance.4---56# Initialize or export a microfeed theme78Prefer the clone-free `npx @microfeed/cli manage` launcher from any working9directory. A user who is already working inside a trusted microfeed clone may10use the project-owned `yarn manage` command instead. Use one prefix consistently11for the whole task. Read the theme section of12[`docs/manage-cli.md`](../../../docs/manage-cli.md) before using an unfamiliar13option.1415## Choose the repository identity16171. Run `npx @microfeed/cli manage instances --json` and select the exact saved instance the18 user named. If several instances remain plausible, report their names and19 ask the user to choose.202. Use `theme init` when the user wants a new independently versioned theme21 based on the site's effective appearance:2223 ```console24 npx @microfeed/cli manage theme init <output-directory> --instance <instance-name> --json25 ```2627 Let the CLI choose the initial `local.<directory-name>` package ID unless28 the user supplied a package ID, name, version, or author. The command29 initializes Git by default; pass `--no-git` only when the user wants another30 tool to initialize the repository.313. Use `theme export` when the user wants to preserve one exact installed32 package identity. Export the active installed version by default:3334 ```console35 npx @microfeed/cli manage theme export --active --instance <instance-name> --git --json36 ```3738 When the user names an immutable theme ID, replace `--active` with that ID.39 Let the CLI choose `.microfeed/themes/<package-id>-<version>/` unless the40 user supplied another empty output directory.414. Read the JSON result and report the source selection, package ID, version,42 output directory, and Git-initialization state. For export, also report the43 exact immutable theme ID.4445Initialization and export are read-only for the instance. Never install,46activate, deactivate, delete, or otherwise change a live theme as part of this47workflow. Git initialization does not stage, commit, create a remote, or push.4849## Verify the standalone repository50511. Change into the returned output directory and read `README.md`, `THEME.md`,52 `microfeed-theme.json`, and both generated schemas completely.532. Run `yarn install`, then `yarn validate` and `yarn test`. Do not use54 dependencies from the parent microfeed workspace.553. Start `yarn preview` with the bundled fixtures. Use `--feed-url` only when a56 public feed is needed. Confirm the printed local URL responds, then stop the57 preview process and confirm it exited.584. Show `git status` and propose an initial commit message after every check59 passes. Stop before staging, committing, creating a remote, pushing, or60 opening a pull request unless the user explicitly requests those actions.6162## Handle failures safely6364- Never delete, empty, or overwrite a non-empty destination. Use another65 collision-resistant directory only with the user's approval.66- If Git initialization fails, keep and inspect the completed scaffold. Do not67 rerun export into that now-non-empty directory.68- If no installed version is active during export, explain that `theme init`69 can derive a new identity from the effective fallback; do not silently70 substitute it for an immutable export.71- If dependency installation is blocked, inspect the generated compatibility72 range and local Yarn configuration. Do not disable package gates globally or73 preapprove packages other than `@microfeed/theme-kit`.74- Keep exports under `.microfeed/themes/` when they should share the coding75 workspace. Do not use disposable `dist/` output. Warn that ignored-file76 cleanup can remove the local repository until it is committed and pushed77 elsewhere.7879At handoff, list the exact commands run and all remaining local-only state.