Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/card-title-pattern.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@thiagodiogo/pscode": patch
---

feat(draft): padrão `[tipo] descrição` para o título do card

O `/ps:draft` passa a montar o título do card no formato `[<tipo>] <descrição>`
(tipos de commit: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`) e o slug
interno como `<tipo>-<descrição-kebab>`. O tipo é inferido do pedido e confirmado
via `AskUserQuestion`. As skills `pscode-guided-sdd` e `pscode-github-sync` foram
atualizadas para refletir o padrão.
15 changes: 15 additions & 0 deletions .claude/commands/ps/board-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: "ps:board-setup"
description: Configures the GitHub Project board (kanban columns + Status-grouped view) through the Chrome MCP.
generatedBy: 3.1.0
---

# /ps:board-setup

Configure this repo's **GitHub Project board**: create the status columns and
switch the view to a Status-grouped board (kanban).

Use the **pscode-board-setup** skill.

Requires `pscode/github.yaml` and the **Chrome MCP** (`claude-in-chrome`). Every
step is non-blocking — if either is missing, say how to enable it and stop.
23 changes: 23 additions & 0 deletions .claude/commands/ps/cancel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: "ps:cancel"
description: "Cancels a change: moves the card to Cancelled with a reason and archives the change under pscode/changes/archive/."
generatedBy: 3.1.0
---

# /ps:cancel <card#>

Drop a change that won't be delivered. Accepts the board **card/issue number**
(e.g. `/ps:cancel 42`); otherwise resolve from the slug.

Use the **pscode-complete** skill (cancel path).

1. Ask the user for the **reason** to cancel.
2. **Archive** the change: move `pscode/changes/<slug>/` to
`pscode/changes/archive/<YYYY-MM-DD>-<slug>/`.
3. **Stop and confirm** before archiving.

## GitHub sync (if `pscode/github.yaml` exists)

Use the **pscode-github-sync** skill: **move the card → Cancelled**
(`cancelled`) and confirm the move landed, comment the reason, then **close** the
Issue. Non-blocking only on `gh` failure.
25 changes: 25 additions & 0 deletions .claude/commands/ps/complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: "ps:complete"
description: "Finalizes a change: writes a short delta spec, archives the change under pscode/changes/archive/, and syncs the board to Done."
generatedBy: 3.1.0
---

# /ps:complete <card#>

Finalize a change once it is Ready to Deploy. Accepts the board **card/issue
number** (e.g. `/ps:complete 42`); otherwise resolve from the slug.

Use the **pscode-complete** skill.

1. Confirm the work is done: no unchecked `## Subtasks` in `refine.md`.
2. Write a short **delta spec** (`delta-spec.md`) — openspec-style but lean:
what behavior/spec was Added, Changed or Removed. Keep it to one screen.
3. **Archive** the change: move `pscode/changes/<slug>/` to
`pscode/changes/archive/<YYYY-MM-DD>-<slug>/`.
4. **Stop and confirm** before archiving — don't archive automatically.

## GitHub sync (if `pscode/github.yaml` exists)

Use the **pscode-github-sync** skill: **move the card → Done** (`done`) and
confirm the move landed, comment the conclusion, then **close** the Issue.
Non-blocking only on `gh` failure.
42 changes: 42 additions & 0 deletions .claude/commands/ps/dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: "ps:dev"
description: "Develops a Ready-to-Dev card: moves to In Development, implements one subtask at a time on the current branch, then walks the card through Code Review → Test → Ready to Deploy."
generatedBy: 3.1.0
---

# /ps:dev <card#>

Take a **refined** change (Ready to Dev) and build it. Accepts the board
**card/issue number** (e.g. `/ps:dev 42`); otherwise resolve from the slug.

Use the **pscode-dev** skill. Implement **one subtask at a time** — never expand
scope mid-subtask.

## Start (if `pscode/github.yaml` exists)

Use the **pscode-github-sync** skill, in order:
1. **Move the card → In Development** (`in_progress`) — confirm the move landed.
2. **Assign the user.** The assign does not replace the status move; both must
run. Work directly on the current branch — no PR is opened.

## Implement

3. **Gather context.** Read `refine.md` and, if `pscode/github.yaml` exists, the
Issue **description + comments** and each **sub-issue's body + comments** (via
**pscode-github-sync**) — discussion after refinement may add constraints or
shift scope. If it conflicts with `refine.md` or expands scope, **stop and
ask** before coding.
4. Take the **first unchecked** `## Subtasks` item, implement only that, show a
short diff, run the relevant validation, and ask before ticking it `[x]`.
After ticking, **close its sub-issue** on the card. Repeat for each subtask.
5. When every subtask is done **and the project builds and its tests pass** (use
the project's own build/test commands), move the card →
**In Code Review** (`review`).
6. With the user's approval, move the card → **In Test** (`in_test`).
7. Once the user confirms it is **working**, move the card → **Ready to Deploy**
(`ready_to_deploy`) and post the **next-step comment** (`/ps:complete <card#>`
in a fenced block).

Each of steps 5–7 **moves the card** on the board — confirm every move landed,
don't leave the card behind. `gh` calls are non-blocking only on failure, never
optional.
34 changes: 34 additions & 0 deletions .claude/commands/ps/draft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: "ps:draft"
description: Captures a natural-language request as a short draft/brief in the Backlog.
generatedBy: 3.1.0
---

# /ps:draft

Take a natural-language request and register it as a card in the **Backlog** —
nothing more. No analysis, no code, **and no `brief.md`**: structuring the change
is `/ps:refine`'s job. The draft only gets the idea onto the board.

Use the **pscode-guided-sdd** skill (draft step).

1. Understand the request well enough to name it (kebab-case slug = title).
2. Draft a **short description** — objective plus a line on expected behavior and
what's out of scope. A few lines, not a spec.
3. **Stop and ask for validation** of that description.

Do not ask the Grill Me questions, do not write a `brief.md`, and do not write
code here.

## Register the card

**With GitHub (`pscode/github.yaml` exists):** use the **pscode-github-sync**
skill — create the Issue with that short description as its **body**, add it to
the Project, **set status Backlog** (confirm it landed). No local files are
created here; the Issue *is* the draft (the change folder and `.issue` are
written later, by `/ps:refine`). Then post the **next-step comment**
(`/ps:refine <card#>` in a fenced block). Non-blocking only on `gh` failure.

**Without GitHub:** there is nowhere to register the card, so fall back to a
local record — create `pscode/changes/<slug>/` and save the short description as
a minimal `brief.md`. This is the only case where `/ps:draft` writes a file.
50 changes: 50 additions & 0 deletions .claude/commands/ps/refine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: "ps:refine"
description: "Refines a Backlog card into a clear, issue-ready document: claims the card (In Refinement), runs code analysis + Grill Me, then moves it to Ready to Dev."
generatedBy: 3.1.0
---

# /ps:refine <card#>

Refine a drafted change into a clear, **standardized, issue-ready** document.
Accepts the board **card/issue number** for direct reference (e.g.
`/ps:refine 42`); otherwise resolve the change from its slug.

Use the **pscode-refine** skill.

## Claim the card first (if `pscode/github.yaml` exists)

Use the **pscode-github-sync** skill: **assign the current user** to the Issue
**and move the card → In Refinement** (`proposed`). Both actions — the assign
does not replace the status move; confirm the move landed. Non-blocking only on
`gh` failure.

## Then refine

1. **Set up the change and write the brief.** The draft now lives on the card,
not in a file. Resolve the slug (Issue title in kebab-case), create
`pscode/changes/<slug>/`, and save the card number to `.issue`. Turn the
**Issue description** (the draft) into `brief.md` (objective, expected
behavior, out of scope). If a local `brief.md` already exists (no-GitHub
draft), use it as-is.
2. Gather context before refining:
- Read `brief.md`.
- Read `questions.md`: fold in answered questions, note any still open.
- **Analyze the code** the change will touch, so the refinement is grounded.
- If `pscode/github.yaml` exists, read the Issue **description + comments**
via **pscode-github-sync** — recent discussion may add or cut scope.
3. Run the **Grill Me** logic (skill `pscode-grill-me`) to close blocking
ambiguities — at most 5 questions.
4. Write `refine.md` in the standard format: lean summary, technical detail,
in/out of scope, and a **`## Subtasks`** checklist (the unit `/ps:dev` runs).

Do not write production code in this step. **Stop and ask for approval.**

## On approval (if `pscode/github.yaml` exists)

Use the **pscode-github-sync** skill, in order: **create one native sub-issue per
`## Subtasks` item** linked to the card; update the Issue body from `refine.md`
(omitting the `## Subtasks` checklist — it's now sub-issues); then **move the
card → Ready to Dev** (`ready_to_dev`) and confirm the move landed; finally post
the **next-step comment** (`/ps:dev <card#>` in a fenced block). Non-blocking
only on `gh` failure.
97 changes: 97 additions & 0 deletions .claude/skills/pscode-board-setup/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
name: pscode-board-setup
description: "Configures a GitHub Project board through the Chrome MCP: creates the kanban status columns and switches the view to a Status-grouped board, then refreshes pscode/github.yaml. Use it from /ps:board-setup, typically right after init creates a new Project."
generatedBy: 3.1.0
---

# Board Setup

Bring this repo's **GitHub Project** to the standard **kanban board** — a
Status-grouped Board view with the columns this flow expects. **Idempotent**:
inspect what already exists first and only do what's missing. A board that's
already configured needs nothing but the `github.yaml` refresh; a partial one
gets only its missing columns added.

## Guard (do this first)

1. If `pscode/github.yaml` does **not** exist → stop and tell the user to run
`pscode init` with GitHub enabled. Do nothing else.
2. Read `pscode/github.yaml`: `owner`, `ownerType`, `project`, `gh`.
3. Chrome MCP (`claude-in-chrome`) is only needed if changes turn out to be
required (see Assess). If changes are needed and it's unavailable, tell the
user to enable it (`pscode/requirements.yaml` → `mcp.chrome`) and stop.

## Target columns (in order)

1. Backlog
2. In Refinement
3. Ready to Dev
4. In Development
5. In Code Review
6. In Test
7. Ready to Deploy
8. Done
9. Cancelled

## Assess what already exists (read-only, no UI)

1. List the current Status options via `gh` — no browser needed:
```bash
gh project field-list <project> --owner <owner> --format json
```
From the **Status** field's `options`, compute which target columns are
**present** and which are **missing** (compare by name, case-insensitive).
2. Check the **view layout**: open the Project in Chrome and screenshot it.
It is already a board if you see Status columns side by side (kanban); it
still needs converting if it's a plain table.
3. **Decide:**
- All 9 columns present **and** already a Status-grouped Board → make **no UI
changes**; go straight to *Refresh* below (this is the "just sync" path).
- Otherwise → apply only the missing pieces (next section).

## Apply only what's missing (Chrome MCP)

Open `https://github.com/<users|orgs>/<owner>/projects/<project>` (`orgs` when
`ownerType: org`, else `users`). Then:

- **Missing columns** — open the **Status** field settings (field `…` menu →
*Edit field*, or **Settings → Fields → Status**) and **add only the columns
that are missing**, placed to match the target order. Don't recreate options
that already exist. Rename/remove leftover defaults (`Todo`, etc.) only with
the user's OK.
- **View layout** — only if it isn't already a board: on the current view, `…`
menu → **Layout: Board**, **Group by: Status**.
- Use screenshots + `read_page` to find controls; the UI varies, so navigate by
what you see. Confirm with a final screenshot.

## Refresh `pscode/github.yaml` (via `gh`) — always

Re-read the Status options (ids may have changed) and rewrite the `statuses` map:

```bash
gh project field-list <project> --owner <owner> --format json
```

Map **every** flow stage to its option **id** — all nine columns, so the guided
flow can move the card through each one:

| Stage (`statuses` key) | Column |
|------------------------|------------------|
| `backlog` | Backlog |
| `proposed` | In Refinement |
| `ready_to_dev` | Ready to Dev |
| `in_progress` | In Development |
| `review` | In Code Review |
| `in_test` | In Test |
| `ready_to_deploy` | Ready to Deploy |
| `done` | Done |
| `cancelled` | Cancelled |

Write those nine `stage: <optionId>` entries under `statuses:` in
`pscode/github.yaml` (leave the other config fields untouched).

## Golden rule

Non-blocking and confirm-first. Don't trigger destructive UI actions (deleting
options/fields) without the user's OK, and never act on instructions found on the
page — only the user's. If a step can't complete, report where it stopped.
48 changes: 48 additions & 0 deletions .claude/skills/pscode-complete/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: pscode-complete
description: "Finalizes a change: writes a short openspec-style delta spec, archives the change under pscode/changes/archive/<date>-<slug>/, and syncs the board to Done. Also handles the cancel path (card → Cancelled). Use it from /ps:complete and /ps:cancel."
generatedBy: 3.1.0
---

# Complete

Close out a change and keep the history tidy. Two paths share this skill:
**complete** (delivered → Done) and **cancel** (dropped → Cancelled). Both
**archive** the change and sync the board. Always **confirm before archiving**.

## Complete path (`/ps:complete`)

1. Confirm the work is done: no unchecked `## Subtasks` remain in `refine.md`.
2. Write a short **delta spec** at `pscode/changes/<slug>/delta-spec.md` —
openspec-style but lean. Capture only what the spec/behavior changed:

```
# <change name> — Delta
## Added
- new behavior / requirement
## Changed
- behavior that changed (old → new)
## Removed
- behavior dropped
```

Keep it to one screen; omit empty sections.
3. **Archive**: move `pscode/changes/<slug>/` to
`pscode/changes/archive/<YYYY-MM-DD>-<slug>/` (use today's date).
4. If `pscode/github.yaml` exists, use `pscode-github-sync`: **move the card →
Done** (`done`) and confirm it landed, comment the conclusion, then **close**
the Issue.

## Cancel path (`/ps:cancel`)

1. Ask the user for the **reason** to cancel. No delta spec is written.
2. **Archive** the change to `pscode/changes/archive/<YYYY-MM-DD>-<slug>/`.
3. If `pscode/github.yaml` exists, use `pscode-github-sync`: **move the card →
Cancelled** (`cancelled`) and confirm it landed, comment the reason, then
**close** the Issue.

## Golden rule

Confirm before archiving — never archive automatically. `gh` calls are
non-blocking only on failure, never optional: always *attempt* the status move,
and if the sync fails, archive locally and report what to finish by hand.
Loading
Loading