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.
In this repository22 other files it gives its agents.
- ai-directorSkill
- code-implementationSkill
- code-repairSkill
- code-verifySkill
- concept-runSkill
- db-migrationSkill
- deploy-basicSkill
- dev-stackSkill
- docsSkill
- feature-specSkill
- infra-terraformSkill
- plan-foundationSkill
- plan-masterSkill
- plan-repairSkill
- plan-syncSkill
- plan-verifySkill
- process-routerSkill
- project-bootstrapSkill
- project-query-setupSkill
- session-controlSkill
- tauri-developmentSkill
- x-directorSkill
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
- Very specific: line 31
Operator handoff: every response that ends a turn follows the Operator handoff contract — terse output.
- Very specific: line 65
When invoked from a target project (cwd has no scripts/deploy-files.sh):
- Very specific: line 67
Auto: if the script can be located at a known source path (user named it, or sibling .ai discoverable per .cursorrules § Frameworks …
- Very specific: line 68
Ask once: if source is unknown, ask the user for the source framework path (e.g.
- Very specific: line 90
When invoked in-place (bare @deploy-files or @deploy-files update), after the copy pass run the .work/ + .cursorrules + DOCS_TECH_STACK.md …
- Distinctive: line 112
After I1 (no-overwrite copy) the script:
- Distinctive: line 136
Read source version and target version.
- Very specific: line 141
Write merged result to target.
- Very specific: line 189
All agents: ensure .cursorrules exists (scaffold creates it in-place.
- Very specific: line 190
opencode users: if opencode.json is missing, run:
≈ “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.
Files
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:**citingpath: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 says | Direction | Mode |
@deploy-files | in-place (cwd is target) | copy no-overwrite + scaffold no-overwrite |
@deploy-files update | in-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/repo | outbound (source = this repo) | copy no-overwrite to /path/to/repo/.ai |
@deploy-files copy - /path/to/repo --force | outbound | copy with idempotent overwrite of existing files (legacy) |
@deploy-files status | report | .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)
| Condition | Action |
| Source is not a git repo, or framework files are not at the repo root | Block: report; deploy-files relies on git ls-files from the source repo root as the authority |
| Target parent dir does not exist | Block: report missing path |
| Destination exists and is not a dir | Block: report conflict |
Destination already has .ai/ | Proceed with no-overwrite; report skipped count (default) |
--force requested and destination populated | Warn 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):
- Auto: if the script can be located at a known source path (user named it, or sibling
.aidiscoverable per.cursorrules§ Frameworks registry auto-discovery from.aiparent), use it. - 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. - 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). - 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)
bash <source>/scripts/deploy-files.sh "<resolved-target>"(default) — or--force/--updateper parse-invocation.- File set:
git ls-files --cached --others --exclude-standardfrom the source repo root — i.e. every file not excluded by.gitignore. Anything gitignored (.credentials/,.private/,tmp/, …) is never copied. - 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). - No-overwrite default:
rsync --ignore-existingskips any file already present in the target. Target-side customizations are preserved by construction.--forcedrops that flag (legacy idempotent overwrite; still no--delete).--updatekeeps 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.shThis 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 path | If exists |
.work/** skeleton files | skip (preserve) |
Project-root standards/.gitkeep, docs/integration/.gitkeep | skip (preserve) — deprecated paths; use .work/standards/ + .work/docs/integration/ (bootstrap no longer creates repo-root dirs) |
.cursorrules | skip (preserve) |
DOCS_TECH_STACK.md | skip (preserve) |
opencode.json | create 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:
- 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). - Runs
install-opencode-config.sh --sync-pathson the consumer repo root (fat-client.ai/skillspaths; preserves custommcpentries). - Runs
cursorrules-verify.sh --fixon the consumer root when a.cursorrulesexists — 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.) - 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):
| Class | Examples | Merge rule |
| Skills | .ai/skills/<skill>/skill.md, reference.md | Append 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/*.md | Append 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 sourceREPLACE:*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:
- Read source version and target version.
- Diff structurally (sections by
##/###headings, then list rows / table rows). - For each shared section whose source text changed: apply source change but keep target-only rows/lines inside it.
- For each source-only section absent in target: append it.
- For each target-only section absent in source: keep unchanged.
- Write merged result to target. Record
merged: <path>in the report. - Never wholesale-replace a file the target already owned.
Unverified, do not merge blindly: binary files, lockfiles, anything under tmp/. Report and skip.
Completion
| # | Check | Result |
| 1 | Source repo is a git repo with framework files at its root | pass |
| 2 | Destination .ai/ exists after copy | |
| 3 | No .gitignored content in destination (.credentials/, .private/, tmp/, …) | |
| 4 | .github/ excluded from destination | |
| 5 | .cursorrules excluded from copy (created by scaffold or @project-bootstrap init) | |
| 6 | No-overwrite honored (skipped count reported; --force only when explicitly requested) | |
| 7 | Scaffold ran into target (in-place only); target .work/ + .cursorrules + empty .work/standards/ + .work/docs/integration/ present | |
| 8 | update: merge candidate list processed; each merged file recorded; no wholesale replaces | |
| 9 | User 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:
| Agent | Config file | What Agent OS uses it for |
| opencode | opencode.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.json | MCP registration |
| Codex / other | per tool docs | Provide skill paths + rules equivalent to .cursorrules |
After deploy (operator checklist):
- All agents: ensure
.cursorrulesexists (scaffold creates it in-place; outbound needs@project-bootstrap init). - opencode users: if
opencode.jsonis missing, run:
Review paths: fat-client →REPO_ROOT="$(pwd)" bash .ai/scripts/install-opencode-config.sh # thin-client (no local .ai/): bash "$AGENT_OS_SOURCE/scripts/install-opencode-config.sh".ai/skills,.ai/START_HERE.md; thin-client → absolute$AGENT_OS_SOURCE/skills. - MCP (optional):
@project-query-setup installdetectsopencode.json,.cursor/mcp.json, etc. and registerstools-projectafter operator confirmation. - Verify: invoke
@session-control startfrom your agent — it should load.ai/skills/session-control/skill.md(fat) or$AGENT_OS_SOURCE/skills/session-control/skill.md(thin).
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
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.

