/octo:skill-design-lineagefrom octo
Persists design documents with branch tracking, revision chains, and cross-session discovery. Stores immutable design docs under ~/.claude-octopus/designs/ and supports migration of existing designs.
Ships in octo. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
When a design introduces or changes domain terms, load
skills/blocks/domain-modeling.md. Record each definition in the existing design
lineage artifact with its evidence source, checked time, and scope. A changed
definition invalidates dependent decisions. Link and reopen them instead of
leaving stale implementation guidance marked current.
Persist design documents from brainstorming and planning sessions with branch tracking, revision chains, and cross-session discoverability. Design docs are immutable after creation -- new revisions supersede prior versions rather than editing in place.
Designs are stored under ~/.claude-octopus/designs/by-project/<project-key>/.
The key comes from the physical Git checkout root, or the current directory
outside Git. Two checkouts with the same directory name have separate stores.
Run the path helper from the checkout to find its store.
OCTO_ROOT="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${HOME}/.claude-octopus/plugin}}"
DESIGNS_DIR=$(bash "$OCTO_ROOT/scripts/helpers/design-storage-path.sh") || exit 1
printf '%s\n' "$DESIGNS_DIR"
Older designs remain in ~/.claude-octopus/designs/<checkout-basename>/.
That directory may contain files from several projects. To bring existing
designs into a new or empty store, pause design workflows for this checkout and
have the user identify the complete revision chains that belong to it. Create a
private temporary MIGRATION_DIR next to DESIGNS_DIR, outside the live store.
Copy each selected file with cp -p to keep modification times and filenames.
Verify that every selected file is present and trace each predecessor in staging
before publishing. Keep the original files.
Publish the validated directory in one rename. If either staging or publication fails, keep staging outside the live store. A store with existing files, including hidden lock or draft files, requires manual reconciliation. Report the existing store and staging paths so the user can inspect them.
python3 -I - "${MIGRATION_DIR:?}" "${DESIGNS_DIR:?}" <<'PY_PUBLISH' || exit 1
import os
from pathlib import Path
import stat
import sys
staged, store = map(Path, sys.argv[1:])
if staged == store or staged.parent != store.parent:
sys.exit("Design migration requires a separate staging directory next to the store.")
try:
if not stat.S_ISDIR(staged.lstat().st_mode):
sys.exit("Design migration staging must be a directory.")
# POSIX rename can replace an empty directory, but refuses a populated one.
os.rename(staged, store)
except OSError as error:
sys.exit(f"Could not publish staged designs at {store}: {error}. Staging remains at {staged}.")
PY_PUBLISH
Design documents follow a strict naming convention:
{user}-{branch}-design-{datetime}.md
Where:
{user} -- the current OS username ($USER or whoami){branch} -- the current git branch with slashes replaced with dashes,
or no-branch if Git cannot resolve HEAD{datetime} -- ISO 8601 compact timestamp (YYYYMMDD-HHmmss)If that filename already exists, the new design adds a unique suffix before
.md. Both documents remain available in the revision history.
Example:
chris-feature-auth-refactor-design-20260321-143022.md
Resolution:
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) || BRANCH=no-branch
BRANCH_SLUG=${BRANCH//\//-}
DATETIME=$(date -u +"%Y%m%d-%H%M%S") || exit 1
FILENAME="${USER}-${BRANCH_SLUG}-design-${DATETIME}.md"
Each design document contains YAML frontmatter followed by structured sections.
---
branch: feature/auth-refactor
user: chris
created: 2026-03-21T14:30:22Z
supersedes: chris-feature-auth-refactor-design-20260320-091500.md
---
Fields:
branch -- the git branch at time of creationuser -- the OS username who created the documentcreated -- ISO 8601 timestamp of creationsupersedes -- filename of the prior design document this revision replaces (omitted if this is the first design for the branch)# Design: [Title]
## Problem Statement
[What problem does this design solve? Why does it matter?]
## Constraints
[Technical, timeline, resource, or organizational constraints that bound the solution space.]
## Approaches Considered
[List each approach evaluated, with brief pros/cons for each.]
### Approach A: [Name]
- **Pros:** ...
- **Cons:** ...
### Approach B: [Name]
- **Pros:** ...
- **Cons:** ...
## Recommendation
[Which approach is recommended and why. Include the key trade-off that drove the decision.]
## Open Questions
[Unresolved questions that may affect implementation or require follow-up.]
After a brainstorm, planning, or define workflow produces design output, save it to the standard location with metadata.
OCTO_ROOT="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${HOME}/.claude-octopus/plugin}}"
DESIGNS_DIR=$(bash "$OCTO_ROOT/scripts/helpers/design-storage-path.sh") || exit 1
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) || BRANCH=no-branch
BRANCH_SLUG=${BRANCH//\//-}
timestamps=$(date -u "+%Y%m%d-%H%M%S %Y-%m-%dT%H:%M:%SZ") || exit 1
IFS=' ' read -r DATETIME CREATED <<< "$timestamps"
mkdir -p "$DESIGNS_DIR" || exit 1
FILENAME="${USER}-${BRANCH_SLUG}-design-${DATETIME}.md"
FRONTMATTER_DELIMITER=---
FILEPATH=$(python3 -I -c '
import os
from pathlib import Path
import shutil
import sys
import tempfile
destination = Path(sys.argv[1])
with tempfile.NamedTemporaryFile(dir=destination.parent, prefix=".design-") as draft:
shutil.copyfileobj(sys.stdin.buffer, draft)
draft.flush()
# Publish the complete document without replacing an existing revision.
try:
os.link(draft.name, destination)
except FileExistsError:
suffix = Path(draft.name).name[len(".design-"):]
destination = destination.with_name(f"{destination.stem}-{suffix}.md")
os.link(draft.name, destination)
print(destination)
' "$DESIGNS_DIR/$FILENAME" <<EOF
${FRONTMATTER_DELIMITER}
branch: ${BRANCH}
user: ${USER}
created: ${CREATED}
${SUPERSEDES:+supersedes: ${SUPERSEDES}}
${FRONTMATTER_DELIMITER}
# Design: [Title]
## Problem Statement
[Content from brainstorm/planning session]
## Constraints
[Identified constraints]
## Approaches Considered
[Evaluated approaches]
## Recommendation
[Selected approach and rationale]
## Open Questions
[Unresolved items]
EOF
) || exit 1
FILENAME="${FILEPATH##*/}"
printf 'Design saved to %s\n' "$FILEPATH"
Design docs are read-only after creation. To revise a design, create a new document with a supersedes reference to the prior version.
Before writing a new design, search for related prior designs using keyword matching.
OCTO_ROOT="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${HOME}/.claude-octopus/plugin}}"
DESIGNS_DIR=$(bash "$OCTO_ROOT/scripts/helpers/design-storage-path.sh") || exit 1
# Search for designs matching keywords (case-insensitive)
KEYWORDS="auth refactor"
grep -li "$KEYWORDS" "${DESIGNS_DIR}"/*.md 2>/dev/null | head -10
Constraints:
grep -liWhen prior designs are found, present them to the user:
Found 2 prior designs related to "auth refactor":
1. chris-feature-auth-refactor-design-20260320-091500.md (2026-03-20)
2. chris-main-design-20260315-140000.md (2026-03-15)
Would you like to review any of these before creating a new design?
If a prior design exists for the same branch, use the newest matching document
as SUPERSEDES before saving the next revision. Compare the original branch in
the frontmatter because different branch names can share a filename slug.
Existing designs keep their original filenames.
OCTO_ROOT="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${HOME}/.claude-octopus/plugin}}"
DESIGNS_DIR=$(bash "$OCTO_ROOT/scripts/helpers/design-storage-path.sh") || exit 1
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) || BRANCH=no-branch
BRANCH_DESIGNS=$(python3 -I - "$DESIGNS_DIR" "$BRANCH" <<'PY_DESIGNS'
from pathlib import Path
import sys
root = Path(sys.argv[1])
branch_field = f"branch: {sys.argv[2]}"
matches = []
for design in root.glob("*-design-*.md"):
try:
if not design.is_file() or "\n" in design.name:
continue
with design.open(encoding="utf-8") as document:
if document.readline().rstrip("\n") != "---":
continue
branches = []
for line in document:
line = line.rstrip("\n")
if line == "---":
if branches == [branch_field]:
matches.append((design.stat().st_mtime_ns, design.name))
break
if line.startswith("branch:"):
branches.append(line)
except (OSError, UnicodeError):
continue
for _, name in sorted(matches, reverse=True)[:3]:
print(name)
PY_DESIGNS
) || exit 1
SUPERSEDES=${BRANCH_DESIGNS%%$'\n'*}
This creates a linked chain of revisions:
v3 (supersedes: v2) -> v2 (supersedes: v1) -> v1 (no supersedes)
To walk the full revision history, start with the design just saved. In a fresh
shell, set FILENAME to the basename of the printed path and DESIGNS_DIR to
the design directory from Step 1. Follow supersedes only in the frontmatter.
If a revision is missing, unreadable, or part of a cycle, report the history as
incomplete.
python3 -I - "${DESIGNS_DIR:?}" "${FILENAME:?}" <<'PY_HISTORY'
from pathlib import Path
import stat
import sys
root, current = Path(sys.argv[1]), sys.argv[2]
history = []
while current:
if current in history:
sys.exit(f"Revision history incomplete: cycle at {current!r}")
name = Path(current)
if name.name != current or not name.match("*-design-*.md") or "\n" in current:
sys.exit(f"Revision history incomplete: invalid filename {current!r}")
design = root / name
try:
if not stat.S_ISREG(design.lstat().st_mode):
raise ValueError("expected a regular design file")
with design.open("rb") as document:
if document.readline().rstrip(b"\r\n") != b"---":
raise ValueError("missing frontmatter")
predecessors = []
for raw_line in document:
line = raw_line.decode("utf-8").rstrip("\r\n")
if line == "---":
break
if line.startswith("supersedes:"):
predecessors.append(line.split(":", 1)[1].strip())
else:
raise ValueError("unclosed frontmatter")
if len(predecessors) > 1:
raise ValueError("multiple supersedes fields")
except (OSError, ValueError) as error:
sys.exit(f"Revision history incomplete: {current!r}: {error}")
history.append(current)
current = predecessors[0] if predecessors else ""
print("\n".join(history))
PY_HISTORY
Downstream commands (deliver, review, develop) can auto-discover design context. Run the lookup block from Step 3 in the same shell before running this block. It returns up to three filenames for the current branch, newest first.
if [[ -n "$BRANCH_DESIGNS" ]]; then
echo "Design context found for branch ${BRANCH}:"
while IFS= read -r design; do
printf ' - %s\n' "$design"
done <<< "$BRANCH_DESIGNS"
DESIGN_CONTEXT=$(<"${DESIGNS_DIR}/${SUPERSEDES}")
fi
Downstream skills should check for designs before starting work:
Use when the user asks whether the code still matches the saved designs. The check is read-only: never edit code or designs while running it.
List the current design of each revision chain, newest first. A design named
in another design's supersedes field is history and is skipped. At most ten
designs are checked per run. Incomplete revision chains stop selection before
any designs are compared.
If the requested designs are still in the legacy store, report the comparison as incomplete. Use the Storage Location migration procedure as a separate step before rerunning the read-only comparison.
OCTO_ROOT="${CLAUDE_PLUGIN_ROOT:-${CODEX_PLUGIN_ROOT:-${HOME}/.claude-octopus/plugin}}"
DESIGNS_DIR=$(bash "$OCTO_ROOT/scripts/helpers/design-storage-path.sh") || exit 1
DRIFT_DESIGNS=$(python3 -I - "$DESIGNS_DIR" <<'PY_DRIFT'
from pathlib import Path
import stat
import sys
root = Path(sys.argv[1])
designs, predecessors, incomplete = [], {}, []
try:
candidates = sorted(path for path in root.iterdir() if path.match("*-design-*.md"))
except FileNotFoundError:
candidates = []
except OSError:
sys.exit(f"Revision chain selection incomplete: cannot list {str(root)!r}")
for design in candidates:
try:
metadata = design.lstat()
if not stat.S_ISREG(metadata.st_mode) or "\n" in design.name:
raise ValueError("invalid design file")
# Decode one line at a time so unreadable body text does not hide
# otherwise readable revision links.
with design.open("rb") as document:
if document.readline().rstrip(b"\r\n") != b"---":
raise ValueError("missing frontmatter")
previous = []
for raw_line in document:
line = raw_line.decode("utf-8").rstrip("\r\n")
if line == "---":
break
if line.startswith("supersedes:"):
previous.append(line.split(":", 1)[1].strip())
else:
raise ValueError("unclosed frontmatter")
if len(previous) > 1:
sys.exit(f"Revision chain selection incomplete: {design.name!r} has multiple supersedes fields.")
predecessors[design.name] = previous[0] if previous else ""
designs.append((metadata.st_mtime_ns, design.name))
except (OSError, ValueError):
incomplete.append(design.name)
if incomplete:
for name in incomplete:
print(f"Incomplete: cannot read design metadata for {name!r}", file=sys.stderr)
sys.exit("Revision chain selection incomplete; no designs compared.")
checked = set()
for name in predecessors:
revision, chain = name, set()
while revision and revision not in checked:
if revision in chain:
sys.exit(f"Revision chain selection incomplete: cycle at {revision!r}.")
if revision not in predecessors:
sys.exit(f"Revision chain selection incomplete: missing predecessor {revision!r} in the chain for {name!r}.")
chain.add(revision)
revision = predecessors[revision]
checked.update(chain)
superseded = set(predecessors.values())
current = [name for _, name in sorted(designs, reverse=True) if name not in superseded]
for name in current[:10]:
print(name)
if len(current) > 10:
print(f"Drift check skipped {len(current) - 10} older designs", file=sys.stderr)
PY_DRIFT
) || exit 1
printf '%s\n' "$DRIFT_DESIGNS"
If selection fails, include its diagnostics in the report once checkout ownership is confirmed. Stop the check without comparing designs, since an unreadable revision could supersede a readable one. Otherwise, proceed one design at a time:
Incomplete,
never No drift found.After confirming checkout ownership, create a unique report file:
DRIFT_TIMESTAMP=$(date -u +%Y%m%dT%H%M%SZ) || exit 1
mkdir -p -- "${DESIGNS_DIR}/drift" || exit 1
DRIFT_REPORT=$(mktemp "${DESIGNS_DIR}/drift/drift-${DRIFT_TIMESTAMP}-XXXXXX") || exit 1
printf '%s\n' "$DRIFT_REPORT"
Include one section per design with its filename, then each difference with
file:line evidence, No drift found or Incomplete. Give the user the path.
The user decides whether the code or the design should change. Save design
changes as new revisions.
Cap enforcement:
DOC_COUNT=$(ls "${DESIGNS_DIR}"/*.md 2>/dev/null | wc -l | tr -d ' ')
if [[ "$DOC_COUNT" -ge 50 ]]; then
echo "Warning: ${DOC_COUNT} design docs in ${DESIGNS_DIR}. Consider archiving old designs."
fi
Design docs are read-only after creation. To update a design:
supersedes to the prior document's filenameThis ensures a complete history of design evolution is always available.
What SKILL.md sets; muted values are Claude Code's defaults
64 skills in this plugin
/council-verdictsStarter: interpret a council run's verdict artifacts — quorum, dissent, cross-lab validity, and what to do next/debate-kickoffStarter: frame a decision as a multi-model debate — picks sides, seats providers, and launches /octo:debate with a well-formed motion/flow-defineMulti-AI requirements scoping using available external providers (Double Diamond Define phase). Priority triggers: octo define, octo scope, co-define, co-scope. DO NOT use for implementation, research, review/validation, or built-in commands.npx claudepluginhub nyldn/claude-octopus --plugin octoOther plugins' skills for the same job