Artifact 9e5457979896fb0151aeb47518e36df7b3fee89aa84d0c4fac4ae4006e2990fe:
- File
docs/projects.md
— part of check-in
[45a7e1e117]
at
2026-11-13 07:44:25
on branch trunk
— Phase 4b-2: your own assets placed inside each project that matches
An outfit worn at personal scope for a project's key is now linked into every project with that key, and into each of its linked worktrees: skills, agents, commands, instructions and files, under the folders the harness names for a project. The machine limit and joined instructions work there as they do at the User scope.
The links are hidden from version control per project, never globally. For a git project suit keeps one marked block in that project's local exclude file, leaves every other byte of the file as it was, and removes only the block on suit off. A Fossil or zit project has no such file, so its links are placed and suit status says they are visible.
Suit never runs git and never stages or commits anything. A file already in the project at a destination is a clash, left as it is and reported, so a committed file always wins.
1006 unit checks, 227 shell cases, 146 store cases, 612 placement cases and 310 project cases, under clang and under gcc 16. 100% coverage in all 19 source files. The no-change run costs about 0.43 ms over an empty program. (user: dmestas, size: 6533) [annotate] [blame] [check-ins using]
# Projects A project is a code repository on your disk: the nearest folder holding `.git`, `.fslckout` or `.zit-checkout`. Suit finds projects by scanning the folders you name, and matches each one to config by its remote address. ## The key A project's key is its remote address reduced to host and path: lower-case host, no scheme, no user or password, no port, no trailing `.git` or `/`. | Remote address | Key | |---|---| | `https://github.com/Owner/Name.git` | `github.com/Owner/Name` | | `[email protected]:Owner/Name.git` | `github.com/Owner/Name` | | `ssh://[email protected]/Owner/Name` | `github.com/Owner/Name` | | `https://User:[email protected]:8443/x/y.git/` | `example.com/x/y` | | `https://zeitforge.app/r/dmestas/suit` | `zeitforge.app/r/dmestas/suit` | The key is what a `[wear personal KEY]` or `[wear shared KEY]` section in `suit.conf` names, so config follows a project wherever it is cloned. A user name or password in a remote address never reaches suit's files or output. ## Commands | Command | What it does | |---|---| | `suit roots` | Print the folders suit looks in | | `suit roots add FOLDER` | Add one. FOLDER is an absolute path. | | `suit roots rm FOLDER` | Remove one | | `suit projects scan` | Walk the roots and rewrite the list of projects | | `suit projects` | Print the list: one line per project folder, `KEY FOLDER KIND` | | `suit project set FOLDER KEY` | Give a project a key by hand | | `suit project unset FOLDER` | Take a hand-set key away | A project with no key is listed with `-` in the key column. A key set by hand is applied by the next scan and kept across scans. ## The scan - It walks each root to a depth of four folders. - It does not follow symbolic links. - It does not look inside a project for more projects, except to find a git project's linked worktrees. - A folder it cannot read is skipped with a note. - It runs no other program. Everything is read from the project's own files. ## What each kind supports | Kind | Marker | Where the remote is read from | Worktrees | |---|---|---|---| | git | `.git` | `url` under `[remote "origin"]` in `.git/config`, or the first remote when there is no origin | Each linked worktree is listed with its project's key | | Fossil | `.fslckout` | The checkout database names the repository file, and that file's `last-sync-url` setting holds the remote | Not applicable | | zit | `.zit-checkout` | Not read. A zit project has no key until you set one with `suit project set`. | Not found | A linked git worktree has a `.git` file where a project has a `.git` folder. Suit follows it to the main repository's config, so a worktree made by an agent gets the same key, and later the same personal links, as the project it belongs to. ## Files All three sit in suit's home folder, are read strictly (a malformed line is an error that names the file and the line) and are rewritten by writing a new file beside the old one and renaming it. | File | Holds | Written by | |---|---|---| | `roots` | One absolute folder per line | `suit roots add`, `suit roots rm` | | `projects` | One line per project folder: key, folder, kind | `suit projects scan` | | `projects.set` | Keys set by hand: folder and key | `suit project set`, `suit project unset` | ## What lands in a project `suit apply` places the Project personal scope: for each `[wear personal KEY]` section, in every project in the list whose key is KEY. A linked worktree is a line of its own with the same key, so it gets the same links. `apply` uses the list as it is and does not scan; a `suit run` applies after a scan that changed the list, because the stamp watches `roots`, `projects` and `projects.set`. Each asset is a link to the store, as in the User scope, below the project's folder: | Asset | Where it lands | |---|---| | skill | `FOLDER/<skills.personal>/NAME` | | agent, command | `FOLDER/<agents.personal>/FILE`, `FOLDER/<commands.personal>/FILE` | | `instructions` | `FOLDER/<instructions.personal>` | | `file DEST = SRC` | `FOLDER/DEST` | - A harness's `.personal` folders are relative paths, with no `..` part. A harness with none for a kind is skipped for that kind, and `suit plan` and `suit status` say `skipped HARNESS KIND NAME in FOLDER (no folder)`. - DEST of a `file` worn at personal scope is relative with no `..` part. An absolute or `~` DEST is an error that names the outfit. - A `slot` in an outfit worn at personal scope is an error: a slot belongs to the User scope. - `[wear personal KEY machine=NAME]` applies only on that machine. Where both it and the unlimited section supply the same destination the limited one wins, and two `instructions` are joined, broadest first, into a file of suit's own that the destination links to, exactly as at the User scope. - A `[wear personal KEY]` that matches no project is no error. `suit status` says `personal KEY: no project with this key`. - `[wear shared ...]` sections are not placed yet and are not an error. Suit never touches what is not its own. A destination that holds a real file, a real folder or someone else's link is a clash: reported and left as it is, so a file committed in the project always wins. Suit never runs git and never stages, commits or changes anything else in a project. ## How the links are hidden Links in a project must not be committed by accident, and a global ignore rule would hide same-named files in every project. So each git project hides its own links, in its own local exclude file, `info/exclude` in the main repository (for a linked worktree, found through `commondir`). Suit keeps one block there: # suit begin /.claude/skills/tdd /CLAUDE.local.md # suit end One line for each link suit owns in the repository's project and worktrees, written as a path from the project's top, with a backslash before any of `\ * ? [`. A destination that is a clash is not listed. Everything outside the block is left byte-identical; a file with no final newline gets one before the block, and its block ends without one, so taking the block out gives back the very bytes that were there. The file is rewritten atomically. The ledger records the block as `block PATH`, or `block PATH created` when suit made the file. `suit off` removes the block and nothing else, and removes the file only if suit made it and nothing else is in it. A Fossil or zit project has no local exclude file. Its links are placed, and `suit status` says `links in FOLDER are visible to its version control (KIND has no local exclude file)`.