@softure-ai/skills 0.18.0 → 0.20.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/ONBOARD.md CHANGED
@@ -81,7 +81,7 @@ you escalate. Talk to me in <chat language>; everything you write to the reposit
81
81
  filed in SOFTURE/SKILLS; only a release or a production deploy waits for my word;
82
82
  - for a hosted project (claude.ai project) whose instructions lack it, the pointer from
83
83
  WORKFLOW §8.5 with <owner>/<repo> filled in, ready to paste.
84
- 6. Then follow "Start of a run" from AGENTS.md: adopt what is in flight first (give the go to READY
84
+ 6. Then follow "Start of a run" from AGENTS.md: act on open `owner-word` issues first, then adopt what is in flight (give the go to READY
85
85
  threads, nudge stalled ones), then start threads for ready, parallel-safe items, then the report
86
86
  routine. With no roadmap and no issue queue, say so in one line and name what I give next (a
87
87
  goal for `softure-shape`, or an issue queue); do not invent work.
package/README.md CHANGED
@@ -24,10 +24,34 @@ What the installer does (idempotent; re-run on every `npm install`):
24
24
  | `rules/AGENTS.md` | managed block in `AGENTS.md` (or `CLAUDE.md` if only that exists) |
25
25
  | ignore entries | managed block in `.gitignore`: installed skills are restored by `npm install`, not committed |
26
26
  | manifest | `.claude/softure-skills.json` |
27
+ | label `owner-word` | created on the forge when an authenticated `gh` can (outside CI); otherwise the command is printed |
27
28
 
28
29
  It never overwrites a skill folder it did not install. Flags: `--dry-run`, `--target <dir>`,
29
30
  `--no-gitignore` (commit the skills instead).
30
31
 
32
+ **CI line.** Add one step to the project's CI check, documentation-only changes included:
33
+
34
+ ```bash
35
+ npx softure-skills doctor
36
+ ```
37
+
38
+ It fails on drift in `context/` (a roadmap left after its archive, archived changes not stamped,
39
+ `## Summary` placeholders, a stale `context/state.json`, …; WORKFLOW §12). The installer prints the
40
+ line until a workflow runs it. `npx softure-skills state` regenerates `context/state.json`, which the
41
+ scripts otherwise write themselves.
42
+
43
+ ## Many projects at once
44
+
45
+ `npx softure-skills portfolio` is read-only: it reads `context/state.json` from the main branch of every
46
+ listed repository (arguments, or `~/.config/softure/portfolio.json` outside any project) and prints one table:
47
+
48
+ ```
49
+ | project | active roadmap X/N | queued | open changes | owner queue | last release | doctor |
50
+ ```
51
+
52
+ `--owner` prints only what waits for the owner across all projects, oldest first; `--json` gives the same
53
+ data to another tool; `--source api` reads through the GitHub API instead of git. See WORKFLOW §12.3.
54
+
31
55
  **Operating mode.** `context/workflow.json` → `mode` is `"manual"` (default) or `"autonomous"`, and the
32
56
  installer injects only that mode's section into the rules block:
33
57
 
@@ -94,6 +118,8 @@ operating modes.
94
118
  | hygiene | `softure-code-review` | review of a diff against conventions |
95
119
  | | `softure-lesson` | numbered rule in `lessons.md` |
96
120
  | | `softure-rule-review` | audit of AGENTS.md / CLAUDE.md / skills |
121
+ | | `softure-evidence` | screenshots and recordings in the evidence store (never git) + the evidence page |
122
+ | | `softure-doctor` | `context/state.json` (machine-readable state, `owner_queue`) + the `context/` contract check |
97
123
 
98
124
  Every interactive skill accepts `--auto`: it decides instead of asking and records each
99
125
  decision in the artifact. The orchestrators always use it, and `mode: "autonomous"` implies it.
package/WORKFLOW.md CHANGED
@@ -24,6 +24,8 @@ hygiene (any time)
24
24
  softure-code-review review a diff against the project conventions
25
25
  softure-rule-review audit AI rule files (AGENTS.md, CLAUDE.md, skills) for drift and contradictions
26
26
  softure-lesson turn a repeated mistake into a numbered rule
27
+ softure-evidence store screenshots and recordings outside git, by name, on one evidence page (§11)
28
+ softure-doctor check the context/ contract and keep context/state.json current (§12)
27
29
  ```
28
30
 
29
31
  Each step produces a durable artifact the next step reads. A step never starts without its
@@ -102,6 +104,15 @@ or languages.
102
104
  "research": { // optional: extra knowledge sources softure-research should consult
103
105
  "sources": ["docs/", "context/foundation/prd.md"]
104
106
  },
107
+ "evidence": { // optional: where screenshots, frame grabs and recordings live (§11); never git
108
+ "store": "artifact", // "artifact": the asset store of one evidence page (`url`), hosted cloud sessions;
109
+ // "project-files": the hosted project's shared files (`path`); "dir": a folder outside
110
+ // the repository (`path`), local runs; "command": object storage behind `upload`
111
+ "url": "https://claude.ai/code/artifact/<id>", // artifact: the per-project evidence page
112
+ "path": null, // project-files: "<project-slug>/evidence"; dir: e.g. "~/softure-evidence/<repo>"
113
+ "upload": null, // command: e.g. "scripts/evidence-upload.sh {file} {key}", prints the link last
114
+ "retainMonths": null // null: keep forever (default); N: prune evidence of changes archived N months ago
115
+ },
105
116
  "install": { // optional: read by the installer on every `npm install`
106
117
  "gitignore": true, // false: commit the installed skills (e.g. cloud sessions that never run npm install)
107
118
  "rules": ["language", "workflow", "conventions"], // sections of rules/AGENTS.md to inject; default: all.
@@ -139,14 +150,17 @@ Parallel sessions push often, and every push can start the project's CI. The ski
139
150
  The project's side: when the git hooks already run the gates (`pre-commit`, `pre-push`), CI does not need to
140
151
  repeat them on every pushed branch. A pre-push hook needs a cheap path for a push whose changed files are all
141
152
  under `context/` (the roadmap commits of `wt-roadmap.py`): skip typecheck, lint and tests, keep the language
142
- check. Without it every stage costs a full suite, which is what `cloudState: "branch"` works around. Run CI on pull requests, on the main branch or on demand, skip changes
143
- that touch only documents, and cancel superseded runs (`concurrency`).
153
+ check. Without it every stage costs a full suite, which is what `cloudState: "branch"` works around. Run CI on pull requests, on the main branch or on demand, skip
154
+ the gates for changes that touch only documents, and cancel superseded runs (`concurrency`). The one step that
155
+ does run on documentation-only changes is `npx softure-skills doctor` (§12): it takes seconds and checks exactly
156
+ the files those changes edit.
144
157
 
145
158
  ## 3. Artifacts
146
159
 
147
160
  ```
148
161
  context/
149
162
  workflow.json
163
+ state.json machine-readable project state, written by scripts only (§12)
150
164
  foundation/
151
165
  shape-notes.md softure-shape (frontmatter: session, status, context_type: greenfield | brownfield, created, updated; optional `## Frame` from softure-frame)
152
166
  prd.md softure-prd (frontmatter: version, status: draft | accepted, context_type, source, updated)
@@ -172,6 +186,9 @@ context/
172
186
 
173
187
  `change-id` is kebab-case, ASCII, at most 40 characters, unique across `changes/` and `archive/`.
174
188
 
189
+ **No binaries under `context/`.** Screenshots, frame grabs and recordings go to the evidence store and
190
+ are linked, never committed; owner material stays in the project files and is referenced by path (§11).
191
+
175
192
  **Headings are fixed English** in every artifact (`## Intent`, `## Progress`, `## Done`, `## Owner decisions and checks`, …),
176
193
  regardless of `language`. Scripts and orchestrators find sections by these headings. Only the prose under them is
177
194
  written in `language`.
@@ -369,13 +386,17 @@ the release keep `done_code` in the archived `## At a glance`, so the release st
369
386
  Then, in one commit (`docs(roadmap): close <slug>`):
370
387
 
371
388
  - move `roadmap.md` to `foundation/archive/<YYYY-MM-DD>-roadmap.md` (same-day collision: `-2`, `-3`, never other
372
- suffixes) and append `## Summary`: one table `| ID | Item | What changed | Merge |` (merge SHA per row) and the
373
- integration result line. It is the version history; release notes can be built from it;
389
+ suffixes) and append `## Summary`: one table `| ID | Item | What changed | Merge |` (merge SHA per row, `—` for a
390
+ carried or dropped row, never a placeholder) and the integration result line. It is the version history; release
391
+ notes can be built from it. The release that ships it may add one line `Release: <version> (<YYYY-MM-DD>)` under
392
+ the summary; `context/state.json` reports the newest one as `last_release`;
374
393
  - carried rows move to the next roadmap or to a queued one, never silently dropped;
375
394
  - if this roadmap was promoted from `roadmaps/roadmap-<slug>.md`, remove its backlog folder
376
395
  `backlog/roadmap-<slug>/` (move entries that are still alive to another queued roadmap first) and its row in an
377
396
  index file such as `foundation/roadmaps/README.md`, if the project keeps one;
378
- - afterwards: every file in `roadmaps/` is a waiting roadmap, and every folder in `backlog/` has its roadmap file.
397
+ - afterwards: every file in `roadmaps/` is a waiting roadmap, and every folder in `backlog/` has its roadmap file;
398
+ - right before the commit: `context_state.py write --staged` (the state goes into the same commit) and
399
+ `doctor.py`; a failure the close owns is fixed, any other is named in the report (§12).
379
400
 
380
401
  ## 6. `plan.md`
381
402
 
@@ -418,7 +439,8 @@ Rules:
418
439
  `Owner step:` lines, never owner checks (AGENTS.md → Operating mode: autonomous).
419
440
  - Notation:
420
441
  - done: `- [x] N.M text — <sha>`;
421
- - a Manual item the agent verified itself: `- [x] N.M text — <sha> (verified by agent: <how>)`;
442
+ - a Manual item the agent verified itself: `- [x] N.M text — <sha> (verified by agent: <how>)`; when the
443
+ proof is visual, the stored files are linked: `(verified by agent: <how> → <result>; <link>[, <link>])` (§11);
422
444
  - dropped mid-flight: `- [x] ~~N.M text~~ — dropped: <reason>`.
423
445
  - SHA: the phase commit is created first, then its SHA is written into Progress. Never amend that edit into the
424
446
  phase commit (the amend changes the SHA it records). It rides with the next commit of the change, or goes into a
@@ -579,6 +601,25 @@ the set. It never derives the next start only from the thread that just merged.
579
601
  scoped to the project's own repository: attach a repository the run needs (for example SOFTURE/SKILLS
580
602
  to file a gap) before deciding it is out of reach.
581
603
 
604
+ ### 8.6 Owner-word issues
605
+
606
+ The owner often decides for a project from outside its chat, for example while reviewing several projects at once
607
+ (`softure-skills portfolio --owner`, §12.3). Such a decision travels as an issue in the project's own repository,
608
+ labelled **`owner-word`**: one decision, its scope and any limit ("start the queued roadmap payments", "release only
609
+ after the last item", "drop SA-12"). It is the owner's word in writing, equal to the same sentence in the main chat.
610
+
611
+ - **Label.** The installer creates `owner-word` when the forge allows it (GitHub through an authenticated `gh`,
612
+ outside CI); otherwise it prints the one command that creates it.
613
+ - **Autonomous mode.** The coordinator lists open `owner-word` issues first at the start of a run and again on every
614
+ report and wake-up, and acts on each like an order in the chat: a roadmap to start goes through a roadmap thread,
615
+ a release word is recorded where the release rules look for it, a "no" or "later" is recorded in the roadmap. It
616
+ comments what it did (thread, PR, merge SHA) and closes the issue; one it cannot act on (unclear, contradicts
617
+ `change.md` or a standing order) gets a comment with the question and stays open.
618
+ - **Manual mode.** The coordinator shows open `owner-word` issues to the owner at the start of a session and acts
619
+ only on the owner's word in the conversation; it then comments and closes them the same way.
620
+ - **Not in `state.json`.** Open owner-word issues live on the forge; an aggregator reads both (`state.json` for what
621
+ waits for the owner, the forge for the words already given).
622
+
582
623
  ## 9. Commits
583
624
 
584
625
  - Implementation: `<type>(<change-id>): <phase title> (p<N>)`. Type is `feat`, `fix`, `refactor`,
@@ -586,7 +627,7 @@ to file a gap) before deciding it is out of reach.
586
627
  - Review fixes: `fix(<change-id>): address impl review`.
587
628
  - Progress bookkeeping (when no later commit of the change carries it): `docs(<change-id>): progress p<N>`.
588
629
  - Archive: `chore(archive): close <change-id>`.
589
- - Roadmap stage updates: `docs(roadmap): <ID> <stage>`.
630
+ - Roadmap stage updates: `docs(roadmap): <ID> <stage>` (they carry `context/state.json`, §12).
590
631
  - Lessons: `docs(lessons): L-<NNN> <title>`. Rule-file edits: `docs(rules): <what>`.
591
632
  - Merge of a worktree branch: `Merge <change-id> (<ID>): <outcome>`.
592
633
 
@@ -599,3 +640,164 @@ MCP access tokens, billing/trial, GDPR export/delete, consent, channel analytics
599
640
  checks and UI primitives. If a module covers the need, the plan uses the module, configured
600
641
  through `softure.config.ts`. If a module almost covers it, the plan records the gap as an
601
642
  issue for SOFTURE/AI instead of re-implementing it locally.
643
+
644
+ ## 11. Project files and evidence
645
+
646
+ Two kinds of material never enter git: **owner material** kept outside the repository, and **run
647
+ evidence** (screenshots, frame grabs, recordings) a run produces. Both are kept durably, under
648
+ predictable names, and referenced from the repository by path or link.
649
+
650
+ ### 11.1 Project files (owner material)
651
+
652
+ A hosted project's shared files (or the owner's equivalent folder) hold the project's briefs,
653
+ concepts, private data and design material, in one layout:
654
+
655
+ ```
656
+ <project-slug>/
657
+ INDEX.md file → what it is → who reads it
658
+ briefs/YYYY-MM-DD-<topic>.md concepts, owner roadmaps, private data
659
+ data/YYYY-MM-DD-<topic>.<ext> exports, real seed data, documents
660
+ design/<screen>-<variant>.<ext> mock-ups, inspiration, brand material
661
+ evidence/ run evidence when `evidence.store` is "project-files" (§11.2)
662
+ archive/ superseded files
663
+ ```
664
+
665
+ - Lowercase kebab-case, a date prefix, no version or `-final` suffixes: the version lives in the content.
666
+ A superseded file moves to `archive/`; `INDEX.md` gets one line per file.
667
+ - The repository references a file by path (`project files: <project-slug>/briefs/2026-11-02-roadmap.md`)
668
+ and never copies its content. Anything with personal data, real bookings, amounts or addresses lives
669
+ there, never in the repository.
670
+ - `softure-init` writes the `INDEX.md` template when the shared files are reachable and it is missing,
671
+ otherwise prints it for the owner (`softure-init/references/templates.md`).
672
+
673
+ ### 11.2 Run evidence
674
+
675
+ - **Store:** `evidence.store` (§2), outside git. `artifact` (the asset store of one per-project
676
+ evidence page) suits hosted cloud sessions: it needs no secret and the owner browses the page.
677
+ `project-files` suits sessions that can write the shared files, `dir` local runs, `command` object
678
+ storage (R2/S3) behind a project script that holds its own key. Never `context/changes/<id>/`.
679
+ - **Name:** `<change-id>/<NN>-<what>-<before|after>-<width>-<theme>.webp`, e.g.
680
+ `add-side-map/01-map-panel-after-390-dark.webp`. WebP at quality 85; PNG only above the WebP size
681
+ limit (a side over 16383 px); recordings keep their format.
682
+ - **Link:** each Progress item that relied on visual evidence links its stored files (§6 notation)
683
+ instead of describing them. `softure-impl-review` treats a visual claim without a link that opens as
684
+ missing evidence.
685
+ - **Page:** one evidence page per project lists the changes newest first, a thumbnail grid per change,
686
+ `before` and `after` of the same screen, width and theme side by side.
687
+ - **Gate:** `softure-archive` stops when the change folder holds an image or a recording.
688
+ - **Retention:** kept forever by default; `evidence.retainMonths` (or the owner's word) prunes the
689
+ evidence of changes archived that many months ago.
690
+ - **Exception:** visual-regression baselines that tests compare against stay in the repository, next
691
+ to their tests.
692
+
693
+ `softure-evidence` (`scripts/evidence.py`) does the naming, the conversion, the store and the page:
694
+ `save`, `list`, `render`, `check`, `prune`. Without a configured store it keeps a local copy, reports it
695
+ as not durable, and the setup gap goes to the owner once.
696
+
697
+ ## 12. Project state (`context/state.json`) and the doctor
698
+
699
+ An owner who runs several projects reads one file per repository instead of parsing the roadmap, the queued
700
+ roadmaps, the change folders and the owner sections by hand. The same file and one check keep `context/`
701
+ from drifting out of the contract unnoticed.
702
+
703
+ ### 12.1 `context/state.json`
704
+
705
+ Written **only by scripts**, never by hand, always in the same commit as the markdown it reflects:
706
+
707
+ | Writer | When |
708
+ | --- | --- |
709
+ | `wt-roadmap.py` | every mode (`open`, `stage`, `ready`, `done`, `done_code`), together with `roadmap.md` |
710
+ | `softure-archive` | on the main branch, before its commit (with `--handoff` the branch leaves it alone; `wt-roadmap.py done` writes it after the merge) |
711
+ | `softure-roadmap` | record, `--revise`, `--queue`, `--promote`, `--close`, before its commit |
712
+
713
+ The skills run `python3 .claude/skills/softure-doctor/scripts/context_state.py write --staged`: it reads what is
714
+ staged (so nobody's uncommitted edits leak in) and stages the result. By hand: `npx softure-skills state`.
715
+ A project without the file gets it from the first of these runs; nothing has to be migrated.
716
+
717
+ ```jsonc
718
+ {
719
+ "schema_version": 1,
720
+ "project": "Example clinic", // workflow.json `project`, else the roadmap's `project`
721
+ "mode": "autonomous", "main_branch": "main",
722
+ "updated_at": "2026-11-20T09:00:00Z", // changes only when the content does
723
+ "active_roadmap": { // null when there is no roadmap.md
724
+ "slug": "search", "title": "…", "status": "ready", "version": "2", "path": "context/foundation/roadmap.md",
725
+ "done": 2, "total": 5, // done = rows done or done_code (the report's X of N)
726
+ "items": [ // rows not done yet
727
+ { "id": "SR-2", "change_id": "search-titles", "outcome": "…", "status": "in_progress",
728
+ "stage": "implement 2/3", "since": "2026-11-08", "detail": "…", "prerequisites": ["SR-1"], "mode": "autonomous" }
729
+ ]
730
+ },
731
+ "queued": [ { "slug": "payments", "path": "…", "status": "waiting", "start_condition": "<trigger>",
732
+ "done": 0, "total": 1, "items": [ { "id": "PY-1", "change_id": "…", "outcome": "…", "status": "blocked" } ] } ],
733
+ "open_changes": [ { "change_id": "search-titles", "title": "…", "status": "implementing", "roadmap_item": "SR-2",
734
+ "updated": "2026-11-10", "stage": "implement 2/3" } ],
735
+ "owner_queue": [ // everything that waits for the owner, oldest first
736
+ { "kind": "decision", "source": "context/foundation/roadmap.md#Owner decisions and checks", "item": "SR-5",
737
+ "since": "2026-11-10", "text": "**SR-5**: choose the ranking provider …" }
738
+ ],
739
+ "last_release": { "version": "v1.4.0", "date": "2026-10-02", "source": "context/foundation/archive/2026-09-30-roadmap.md" }
740
+ }
741
+ ```
742
+
743
+ The schema ships with the package: `skills/softure-doctor/references/state.schema.json`.
744
+
745
+ **`owner_queue`** is the one list of what waits for the owner, from the main roadmap, the queued roadmaps and the
746
+ archived roadmaps:
747
+
748
+ | `kind` | Comes from |
749
+ | --- | --- |
750
+ | `word` | rows `done_code (…; waiting: release)` of the main roadmap (one entry: the release word); every queued roadmap (the word to start it, with its `trigger`) |
751
+ | `decision` | open `- [ ]` entries under `## Owner decisions and checks` that are not owner steps |
752
+ | `step` | `owner step:` entries and manual-mode owner checks `(Manual N.M)`; open `## Before the next release` entries; `done_code` rows waiting for an owner step that has no entry |
753
+ | `secret` | a `step` whose text names a secret, key, token, credential or password |
754
+
755
+ An archived roadmap contributes only its open checkboxes (its `## Before the next release` only until its
756
+ `## Summary` records a release). `source` is the file, `#`, and the heading; `item` the roadmap ID the entry names;
757
+ `since` the date in the entry, else the file's `updated`, and once written it is kept for that entry on every
758
+ rewrite. Owner-word issues (§8.6) live on the forge, not here.
759
+
760
+ `open_changes` and `updated_at` are refreshed on every write but never make the file stale: a change branch edits
761
+ its own `change.md` without touching `state.json`, and stays green.
762
+
763
+ ### 12.2 `softure-doctor`
764
+
765
+ `npx softure-skills doctor` (or `python3 .claude/skills/softure-doctor/scripts/doctor.py`) exits non-zero on:
766
+
767
+ | Code | Drift |
768
+ | --- | --- |
769
+ | `roadmap-archived-not-removed` | `roadmap.md` is still there although the same roadmap (slug and version) is in `foundation/archive/` |
770
+ | `roadmap-status-mismatch` | `roadmap.md` says `done` while rows are open, or `waiting` (a queued roadmap's status) |
771
+ | `archived-change-status` | an archived `change.md` whose status is not `archived` |
772
+ | `archived-change-progress` | an archived `plan.md` with unticked Automated items (open Manual items are legitimate) |
773
+ | `archived-roadmap-open-items` | an archived roadmap with rows that are not `done`, `done_code`, dropped or carried |
774
+ | `archived-roadmap-summary` | an archived roadmap whose `## Summary` merge column holds placeholders instead of SHAs |
775
+ | `queued-roadmap-done` | a queued roadmap whose rows are all done, never archived |
776
+ | `backlog-without-roadmap` | `backlog/roadmap-<slug>/` without `roadmaps/roadmap-<slug>.md` (or the promoted main roadmap) |
777
+ | `index-missing-file` | a table row of a `README.md` or `INDEX.md` under `context/` that links or names a missing file |
778
+ | `state-missing` | `context/state.json` is gone although git history holds it |
779
+ | `state-stale` | `context/state.json` does not match the markdown |
780
+
781
+ A project that has never written `state.json` gets a note, not a failure. **Adopting projects run the doctor in their
782
+ CI check**, documentation-only changes included; the installer prints the line (`npx softure-skills doctor`) until a
783
+ workflow under `.github/workflows/` runs it. `softure-archive` and `softure-roadmap --close` run it before their commit
784
+ and fix what they own.
785
+
786
+ ### 12.3 Portfolio: many projects at once
787
+
788
+ `npx softure-skills portfolio` reads the state of several projects and writes nothing anywhere (a remote is read
789
+ through a shallow, sparse clone into a temporary folder; a local checkout at `origin/<mainBranch>` without a fetch).
790
+
791
+ ```bash
792
+ npx softure-skills portfolio acme/shop ~/code/api # or list them in ~/.config/softure/portfolio.json
793
+ npx softure-skills portfolio --owner # only the owner queue, oldest first
794
+ npx softure-skills portfolio --json # the same data for another tool
795
+ ```
796
+
797
+ The config file lives outside every project (`--config <file>`, `$SOFTURE_PORTFOLIO`, default
798
+ `~/.config/softure/portfolio.json`): `{ "projects": [ { "name": "shop", "repo": "acme/shop", "branch": "main" } ] }`,
799
+ where `repo` is `owner/name`, a git URL or a local path. One row per project:
800
+ `project | active roadmap X/N | queued | open changes | owner queue | last release | doctor`. The doctor runs on the
801
+ same tree; a project without `state.json` yet gets one built in memory (marked `*`). `--source api` reads only
802
+ `state.json` through `gh api` (no doctor). Last release: `state.json` → `last_release`, else the highest `v*` tag
803
+ (the latest GitHub release with `--source api`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softure-ai/skills",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "SOFTURE agent skills: a spec-driven delivery workflow (shape → prd → roadmap → plan → implement → review) plus parallel worktree orchestration",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,6 +15,7 @@
15
15
  "ONBOARD.md",
16
16
  "scripts/install.mjs",
17
17
  "scripts/uninstall.mjs",
18
+ "scripts/portfolio.py",
18
19
  "README.md"
19
20
  ],
20
21
  "bin": {
package/rules/AGENTS.md CHANGED
@@ -33,7 +33,12 @@ The full contract is in `node_modules/@softure-ai/skills/WORKFLOW.md`.
33
33
  `softure-implement` → `softure-impl-review` → `softure-archive`.
34
34
  - **In parallel:** `softure-worktree` runs one change end to end in its own worktree.
35
35
  `softure-worktree-manager` runs several at once and merges them.
36
- - **Any time:** `softure-code-review`, `softure-rule-review`, `softure-lesson`.
36
+ - **Any time:** `softure-code-review`, `softure-rule-review`, `softure-lesson`, `softure-doctor`.
37
+
38
+ `context/state.json` is the machine-readable state of the project (WORKFLOW §12). Only scripts write
39
+ it (`wt-roadmap.py`, and `context_state.py write --staged` in `softure-archive` and `softure-roadmap`),
40
+ in the same commit as the markdown; never edit it by hand. CI runs `npx softure-skills doctor`, which
41
+ fails on drift in `context/`: fix the file it names, never the check.
37
42
 
38
43
  **Every change goes through the chain, however small.** A one-line fix reported in chat is a change
39
44
  too (`roadmap_item: null`). `new`, `plan`, `plan-review`, `implement`, `impl-review` and `archive` are
@@ -46,6 +51,13 @@ missing) or `autonomous`. Its rules are the `## Operating mode` section below; i
46
51
  section in this block. Switch modes only on the owner's explicit word: set `mode`, re-run the installer
47
52
  (`npx softure-skills`) so this block follows, commit both as `docs(rules): switch to <mode> mode`.
48
53
 
54
+ **Project files and evidence (WORKFLOW §11).** No screenshot, frame grab or recording enters git
55
+ (visual-regression baselines next to their tests excepted). Save each with `softure-evidence` to the
56
+ store in `workflow.json` → `evidence`, named `<change-id>/<NN>-<what>-<before|after>-<width>-<theme>.webp`,
57
+ and link the stored files from the Progress item they prove. Owner material (briefs, real data, designs)
58
+ stays in the project files (`<project-slug>/briefs|data|design/`, listed in `INDEX.md`) and is referenced
59
+ by path, never copied into the repository.
60
+
49
61
  Execution state lives only in the `## Progress` section of `plan.md`. Commands, the main branch
50
62
  and the artifact language come from `context/workflow.json`. Before building anything generic
51
63
  (auth, mail, feature switches, billing, GDPR, analytics, UI primitives), check the
@@ -72,6 +84,9 @@ step the owner has to undo.
72
84
  batch before launching and asks before every merge.
73
85
  - **Questions are welcome.** When a decision is the owner's (scope, product behaviour, naming, a
74
86
  trade-off), ask with a recommendation instead of deciding silently.
87
+ - **Owner-word issues** (label `owner-word`, WORKFLOW §8.6): at the start of a session, list the open
88
+ ones in this project's repository and show them to the owner first, with what each would start. Act
89
+ on one only after the owner's word in this conversation; then comment what was done and close it.
75
90
  - Rules of autonomous projects (standing merge consent, coordinators, report cadences) do not apply
76
91
  here, even when a memory or another session suggests them.
77
92
 
@@ -126,6 +141,9 @@ the owner's to-do.
126
141
  **Start of a run.** A coordinator that wakes with no run in flight (a fresh or cleared session, or a
127
142
  hosted project's main-chat session on its first message) starts the run itself, without waiting for
128
143
  the owner's "go":
144
+ 0. **owner-word issues first:** list the open issues labelled `owner-word` in this project's repository
145
+ (through a thread when the coordinator has no forge access) and act on each before starting any other
146
+ thread (Owner-word issues, below);
129
147
  1. read `context/workflow.json` and the roadmap (or the issue queue) on the main branch; outside a
130
148
  checkout, read them, and this block, from the repository first. Then read the project's memory and
131
149
  its own coordinator conventions (the project's `AGENTS.md` outside this block). When memory lacks
@@ -182,6 +200,8 @@ Only a "stop" or "pause" from the owner, recorded in memory, holds it back.
182
200
  - **Stale go:** a thread that got its go and has sent no merge SHA within 30 minutes is nudged at once
183
201
  (what is it waiting for, CI or a conflict?), not at the next report.
184
202
  - Posts every thread's result in the main chat as it arrives (condensed, decision first).
203
+ - **Checks open `owner-word` issues on every report and every wake-up**, before the startable set, and
204
+ acts on new ones (Owner-word issues, below).
185
205
  - **Makes sure finished threads are closed.** On every merge result, and whenever a thread with a
186
206
  one-off job hands its result over (a planning thread, the report routine setup thread once it sends
187
207
  the routine id back, a report thread), check that the thread is resolved and resolve it yourself
@@ -320,6 +340,18 @@ the owning repository first (read and issues) and only then decide you cannot fi
320
340
  of reach, put the issue text in the main chat for the owner. The work goes on around it; the item that
321
341
  needs the fix is `blocked (<repo>#<N>)`.
322
342
 
343
+ **Owner-word issues.** An open issue labelled `owner-word` in this project's repository is the owner's
344
+ word in writing, equal to the same sentence in the main chat: one decision, its scope and any limit
345
+ ("start the queued roadmap payments", "release after the last item", "drop SA-12"). The coordinator acts
346
+ on it like an order in the chat: a roadmap to start goes to a roadmap thread (`--promote`), a release
347
+ word is recorded where the release rules look for it (the roadmap header's `Release:` order, quoted with
348
+ the issue link), a "no" or "later" is recorded in the roadmap (`## Owner decisions and checks` or the
349
+ item's status). Then it comments what it did (thread, PR, merge SHA, roadmap line), closes the issue as
350
+ completed, and names it in the next report. An issue it cannot act on (unclear, contradicts `change.md`
351
+ or a standing order) gets one comment with the question and stays open; the question also goes to the
352
+ owner in the main chat. Owner-word issues are not work items: they never get a thread of their own
353
+ unless the decision itself needs one, and they are not in `context/state.json`.
354
+
323
355
  **Issues as the work source** (`autonomy.source: "issues"`, no roadmap):
324
356
  - The coordinator lists open issues (through a thread when it has no forge access). Not well-founded:
325
357
  comment why, label `invalid`, close. Well-founded: one change, one thread.
@@ -7,6 +7,11 @@
7
7
  //
8
8
  // Flags: --postinstall (never fails the host install), --dry-run, --target <dir>, --no-gitignore
9
9
  //
10
+ // Subcommands (run from the project root; Python 3, like the other scripts):
11
+ // softure-skills doctor [--json] check the context/ contract (WORKFLOW.md §12); exit 1 on drift
12
+ // softure-skills state [write|print|check] regenerate context/state.json (default: write)
13
+ // softure-skills portfolio [<repo> ...] [--owner] [--json] read-only table across many repositories
14
+ //
10
15
  // Per-project choices live in context/workflow.json -> "install" (all optional):
11
16
  // "gitignore": false commit the installed skills instead of ignoring them
12
17
  // "rules": ["workflow", ...] rule sections to inject; default: every section in RULE_SECTIONS
@@ -14,6 +19,7 @@
14
19
  // section that is always injected, whatever "rules" says. The "language" section is mandatory too:
15
20
  // only "allowNonEnglishCode": true (an owner's explicit exception) leaves it out.
16
21
 
22
+ import { spawnSync } from "node:child_process";
17
23
  import fs from "node:fs";
18
24
  import path from "node:path";
19
25
  import { fileURLToPath } from "node:url";
@@ -32,6 +38,54 @@ const RULE_SECTIONS = { language: "## Language", workflow: "## How work flows",
32
38
  const MODE_HEADING = "## Operating mode: ";
33
39
  const MODES = ["manual", "autonomous"];
34
40
  const DEFAULT_MODE = "manual";
41
+ const DOCTOR_SCRIPTS = path.join(PACKAGE_ROOT, "skills", "softure-doctor", "scripts");
42
+ // Subcommand -> [script, default arguments]. Each runs with the caller's working directory.
43
+ const SUBCOMMANDS = {
44
+ doctor: [path.join(DOCTOR_SCRIPTS, "doctor.py"), []],
45
+ state: [path.join(DOCTOR_SCRIPTS, "context_state.py"), ["write"]],
46
+ portfolio: [path.join(PACKAGE_ROOT, "scripts", "portfolio.py"), []],
47
+ };
48
+ const CI_LINE = "npx softure-skills doctor";
49
+ // Issues with this label carry an owner decision the coordinator acts on (WORKFLOW.md §8.6).
50
+ const OWNER_WORD_LABEL = {
51
+ name: "owner-word",
52
+ color: "5319e7",
53
+ description: "An owner decision the coordinator acts on (SOFTURE workflow)",
54
+ };
55
+ const LABEL_COMMAND = `gh label create ${OWNER_WORD_LABEL.name} --color ${OWNER_WORD_LABEL.color} --description "${OWNER_WORD_LABEL.description}"`;
56
+
57
+ // Creates the owner-word label on the project's forge when it can (GitHub through an authenticated gh,
58
+ // outside CI, once per checkout). Returns [action line, whether the label is known to exist].
59
+ function ensureOwnerWordLabel(projectRoot, previous, options) {
60
+ if ((previous.labels ?? []).includes(OWNER_WORD_LABEL.name)) return [null, true];
61
+ if (options.isDryRun) return [`label ${OWNER_WORD_LABEL.name} (created on the forge when gh can)`, false];
62
+ if (process.env.CI) return [null, false];
63
+ const result = spawnSync("gh", ["label", "create", OWNER_WORD_LABEL.name, "--color", OWNER_WORD_LABEL.color,
64
+ "--description", OWNER_WORD_LABEL.description], { cwd: projectRoot, encoding: "utf8", timeout: 15000 });
65
+ if (result.status === 0) return [`label ${OWNER_WORD_LABEL.name} created on the forge`, true];
66
+ if (/already exists/i.test(result.stderr ?? "")) return [null, true];
67
+ return [`label ${OWNER_WORD_LABEL.name}: not created here; run once in the repository: ${LABEL_COMMAND}`, false];
68
+ }
69
+
70
+ function runSubcommand(name, args) {
71
+ const [script, defaults] = SUBCOMMANDS[name];
72
+ const result = spawnSync("python3", [script, ...(args.length > 0 ? args : defaults)], { stdio: "inherit" });
73
+ if (result.error) {
74
+ console.error(`[softure-skills] ${name} needs python3 on PATH: ${result.error.message}`);
75
+ return 1;
76
+ }
77
+ return result.status ?? 1;
78
+ }
79
+
80
+ // True when one of the project's GitHub workflows already runs the doctor.
81
+ function hasDoctorInCi(projectRoot) {
82
+ const dir = path.join(projectRoot, ".github", "workflows");
83
+ if (!fs.existsSync(dir)) return false;
84
+ return fs
85
+ .readdirSync(dir)
86
+ .filter((name) => /\.ya?ml$/.test(name))
87
+ .some((name) => fs.readFileSync(path.join(dir, name), "utf8").includes("softure-skills doctor"));
88
+ }
35
89
 
36
90
  function parseArgs(argv) {
37
91
  const options = { isPostinstall: false, isDryRun: false, target: null, shouldIgnore: true };
@@ -199,6 +253,9 @@ function install(options) {
199
253
  }
200
254
  }
201
255
 
256
+ const [labelAction, hasLabel] = ensureOwnerWordLabel(projectRoot, previous, options);
257
+ if (labelAction) actions.push(labelAction);
258
+
202
259
  if (!options.isDryRun) {
203
260
  fs.mkdirSync(path.join(projectRoot, ".claude"), { recursive: true });
204
261
  const manifest = {
@@ -210,6 +267,7 @@ function install(options) {
210
267
  rules: ruleSections,
211
268
  mode,
212
269
  gitignore: shouldIgnore,
270
+ labels: hasLabel ? [OWNER_WORD_LABEL.name] : [],
213
271
  };
214
272
  // A re-install that changes nothing keeps the old timestamp, so a committed manifest
215
273
  // does not dirty every fresh clone or worktree after `npm ci`.
@@ -222,6 +280,14 @@ function install(options) {
222
280
  const prefix = options.isDryRun ? "[softure-skills] (dry run)" : "[softure-skills]";
223
281
  for (const action of actions) console.log(`${prefix} ${action}`);
224
282
  console.log(`${prefix} ${PACKAGE.name}@${PACKAGE.version} -> ${projectRoot}`);
283
+ if (!hasDoctorInCi(projectRoot)) {
284
+ console.log(`${prefix} CI: add \`${CI_LINE}\` to the project's CI check, documentation-only changes included (WORKFLOW.md §12)`);
285
+ }
286
+ }
287
+
288
+ const [subcommand, ...subcommandArgs] = process.argv.slice(2);
289
+ if (subcommand in SUBCOMMANDS) {
290
+ process.exit(runSubcommand(subcommand, subcommandArgs));
225
291
  }
226
292
 
227
293
  try {
@@ -233,4 +299,4 @@ try {
233
299
  process.exit(isPostinstall ? 0 : 1);
234
300
  }
235
301
 
236
- export { replaceManagedBlock, selectRuleSections };
302
+ export { CI_LINE, OWNER_WORD_LABEL, replaceManagedBlock, selectRuleSections };