@gtrabanco/pi-agentic-workflow 0.1.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 +21 -0
- package/README.es.md +154 -0
- package/README.md +148 -0
- package/dist/config/defaults.d.ts +8 -0
- package/dist/config/defaults.js +11 -0
- package/dist/config/load.d.ts +19 -0
- package/dist/config/load.js +76 -0
- package/dist/config/merge.d.ts +4 -0
- package/dist/config/merge.js +43 -0
- package/dist/config/schema.d.ts +21 -0
- package/dist/config/schema.js +144 -0
- package/dist/config/types.d.ts +53 -0
- package/dist/config/types.js +12 -0
- package/dist/extension/factory.d.ts +47 -0
- package/dist/extension/factory.js +49 -0
- package/dist/extension/index.d.ts +4 -0
- package/dist/extension/index.js +84 -0
- package/dist/routing/catalogue.d.ts +35 -0
- package/dist/routing/catalogue.js +79 -0
- package/dist/routing/dispatch.d.ts +34 -0
- package/dist/routing/dispatch.js +191 -0
- package/dist/routing/state.d.ts +13 -0
- package/dist/routing/state.js +65 -0
- package/dist/routing/types.d.ts +90 -0
- package/dist/routing/types.js +3 -0
- package/dist/settings/console.d.ts +55 -0
- package/dist/settings/console.js +266 -0
- package/dist/settings/store.d.ts +3 -0
- package/dist/settings/store.js +24 -0
- package/dist/settings/view.d.ts +11 -0
- package/dist/settings/view.js +46 -0
- package/package.json +59 -0
- package/skills/audit-docs/SKILL.md +171 -0
- package/skills/audit-pr/SKILL.md +201 -0
- package/skills/audit-pr/references/01_MERGE_GATES.md +24 -0
- package/skills/audit-pr/references/02_CLOSURE_AND_SCOPE_GATES.md +83 -0
- package/skills/audit-pr/references/03_AUDIT_PROCESS.md +69 -0
- package/skills/audit-pr/references/04_VERDICT.md +69 -0
- package/skills/audit-pr/references/05_ROUTING_AND_GUARDRAILS.md +58 -0
- package/skills/audit-pr/references/PORTABILITY.md +17 -0
- package/skills/design-feature/SKILL.md +162 -0
- package/skills/design-feature/references/INTERVIEW.md +52 -0
- package/skills/design-feature/references/PORTABILITY.md +15 -0
- package/skills/design-feature/references/UPSERT_EXAMPLE.md +8 -0
- package/skills/design-feature/references/WRITE_AND_UPSERT.md +92 -0
- package/skills/discover-repository-state/SKILL.md +83 -0
- package/skills/execute-phase/SKILL.md +115 -0
- package/skills/execute-phase/references/BATCH_AND_PORTABILITY.md +54 -0
- package/skills/execute-phase/references/CLOSEOUT.md +74 -0
- package/skills/execute-phase/references/DESCOPE.md +35 -0
- package/skills/execute-phase/references/EXECUTION_CONTRACT.md +147 -0
- package/skills/execute-phase/references/FOLDING.md +73 -0
- package/skills/execute-phase/references/FORGE_BODY.md +24 -0
- package/skills/execute-phase/references/HANDOFF.md +21 -0
- package/skills/execute-phase/references/OPPORTUNISTIC_FINDING.md +45 -0
- package/skills/execute-phase/references/PREFLIGHT.md +152 -0
- package/skills/execute-phase/references/UNIT_LOOP.md +88 -0
- package/skills/execute-phase/references/WORKFLOWS_FEATURE.md +37 -0
- package/skills/execute-phase/references/WORKFLOWS_FIX.md +43 -0
- package/skills/execute-phase/references/WORKFLOWS_LEGACY.md +26 -0
- package/skills/execute-phase/references/WORKFLOWS_SMALL_PHASED.md +38 -0
- package/skills/fold-findings/SKILL.md +141 -0
- package/skills/fold-findings/references/FOLD_POLICY.md +43 -0
- package/skills/fold-findings/references/FOLD_PROCESS.md +41 -0
- package/skills/generate-docs/SKILL.md +145 -0
- package/skills/generate-docs/references/ADAPTERS.md +15 -0
- package/skills/generate-docs/references/ADAPTER_DISCOVERY.md +33 -0
- package/skills/generate-docs/references/GENERATION_PROCESS.md +90 -0
- package/skills/init-workspace/SKILL.md +152 -0
- package/skills/init-workspace/references/BOOTSTRAP_DISCOVERY.md +70 -0
- package/skills/init-workspace/references/BOOTSTRAP_WRITE.md +58 -0
- package/skills/init-workspace/references/PORTABILITY.md +16 -0
- package/skills/init-workspace/references/UPGRADE.md +83 -0
- package/skills/log-session/SKILL.md +159 -0
- package/skills/loop-review-fold/SKILL.md +168 -0
- package/skills/orchestration-envelope/SKILL.md +81 -0
- package/skills/orchestration-envelope/references/TURN_CONTRACT.md +21 -0
- package/skills/phase-contract/SKILL.md +82 -0
- package/skills/plan-feature/SKILL.md +179 -0
- package/skills/plan-feature/references/ROUTING.md +83 -0
- package/skills/plan-feature-from-issue/SKILL.md +140 -0
- package/skills/plan-feature-scaffold/SKILL.md +93 -0
- package/skills/plan-feature-scaffold/references/SCAFFOLD_PROCESS.md +76 -0
- package/skills/plan-fix/SKILL.md +115 -0
- package/skills/plan-fix/references/PLANNING_PROCESS.md +118 -0
- package/skills/plan-fix/references/SPEC_CONTRACT.md +22 -0
- package/skills/planning-preflight/SKILL.md +130 -0
- package/skills/product-audit/SKILL.md +225 -0
- package/skills/product-audit/references/AUDIT_DIMENSIONS.md +24 -0
- package/skills/product-audit/references/AUDIT_PROCESS.md +85 -0
- package/skills/resolve-repository-state/SKILL.md +79 -0
- package/skills/review-a11y/SKILL.md +60 -0
- package/skills/review-brand/SKILL.md +65 -0
- package/skills/review-change/SKILL.md +156 -0
- package/skills/review-change/references/ADVERSARIAL_RECOMMENDATION.md +31 -0
- package/skills/review-change/references/ADVERSARIAL_SETUP.md +86 -0
- package/skills/review-change/references/ADVERSARIAL_SYNTHESIS.md +53 -0
- package/skills/review-change/references/OUTPUT_AND_GUARDRAILS.md +85 -0
- package/skills/review-change/references/PERSIST_AND_DECIDE.md +151 -0
- package/skills/review-change/references/PORTABILITY.md +74 -0
- package/skills/review-change/references/REVIEW_PROCESS.md +86 -0
- package/skills/review-code/SKILL.md +69 -0
- package/skills/review-debt/SKILL.md +72 -0
- package/skills/review-design/SKILL.md +60 -0
- package/skills/review-implementation/SKILL.md +108 -0
- package/skills/review-implementation/references/CLASSIFY.md +96 -0
- package/skills/review-implementation/references/FIND.md +35 -0
- package/skills/review-perf/SKILL.md +79 -0
- package/skills/review-security/SKILL.md +65 -0
- package/skills/review-seo/SKILL.md +65 -0
- package/skills/review-verify/SKILL.md +66 -0
- package/skills/ship-roadmap/SKILL.md +120 -0
- package/skills/ship-roadmap/references/ADVANCE.md +90 -0
- package/skills/ship-roadmap/references/AUDIT_AND_MERGE.md +64 -0
- package/skills/ship-roadmap/references/CLOSEOUT_AND_LOG.md +26 -0
- package/skills/ship-roadmap/references/FOUNDING.md +101 -0
- package/skills/ship-roadmap/references/GUARDRAILS.md +56 -0
- package/skills/ship-roadmap/references/MODEL_ROUTING.md +14 -0
- package/skills/ship-roadmap/references/PORTABILITY.md +34 -0
- package/skills/ship-roadmap/references/RECOVERY_AND_SELECTION.md +93 -0
- package/skills/ship-roadmap/references/STOP_CONDITIONS.md +9 -0
- package/skills/ship-roadmap/references/TERMINAL_REPORT.md +34 -0
- package/skills/triage-issue/SKILL.md +148 -0
- package/skills/triage-issue/references/AUDIT_FINDINGS.md +35 -0
- package/skills/triage-issue/references/FOLD_LEDGER.md +32 -0
- package/skills/triage-issue/references/ISSUE_PROCESS.md +101 -0
- package/skills/triage-issue/references/LABELS.md +83 -0
- package/skills/triage-issue/references/REVIEW_FINDING_PROCESS.md +41 -0
- package/skills/verification-contract/SKILL.md +77 -0
- package/skills/workflow-status/SKILL.md +143 -0
- package/skills/workflow-status/references/CRASH_RECOVERY.md +66 -0
- package/skills/workflow-status/references/ENVELOPE_CORE.md +107 -0
- package/skills/workflow-status/references/ENVELOPE_FIELDS.md +77 -0
- package/skills/workflow-status/references/GUARDRAILS.md +17 -0
- package/skills/workflow-status/references/PORTABILITY.md +14 -0
- package/skills/workflow-status/references/SENSOR_CORE.md +95 -0
- package/skills/workflow-status/references/SENSOR_SIGNALS.md +128 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
## Process
|
|
2
|
+
|
|
3
|
+
1. **Resolve the scope** — exactly one of, in this order:
|
|
4
|
+
- an explicit argument (`NN-slug`, `fix-n`, or a path/glob) → that unit's
|
|
5
|
+
branch diff vs the default branch, or the given paths;
|
|
6
|
+
- no argument → the current branch's diff vs the default branch;
|
|
7
|
+
- on the default branch with a clean tree → the last merged unit's diff
|
|
8
|
+
(`git log --merges -1` → its diff). State the resolved scope in the
|
|
9
|
+
report.
|
|
10
|
+
|
|
11
|
+
2. **Select pages with the incrementality checklist.** A guide page is
|
|
12
|
+
(re)written only if at least one holds — otherwise it is not touched:
|
|
13
|
+
- ✓ the diff changes files under the page's subject paths (page exists →
|
|
14
|
+
update it);
|
|
15
|
+
- ✓ the diff introduces a public entry point (exported API, event, command,
|
|
16
|
+
route, port) that no existing guide covers (→ create the page).
|
|
17
|
+
|
|
18
|
+
**Whole-tree regeneration is Forbidden** — an empty selection is a valid,
|
|
19
|
+
reportable outcome (`0 pages`, `Decision: PASS`).
|
|
20
|
+
|
|
21
|
+
3. **Write the pages** into the adapter's guides location (see the adapter
|
|
22
|
+
table). Fixed page shape, identical on every agent:
|
|
23
|
+
- **Title** — task-oriented ("Create a domain event"), not file-oriented.
|
|
24
|
+
- **Frontmatter** — the adapter's required keys **plus the provenance
|
|
25
|
+
keys** (mandatory, exactly these names):
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
generated-by: agentic-workflow/generate-docs
|
|
29
|
+
source-unit: <NN-slug | fix-n>
|
|
30
|
+
updated: <ISO date>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- **Body sections, in order**: *What this is* (1 paragraph) · *How to do
|
|
34
|
+
it* (numbered steps citing real paths — `src/...`, clickable) · *Where
|
|
35
|
+
the pieces live* (table: role → path) · *Related* (links to sibling
|
|
36
|
+
guide pages that share subject paths).
|
|
37
|
+
- **File name**: kebab-case derived from the subject module path
|
|
38
|
+
(`src/domain/events/` → `guides/domain/events.mdx`) — never a
|
|
39
|
+
model-invented name.
|
|
40
|
+
- Facts come from the diff and the code — a claim that cannot cite a path
|
|
41
|
+
does not go in the page.
|
|
42
|
+
|
|
43
|
+
4. **Knowledge map** (only when the documentation map declares a `map`
|
|
44
|
+
command). The map is the navigable call/module graph that lets a reader
|
|
45
|
+
trace an error doc-to-doc to its origin. Rules — no interpretation:
|
|
46
|
+
- **Run the declared command** (a project script wrapping deterministic
|
|
47
|
+
tooling — dependency-cruiser, madge, TypeDoc, tree-sitter, an LSP dump…).
|
|
48
|
+
The model **never infers graph nodes or edges** — zero-token structural
|
|
49
|
+
truth, or no map at all.
|
|
50
|
+
- **Validate the output**: JSON with `nodes[]` (each
|
|
51
|
+
`{"id", "path"}` minimum) and `edges[]` (each `{"from", "to"}`), any
|
|
52
|
+
extra keys allowed. Invalid → write nothing, report
|
|
53
|
+
`Map: invalid output — <first mismatch>` and count it as a FAIL.
|
|
54
|
+
- Valid → write it to the adapter's map location as `graph.json`, then
|
|
55
|
+
write/refresh one wrapper page per top-level module **the scope
|
|
56
|
+
touched** (incrementality applies to wrapper pages, not to the JSON):
|
|
57
|
+
the page lists the module's nodes with source paths, direct callers,
|
|
58
|
+
direct callees, and links to guide pages sharing subject paths — the
|
|
59
|
+
stack-trace walk. Wrapper pages carry the provenance frontmatter.
|
|
60
|
+
- No `map` command declared → `Map: n/a — no map command declared` in the
|
|
61
|
+
report. Never substitute model inference.
|
|
62
|
+
|
|
63
|
+
Per-tool recipes (the mapping each tool needs to emit the shape above):
|
|
64
|
+
`dependency-cruiser --output-type json` → modules⇒nodes, dependencies⇒edges;
|
|
65
|
+
`madge --json` → adjacency object⇒edges; TypeDoc JSON → reflections⇒nodes,
|
|
66
|
+
references⇒edges; tree-sitter/LSP call hierarchy → definitions⇒nodes,
|
|
67
|
+
calls⇒edges. The project's script owns the mapping; these recipes are
|
|
68
|
+
documentation for writing that script, not something this skill executes ad
|
|
69
|
+
hoc.
|
|
70
|
+
|
|
71
|
+
5. **Review export** (only with the explicit `--review` flag — never
|
|
72
|
+
automatic; findings may predate their fixes and a public site is a
|
|
73
|
+
publishing decision). Take the most recent `review-change` report available
|
|
74
|
+
in the invoking context (or the path the user names), convert its
|
|
75
|
+
fixed-format blocks verbatim into one page at the adapter's reviews
|
|
76
|
+
location (`reviews/<unit>-<ISO-date>.mdx` or `.md`), provenance frontmatter
|
|
77
|
+
included, findings tables intact — no summarizing, no re-judging (that is
|
|
78
|
+
`review-change`'s output, frozen). No report available → state it in the
|
|
79
|
+
report block and write nothing.
|
|
80
|
+
|
|
81
|
+
6. **Verify.** Run the declared docs build command (e.g. `npx astro check`)
|
|
82
|
+
when the adapter declares one; otherwise check that every intra-docs link
|
|
83
|
+
in the written pages resolves. Paste the command + exit code (or the link
|
|
84
|
+
count) in the report. A red build → fix the written pages or revert them;
|
|
85
|
+
never leave the docs site broken.
|
|
86
|
+
|
|
87
|
+
7. **Report** (fixed block), then the closing `→ Next:` block as the
|
|
88
|
+
ABSOLUTE last output. This skill does **not** commit — the pages ride the
|
|
89
|
+
unit's workflow (the executor or the user commits them with the unit's
|
|
90
|
+
close-out).
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init-workspace
|
|
3
|
+
user-invocable: true
|
|
4
|
+
version: 2.8.0
|
|
5
|
+
argument-hint: <target-dir>
|
|
6
|
+
author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
|
|
7
|
+
license: MIT
|
|
8
|
+
description: >
|
|
9
|
+
Adapt the workflow scaffold to a new repository or add only missing substrate
|
|
10
|
+
blocks to an existing install. Every install, hook, and overwrite needs
|
|
11
|
+
explicit consent. Triggers: "init-workspace", "set up agentic workflow",
|
|
12
|
+
"upgrade workflow scaffold".
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Init Workspace
|
|
16
|
+
|
|
17
|
+
Turn an empty or existing repo into one that works with the agentic workflow:
|
|
18
|
+
copy the generic scaffold, then **tailor it to this project** instead of leaving
|
|
19
|
+
raw placeholders.
|
|
20
|
+
|
|
21
|
+
## Turn contract — verify before ending the turn
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
✓ The adapted scaffold and repository-state ledger are written (or the merge/abort decision was asked) and remaining placeholders are listed
|
|
25
|
+
✓ Nothing was installed or overwritten without an explicit yes
|
|
26
|
+
✓ Artifact language: explicit user instruction > the project's declared docs language > English. The CONVERSATION language never decides — a Spanish prompt still produces English PRs/issues/commits/SPECs unless one of the first two says otherwise
|
|
27
|
+
✓ The closing `→ Next:` block is printed as the ABSOLUTE last output
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
About to end the turn with any box unchecked? The turn is NOT done — complete
|
|
31
|
+
the missing box first (weak models drop end-of-document duties; this list is
|
|
32
|
+
first on purpose).
|
|
33
|
+
|
|
34
|
+
## When to use
|
|
35
|
+
|
|
36
|
+
- Setting up a repo to use these skills and you want the documentation substrate
|
|
37
|
+
(`CLAUDE.md` + `docs/` map + templates) adapted to the project, not just copied.
|
|
38
|
+
- Prefer this over a static `npx degit gtrabanco/agentic-workflow/template` when you
|
|
39
|
+
want the gate commands, architecture, and doc domains filled in by interview.
|
|
40
|
+
|
|
41
|
+
## Step 0 — Discover the project (always first)
|
|
42
|
+
|
|
43
|
+
Inspect the target dir (`[target-dir]`, default cwd) before touching anything:
|
|
44
|
+
|
|
45
|
+
- Existing `CLAUDE.md` / `AGENTS.md` / `docs/` / `.github/`? If so, **do not
|
|
46
|
+
clobber** — check first whether it's an **agentic-workflow scaffold**
|
|
47
|
+
(marker: `CLAUDE.md` present *and* either `docs/features/ROADMAP.md` or a
|
|
48
|
+
`docs/workflow/` dir). If both markers are present, offer **upgrade** as the
|
|
49
|
+
default action, alongside merge / adapt-in-place / abort — see **Upgrade
|
|
50
|
+
mode** below. If `CLAUDE.md`/`docs/` exist but the markers are absent (a
|
|
51
|
+
foreign scaffold), stay in bootstrap and ask merge / adapt in place / abort
|
|
52
|
+
as before.
|
|
53
|
+
- Detect the stack from manifests (`package.json`, `pyproject.toml`, `go.mod`,
|
|
54
|
+
`Cargo.toml`, `Gemfile`, …) to *propose* gate commands and naming conventions.
|
|
55
|
+
- Note the git state (is it a repo, what's the default branch, and the **remote
|
|
56
|
+
URL → forge**: github.com → GitHub/`gh`, gitlab → GitLab/`glab`, else ask).
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Progressive loading — bootstrap or upgrade, never both
|
|
60
|
+
|
|
61
|
+
The reference allowlist is exactly the four linked paths below. Never invent or
|
|
62
|
+
read another `references/` path. Step 0 selects exactly one route:
|
|
63
|
+
|
|
64
|
+
**Hard rule for an existing Claude Code, Cursor, Copilot, or OpenCode
|
|
65
|
+
scaffold:** LOAD exactly `references/UPGRADE.md`. A missing committed safety
|
|
66
|
+
adapter is upgrade work, not a missing vendor primitive. Do not load bootstrap
|
|
67
|
+
or portability unless the runtime platform has no named adapter at all.
|
|
68
|
+
|
|
69
|
+
- Bare/foreign repository: read
|
|
70
|
+
[bootstrap discovery](references/BOOTSTRAP_DISCOVERY.md), complete its
|
|
71
|
+
interview, then read [bootstrap write](references/BOOTSTRAP_WRITE.md).
|
|
72
|
+
- Existing agentic-workflow scaffold: read [upgrade](references/UPGRADE.md)
|
|
73
|
+
only. Its additive-only rule is absolute; do not replay bootstrap.
|
|
74
|
+
- No named adapter exists for the detected runtime platform: add
|
|
75
|
+
[portability](references/PORTABILITY.md) only for that fallback. Claude Code,
|
|
76
|
+
Cursor, Copilot, and OpenCode are named supported adapters; a missing adapter
|
|
77
|
+
file is repaired by upgrade and does not trigger portability.
|
|
78
|
+
|
|
79
|
+
All resources are one hop from this file. Existing files, hook consent,
|
|
80
|
+
installation consent, and residual reporting are fixed contracts. Missing
|
|
81
|
+
template/migration evidence is reported by the selected route, never filled by
|
|
82
|
+
guessing. An existing OpenCode scaffold with only its safety adapter missing
|
|
83
|
+
loads exactly upgrade and skips bootstrap plus portability.
|
|
84
|
+
|
|
85
|
+
## Guardrails
|
|
86
|
+
|
|
87
|
+
- **Never overwrite an existing `CLAUDE.md` or `docs/` without explicit consent.**
|
|
88
|
+
- **Additive-only, never clobber (upgrade mode).** Upgrade mode only adds
|
|
89
|
+
blocks the project lacks and fills raw placeholders — it never rewrites or
|
|
90
|
+
deletes a block the project already tailored, even if the current template
|
|
91
|
+
changed that block too. A genuine re-tailor is a separate, explicitly
|
|
92
|
+
requested bootstrap adapt-in-place run, never something upgrade mode does
|
|
93
|
+
on its own. **The urgency label seeding is additive-only the same way:**
|
|
94
|
+
create a missing `urgent`/`fix-next` label, never touch one that already
|
|
95
|
+
exists (name, color, or description a project already customized).
|
|
96
|
+
- **Never redefine the urgency label vocabulary here.** `skills/triage-issue
|
|
97
|
+
/SKILL.md` is the sole owner of the `urgent`/`fix-next` names, colors, and
|
|
98
|
+
apply rules — this skill only seeds those two labels into the repo; it never
|
|
99
|
+
invents a third label or changes what the two mean.
|
|
100
|
+
- Docs-only scaffolding; no app code, no dependencies installed unprompted.
|
|
101
|
+
- Architecture-agnostic: record the project's pattern, don't impose one.
|
|
102
|
+
- Honest placeholders over invented specifics; flag what's left to fill.
|
|
103
|
+
- Honor the project's **Workflow conventions** once present; on an existing repo,
|
|
104
|
+
don't work on its default branch and never commit/push unless asked.
|
|
105
|
+
|
|
106
|
+
## Normalized Repository State
|
|
107
|
+
|
|
108
|
+
Seed `docs/workflow/REPOSITORY_STATE.md` from the template. Explain that
|
|
109
|
+
discovery freezes evidence before planning and only the resolver updates facts.
|
|
110
|
+
|
|
111
|
+
## Architectural invariants
|
|
112
|
+
|
|
113
|
+
Offer `docs/architecture/ARCHITECTURAL_INVARIANTS.md` as an optional project
|
|
114
|
+
contract for long-lived architectural rules. Its entries must name a stable ID,
|
|
115
|
+
repository evidence, and the authority that can change the rule. Do not infer a
|
|
116
|
+
rule from the implementation or a feature SPEC. A project without this document
|
|
117
|
+
remains compatible; record `n/a: no project invariants declared` in later
|
|
118
|
+
workflow artifacts rather than creating one silently.
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## Portability
|
|
122
|
+
|
|
123
|
+
The scaffold is vendor-neutral; only hook activation differs. When the detected
|
|
124
|
+
agent has no named adapter, follow [portability](references/PORTABILITY.md) and
|
|
125
|
+
keep it as an explicit residual. A supported Claude Code, Cursor, Copilot, or
|
|
126
|
+
OpenCode adapter does not load this fallback.
|
|
127
|
+
|
|
128
|
+
## Relationship to other skills
|
|
129
|
+
|
|
130
|
+
- `npx degit gtrabanco/agentic-workflow/template` — the static copy this skill
|
|
131
|
+
adapts. Use that when you want the raw scaffold and will fill it yourself.
|
|
132
|
+
- `docs/workflow/PORTABLE_PROMPT.md` — regenerates the **skills** adapted to a
|
|
133
|
+
project (behavior). This skill adapts the **substrate** (docs). Complementary.
|
|
134
|
+
- After init: `discover-repository-state` → `design-feature` → `plan-feature` →
|
|
135
|
+
`execute-phase`; run `audit-docs` to confirm the scaffold is coherent.
|
|
136
|
+
|
|
137
|
+
## Done when
|
|
138
|
+
|
|
139
|
+
- A tailored `CLAUDE.md` + `docs/` scaffold + `.github/` templates exist in the
|
|
140
|
+
target, unused folders pruned, residual placeholders flagged, the platform's
|
|
141
|
+
companion review skills are recorded (and offered), and the `urgent`/
|
|
142
|
+
`fix-next` labels are seeded (scaffold) or additively reconciled (upgrade),
|
|
143
|
+
and every accepted safety adapter is active and fixture-tested — or explicitly
|
|
144
|
+
listed as a residual when its hook API/dependency was unavailable.
|
|
145
|
+
- **The closing `→ Next:` block is printed** (plus the offer to install the skills):
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
→ Next: /discover-repository-state — freeze repository evidence before planning
|
|
149
|
+
· raw idea → /design-feature "<idea>" after discovery
|
|
150
|
+
· next roadmap entry → /plan-feature --next after discovery
|
|
151
|
+
· confirm the scaffold is coherent → /audit-docs
|
|
152
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
## Process
|
|
2
|
+
|
|
3
|
+
1. **Preflight.** Confirm the target dir and the discovery findings. If scaffold
|
|
4
|
+
files already exist, get an explicit decision before overwriting.
|
|
5
|
+
2. **Fetch the template.** `npx degit gtrabanco/agentic-workflow/template <dir>`
|
|
6
|
+
(into the target if empty, else a temp dir to merge from). **`degit` can't read
|
|
7
|
+
a private repo — it fails, or in `--mode=git` silently leaves an empty dir; for
|
|
8
|
+
a private source, `git clone` via SSH and copy the `template/` subtree instead.**
|
|
9
|
+
3. **Interview to adapt** — small batched rounds, each with a recommended default
|
|
10
|
+
drawn from Step 0; skip whatever discovery already answers:
|
|
11
|
+
- **Project** — name + one-line purpose.
|
|
12
|
+
- **Gate** — dev / build / test commands and the verification gate (proposed
|
|
13
|
+
from the detected stack; confirm).
|
|
14
|
+
- **Forge** — issue/PR tracker + CLI (proposed from the remote URL; confirm)
|
|
15
|
+
→ recorded in the Workflow conventions **Forge** line.
|
|
16
|
+
- **Git workflow** — how parallel work is handled: **branches** (default —
|
|
17
|
+
one active unit at a time, sequential, plain `git switch -c`) or
|
|
18
|
+
**worktrees** (parallel units in separate checkouts; only if the user's
|
|
19
|
+
agent/tooling manages them). Recorded in the Workflow conventions
|
|
20
|
+
**Git workflow** line; every skill that creates branches honors it.
|
|
21
|
+
- **Agent safety hooks** — detect where the agent actually runs and which
|
|
22
|
+
repository adapters apply: Claude Code, Cursor, Copilot, OpenCode, or none.
|
|
23
|
+
Recommend the shared command guard for every detected platform; explain
|
|
24
|
+
that shell adapters require `jq`, OpenCode uses the bundled Bun plugin,
|
|
25
|
+
and hooks are defense-in-depth behind forge rulesets. Ask one explicit
|
|
26
|
+
yes/no per adapter before activating it. Remote/VPS execution is not a
|
|
27
|
+
reason to skip: commit the repository adapter so the remote clone loads it.
|
|
28
|
+
- **Docs language.**
|
|
29
|
+
- **Architecture** — pattern, layers/modules, and dependency-direction rules
|
|
30
|
+
(stay architecture-agnostic; record the user's choice in `ARCHITECTURE.md`).
|
|
31
|
+
- **Doc domains** — which of `providers/ brand/ domain/ business/
|
|
32
|
+
infrastructure/ legal/ frontend/` apply. **Delete the folders that don't**
|
|
33
|
+
(e.g. `frontend/` for a non-UI project).
|
|
34
|
+
- **Capability inventory** (`docs/CAPABILITIES.md` — the substrate
|
|
35
|
+
`design-feature`'s Integration closure walks). Seed it from discovery,
|
|
36
|
+
not raw placeholders: on an existing codebase, propose the roles and the
|
|
37
|
+
`yes|no|partial` state of each template subsystem row (auth, ACL,
|
|
38
|
+
navigation, notifications, search, audit, settings, jobs, storage, i18n,
|
|
39
|
+
flags, billing, public API) from what the code actually shows; on an
|
|
40
|
+
empty repo, walk the same fixed rows with the user (`no` is a valid,
|
|
41
|
+
load-bearing answer). Delete rows that can never apply to this product;
|
|
42
|
+
confirm the result in one round — never leave the file as the raw
|
|
43
|
+
template.
|
|
44
|
+
- **Performance tooling** — detect what the stack offers, one slot at a
|
|
45
|
+
time (fixed checklist, first match per slot; record `none` explicitly
|
|
46
|
+
when nothing fits — never leave the slot undiscussed):
|
|
47
|
+
- *Static complexity lint*: Biome present → enable its `complexity`
|
|
48
|
+
group (incl. `noExcessiveCognitiveComplexity`); ESLint present →
|
|
49
|
+
suggest `eslint-plugin-sonarjs` + `eslint-plugin-unicorn`; neither →
|
|
50
|
+
ask for the stack's equivalent or record `none`.
|
|
51
|
+
- *Benchmark harness*: Vitest → `vitest bench`; Bun runtime → `mitata`;
|
|
52
|
+
Node → `tinybench`/`mitata`; other stacks → ask for the project's
|
|
53
|
+
benchmark command or record `none`.
|
|
54
|
+
- *Profiler*: Node → `node --cpu-prof` (zero-dependency default) or `0x`
|
|
55
|
+
via the project's package runner; Bun → `bun --inspect` CPU profiling;
|
|
56
|
+
other → ask or record `none`.
|
|
57
|
+
(The named tools are the TS/JS **adapter examples**; the contract is the
|
|
58
|
+
generic block below.) Offer installation — **the user confirms each
|
|
59
|
+
dependency; never install silently** — and register the outcome in the
|
|
60
|
+
template's `Performance commands` block next to the verification gate,
|
|
61
|
+
so `review-perf` can measure instead of guess.
|
|
62
|
+
- **Docs site** — does the project have (or want) a developer docs website
|
|
63
|
+
the `generate-docs` skill can write into? If yes, fill the template's
|
|
64
|
+
`Docs site` block in `CLAUDE.md` (format: starlight/docusaurus/markdown,
|
|
65
|
+
content dir, build command, optional knowledge-map command — proposed
|
|
66
|
+
from discovery: an `astro.config.*` + `@astrojs/starlight` dependency
|
|
67
|
+
means Starlight). If no, leave the block commented out — `generate-docs`
|
|
68
|
+
then reports NOT-CONFIGURED instead of guessing. Never scaffold the
|
|
69
|
+
website itself.
|
|
70
|
+
- **Naming conventions** and **MCP servers**, if any.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
## Write and verify the bootstrap
|
|
2
|
+
|
|
3
|
+
4. **Write the adapted scaffold.** Fill the `CLAUDE.md` placeholders (commands,
|
|
4
|
+
the documentation map rows, architecture); keep `AGENTS.md`, the
|
|
5
|
+
`features/_TEMPLATE` + `ROADMAP`, the `fix/_TEMPLATE` + `README`, and the
|
|
6
|
+
`.github/` templates; keep `.agentic-workflow/hooks/` and activate only the
|
|
7
|
+
adapters explicitly accepted in the interview; prune unused doc folders and
|
|
8
|
+
map rows. Leave honest placeholders where the user hasn't decided — never
|
|
9
|
+
invent values.
|
|
10
|
+
5. **Seed Normalized Repository State.** Copy
|
|
11
|
+
`template/docs/workflow/REPOSITORY_STATE.md` to
|
|
12
|
+
`docs/workflow/REPOSITORY_STATE.md` when it is absent. If the target already
|
|
13
|
+
has one, leave it unchanged and report that discovery should refresh it.
|
|
14
|
+
Explain that discovery freezes evidence before planning and only
|
|
15
|
+
`resolve-repository-state` updates frozen facts.
|
|
16
|
+
6. **Offer architectural invariants.** Keep
|
|
17
|
+
`docs/architecture/ARCHITECTURAL_INVARIANTS.md` from the template only when
|
|
18
|
+
the project has long-lived architectural constraints. Explain that it is
|
|
19
|
+
optional: an absent document means no project invariants are declared, not
|
|
20
|
+
that the scaffold failed. If retained, add its documentation-map row and
|
|
21
|
+
name the project's explicit architectural-decision authority.
|
|
22
|
+
7. **Install accepted agent safety hooks.** Keep the canonical policy and
|
|
23
|
+
fullauto wrapper at `.agentic-workflow/hooks/`. For each accepted platform,
|
|
24
|
+
activate only its repository config/example as documented in the hook pack.
|
|
25
|
+
Run `bash .agentic-workflow/hooks/tests/test-command-guard.sh`; missing `jq`,
|
|
26
|
+
an unknown payload, or an existing customized hook file becomes a residual,
|
|
27
|
+
never a silent overwrite. Direct merges remain blocked; do not create a
|
|
28
|
+
`.automerge` exception.
|
|
29
|
+
8. **Offer the workflow skills.** Propose installing them:
|
|
30
|
+
`npx skills add gtrabanco/agentic-workflow` (note the SSH/local-path variant if
|
|
31
|
+
the source is private). Don't install without a yes.
|
|
32
|
+
9. **State that reviews are self-contained; offer optional extras.** The
|
|
33
|
+
workflow ships its **own internal review pack** (`review-code`,
|
|
34
|
+
`review-security`, `review-verify`, `review-debt`, `review-design`,
|
|
35
|
+
`review-a11y`, `review-brand`, `review-perf`, `review-seo`) — it installs
|
|
36
|
+
with the skills and covers every review axis, so **no external review skill
|
|
37
|
+
is required on any agent**. If the user wants platform-specific extras (a
|
|
38
|
+
framework skill, a stack-specific security skill), record them in `CLAUDE.md`
|
|
39
|
+
under a short "Optional review extras" note so `review-change` and
|
|
40
|
+
`product-audit` run them **in addition** — never as a dependency. Don't
|
|
41
|
+
install anything without a yes.
|
|
42
|
+
10. **Seed the urgency labels (feature 15, injection-safe urgency).** Create the
|
|
43
|
+
two capability-gated GitHub labels `triage-issue` owns and applies
|
|
44
|
+
(`skills/triage-issue/SKILL.md` is the sole owner of the name/color
|
|
45
|
+
vocabulary — this step only seeds it, never redefines it):
|
|
46
|
+
`gh label create urgent --color B60205 --description "Evaluate for
|
|
47
|
+
interrupt-now — reaches the pause-vs-finish judge"` and
|
|
48
|
+
`gh label create fix-next --color D93F0B --description "Head of the fix
|
|
49
|
+
queue — never interrupts the in-flight unit"`. Create-if-missing: an
|
|
50
|
+
"already exists" error from `gh label create` is treated as success, not a
|
|
51
|
+
failure. Requires the forge remote/auth Step 0 already detected — if the
|
|
52
|
+
forge is unavailable or the user declines forge setup, skip this step and
|
|
53
|
+
list the two labels as a residual for the user to create manually later
|
|
54
|
+
(never fail the whole scaffold on it).
|
|
55
|
+
11. **Report.** List what was created, which placeholders still need human input,
|
|
56
|
+
the companion skills recorded/installed, the urgency labels seeded (or
|
|
57
|
+
skipped, with reason), and the next step: `discover-repository-state` →
|
|
58
|
+
`design-feature` → `plan-feature` → `execute-phase`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## Portability (agents other than Claude Code)
|
|
2
|
+
|
|
3
|
+
The workflow is the contract; Claude Code features are conveniences. On an
|
|
4
|
+
agent that lacks one, apply the fallback — never skip the step the feature
|
|
5
|
+
enables:
|
|
6
|
+
|
|
7
|
+
- **No slash-command menu** — where this skill says `/<skill>`, open that
|
|
8
|
+
skill's `SKILL.md` (wherever your agent installed the skills) and follow it
|
|
9
|
+
literally, in a fresh conversation: hand-offs assume a clean context.
|
|
10
|
+
- **No per-skill `model:`/`effort:`** — on the `#claude` branch the frontmatter pins these tiers; here, pick tiers yourself:
|
|
11
|
+
the interview and adaptation are judgment work — run them on your
|
|
12
|
+
**strongest** model.
|
|
13
|
+
- **No Claude Code hooks** — choose the Cursor, Copilot, or OpenCode adapter
|
|
14
|
+
when available. If the agent exposes no pre-tool hook, report the safety hook
|
|
15
|
+
as unavailable and keep forge rulesets as the hard boundary; `log-session`
|
|
16
|
+
remains the manual logging alternative.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
## Upgrade mode
|
|
2
|
+
|
|
3
|
+
Entered when Step 0 finds an existing **agentic-workflow scaffold** (not a
|
|
4
|
+
bare or foreign repo). Bootstrap mode (the Process section above) never
|
|
5
|
+
engages here — upgrade mode reuses the same discovery + interview machinery,
|
|
6
|
+
scoped to **only the blocks the current template has that this project
|
|
7
|
+
lacks**. Seven ordered steps:
|
|
8
|
+
|
|
9
|
+
1. **Locate the current template.** Fetch the current `template/` the same
|
|
10
|
+
way bootstrap does — `npx degit gtrabanco/agentic-workflow/template <temp-dir>`
|
|
11
|
+
(always into a temp dir here, never into the target); the SSH/local-path
|
|
12
|
+
variant applies verbatim for a private source.
|
|
13
|
+
2. **Diff the substrate.** Compare the project's `CLAUDE.md` (and the `docs/`
|
|
14
|
+
blocks its documentation map references) against the fetched template.
|
|
15
|
+
Produce the list of blocks/conventions the template carries that this
|
|
16
|
+
project's substrate lacks, or still holds as a raw, unfilled placeholder —
|
|
17
|
+
e.g. a `Docs site` block, a `Performance commands` block, a `Git workflow`
|
|
18
|
+
line, the five-state roadmap `Status legend`, the capability inventory
|
|
19
|
+
(`docs/CAPABILITIES.md` + its documentation-map row), the optional
|
|
20
|
+
architectural-invariants document
|
|
21
|
+
(`docs/architecture/ARCHITECTURAL_INVARIANTS.md` + its documentation-map
|
|
22
|
+
row), the portable command-guard pack and detected platform adapter, or the Normalized
|
|
23
|
+
Repository State ledger (`docs/workflow/REPOSITORY_STATE.md`). This is the
|
|
24
|
+
diff-against-current-template contract; it is the only source of *what's
|
|
25
|
+
new*. (A missing `docs/CAPABILITIES.md` is proposed with the same
|
|
26
|
+
discovery-seeded defaults bootstrap's interview uses — never as the raw
|
|
27
|
+
template. A missing repository-state ledger is proposed from the template
|
|
28
|
+
without overwriting any existing ledger.)
|
|
29
|
+
3. **Read `docs/workflow/MIGRATION.md`.** For each missing block, pull its
|
|
30
|
+
dated migration note so the proposal explains *why* the block exists and
|
|
31
|
+
*what* it migrates. If `MIGRATION.md` is absent, proceed on the template
|
|
32
|
+
diff alone and say so in the report — never block on a missing note.
|
|
33
|
+
4. **Propose only the missing blocks — one short, batched interview round.**
|
|
34
|
+
Each item is the block, a discovery-based default (the same detection
|
|
35
|
+
bootstrap mode already runs — e.g. `astro.config.*` + Starlight ⇒ `Docs
|
|
36
|
+
site` default, Biome ⇒ the complexity-lint slot, the remote URL ⇒ forge),
|
|
37
|
+
and the `MIGRATION.md` rationale when available. The user accepts, edits,
|
|
38
|
+
or skips each block. **Never re-ask what the project already answered** —
|
|
39
|
+
a block that's already filled is skipped, not re-interviewed.
|
|
40
|
+
5. **Write additively.** Insert accepted blocks, including a missing
|
|
41
|
+
`docs/workflow/REPOSITORY_STATE.md`; fill raw, still-placeholder
|
|
42
|
+
blocks with the confirmed values. **Never rewrite a block the project has
|
|
43
|
+
already tailored, and never delete anything** — a tailored block the
|
|
44
|
+
template also changed is left untouched and listed as a residual, not
|
|
45
|
+
silently updated. For hooks, add the canonical pack when absent and activate
|
|
46
|
+
a platform adapter only after an explicit yes; never replace an existing
|
|
47
|
+
platform hook config. Leave honest placeholders where the user skipped.
|
|
48
|
+
6. **Seed missing urgency labels, additively (feature 15).** Independent of
|
|
49
|
+
the `CLAUDE.md`/`docs/` block diff above (this is forge-repo state, not a
|
|
50
|
+
doc block): check whether the target repo already has the `urgent` and
|
|
51
|
+
`fix-next` labels (`gh label list`); create whichever is missing with the
|
|
52
|
+
same `gh label create` calls bootstrap mode uses (see Process step 9) —
|
|
53
|
+
never touch a label that already exists (additive-only, same never-clobber
|
|
54
|
+
rule as the doc blocks; a pre-existing `urgent`/`fix-next` label the
|
|
55
|
+
project recolored or redescribed is left exactly as-is).
|
|
56
|
+
7. **Report + hand off.** Summarize blocks added, filled, and skipped
|
|
57
|
+
(residuals), the urgency labels seeded (or already present), then print the
|
|
58
|
+
recommendation to run `product-audit` next to see which newly-available
|
|
59
|
+
*capabilities* apply to the code (upgrade mode migrates the substrate only,
|
|
60
|
+
never the code).
|
|
61
|
+
|
|
62
|
+
**Failure edges — handle each explicitly, never silently:**
|
|
63
|
+
|
|
64
|
+
- **No drift.** The diff (step 2) finds nothing missing or placeholder-only →
|
|
65
|
+
skip the interview entirely and report **"substrate current, nothing to
|
|
66
|
+
migrate"**. Never fabricate a block to propose just to have something to
|
|
67
|
+
show.
|
|
68
|
+
- **`MIGRATION.md` absent.** An older install may predate this file → proceed
|
|
69
|
+
on the template diff alone (step 3 already covers this) and say so plainly
|
|
70
|
+
in the proposal and the final report: rationale was unavailable, the block
|
|
71
|
+
list is still complete.
|
|
72
|
+
- **A block the project already tailored.** If the current template also
|
|
73
|
+
changed a block the project customized, **do not merge, diff-patch, or
|
|
74
|
+
overwrite it** — leave it exactly as the project has it and list it as a
|
|
75
|
+
residual in the report (step 5's never-clobber invariant). The user decides
|
|
76
|
+
separately, via an explicit bootstrap adapt-in-place run, whether to
|
|
77
|
+
re-tailor it.
|
|
78
|
+
- **Bootstrap stays unchanged on a bare or foreign repo.** If Step 0's
|
|
79
|
+
scaffold markers (`CLAUDE.md` + `docs/features/ROADMAP.md` or
|
|
80
|
+
`docs/workflow/`) are absent — no repo, an empty repo, or a `CLAUDE.md`
|
|
81
|
+
that isn't this workflow's — upgrade mode never engages; the existing
|
|
82
|
+
bootstrap Process (merge/adapt/abort) runs exactly as before this mode was
|
|
83
|
+
added.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: log-session
|
|
3
|
+
user-invocable: true
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
argument-hint: "[note to prepend to the entry]"
|
|
6
|
+
author: "Gabriel Trabanco <gtrabanco@users.noreply.github.com>"
|
|
7
|
+
license: MIT
|
|
8
|
+
description: >
|
|
9
|
+
Append a structured entry to the project's session log (`docs/LOGS.md`):
|
|
10
|
+
what was done this session, files touched, decisions taken, and the next
|
|
11
|
+
step — so the next session (or another person) can pick up the thread
|
|
12
|
+
without re-reading git history. Run it before `/clear`, before closing
|
|
13
|
+
Claude Code, or at any natural stopping point. On Claude Code and want hand-tuned per-skill model/effort tiers? Install the `#claude` branch instead (`npx skills add gtrabanco/agentic-workflow#claude`) — see the README. This branch is model-agnostic: the skill inherits whatever model and effort your agent session is already using.
|
|
14
|
+
Triggers: "log this
|
|
15
|
+
session", "log-session", "write a session log", "journal what we did",
|
|
16
|
+
"record this session before I clear", "save the session summary".
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Log Session
|
|
20
|
+
|
|
21
|
+
Capture the *why* and the *what-next* of a working session — the context that
|
|
22
|
+
git history alone never records. A commit says what changed; a session log says
|
|
23
|
+
what you were trying to do, what you decided, and where to resume.
|
|
24
|
+
|
|
25
|
+
Deliberately cheap (`sonnet`/`medium`): this is structured summarization, not
|
|
26
|
+
judgment. It must never reach for an expensive model.
|
|
27
|
+
|
|
28
|
+
## Turn contract — verify before ending the turn
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
✓ The entry was APPENDED to docs/LOGS.md (file edited, not just drafted) with accurate git facts
|
|
32
|
+
✓ No past entry was edited
|
|
33
|
+
✓ Artifact language: explicit user instruction > the project's declared docs language > English. The CONVERSATION language never decides — a Spanish prompt still produces English PRs/issues/commits/SPECs unless one of the first two says otherwise
|
|
34
|
+
✓ The closing `→ Next:` block is printed as the ABSOLUTE last output
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
About to end the turn with any box unchecked? The turn is NOT done — complete
|
|
38
|
+
the missing box first (weak models drop end-of-document duties; this list is
|
|
39
|
+
first on purpose).
|
|
40
|
+
|
|
41
|
+
## When to use
|
|
42
|
+
|
|
43
|
+
- **Before `/clear`** (or your agent's context-reset equivalent) — you're about
|
|
44
|
+
to wipe context; capture it first.
|
|
45
|
+
- **Before closing your agent** for the day.
|
|
46
|
+
- **At a natural stopping point** — a feature paused mid-way, a thread you want
|
|
47
|
+
to be able to resume cold.
|
|
48
|
+
- **After a long session** with several decisions worth remembering.
|
|
49
|
+
|
|
50
|
+
This is the *manual, rich* counterpart to the lightweight auto-logging hooks
|
|
51
|
+
the `template/` ships (see `template/.claude/`). The hooks capture the
|
|
52
|
+
mechanical facts for free on every exit; this skill writes the thoughtful
|
|
53
|
+
entry when you want one.
|
|
54
|
+
|
|
55
|
+
## Step 0 — Discover the project (always first)
|
|
56
|
+
|
|
57
|
+
Per the agent guide's **Workflow conventions** + **documentation map**, locate
|
|
58
|
+
the session log. Default path: `docs/LOGS.md`. If the documentation map names a
|
|
59
|
+
different location, use that. If no log file exists yet, create it from the
|
|
60
|
+
shape in `template/docs/LOGS.md` (a short header + the entry format below) and
|
|
61
|
+
say so.
|
|
62
|
+
|
|
63
|
+
If a session-start marker exists (`.claude/.session-*.start`, written by the
|
|
64
|
+
template's SessionStart hook), read it to bound the session precisely — it holds
|
|
65
|
+
the HEAD sha and start time at session open.
|
|
66
|
+
|
|
67
|
+
## Process
|
|
68
|
+
|
|
69
|
+
1. **Establish the session boundary.**
|
|
70
|
+
- If a marker is present, the session spans `marker_sha..HEAD` plus any
|
|
71
|
+
uncommitted work.
|
|
72
|
+
- Otherwise, use your own conversation context as the source of truth for
|
|
73
|
+
what happened this session, and corroborate with `git log` of the recent
|
|
74
|
+
commits and `git status` / `git diff --stat` for uncommitted changes.
|
|
75
|
+
|
|
76
|
+
2. **Gather the mechanical facts** (cheaply, with git):
|
|
77
|
+
- branch (`git branch --show-current`),
|
|
78
|
+
- commits this session (`git log --oneline <since>..HEAD`),
|
|
79
|
+
- files touched (`git diff --stat <since>..HEAD` + uncommitted).
|
|
80
|
+
|
|
81
|
+
3. **Write the narrative** — the part only you can add:
|
|
82
|
+
- **Summary:** 1–3 sentences on what this session set out to do and what
|
|
83
|
+
actually got done.
|
|
84
|
+
- **Decisions:** the non-obvious choices made and *why* (the rationale that
|
|
85
|
+
would otherwise be lost). Link related docs/issues.
|
|
86
|
+
- **Next:** the concrete next step(s) — the command to run, the unfinished
|
|
87
|
+
thread, the open question. Write it so a cold reader knows exactly where to
|
|
88
|
+
resume.
|
|
89
|
+
|
|
90
|
+
4. **Append the entry** to `docs/LOGS.md`, newest at the bottom (append-only,
|
|
91
|
+
chronological). Use this format so the auto-hook entries and these stay
|
|
92
|
+
compatible:
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
## <ISO-8601 timestamp> — <branch> — manual
|
|
96
|
+
- **Commits:** <n> (`<short-sha>…<short-sha>`)
|
|
97
|
+
- **Files:** <comma-separated paths, or a count if many>
|
|
98
|
+
- **Summary:** <what this session did>
|
|
99
|
+
- **Decisions:** <key choices + why; omit the line if none>
|
|
100
|
+
- **Next:** <the concrete next step>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
If the user passed a note as an argument, prepend it to the Summary.
|
|
104
|
+
|
|
105
|
+
5. **Commit policy.** `docs/LOGS.md` is documentation — keep it coherent, but do
|
|
106
|
+
**not** open a PR just for a log entry. If you're mid-feature on a branch,
|
|
107
|
+
the entry rides along with the next commit. If the working tree is otherwise
|
|
108
|
+
clean and the user wants it persisted, ask before committing a standalone
|
|
109
|
+
`docs(log): session <date>` commit. Never push without the project's push
|
|
110
|
+
convention.
|
|
111
|
+
|
|
112
|
+
## Guardrails
|
|
113
|
+
|
|
114
|
+
- **Never use an expensive model for this.** It's summarization; `sonnet` is the
|
|
115
|
+
ceiling, and the hooks do the free mechanical version.
|
|
116
|
+
- **Don't invent facts.** Decisions and next steps come from the actual session
|
|
117
|
+
(your context + git), not plausible-sounding filler. If a section has nothing
|
|
118
|
+
real, omit its line rather than padding.
|
|
119
|
+
- **Append, never rewrite.** Past entries are a historical record — don't edit
|
|
120
|
+
or "tidy" them. Same reasoning as not rewriting a delivered feature's planning
|
|
121
|
+
artifacts.
|
|
122
|
+
- **One file, append-only.** Don't fan session logs across files.
|
|
123
|
+
|
|
124
|
+
## Portability (agents other than Claude Code)
|
|
125
|
+
|
|
126
|
+
The workflow is the contract; Claude Code features are conveniences. On an
|
|
127
|
+
agent that lacks one, apply the fallback — never skip the step the feature
|
|
128
|
+
enables:
|
|
129
|
+
|
|
130
|
+
- **No Claude Code hooks** — the template's auto-logging hooks (SessionStart
|
|
131
|
+
marker, SessionEnd entry) don't run on other agents, so there is no marker
|
|
132
|
+
file and no free mechanical entry: this skill is the **only** journal writer.
|
|
133
|
+
Run it before ending every session, and bound the session with git alone
|
|
134
|
+
(Process step 1's no-marker path).
|
|
135
|
+
- **No `/clear`** — read it as your agent's context-reset / new-conversation
|
|
136
|
+
equivalent, in the triggers and in the closing block alike.
|
|
137
|
+
- **No per-skill `model:`/`effort:`** — the intent stands: use a **cheap**
|
|
138
|
+
model for this. It's summarization, never judgment.
|
|
139
|
+
|
|
140
|
+
## Relationship to other skills
|
|
141
|
+
|
|
142
|
+
- Complements the `template/`'s **SessionEnd hook** (free, mechanical, automatic
|
|
143
|
+
on `/clear` and exit) and the **opt-in SessionStart restore hook** (re-injects
|
|
144
|
+
the last entry to resume context). This skill is the rich, manual entry.
|
|
145
|
+
- Pairs with `execute-phase`'s per-feature `progress.md`: that tracks progress
|
|
146
|
+
*within* a feature; the session log is *cross-cutting* — whatever you touched
|
|
147
|
+
this session, across features/fixes.
|
|
148
|
+
- Not part of the PR gate — it's a working-memory aid, not a merge artifact.
|
|
149
|
+
|
|
150
|
+
## Done when
|
|
151
|
+
|
|
152
|
+
- A new entry is appended to `docs/LOGS.md` with at least Summary and Next.
|
|
153
|
+
- The mechanical facts (branch, commits, files) are accurate to git.
|
|
154
|
+
- **The closing `→ Next:` block is printed:**
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
→ Next: /clear (or your agent's context reset) is now safe — the session is captured
|
|
158
|
+
· resume later → the command named in the entry's **Next** line
|
|
159
|
+
```
|