aligndev 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,15 +2,33 @@
2
2
 
3
3
  Autonomous software development. You say what you want; the assistant drives the coding agents and brings you the decisions.
4
4
 
5
- You talk to an **assistant**, the way you would to a developer on your team. It never touches the code itself. It isolates each task in its own workspace, then hands the investigation and the coding to an AI coding agent, **the agent**, which follows the [AlignFirst](https://alignfirst.paroi.tech/) protocols: specify, plan, implement, review. The assistant reads the agent's work, tests it, asks you what only you can decide, and opens the pull request.
5
+ See the [product page](https://alignfirst.paroi.tech/aligndev) for an overview.
6
+
7
+ You talk to an **assistant**, the way you would to a developer on your team. It never touches the code itself. It isolates each task in its own workspace, then hands the investigation and the coding to an AI coding agent, **the agent**, which follows the AlignFirst protocols: specify, plan, implement. The assistant reads the agent's work, tests it, asks you what only you can decide, and opens the pull request.
6
8
 
7
9
  `aligndev` is the assistant's CLI. It gives the assistant its playbook, launches and tracks the agent, and keeps the inventory of your projects. You never run it yourself: the assistant does.
8
10
 
11
+ ## The Assistant's Workflow
12
+
13
+ For each task, the assistant:
14
+
15
+ 1. Discusses the task with the agent and has it write a **spec**.
16
+ 2. Has it write the **plans**.
17
+ 3. Has the plans **executed** in a fresh session.
18
+ 4. Has a **code review** done in another session.
19
+ 5. Has the review findings **fixed** in yet another session.
20
+ 6. For UI changes, **tests manually** and checks the dev-server logs.
21
+ 7. Has fixes made as needed.
22
+ 8. Takes **screenshots** for good measure.
23
+ 9. Has the agent **open a draft PR**.
24
+
25
+ A task can also start at any intermediate step.
26
+
9
27
  ## Two Ways to Run the Assistant
10
28
 
11
29
  **In your coding agent.** A Claude Code or Codex session becomes the assistant of the repository it starts in. You keep chatting in the same session; the agents it launches work in the background.
12
30
 
13
- **As an OpenClaw bot.** The [AlignFirst Dev Kit](https://alignfirst.paroi.tech/openclaw-dev-kit) deploys the assistant on a server, under its own name in Slack or Discord. It works on every project of the host, one thread per task.
31
+ **As an OpenClaw bot.** [AlignDev for OpenClaw](#start-as-an-openclaw-bot) deploys the assistant on a server, under its own name in Slack or Discord. It works on every project of the host, one thread per task.
14
32
 
15
33
  Either way, the agent is Claude Code or Codex. A coding-agent assistant launches its own kind by default.
16
34
 
@@ -35,7 +53,7 @@ Then start a session in the project and invoke `/aligndev` in Claude Code, or `$
35
53
  Add this section to your global agent instructions (`~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, or the equivalent):
36
54
 
37
55
  ```markdown
38
- ## Aligndev
56
+ ## AlignDev
39
57
 
40
58
  When the user mentions **aligndev**, follow the `aligndev` playbook if it is already in context. Otherwise, run `npx -y aligndev guide` and follow it.
41
59
  ```
@@ -67,6 +85,25 @@ Then ask your session to work with aligndev.
67
85
 
68
86
  Unknown keys and invalid values are errors.
69
87
 
88
+ ## Start as an OpenClaw Bot
89
+
90
+ AlignDev for OpenClaw runs the assistant as an OpenClaw bot. One deployment is a dedicated service account running the assistant under its own name and channel identity. The communication surface, the agent and the assistant's model provider are independent choices. Each task moves from a channel into its own thread, then into an isolated project workspace.
91
+
92
+ ```mermaid
93
+ flowchart TD
94
+ U([User]) -->|Slack or Discord| O[OpenClaw]
95
+ O -->|aligndev guide and aligndev code| CA[Claude Code or Codex]
96
+ CA -->|AlignFirst protocols| FS[(Managed project)]
97
+ ```
98
+
99
+ Install the setup skill where your agent will assemble the deployment's private administration repository:
100
+
101
+ ```sh
102
+ npx -y skills add https://github.com/paleo/alignfirst --global --skill alignfirst-setup-guide
103
+ ```
104
+
105
+ Then ask the agent to create an assistant. The skill collects the deployment values, renders one Slack or Discord variant and one Claude Code or Codex variant, and writes the installation, security, operation and recovery runbooks. Each managed project receives the full preparation contract: the AlignFirst bootstrap line, an optional work-files repository, docmap, isolated workspaces and a project-specific `DEVELOPERS.md`.
106
+
70
107
  ## Under the Hood
71
108
 
72
- `aligndev` documents itself for the assistant: `aligndev --help`, then `aligndev guide`, print everything it needs. Maintainers: see [aligndev Architecture](https://github.com/paleo/alignfirst/blob/main/docs/aligndev-architecture.md).
109
+ `aligndev` documents itself for the assistant: `aligndev --help`, then `aligndev guide`, print everything it needs. Maintainers: see [aligndev Architecture](https://github.com/paleo/alignfirst/blob/main/docs/aligndev-architecture.md) and the [AlignDev for OpenClaw map](https://github.com/paleo/alignfirst/blob/main/docs/aligndev-openclaw/aligndev-openclaw.md).
package/dist/cli.js CHANGED
@@ -49,7 +49,7 @@ function renderHelp(aligndev) {
49
49
  [`${aligndev} -h, --help`],
50
50
  [`${aligndev} -v, --version`],
51
51
  ]);
52
- return `aligndev — the AlignFirst Dev Kit CLI.
52
+ return `aligndev — the AlignDev CLI.
53
53
 
54
54
  Usage:
55
55
  ${usage}
@@ -26,7 +26,7 @@ const SESSION_OPTIONS = {
26
26
  // Items whose companion copy the agent may edit: the companion becomes a writable directory.
27
27
  const WRITABLE_COMPANION_ITEMS = [
28
28
  ".alignfirst.json",
29
- ".alignfirst.md",
29
+ ".alignfirst-instructions",
30
30
  "DEVELOPERS.md",
31
31
  "docs",
32
32
  ".plans",
@@ -34,7 +34,7 @@ const WRITABLE_COMPANION_ITEMS = [
34
34
  // Items the agent would not find in the repository: a new session gets `alignfirst context`.
35
35
  const CONTEXT_COMPANION_ITEMS = [
36
36
  ".alignfirst.json",
37
- ".alignfirst.md",
37
+ ".alignfirst-instructions",
38
38
  "docs",
39
39
  ".plans",
40
40
  ];
@@ -1,5 +1,5 @@
1
1
  import type { PortRange } from "./markers.js";
2
- export type ItemName = ".alignfirst.json" | ".alignfirst.md" | "DEVELOPERS.md" | "docs" | ".plans" | "_aligndev";
2
+ export type ItemName = ".alignfirst.json" | ".alignfirst-instructions" | "DEVELOPERS.md" | "docs" | ".plans" | "_aligndev";
3
3
  export interface ProjectReport {
4
4
  source: ConfigSource | null;
5
5
  cli: ProjectCliReport | null;
@@ -75,7 +75,7 @@ function parsePlans(value, path) {
75
75
  throw invalidReport(path);
76
76
  return value.folder === undefined ? {} : { folder: value.folder };
77
77
  }
78
- // The report's other companion fields (`entries`, `flags`) are alignfirst's concern.
78
+ // The report's other companion fields (`key`, `flags`) are alignfirst's concern.
79
79
  function parseCompanion(value, path) {
80
80
  if (value === null)
81
81
  return null;
@@ -90,7 +90,7 @@ function parseLocations(value, path) {
90
90
  const location = (name) => parseLocation(value[name], path);
91
91
  return {
92
92
  ".alignfirst.json": location(".alignfirst.json"),
93
- ".alignfirst.md": location(".alignfirst.md"),
93
+ ".alignfirst-instructions": location(".alignfirst-instructions"),
94
94
  "DEVELOPERS.md": location("DEVELOPERS.md"),
95
95
  docs: location("docs"),
96
96
  ".plans": location(".plans"),
@@ -36,7 +36,7 @@ function runProjectCommand(ctx, args) {
36
36
  return 0;
37
37
  }
38
38
  if (args.command === "status" && args.path !== undefined) {
39
- const details = getProjectStatus(inventory, args.path);
39
+ const details = getProjectStatus(inventory, resolve(ctx.cwd, args.path));
40
40
  ctx.stdout.write(args.json ? renderProjectStatusJson(details) : renderProjectStatus(details));
41
41
  return 0;
42
42
  }
@@ -57,6 +57,7 @@ function renderUsage(aligndev) {
57
57
  ${aligndev} project --help
58
58
 
59
59
  --root defaults to projectsRoot in the aligndev config, then to the working directory.
60
+ A relative status <path> starts from the working directory.
60
61
  `;
61
62
  }
62
63
  // The projects guide, followed by the directory sections when the root carries a marker.
@@ -21,4 +21,4 @@ export interface ProjectWorktree {
21
21
  name: string;
22
22
  path: string;
23
23
  }
24
- export declare function getProjectStatus(inventory: ProjectInventory, inputPath: string): ProjectDetails;
24
+ export declare function getProjectStatus(inventory: ProjectInventory, projectPath: string): ProjectDetails;
@@ -1,10 +1,10 @@
1
1
  import { execFileSync } from "node:child_process";
2
2
  import { realpathSync } from "node:fs";
3
- import { basename, isAbsolute, resolve } from "node:path";
3
+ import { basename } from "node:path";
4
4
  import { errorMessage, isNodeError } from "../errors.js";
5
5
  const URL_WITH_AUTHORITY = /^[A-Za-z][A-Za-z\d+.-]*:\/\//u;
6
- export function getProjectStatus(inventory, inputPath) {
7
- const path = resolveProjectPath(inventory.root, inputPath);
6
+ export function getProjectStatus(inventory, projectPath) {
7
+ const path = realPathOrSelf(projectPath);
8
8
  const project = inventory.projects.find((candidate) => candidate.path === path);
9
9
  if (project === undefined) {
10
10
  throw new Error(`${path} is not a project of ${inventory.root}. Pass the main-worktree path of a git ` +
@@ -12,8 +12,7 @@ export function getProjectStatus(inventory, inputPath) {
12
12
  }
13
13
  return buildProjectDetails(project);
14
14
  }
15
- function resolveProjectPath(root, inputPath) {
16
- const path = isAbsolute(inputPath) ? inputPath : resolve(root, inputPath);
15
+ function realPathOrSelf(path) {
17
16
  try {
18
17
  return realpathSync(path);
19
18
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "aligndev",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "license": "CC0-1.0",
5
5
  "author": "Thomas MUR",
6
- "description": "The AlignFirst Dev Kit CLI: the assistant's playbook, coding-agent delegation, and project inventory.",
6
+ "description": "The AlignDev CLI: the assistant's playbook, coding-agent delegation, and project inventory.",
7
7
  "keywords": [
8
8
  "ai",
9
9
  "agent",
@@ -15,7 +15,7 @@
15
15
  "projects",
16
16
  "worktrees"
17
17
  ],
18
- "homepage": "https://alignfirst.paroi.tech/openclaw-dev-kit",
18
+ "homepage": "https://alignfirst.paroi.tech/aligndev",
19
19
  "repository": {
20
20
  "type": "git",
21
21
  "url": "git+https://github.com/paleo/alignfirst.git",
@@ -103,7 +103,7 @@ You are an autonomous programmer. Instructions reach you from two places, and "t
103
103
  {{#codingAgent}}
104
104
  - **This playbook, and the developer's global instructions auto-loaded into your session,** address you as the assistant: "the user" is the person in this conversation.
105
105
  - **A project's files** (under its PROJECT_PATH or its companion directory) address programmers and their coding agents. You are the programmer, and the agent's user is you. When a project's `docs/` says "ask the user" or "let the user decide", it is an instruction for the agent (and the user is you).
106
- - This session runs in the repository, so the project's `AGENTS.md`, `CLAUDE.md` or companion `.alignfirst.md` is auto-loaded too. It still addresses the agent: its directives about investigating or implementing, such as "run `alignfirst context` before any investigation", are for the agent.
106
+ - This session runs in the repository, so the project's `AGENTS.md`, `CLAUDE.md` or companion `.alignfirst-instructions/context.md` is auto-loaded too. It still addresses the agent: its directives about investigating or implementing, such as "run `alignfirst context` before any investigation", are for the agent.
107
107
  {{/codingAgent}}
108
108
 
109
109
  Exception: a project's `DEVELOPERS.md` addresses the agent's user — you.
@@ -42,7 +42,7 @@ Before any discussion:
42
42
  3. Retain the canonical path as PROJECT_PATH. Run `{{ALIGNDEV}} project status <PROJECT_PATH>` and retain its `DEVELOPERS.md` path as DEVELOPERS_PATH. When the project's workspace wrapper declares ports, run `{{ALIGNDEV}} project free-ports --root <selected parent directory> --size <perWorkspace × maxWorkspaces> [--range <code>]` and retain the block; preparation through the setup guide writes it into `.alignfirst.json`.
43
43
  4. Install dependencies and build, following the repository's own README.
44
44
 
45
- ### Step 2 — Check the Dev Kit contract
45
+ ### Step 2 — Check the AlignDev contract
46
46
 
47
47
  The contract is the one the `alignfirst-setup-guide` lists under "Prepare a Project for an Assistant": AlignFirst skills configuration, docmap, the workspace system, and a `DEVELOPERS.md` with a workspaces section. The workspace system and its section belong to the contract only for a project that installs them; a project without them runs in main-worktree mode. When DEVELOPERS_PATH exists, the project is prepared: continue with the normal working-session flow for the user's request. Otherwise, continue to Step 3.
48
48
 
@@ -79,7 +79,7 @@ When the user reports the merge, or you observe it while checking the PR:
79
79
 
80
80
  The preparation targets the project's companion directory. It writes nothing in the repository and creates no branch, commit or pull request.
81
81
 
82
- 1. Run `{{ALIGNFIRST}} companion add` from PROJECT_PATH. It registers the project in the companion registry unless an entry already covers it, and creates the companion directory.
82
+ 1. Run `{{ALIGNFIRST}} companion register` from PROJECT_PATH. It registers the project in the companion registry unless it is registered.
83
83
  2. Unless the user already said, ask whether `.plans` must be shared through a work-files repository, and for its URL if so. Wait for the answer.
84
84
  3. When the user chose the work-files repository, clone it under `{{PROJECTS_ROOT}}` when no clone exists there.
85
85
  4. Run `{{ALIGNDEV}} guide code`. From PROJECT_PATH, delegate the preparation to the agent without a protocol: use the `alignfirst-setup-guide` skill and follow its procedure "Set up a project through its companion" for an assistant, with the work-files clone path when there is one.
@@ -92,9 +92,10 @@ Removal requires the listed PROJECT_PATH selected before the thread opened or su
92
92
 
93
93
  1. Run and read `{{ALIGNDEV}} guide project`, then refresh `{{ALIGNDEV}} project list --json` and resolve the listed project at PROJECT_PATH. Run `{{ALIGNDEV}} project status <PROJECT_PATH>` and retain its `DEVELOPERS.md` path as DEVELOPERS_PATH, and its companion directory when it reports one. Read DEVELOPERS_PATH, then run and read the project workspace guide it names, if any.
94
94
  2. A project in main-worktree mode (DEVELOPERS_PATH missing or without a workspaces section) has no linked workspace to enumerate: its list holds PROJECT_PATH alone. Otherwise, use the project workspace tooling to enumerate every registered linked workspace and its exact absolute path. Include the exact PROJECT_PATH for the main worktree.
95
- 3. Show the user the complete linked-worktree path list and the main-worktree path. Wait for explicit confirmation of those exact paths.
95
+ 3. Show the user the complete linked-worktree path list and the main-worktree path. When the project status reports a companion directory, show it too and ask whether to keep or delete it. Wait for explicit confirmation of those exact paths, and for the answer about the companion directory.
96
96
  4. Remove each confirmed linked workspace through the project workspace tooling. Stop immediately if any removal fails; keep the main worktree intact.
97
- 5. Remove only the confirmed main-worktree directory at PROJECT_PATH. Leave every additional directory reported by the inventory untouched, the companion directory included.
98
- 6. Refresh `{{ALIGNDEV}} project list --json`: the path must be absent from `projects`. Report any remaining workspace or filesystem discrepancy, and name the companion directory left in place.
97
+ 5. When the project status reports a companion, run `{{ALIGNFIRST}} companion unregister` from PROJECT_PATH. It removes the registry entry and keeps the companion directory. Add `--remove-dir --force` when the user chose to delete the companion directory.
98
+ 6. Remove only the confirmed main-worktree directory at PROJECT_PATH. Leave every additional directory reported by the inventory untouched.
99
+ 7. Refresh `{{ALIGNDEV}} project list --json`: the path must be absent from `projects`. Report any remaining workspace or filesystem discrepancy, and name the companion directory when it was kept.
99
100
 
100
101
  Apply the host-specific and project-specific constraints read earlier throughout the sequence.
@@ -349,7 +349,7 @@ A project has up to three entry points:
349
349
  - `DEVELOPERS.md` — the agent's user, human or AI: you. This project has none, so `README.md` is also your guide, read at DEVELOPERS_PATH.
350
350
  {{/readme}}
351
351
  {{/codingAgent}}
352
- - `AGENTS.md` — the agent. When the project's instructions come from its companion, the companion's `.alignfirst.md` replaces it for the agent, and `{{ALIGNFIRST}} context` prints it.
352
+ - `AGENTS.md` — the agent. When the project's instructions come from its companion, the companion's `.alignfirst-instructions/context.md` replaces it for the agent, and `{{ALIGNFIRST}} context` prints it.
353
353
 
354
354
  The rest of the documentation (`docs/`, …) addresses everybody.
355
355
 
@@ -490,10 +490,10 @@ When the user brings up acceptance testing, first be sure who runs it — ask wh
490
490
  ### Project rules and docs
491
491
 
492
492
  {{#openclaw}}
493
- A project whose `.alignfirst.md` or `DEVELOPERS.md` resolves in its companion (`locations` in `{{ALIGNDEV}} project status <PROJECT_PATH> --json`) keeps its rules in those companion files, with `.alignfirst.md` in place of `AGENTS.md`. The agent edits them in place. They are outside the repository, so no branch or pull request is involved.
493
+ A project whose `.alignfirst-instructions` or `DEVELOPERS.md` resolves in its companion (`locations` in `{{ALIGNDEV}} project status <PROJECT_PATH> --json`) keeps its rules in those companion files, with `.alignfirst-instructions/context.md` in place of `AGENTS.md`. The agent edits them in place. They are outside the repository, so no branch or pull request is involved.
494
494
  {{/openclaw}}
495
495
  {{#codingAgent}}
496
- A project whose `.alignfirst.md` or `DEVELOPERS.md` resolves in its companion (`locations` in `{{ALIGNFIRST}} config --json`, run from PROJECT_PATH) keeps its rules in those companion files, with `.alignfirst.md` in place of `AGENTS.md`. The agent edits them in place. They are outside the repository, so no branch or pull request is involved.
496
+ A project whose `.alignfirst-instructions` or `DEVELOPERS.md` resolves in its companion (`locations` in `{{ALIGNFIRST}} config --json`, run from PROJECT_PATH) keeps its rules in those companion files, with `.alignfirst-instructions/context.md` in place of `AGENTS.md`. The agent edits them in place. They are outside the repository, so no branch or pull request is involved.
497
497
  {{/codingAgent}}
498
498
 
499
499
  Two triggers, both edited through the agent: