Task: Update Project Integration with flowai
Overview
Reconcile project-owned flowai artifacts with the currently installed framework templates. This command does not manage the flowai CLI, does not sync or rewrite installed primitives, and does not adapt skills or agents. CLI lifecycle belongs to the standalone flowai CLI repository. Primitive adaptation belongs to adapt.
Context
Project-owned artifacts:
AGENTS.mdCLAUDE.mdwhen it is a project compatibility file or symlink- scaffolded project docs/configs created by flowai setup commands
Read-only framework sources:
- project-local asset copies such as
.{ide}/assets/AGENTS.template.md - skill-local plugin assets such as
.{ide}/skills/update/assets/AGENTS.template.md - user-level assets such as
~/.claude/assets/AGENTS.template.mdor~/.codex/assets/AGENTS.template.md - plugin cache files
If project-local flowai primitives exist under .{ide}/skills/, .{ide}/agents/, hooks, or scripts, this command reports that they can be adapted with adapt. It must not rewrite them.
Rules & Constraints
Instructions
Detect scope and arguments
- Work from the current project root.
- Parse flags:
- no args or
--all-> check instructions and scaffolded artifacts. --instructions-> check onlyAGENTS.md/CLAUDE.md.--scaffolds-> check only known scaffolded project artifacts.
- no args or
- Detect project IDE config dirs:
.claude/,.cursor/,.opencode/,.codex/.
Locate AGENTS template sources (for
--instructions/--all)- Check skill-local plugin asset paths first. When present, these are the most accurate source for plugin/user-level installs because the asset was copied next to the invoking command:
.claude/skills/update/assets/AGENTS.template.md.cursor/skills/update/assets/AGENTS.template.md.opencode/skills/update/assets/AGENTS.template.md.codex/skills/update/assets/AGENTS.template.md- namespace-stripped plugin paths such as
*/skills/update/assets/AGENTS.template.mdwhen visible in the project.
- Then check project-local asset paths:
.claude/assets/AGENTS.template.md.cursor/assets/AGENTS.template.md.opencode/assets/AGENTS.template.md.codex/assets/AGENTS.template.md
- Check user-level paths:
~/.claude/assets/AGENTS.template.md~/.cursor/assets/AGENTS.template.md~/.config/opencode/assets/AGENTS.template.md~/.codex/assets/AGENTS.template.md
- If any skill-local plugin asset exists, use it as the authoritative template source for this run. If other templates differ, report them as secondary/stale sources; do not switch to a project-local or user-level template by modified time.
- If no skill-local template exists and multiple same-tier templates differ, report the paths and choose the newest modified file only after warning the user.
- If none exist, stop with: "AGENTS.template.md not found. Update or install flowai through your plugin manager or flowai CLI, then rerun update."
- Check skill-local plugin asset paths first. When present, these are the most accurate source for plugin/user-level installs because the asset was copied next to the invoking command:
Read project instructions artifacts
- Read
./AGENTS.md. - If
AGENTS.mdis missing, stop and tell the user to runinitfirst. Do not create a new root file here. - Inspect
./CLAUDE.md:- If it is a symlink to
AGENTS.md, it is up to date. - If missing in a Claude Code project, propose creating a compatibility symlink to
AGENTS.md. - If it is a regular file, compare it with
AGENTS.md; propose replacing it with a symlink only after showing the diff/risk.
- If it is a symlink to
- Read
Compare template against project artifact
- Compare template content against
AGENTS.md. - Ignore unresolved placeholders such as
{{PROJECT_NAME}}and{{TOOLING_STACK}}. - Focus on framework-originated sections: core rules, documentation rules, planning rules, TDD flow, acceptance-test flow, development commands, and safety constraints.
- Classify each difference:
- framework section missing or outdated -> propose update.
- project-specific section -> preserve.
- framework section customized by project -> propose a merge that keeps local constraints.
- obsolete legacy sections (
documents/AGENTS.md,scripts/AGENTS.md) -> propose collapsing them into rootAGENTS.md.
- When a section has missing named rules, list each missing rule by name instead of summarizing the count. For Planning Rules, explicitly name missing rules such as
Proactive Resolution.
- Compare template content against
Check scaffolded artifacts (for
--scaffolds/--all)- Use known scaffold mappings from visible pack metadata when available. Also resolve documentation roles from AGENTS.md; for documentation artifacts, role bindings override template defaults.
- Default known project scaffolds by role/type:
SRSSDS.devcontainer/devcontainer.json.devcontainer/Dockerfile.devcontainer/init-firewall.sh.devcontainer/setup-container.shdeno.jsonscripts/check.ts
- Only compare files that already exist in the project unless an explicit scaffold mapping says a missing file should exist.
- Read the corresponding template/source if visible in the project-local install or skill-local plugin assets. If no source is visible, skip with a clear note instead of guessing.
- Propose updates only when a framework-originated section is stale.
Detect local primitives but do not adapt them
- Look for project-local flowai primitives:
.{ide}/skills/flowai-*.{ide}/skills/*matching installed framework primitive names.{ide}/agents/*matching installed framework agent names- flowai hook/script files under project IDE config dirs
- Do not edit those files.
- If any exist, report: "Project-local flowai primitives detected. Run adapt for primitive adaptation."
- Look for project-local flowai primitives:
Propose changes
- For each affected artifact, show:
- source template path
- current project section
- proposed project section
- reason for the change, including the practical risk or benefit. Example: if proposing the TDD
CHECKstep, explain that skipping it leaves formatter, linter, and regression failures undetected after GREEN.
- Use a unified diff or compact before/after blocks.
- Keep proposals per file so the user can approve or reject each one.
- For each affected artifact, show:
Apply approved changes
- Ask for confirmation before each file write.
- Apply only approved project-artifact edits.
- Never modify read-only template/source files.
- Never stage or commit unless the user explicitly asks.
Verify
- Show the resulting
git diff -- AGENTS.md CLAUDE.md <resolved-SRS> <resolved-SDS> .devcontainer deno.json scripts/check.tslimited to touched files. - Confirm plugin/user-level files and installed primitives were not modified.
- End with a short summary of updated, skipped, and deferred items.
- Show the resulting