|
1 | | -# Agents |
| 1 | +# Agent Instructions |
2 | 2 |
|
3 | 3 | ## Main directive |
4 | 4 |
|
5 | | -Everything is a work in progress and can be updated and improved. |
6 | | -If you find a problem, fix it if it's small; otherwise, register it as an issue in the respective repo. |
| 5 | +Everything is a work in progress and can be updated and improved. Fix a small problem when it is directly in scope; register a larger or unrelated problem as an issue in the repository that owns it. |
7 | 6 |
|
8 | | -## Install the ecosystem |
| 7 | +This repository belongs to `github.com/MSXOrg`. |
9 | 8 |
|
10 | | -1. Create a folder in the home directory called `.msx`: |
11 | | -2. Clone the ecosystem locally: |
12 | | - 1. <https://github.com/MSXOrg/docs> — requires PRs to be updated. |
13 | | - - Clone as bare and use worktrees. |
14 | | - - Create a worktree for all branches - worktree = name of the branch. |
15 | | - 2. <https://github.com/MSXOrg/memory/> — work directly towards main. |
16 | | - - Simple clone, only main. |
| 9 | +## Install and synchronize the ecosystem |
17 | 10 |
|
18 | | -To install: |
19 | | -- Clone the repos in the users home folder under a sub-folder named `.msx`. |
20 | | -- Set configs locally to each of these repos using the GitHub username and email. |
| 11 | +The agent workspace lives under `~/.msx`: |
21 | 12 |
|
22 | | -## Working with the ecosystem |
| 13 | +| Repository | Local path | Purpose | Change model | |
| 14 | +| --- | --- | --- | --- | |
| 15 | +| `MSXOrg/docs` | `~/.msx/docs.git` + `~/.msx/docs` | Bare backing repository plus clean readable main worktree for reviewed organization context. | Pull requests through topic worktrees only. | |
| 16 | +| `MSXOrg/memory` | `~/.msx/memory` | Durable organization memory: prior decisions, gotchas, and reusable working knowledge. | Commit and push directly to `main`, per that repository's policy. | |
23 | 17 |
|
24 | | -1. Get to know this repo first: |
25 | | - - [README](README.md) for what this repository is and how it builds. |
26 | | - - [CONTRIBUTING](CONTRIBUTING.md) for how to contribute and the review process. |
27 | | -2. Read `~/.msx/docs` - start with the index to get an overview of what is here. |
28 | | -3. Read `~/.msx/memory` - start with the index to get an overview of what is here. Use this while working - commit your memories here for work inside the PSModule organization. |
29 | | -4. While working with the code, do small micro commits and push on every commit. This will make it easier to review and merge your changes. |
| 18 | +From this repository, install missing context repositories and synchronize every existing clone before use: |
| 19 | + |
| 20 | +```powershell |
| 21 | +pwsh bootstrap/Initialize-MsxWorkspace.ps1 ` |
| 22 | + -UserName '<github-user>' ` |
| 23 | + -UserEmail '<github-noreply-email>' |
| 24 | +``` |
| 25 | + |
| 26 | +Projects that add their own docs and memory provide plug-in coordinates without changing the synchronization implementation: |
| 27 | + |
| 28 | +```powershell |
| 29 | +$projects = @( |
| 30 | + @{ |
| 31 | + Name = 'MSXOrg' |
| 32 | + Path = '' |
| 33 | + DocsUrl = 'https://github.com/MSXOrg/docs.git' |
| 34 | + MemoryUrl = 'https://github.com/MSXOrg/memory.git' |
| 35 | + } |
| 36 | + @{ |
| 37 | + Name = 'PSModule' |
| 38 | + Path = 'projects/PSModule' |
| 39 | + DocsUrl = 'https://github.com/PSModule/docs.git' |
| 40 | + MemoryUrl = 'https://github.com/PSModule/memory.git' |
| 41 | + } |
| 42 | +) |
| 43 | +& ./bootstrap/Initialize-MsxWorkspace.ps1 -Project $projects |
| 44 | +``` |
| 45 | + |
| 46 | +The bootstrap writes identity only to each context repository's local git configuration. It must succeed before any context is read; do not continue with missing, dirty, diverged, wrong-branch, unreachable, or stale context. |
| 47 | + |
| 48 | +Use a dedicated worktree for every topic branch. Follow [Git Worktrees](src/docs/Ways-of-Working/Git-Worktrees.md) for the local layout and [Branching and Merging](src/docs/Ways-of-Working/Branching-and-Merging.md) for `<type>/<issue>-<slug>` branch names. |
| 49 | + |
| 50 | +## Canonical context |
| 51 | + |
| 52 | +- Docs root: [src/docs/index.md](src/docs/index.md) |
| 53 | +- Organization memory: `~/.msx/memory/index.md` |
| 54 | + |
| 55 | +## Before acting |
| 56 | + |
| 57 | +1. Segment the work by host, organization, repository, path, and task. |
| 58 | +2. Synchronize every canonical context repository to its remote default branch; stop if any context may be stale. |
| 59 | +3. Start at the docs root index and follow [Ways of Working](src/docs/Ways-of-Working/index.md) to the canonical [Workflow](src/docs/Ways-of-Working/Workflow.md). |
| 60 | +4. Infer the current stage from the task and its artifacts, then read the linked stage procedure. |
| 61 | +5. Read [README.md](README.md), [CONTRIBUTING.md](CONTRIBUTING.md), relevant standards, and organization memory. |
| 62 | +6. Apply path-specific local rules only when they match the files in scope. |
| 63 | + |
| 64 | +## Working in this repository |
| 65 | + |
| 66 | +1. Use [README.md](README.md) to understand what this repository is and how it builds. |
| 67 | +2. Use [CONTRIBUTING.md](CONTRIBUTING.md) for its contribution and review contract. |
| 68 | +3. Keep work reviewable with small, descriptive micro-commits. |
| 69 | +4. Push every commit so the remote branch, CI, and draft pull request reflect current work. |
| 70 | +5. Improve organization memory when a verified lesson is likely to matter again; commit and push MSXOrg memory directly to `main`. |
| 71 | + |
| 72 | +This file owns bootstrap and repository-specific operating instructions. The linked documentation owns reusable process knowledge; this file does not redefine a workflow stage, coding standard, or review convention. |
0 commit comments