@igor-guari/pi-skill-implement-spec 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Matt Pocock
4
+ Copyright (c) 2025 Igor Guariroba
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,53 @@
1
- # Temporary Holding Version
1
+ # pi-skill-implement-spec
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Pi Package](https://img.shields.io/badge/pi--package-skill-blue)](https://github.com/IgorGuariroba/pi-skill-implement-spec)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+
6
+ **implement-spec** skill for the **[Pi coding agent](https://pi.dev)**, adapted from Matt Pocock's Engineering Skills.
7
+
8
+ > Implement a spec and its ticket graph on one integration branch using Pi workers.
9
+
10
+ ---
11
+
12
+ ## Installation
13
+
14
+ Install directly into Pi using `pi install`:
15
+
16
+ ```bash
17
+ pi install git:github.com/IgorGuariroba/pi-skill-implement-spec
18
+ ```
19
+
20
+ Or clone into your local/global skills directory:
21
+
22
+ ```bash
23
+ # Global Pi skills directory:
24
+ git clone https://github.com/IgorGuariroba/pi-skill-implement-spec.git ~/.pi/agent/skills/implement-spec
25
+
26
+ # Or Agent Skills standard path:
27
+ git clone https://github.com/IgorGuariroba/pi-skill-implement-spec.git ~/.agents/skills/implement-spec
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Usage
33
+
34
+ Trigger it explicitly in your session:
35
+
36
+ ```text
37
+ /skill:implement-spec
38
+ ```
39
+
40
+ Or let Pi automatically route to it based on conversation context and need.
41
+
42
+ ---
43
+
44
+ ## Credits
45
+
46
+ - **Original concept & methodology**: [Matt Pocock](https://github.com/mattpocock)
47
+ - **Adapted for Pi Agent**: [Igor Guariroba](https://github.com/IgorGuariroba)
48
+
49
+ ---
50
+
51
+ ## License
52
+
53
+ [MIT](LICENSE)
package/SKILL.md ADDED
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: implement-spec
3
+ description: Implement a spec and its ticket graph on one integration branch using
4
+ Pi workers.
5
+ disable-model-invocation: true
6
+ license: MIT
7
+ metadata:
8
+ author: Matt Pocock
9
+ adapted_by: Igor Guariroba
10
+ version: 1.0.0
11
+ ---
12
+
13
+
14
+ # Implement spec
15
+
16
+ Implement the provided spec and tickets on one **integration branch**. Tickets form a **task graph**: the **frontier** contains only tickets whose dependencies have been integrated and validated.
17
+
18
+ Read `references/pi-workers.md` before delegating. Workers are fresh Pi processes, not native subagents. Share absolute context pointers to the spec, tickets, exploration notes and commits. Keep notes and execution artifacts outside the repository.
19
+
20
+ ## Steps
21
+
22
+ 1. **Map the graph.** Read the spec and every ticket; record acceptance criteria, dependencies and tracker workflow. Use `docs/agents/issue-tracker.md` when present, otherwise the relevant installed tracker skill. Ask for any missing spec, tickets or tracker information that blocks execution. This step is complete when every ticket is accounted for and the graph has no unresolved dependency ambiguity or cycles.
23
+
24
+ 2. **Explore when needed.** Use a read-only exploration worker for unresolved codebase/documentation questions. Have it return evidence and pointers; the coordinator saves useful notes outside the repo. Exploration is complete when each blocking question has an answer or an explicit blocker.
25
+
26
+ 3. **Prepare integration.** Record the starting SHA and existing local changes, then create the integration branch without disturbing them. The coordinator is its sole writer and performs merges serially. If the tracker closes work through PRs, or the user requests one, open a draft after the first integrated commit; reference the spec and tickets using the tracker's closing convention.
27
+
28
+ 4. **Dispatch the frontier.** Create a dedicated branch/worktree from the current integration tip for each ready ticket, then start a fresh implementer worker there. The prompt must require the worker to:
29
+ - confirm its worktree, branch and base SHA before editing; report a mismatch to the coordinator rather than resetting;
30
+ - read `../tdd/SKILL.md` (pass an absolute path) and implement the ticket's acceptance criteria;
31
+ - run relevant checks, commit only its own work and report commit SHA(s), acceptance evidence, checks/results and blockers;
32
+ - leave integration and other workers' worktrees to the coordinator.
33
+
34
+ Start independent tickets concurrently through the shared worker guide. A ticket is ready for integration only after the coordinator verifies its commit(s), report and clean worktree.
35
+
36
+ 5. **Integrate serially.** Merge each completed ticket into integration. If the tip advanced, resolve conflicts and validate the combined state before accepting it. Delegate conflict resolution only to a fresh worker with exclusive ownership of the integration worktree while the coordinator pauses writes. Unresolved conflicts or failed checks keep the ticket blocked. Recompute the frontier only after a successful merge and relevant integration checks; return to step 4 until every ticket is integrated.
37
+
38
+ 6. **Review the whole spec.** Read `../code-review/SKILL.md` and review integration against the starting SHA from step 3. Supply the spec and all ticket criteria. Fix actionable findings in a fresh implementer worktree and integrate serially. Run the full validation suite and re-review affected areas. This step is complete when every criterion has evidence, both review axes have results (or an explicit unavailable source), and outstanding issues are resolved or reported as blockers.
39
+
40
+ 7. **Deliver and clean up.** Only after validation, mark the draft PR ready, or resolve tickets using the tracker's workflow when no PR exists. Do not mark incomplete work resolved. Report integration branch, commits/PR, checks and ticket outcomes. Remove only worktrees created by this run that are clean and whose commits are integrated; preserve blocked/unmerged work and execution artifacts for recovery. Avoid forced cleanup.
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
1
  {
2
2
  "name": "@igor-guari/pi-skill-implement-spec",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "Implement a spec and its ticket graph on one integration branch using Pi workers.",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-skill",
8
+ "pi",
9
+ "implement-spec",
10
+ "engineering-skills"
11
+ ],
12
+ "author": "Igor Guariroba",
13
+ "license": "MIT",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/IgorGuariroba/pi-skill-implement-spec.git"
17
+ },
18
+ "homepage": "https://github.com/IgorGuariroba/pi-skill-implement-spec#readme",
19
+ "pi": {
20
+ "skills": [
21
+ "."
22
+ ]
23
+ },
24
+ "files": [
25
+ "SKILL.md",
26
+ "*.md",
27
+ "references/"
28
+ ]
29
+ }
@@ -0,0 +1,33 @@
1
+ # Workers no Pi
2
+
3
+ Referência compartilhada para delegação em processos Pi independentes. Um **worker** é outro processo Pi com contexto próprio; o coordenador continua responsável pelo resultado.
4
+
5
+ ## Preparar e executar
6
+
7
+ 1. Confira `pi --help` para as opções da instalação. Crie um diretório de execução fora do repositório (`mktemp -d`) e um prompt por tarefa. Registre papel, cwd absoluto, escopo permitido, referências absolutas à spec/tickets/skills, resultado esperado e critério de conclusão. Compartilhe ponteiros, não o histórico da conversa.
8
+ 2. Execute cada tarefa com cwd explícito e contexto novo. Exemplo de comando para `process_start` (substitua os caminhos):
9
+
10
+ ```bash
11
+ cd /absolute/worktree && pi --print --no-session @/absolute/run/task.md > /absolute/run/result.md 2> /absolute/run/stderr.log
12
+ ```
13
+
14
+ Use o modelo/provider solicitado, se houver; caso contrário, mantenha os defaults configurados. `--no-session` evita persistir/reutilizar a conversa; configurações e instruções do projeto continuam disponíveis. Carregue outras skills lendo seus `SKILL.md` por caminho absoluto no prompt. Pi não precisa de uma ferramenta `Skill` para isso.
15
+ 3. Inicie tarefas independentes com chamadas separadas de `process_start`, cada uma com `watch`: `success: {exitCode: {eq: 0}}`, `failure: {exitCode: {ne: 0}}` e `timeoutMs` finito conforme o trabalho (por exemplo, 600000 para revisão). Após registrar os watches, informe a espera e encerre o turno. Os resultados chegam automaticamente; use `process_logs` para diagnóstico, não polling manual.
16
+ 4. Ao receber a conclusão, leia resultado e stderr e confira os artefatos. Exit code zero comprova execução, não cumprimento da tarefa. Uma resposta sem evidência, com bloqueio ou trabalho parcial é incompleta. Em timeout, inspecione e pare o processo antes de repetir ou liberar seu worktree. Preserve prompts, resultados e logs até entregar o trabalho.
17
+
18
+ Se `process_start`/watch não estiverem disponíveis, escolha o caminho Herdr abaixo quando aplicável; caso contrário, execute tarefas sequencialmente com timeout explícito na ferramenta disponível. Registre a perda de paralelismo. Falha de autenticação ou diálogo que exija interação deve ser reportado ao usuário; não invente aprovações nem transfira segredos em prompts.
19
+
20
+ ## Contratos e isolamento
21
+
22
+ - **Implementação:** um worktree e branch exclusivos por worker escritor. O resultado informa commit(s), critérios atendidos, comandos/testes e resultados, pendências e status Git. Só aceite conclusão após conferir esses itens.
23
+ - **Revisão/exploração:** leitura apenas do código; saída final em stdout, capturada pelo coordenador. Autorize escrita de notas externas apenas quando a tarefa exigir. Com `bash`, uma instrução de leitura não é sandbox: mantenha o escopo explícito e verifique o status Git antes/depois. Para leitura estrita sem shell, a instalação oferece `--tools read,grep,find,ls --no-mcp`; o coordenador pode fornecer diff e commits em arquivos externos.
24
+ - **Integração:** um único escritor na branch de integração. O coordenador serializa merges; workers de tickets não atualizam essa branch. Nenhum reset destrutivo ou limpeza forçada de alterações alheias.
25
+ - **Conclusão:** o coordenador valida commits, testes e critérios de aceitação. Estado de processo/pane não substitui essa validação.
26
+
27
+ ## Herdr: acompanhamento visível
28
+
29
+ Quando o usuário mencionar/pedir Herdr e `HERDR_ENV=1`, leia `../skills/herdr/SKILL.md` (relativo a este arquivo) e consulte a CLI instalada antes de controlar panes. Fora do Herdr, continue com processos Pi; Herdr não é pré-requisito.
30
+
31
+ Use os comandos documentados de pane para executar o mesmo comando `pi --print --no-session` em um shell disponível, preservando foco e cwd explícito. Capture saída, stderr e exit code em arquivos exclusivos fora do repositório. Aguarde via `watch_create` com polling barato do arquivo de exit code, sucesso zero, falha não zero e timeout finito. Publique esse arquivo apenas depois que o Pi terminar. Após registrar o watch, encerre o turno. Em timeout, inspecione o pane antes de repetir.
32
+
33
+ Se preferir um Pi interativo reconhecido por Herdr, confira primeiro se a CLI instalada oferece esse kind e siga a skill Herdr para iniciar, enviar prompt e aguardar. Cada tarefa independente começa em um processo/sessão nova. `idle`/`done` indica estado da interface, não aceitação do trabalho: leia a resposta e valide os artefatos. Crie workspaces/tabs ou outra topologia somente quando o usuário os solicitar; encerre apenas recursos criados para esta execução.