diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 73bc7d5..b5571a8 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "shiplog", "description": "Git-as-knowledge-graph workflow for traceability across issues, branches, commits, reviews, and PRs.", - "version": "0.5.1", + "version": "0.5.2", "author": { "name": "devallibus" }, diff --git a/.github/workflows/cross-ref-check.yml b/.github/workflows/cross-ref-check.yml new file mode 100644 index 0000000..363008e --- /dev/null +++ b/.github/workflows/cross-ref-check.yml @@ -0,0 +1,34 @@ +# Rejects legacy cross-reference forms that the audit found drifting: +# bare `shiplog:` references outside HTML envelopes. Shiplog's own +# units are referenced by file path; the `plugin:skill` syntax is reserved +# for external plugins (e.g. `ork:commit`, `superpowers:brainstorming`). +# +# Implementation: pure shell + grep, no third-party action. Runs on PRs only. + +name: Cross-reference check + +on: + pull_request: + # List both master and main so a future default-branch rename does + # not silently no-op the check. GitHub Actions does not template + # `branches:`, so a literal list is the simplest correct shape. + branches: [master, main] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout PR + uses: actions/checkout@v4 + + - name: Reject legacy shiplog:skill refs outside envelopes + shell: bash + run: | + set -euo pipefail + # ' - + 0. **Routing check.** Run the phase entry check from `references/model-routing.md`. On first activation, if `.shiplog/routing.md` is missing, run the setup prompt first. 1. **Run the brainstorm.** Follow `references/brainstorm-workflow.md` for the design exploration process. External skills (`superpowers:brainstorming`, `ork:brainstorming`) may be used for the exploration phase (steps 1-4) but output capture (steps 5-6) follows the internalized workflow. -2. **Capture as GitHub Issue (Full Mode).** Before the first labeled create in a repo, bootstrap the Shiplog labels per `references/labels.md`. Create the issue with `shiplog/plan` already applied using the template below. Sign the issue body per the signing spec — see SKILL.md §8 (Agent Identity Signing). +2. **Capture as GitHub Issue (Full Mode).** Before the first labeled create in a repo, bootstrap the Shiplog labels per `references/labels.md`. Create the issue with `shiplog/plan` already applied using the template below. Sign the issue body per the signing spec — see SKILL.md → "Agent Identity Signing". Before writing the final issue body, classify factual claims: - **Internal claims** about this repository's code, tests, configuration, or committed docs can be verified from the repo itself. @@ -21,7 +21,7 @@ description: "Phase 1: Capture brainstorming output as a GitHub issue with struc 3. **Store in knowledge graph.** If `ork:remember` is available, store the key decision. -4. **Transition.** Proceed to `shiplog:branch` if the user wants to start work. +4. **Transition.** Proceed to `skills/shiplog/branch.md` if the user wants to start work. --- diff --git a/skills/shiplog/branch.md b/skills/shiplog/branch.md index 8d36e5b..9f39004 100644 --- a/skills/shiplog/branch.md +++ b/skills/shiplog/branch.md @@ -6,7 +6,7 @@ description: "Phase 2: Create a branch from an issue, set up worktree, and post # Branch Setup (Phase 2) - + 0. **Routing check.** Run the phase entry check from `references/model-routing.md`. @@ -33,7 +33,7 @@ description: "Phase 2: Create a branch from an issue, set up worktree, and post If a delegated lane later uses a forked workspace, tmux session, or other runtime-specific isolation backend, keep this feature branch/worktree as the canonical shiplog record for the work. **Fallback (in-place checkout):** Only when the user explicitly requests no worktree. -3. **Post timeline entry.** Comment on the issue using the session-start template below. Record the workspace path when known. Sign per the signing spec — see SKILL.md §8 (Agent Identity Signing). +3. **Post timeline entry.** Comment on the issue using the session-start template below. Record the workspace path when known. Sign per the signing spec — see SKILL.md → "Agent Identity Signing". 4. **Load plan** if it exists. Delegate to `superpowers:executing-plans` or `ork:implement`. For delegated or tier-3 work, the plan should define a contract: allowed files, forbidden changes, stop conditions, verification, return artifact, and decision budget. @@ -159,6 +159,10 @@ Track the primary feature worktree from session start through cleanup. Portable cleanup sequence: +> **Canonical source:** this same cleanup sequence is maintained in `references/orchestrator-protocol.md` +> ("Cleanup commands"), which owns it. Keep both copies in sync when changing it, or replace this copy +> with a pointer to the canonical block. + ```bash git fetch origin git branch --merged origin/$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name') @@ -180,6 +184,6 @@ git branch -d ## Edge Cases -**Session resume:** Detect the issue from the current branch name or worktree. If the branch has an existing worktree, `cd` into it. Find linked PRs, read comments, add "Session resumed" timeline comment via `shiplog:timeline`. +**Session resume:** Detect the issue from the current branch name or worktree. If the branch has an existing worktree, `cd` into it. Find linked PRs, read comments, add "Session resumed" timeline comment via `skills/shiplog/timeline.md`. **Post-merge cleanup:** If the branch is merged and no open PR still depends on it, run the cleanup protocol above or dispatch a dedicated cleanup lane per `references/orchestrator-protocol.md`. diff --git a/skills/shiplog/commit.md b/skills/shiplog/commit.md index c4a951a..17526ca 100644 --- a/skills/shiplog/commit.md +++ b/skills/shiplog/commit.md @@ -6,13 +6,13 @@ description: "Phase 4: Commit with conventional format and post context comments # Commit Context (Phase 4) - + 0. **Routing check.** Run the phase entry check from `references/model-routing.md`. 1. **Create the commit.** Follow `references/commit-workflow.md`. External commit skills may still be used for convenience, but the conventions in the internal workflow take precedence. Format: `(#): `. When a commit addresses a specific task, include the task ID: `(#/): `. -2. **Add context comment** for significant commits. Document the reasoning and verification on the issue. Sign per the signing spec — see SKILL.md §8 (Agent Identity Signing). +2. **Add context comment** for significant commits. Document the reasoning and verification on the issue. Sign per the signing spec — see SKILL.md → "Agent Identity Signing". **When to add context comments:** After significant functionality, unexpected discoveries, approach changes, or tricky bug fixes. Not after trivial commits. diff --git a/skills/shiplog/discovery.md b/skills/shiplog/discovery.md index df89e91..a09082e 100644 --- a/skills/shiplog/discovery.md +++ b/skills/shiplog/discovery.md @@ -6,7 +6,7 @@ description: "Phase 3: Handle mid-work discoveries — fix inline, stack a prere # Discovery Handling (Phase 3) - + 0. **Routing check.** Run the phase entry check from `references/model-routing.md`. @@ -20,9 +20,9 @@ Discovery made during work +-- Refactoring opportunity? -> Create issue tagged "refactor" ``` -**3a (stack a prerequisite):** Commit current progress. Create a new issue first (so the ID exists), then create the stacked branch. Label the new issue `shiplog/discovery` and `shiplog/stacked`. Cross-reference on the parent issue and add `shiplog/blocker` to the parent while it is blocked. Sign both artifacts per the signing spec — see SKILL.md §8 (Agent Identity Signing). +**3a (stack a prerequisite):** Commit current progress. Create a new issue first (so the ID exists), then create the stacked branch. Label the new issue `shiplog/discovery` and `shiplog/stacked`. Cross-reference on the parent issue and add `shiplog/blocker` to the parent while it is blocked. Sign both artifacts per the signing spec — see SKILL.md → "Agent Identity Signing". -**3b (independent discovery):** Create new issue (same template without "blocks parent") and label it `shiplog/discovery`. Add timeline comment. Continue current work. Sign per the signing spec — see SKILL.md §8 (Agent Identity Signing). +**3b (independent discovery):** Create new issue (same template without "blocks parent") and label it `shiplog/discovery`. Add timeline comment. Continue current work. Sign per the signing spec — see SKILL.md → "Agent Identity Signing". --- diff --git a/skills/shiplog/pr.md b/skills/shiplog/pr.md index a7f39c4..dada6a3 100644 --- a/skills/shiplog/pr.md +++ b/skills/shiplog/pr.md @@ -6,19 +6,19 @@ description: "Phase 5: Create PR with timeline body, handle review gate, and lin # PR Timeline (Phase 5) - + 0. **Routing check.** Run the phase entry check from `references/model-routing.md`. 1. **Pre-PR checks.** Follow `references/pr-workflow.md`. External PR skills may still be used for validation help, but shiplog's internal PR workflow is authoritative for title, body, labels, and review gate behavior. -2. **Create PR (Full Mode).** Use the PR timeline template below. Create the PR with `shiplog/history` and `shiplog/issue-driven` already applied. Sign per the signing spec — see SKILL.md §8 (Agent Identity Signing). +2. **Create PR (Full Mode).** Use the PR timeline template below. Create the PR with `shiplog/history` and `shiplog/issue-driven` already applied. Sign per the signing spec — see SKILL.md → "Agent Identity Signing". 3. **Review gate.** Every PR requires cross-model review before merge. Use the execution ladder in `references/closure-and-review.md`: bounded reviewer lane if available, then external session delegation, then a contract-only review handoff. Local parallel tool fan-out does not count as an independent reviewer identity. -5. **Link and store.** PR body includes `Closes #` when the PR fully resolves the issue. For partial delivery, use `Addresses # (completes T1, T2, ...)` - see the partial-delivery template below and `references/closure-and-review.md` Section 1. Store key learning in knowledge graph. +4. **Link and store.** PR body includes `Closes #` when the PR fully resolves the issue. For partial delivery, use `Addresses # (completes T1, T2, ...)` - see the partial-delivery template below and `references/closure-and-review.md` Section 1. Store key learning in knowledge graph. -6. **Closure verification (optional).** When evidence-to-issue mapping is non-obvious, optionally dispatch a verifier lane using the same orchestration ladder described in `references/closure-and-review.md` and `references/orchestrator-protocol.md`. +5. **Closure verification (optional).** When evidence-to-issue mapping is non-obvious, optionally dispatch a verifier lane using the same orchestration ladder described in `references/closure-and-review.md` and `references/orchestrator-protocol.md`. --- @@ -111,7 +111,7 @@ Last-code-by: / () ``` The PR body is large enough that `--body-file` should be the preferred portable path. -After every signed review comment and every post-review code push, refresh this review snapshot in place per `references/closure-and-review.md` and the signing spec in SKILL.md §8 (Agent Identity Signing). +After every signed review comment and every post-review code push, refresh this review snapshot in place per `references/closure-and-review.md` and the signing spec in SKILL.md → "Agent Identity Signing". If review or cleanup work is dispatched in parallel, post the fan-out dispatch and collection artifacts from `references/orchestrator-protocol.md` instead of leaving that orchestration implicit in chat-only context. diff --git a/skills/shiplog/references/brainstorm-workflow.md b/skills/shiplog/references/brainstorm-workflow.md index 92d257e..a9afb34 100644 --- a/skills/shiplog/references/brainstorm-workflow.md +++ b/skills/shiplog/references/brainstorm-workflow.md @@ -68,7 +68,7 @@ Once the design is approved, create a **shiplog** issue using the template in `. 2. **Context, Design Summary, Approach, Alternatives** — from the brainstorm 3. **Sources and Verification Status** — for external claims 4. **Task contracts** — structured `T1`, `T2`, ... with tier annotations, file lists, acceptance criteria, and decision budgets per `../brainstorm.md` -5. **Provenance signature** — `Authored-by:` per the signing spec — see SKILL.md §8 (Agent Identity Signing) +5. **Provenance signature** — `Authored-by:` per the signing spec — see SKILL.md → "Agent Identity Signing" 6. **Label** — `shiplog/plan` applied at creation time Bootstrap **shiplog** labels first if this is the first labeled create in the repo (see `labels.md`). Use the portable `--body-file` pattern from `shell-portability.md` for the issue body. @@ -77,7 +77,7 @@ Bootstrap **shiplog** labels first if this is the first labeled create in the re After issue creation: - Store key decisions in the knowledge graph if `ork:remember` is available. -- Offer to proceed to Phase 2 (branch setup via `shiplog:branch`). +- Offer to proceed to Phase 2 (branch setup via `skills/shiplog/branch.md`). - Do NOT invoke `superpowers:writing-plans` or any implementation skill. ## Visual Companion diff --git a/skills/shiplog/references/closure-and-review.md b/skills/shiplog/references/closure-and-review.md index 3875af6..453e635 100644 --- a/skills/shiplog/references/closure-and-review.md +++ b/skills/shiplog/references/closure-and-review.md @@ -201,7 +201,7 @@ The PR body review snapshot is the latest-wins summary. Read it first for curren Use the first available signal - each level is less authoritative than the one above: -1. **`Last-code-by:`** in the PR body - authoritative. This field tracks who most recently pushed code to the branch. See SKILL.md §8 (Agent Identity Signing) for code provenance rules. +1. **`Last-code-by:`** in the PR body - authoritative. This field tracks who most recently pushed code to the branch. See SKILL.md → "Agent Identity Signing" for code provenance rules. 2. **`Updated-by:`** in the PR body - approximate. May reflect artifact text edits rather than code changes, but is the best proxy when `Last-code-by:` is absent. 3. **`Authored-by:`** in the PR body - original author. May be stale if another model pushed code later. 4. **Git commit author** on the PR branch - last resort. Requires an additional API call and uses git metadata rather than signed artifacts, but provides ground truth when no signed field exists. diff --git a/skills/shiplog/references/phase-templates.md b/skills/shiplog/references/phase-templates.md index 1f3b25b..c165008 100644 --- a/skills/shiplog/references/phase-templates.md +++ b/skills/shiplog/references/phase-templates.md @@ -30,14 +30,7 @@ Authored-by: / () Last-code-by: / () ``` -For review sign-off comments: - -``` -Reviewed-by: / () -Disposition: approve | approve-with-follow-ups | request-changes -Scope: -Follow-ups: # | none -``` +For review sign-off comments, use the four-field block defined in `closure-and-review.md` ("Sign-off format"), which owns it. This file intentionally does not duplicate it. For in-place edits to existing artifacts (append after the original `Authored-by:` line): @@ -47,4 +40,4 @@ Edit-kind: correction | amendment | rewrite Edit-note: [1 sentence describing what changed and why] ``` -The full signing rules and amendment artifact template live in `../SKILL.md` §8 (Agent Identity Signing). +The full signing rules and amendment artifact template live in `../SKILL.md` → "Agent Identity Signing". diff --git a/skills/shiplog/references/signing.md b/skills/shiplog/references/signing.md index 4199db7..000b94e 100644 --- a/skills/shiplog/references/signing.md +++ b/skills/shiplog/references/signing.md @@ -1,5 +1,5 @@ # Agent Identity Signing -> **Moved.** The full provenance signing spec — canonical grammar, role semantics, model detection, orchestration qualifiers, edit provenance rules, code provenance (`Last-code-by:`), edit-in-place vs amendment, and PR body review snapshot maintenance — now lives in **SKILL.md §8 (Agent Identity Signing)**. +> **Moved.** The full provenance signing spec — canonical grammar, role semantics, model detection, orchestration qualifiers, edit provenance rules, code provenance (`Last-code-by:`), edit-in-place vs amendment, and PR body review snapshot maintenance — now lives in **SKILL.md → "Agent Identity Signing"**. > > This file is kept as a redirect so that any external links to `references/signing.md` continue to resolve. diff --git a/skills/shiplog/timeline.md b/skills/shiplog/timeline.md index 216d53c..48d40d4 100644 --- a/skills/shiplog/timeline.md +++ b/skills/shiplog/timeline.md @@ -6,11 +6,11 @@ description: "Phase 7: Add timeline comments for session starts, milestones, dis # Timeline Updates (Phase 7) - + 0. **Routing check.** Run the phase entry check from `references/model-routing.md`. -1. **Add timeline comments** when: starting a new session, changing approach, finding something unexpected, completing a milestone, or getting blocked. Sign per the signing spec — see SKILL.md §8 (Agent Identity Signing). +1. **Add timeline comments** when: starting a new session, changing approach, finding something unexpected, completing a milestone, or getting blocked. Sign per the signing spec — see SKILL.md → "Agent Identity Signing". 2. **Use the standard format** below. Comment types: `session-start`, `session-resume`, `milestone`, `discovery`, `implementation-issue`, `blocker`.