agentleFS
PiloTracerPiloTracer/pilo.ai.logicbison/skills/deploy-files/skill.md

deploy-files

Skill0 starsChanged 5 months agoMITView on GitHub

Deploy Agent OS framework files into a target project. Two directions: (1) in-place bootstrap — invoked from a TARGET project, copies the source framework files in without overwriting existing files, then scaffolds .work/ + .cursorrules; (2) outbound copy — invoked from the source Agent OS repo, copies into an explicit <path>. `update` mode additionally performs a rules-aware merge of existing-but- differing files (append new rules, update shared sections, preserve target customizations + REPLACE: tokens; never wholesale-replace). Copies only git-tracked / non-ignored files (anything in .gitignore is never copied). Use deploy-files (default), deploy-files update, deploy-files copy - <path>, deploy-files status.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Operator handoff: every response that ends a turn follows the Operator handoff contract — terse output.

    line 31
  2. Very specific:

    When invoked from a target project (cwd has no scripts/deploy-files.sh):

    line 65
  3. Very specific:

    Auto: if the script can be located at a known source path (user named it, or sibling .ai discoverable per .cursorrules § Frameworks …

    line 67
  4. Very specific:

    Ask once: if source is unknown, ask the user for the source framework path (e.g.

    line 68
  5. Very specific:

    When invoked in-place (bare @deploy-files or @deploy-files update), after the copy pass run the .work/ + .cursorrules + DOCS_TECH_STACK.md …

    line 90
  6. Distinctive:

    After I1 (no-overwrite copy) the script:

    line 112
  7. Distinctive:

    Read source version and target version.

    line 136
  8. Very specific:

    Write merged result to target.

    line 141
  9. Very specific:

    All agents: ensure .cursorrules exists (scaffold creates it in-place.

    line 189
  10. Very specific:

    opencode users: if opencode.json is missing, run:

    line 190

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

deploy-files

Two-direction deploy of the .ai framework into a target project so the project can use Agent OS skills. Default = no-overwrite: existing target files are preserved by construction.

Shell: bash <source>/scripts/deploy-files.sh <target-path> [mode] Scaffold shell: REPO_ROOT=<target> bash <source>/templates/bootstrap.sh

Canonical path: .ai/skills/deploy-files/skill.md · Shell: .ai/scripts/deploy-files.sh

Security invariant: The script enumerates files via git ls-files --cached --others --exclude-standard from the source framework repo root, so anything .gitignore excludes (credentials, private context, tmp/, …) is never copied — enforced by construction, not a hand-maintained list. The source must be a git repo with the framework files (skills/, scripts/, templates/, etc.) at its root.

Source not modified. deploy-files only writes to the target. The source framework is read-only (script enumerates it via git ls-files).

Scope: deploy-files copies only the framework files (skills/, standards/, concepts/, docs/, scripts/, templates/, etc.; no VCS artifacts, no .github/). There is no full-repo deploy mode — mirror the repo via plain git clone out-of-band if needed.

  • Operator handoff: every response that ends a turn follows the Operator handoff contract — terse output; approvals under **Needs your approval:** citing path:L<n>; questions numbered under **Needs your answer:**; exactly one **Next step:** command; one line when nothing is needed (Form A). Decisions and questions never mixed; empty sections omitted.

Parse invocation

User saysDirectionMode
@deploy-filesin-place (cwd is target)copy no-overwrite + scaffold no-overwrite
@deploy-files updatein-place (cwd is target)copy no-overwrite + scaffold no-overwrite + rules-aware merge + opencode.json --sync-paths + cursorrules-verify.sh --fix (sister cells)
@deploy-files copy - /path/to/repooutbound (source = this repo)copy no-overwrite to /path/to/repo/.ai
@deploy-files copy - /path/to/repo --forceoutboundcopy with idempotent overwrite of existing files (legacy)
@deploy-files statusreport.ai/skills presence + .cursorrules verification (via cursorrules-verify.sh) + opencode.json presence

Argument equivalence (script + this table): verbs accept the -- prefix or bare form — update ≡ --update, status ≡ --status, force ≡ --force. copy is the explicit form of the default copy mode. A - / -- token is a separator and is dropped. The target path may appear in any position: @deploy-files copy - /path ≡ @deploy-files /path ≡ @deploy-files -- /path copy.

Default: status if no verb matches; if invoked bare with no .ai/ in cwd → in-place bootstrap (copy in-place per § I0).

Aliases: bootstrap, in-place → bare @deploy-files.


I0 — Pre-checks (both directions)

ConditionAction
Source is not a git repo, or framework files are not at the repo rootBlock: report; deploy-files relies on git ls-files from the source repo root as the authority
Target parent dir does not existBlock: report missing path
Destination exists and is not a dirBlock: report conflict
Destination already has .ai/Proceed with no-overwrite; report skipped count (default)
--force requested and destination populatedWarn that target customizations will be overwritten; require explicit --force in the same invocation

Source resolution (in-place direction)

When invoked from a target project (cwd has no scripts/deploy-files.sh):

  1. Auto: if the script can be located at a known source path (user named it, or sibling .ai discoverable per .cursorrules § Frameworks registry auto-discovery from .ai parent), use it.
  2. Ask once: if source is unknown, ask the user for the source framework path (e.g. /mnt/work/Projects/pilo.ai.logicbison). Do not guess.
  3. Optional skills path override: user may name a skills location (/path/skills); default is <source>/skills. Recorded in the start report only; the script enumerates the whole source, so an explicit skills path is informational unless the user wants a partial deploy (then surface as Unverified — partial deploy unsupported by script).
  4. Source determined → run the shell from the target directory:
    cd <target> && bash <source>/scripts/deploy-files.sh . <mode>
    # or override source via env:
    AI_SOURCE=<source> bash <source>/scripts/deploy-files.sh . <mode>

I1 — Copy mode (no-overwrite by default)

  1. bash <source>/scripts/deploy-files.sh "<resolved-target>" (default) — or --force / --update per parse-invocation.
  2. File set: git ls-files --cached --others --exclude-standard from the source repo root — i.e. every file not excluded by .gitignore. Anything gitignored (.credentials/, .private/, tmp/, …) is never copied.
  3. Skill-level omissions (intentional, on top of the git-based set): .github/, .gitignore, .gitattributes, .cursorrules, scripts/deploy-files.sh (the deploy script itself — run from source repo, not consumer concern), agent.os.framework.md (framework source marker — never deployed; a consumer carrying it would be misdetected as framework source by session-control repo-mode detection).
  4. No-overwrite default: rsync --ignore-existing skips any file already present in the target. Target-side customizations are preserved by construction. --force drops that flag (legacy idempotent overwrite; still no --delete). --update keeps no-overwrite and additionally emits the merge candidate list (existing-but-differing files) for § I3.

I2 — Scaffold (in-place direction only)

When invoked in-place (bare @deploy-files or @deploy-files update), after the copy pass run the .work/ + .cursorrules + DOCS_TECH_STACK.md scaffold into the target using the source templates (no-overwrite — bootstrap.sh uses copy_if_missing):

REPO_ROOT="$(pwd)" bash <source>/templates/bootstrap.sh

This is the same scaffold @project-bootstrap init performs; in-place @deploy-files simply chains it so the target ends with .ai/ + .work/ + .cursorrules in one invocation. Outbound copy - <path> does NOT scaffold — it leaves next-step instructions for the user to run @project-bootstrap init in the target (preserves the legacy contract).

Scaffold honor table (no-overwrite):

Target pathIf exists
.work/** skeleton filesskip (preserve)
Project-root standards/.gitkeep, docs/integration/.gitkeepskip (preserve) — deprecated paths; use .work/standards/ + .work/docs/integration/ (bootstrap no longer creates repo-root dirs)
.cursorrulesskip (preserve)
DOCS_TECH_STACK.mdskip (preserve)
opencode.jsoncreate if missing via install-opencode-config.sh; on --update run --sync-paths only (.opencode/ MCP dir never touched)

I3 — update-merge protocol (@deploy-files update only)

After I1 (no-overwrite copy) the script:

  1. Prints a merge candidate list for differing files under .ai/ (the vendored fat-client copy — never .work/standards/ or .work/docs/integration/, which are project memory and never merge candidates).
  2. Runs install-opencode-config.sh --sync-paths on the consumer repo root (fat-client .ai/skills paths; preserves custom mcp entries).
  3. Runs cursorrules-verify.sh --fix on the consumer root when a .cursorrules exists — repairs sister-framework cells (fills installed-sister tokens, re-points stale baked absolutes) — and reports the verification verdict. (Thin-client source-pointer/script-path repair is @deploy-basic update's domain.)
  4. The agent performs rules-aware merge for each .ai/ merge candidate (agent work, not script work).

Framework-owned file classes (all paths relative to <target>/.ai/; merge applies; preserve target customizations):

ClassExamplesMerge rule
Skills.ai/skills/<skill>/skill.md, reference.mdAppend new sections/rules absent in target; update shared sections where source changed; never drop target-only verbs/tables/notes
Standards (vendored copy, template/example docs).ai/standards/*.mdAppend new sections; update shared section text where source changed; preserve dated target overrides. Not .work/standards/*.md the target generates for itself via @plan-foundation — that tree is never a merge candidate.
Framework docs.ai/README.md, .ai/PROCESS_ROUTER.md, .ai/START_HERE.md, .ai/concepts/, .ai/docs/guides/Append new sections; update shared paragraphs where source changed; preserve target examples/paths
Templates.ai/templates/**Prefer source version (templates are framework-owned); but if target edited a template intentionally, keep target + record in report
Scripts.ai/scripts/**Prefer source version (mechanical); overwrite target copy → record in report

Preserve invariants (never drop):

  • Target REPLACE: tokens the user has filled (the merge must keep target values, not source REPLACE:* placeholders).
  • Target-only skill folders not present in source (custom skills).
  • Target additions to any table (rows the source doesn't have).
  • Target date-stamped filenames (YYYYMMDD-*).

Merge procedure per candidate:

  1. Read source version and target version.
  2. Diff structurally (sections by ##/### headings, then list rows / table rows).
  3. For each shared section whose source text changed: apply source change but keep target-only rows/lines inside it.
  4. For each source-only section absent in target: append it.
  5. For each target-only section absent in source: keep unchanged.
  6. Write merged result to target. Record merged: <path> in the report.
  7. Never wholesale-replace a file the target already owned.

Unverified, do not merge blindly: binary files, lockfiles, anything under tmp/. Report and skip.


Completion

#CheckResult
1Source repo is a git repo with framework files at its rootpass
2Destination .ai/ exists after copy
3No .gitignored content in destination (.credentials/, .private/, tmp/, …)
4.github/ excluded from destination
5.cursorrules excluded from copy (created by scaffold or @project-bootstrap init)
6No-overwrite honored (skipped count reported; --force only when explicitly requested)
7Scaffold ran into target (in-place only); target .work/ + .cursorrules + empty .work/standards/ + .work/docs/integration/ present
8update: merge candidate list processed; each merged file recorded; no wholesale replaces
9User informed of next steps

End the report with the Operator handoff close (Form A Next: … or Form B **Needs your approval:** / **Needs your answer:** / **Next step:**) per SKILL_DEPENDENCIES.md.

Next commands (in target project)

@session-control start

(In-place @deploy-files already scaffolded .work/ + .cursorrules; @project-bootstrap init is only needed for the outbound copy - <path> direction.)

Any operator-required approval or question raised anywhere in the report must ALSO appear in the closing handoff block (enumerated, with path:line), not only in this section. End the report with the Operator handoff close (Form A Next: … or Form B **Needs your approval:** / **Needs your answer:** / **Next step:**) per SKILL_DEPENDENCIES.md.


Coding-agent config (tool-agnostic)

Agent OS skills and standards are tool-agnostic — they are plain markdown invoked by name (@session-control, @deploy-files, …). Each coding agent still needs a host config so it loads the right instructions and skill paths:

AgentConfig fileWhat Agent OS uses it for
opencodeopencode.json (repo root)instructions, skills.paths, optional mcp
Cursor.cursorrules (repo root)Agent rules; optional .cursor/mcp.json for MCP
Claude Code.claude/settings.json or .claude/mcp.jsonMCP registration
Codex / otherper tool docsProvide skill paths + rules equivalent to .cursorrules

After deploy (operator checklist):

  1. All agents: ensure .cursorrules exists (scaffold creates it in-place; outbound needs @project-bootstrap init).
  2. opencode users: if opencode.json is missing, run:
    REPO_ROOT="$(pwd)" bash .ai/scripts/install-opencode-config.sh
    # thin-client (no local .ai/): bash "$AGENT_OS_SOURCE/scripts/install-opencode-config.sh"
    Review paths: fat-client → .ai/skills, .ai/START_HERE.md; thin-client → absolute $AGENT_OS_SOURCE/skills.
  3. MCP (optional): @project-query-setup install detects opencode.json, .cursor/mcp.json, etc. and registers tools-project after operator confirmation.
  4. Verify: invoke @session-control start from your agent — it should load .ai/skills/session-control/skill.md (fat) or $AGENT_OS_SOURCE/skills/session-control/skill.md (thin).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.