syntaur 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/.agents/plugins/marketplace.json +20 -0
- package/bin/syntaur.js +2 -0
- package/dashboard/dist/assets/_basePickBy-C-VS6QEr.js +1 -0
- package/dashboard/dist/assets/_baseUniq-Dfp0h_kE.js +1 -0
- package/dashboard/dist/assets/arc-DMAuseMg.js +1 -0
- package/dashboard/dist/assets/architectureDiagram-2XIMDMQ5-DERw9YH7.js +36 -0
- package/dashboard/dist/assets/blockDiagram-WCTKOSBZ-CVhoUGyp.js +132 -0
- package/dashboard/dist/assets/c4Diagram-IC4MRINW-B97ce7q3.js +10 -0
- package/dashboard/dist/assets/channel-BFnz84Fk.js +1 -0
- package/dashboard/dist/assets/chunk-4BX2VUAB-C-Tm8s7l.js +1 -0
- package/dashboard/dist/assets/chunk-55IACEB6-DTLywdgN.js +1 -0
- package/dashboard/dist/assets/chunk-FMBD7UC4-CZe3jJBW.js +15 -0
- package/dashboard/dist/assets/chunk-JSJVCQXG-DCDIzNBU.js +1 -0
- package/dashboard/dist/assets/chunk-KX2RTZJC-Dny_iTMP.js +1 -0
- package/dashboard/dist/assets/chunk-NQ4KR5QH-BVkniaFi.js +220 -0
- package/dashboard/dist/assets/chunk-QZHKN3VN-Yiy-DBy_.js +1 -0
- package/dashboard/dist/assets/chunk-WL4C6EOR-BZ6Aii8B.js +189 -0
- package/dashboard/dist/assets/classDiagram-VBA2DB6C-9i4eMNgh.js +1 -0
- package/dashboard/dist/assets/classDiagram-v2-RAHNMMFH-9i4eMNgh.js +1 -0
- package/dashboard/dist/assets/clone-BQWw0UR0.js +1 -0
- package/dashboard/dist/assets/cose-bilkent-S5V4N54A-p-FSX7Hd.js +1 -0
- package/dashboard/dist/assets/cytoscape.esm-BQaXIfA_.js +331 -0
- package/dashboard/dist/assets/dagre-KLK3FWXG-JGHXC_Z-.js +4 -0
- package/dashboard/dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dashboard/dist/assets/diagram-E7M64L7V-BMj79nA2.js +24 -0
- package/dashboard/dist/assets/diagram-IFDJBPK2-DvE6Hc7-.js +43 -0
- package/dashboard/dist/assets/diagram-P4PSJMXO-xVL3uMJs.js +24 -0
- package/dashboard/dist/assets/erDiagram-INFDFZHY-HAM6d8j_.js +70 -0
- package/dashboard/dist/assets/flowDiagram-PKNHOUZH-DPorMsV0.js +162 -0
- package/dashboard/dist/assets/ganttDiagram-A5KZAMGK-BxesGLxK.js +292 -0
- package/dashboard/dist/assets/gitGraphDiagram-K3NZZRJ6-tjaHpiMU.js +65 -0
- package/dashboard/dist/assets/graph-DAyh4Dby.js +1 -0
- package/dashboard/dist/assets/index-BnqH-RIk.css +1 -0
- package/dashboard/dist/assets/index-C1augJ5N.js +440 -0
- package/dashboard/dist/assets/infoDiagram-LFFYTUFH-MekJE5ZF.js +2 -0
- package/dashboard/dist/assets/init-Gi6I4Gst.js +1 -0
- package/dashboard/dist/assets/ishikawaDiagram-PHBUUO56-DovIBmaF.js +70 -0
- package/dashboard/dist/assets/journeyDiagram-4ABVD52K-CZw0QfY4.js +139 -0
- package/dashboard/dist/assets/kanban-definition-K7BYSVSG-Bl-d4Lb6.js +89 -0
- package/dashboard/dist/assets/katex-B1X10hvy.js +261 -0
- package/dashboard/dist/assets/layout-Ds5A52wn.js +1 -0
- package/dashboard/dist/assets/linear-FqOeAEKI.js +1 -0
- package/dashboard/dist/assets/mermaid.core-C7JSt2gc.js +255 -0
- package/dashboard/dist/assets/mindmap-definition-YRQLILUH-D6x3mID9.js +68 -0
- package/dashboard/dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dashboard/dist/assets/pieDiagram-SKSYHLDU-CnElBd0K.js +30 -0
- package/dashboard/dist/assets/quadrantDiagram-337W2JSQ-Q08fuvGB.js +7 -0
- package/dashboard/dist/assets/requirementDiagram-Z7DCOOCP-BImzzV5r.js +73 -0
- package/dashboard/dist/assets/sankeyDiagram-WA2Y5GQK-BIfD481p.js +10 -0
- package/dashboard/dist/assets/sequenceDiagram-2WXFIKYE-BS_1aSDE.js +145 -0
- package/dashboard/dist/assets/stateDiagram-RAJIS63D-Br1E8nkw.js +1 -0
- package/dashboard/dist/assets/stateDiagram-v2-FVOUBMTO-rZTWN-vQ.js +1 -0
- package/dashboard/dist/assets/timeline-definition-YZTLITO2-DQJ_O-WU.js +61 -0
- package/dashboard/dist/assets/treemap-KZPCXAKY-BmmUp0Cf.js +162 -0
- package/dashboard/dist/assets/vennDiagram-LZ73GAT5-DzQooghy.js +34 -0
- package/dashboard/dist/assets/xychartDiagram-JWTSCODW-W9j8X9K6.js +7 -0
- package/dashboard/dist/index.html +17 -0
- package/dist/dashboard/server.d.ts +15 -0
- package/dist/dashboard/server.js +5873 -0
- package/dist/dashboard/server.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8892 -0
- package/dist/index.js.map +1 -0
- package/examples/playbooks/commit-discipline.md +20 -0
- package/examples/playbooks/keep-records-updated.md +30 -0
- package/examples/playbooks/plan-versioning.md +36 -0
- package/examples/playbooks/read-before-plan.md +27 -0
- package/examples/playbooks/test-before-done.md +24 -0
- package/examples/playbooks/workspace-before-code.md +30 -0
- package/examples/sample-mission/_index-assignments.md +20 -0
- package/examples/sample-mission/_index-decisions.md +11 -0
- package/examples/sample-mission/_index-plans.md +12 -0
- package/examples/sample-mission/_status.md +47 -0
- package/examples/sample-mission/agent.md +33 -0
- package/examples/sample-mission/assignments/design-auth-schema/assignment.md +61 -0
- package/examples/sample-mission/assignments/design-auth-schema/decision-record.md +15 -0
- package/examples/sample-mission/assignments/design-auth-schema/handoff.md +31 -0
- package/examples/sample-mission/assignments/design-auth-schema/plan.md +31 -0
- package/examples/sample-mission/assignments/design-auth-schema/scratchpad.md +40 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/assignment.md +65 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/decision-record.md +15 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/handoff.md +9 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/plan.md +33 -0
- package/examples/sample-mission/assignments/implement-jwt-middleware/scratchpad.md +48 -0
- package/examples/sample-mission/assignments/write-auth-tests/assignment.md +54 -0
- package/examples/sample-mission/assignments/write-auth-tests/decision-record.md +9 -0
- package/examples/sample-mission/assignments/write-auth-tests/handoff.md +9 -0
- package/examples/sample-mission/assignments/write-auth-tests/plan.md +34 -0
- package/examples/sample-mission/assignments/write-auth-tests/scratchpad.md +8 -0
- package/examples/sample-mission/claude.md +13 -0
- package/examples/sample-mission/manifest.md +22 -0
- package/examples/sample-mission/memories/_index.md +11 -0
- package/examples/sample-mission/memories/postgres-connection-pooling.md +35 -0
- package/examples/sample-mission/mission.md +34 -0
- package/examples/sample-mission/resources/_index.md +11 -0
- package/examples/sample-mission/resources/auth-requirements.md +44 -0
- package/package.json +57 -0
- package/plugin/.claude-plugin/plugin.json +9 -0
- package/plugin/agents/syntaur-expert.md +393 -0
- package/plugin/commands/track-server/track-server.md +56 -0
- package/plugin/commands/track-session/track-session.md +65 -0
- package/plugin/hooks/enforce-boundaries.sh +135 -0
- package/plugin/hooks/hooks.json +27 -0
- package/plugin/hooks/session-cleanup.sh +74 -0
- package/plugin/references/file-ownership.md +51 -0
- package/plugin/references/protocol-summary.md +70 -0
- package/plugin/skills/complete-assignment/SKILL.md +137 -0
- package/plugin/skills/create-assignment/SKILL.md +64 -0
- package/plugin/skills/create-mission/SKILL.md +51 -0
- package/plugin/skills/grab-assignment/SKILL.md +180 -0
- package/plugin/skills/plan-assignment/SKILL.md +101 -0
- package/plugin/skills/syntaur-protocol/SKILL.md +72 -0
- package/plugins/syntaur/.codex-plugin/plugin.json +28 -0
- package/plugins/syntaur/agents/openai.yaml +7 -0
- package/plugins/syntaur/agents/syntaur-operator.md +127 -0
- package/plugins/syntaur/commands/track-session.md +27 -0
- package/plugins/syntaur/hooks.json +27 -0
- package/plugins/syntaur/references/file-ownership.md +51 -0
- package/plugins/syntaur/references/protocol-summary.md +66 -0
- package/plugins/syntaur/scripts/enforce-boundaries.sh +103 -0
- package/plugins/syntaur/scripts/session-cleanup.sh +39 -0
- package/plugins/syntaur/skills/complete-assignment/SKILL.md +63 -0
- package/plugins/syntaur/skills/create-assignment/SKILL.md +43 -0
- package/plugins/syntaur/skills/create-mission/SKILL.md +35 -0
- package/plugins/syntaur/skills/grab-assignment/SKILL.md +61 -0
- package/plugins/syntaur/skills/plan-assignment/SKILL.md +49 -0
- package/plugins/syntaur/skills/syntaur-protocol/SKILL.md +84 -0
- package/plugins/syntaur/skills/track-session/SKILL.md +49 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Syntaur SessionEnd Hook
|
|
3
|
+
# Logs and marks agent sessions as "stopped" when a Claude Code session exits.
|
|
4
|
+
# If the session was never registered but has an active assignment, registers it first.
|
|
5
|
+
# Reads JSON from stdin, always exits 0.
|
|
6
|
+
|
|
7
|
+
# --- Safety: never fail ---
|
|
8
|
+
set -o pipefail 2>/dev/null || true
|
|
9
|
+
|
|
10
|
+
# --- Step 1: Check for jq ---
|
|
11
|
+
if ! command -v jq &>/dev/null; then
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# --- Step 2: Read stdin ---
|
|
16
|
+
INPUT=$(cat)
|
|
17
|
+
if [ -z "$INPUT" ]; then
|
|
18
|
+
exit 0
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# --- Step 3: Find context file ---
|
|
22
|
+
CWD=$(echo "$INPUT" | jq -r '.cwd // empty' 2>/dev/null)
|
|
23
|
+
if [ -z "$CWD" ]; then
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
CONTEXT_FILE="$CWD/.syntaur/context.json"
|
|
28
|
+
if [ ! -f "$CONTEXT_FILE" ]; then
|
|
29
|
+
exit 0
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# --- Step 4: Extract context info ---
|
|
33
|
+
SESSION_ID=$(jq -r '.sessionId // empty' "$CONTEXT_FILE" 2>/dev/null)
|
|
34
|
+
MISSION_SLUG=$(jq -r '.missionSlug // empty' "$CONTEXT_FILE" 2>/dev/null)
|
|
35
|
+
ASSIGNMENT_SLUG=$(jq -r '.assignmentSlug // empty' "$CONTEXT_FILE" 2>/dev/null)
|
|
36
|
+
|
|
37
|
+
PORT=$(cat "$HOME/.syntaur/dashboard-port" 2>/dev/null || echo "4800")
|
|
38
|
+
|
|
39
|
+
# --- Step 5: If no session was registered, try to auto-register (requires mission+assignment) ---
|
|
40
|
+
if [ -z "$SESSION_ID" ]; then
|
|
41
|
+
# Can only auto-register if we have mission and assignment context
|
|
42
|
+
if [ -z "$MISSION_SLUG" ] || [ -z "$ASSIGNMENT_SLUG" ]; then
|
|
43
|
+
exit 0
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
# Generate a session ID for the log entry
|
|
47
|
+
SESSION_ID=$(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid 2>/dev/null || echo "ses-$(date +%s)")
|
|
48
|
+
# Lowercase the UUID (uuidgen on macOS outputs uppercase)
|
|
49
|
+
SESSION_ID=$(echo "$SESSION_ID" | tr '[:upper:]' '[:lower:]')
|
|
50
|
+
|
|
51
|
+
RESPONSE=$(curl -sf -X POST "http://localhost:${PORT}/api/agent-sessions" \
|
|
52
|
+
-H "Content-Type: application/json" \
|
|
53
|
+
-d "{\"missionSlug\": \"${MISSION_SLUG}\", \"assignmentSlug\": \"${ASSIGNMENT_SLUG}\", \"agent\": \"claude\", \"sessionId\": \"${SESSION_ID}\", \"path\": \"${CWD}\"}" \
|
|
54
|
+
2>/dev/null) || true
|
|
55
|
+
|
|
56
|
+
# If registration succeeded, update the context file with the session ID
|
|
57
|
+
if [ -n "$RESPONSE" ]; then
|
|
58
|
+
jq --arg sid "$SESSION_ID" '. + {sessionId: $sid}' "$CONTEXT_FILE" > "${CONTEXT_FILE}.tmp" 2>/dev/null \
|
|
59
|
+
&& mv "${CONTEXT_FILE}.tmp" "$CONTEXT_FILE" 2>/dev/null || true
|
|
60
|
+
fi
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# --- Step 6: Mark session as stopped via dashboard API ---
|
|
64
|
+
BODY="{\"status\": \"stopped\"}"
|
|
65
|
+
if [ -n "$MISSION_SLUG" ]; then
|
|
66
|
+
BODY="{\"status\": \"stopped\", \"missionSlug\": \"${MISSION_SLUG}\"}"
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
curl -sf -X PATCH "http://localhost:${PORT}/api/agent-sessions/${SESSION_ID}/status" \
|
|
70
|
+
-H "Content-Type: application/json" \
|
|
71
|
+
-d "$BODY" \
|
|
72
|
+
-o /dev/null 2>/dev/null || true
|
|
73
|
+
|
|
74
|
+
exit 0
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# File Ownership Rules
|
|
2
|
+
|
|
3
|
+
## Human-Authored (READ-ONLY for agents)
|
|
4
|
+
|
|
5
|
+
Agents must NEVER modify these files:
|
|
6
|
+
|
|
7
|
+
| File | Location |
|
|
8
|
+
|------|----------|
|
|
9
|
+
| `mission.md` | `<mission>/mission.md` |
|
|
10
|
+
| `agent.md` | `<mission>/agent.md` |
|
|
11
|
+
| `claude.md` | `<mission>/claude.md` |
|
|
12
|
+
|
|
13
|
+
## Agent-Writable (YOUR assignment folder ONLY)
|
|
14
|
+
|
|
15
|
+
You may ONLY write to files inside your assigned assignment folder:
|
|
16
|
+
|
|
17
|
+
| File | Purpose |
|
|
18
|
+
|------|---------|
|
|
19
|
+
| `assignment.md` | Assignment record, source of truth for state |
|
|
20
|
+
| `plan.md` | Your implementation plan |
|
|
21
|
+
| `scratchpad.md` | Working notes |
|
|
22
|
+
| `handoff.md` | Append-only handoff log |
|
|
23
|
+
| `decision-record.md` | Append-only decision log |
|
|
24
|
+
|
|
25
|
+
Path pattern: `~/.syntaur/missions/<mission>/assignments/<your-assignment>/`
|
|
26
|
+
|
|
27
|
+
## Shared-Writable (any agent or human)
|
|
28
|
+
|
|
29
|
+
| Location | Purpose |
|
|
30
|
+
|----------|---------|
|
|
31
|
+
| `<mission>/resources/<slug>.md` | Reference material |
|
|
32
|
+
| `<mission>/memories/<slug>.md` | Learnings and patterns |
|
|
33
|
+
|
|
34
|
+
## Derived (NEVER edit)
|
|
35
|
+
|
|
36
|
+
All files prefixed with `_` are derived and rebuilt by tooling:
|
|
37
|
+
- `manifest.md`
|
|
38
|
+
- `_index-assignments.md`
|
|
39
|
+
- `_index-plans.md`
|
|
40
|
+
- `_index-decisions.md`
|
|
41
|
+
- `_status.md`
|
|
42
|
+
- `resources/_index.md`
|
|
43
|
+
- `memories/_index.md`
|
|
44
|
+
|
|
45
|
+
## Workspace Files
|
|
46
|
+
|
|
47
|
+
When working on code (not protocol files), you may write to files within
|
|
48
|
+
the workspace defined in your assignment frontmatter:
|
|
49
|
+
- `workspace.worktreePath` or `workspace.repository` defines your project root
|
|
50
|
+
- You may create and edit source code files within that workspace
|
|
51
|
+
- The `.syntaur/context.json` context file in your working directory is also writable
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Syntaur Protocol Summary
|
|
2
|
+
|
|
3
|
+
## Directory Structure
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
~/.syntaur/
|
|
7
|
+
config.md
|
|
8
|
+
missions/
|
|
9
|
+
<mission-slug>/
|
|
10
|
+
manifest.md # Derived: root navigation (read-only)
|
|
11
|
+
mission.md # Human-authored: mission overview (read-only)
|
|
12
|
+
_index-assignments.md # Derived (read-only)
|
|
13
|
+
_index-plans.md # Derived (read-only)
|
|
14
|
+
_index-decisions.md # Derived (read-only)
|
|
15
|
+
_status.md # Derived (read-only)
|
|
16
|
+
claude.md # Human-authored: Claude-specific instructions (read-only)
|
|
17
|
+
agent.md # Human-authored: universal agent instructions (read-only)
|
|
18
|
+
assignments/
|
|
19
|
+
<assignment-slug>/
|
|
20
|
+
assignment.md # Agent-writable: source of truth for state
|
|
21
|
+
plan.md # Agent-writable: implementation plan
|
|
22
|
+
scratchpad.md # Agent-writable: working notes
|
|
23
|
+
handoff.md # Agent-writable: append-only handoff log
|
|
24
|
+
decision-record.md # Agent-writable: append-only decision log
|
|
25
|
+
resources/
|
|
26
|
+
_index.md # Derived (read-only)
|
|
27
|
+
<resource-slug>.md # Shared-writable
|
|
28
|
+
memories/
|
|
29
|
+
_index.md # Derived (read-only)
|
|
30
|
+
<memory-slug>.md # Shared-writable
|
|
31
|
+
playbooks/
|
|
32
|
+
manifest.md # Derived: playbook listing (read-only)
|
|
33
|
+
<slug>.md # User-authored: behavioral rules for agents
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Assignment Lifecycle
|
|
37
|
+
|
|
38
|
+
| Status | Meaning |
|
|
39
|
+
|--------|---------|
|
|
40
|
+
| `pending` | Not yet started |
|
|
41
|
+
| `in_progress` | Actively being worked on |
|
|
42
|
+
| `blocked` | Manually blocked (requires `blockedReason`) |
|
|
43
|
+
| `review` | Work complete, awaiting review |
|
|
44
|
+
| `completed` | Done |
|
|
45
|
+
| `failed` | Could not be completed |
|
|
46
|
+
|
|
47
|
+
## Valid State Transitions
|
|
48
|
+
|
|
49
|
+
| From | Command | To |
|
|
50
|
+
|------|---------|-----|
|
|
51
|
+
| pending | start | in_progress |
|
|
52
|
+
| pending | block | blocked |
|
|
53
|
+
| in_progress | block | blocked |
|
|
54
|
+
| in_progress | review | review |
|
|
55
|
+
| in_progress | complete | completed |
|
|
56
|
+
| in_progress | fail | failed |
|
|
57
|
+
| blocked | unblock | in_progress |
|
|
58
|
+
| review | start | in_progress |
|
|
59
|
+
| review | complete | completed |
|
|
60
|
+
| review | fail | failed |
|
|
61
|
+
|
|
62
|
+
## Key Rules
|
|
63
|
+
|
|
64
|
+
1. **Assignment frontmatter is the single source of truth** for all assignment state.
|
|
65
|
+
2. **One folder per mission**, one subfolder per assignment.
|
|
66
|
+
3. **Derived files** (underscore-prefixed) are never edited manually.
|
|
67
|
+
4. **Slugs** are lowercase, hyphen-separated.
|
|
68
|
+
5. **Dependencies** are declared via `dependsOn` in assignment frontmatter.
|
|
69
|
+
6. An assignment cannot transition from `pending` to `in_progress` while any dependency is not `completed`.
|
|
70
|
+
7. **Playbooks** in `~/.syntaur/playbooks/` define behavioral rules agents must follow. Read `manifest.md` for a summary, then read each referenced playbook before starting work.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: complete-assignment
|
|
3
|
+
description: Write a handoff and transition the current Syntaur assignment to review or completed
|
|
4
|
+
argument-hint: "[--complete]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Complete Assignment
|
|
13
|
+
|
|
14
|
+
Write a handoff for your current assignment and transition it to review (or completed).
|
|
15
|
+
|
|
16
|
+
## Arguments
|
|
17
|
+
|
|
18
|
+
User provided: $ARGUMENTS
|
|
19
|
+
|
|
20
|
+
If the user passed `--complete`, transition directly to `completed` instead of `review`. However, `--complete` is ONLY allowed if ALL acceptance criteria are met. If any criteria are unmet, always transition to `review` regardless of the `--complete` flag, and inform the user why.
|
|
21
|
+
|
|
22
|
+
## Step 1: Load Context
|
|
23
|
+
|
|
24
|
+
Read `.syntaur/context.json` from the current working directory.
|
|
25
|
+
|
|
26
|
+
If the file does not exist, tell the user: "No active assignment found. Run `/grab-assignment <mission-slug>` first."
|
|
27
|
+
|
|
28
|
+
Extract: `missionSlug`, `assignmentSlug`, `assignmentDir`, `missionDir`.
|
|
29
|
+
|
|
30
|
+
## Step 1.5: Load Playbooks
|
|
31
|
+
|
|
32
|
+
Read all playbook files from `~/.syntaur/playbooks/` — verify your work complies with their rules:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
ls ~/.syntaur/playbooks/*.md 2>/dev/null
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For each file found, read it and check that your work follows its directives. If any playbook has completion-related rules (e.g., "run tests before done"), follow them before proceeding.
|
|
39
|
+
|
|
40
|
+
## Step 2: Verify Acceptance Criteria
|
|
41
|
+
|
|
42
|
+
Read `<assignmentDir>/assignment.md` and find the `## Acceptance Criteria` section.
|
|
43
|
+
|
|
44
|
+
Review each criterion (checkbox item). For each:
|
|
45
|
+
- If you believe it is met, note why (what was implemented, where)
|
|
46
|
+
- If it is NOT met, flag it clearly
|
|
47
|
+
|
|
48
|
+
If any criteria are not met, warn the user: "The following acceptance criteria are not yet met: [list]. Do you want to proceed with the handoff anyway?"
|
|
49
|
+
|
|
50
|
+
If the user says no, stop.
|
|
51
|
+
|
|
52
|
+
## Step 3: Write Handoff Entry
|
|
53
|
+
|
|
54
|
+
Read `<assignmentDir>/handoff.md` to see its current content and frontmatter.
|
|
55
|
+
|
|
56
|
+
Append a new handoff entry to the markdown body. Read the current `handoffCount` from the frontmatter and use `handoffCount + 1` as the entry number. The entry MUST follow the protocol-specified format from `docs/protocol/file-formats.md`:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
---
|
|
60
|
+
## Handoff <N>: <ISO 8601 timestamp>
|
|
61
|
+
|
|
62
|
+
**From:** claude
|
|
63
|
+
**To:** human
|
|
64
|
+
**Reason:** <Why this handoff is happening, e.g., "Assignment complete, handing off for review.">
|
|
65
|
+
|
|
66
|
+
### Summary
|
|
67
|
+
<One paragraph summarizing what was accomplished and what remains>
|
|
68
|
+
|
|
69
|
+
### Current State
|
|
70
|
+
- <What is working>
|
|
71
|
+
- <What is not working or partially done>
|
|
72
|
+
- <Acceptance criteria status: N of M met>
|
|
73
|
+
|
|
74
|
+
### Next Steps
|
|
75
|
+
- <Recommended next actions for the reviewer or next agent>
|
|
76
|
+
|
|
77
|
+
### Important Context
|
|
78
|
+
- <Anything the next agent/human needs that is not in the assignment or plan>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use the Edit tool to append this entry to handoff.md (do not overwrite existing content).
|
|
82
|
+
|
|
83
|
+
Also update the handoff.md frontmatter: set `updated` to the current timestamp and increment the `handoffCount` by 1.
|
|
84
|
+
|
|
85
|
+
## Step 4: Update Acceptance Criteria Checkboxes
|
|
86
|
+
|
|
87
|
+
In `<assignmentDir>/assignment.md`, update the acceptance criteria checkboxes to reflect the current state. Use the Edit tool to check off criteria that were met (change `- [ ]` to `- [x]`).
|
|
88
|
+
|
|
89
|
+
**Note:** Ideally, criteria should have been checked off incrementally during implementation. If they are already checked, verify they are still accurate. If some were missed, check them off now with a note in the handoff about which were verified at completion time vs. during development.
|
|
90
|
+
|
|
91
|
+
## Step 4.5: Close Session
|
|
92
|
+
|
|
93
|
+
Read the context file (`.syntaur/context.json`) to get the `sessionId` and `missionSlug`. Then mark the session as completed via the dashboard API:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
curl -s -X PATCH "http://localhost:$(cat ~/.syntaur/dashboard-port 2>/dev/null || echo 4800)/api/agent-sessions/<session-id>/status" \
|
|
97
|
+
-H "Content-Type: application/json" \
|
|
98
|
+
-d '{"status": "completed", "missionSlug": "<mission-slug>"}'
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If the API call fails (e.g., dashboard not running), this is non-critical — the session will be reconciled automatically on the next dashboard load.
|
|
102
|
+
|
|
103
|
+
## Step 5: Transition Assignment State
|
|
104
|
+
|
|
105
|
+
If the user passed `--complete`:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
syntaur complete <assignment-slug> --mission <mission-slug>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Otherwise, transition to review:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
syntaur review <assignment-slug> --mission <mission-slug>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use `dangerouslyDisableSandbox: true` since the CLI writes to `~/.syntaur/`.
|
|
118
|
+
|
|
119
|
+
If the command fails, report the error. Common failures:
|
|
120
|
+
- Assignment is not in `in_progress` status (cannot transition)
|
|
121
|
+
- Mission not found
|
|
122
|
+
|
|
123
|
+
## Step 6: Clean Up Context
|
|
124
|
+
|
|
125
|
+
Delete the context file:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
rm .syntaur/context.json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Step 7: Report to User
|
|
132
|
+
|
|
133
|
+
Summarize:
|
|
134
|
+
- Assignment slug and title
|
|
135
|
+
- New status (review or completed)
|
|
136
|
+
- Number of acceptance criteria met vs total
|
|
137
|
+
- Remind: if transitioned to `review`, a human reviewer will check the work. If any criteria were unmet, they may send it back to `in_progress` via `syntaur start`.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-assignment
|
|
3
|
+
description: Create a new Syntaur assignment within a mission (or as a one-off)
|
|
4
|
+
argument-hint: <title> --mission <slug> [--priority <level>] [--depends-on <slugs>] [--one-off]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Create Assignment
|
|
11
|
+
|
|
12
|
+
Create a new assignment within a Syntaur mission from Claude Code.
|
|
13
|
+
|
|
14
|
+
## Arguments
|
|
15
|
+
|
|
16
|
+
The user provided: $ARGUMENTS
|
|
17
|
+
|
|
18
|
+
Parse the arguments:
|
|
19
|
+
- First argument (required): the assignment title (e.g., `"Add login endpoint"`)
|
|
20
|
+
- `--mission <slug>` (required unless `--one-off`): the mission to add the assignment to
|
|
21
|
+
- `--one-off` (optional): create a standalone mission+assignment in one step
|
|
22
|
+
- `--slug` (optional): override the auto-generated assignment slug
|
|
23
|
+
- `--priority` (optional): `low`, `medium` (default), `high`, or `critical`
|
|
24
|
+
- `--depends-on` (optional): comma-separated list of assignment slugs this depends on
|
|
25
|
+
- `--dir` (optional): override the default mission directory
|
|
26
|
+
|
|
27
|
+
If no title was provided, ask the user what the assignment should be called.
|
|
28
|
+
|
|
29
|
+
If neither `--mission` nor `--one-off` was provided, check if there is an active assignment context in `.syntaur/context.json`. If so, default `--mission` to that context's `missionSlug` and confirm with the user: "Add this assignment to mission `<missionSlug>`?"
|
|
30
|
+
|
|
31
|
+
If there is no active context and no mission flag, ask the user which mission to add it to, or whether it should be a one-off.
|
|
32
|
+
|
|
33
|
+
## Step 1: Run the CLI
|
|
34
|
+
|
|
35
|
+
Build the command from the parsed arguments. Use `dangerouslyDisableSandbox: true` since the CLI writes to `~/.syntaur/` which is outside the project sandbox.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
syntaur create-assignment "<title>" --mission <slug> [--slug <slug>] [--priority <level>] [--depends-on <slugs>] [--dir <path>]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or for one-off:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
syntaur create-assignment "<title>" --one-off [--slug <slug>] [--priority <level>] [--dir <path>]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If the command fails (e.g., mission not found, slug collision), report the error and suggest fixes.
|
|
48
|
+
|
|
49
|
+
## Step 2: Read the Created Assignment
|
|
50
|
+
|
|
51
|
+
After successful creation, extract the assignment slug and directory from the CLI output. Read the generated `assignment.md`:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cat ~/.syntaur/missions/<mission-slug>/assignments/<assignment-slug>/assignment.md
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Step 3: Guide Next Steps
|
|
58
|
+
|
|
59
|
+
Tell the user:
|
|
60
|
+
- The assignment was created with its slug, priority, and location
|
|
61
|
+
- List the files created (assignment.md, plan.md, scratchpad.md, handoff.md, decision-record.md)
|
|
62
|
+
- Suggest they edit `assignment.md` to fill in the objective, acceptance criteria, and context
|
|
63
|
+
- If dependencies were set, note them
|
|
64
|
+
- Suggest running `/grab-assignment <mission-slug> <assignment-slug>` to claim and start working on it
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-mission
|
|
3
|
+
description: Create a new Syntaur mission with all scaffolding files (manifest, agent instructions, indexes)
|
|
4
|
+
argument-hint: <title> [--slug <slug>] [--dir <path>] [--workspace <workspace>]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Create Mission
|
|
11
|
+
|
|
12
|
+
Create a new Syntaur mission from within Claude Code.
|
|
13
|
+
|
|
14
|
+
## Arguments
|
|
15
|
+
|
|
16
|
+
The user provided: $ARGUMENTS
|
|
17
|
+
|
|
18
|
+
Parse the arguments:
|
|
19
|
+
- First argument (required): the mission title (e.g., `"Build Auth System"`)
|
|
20
|
+
- `--slug` (optional): override the auto-generated slug
|
|
21
|
+
- `--dir` (optional): override the default mission directory
|
|
22
|
+
- `--workspace` (optional): workspace grouping label (e.g., `syntaur`, `reeva`)
|
|
23
|
+
|
|
24
|
+
If no title was provided, ask the user what the mission should be called.
|
|
25
|
+
|
|
26
|
+
## Step 1: Run the CLI
|
|
27
|
+
|
|
28
|
+
Build the command from the parsed arguments. Use `dangerouslyDisableSandbox: true` since the CLI writes to `~/.syntaur/` which is outside the project sandbox.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
syntaur create-mission "<title>" [--slug <slug>] [--dir <path>] [--workspace <workspace>]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If the command fails (e.g., slug collision, empty title), report the error and suggest fixes.
|
|
35
|
+
|
|
36
|
+
## Step 2: Read the Created Mission
|
|
37
|
+
|
|
38
|
+
After successful creation, extract the mission slug and directory from the CLI output. Read the generated `mission.md` to confirm the structure:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cat ~/.syntaur/missions/<slug>/mission.md
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Step 3: Guide Next Steps
|
|
45
|
+
|
|
46
|
+
Tell the user:
|
|
47
|
+
- The mission was created with its slug and location
|
|
48
|
+
- List the key files created (manifest.md, mission.md, agent.md, claude.md)
|
|
49
|
+
- Suggest they edit `mission.md` to fill in the goal, scope, and context sections
|
|
50
|
+
- Suggest they edit `agent.md` to set conventions and boundaries for agents
|
|
51
|
+
- Suggest running `/create-assignment` to add assignments to this mission
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grab-assignment
|
|
3
|
+
description: Discover and claim a pending Syntaur assignment from a mission
|
|
4
|
+
argument-hint: <mission-slug> [assignment-slug]
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Grab Assignment
|
|
14
|
+
|
|
15
|
+
Claim a pending assignment from a Syntaur mission and set up your working context.
|
|
16
|
+
|
|
17
|
+
## Arguments
|
|
18
|
+
|
|
19
|
+
The user provided: $ARGUMENTS
|
|
20
|
+
|
|
21
|
+
Parse the arguments:
|
|
22
|
+
- First argument (required): the mission slug (e.g., `build-auth-system`)
|
|
23
|
+
- Second argument (optional): a specific assignment slug to grab. If omitted, you will list pending assignments and pick one.
|
|
24
|
+
|
|
25
|
+
## Pre-flight Check
|
|
26
|
+
|
|
27
|
+
1. Check if `.syntaur/context.json` already exists in the current working directory.
|
|
28
|
+
- If it exists, read it and warn the user: "You already have an active assignment: `<assignmentSlug>` in mission `<missionSlug>`. Grabbing a new assignment will replace this context. Proceed?"
|
|
29
|
+
- If the user says no, stop.
|
|
30
|
+
|
|
31
|
+
## Step 1: Discover the Mission
|
|
32
|
+
|
|
33
|
+
Read the mission directory to understand what is available:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
ls ~/.syntaur/missions/<mission-slug>/
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Read the mission files, starting with the manifest (the protocol-defined entry point):
|
|
40
|
+
- Read `~/.syntaur/missions/<mission-slug>/manifest.md` first (root navigation file per protocol spec)
|
|
41
|
+
- Read `~/.syntaur/missions/<mission-slug>/mission.md` for goal and context
|
|
42
|
+
- Read `~/.syntaur/missions/<mission-slug>/agent.md` for agent instructions
|
|
43
|
+
- Read `~/.syntaur/missions/<mission-slug>/claude.md` if it exists for Claude-specific instructions
|
|
44
|
+
|
|
45
|
+
Note the `workspace` field in `mission.md` frontmatter if present. This indicates which project/codebase grouping the mission belongs to. When writing context to `.syntaur/context.json` (Step 5), include `"workspace": "<value>"` if the mission has a workspace.
|
|
46
|
+
|
|
47
|
+
## Step 2: Find Pending Assignments
|
|
48
|
+
|
|
49
|
+
List assignment directories and check their status:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ls ~/.syntaur/missions/<mission-slug>/assignments/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For each assignment directory, read the `assignment.md` frontmatter and look for `status: pending`. You can use grep:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
grep -l "status: pending" ~/.syntaur/missions/<mission-slug>/assignments/*/assignment.md
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If no pending assignments exist, tell the user and stop.
|
|
62
|
+
|
|
63
|
+
If the user specified an assignment slug as the second argument, verify it exists and is pending. If it is not pending, report its current status and stop.
|
|
64
|
+
|
|
65
|
+
If no specific assignment was requested, present the list of pending assignments with their titles and priorities, and ask the user which one to grab. If there is only one pending assignment, grab it automatically.
|
|
66
|
+
|
|
67
|
+
## Step 3: Claim the Assignment
|
|
68
|
+
|
|
69
|
+
Run the Syntaur CLI commands to assign and start the assignment. Use `dangerouslyDisableSandbox: true` for these bash commands since the CLI writes to `~/.syntaur/` which is outside the project sandbox.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
syntaur assign <assignment-slug> --agent claude --mission <mission-slug>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
syntaur start <assignment-slug> --mission <mission-slug>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If either command fails, report the error and stop. Common failures:
|
|
82
|
+
- Assignment has unmet dependencies (cannot start until dependencies are `completed`)
|
|
83
|
+
- Assignment is not in `pending` status
|
|
84
|
+
- Mission not found
|
|
85
|
+
|
|
86
|
+
## Step 4: Read Assignment Context and Set Workspace
|
|
87
|
+
|
|
88
|
+
After successfully starting the assignment, read the full assignment details:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
cat ~/.syntaur/missions/<mission-slug>/assignments/<assignment-slug>/assignment.md
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Extract from the frontmatter:
|
|
95
|
+
- `title` -- the assignment title
|
|
96
|
+
- `workspace.repository` -- the code repository path (may be null)
|
|
97
|
+
- `workspace.worktreePath` -- the worktree path (may be null)
|
|
98
|
+
- `workspace.branch` -- the branch name (may be null)
|
|
99
|
+
- `dependsOn` -- list of dependency slugs
|
|
100
|
+
- `priority` -- priority level
|
|
101
|
+
|
|
102
|
+
Read the objective and acceptance criteria from the markdown body.
|
|
103
|
+
|
|
104
|
+
### Set workspace if not configured
|
|
105
|
+
|
|
106
|
+
If `workspace.repository` and `workspace.worktreePath` are both null, set them to the current working directory (`$(pwd)`). This is critical because the write boundary hook uses the workspace path to determine which files the agent is allowed to edit. Without it, all code edits outside the assignment directory will be blocked.
|
|
107
|
+
|
|
108
|
+
Use the Edit tool to update the assignment.md frontmatter:
|
|
109
|
+
```yaml
|
|
110
|
+
workspace:
|
|
111
|
+
repository: /absolute/path/to/cwd
|
|
112
|
+
worktreePath: /absolute/path/to/cwd
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Step 5: Create Context File
|
|
116
|
+
|
|
117
|
+
Write `.syntaur/context.json` in the current working directory with the assignment context. First ensure the directory exists:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
mkdir -p .syntaur
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Then write the JSON file with this structure:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"missionSlug": "<mission-slug>",
|
|
128
|
+
"assignmentSlug": "<assignment-slug>",
|
|
129
|
+
"missionDir": "/Users/<username>/.syntaur/missions/<mission-slug>",
|
|
130
|
+
"assignmentDir": "/Users/<username>/.syntaur/missions/<mission-slug>/assignments/<assignment-slug>",
|
|
131
|
+
"workspaceRoot": "<workspace.worktreePath if set, else workspace.repository if it is a local path, else current working directory>",
|
|
132
|
+
"title": "<assignment title>",
|
|
133
|
+
"branch": "<workspace.branch or null>",
|
|
134
|
+
"grabbedAt": "<ISO 8601 timestamp>"
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Use absolute paths (expand `~` to the actual home directory). Note: `workspace.repository` may be a remote URL (e.g., `https://github.com/...`) -- only use it as `workspaceRoot` if it starts with `/` (local path). If it is a URL, set `workspaceRoot` to the current working directory.
|
|
139
|
+
|
|
140
|
+
**IMPORTANT:** The `workspaceRoot` must NEVER be null when the agent will be writing code. If no workspace was configured, default to the current working directory.
|
|
141
|
+
|
|
142
|
+
## Step 5.5: Register Agent Session
|
|
143
|
+
|
|
144
|
+
After creating the context file, register this session in the mission's agent session log so it appears in the dashboard.
|
|
145
|
+
|
|
146
|
+
1. Find the current Claude Code session ID by reading from `~/.claude/sessions/`. These are JSON files keyed by PID containing `sessionId`, `cwd`, etc. Find the most recently modified file whose `cwd` matches the current working directory:
|
|
147
|
+
```bash
|
|
148
|
+
ls -t ~/.claude/sessions/*.json | head -5
|
|
149
|
+
```
|
|
150
|
+
Read the most recent file(s) and find the one whose `cwd` matches `$(pwd)`. Extract the `sessionId` field — this is the real Claude Code session ID that can be used with `claude --resume <sessionId>` to resume this exact conversation.
|
|
151
|
+
|
|
152
|
+
If you cannot find a matching session file (e.g., no file matches the cwd, or the sessions directory is empty), ask the user to run `/rename <assignment-slug>` to name the current session after the assignment. Then store the assignment slug as the session name in context.json (`"sessionName": "<assignment-slug>"`) instead of `sessionId`. The user can later resume with `claude --resume <assignment-slug>`.
|
|
153
|
+
|
|
154
|
+
2. Run the track-session command (use `dangerouslyDisableSandbox: true` since it writes to `~/.syntaur/`):
|
|
155
|
+
```bash
|
|
156
|
+
syntaur track-session --mission <missionSlug> --assignment <assignmentSlug> --agent claude --session-id <claude-session-id> --path $(pwd)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
3. Update the `.syntaur/context.json` context file to include the session ID. Add `"sessionId": "<claude-session-id>"` to the JSON object you wrote in Step 5.
|
|
160
|
+
|
|
161
|
+
## Step 5.6: Load Playbooks
|
|
162
|
+
|
|
163
|
+
Read all playbook files from `~/.syntaur/playbooks/` and treat their content as active behavioral rules for this assignment:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
ls ~/.syntaur/playbooks/*.md 2>/dev/null
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
For each `.md` file found, read it and internalize the rules in its body section. These are user-defined behavioral policies that you must follow throughout your work on this assignment. Playbooks take precedence over default conventions when they conflict.
|
|
170
|
+
|
|
171
|
+
If no playbook files exist, skip this step.
|
|
172
|
+
|
|
173
|
+
## Step 6: Report to User
|
|
174
|
+
|
|
175
|
+
Summarize what was done:
|
|
176
|
+
- Which assignment was grabbed
|
|
177
|
+
- The objective (first paragraph from assignment.md body)
|
|
178
|
+
- The acceptance criteria (the checkbox list)
|
|
179
|
+
- The workspace path (if set)
|
|
180
|
+
- Suggest next step: "Run `/plan-assignment` to create an implementation plan."
|