diff --git a/convert-to-phased/SKILL.md b/convert-to-phased/SKILL.md index 2aaca1d..7ebca4a 100644 --- a/convert-to-phased/SKILL.md +++ b/convert-to-phased/SKILL.md @@ -1,13 +1,13 @@ --- name: convert-to-phased -description: Converts an existing project to the .agent/phases/ phased-execution strategy — audits the codebase, scaffolds .agent/PLAN.md, AGENTS.md, and .agent/phases/{todo,complete}/, decomposes existing functionality into per-feature files (workflows / features / user_stories), and writes a sequential phase roadmap where every phase is independently executable with its own test suite. Use when the user asks to adopt phased execution, convert an existing or legacy project to the phased protocol, or set up a phase roadmap for an existing codebase. This skill only writes planning files and never touches application code; the phase-authoring skill adds individual phases, and the phased-execution skill runs them. +description: Converts an existing project to the .agents/phases/ phased-execution strategy — audits the codebase, scaffolds .agents/PLAN.md, AGENTS.md, and .agents/phases/{todo,complete}/, decomposes existing functionality into per-feature files (workflows / features / user_stories), and writes a sequential phase roadmap where every phase is independently executable with its own test suite. Use when the user asks to adopt phased execution, convert an existing or legacy project to the phased protocol, or set up a phase roadmap for an existing codebase. This skill only writes planning files and never touches application code; the phase-authoring skill adds individual phases, and the phased-execution skill runs them. --- # Convert to Phased You are the **Conversion Architect** — a senior engineer responsible for adopting an *existing* project into the phased-execution strategy. You audit -the codebase, scaffold the `.agent/` planning structure, and write a phase +the codebase, scaffold the `.agents/` planning structure, and write a phase roadmap that takes the project from its current state to the agreed target state. You **never implement code changes yourself** — every code change is expressed as a phase directory (a `00_phase.md` overview plus small task @@ -17,24 +17,24 @@ never add individual phases to an already-converted project — that is the Phase state lives in files, not chat: -- `.agent/PLAN.md` — master plan; **LOCKED DECISIONS** are binding -- `.agent/phases/todo/NN_name/` — a pending phase: `00_phase.md` overview + `NN_task.md` task files (task sort order = execution order) -- `.agent/phases/complete/` — finished phases, mirroring the todo/ layout (read-only history) -- `.agent/validate.sh` — the pass/fail gate, run after every task (installed by the `phased-execution` skill on first run) +- `.agents/PLAN.md` — master plan; **LOCKED DECISIONS** are binding +- `.agents/phases/todo/NN_name/` — a pending phase: `00_phase.md` overview + `NN_task.md` task files (task sort order = execution order) +- `.agents/phases/complete/` — finished phases, mirroring the todo/ layout (read-only history) +- `.agents/validate.sh` — the pass/fail gate, run after every task (installed by the `phased-execution` skill on first run) ## Choosing the mode -- **Not phased** (no `.agent/phases/todo/`) → run the conversion protocol below. -- **Already phased** (`.agent/phases/todo/` exists) → stop; do not +- **Not phased** (no `.agents/phases/todo/`) → run the conversion protocol below. +- **Already phased** (`.agents/phases/todo/` exists) → stop; do not re-convert. Point the user at the `phase-authoring` skill. -- **Partially phased** (some `.agent/` artifacts exist) → convert only the +- **Partially phased** (some `.agents/` artifacts exist) → convert only the missing parts, and merge into existing files instead of overwriting them. ## Phase 1 — Audit (change nothing yet) 1. Run `bash scripts/project-audit.sh` (resolve `scripts/` against this skill's directory) to report the version-control state, detected stack, - existing `.agent/` artifacts, test tooling, and the next free phase number. + existing `.agents/` artifacts, test tooling, and the next free phase number. 2. Read the README, manifests, configuration, entry points, and the test suite layout. Identify the significant features that exist in code but have no feature file or dedicated tests. @@ -46,7 +46,7 @@ Phase state lives in files, not chat: floor is, existing failures. - **Feature decomposition:** features lacking a story/feature/workflow file or a dedicated test suite. - - **Existing `.agent/` artifacts:** what exists, what is missing. + - **Existing `.agents/` artifacts:** what exists, what is missing. 4. **Wait for confirmation.** Do not write anything until the user confirms the upgrade strategy based on the report. @@ -69,61 +69,61 @@ matches the project's domain: | Domain | Directory | File content | |------------|---------------------------|--------------| -| CLI tool | `.agent/workflows/` | I/O contract: arguments/options, stdout/stderr, exit codes. Source of truth for the CliRunner contract tests. | -| Library | `.agent/features/` | Public API sketch + exception contracts. Source of truth for the capability test modules. | -| Web app | `.agent/user_stories/` | Narrative (Given/When/Then), UI Visualization & Structure (current and target), Playwright mapping rule. | -| Anything else | `.agent/features/` | Contract-level description: inputs/outputs and observable behavior. | +| CLI tool | `.agents/workflows/` | I/O contract: arguments/options, stdout/stderr, exit codes. Source of truth for the CliRunner contract tests. | +| Library | `.agents/features/` | Public API sketch + exception contracts. Source of truth for the capability test modules. | +| Web app | `.agents/user_stories/` | Narrative (Given/When/Then), UI Visualization & Structure (current and target), Playwright mapping rule. | +| Anything else | `.agents/features/` | Contract-level description: inputs/outputs and observable behavior. | These files describe the **current** behavior precisely — they are contracts, not aspirations. The refactor to reach a contract becomes a phase. -## Phase 4 — Scaffold the `.agent/` structure +## Phase 4 — Scaffold the `.agents/` structure Create (or merge into what already exists) with file tools: -- **`.agent/PLAN.md`** — from `assets/plan-template.md`: assumptions & design +- **`.agents/PLAN.md`** — from `assets/plan-template.md`: assumptions & design principles, the anchors table, high-level architecture (mirroring the actual code), data model, validation workflow, the domain section (CLI/UX strategy, public-API principles, or UI/UX guidelines), and the phase roadmap. - **`AGENTS.md`** — the five base rules below, plus the domain additions. -- **`.agent/phases/todo/`** — the roadmap from Phase 5. -- **`.agent/phases/complete/`** — create the directory, leave it empty (it mirrors `todo/` as phases complete). -- **`.gitignore`** — add `.agent/phase-sessions/` and `.agent/pipeline.log` if missing (never `.agent/` itself — the planning tree is tracked and committed); if an existing `.gitignore` has a `.agent/` ignore line, remove it. +- **`.agents/phases/todo/`** — the roadmap from Phase 5. +- **`.agents/phases/complete/`** — create the directory, leave it empty (it mirrors `todo/` as phases complete). +- **`.gitignore`** — add `.agents/phase-sessions/` and `.agents/pipeline.log` if missing (never `.agents/` itself — the planning tree is tracked and committed); if an existing `.gitignore` has a `.agents/` ignore line, remove it. **AGENTS.md base rules:** -1. "Always read `.agent/PLAN.md` first to understand the project context and goals." -2. "Follow the phased execution protocol in `.agent/phases/`." -3. "Never modify `.agent/PLAN.md` or any files in `.agent/phases/complete/`." -4. "If you need to update any file in `.agent/phases/todo/`, you must ask the user for permission first." -5. "Strictly adhere to the **LOCKED DECISIONS** listed in `.agent/PLAN.md`." +1. "Always read `.agents/PLAN.md` first to understand the project context and goals." +2. "Follow the phased execution protocol in `.agents/phases/`." +3. "Never modify `.agents/PLAN.md` or any files in `.agents/phases/complete/`." +4. "If you need to update any file in `.agents/phases/todo/`, you must ask the user for permission first." +5. "Strictly adhere to the **LOCKED DECISIONS** listed in `.agents/PLAN.md`." **Domain additions:** -- **CLI:** "One Workflow, One Phase": each `.agent/workflows/` file +- **CLI:** "One Workflow, One Phase": each `.agents/workflows/` file corresponds to a distinct execution phase with its own dedicated CliRunner contract test suite. "Safety Check": any command that mutates state must implement `--dry-run` and be idempotent before it is complete. "Options over Arguments": new parameters are typed options. -- **Library:** "One Capability, One Phase": each `.agent/features/` file +- **Library:** "One Capability, One Phase": each `.agents/features/` file corresponds to a distinct execution phase with its own dedicated pytest suite. "Public API Lock": once a capability phase is complete, its public API is LOCKED; changes follow SemVer. "Tests via Public API": integration tests exercise the public API surface, never private internals. -- **Web:** "One Story, One Phase": each `.agent/user_stories/` file +- **Web:** "One Story, One Phase": each `.agents/user_stories/` file corresponds to a distinct execution phase with its own dedicated Playwright E2E test suite. "UI Structure Check": before finalizing any UI component, - verify it follows the layout principles in `.agent/PLAN.md` and meets WCAG + verify it follows the layout principles in `.agents/PLAN.md` and meets WCAG accessibility basics. "No CDN Rule": all CSS/JS/fonts/images must be served locally, no external asset URLs. -**Do not create `.agent/validate.sh`** — the `phased-execution` skill +**Do not create `.agents/validate.sh`** — the `phased-execution` skill installs it from its template on first run and it must be adapted to the project's real checks (the foundation phase does that). ## Phase 5 — The Phase Roadmap -Write sequential phase **directories** into `.agent/phases/todo/` — each +Write sequential phase **directories** into `.agents/phases/todo/` — each `NN_name/` holds a `00_phase.md` overview (from `assets/phase-template.md`) and its task files (from `assets/task-template.md`); both mirror the `phase-authoring` templates, keep the sections identical. Numbering starts @@ -132,7 +132,7 @@ together. Never reuse or collide a number. Roadmap shape: -1. **`01_…` foundation/rectification phase** — adapt `.agent/validate.sh` to +1. **`01_…` foundation/rectification phase** — adapt `.agents/validate.sh` to the project's real test/lint/coverage checks; fix or baseline the existing test failures; add missing test/coverage tooling. The full current suite must be green and the project fully launchable when this phase completes. @@ -149,8 +149,8 @@ Every phase directory must contain: logic, with coverage **>90%** on new/modified code, plus the domain block below. Tasks express the *delta* from current state to the contract, not a from-scratch rebuild. The header line references the corresponding feature - file (`.agent/workflows/…`, `.agent/features/…`, or - `.agent/user_stories/…`). + file (`.agents/workflows/…`, `.agents/features/…`, or + `.agents/user_stories/…`). - **Task files `01_…`, `02_…`, …** — small, quick units (one focused change, roughly ≤30 minutes of executor work; a phase typically holds 2–8): Objective, Work (file-level steps), Testing & Quality, Completion @@ -189,7 +189,7 @@ final pass is where they are verified end-to-end): ## Phase 6 — Version Control & Hand-Off - Git is mandatory: `git init` if the project is not a repository. -- Commit the conversion — `AGENTS.md`, `.gitignore`, the whole `.agent/` +- Commit the conversion — `AGENTS.md`, `.gitignore`, the whole `.agents/` tree (it is tracked, not git-ignored), and any other modified files — with a Conventional Commits message (e.g. `chore(agent): adopt phased execution strategy with NN-phase roadmap`), always with `--no-gpg-sign`. @@ -206,13 +206,13 @@ and the phase list (number, name, one-line objective). Then hand off: ## Strict Operational Rules -- The conversion writes **planning files only**: `.agent/**`, `AGENTS.md`, +- The conversion writes **planning files only**: `.agents/**`, `AGENTS.md`, and `.gitignore`. **Never modify application code in this skill** — bugs and failing tests found during the audit become tasks in the foundation phase, not direct edits. -- Never overwrite existing `.agent/` content — merge into it. -- Never modify anything in `.agent/phases/complete/`. -- Do not create `.agent/validate.sh` (the `phased-execution` skill installs +- Never overwrite existing `.agents/` content — merge into it. +- Never modify anything in `.agents/phases/complete/`. +- Do not create `.agents/validate.sh` (the `phased-execution` skill installs it on first run). - Wait for confirmation after the Gap Analysis Report, and wait for the user to lock any `PROPOSED` anchor before writing `PLAN.md`. diff --git a/convert-to-phased/assets/phase-template.md b/convert-to-phased/assets/phase-template.md index 3a8d828..e920364 100644 --- a/convert-to-phased/assets/phase-template.md +++ b/convert-to-phased/assets/phase-template.md @@ -1,6 +1,6 @@ # Phase {{NN}} — {{Short Title}} -**Feature:** `{{.agent/workflows/.md | .agent/features/.md | .agent/user_stories/.md | "n/a"}}` +**Feature:** `{{.agents/workflows/.md | .agents/features/.md | .agents/user_stories/.md | "n/a"}}` **Context:** `{{PLAN.md sections / files this phase builds on}}` ## Objective diff --git a/convert-to-phased/assets/plan-template.md b/convert-to-phased/assets/plan-template.md index c9e48b9..8bfb528 100644 --- a/convert-to-phased/assets/plan-template.md +++ b/convert-to-phased/assets/plan-template.md @@ -31,4 +31,4 @@ accessibility, asset policy) — whichever matches the project's domain.}} | # | Phase | Feature file | Objective (one line) | |---|-------|--------------|----------------------| | 01 | {{NN_name}} | — | foundation: adapt validate.sh, green test baseline | -| 02 | {{NN_name}} | `.agent/{{workflows\|features\|user_stories}}/{{name}}.md` | {{...}} | +| 02 | {{NN_name}} | `.agents/{{workflows\|features\|user_stories}}/{{name}}.md` | {{...}} | diff --git a/convert-to-phased/assets/task-template.md b/convert-to-phased/assets/task-template.md index ba250c4..ca7ebf9 100644 --- a/convert-to-phased/assets/task-template.md +++ b/convert-to-phased/assets/task-template.md @@ -1,6 +1,6 @@ # Task {{NN}} — {{Short Title}} -**Phase:** `{{NN_phase}}` · **Feature:** `{{.agent/workflows/.md | .agent/features/.md | .agent/user_stories/.md | "n/a"}}` +**Phase:** `{{NN_phase}}` · **Feature:** `{{.agents/workflows/.md | .agents/features/.md | .agents/user_stories/.md | "n/a"}}` ## Objective {{1–2 sentences: what this task delivers (the delta from current state to the contract)}} diff --git a/convert-to-phased/scripts/project-audit.sh b/convert-to-phased/scripts/project-audit.sh index 6facc83..f63a126 100755 --- a/convert-to-phased/scripts/project-audit.sh +++ b/convert-to-phased/scripts/project-audit.sh @@ -2,8 +2,8 @@ # project-audit.sh — stack & phased-readiness probe for the Conversion Architect. # # Prints: project root, version-control state, detected manifests, domain -# hints, existing .agent/ artifacts, test tooling, and the next free phase -# number NN (counting .agent/phases/todo/ and complete/ together, +# hints, existing .agents/ artifacts, test tooling, and the next free phase +# number NN (counting .agents/phases/todo/ and complete/ together, # zero-padded to 2 digits). # # Usage: bash project-audit.sh # from anywhere in the project tree @@ -72,29 +72,29 @@ fi if (( ! hint )); then echo " (none — classify from the manifests above)"; fi echo -echo ".agent state:" +echo ".agents state:" a=0 -if [[ -f "$root/.agent/PLAN.md" ]]; then - echo " .agent/PLAN.md: present" +if [[ -f "$root/.agents/PLAN.md" ]]; then + echo " .agents/PLAN.md: present" a=1 fi if [[ -f "$root/AGENTS.md" ]]; then echo " AGENTS.md: present" a=1 fi -if [[ -f "$root/.agent/validate.sh" ]]; then - echo " .agent/validate.sh: present" +if [[ -f "$root/.agents/validate.sh" ]]; then + echo " .agents/validate.sh: present" a=1 fi for d in workflows features user_stories; do - if [[ -d "$root/.agent/$d" ]]; then - n="$(find "$root/.agent/$d" -maxdepth 1 -name '*.md' 2>/dev/null | wc -l | tr -d ' ')" - echo " .agent/$d/: present ($n file(s))" + if [[ -d "$root/.agents/$d" ]]; then + n="$(find "$root/.agents/$d" -maxdepth 1 -name '*.md' 2>/dev/null | wc -l | tr -d ' ')" + echo " .agents/$d/: present ($n file(s))" a=1 fi done -todo_dir="$root/.agent/phases/todo" -complete_dir="$root/.agent/phases/complete" +todo_dir="$root/.agents/phases/todo" +complete_dir="$root/.agents/phases/complete" list_phases() { local dir="$1" entry n t any=0 for entry in "$dir"/*; do @@ -113,16 +113,16 @@ list_phases() { if (( ! any )); then echo " (empty)"; fi } if [[ -d "$todo_dir" ]]; then - echo " .agent/phases/todo:" + echo " .agents/phases/todo:" list_phases "$todo_dir" a=1 fi if [[ -d "$complete_dir" ]]; then - echo " .agent/phases/complete:" + echo " .agents/phases/complete:" list_phases "$complete_dir" a=1 fi -if (( ! a )); then echo " (no .agent/ artifacts — full conversion needed)"; fi +if (( ! a )); then echo " (no .agents/ artifacts — full conversion needed)"; fi max=0 for d in "$todo_dir" "$complete_dir"; do diff --git a/new-project/SKILL.md b/new-project/SKILL.md index 38f6a3b..f30705b 100644 --- a/new-project/SKILL.md +++ b/new-project/SKILL.md @@ -1,6 +1,6 @@ --- name: new-project -description: Initialises a new Python project and its high-rigor, phased-execution roadmap for a chosen project type. Use when the user wants to start a brand-new project and asks for a professional setup with independent, test-driven phases. Branch on --type to apply the correct stack defaults — web (FastAPI + PostgreSQL 17 + Playwright E2E per user story, no external CDNs), cli (Click), library/pip (src-layout, public API, PyPI-ready), or script (argparse/typer, cron-deployable). This skill scaffolds the environment AND writes the .agent/phases roadmap; the phase-authoring skill adds phases later and the phased-execution skill runs them. +description: Initialises a new Python project and its high-rigor, phased-execution roadmap for a chosen project type. Use when the user wants to start a brand-new project and asks for a professional setup with independent, test-driven phases. Branch on --type to apply the correct stack defaults — web (FastAPI + PostgreSQL 17 + Playwright E2E per user story, no external CDNs), cli (Click), library/pip (src-layout, public API, PyPI-ready), or script (argparse/typer, cron-deployable). This skill scaffolds the environment AND writes the .agents/phases roadmap; the phase-authoring skill adds phases later and the phased-execution skill runs them. --- # New Project @@ -28,9 +28,9 @@ Determine `--type` from the chat context (or ask once if genuinely absent): ## Phase state in files -- `.agent/PLAN.md` — master design; **LOCKED DECISIONS** are binding. -- `.agent/phases/todo/NN_name/` — pending phase: `00_phase.md` + `NN_task.md` files. -- `.agent/phases/complete/` — finished phases (mirrors `todo/`, read-only history). +- `.agents/PLAN.md` — master design; **LOCKED DECISIONS** are binding. +- `.agents/phases/todo/NN_name/` — pending phase: `00_phase.md` + `NN_task.md` files. +- `.agents/phases/complete/` — finished phases (mirrors `todo/`, read-only history). - `AGENTS.md` — project operating rules derived from this skill's mandates. ## Protocol — New Project @@ -60,7 +60,7 @@ applying **only your branch's** stack section. #### Common (all types) - `uv` project: `pyproject.toml`, `src//` package layout, `[project.scripts]` entry point where a CLI/library applies. -- `.gitignore` that **includes `.agent/phase-sessions/` and `.agent/pipeline.log`** — but never `.agent/` itself (the phase roadmap is tracked and committed). +- `.gitignore` that **includes `.agents/phase-sessions/` and `.agents/pipeline.log`** — but never `.agents/` itself (the phase roadmap is tracked and committed). - Multi-stage `Containerfile` (assumes `podman`/`docker`). - `README.md` with `uv` + configuration instructions. - **Debugpy (dev):** include `debugpy`; a utility module checks the `DEBUGPY` env var. Default (`DEBUGPY=0`/unset) → **not** imported, minimal overhead. `DEBUGPY=1` → import and listen (e.g. port 5678) without blocking. @@ -117,17 +117,17 @@ anchors are the only technologies phases may use. Cover: Create with file tools: -- **`.agent/PLAN.md`** — the master design from Phase 3 (architecture, LOCKED DECISIONS, high-level roadmap). -- **`AGENTS.md`** — initialized with: read `.agent/PLAN.md` first; follow the phased protocol in `.agent/phases/`; never modify `PLAN.md` or anything in `.agent/phases/complete/`; ask before editing `todo/`; adhere to the LOCKED DECISIONS. -- **`.agent/phases/todo/`** — sequential phase directories (`01_…/`, `02_…/`, …), each with a `00_phase.md` overview plus task files, each leaving the project launchable on its own. -- **`.agent/phases/complete/`** — create, leave empty. +- **`.agents/PLAN.md`** — the master design from Phase 3 (architecture, LOCKED DECISIONS, high-level roadmap). +- **`AGENTS.md`** — initialized with: read `.agents/PLAN.md` first; follow the phased protocol in `.agents/phases/`; never modify `PLAN.md` or anything in `.agents/phases/complete/`; ask before editing `todo/`; adhere to the LOCKED DECISIONS. +- **`.agents/phases/todo/`** — sequential phase directories (`01_…/`, `02_…/`, …), each with a `00_phase.md` overview plus task files, each leaving the project launchable on its own. +- **`.agents/phases/complete/`** — create, leave empty. -Do **not** create `.agent/validate.sh` — the `phased-execution` skill installs it +Do **not** create `.agents/validate.sh` — the `phased-execution` skill installs it from its template on first run and adapts it to the project's real checks. - **Version control:** `git init` if the project is not a repository, then - commit the scaffold — including the whole `.agent/` tree (tracked, never - git-ignored; only `.agent/phase-sessions/` and `.agent/pipeline.log` are + commit the scaffold — including the whole `.agents/` tree (tracked, never + git-ignored; only `.agents/phase-sessions/` and `.agents/pipeline.log` are ignored) — with a Conventional Commits message, always `--no-gpg-sign`. Finish by summarizing the Architectural Anchors and how to start execution with @@ -141,6 +141,6 @@ Extract before asking: what the user asked for and why, explicit decisions/const - **You scaffold and design; you do not implement the roadmap.** Phases are written as directories for the `phased-execution` skill to run, task by task. - **Apply only your chosen type's stack mandates** — do not bleed web requirements into a CLI project, and vice versa. -- **Never** create or edit files inside `.agent/PLAN.md`, `AGENTS.md`, or `.agent/phases/complete/` after this skill hands off (the `phase-authoring` skill owns later changes). +- **Never** create or edit files inside `.agents/PLAN.md`, `AGENTS.md`, or `.agents/phases/complete/` after this skill hands off (the `phase-authoring` skill owns later changes). - **No external CDNs** anywhere in a web project — all assets served from the app. - Introduce any technology outside the LOCKED DECISIONS only with explicit user permission, recorded in `PLAN.md`. diff --git a/phase-authoring/SKILL.md b/phase-authoring/SKILL.md index 5b8ee9a..009446e 100644 --- a/phase-authoring/SKILL.md +++ b/phase-authoring/SKILL.md @@ -1,6 +1,6 @@ --- name: phase-authoring -description: The required entry point for ANY new work on a .agent/phases/ project. Whenever the user requests a new feature, a bug fix, a refactor, or any other code change to a project that has the .agent/phases/ structure, call this skill FIRST to capture the work as a phase directory with task files — never implement the change directly in code. Also use it when the user explicitly asks to add, write, or draft a phase, extend the phase roadmap, or start a new phased-execution project (Protocol B scaffolds fresh projects). Uses the Phase Architect protocol (the /new-phase and /new-project prompts, as a skill); scopes the phase from the user's chat context first and only interviews for information that is genuinely missing. This skill writes phase directories (a 00_phase.md overview plus task files); the phased-execution skill runs them, task by task. +description: The required entry point for ANY new work on a .agents/phases/ project. Whenever the user requests a new feature, a bug fix, a refactor, or any other code change to a project that has the .agents/phases/ structure, call this skill FIRST to capture the work as a phase directory with task files — never implement the change directly in code. Also use it when the user explicitly asks to add, write, or draft a phase, extend the phase roadmap, or start a new phased-execution project (Protocol B scaffolds fresh projects). Uses the Phase Architect protocol (the /new-phase and /new-project prompts, as a skill); scopes the phase from the user's chat context first and only interviews for information that is genuinely missing. This skill writes phase directories (a 00_phase.md overview plus task files); the phased-execution skill runs them, task by task. --- # Phase Authoring @@ -14,10 +14,10 @@ master plan. Phase state lives in files, not chat: -- `.agent/PLAN.md` — master plan; **LOCKED DECISIONS** are binding -- `.agent/phases/todo/NN_name/` — a pending phase: `00_phase.md` overview + `NN_task.md` task files (task sort order = execution order) -- `.agent/phases/todo/NN_name.md` — legacy single-file phase (still valid; migrate or split it) -- `.agent/phases/complete/` — finished phases, mirroring the todo/ layout (read-only history) +- `.agents/PLAN.md` — master plan; **LOCKED DECISIONS** are binding +- `.agents/phases/todo/NN_name/` — a pending phase: `00_phase.md` overview + `NN_task.md` task files (task sort order = execution order) +- `.agents/phases/todo/NN_name.md` — legacy single-file phase (still valid; migrate or split it) +- `.agents/phases/complete/` — finished phases, mirroring the todo/ layout (read-only history) Legacy flat phases (`todo/NN_name.md`) are still executed as a single unit. `bash scripts/migrate-phases-to-tasks.sh [project-root]` (resolve `scripts/` @@ -29,8 +29,8 @@ into real task files is this skill's job. This skill is the **first stop** for any request to do work on a phased project. If the user asks for a new feature, bug fix, improvement, refactor, or any other code change — regardless of phrasing ("add X", "fix Y", "update Z", "it's broken when…", "make it so that…") — do **not** start editing application code. Convert the request into a phase directory (overview + task files) with this skill; the `phased-execution` skill is the only path from a phase to code (it runs each task in a fresh subprocess behind the validation gate). -- **Phased project** (`.agent/phases/todo/` exists) → **Protocol A**: create the phase for the requested work. This is the default path for feature, bug, and change requests — the user does not need to mention "phase" at all. -- **Fresh project** (no `.agent/` structure) and the user wants a phased project (asks for it explicitly, or the chat context makes clear the phased workflow is wanted) → **Protocol B**: scaffold the project and its phase roadmap. +- **Phased project** (`.agents/phases/todo/` exists) → **Protocol A**: create the phase for the requested work. This is the default path for feature, bug, and change requests — the user does not need to mention "phase" at all. +- **Fresh project** (no `.agents/` structure) and the user wants a phased project (asks for it explicitly, or the chat context makes clear the phased workflow is wanted) → **Protocol B**: scaffold the project and its phase roadmap. - **Not phased and no sign of phased intent** → this skill does not apply; do the work normally, and if the work is substantial, suggest the `convert-to-phased` skill. - Only if the user **explicitly** asks to bypass the phase workflow should code be edited directly — in that case note that the change skips the phase's test and validation gates. @@ -59,10 +59,10 @@ Rules: Before writing anything, you must: -1. Read `.agent/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS**. +1. Read `.agents/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS**. 2. Read `AGENTS.md` if present — project rules may add requirements (e.g. one user story per phase with a dedicated E2E suite per story, mandatory commit conventions, or a `validate.sh` gate). 3. Run `bash scripts/phase-status.sh` (resolve `scripts/` against this skill's directory) to list the phases and their per-task state, and compute the next free number `NN`. -4. Read the `00_phase.md` files in `.agent/phases/complete/*/` to understand what has already been built, and review the remaining `todo/` phase directories to avoid overlap. Read the most recent completed phase files and match their **local formatting conventions** (section names, story-mapping lines, E2E/commit blocks) while keeping the required sections below. +4. Read the `00_phase.md` files in `.agents/phases/complete/*/` to understand what has already been built, and review the remaining `todo/` phase directories to avoid overlap. Read the most recent completed phase files and match their **local formatting conventions** (section names, story-mapping lines, E2E/commit blocks) while keeping the required sections below. ### Phase 2: Scope the New Phase (context first, interview only if needed) @@ -86,7 +86,7 @@ Derive from the chat context (see "Scoping from chat context" above): ### Phase 3: Design & Create the Phase -Create **exactly one** new phase directory at `.agent/phases/todo/NN_name/`, +Create **exactly one** new phase directory at `.agents/phases/todo/NN_name/`, where `NN` comes from Phase 1 (next free number, counting `todo/` and `complete/` together) and `name` is a short `snake_case` description. It contains the phase overview and the phase's task files: @@ -112,7 +112,7 @@ earlier ones within the phase. **Design Mandates:** - **Independent Viability:** the phase must leave the project functional and launchable on its own once complete. -- **Architectural Anchors:** use only the technologies in the LOCKED DECISIONS of `.agent/PLAN.md`. Never introduce new technology without explicit permission. +- **Architectural Anchors:** use only the technologies in the LOCKED DECISIONS of `.agents/PLAN.md`. Never introduce new technology without explicit permission. - **No Regressions:** the phase must not alter the behavior of completed phases. - **Executable in isolation:** an agent that sees only the repository, the phase overview, the completed task files, and one task file — no chat history, no follow-ups — must be able to finish that task. No hidden assumptions. @@ -153,7 +153,7 @@ Derive from the chat context (see "Scoping from chat context" above): - Use `uv` for all package management. - **Mandatory Dependencies:** `python-dotenv` (production); `debugpy`, `ruff`, `pyright`, `pytest`, `pytest-cov` (dev). - **Web Projects:** add `fastapi`, `alembic`, `pydantic`; prefer `httpx`. -- **Scaffold Files:** a comprehensive `.gitignore` (must include `.agent/phase-sessions/` and `.agent/pipeline.log` — but **never** `.agent/` itself: the planning tree is tracked and committed), a multi-stage `Containerfile` (assuming `podman`/`docker`), and a `README.md` with `uv` and configuration instructions. +- **Scaffold Files:** a comprehensive `.gitignore` (must include `.agents/phase-sessions/` and `.agents/pipeline.log` — but **never** `.agents/` itself: the planning tree is tracked and committed), a multi-stage `Containerfile` (assuming `podman`/`docker`), and a `README.md` with `uv` and configuration instructions. ### Phase 3: Strategic Architectural Design @@ -174,12 +174,12 @@ phases may use. The design must cover: Use file tools to create (not just describe): -- **`.agent/PLAN.md`** — the master design from Phase 3 (architecture, locked decisions, high-level roadmap). -- **`AGENTS.md`** — initialized with: always read `.agent/PLAN.md` first; follow the phased protocol in `.agent/phases/`; never modify `.agent/PLAN.md` or anything in `.agent/phases/complete/`; ask the user before editing files in `.agent/phases/todo/`; strictly adhere to the **LOCKED DECISIONS**. -- **`.agent/phases/todo/`** — sequential phase directories (`01_…/`, `02_…/`, …), each with a `00_phase.md` overview and its task files per Protocol A, Phase 3, and each leaving the project launchable on its own. -- **`.agent/phases/complete/`** — create the directory, leave it empty. +- **`.agents/PLAN.md`** — the master design from Phase 3 (architecture, locked decisions, high-level roadmap). +- **`AGENTS.md`** — initialized with: always read `.agents/PLAN.md` first; follow the phased protocol in `.agents/phases/`; never modify `.agents/PLAN.md` or anything in `.agents/phases/complete/`; ask the user before editing files in `.agents/phases/todo/`; strictly adhere to the **LOCKED DECISIONS**. +- **`.agents/phases/todo/`** — sequential phase directories (`01_…/`, `02_…/`, …), each with a `00_phase.md` overview and its task files per Protocol A, Phase 3, and each leaving the project launchable on its own. +- **`.agents/phases/complete/`** — create the directory, leave it empty. -Do **not** create `.agent/validate.sh` — the `phased-execution` skill +Do **not** create `.agents/validate.sh` — the `phased-execution` skill installs it from its template on first run and it must be adapted to the project's real checks. @@ -189,7 +189,7 @@ execution with `phased-execution` (`auto-phase.sh`). ## Strict Operational Rules - **Work requests become phase directories.** When this skill was invoked because of a feature, bug, or change request, the deliverable is the phase directory (overview + task files) — not code. Do not edit application code during this invocation; the `phased-execution` skill does that from the task files. -- **Never** modify `.agent/PLAN.md`, `AGENTS.md`, or any file in `.agent/phases/complete/`. -- **Never** modify existing phase directories or their files in `.agent/phases/todo/`; if one needs updating, ask the user for permission first. +- **Never** modify `.agents/PLAN.md`, `AGENTS.md`, or any file in `.agents/phases/complete/`. +- **Never** modify existing phase directories or their files in `.agents/phases/todo/`; if one needs updating, ask the user for permission first. - Create exactly **one** phase directory (overview + task files) per invocation in Protocol A. If the request covers multiple phases, propose the ordered split and ask the user to confirm it, then create only the first — the rest follow in later invocations (or a Protocol B roadmap pass if the project is new). - Numbering: phase `NN` is the next free number after the highest existing entry (directory or legacy file), counting `todo/` and `complete/` together; task `NN` is per-phase (`01`…). Never reuse or collide a number. diff --git a/phase-authoring/assets/phase-template.md b/phase-authoring/assets/phase-template.md index c7bef06..cc89468 100644 --- a/phase-authoring/assets/phase-template.md +++ b/phase-authoring/assets/phase-template.md @@ -1,6 +1,6 @@ # Phase {{NN}} — {{Short Title}} -**Story:** `{{.agent/user_stories/.md or "n/a"}}` +**Story:** `{{.agents/user_stories/.md or "n/a"}}` **Context:** `{{PLAN.md sections / files this phase builds on}}` ## Objective diff --git a/phase-authoring/assets/task-template.md b/phase-authoring/assets/task-template.md index be95025..8a34d2a 100644 --- a/phase-authoring/assets/task-template.md +++ b/phase-authoring/assets/task-template.md @@ -1,6 +1,6 @@ # Task {{NN}} — {{Short Title}} -**Phase:** `{{NN_phase}}` · **Story:** `{{.agent/user_stories/.md or "n/a"}}` +**Phase:** `{{NN_phase}}` · **Story:** `{{.agents/user_stories/.md or "n/a"}}` ## Objective {{1–2 sentences: what this task delivers}} diff --git a/phase-authoring/scripts/migrate-phases-to-tasks.sh b/phase-authoring/scripts/migrate-phases-to-tasks.sh index bb8996a..8d20165 100644 --- a/phase-authoring/scripts/migrate-phases-to-tasks.sh +++ b/phase-authoring/scripts/migrate-phases-to-tasks.sh @@ -17,7 +17,7 @@ # # Usage: bash migrate-phases-to-tasks.sh [project-root] # project-root defaults to the nearest ancestor containing -# .agent/phases/todo or agent/phases/todo (older projects). +# .agents/phases/todo or agent/phases/todo (older projects). set -euo pipefail root="${1:-}" @@ -26,14 +26,14 @@ if [[ -n "$root" ]]; then else root="$(pwd)" while :; do - if [[ -d "$root/.agent/phases/todo" || -d "$root/agent/phases/todo" ]]; then break; fi + if [[ -d "$root/.agents/phases/todo" || -d "$root/agent/phases/todo" ]]; then break; fi [[ "$root" == "/" ]] && { echo "✗ ERROR: no phases/todo found at or above $(pwd)" >&2; exit 1; } root="$(dirname "$root")" done fi -if [[ -d "$root/.agent/phases" ]]; then - phases="$root/.agent/phases" +if [[ -d "$root/.agents/phases" ]]; then + phases="$root/.agents/phases" elif [[ -d "$root/agent/phases" ]]; then phases="$root/agent/phases" else diff --git a/phase-authoring/scripts/phase-status.sh b/phase-authoring/scripts/phase-status.sh index 79db3ef..b337c9a 100755 --- a/phase-authoring/scripts/phase-status.sh +++ b/phase-authoring/scripts/phase-status.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # phase-status.sh — phase/task pipeline state for the Phase Architect. # -# Finds the project root (nearest ancestor with .agent/phases/todo), prints +# Finds the project root (nearest ancestor with .agents/phases/todo), prints # the todo/ and complete/ phase listings with per-task state, the next free # phase number NN (counting both directories together, zero-padded to 2 # digits), and the next pending unit in pipeline order. @@ -15,12 +15,12 @@ set -euo pipefail root="$(pwd)" while :; do - if [[ -d "$root/.agent/phases/todo" ]]; then break; fi - [[ "$root" == "/" ]] && { echo "✗ ERROR: no .agent/phases/todo found at or above $(pwd)" >&2; exit 1; } + if [[ -d "$root/.agents/phases/todo" ]]; then break; fi + [[ "$root" == "/" ]] && { echo "✗ ERROR: no .agents/phases/todo found at or above $(pwd)" >&2; exit 1; } root="$(dirname "$root")" done -phases="$root/.agent/phases" +phases="$root/.agents/phases" # --- todo: per-task state ------------------------------------------------------ echo "todo:" diff --git a/phased-execution/SKILL.md b/phased-execution/SKILL.md index f8697c6..99d029e 100644 --- a/phased-execution/SKILL.md +++ b/phased-execution/SKILL.md @@ -1,23 +1,23 @@ --- name: phased-execution -description: Runs the .agent/phases/ phased-execution pipeline (ported from opencode's next-phase/auto-phase commands). Use when the user asks to run the next task, run the next phase, run all phases, run the phase pipeline, or check pipeline status. Each task executes in a separate pi subprocess so this chat's context stays small. +description: Runs the .agents/phases/ phased-execution pipeline (ported from opencode's next-phase/auto-phase commands). Use when the user asks to run the next task, run the next phase, run all phases, run the phase pipeline, or check pipeline status. Each task executes in a separate pi subprocess so this chat's context stays small. --- # Phased Execution Phase state lives in files, not chat: -- `.agent/PLAN.md` — master plan; LOCKED DECISIONS are binding -- `.agent/phases/todo/NN_name/` — a pending phase: `00_phase.md` (objective, dependencies, task index, testing & quality, completion criteria) plus `NN_task.md` task files (task sort order = execution order) -- `.agent/phases/todo/NN_name.md` — legacy single-file phase (still executable as one unit) -- `.agent/phases/complete/` — finished phases; mirrors the `todo/` layout (completed task files and the phase overview move here) -- `.agent/reports//.a.{md,err,validate}` — per-task executor reports, stderr, and validation logs (legacy phases: `.agent/reports/.a.*`) -- `.agent/validate.sh` — the pass/fail gate, run after **every task** +- `.agents/PLAN.md` — master plan; LOCKED DECISIONS are binding +- `.agents/phases/todo/NN_name/` — a pending phase: `00_phase.md` (objective, dependencies, task index, testing & quality, completion criteria) plus `NN_task.md` task files (task sort order = execution order) +- `.agents/phases/todo/NN_name.md` — legacy single-file phase (still executable as one unit) +- `.agents/phases/complete/` — finished phases; mirrors the `todo/` layout (completed task files and the phase overview move here) +- `.agents/reports//.a.{md,err,validate}` — per-task executor reports, stderr, and validation logs (legacy phases: `.agents/reports/.a.*`) +- `.agents/validate.sh` — the pass/fail gate, run after **every task** The unit of execution is the **task**: each task runs in a **separate pi process** (fresh context) with bounded fixer retries. A task only moves to `complete/` after the child exits 0, the child's stream ends with a clean -final report, **and** `.agent/validate.sh` passes. When all of a phase's tasks +final report, **and** `.agents/validate.sh` passes. When all of a phase's tasks are done, `00_phase.md` runs as the phase's **final pass** (remaining inline work + completion criteria + phase-level verification); moving it completes the phase and is the `PHASE_COMMIT` commit point. This chat only dispatches @@ -31,7 +31,7 @@ the terminal: tool calls, assistant text, `◐ thinking…` / `◑ thought for N indicators, yellow `⧉ compacting context` lines (these can take minutes — not a hang), and provider auto-retry notices. If the child dies mid-flush and the stream loses the final message, the report is recovered from the -child's session file (`.agent/phase-sessions/`), so a completed phase is +child's session file (`.agents/phase-sessions/`), so a completed phase is never lost to a truncated stream. ## Commands @@ -73,8 +73,8 @@ keeping its work). Relay to the user: the task (or phase) name, its executor report (printed at the end of the script output), and the validation outcome. On failure, point -the user at `.agent/reports//.a*.{md,err,validate}` (legacy -phases: `.agent/reports/.a*.*`) — the script also prints a ready to run +the user at `.agents/reports//.a*.{md,err,validate}` (legacy +phases: `.agents/reports/.a*.*`) — the script also prints a ready to run `pi --session … -c “…”` command to continue the failed session manually. ## Configuration (environment variables) @@ -92,7 +92,7 @@ phases: `.agent/reports/.a*.*`) — the script also prints a ready to run ## Setup notes -- First run creates `.agent/validate.sh` from `assets/validate.sh` if missing. +- First run creates `.agents/validate.sh` from `assets/validate.sh` if missing. It must be adapted to the project's real checks — it is the authoritative quality gate. - Phase directories are created by the `phase-authoring` skill or the @@ -101,9 +101,9 @@ phases: `.agent/reports/.a*.*`) — the script also prints a ready to run - Legacy flat phase files (`todo/NN_name.md`) are still executed as a single unit; `phase-authoring`'s `migrate-phases-to-tasks.sh` converts them to the directory layout (the phase's final pass then picks up any inline task list). -- Child executor sessions are kept in `.agent/phase-sessions/` (plus - `pipeline.log` in `.agent/`); if the project is versioned, git-ignore those - runtime artifacts only — `.agent/` itself is tracked and committed. +- Child executor sessions are kept in `.agents/phase-sessions/` (plus + `pipeline.log` in `.agents/`); if the project is versioned, git-ignore those + runtime artifacts only — `.agents/` itself is tracked and committed. - If you keep non-skill markdown (e.g. a `README.md`) in a skills directory (like `~/.pi/agent/skills/`), pi warns “description is required” for it. Add a `.gitignore` in that directory listing the file — pi's skill scanner diff --git a/phased-execution/assets/executor-prompt.md b/phased-execution/assets/executor-prompt.md index 2e323f6..9e5b3db 100644 --- a/phased-execution/assets/executor-prompt.md +++ b/phased-execution/assets/executor-prompt.md @@ -1,11 +1,11 @@ You are a phase executor in a phased build pipeline. You run in a fresh, isolated context; the harness manages phase files, retries, and final validation. -Target phase file: `.agent/phases/todo/{{PHASE}}` +Target phase file: `.agents/phases/todo/{{PHASE}}` ## Steps -1. Read `.agent/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS** (binding; never introduce technology outside them). +1. Read `.agents/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS** (binding; never introduce technology outside them). 2. Read `AGENTS.md` if present. -3. Read the completed phase files so your work stays architecturally consistent with what is already built: every `00_phase.md` in `.agent/phases/complete/*/`, plus any legacy flat phase files directly in `.agent/phases/complete/`. +3. Read the completed phase files so your work stays architecturally consistent with what is already built: every `00_phase.md` in `.agents/phases/complete/*/`, plus any legacy flat phase files directly in `.agents/phases/complete/`. 4. Read the target phase file and complete **every** task in it, in order. 5. Write the unit and integration tests required by the phase's Testing & Quality section. Do not omit parts of the code to inflate coverage. 6. Run the project's full test suite and linter. If anything fails — including the phase's coverage criterion — fix it and re-run until green. @@ -13,7 +13,7 @@ Target phase file: `.agent/phases/todo/{{PHASE}}` ## Rules - Work only on the target phase; never start work from other files in `todo/`. -- Do **not** move, rename, or edit the phase file, other files in `.agent/phases/todo/`, `.agent/PLAN.md`, or anything in `.agent/phases/complete/`. The harness moves the phase file on success. +- Do **not** move, rename, or edit the phase file, other files in `.agents/phases/todo/`, `.agents/PLAN.md`, or anything in `.agents/phases/complete/`. The harness moves the phase file on success. - Do not assume the code is correct; fix any errors you find while testing. - Leave the repository functional when you finish. diff --git a/phased-execution/assets/phase-final-prompt.md b/phased-execution/assets/phase-final-prompt.md index 72c7d0b..840ca96 100644 --- a/phased-execution/assets/phase-final-prompt.md +++ b/phased-execution/assets/phase-final-prompt.md @@ -1,19 +1,19 @@ You are the phase-completion executor in a phased build pipeline. You run in a fresh, isolated context; the harness manages phase and task files, retries, and final validation. -Phase overview: `.agent/phases/todo/{{PHASE}}/00_phase.md` +Phase overview: `.agents/phases/todo/{{PHASE}}/00_phase.md` ## Steps -1. Read `.agent/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS** (binding; never introduce technology outside them). +1. Read `.agents/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS** (binding; never introduce technology outside them). 2. Read `AGENTS.md` if present. -3. Read the phase overview `.agent/phases/todo/{{PHASE}}/00_phase.md`. -4. Check the phase's task index against `.agent/phases/complete/{{PHASE}}/`: if any task is missing from there, the overview itself still carries work (a legacy phase with an inline task list) — implement that remaining work now, in order, including its tests. +3. Read the phase overview `.agents/phases/todo/{{PHASE}}/00_phase.md`. +4. Check the phase's task index against `.agents/phases/complete/{{PHASE}}/`: if any task is missing from there, the overview itself still carries work (a legacy phase with an inline task list) — implement that remaining work now, in order, including its tests. 5. Otherwise every task is done: this is the final verification pass. Verify **each** completion criterion in the phase overview (commands to run, endpoints to hit, artifacts to exist), and execute any phase-level verification blocks it defines (e.g. a dedicated E2E or contract test suite). 6. Run the project's full test suite and linter. If anything fails — including the phase's coverage criterion or a completion criterion — fix it and re-run until green. 7. If you find defects in previously completed work (failing tests, lint errors, bugs), fix those as part of this pass. ## Rules - Never start work from other files in `todo/`. -- Do **not** move, rename, or edit the phase overview, other files in `.agent/phases/todo/`, `.agent/PLAN.md`, or anything in `.agent/phases/complete/`. The harness moves the phase file on success. +- Do **not** move, rename, or edit the phase overview, other files in `.agents/phases/todo/`, `.agents/PLAN.md`, or anything in `.agents/phases/complete/`. The harness moves the phase file on success. - Do not assume the code is correct; fix any errors you find while testing. - Leave the repository functional when you finish. diff --git a/phased-execution/assets/task-executor-prompt.md b/phased-execution/assets/task-executor-prompt.md index f0d5013..04dde48 100644 --- a/phased-execution/assets/task-executor-prompt.md +++ b/phased-execution/assets/task-executor-prompt.md @@ -1,12 +1,12 @@ You are a task executor in a phased build pipeline. You run in a fresh, isolated context; the harness manages phase and task files, retries, and final validation. -Target task file: `.agent/phases/todo/{{PHASE}}/{{TASK}}` +Target task file: `.agents/phases/todo/{{PHASE}}/{{TASK}}` ## Steps -1. Read `.agent/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS** (binding; never introduce technology outside them). +1. Read `.agents/PLAN.md` — project goals, architecture, and **LOCKED DECISIONS** (binding; never introduce technology outside them). 2. Read `AGENTS.md` if present. -3. Read the phase overview `.agent/phases/todo/{{PHASE}}/00_phase.md` — objective, dependencies, testing & quality mandate, and completion criteria. -4. Read this phase's completed task files (`.agent/phases/complete/{{PHASE}}/*.md`, excluding `00_phase.md`) and the `00_phase.md` overviews of other completed phases (`.agent/phases/complete/*/00_phase.md`) so your work stays architecturally consistent with what is already built. +3. Read the phase overview `.agents/phases/todo/{{PHASE}}/00_phase.md` — objective, dependencies, testing & quality mandate, and completion criteria. +4. Read this phase's completed task files (`.agents/phases/complete/{{PHASE}}/*.md`, excluding `00_phase.md`) and the `00_phase.md` overviews of other completed phases (`.agents/phases/complete/*/00_phase.md`) so your work stays architecturally consistent with what is already built. 5. Read the target task file and complete it fully, in order. 6. Write the unit and integration tests required by the task. Do not omit parts of the code to inflate coverage. 7. Run the project's full test suite and linter. If anything fails — including the task's coverage criterion — fix it and re-run until green. @@ -14,7 +14,7 @@ Target task file: `.agent/phases/todo/{{PHASE}}/{{TASK}}` ## Rules - Work only on the target task; never start the next task or work from other files in `todo/`. -- Do **not** move, rename, or edit the task file, `00_phase.md`, other files in `.agent/phases/todo/`, `.agent/PLAN.md`, or anything in `.agent/phases/complete/`. The harness moves the task file on success. +- Do **not** move, rename, or edit the task file, `00_phase.md`, other files in `.agents/phases/todo/`, `.agents/PLAN.md`, or anything in `.agents/phases/complete/`. The harness moves the task file on success. - Do not assume the code is correct; fix any errors you find while testing. - Leave the repository functional when you finish. diff --git a/phased-execution/assets/validate.sh b/phased-execution/assets/validate.sh index e7f36b5..88971e0 100755 --- a/phased-execution/assets/validate.sh +++ b/phased-execution/assets/validate.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -# .agent/validate.sh — validation gate for the phased-execution pipeline. +# .agents/validate.sh — validation gate for the phased-execution pipeline. # -# A phase is only moved to .agent/phases/complete/ if this script exits 0. +# A phase is only moved to .agents/phases/complete/ if this script exits 0. # Adapt the checks below to this project's real test suite, linter, and # coverage floor, then commit the result. set -uo pipefail diff --git a/phased-execution/scripts/auto-phase.sh b/phased-execution/scripts/auto-phase.sh index eda4305..931471e 100755 --- a/phased-execution/scripts/auto-phase.sh +++ b/phased-execution/scripts/auto-phase.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash # auto-phase.sh — run the full phased pipeline, no LLM in the loop. # -# Processes every pending task in .agent/phases/todo/ in pipeline order +# Processes every pending task in .agents/phases/todo/ in pipeline order # (phase order, then task order within each phase). Each task runs in its -# own pi process (fresh context); .agent/validate.sh runs after EVERY task. +# own pi process (fresh context); .agents/validate.sh runs after EVERY task. # On failure the executor's session is resumed for up to MAX_FIX_ATTEMPTS -# fixer rounds. A task moves to .agent/phases/complete/ only after the +# fixer rounds. A task moves to .agents/phases/complete/ only after the # child exits 0 AND validation passes; a phase completes when its # 00_phase.md final pass succeeds (legacy phases: when their file moves). # Stops at the first task that cannot be completed — re-run this script to @@ -17,12 +17,12 @@ set -uo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/lib.sh" -# Make interruptions visible: state stays in .agent/phases/todo, and the +# Make interruptions visible: state stays in .agents/phases/todo, and the # failed executor's session is still resumable on the next run. trap 'echo; echo "✗ ERROR: interrupted (SIGINT) — ${unit:-the pipeline} is left in $PHASE_TODO/; re-run to continue where it stopped" >&2; exit 130' INT trap 'echo; echo "✗ ERROR: interrupted (SIGTERM) — ${unit:-the pipeline} is left in $PHASE_TODO/; re-run to continue where it stopped" >&2; exit 143' TERM -cd "$(find_root)" || die "no .agent/phases/todo found in this or parent directories (run /to-phase or /audit-create first)" +cd "$(find_root)" || die "no .agents/phases/todo found in this or parent directories (run /to-phase or /audit-create first)" build_pi_args delivered=() diff --git a/phased-execution/scripts/lib.sh b/phased-execution/scripts/lib.sh index fc9a939..7a2e516 100755 --- a/phased-execution/scripts/lib.sh +++ b/phased-execution/scripts/lib.sh @@ -3,16 +3,16 @@ # Sourced by run-task.sh, run-phase.sh, and auto-phase.sh. Not meant to be run directly. # # Phase state lives in files, not chat context: -# .agent/PLAN.md master plan, LOCKED DECISIONS (binding) -# .agent/phases/todo/NN_name/ pending phase: 00_phase.md (overview) + NN_task.md task files -# .agent/phases/todo/NN_name.md legacy single-file phase (still executable) -# .agent/phases/complete/ finished phases — mirrors the todo/ layout -# .agent/reports/ per-task executor reports, stderr, validation logs -# .agent/phase-sessions/ child pi session files (resumable fixers) +# .agents/PLAN.md master plan, LOCKED DECISIONS (binding) +# .agents/phases/todo/NN_name/ pending phase: 00_phase.md (overview) + NN_task.md task files +# .agents/phases/todo/NN_name.md legacy single-file phase (still executable) +# .agents/phases/complete/ finished phases — mirrors the todo/ layout +# .agents/reports/ per-task executor reports, stderr, validation logs +# .agents/phase-sessions/ child pi session files (resumable fixers) # # The unit of execution is the TASK: each task file runs in its own pi # subprocess (fresh context) with bounded fixer retries, and -# .agent/validate.sh runs after EVERY task. A unit only moves to complete/ +# .agents/validate.sh runs after EVERY task. A unit only moves to complete/ # after the child exits 0, the child's stream ends with a clean final # report, and validation passes. When all of a phase's tasks are done, # 00_phase.md runs as the phase's final pass (any remaining inline work + @@ -24,22 +24,22 @@ EXECUTOR_PROMPT_FILE="$SKILL_DIR/assets/executor-prompt.md" TASK_EXECUTOR_PROMPT_FILE="$SKILL_DIR/assets/task-executor-prompt.md" PHASE_FINAL_PROMPT_FILE="$SKILL_DIR/assets/phase-final-prompt.md" -PHASE_TODO=".agent/phases/todo" -PHASE_DONE=".agent/phases/complete" -PHASE_REPORTS=".agent/reports" -PHASE_SESSIONS=".agent/phase-sessions" +PHASE_TODO=".agents/phases/todo" +PHASE_DONE=".agents/phases/complete" +PHASE_REPORTS=".agents/reports" +PHASE_SESSIONS=".agents/phase-sessions" MAX_FIX_ATTEMPTS="${MAX_FIX_ATTEMPTS:-3}" warn() { echo "⚠ $*" >&2; } die() { echo "✗ ERROR: $*" >&2; exit 1; } # --- project root ------------------------------------------------------------- -# Walk up from $PWD to the nearest directory containing .agent/phases/todo. +# Walk up from $PWD to the nearest directory containing .agents/phases/todo. find_root() { local d d="$(pwd)" while :; do - if [[ -d "$d/.agent/phases/todo" ]]; then printf '%s\n' "$d"; return 0; fi + if [[ -d "$d/.agents/phases/todo" ]]; then printf '%s\n' "$d"; return 0; fi [[ "$d" == "/" ]] && return 1 d="$(dirname "$d")" done @@ -47,7 +47,7 @@ find_root() { # --- unit selection ------------------------------------------------------------- # A unit is the smallest schedulable piece of work, referenced relative to -# .agent/phases/todo/: +# .agents/phases/todo/: # directory phase → each task file "NN_name/NN_task.md" (sort order), then # the phase overview "NN_name/00_phase.md" as the final pass # legacy flat → the phase file itself, "NN_name.md" @@ -225,7 +225,7 @@ fix_prompt() { # --- child executor ----------------------------------------------------------- # run_child [resume-session] -# Attempt 1: fresh session in .agent/phase-sessions/. +# Attempt 1: fresh session in .agents/phase-sessions/. # Attempt N>1: resumes the given session file — the failed executor's own # session, tracked by execute_unit (so retries keep its work). When no # session was captured (or FRESH_FIX=1) a fresh ephemeral session runs with @@ -287,17 +287,17 @@ run_child() { # --- validation gate ---------------------------------------------------------- ensure_validate() { - if [[ ! -f .agent/validate.sh ]]; then - cp "$SKILL_DIR/assets/validate.sh" .agent/validate.sh - chmod +x .agent/validate.sh - warn "no .agent/validate.sh found — created it from the skill template." + if [[ ! -f .agents/validate.sh ]]; then + cp "$SKILL_DIR/assets/validate.sh" .agents/validate.sh + chmod +x .agents/validate.sh + warn "no .agents/validate.sh found — created it from the skill template." warn "adapt it to this project's real test/lint/coverage commands; it is the pass/fail gate after every task." fi } -# run_validation ; returns 0 iff .agent/validate.sh exits 0. +# run_validation ; returns 0 iff .agents/validate.sh exits 0. run_validation() { - bash .agent/validate.sh >"$1" 2>&1 + bash .agents/validate.sh >"$1" 2>&1 } # --- notifications ------------------------------------------------------------ @@ -382,8 +382,8 @@ execute_unit() { errors+="[child run ended without a clean final report]"$'\n'"$(tail -c 4000 "$(unit_report "$unit" "$attempt" err)" 2>/dev/null)" fi if ! run_validation "$(unit_report "$unit" "$attempt" validate)"; then - warn ".agent/validate.sh FAILED — see $(unit_report "$unit" "$attempt" validate)" - errors+="[.agent/validate.sh FAILED]"$'\n'"$(tail -n 120 "$(unit_report "$unit" "$attempt" validate)" 2>/dev/null)" + warn ".agents/validate.sh FAILED — see $(unit_report "$unit" "$attempt" validate)" + errors+="[.agents/validate.sh FAILED]"$'\n'"$(tail -n 120 "$(unit_report "$unit" "$attempt" validate)" 2>/dev/null)" fi if [[ -z "$errors" ]]; then diff --git a/phased-execution/scripts/run-phase.sh b/phased-execution/scripts/run-phase.sh index 9bdeaae..a010a34 100755 --- a/phased-execution/scripts/run-phase.sh +++ b/phased-execution/scripts/run-phase.sh @@ -2,7 +2,7 @@ # run-phase.sh — run every remaining task of one phase to completion. # # Each task runs in its own pi process (fresh context) with the -# .agent/validate.sh gate after every task; the phase ends with its +# .agents/validate.sh gate after every task; the phase ends with its # 00_phase.md final pass. # # Usage: @@ -16,12 +16,12 @@ set -uo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/lib.sh" -# Make interruptions visible: state stays in .agent/phases/todo, and the +# Make interruptions visible: state stays in .agents/phases/todo, and the # failed executor's session is still resumable on the next run. trap 'echo; echo "✗ ERROR: interrupted (SIGINT) — ${phase:-this phase} is left in $PHASE_TODO/; re-run to continue" >&2; exit 130' INT trap 'echo; echo "✗ ERROR: interrupted (SIGTERM) — ${phase:-this phase} is left in $PHASE_TODO/; re-run to continue" >&2; exit 143' TERM -cd "$(find_root)" || die "no .agent/phases/todo found in this or parent directories (run /to-phase or /audit-create first)" +cd "$(find_root)" || die "no .agents/phases/todo found in this or parent directories (run /to-phase or /audit-create first)" phase="${1:-}" if [[ -n "$phase" ]]; then diff --git a/phased-execution/scripts/run-task.sh b/phased-execution/scripts/run-task.sh index d60bd93..fa5d040 100644 --- a/phased-execution/scripts/run-task.sh +++ b/phased-execution/scripts/run-task.sh @@ -16,12 +16,12 @@ set -uo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/lib.sh" -# Make interruptions visible: state stays in .agent/phases/todo, and the +# Make interruptions visible: state stays in .agents/phases/todo, and the # failed executor's session is still resumable on the next run. trap 'echo; echo "✗ ERROR: interrupted (SIGINT) — ${unit:-this task} is left in $PHASE_TODO/; re-run to continue" >&2; exit 130' INT trap 'echo; echo "✗ ERROR: interrupted (SIGTERM) — ${unit:-this task} is left in $PHASE_TODO/; re-run to continue" >&2; exit 143' TERM -cd "$(find_root)" || die "no .agent/phases/todo found in this or parent directories (run /to-phase or /audit-create first)" +cd "$(find_root)" || die "no .agents/phases/todo found in this or parent directories (run /to-phase or /audit-create first)" unit="${1:-}" if [[ -n "$unit" ]]; then diff --git a/security-audit/SKILL.md b/security-audit/SKILL.md index 3c9ebbc..af03e1e 100644 --- a/security-audit/SKILL.md +++ b/security-audit/SKILL.md @@ -1,6 +1,6 @@ --- name: security-audit -description: Performs a comprehensive application security audit and penetration test of a codebase. Use when the user asks to check code for vulnerabilities, security flaws, or insecure patterns, or to review against OWASP Top 10 / SANS Top 25. Produces a structured findings report and writes it to .agent/remediation_plan.md (or a path the user gives) so another agent can implement the fixes. +description: Performs a comprehensive application security audit and penetration test of a codebase. Use when the user asks to check code for vulnerabilities, security flaws, or insecure patterns, or to review against OWASP Top 10 / SANS Top 25. Produces a structured findings report and writes it to .agents/remediation_plan.md (or a path the user gives) so another agent can implement the fixes. --- # Security Audit @@ -52,7 +52,7 @@ For **every** finding, provide: ## Persistence -Write the full audit to **`.agent/remediation_plan.md`** (create `.agent/` if +Write the full audit to **`.agents/remediation_plan.md`** (create `.agents/` if missing) unless the user specifies another path. Make it self-contained so another agent can implement the fixes without re-reading this session: diff --git a/todo-to-phased/SKILL.md b/todo-to-phased/SKILL.md index 854c361..854ee95 100644 --- a/todo-to-phased/SKILL.md +++ b/todo-to-phased/SKILL.md @@ -1,6 +1,6 @@ --- name: todo-to-phased -description: Converts a TODO.md or TODO.txt file into a phased-execution roadmap — parses the file's sections and checkbox/bullet items, decomposes them into sequential phase directories (a 00_phase.md overview plus NN task files) at the agent's judgment (merging related small items, splitting large ones — items do not map one-to-one to phases or tasks), clears the TODO file once the roadmap is written, and scaffolds the .agent/ structure with a PLAN.md derived from the TODO when the project is not phased yet. Use when the user asks to convert a TODO file (TODO.md, TODO.txt, a todo list) into phases, to make TODO items executable as a phase pipeline, or to build a phase roadmap from a TODO file. This skill only writes planning files and never touches application code; the phased-execution skill runs the resulting phases, and the phase-authoring skill adds individual phases later. +description: Converts a TODO.md or TODO.txt file into a phased-execution roadmap — parses the file's sections and checkbox/bullet items, decomposes them into sequential phase directories (a 00_phase.md overview plus NN task files) at the agent's judgment (merging related small items, splitting large ones — items do not map one-to-one to phases or tasks), clears the TODO file once the roadmap is written, and scaffolds the .agents/ structure with a PLAN.md derived from the TODO when the project is not phased yet. Use when the user asks to convert a TODO file (TODO.md, TODO.txt, a todo list) into phases, to make TODO items executable as a phase pipeline, or to build a phase roadmap from a TODO file. This skill only writes planning files and never touches application code; the phased-execution skill runs the resulting phases, and the phase-authoring skill adds individual phases later. --- # TODO to Phased @@ -9,20 +9,20 @@ You are the **TODO Architect** — a senior engineer responsible for converting a human-written TODO file (TODO.md / TODO.txt) into an executable phased-execution roadmap. You parse the file, expand every unchecked item into an executable task, group the tasks into sequential phases, and — when -the project is not phased yet — scaffold the minimal `.agent/` structure. +the project is not phased yet — scaffold the minimal `.agents/` structure. You **never implement code yourself**. The TODO file is the source of truth for the conversion: it is read-only while you work and is **cleared as the -final step** (Phase 4) — its items now live in `.agent/phases/`. The +final step** (Phase 4) — its items now live in `.agents/phases/`. The `phased-execution` skill executes the phases (one fresh subprocess per task behind the validation gate), and `phase-authoring` handles individual phase additions later. Phase state lives in files, not chat: -- `.agent/PLAN.md` — master plan; **LOCKED DECISIONS** are binding -- `.agent/phases/todo/NN_name/` — a pending phase: `00_phase.md` overview + `NN_task.md` task files (task sort order = execution order) -- `.agent/phases/complete/` — finished phases, mirroring the todo/ layout (read-only history) -- `.agent/validate.sh` — the pass/fail gate, run after every task (installed by the `phased-execution` skill on first run) +- `.agents/PLAN.md` — master plan; **LOCKED DECISIONS** are binding +- `.agents/phases/todo/NN_name/` — a pending phase: `00_phase.md` overview + `NN_task.md` task files (task sort order = execution order) +- `.agents/phases/complete/` — finished phases, mirroring the todo/ layout (read-only history) +- `.agents/validate.sh` — the pass/fail gate, run after every task (installed by the `phased-execution` skill on first run) **Traceability:** every phase overview and task file carries a **Source** line citing the TODO file and line number(s) it was derived from, so any @@ -32,9 +32,9 @@ generated task can be traced back to the original TODO item. Run the audit first (Phase 1), then: -- **Not phased** (no `.agent/phases/todo/`) → **Protocol A**: full +- **Not phased** (no `.agents/phases/todo/`) → **Protocol A**: full conversion — minimal scaffold + the TODO-derived roadmap. -- **Already phased** (`.agent/phases/todo/` exists) → **Protocol B**: +- **Already phased** (`.agents/phases/todo/` exists) → **Protocol B**: append mode — new phase directories only, numbered after the existing ones. - **No TODO file found** → the audit lists candidates in the tree; ask the @@ -46,7 +46,7 @@ Run the audit first (Phase 1), then: 1. Run `bash scripts/todo-audit.sh [path]` (resolve `scripts/` against this skill's directory). It reports the TODO file's location, a parsed outline (sections, unchecked/checked items, bullets, nesting), the - project's `.agent/` state, the next free phase number, git state, and + project's `.agents/` state, the next free phase number, git state, and test tooling. 2. Read the **whole** TODO file with the read tool — the audit's outline is a preview, not a substitute. @@ -106,7 +106,7 @@ to guess at runtime. **Foundation phase.** If the project has application code and the audit shows no test tooling or no green baseline → phase `01_foundation`: adapt -`.agent/validate.sh` to the project's real test/lint/coverage checks, add +`.agents/validate.sh` to the project's real test/lint/coverage checks, add missing test/coverage tooling, fix or baseline existing test failures — the full current suite must be green and the project fully launchable when this phase completes. TODO phases then start at `02`. A pure docs/config project @@ -126,22 +126,22 @@ roadmap and locks any `PROPOSED` anchor. **Protocol A only** — create (or merge into what already exists) with file tools: -- **`.agent/PLAN.md`** — from `assets/plan-template.md`: assumptions & +- **`.agents/PLAN.md`** — from `assets/plan-template.md`: assumptions & design principles, the anchors table, high-level architecture (mirroring the actual code), validation workflow, and a phase-roadmap table whose source column cites the TODO lines. - **`AGENTS.md`** — the five base rules: - 1. "Always read `.agent/PLAN.md` first to understand the project context and goals." - 2. "Follow the phased execution protocol in `.agent/phases/`." - 3. "Never modify `.agent/PLAN.md` or any files in `.agent/phases/complete/`." - 4. "If you need to update any file in `.agent/phases/todo/`, you must ask the user for permission first." - 5. "Strictly adhere to the **LOCKED DECISIONS** listed in `.agent/PLAN.md`." -- **`.agent/phases/todo/`** and **`.agent/phases/complete/`** (the latter + 1. "Always read `.agents/PLAN.md` first to understand the project context and goals." + 2. "Follow the phased execution protocol in `.agents/phases/`." + 3. "Never modify `.agents/PLAN.md` or any files in `.agents/phases/complete/`." + 4. "If you need to update any file in `.agents/phases/todo/`, you must ask the user for permission first." + 5. "Strictly adhere to the **LOCKED DECISIONS** listed in `.agents/PLAN.md`." +- **`.agents/phases/todo/`** and **`.agents/phases/complete/`** (the latter created empty). -- **`.gitignore`** — add `.agent/phase-sessions/` and `.agent/pipeline.log` if missing (never `.agent/` itself — the planning tree is tracked and committed); if an existing `.gitignore` has a `.agent/` ignore line, remove it. +- **`.gitignore`** — add `.agents/phase-sessions/` and `.agents/pipeline.log` if missing (never `.agents/` itself — the planning tree is tracked and committed); if an existing `.gitignore` has a `.agents/` ignore line, remove it. Then write one phase directory per confirmed phase at -`.agent/phases/todo/NN_name/`, numbered from the audit's "next phase +`.agents/phases/todo/NN_name/`, numbered from the audit's "next phase number" (counting `todo/` and `complete/` together): - **`00_phase.md`** — from `assets/phase-template.md`: **Source** (the TODO @@ -161,7 +161,7 @@ number" (counting `todo/` and `complete/` together): executor work; a phase typically holds 2–8 tasks. **Protocol B** — write only the new phase directories (same content rules), -numbered after the existing ones. Do not touch `.agent/PLAN.md`, +numbered after the existing ones. Do not touch `.agents/PLAN.md`, `AGENTS.md`, or existing phases; note in the final summary that `PLAN.md`'s roadmap table does not list these appended phases. @@ -175,7 +175,7 @@ roadmap table does not list these appended phases. itself — leave the empty `TODO.md` in place so the workspace keeps a known, stable landing spot for future todos. - Commit the conversion — `AGENTS.md`, the cleared TODO file, the whole - `.agent/` tree (it is tracked, not git-ignored), and any other modified + `.agents/` tree (it is tracked, not git-ignored), and any other modified files — with a Conventional Commits message (e.g. `chore(agent): phase roadmap from TODO.md, NN phases`), always with `--no-gpg-sign`. @@ -190,14 +190,14 @@ Then hand off: ## Strict Operational Rules -- The conversion writes **planning files**: `.agent/**`, `AGENTS.md`, and +- The conversion writes **planning files**: `.agents/**`, `AGENTS.md`, and `.gitignore`. **Never modify application code.** The TODO file is read-only during the conversion and is cleared (never deleted) as the final step — only after the phase roadmap has been written. -- Never overwrite existing `.agent/` content — merge into it. Never modify - anything in `.agent/phases/complete/`. -- In Protocol B, never modify `.agent/PLAN.md` or `AGENTS.md`. -- Do not create `.agent/validate.sh` (the `phased-execution` skill installs +- Never overwrite existing `.agents/` content — merge into it. Never modify + anything in `.agents/phases/complete/`. +- In Protocol B, never modify `.agents/PLAN.md` or `AGENTS.md`. +- Do not create `.agents/validate.sh` (the `phased-execution` skill installs it on first run; the foundation phase — or the first phase's first task — adapts it). - Wait for confirmation of the Proposed Roadmap before writing any file, diff --git a/todo-to-phased/assets/phase-template.md b/todo-to-phased/assets/phase-template.md index 81eaa9b..ed83e5d 100644 --- a/todo-to-phased/assets/phase-template.md +++ b/todo-to-phased/assets/phase-template.md @@ -1,7 +1,7 @@ # Phase {{NN}} — {{Short Title}} **Source:** `{{TODO file}} L{{range(s) the phase's tasks cover, e.g. 34–38, 41}} — "{{capability / section title}}"` -**Story:** `{{.agent/user_stories/.md or "n/a"}}` +**Story:** `{{.agents/user_stories/.md or "n/a"}}` **Context:** `{{PLAN.md sections / files this phase builds on}}` ## Objective diff --git a/todo-to-phased/assets/task-template.md b/todo-to-phased/assets/task-template.md index 67718ab..d0393a3 100644 --- a/todo-to-phased/assets/task-template.md +++ b/todo-to-phased/assets/task-template.md @@ -1,7 +1,7 @@ # Task {{NN}} — {{Short Title}} **Phase:** `{{NN_phase}}` · **Source:** `{{TODO file}}:{{line(s), e.g. 42 or 42–44}} — "{{original TODO item text — the item or items this task implements}}"` -**Story:** `{{.agent/user_stories/.md or "n/a"}}` +**Story:** `{{.agents/user_stories/.md or "n/a"}}` ## Objective {{1–2 sentences: what this task delivers}} diff --git a/todo-to-phased/scripts/todo-audit.sh b/todo-to-phased/scripts/todo-audit.sh index de8ae77..6578adf 100755 --- a/todo-to-phased/scripts/todo-audit.sh +++ b/todo-to-phased/scripts/todo-audit.sh @@ -3,8 +3,8 @@ # # Locates a TODO.md / TODO.txt (or takes one as an argument), prints its # location, a parsed outline (sections, unchecked/checked items, bullets, -# nesting), and the project's .agent/ state, next free phase number -# (counting .agent/phases/todo/ and complete/ together, zero-padded to 2 +# nesting), and the project's .agents/ state, next free phase number +# (counting .agents/phases/todo/ and complete/ together, zero-padded to 2 # digits), git state, and test tooling. # # Usage: @@ -140,24 +140,24 @@ else printf '%s\n' ${outline[@]+"${outline[@]}"} fi -# --- .agent state ----------------------------------------------------------------- +# --- .agents state ----------------------------------------------------------------- echo -echo ".agent state:" +echo ".agents state:" a=0 -if [[ -f "$root/.agent/PLAN.md" ]]; then - echo " .agent/PLAN.md: present" +if [[ -f "$root/.agents/PLAN.md" ]]; then + echo " .agents/PLAN.md: present" a=1 fi if [[ -f "$root/AGENTS.md" ]]; then echo " AGENTS.md: present" a=1 fi -if [[ -f "$root/.agent/validate.sh" ]]; then - echo " .agent/validate.sh: present" +if [[ -f "$root/.agents/validate.sh" ]]; then + echo " .agents/validate.sh: present" a=1 fi -todo_dir="$root/.agent/phases/todo" -complete_dir="$root/.agent/phases/complete" +todo_dir="$root/.agents/phases/todo" +complete_dir="$root/.agents/phases/complete" list_phases() { local dir="$1" entry n t any=0 for entry in "$dir"/*; do @@ -176,16 +176,16 @@ list_phases() { if (( ! any )); then echo " (empty)"; fi } if [[ -d "$todo_dir" ]]; then - echo " .agent/phases/todo:" + echo " .agents/phases/todo:" list_phases "$todo_dir" a=1 fi if [[ -d "$complete_dir" ]]; then - echo " .agent/phases/complete:" + echo " .agents/phases/complete:" list_phases "$complete_dir" a=1 fi -if (( ! a )); then echo " (no .agent/ artifacts — Protocol A full conversion needed)"; fi +if (( ! a )); then echo " (no .agents/ artifacts — Protocol A full conversion needed)"; fi max=0 for d in "$todo_dir" "$complete_dir"; do diff --git a/upgrade-existing-app/SKILL.md b/upgrade-existing-app/SKILL.md index 1dad30b..6e7e28a 100644 --- a/upgrade-existing-app/SKILL.md +++ b/upgrade-existing-app/SKILL.md @@ -53,8 +53,8 @@ Once confirmed, apply these upgrades (directly for small changes, as phases for ## Strict Operational Rules - **Audit before touching code.** Present the gap analysis and get confirmation first. -- **Prefer phases for large/risky changes.** Wrap big refactors in `.agent/phases/todo/NN_name/` (overview + task files) and let the `phased-execution` skill execute them behind the gate; do small, safe refactors directly. +- **Prefer phases for large/risky changes.** Wrap big refactors in `.agents/phases/todo/NN_name/` (overview + task files) and let the `phased-execution` skill execute them behind the gate; do small, safe refactors directly. - **Never regress completed behavior.** Every change must keep the project functional and launchable. -- **Never** modify `.agent/PLAN.md` or anything in `.agent/phases/complete/` without explicit permission. +- **Never** modify `.agents/PLAN.md` or anything in `.agents/phases/complete/` without explicit permission. - **No external CDNs** — ever. All assets served from the app. - Keep `debugpy` imported **only** when `DEBUGPY=1`.