=== UAI-1 Project Handoff ===
Contributors: uaix
Tags: ai, uai, uaix, prompts, handoff, import, export, json, zip
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

UAIX-produced experimental/internal prototype for exporting, importing, validating, previewing, and managing UAI-1 Project Handoff packages in WordPress.

== Description ==

UAI-1 Project Handoff is an experimental/internal prototype for managing AI project files in WordPress. It creates portable handoff packages containing prompts, conversations, model metadata, provenance, generated content references, project context, root human briefing, active file-intake folders, and validation evidence.

UAIX.org is the source-of-truth producer and distribution surface for this WordPress package. Test sites such as LlmWikis.org should consume the UAIX-published `uai1-project-handoff-v2.8.0.zip` artifact for this shared baseline instead of treating their local copy as canonical source.

The prototype follows the current UAIX Project Handoff direction by generating:

* `uai1-manifest.json` at the ZIP root.
* Optional `uai1-manifest.keyless.json` compact manifest.
* `AGENTS.md` as the project coordination file.
* `readme.human` as the human-facing briefing from the AI perspective.
* `.uai/context.uai`, `.uai/stack.uai`, `.uai/architecture.uai`, `.uai/constraints.uai`, `.uai/decisions.uai`, `.uai/progress.uai`, `.uai/operations.uai`, `.uai/test-plan.uai`, `.uai/style.uai`, `.uai/sources.uai`, `.uai/prompts.uai`, `.uai/file-handoff.uai`, and `.uai/intake-index.uai`.
* Standard folders: `/prompts/`, `/conversations/`, `/assets/`, `/models/`, `/code/`, `/metadata/`, `/evidence/`, `/content/`, and `/agent-file-handoff/`.
* Chat-start file-intake scaffolding: `/agent-file-handoff/Content/`, `/agent-file-handoff/Improvement/`, `/agent-file-handoff/Archive/`, and `.uai/intake-index.uai`.

The plugin does not claim UAIX certification, endorsement, official generator support, or official validator support. Treat it as an implementation-oriented internal prototype until published UAIX tooling and evidence exist.

== Features ==

* Top-level admin menu: UAI-1 Handoff.
* Dashboard with export, import, and validation counts.
* Custom post type: `uai_project`.
* Taxonomies: AI Model, Prompt Type, Project Phase.
* Metadata fields for model family, model ID, temperature, context length, handoff notes, prompts, outputs, conversation JSON, provenance JSON, and manifest extras.
* Export selected AI Projects, posts, pages, or custom post types.
* Include media as references or embed featured media assets.
* Generate experimental ZIP packages with manifest, AGENTS.md, readme.human, context files, prompts, conversations, metadata, content, models, code index, and validation report.
* Generate a local file-intake workspace so a project can receive dropped files from humans, other AI systems, or adjacent tools and have the next AGENTS.md load process inspect, summarize, and disposition them before unrelated broad work.
* Import ZIP packages, validate structure with UAIX Core when available, preview the report, and optionally apply as AI Project posts only after validation passes.
* Conflict handling: duplicate, merge, or overwrite.
* Prototype REST endpoints: `/wp-json/uai1/v1/export/{id}`, `/import`, `/validate`.
* Prototype WP-CLI command: `wp uai1 export`.
* Capability-based security: `manage_uai_handoffs`, `export_uai_handoffs`, `import_uai_handoffs`.
* ZIP preflight checks for size, file count, path safety, and package path allowlists.
* Activation smoke-test record and scheduled cleanup for old package files.
* Internationalization-ready.
* Lightweight and dependency-free except for WordPress core and PHP ZipArchive.

== Installation ==

1. Upload the `uai1-project-handoff` folder to `/wp-content/plugins/` or install the ZIP package from Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Go to UAI-1 Handoff > Settings and review default author and JSON settings.
4. Create an AI Project under UAI-1 Handoff > AI Projects.
5. Use UAI-1 Handoff > Export to download a package.

== Usage ==

= Export =

1. Go to UAI-1 Handoff > Export.
2. Enter a project name and version.
3. Choose post types or specific post IDs.
4. Choose whether to embed media or keep references only.
5. Optionally include the compact keyless manifest.
6. Click Download Handoff Package.

= Import =

1. Go to UAI-1 Handoff > Import.
2. Upload a UAI-1 handoff ZIP package.
3. Select duplicate, merge, or overwrite conflict handling.
4. Choose whether to apply imported data to the site.
5. Review the validation report.

= REST =

Export a project:

`POST /wp-json/uai1/v1/export/123`

Import a package using multipart form-data:

`POST /wp-json/uai1/v1/import` with file field `package`.

Validate a package using multipart form-data:

`POST /wp-json/uai1/v1/validate` with file field `package`.

= WP-CLI =

`wp uai1 export --id=123`

`wp uai1 export --post_type=uai_project --include_media=references`

== Frequently Asked Questions ==

= Does this certify my package as UAIX compliant? =

No. The plugin creates and validates a practical WordPress handoff package prototype. Do not describe exported packages as UAIX-certified, UAIX-endorsed, officially generated, or officially validated unless you have separate published validator/conformance evidence.

= Does it call an AI model? =

No. The plugin stores and exports AI project metadata. It detects whether the WordPress AI Client is available, but export/import runs locally and does not send prompts to any AI provider.

= Where are packages stored? =

Temporary package files are stored under WordPress uploads in a protected `uai1-handoffs` directory and served through a capability-checked admin download action.

= What is the intake folder for? =

The `/agent-file-handoff/Content/` and `/agent-file-handoff/Improvement/` folders are local review workspaces. Drop candidate public or editorial material into `Content`, and audits, QA findings, SEO reports, bug notes, roadmap suggestions, or site-fix work into `Improvement`. Have the next AGENTS.md load process scan those active buckets, and inspect, summarize, and disposition any `needs-agent-review` file in the refreshed `.uai/intake-index.uai` before unrelated broad work. Move processed files into `/agent-file-handoff/Archive/`; routine AI intake ignores archived files unless a human explicitly names one or moves it back into an active bucket. If archived reports are later consolidated into an LLM Wiki or AIWikis-style memory layer, preserve the original processed files with source paths, destination paths, file counts, checksums, dispositions, and summary/index updates before treating summaries or staged artifacts as enough. For production deployment or release-package work, the release output must include a durable deployment memory and test run report with active short-term memory surface size before and after hot/cold reorganization: bytes, lines, estimated tokens, removed redundancy/history, cold evidence path, checks run, checks skipped, and blockers. Watchers, daemons, queue folders, bucket README files, always-on pickup manifests, and background services are outside the base pattern.

= Can it include data from other AI plugins? =

It detects common AI plugin presence and exposes filters so developers can add plugin-specific snippets, manifest extensions, or export data.

== Screenshots ==

1. Dashboard screen showing recent projects and package statistics.
2. Export screen with project scope, media handling, compression, and compact manifest options.
3. Import screen with drag-and-drop upload and conflict resolution.
4. AI Project editor with UAI metadata, conversation, prompts, and preview/export panel.
5. Validation report with errors, warnings, created projects, and raw JSON.

== Hooks and Filters ==

`uai1_project_handoff_manifest` filters the generated keyed manifest.

`uai1_project_handoff_manifest_extensions` adds extension records to the manifest.

`uai1_project_handoff_code_snippets` adds code snippet records to `/code/code-snippets.json`.

`uai1_project_handoff_detected_ai_plugins` customizes detected AI plugin metadata.

== Changelog ==

= 0.2.5 =

* Hardened generated AGENTS.md, readme.human, `.uai/file-handoff.uai`, and `.uai/intake-index.uai` so LLM Wiki or AIWikis archive consolidation requires original report preservation evidence, not only summaries or staged outputs.
* Added release-bound hot-memory size reporting guidance so production deployment outputs include a durable memory and test run report naming active short-term memory size before and after reorganization.
* Clarified that source archive copies should not be removed until raw destination paths, file counts, checksums, dispositions, and discoverable summary/index updates exist.

= 0.2.4 =

* Expanded generated Project Handoff packages with the fuller `.uai` handoff set: architecture, decisions, operations, test plan, style, and sources records.
* Fixed ZIP path validation so `agent-file-handoff/` is an allowed top-level package folder, matching the existing recommended folder checks.
* Removed the legacy `/intake/` folder from new exports while preserving import compatibility for older packages.

= 0.2.3 =

* Replaced the simple `/intake/` package scaffold with `/agent-file-handoff/Content/`, `/agent-file-handoff/Improvement/`, and ignored `/agent-file-handoff/Archive/` folders.
* Updated exported AGENTS.md, readme.human, `.uai/file-handoff.uai`, `.uai/intake-index.uai`, manifest metadata, validation folder checks, and admin copy for dead-archive behavior and no bucket-local README guidance.

= 0.2.2 =

* Added root `readme.human` to generated Project Handoff packages as the human-facing briefing companion to `AGENTS.md`.

= 0.2.1 =

* Added `.uai/intake-index.uai` to generated Project Handoff packages so loader context matches the active Agent File Handoff pattern.
* Simplified file intake to a direct AGENTS.md-triggered folder scan and immediate review gate with no watcher/daemon, queue-folder, or manifest requirement.

= 0.2.0 =

* Added active file-intake folder metadata, `.uai/file-handoff.uai`, and `.uai/intake-index.uai` to generated Project Handoff packages.
* Added manifest metadata for the Agent File Handoff public page and local intake boundary.
* Updated validation allowlists and admin copy for packages that include the intake workspace.

= 0.1.0 =

* Experimental/internal prototype.
* UAI-1 manifest export aligned to the current public `uai.intent.request.v1` shape.
* Project Handoff AGENTS.md, readme.human, and `.uai` context export.
* Import, validation, REST, WP-CLI, settings, AI Project management, ZIP preflight checks, cleanup scheduling, and activation smoke testing.

== Upgrade Notice ==

= 0.2.5 =
Adds raw original report preservation guidance for LLM Wiki or AIWikis archive consolidation.

= 0.2.4 =
Updates generated packages to include the fuller handoff context set and fixes the `agent-file-handoff/` package path allowlist.

= 0.2.3 =
Updates generated package scaffolding to the current Agent File Handoff bucket and archive pattern.

= 0.2.2 =
Adds the root human briefing file expected by active Project Handoff loaders.

= 0.2.1 =
Adds the generated intake index file expected by active Agent File Handoff loaders and clarifies that listed files require review before unrelated broad work.

= 0.2.0 =
Adds the local intake workspace used for active file handoff. Intake records remain draft project state until human review promotes them.

= 0.1.0 =
Experimental/internal prototype. Do not treat this package as official UAIX tooling or public conformance evidence.
