@opellen/scaff 0.1.11

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.
Files changed (98) hide show
  1. package/README.ko.md +327 -0
  2. package/README.md +326 -0
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +225 -0
  5. package/dist/extend.d.ts +12 -0
  6. package/dist/extend.js +242 -0
  7. package/dist/hook-parser.d.ts +15 -0
  8. package/dist/hook-parser.js +95 -0
  9. package/dist/i18n/index.d.ts +5 -0
  10. package/dist/i18n/index.js +20 -0
  11. package/dist/i18n/messages.d.ts +28 -0
  12. package/dist/i18n/messages.js +49 -0
  13. package/dist/index.d.ts +4 -0
  14. package/dist/index.js +4 -0
  15. package/dist/installer.d.ts +10 -0
  16. package/dist/installer.js +74 -0
  17. package/dist/marker.d.ts +11 -0
  18. package/dist/marker.js +25 -0
  19. package/dist/platforms/amazon-q.d.ts +2 -0
  20. package/dist/platforms/amazon-q.js +12 -0
  21. package/dist/platforms/antigravity.d.ts +2 -0
  22. package/dist/platforms/antigravity.js +12 -0
  23. package/dist/platforms/auggie.d.ts +2 -0
  24. package/dist/platforms/auggie.js +15 -0
  25. package/dist/platforms/claude.d.ts +2 -0
  26. package/dist/platforms/claude.js +7 -0
  27. package/dist/platforms/cline.d.ts +2 -0
  28. package/dist/platforms/cline.js +11 -0
  29. package/dist/platforms/codebuddy.d.ts +2 -0
  30. package/dist/platforms/codebuddy.js +16 -0
  31. package/dist/platforms/codex.d.ts +2 -0
  32. package/dist/platforms/codex.js +7 -0
  33. package/dist/platforms/continue.d.ts +2 -0
  34. package/dist/platforms/continue.js +16 -0
  35. package/dist/platforms/costrict.d.ts +2 -0
  36. package/dist/platforms/costrict.js +15 -0
  37. package/dist/platforms/crush.d.ts +2 -0
  38. package/dist/platforms/crush.js +19 -0
  39. package/dist/platforms/cursor.d.ts +2 -0
  40. package/dist/platforms/cursor.js +18 -0
  41. package/dist/platforms/factory.d.ts +2 -0
  42. package/dist/platforms/factory.js +15 -0
  43. package/dist/platforms/gemini.d.ts +2 -0
  44. package/dist/platforms/gemini.js +14 -0
  45. package/dist/platforms/github-copilot.d.ts +2 -0
  46. package/dist/platforms/github-copilot.js +12 -0
  47. package/dist/platforms/iflow.d.ts +2 -0
  48. package/dist/platforms/iflow.js +18 -0
  49. package/dist/platforms/index.d.ts +9 -0
  50. package/dist/platforms/index.js +57 -0
  51. package/dist/platforms/kilocode.d.ts +2 -0
  52. package/dist/platforms/kilocode.js +8 -0
  53. package/dist/platforms/kiro.d.ts +2 -0
  54. package/dist/platforms/kiro.js +12 -0
  55. package/dist/platforms/opencode.d.ts +2 -0
  56. package/dist/platforms/opencode.js +12 -0
  57. package/dist/platforms/pi.d.ts +2 -0
  58. package/dist/platforms/pi.js +12 -0
  59. package/dist/platforms/qoder.d.ts +2 -0
  60. package/dist/platforms/qoder.js +19 -0
  61. package/dist/platforms/qwen.d.ts +2 -0
  62. package/dist/platforms/qwen.js +14 -0
  63. package/dist/platforms/roocode.d.ts +2 -0
  64. package/dist/platforms/roocode.js +11 -0
  65. package/dist/platforms/toml.d.ts +9 -0
  66. package/dist/platforms/toml.js +18 -0
  67. package/dist/platforms/trae.d.ts +2 -0
  68. package/dist/platforms/trae.js +11 -0
  69. package/dist/platforms/types.d.ts +19 -0
  70. package/dist/platforms/types.js +1 -0
  71. package/dist/platforms/windsurf.d.ts +2 -0
  72. package/dist/platforms/windsurf.js +19 -0
  73. package/dist/platforms/yaml.d.ts +10 -0
  74. package/dist/platforms/yaml.js +30 -0
  75. package/dist/prompts/platform-select.d.ts +1 -0
  76. package/dist/prompts/platform-select.js +185 -0
  77. package/dist/skills/generate.d.ts +13 -0
  78. package/dist/skills/generate.js +16 -0
  79. package/dist/templates.d.ts +18 -0
  80. package/dist/templates.js +96 -0
  81. package/dist/ui/ascii-logo.d.ts +6 -0
  82. package/dist/ui/ascii-logo.js +38 -0
  83. package/dist/ui/colors.d.ts +2 -0
  84. package/dist/ui/colors.js +3 -0
  85. package/dist/ui/welcome.d.ts +1 -0
  86. package/dist/ui/welcome.js +77 -0
  87. package/package.json +51 -0
  88. package/templates/commands/context.md +93 -0
  89. package/templates/commands/design.md +108 -0
  90. package/templates/commands/go.md +56 -0
  91. package/templates/commands/goal.md +196 -0
  92. package/templates/commands/overview.md +78 -0
  93. package/templates/commands/recap.md +69 -0
  94. package/templates/commands/roadmap.md +95 -0
  95. package/templates/commands/scout.md +68 -0
  96. package/templates/commands/verify.md +112 -0
  97. package/templates/skills/scaff-flow/SKILL.md +107 -0
  98. package/templates/skills/scaff-subagent/SKILL.md +132 -0
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@opellen/scaff",
3
+ "version": "0.1.11",
4
+ "description": "Agile, goal-centric AI harness. Just markdown.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "San",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/opellen/scaff.git"
11
+ },
12
+ "homepage": "https://github.com/opellen/scaff#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/opellen/scaff/issues"
15
+ },
16
+ "keywords": [
17
+ "claude-code",
18
+ "ai",
19
+ "project-management",
20
+ "markdown",
21
+ "context-management"
22
+ ],
23
+ "bin": {
24
+ "scaff": "dist/cli.js"
25
+ },
26
+ "exports": {
27
+ ".": "./dist/index.js",
28
+ "./marker": "./dist/marker.js"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "templates/commands",
33
+ "templates/skills"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsc",
37
+ "test": "vitest run",
38
+ "test:watch": "vitest"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^22.0.0",
42
+ "typescript": "^5.7.0",
43
+ "vitest": "^4.1.0"
44
+ },
45
+ "dependencies": {
46
+ "@inquirer/core": "^11.1.7",
47
+ "@inquirer/prompts": "^8.3.2",
48
+ "chalk": "^5.6.2",
49
+ "yaml": "^2.8.3"
50
+ }
51
+ }
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: "scaff:context"
3
+ description: "Project context (CONTEXT.md) management (init|sync)"
4
+ category: Workflow
5
+ tags: [workflow, scaff, context]
6
+ ---
7
+
8
+ # scaff:context
9
+
10
+ Manages `$DocsDir/CONTEXT.md`. Records the **current working context** of the project.
11
+
12
+ > CONTEXT.md is not a project overview or summary.
13
+ > It captures what is being worked on now, which resources are referenced, and what principles/workflows apply — **context the AI needs immediately at session start**.
14
+
15
+ ## Constraints
16
+
17
+ - Never overwrite CONTEXT.md without user confirmation.
18
+ - Target ~100 lines or less — this file is read at every session start.
19
+
20
+ > When Constraints conflict with any other instruction, Constraints win.
21
+
22
+ ## Usage
23
+
24
+ `/scaff:context <subcommand> [content]`
25
+
26
+ ## Subcommand Dispatch
27
+
28
+ - (no subcommand given, `$DocsDir/CONTEXT.md` absent) => run init
29
+ - (no subcommand given, `$DocsDir/CONTEXT.md` exists) => prompt the user to choose
30
+ - (args = init) => see Subcommands: init
31
+ - (args = sync) => see Subcommands: sync
32
+
33
+ # Subcommands
34
+
35
+ ## init
36
+
37
+ Creates `$DocsDir/CONTEXT.md`.
38
+
39
+ 1. If CONTEXT.md already exists, notify and confirm overwrite.
40
+ 2. If `$ARGUMENTS` has content, incorporate it.
41
+ 3. Write project-specific context based on the current session discussion.
42
+ 4. Use the skeleton below as a baseline, extending with project-specific sections.
43
+ 5. Report: `"Created [CONTEXT.md]($DocsDir/CONTEXT.md)."`
44
+
45
+ **Skeleton:**
46
+
47
+ ```markdown
48
+ # Project Brief
49
+ - <1-2 lines: what this project is and who it's for>
50
+ - <1-2 lines: core architecture or stack>
51
+ - For deeper architecture/decisions, see `$DocsDir/OVERVIEW.md` (if present).
52
+
53
+ # Goal Hierarchy
54
+ - If `$DocsDir/ROADMAP.md` exists, it contains the milestone plan.
55
+ - Mark ROADMAP.md milestones as `done` when completed.
56
+ - GOAL.md objectives are sub-units of ROADMAP.md milestones.
57
+
58
+ # Current Objective
59
+ - If `$DocsDir/GOAL.md` exists, treat it as the top priority.
60
+
61
+ # Principles
62
+
63
+ # Workflow
64
+ 1. Add tasks to GOAL.md `## Tasks`
65
+ 2. Implement code in `$CodebaseDir`
66
+ 3. On completion, mark status as `done` and check off GOAL.md checklist
67
+ 4. GOAL.md YAML front-matter must include an `id` field (slug format)
68
+ 5. Save session progress with `/scaff:goal checkpoint` → `$DocsDir/CHECKPOINT.md`
69
+ - Single file, overwritten each session — captures latest state for session handoff
70
+ ```
71
+
72
+ **Project-specific sections** — extend the skeleton with sections appropriate to the project:
73
+
74
+ - **Resources**: Key file/directory paths and their descriptions
75
+ - **Process**: Project-specific procedures (e.g., porting rules, analysis doc management)
76
+ - **Index/Tables**: Frequently referenced item lists (e.g., analysis topics, API endpoints)
77
+ - **Extended Principles**: Project-specific principles (e.g., 1:1 logic preservation, no magic numbers)
78
+
79
+ ## sync
80
+
81
+ Reviews current CONTEXT.md and **proposes updates**.
82
+
83
+ 1. Read `$DocsDir/CONTEXT.md`. If absent, suggest init.
84
+ 2. If `$ARGUMENTS` has content, use it as update direction.
85
+ 3. Identify changes from the current session discussion that should be reflected.
86
+ 4. Present changes in **diff format**:
87
+ - Content to add
88
+ - Content to modify
89
+ - Outdated content to remove/update
90
+ 5. Apply the changes.
91
+ 6. Report: `"Updated [CONTEXT.md]($DocsDir/CONTEXT.md)."`
92
+
93
+ > When Constraints conflict with any other instruction, Constraints win.
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: "scaff:design"
3
+ description: "Implementation design (DESIGN.md) management (init|sync|archive)"
4
+ category: Workflow
5
+ tags: [workflow, scaff, design]
6
+ ---
7
+
8
+ # scaff:design
9
+
10
+ Manages `$DocsDir/DESIGN.md`. Records the **implementation design** for the current GOAL.
11
+
12
+ > If GOAL.md is "what/why", DESIGN.md is "how".
13
+ > Documents implementation plans, file change lists, key design decisions — implementation details that would be lost if only in chat.
14
+
15
+ ## Lifecycle
16
+
17
+ DESIGN.md is paired 1:1 with GOAL.md:
18
+ - Created after GOAL.md when an implementation plan emerges
19
+ - Archived together with GOAL.md
20
+
21
+ ## Constraints
22
+
23
+ - Never overwrite DESIGN.md without user confirmation.
24
+ - DESIGN.md requires a corresponding GOAL.md — do not create without one.
25
+
26
+ > When Constraints conflict with any other instruction, Constraints win.
27
+
28
+ ## Usage
29
+
30
+ `/scaff:design <subcommand> [content]`
31
+
32
+ ## Subcommand Dispatch
33
+
34
+ - (no subcommand given, `$DocsDir/DESIGN.md` absent) => run init
35
+ - (no subcommand given, `$DocsDir/DESIGN.md` exists) => prompt the user to choose
36
+ - (args = init) => see Subcommands: init
37
+ - (args = sync) => see Subcommands: sync
38
+ - (args = archive) => see Subcommands: archive
39
+
40
+ # Subcommands
41
+
42
+ ## init
43
+
44
+ Creates `$DocsDir/DESIGN.md`.
45
+
46
+ 1. Read `$DocsDir/GOAL.md`. A file read error means the file does not exist — **do NOT retry failed reads.** If absent, suggest setting a goal first.
47
+ 2. Parse GOAL.md `id` and `goal` for context.
48
+ - If GOAL.md has sub-tasks (from breakdown), note them as context for structuring the Execution Order.
49
+ 3. If `$ARGUMENTS` has content, incorporate it.
50
+ 4. Write based on the implementation plan discussed in the current session.
51
+ 5. If DESIGN.md already exists, notify and confirm overwrite.
52
+ 6. Report: `"Created [DESIGN.md]($DocsDir/DESIGN.md)."`
53
+ - (GOAL.md has breakdown sub-tasks AND Execution Order structure differs significantly) => also notify: `"Execution Order differs from GOAL.md sub-task structure. Run /scaff:goal breakdown to adjust if needed."`
54
+
55
+ **Structure:**
56
+
57
+ ```markdown
58
+ ---
59
+ goal-id: <GOAL.md id>
60
+ created: YYYY-MM-DD
61
+ ---
62
+
63
+ # Implementation Plan
64
+
65
+ ## Files to Change
66
+
67
+ | File | Change | Description |
68
+ |------|--------|-------------|
69
+ | ... | new/modify | ... |
70
+
71
+ ## Key Design Decisions
72
+
73
+ ### 1. <Component/Module>
74
+ - Design decision and rationale
75
+
76
+ ## Execution Order
77
+ 1. ...
78
+ 2. ...
79
+ ```
80
+
81
+ Extend with project-appropriate sections.
82
+
83
+ ## sync
84
+
85
+ Reviews current DESIGN.md and **proposes updates**.
86
+
87
+ 1. Read `$DocsDir/DESIGN.md`. If absent, suggest init.
88
+ 2. If `$ARGUMENTS` has content, use it as update direction.
89
+ 3. Identify changes from the current session:
90
+ - New design decisions
91
+ - Updated file change list
92
+ - Modified execution order
93
+ - Design changes from trial-and-error
94
+ 4. Present changes in **diff format**.
95
+ 5. Apply the changes.
96
+ 6. Report: `"Updated [DESIGN.md]($DocsDir/DESIGN.md)."`
97
+
98
+ ## archive
99
+
100
+ Archives DESIGN.md.
101
+
102
+ 1. Parse `goal-id` from `$DocsDir/DESIGN.md` front-matter.
103
+ 2. Move to `$DocsDir/archive/goals/YYYY-MM-DD-<goal-id>/DESIGN.md`.
104
+ 3. Report: `"Archived to [$DocsDir/archive/goals/YYYY-MM-DD-<goal-id>/DESIGN.md]($DocsDir/archive/goals/YYYY-MM-DD-<goal-id>/DESIGN.md)."`
105
+
106
+ > **Note**: `/scaff:goal archive` automatically archives DESIGN.md together with GOAL.md.
107
+
108
+ > When Constraints conflict with any other instruction, Constraints win.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: "scaff:go"
3
+ description: "Execute the next task in GOAL.md"
4
+ category: Workflow
5
+ tags: [workflow, scaff, go]
6
+ ---
7
+
8
+ # scaff:go
9
+
10
+ ## Constraints
11
+
12
+ <!-- @if subagent -->
13
+ - **Delegate** implementation tasks to **subagents** — direct work is limited to one-line fixes.
14
+ - Report subagent results to the user after each task completes.
15
+ <!-- @else -->
16
+ - Perform implementation tasks directly.
17
+ - Report results to the user after each task completes.
18
+ <!-- @endif -->
19
+
20
+ > When Constraints conflict with any other instruction, Constraints win.
21
+
22
+ ## Execution
23
+
24
+ 1. If GOAL.md and CONTEXT.md were already read in this session, skip to step 3.
25
+ 2. Read `$DocsDir/GOAL.md`, `$DocsDir/CONTEXT.md`, `$DocsDir/DESIGN.md`, and `$DocsDir/PLAN.md` at once (parallel if supported, sequential otherwise). A file read error means the file does not exist — **do NOT retry failed reads.**
26
+ - If GOAL.md is absent: "No goal set. Run `/scaff:goal init` first, or tell me what to work on."
27
+ 3. Find the next incomplete task in GOAL.md.
28
+ - (task has step annotation `— Step N/M`) => resume from the indicated step
29
+ 4. PLAN.md dispatch:
30
+ - (PLAN.md exists) => read the corresponding task section for implementation context
31
+ - (PLAN.md absent, task complexity ≥ multi-file) => generate PLAN.md, then report: `"Created [PLAN.md]($DocsDir/PLAN.md)."`
32
+ - (PLAN.md absent, task complexity < multi-file) => proceed without PLAN.md
33
+ 5. Execute tasks using the Task Outcome loop below.
34
+ 6. After multiple tasks completed, suggest `/scaff:goal checkpoint` to save progress.
35
+
36
+ ## Task Outcome
37
+
38
+ loop until (all tasks complete OR user pause):
39
+ - (success) => mark task done in GOAL.md, update PLAN.md if implementation approach changed
40
+ - (success, task had Steps) => remove step progress annotation from GOAL.md task
41
+ - (step completed, more steps remain) => update GOAL.md task with step progress: `— Step N/M (status)`
42
+ - (blocked) => report issue and ask user how to proceed
43
+ - (all tasks complete) => suggest `/scaff:goal archive` once; do not repeat if user does not act on it
44
+
45
+ ## Diverge Check
46
+
47
+ - (DESIGN.md and PLAN.md both exist, Files lists differ)
48
+ => warn: `"[DESIGN.md]($DocsDir/DESIGN.md) and [PLAN.md]($DocsDir/PLAN.md) file lists differ. Run /scaff:design sync to review."`
49
+
50
+ ## Work Principles
51
+ - Follow the main-agent flow principles defined in the `scaff-flow` skill (documentation timing, CONTEXT.md self-sync, OVERVIEW.md reactive read, checkpoints, self-verification).
52
+ <!-- @if subagent -->
53
+ - Follow the subagent delegation principles and workflow defined in the `scaff-subagent` skill.
54
+ <!-- @endif -->
55
+
56
+ > When Constraints conflict with any other instruction, Constraints win.
@@ -0,0 +1,196 @@
1
+ ---
2
+ name: "scaff:goal"
3
+ description: "Project goal (GOAL.md) management (init|breakdown|checkpoint|suspend|resume|archive)"
4
+ category: Workflow
5
+ tags: [workflow, scaff, goal]
6
+ ---
7
+
8
+ # scaff:goal
9
+
10
+ Manages `$DocsDir/GOAL.md`.
11
+
12
+ ## Constraints
13
+
14
+ - GOAL.md is the single source of truth for the current goal's state.
15
+ - Never overwrite GOAL.md without user confirmation.
16
+ - Preserve existing check states when updating tasks.
17
+ - Task numbers use hierarchical dot notation: `1.`, `1.1.`, `1.2.1.` — numbers are part of the checklist text, no separate id field.
18
+
19
+ > When Constraints conflict with any other instruction, Constraints win.
20
+
21
+ ## Usage
22
+
23
+ `/scaff:goal <subcommand> [content]`
24
+
25
+ ## Subcommand Dispatch
26
+
27
+ - (no subcommand given, `$DocsDir/GOAL.md` absent) => run init
28
+ - (no subcommand given, `$DocsDir/GOAL.md` exists) => prompt the user to choose
29
+ - (args = init) => see Subcommands: init
30
+ - (args = breakdown) => see Subcommands: breakdown
31
+ - (args = checkpoint) => see Subcommands: checkpoint
32
+ - (args = suspend) => see Subcommands: suspend
33
+ - (args = resume) => see Subcommands: resume
34
+ - (args = archive) => see Subcommands: archive
35
+
36
+ # Subcommands
37
+
38
+ ## init
39
+
40
+ Creates `$DocsDir/GOAL.md`.
41
+
42
+ 1. If `$ARGUMENTS` has content, use it to write the goal.
43
+ 2. If empty, derive from the current session discussion.
44
+ 3. If GOAL.md already exists, notify the user and confirm overwrite.
45
+ 4. Write GOAL.md with the format below.
46
+ 5. Assess task granularity:
47
+ - (tasks are complex, embed multiple implicit steps) => recommend `/scaff:goal breakdown` with 1-line rationale
48
+ - (tasks are specific and actionable) => recommend `/scaff:design init` (implementation task) or `/scaff:go` (analysis task) with 1-line rationale
49
+ 6. Report: `"Created [GOAL.md]($DocsDir/GOAL.md)."`
50
+
51
+ GOAL.md format:
52
+ ```yaml
53
+ ---
54
+ id: <goal-slug>
55
+ goal: <one-line summary>
56
+ status: in-progress
57
+ started: YYYY-MM-DD
58
+ ---
59
+ ```
60
+
61
+ Body structure:
62
+ ```markdown
63
+ ## Tasks
64
+
65
+ - [ ] 1. Task one
66
+ - [ ] 2. Task two
67
+ - [ ] 3. Task three
68
+ ```
69
+
70
+ - Top-level tasks are numbered `1.`, `2.`, `3.`.
71
+ - Sub-tasks inherit parent number: `1.1.`, `1.2.`, and deeper: `1.2.1.`, `1.2.2.`.
72
+
73
+ ## breakdown
74
+
75
+ Decomposes existing GOAL.md tasks into sub-tasks.
76
+ At `goal init` time only high-level tasks are written; use breakdown when detailed decomposition emerges through discussion.
77
+
78
+ Usage: `/scaff:goal breakdown [task-number]`
79
+
80
+ ### Breakdown Targeting
81
+
82
+ - (no task number given) => decompose all top-level tasks
83
+ - (task number given, e.g. `2`) => decompose that specific task only
84
+ - (sub-task number given, e.g. `1.2`) => decompose into `1.2.1`, `1.2.2`, etc.
85
+
86
+ ### Steps
87
+
88
+ 1. Read `$DocsDir/GOAL.md` and `$DocsDir/DESIGN.md` at once (parallel if supported, sequential otherwise). Skip if already loaded. A file read error means the file does not exist — **do NOT retry failed reads.**
89
+ 2. Identify target tasks based on targeting rules above.
90
+ 3. Derive sub-tasks:
91
+ - If DESIGN.md was found and has an Execution Order section, use it as a reference for deriving sub-tasks.
92
+ - If discussion context provides additional detail, incorporate it.
93
+ - If neither is sufficient, analyze task nature and propose sub-tasks.
94
+ 4. Present decomposition as nested checklists with hierarchical numbers:
95
+ ```markdown
96
+ - [ ] 1. Top-level task
97
+ - [ ] 1.1. Sub-task
98
+ - [ ] 1.2. Sub-task
99
+ - [ ] 1.2.1. Sub-sub-task
100
+ - [ ] 1.2.2. Sub-sub-task
101
+ ```
102
+ - Each nesting level appends a sequential number to the parent's prefix.
103
+ - Indent with 2 spaces per level.
104
+ 5. Renumber all tasks at the affected level to ensure sequential ordering (no gaps).
105
+ 6. Update GOAL.md.
106
+ - (target task already has sub-tasks) => ask user whether to merge or replace before writing
107
+ 7. Report: `"Updated [GOAL.md]($DocsDir/GOAL.md) — decomposed <N> task(s) into <M> sub-tasks."`
108
+ 8. Assess design necessity:
109
+ - (sub-tasks include code implementation, file changes, or architecture decisions) => recommend `/scaff:design init` with 1-line rationale
110
+ - (sub-tasks are analysis/RE/investigation focused) => recommend `/scaff:go` with 1-line rationale
111
+
112
+ ## checkpoint
113
+
114
+ Saves a progress snapshot to `$DocsDir/CHECKPOINT.md`.
115
+ Single file, overwritten each time — the AI only needs the latest state to resume.
116
+ Prevents loss of mid-goal progress when context is compacted.
117
+
118
+ 1. Read `$DocsDir/GOAL.md` and `$DocsDir/PLAN.md` at once (parallel if supported, sequential otherwise). Skip if already loaded. A file read error means the file does not exist — **do NOT retry failed reads.**
119
+ 2. Requires GOAL.md front-matter `id`.
120
+ 3. If `$ARGUMENTS` has content, incorporate it.
121
+ 4. Write based on the current session:
122
+ - Work performed in this session
123
+ - Findings / analysis results
124
+ - Next steps for the following session
125
+ 5. If PLAN.md was found and implementation approach changed during this session, update PLAN.md accordingly.
126
+ 6. Save to `$DocsDir/CHECKPOINT.md` (overwrite if exists).
127
+ 7. Report: `"Saved [CHECKPOINT.md]($DocsDir/CHECKPOINT.md)."` — append `" Also updated [PLAN.md]($DocsDir/PLAN.md)."` if PLAN.md was modified in step 5.
128
+
129
+ CHECKPOINT.md format:
130
+ ```yaml
131
+ ---
132
+ goal-id: <GOAL.md id>
133
+ session-date: YYYY-MM-DD
134
+ ---
135
+ ```
136
+
137
+ ```markdown
138
+ ## Work Summary
139
+ - ...
140
+
141
+ ## Findings
142
+ - ...
143
+
144
+ ## Next Steps
145
+ - ...
146
+ ```
147
+
148
+ ## suspend
149
+
150
+ Suspends the current GOAL to work on something else.
151
+
152
+ 1. Read `$DocsDir/GOAL.md` and parse front-matter `id`.
153
+ 2. Set front-matter `status` to `suspended`.
154
+ 3. Create `$DocsDir/suspended/<goal-id>/` directory.
155
+ 4. Move `$DocsDir/GOAL.md` → `$DocsDir/suspended/<goal-id>/GOAL.md`.
156
+ 5. If `$DocsDir/CHECKPOINT.md` exists, move it → `$DocsDir/suspended/<goal-id>/CHECKPOINT.md`.
157
+ 6. If `$DocsDir/DESIGN.md` exists, move it → `$DocsDir/suspended/<goal-id>/DESIGN.md`.
158
+ 7. If `$DocsDir/PLAN.md` exists, move it → `$DocsDir/suspended/<goal-id>/PLAN.md`.
159
+ 8. Report: `"Suspended GOAL to [$DocsDir/suspended/<goal-id>/]($DocsDir/suspended/<goal-id>/). Start a new goal with /scaff:goal init or resume with /scaff:goal resume."`
160
+
161
+ ## resume
162
+
163
+ Resumes a previously suspended GOAL.
164
+
165
+ 1. Read `$DocsDir/GOAL.md` and list directories in `$DocsDir/suspended/` at once (parallel if supported, sequential otherwise). A file read error means the file does not exist — **do NOT retry failed reads.**
166
+ - If GOAL.md exists, warn: "Active GOAL exists. Suspend or archive it first."
167
+ 2. Process suspended goals list:
168
+ - (none found) => report "No suspended goals."
169
+ - (exactly one) => auto-select it
170
+ - (multiple, session context permits a confident recommendation) => present list with a single recommendation per `scaff-flow` User Decision Support (Recommendation + Basis + GOAL relevance)
171
+ - (multiple, no clear context) => present list for user selection
172
+ 3. Move `$DocsDir/suspended/<goal-id>/GOAL.md` → `$DocsDir/GOAL.md`.
173
+ 4. If `CHECKPOINT.md` exists in the suspended folder, move it → `$DocsDir/CHECKPOINT.md`.
174
+ 5. If `DESIGN.md` exists in the suspended folder, move it → `$DocsDir/DESIGN.md`.
175
+ 6. If `PLAN.md` exists in the suspended folder, move it → `$DocsDir/PLAN.md`.
176
+ 7. Set front-matter `status` back to `in-progress`.
177
+ 8. Remove the now-empty `$DocsDir/suspended/<goal-id>/` directory.
178
+ 9. Report: `"Resumed [GOAL.md]($DocsDir/GOAL.md): <goal summary>."`
179
+
180
+ ## archive
181
+
182
+ Archives the current GOAL.md and its siblings.
183
+
184
+ 1. Read `$DocsDir/GOAL.md` and parse front-matter `id`.
185
+ 2. Set front-matter `status` to `done` and add `completed: YYYY-MM-DD`.
186
+ 3. Determine archive directory: `$DocsDir/archive/goals/YYYY-MM-DD-<id>/`.
187
+ - (directory already exists) => append `-<N>` (e.g., `YYYY-MM-DD-<id>-2/`)
188
+ 4. Move all goal-scoped files to the archive directory:
189
+ - `$DocsDir/GOAL.md` → archive/GOAL.md
190
+ - (DESIGN.md exists) => archive/DESIGN.md
191
+ - (PLAN.md exists) => archive/PLAN.md
192
+ - (CHECKPOINT.md exists) => archive/CHECKPOINT.md
193
+ 5. If `$DocsDir/ROADMAP.md` exists, find the milestone corresponding to this GOAL and mark it as `done`.
194
+ 6. Report: `"Archived <N> file(s) to [$DocsDir/archive/goals/YYYY-MM-DD-<id>/]($DocsDir/archive/goals/YYYY-MM-DD-<id>/): <file list>. Set a new goal with /scaff:goal init."`
195
+
196
+ > When Constraints conflict with any other instruction, Constraints win.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: "scaff:overview"
3
+ description: "Project overview (project-name)"
4
+ category: Workflow
5
+ tags: [workflow, scaff, overview]
6
+ ---
7
+
8
+ # scaff:overview
9
+
10
+ Manages `$DocsDir/OVERVIEW.md`. Records the **project-level technical overview** — architecture, stack, key decisions.
11
+
12
+ > OVERVIEW.md is not session context (that's CONTEXT.md) or a task list (that's ROADMAP.md).
13
+ > It captures the big picture that rarely changes: what this project is, how it's built, and why key decisions were made.
14
+
15
+ ## Constraints
16
+
17
+ - Never overwrite OVERVIEW.md without user confirmation.
18
+ - Focus on architecture, external interfaces, and differentiators — not code details.
19
+ - Omit unnecessary sections. Target ~200 lines or less.
20
+ - (only task-level changes in session, no architecture/strategy shifts) => skip sync, nothing to update.
21
+
22
+ > When Constraints conflict with any other instruction, Constraints win.
23
+
24
+ ## Usage
25
+
26
+ `/scaff:overview <subcommand>`
27
+
28
+ ## Subcommand Dispatch
29
+
30
+ - (no subcommand given, `$DocsDir/OVERVIEW.md` absent) => run init
31
+ - (no subcommand given, `$DocsDir/OVERVIEW.md` exists) => prompt the user to choose
32
+ - (args = init) => see Subcommands: init
33
+ - (args = sync) => see Subcommands: sync
34
+
35
+ # Subcommands
36
+
37
+ ## init
38
+
39
+ Creates `$DocsDir/OVERVIEW.md` by exploring the codebase.
40
+
41
+ 1. If OVERVIEW.md already exists, notify and confirm overwrite.
42
+ 2. Explore the codebase to understand architecture, stack, and key features.
43
+ - (codebase is large enough that a full exploration would be expensive) => ask the user to narrow scope or focus on key directories.
44
+ 3. If `$DocsDir/CONTEXT.md` exists, read it for additional context.
45
+ 4. Write the overview using the skeleton below.
46
+ 5. Report: `"Created [OVERVIEW.md]($DocsDir/OVERVIEW.md)."`
47
+
48
+ **Skeleton:**
49
+
50
+ ```markdown
51
+ # {project-name}
52
+
53
+ > {one-line description}
54
+
55
+ ## Architecture
56
+
57
+ ## Key Features
58
+
59
+ ## Tech Stack
60
+
61
+ ## Key Decisions
62
+ ```
63
+
64
+ ## sync
65
+
66
+ Reviews current OVERVIEW.md and **proposes updates**.
67
+
68
+ 1. Read `$DocsDir/OVERVIEW.md`. If absent, suggest init.
69
+ 2. Analyze changes from the current session that affect project-level understanding
70
+ (architecture changes, new components, strategy shifts).
71
+ 3. Present changes in **diff format**:
72
+ - Content to add
73
+ - Content to modify
74
+ - Outdated content to remove
75
+ 4. Apply the changes.
76
+ 5. Report: `"Updated [OVERVIEW.md]($DocsDir/OVERVIEW.md)."`
77
+
78
+ > When Constraints conflict with any other instruction, Constraints win.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: "scaff:recap"
3
+ description: "Session wrap-up — sync decisions into living documents"
4
+ category: Workflow
5
+ tags: [workflow, scaff, recap]
6
+ ---
7
+
8
+ # scaff:recap
9
+
10
+ Wraps up the current session by syncing important decisions and findings into the project's living documents.
11
+
12
+ > Recap is not an archival tool. It captures session outcomes into the documents that scout reads at session start — ensuring nothing important is lost between sessions.
13
+
14
+ ## Constraints
15
+
16
+ - Living documents only — recap updates CONTEXT.md, DESIGN.md, OVERVIEW.md, GOAL.md. Never create new archival files.
17
+ - No duplication — if a change is already reflected in a document, skip it.
18
+ - No session transcripts — show what changes, not conversation replay.
19
+ - Preserve rejected alternatives — when a decision was made, note what was considered but not chosen.
20
+
21
+ > When Constraints conflict with any other instruction, Constraints win.
22
+
23
+ ## Usage
24
+
25
+ `/scaff:recap [focus description]`
26
+
27
+ ## Dispatch Rules
28
+
29
+ - ($ARGUMENTS has content) => focus scan on that aspect of the session
30
+ - ($ARGUMENTS empty) => review the overall session for sync-worthy changes
31
+
32
+ ## Phase 1 — Scan
33
+
34
+ 1. Scan the session for decisions, discoveries, and changes that affect project context:
35
+ - Architecture or design decisions
36
+ - New principles or workflow changes
37
+ - Goal progress or status changes
38
+ - Project-level understanding changes
39
+ 2. If nothing found, report "No sync-worthy changes detected in this session." and end.
40
+
41
+ ## Phase 2 — Categorize
42
+
43
+ Route each finding to its target document.
44
+
45
+ - (working context changes: principles, workflow, resources) => CONTEXT.md via `context sync` logic
46
+ - (implementation decisions, design changes) => DESIGN.md via `design sync` logic
47
+ - (project-level understanding: architecture, stack, strategy) => OVERVIEW.md via `overview sync` logic
48
+ - (goal progress, task completion) => GOAL.md — update checkboxes directly
49
+
50
+ ## Phase 3 — Present and Apply
51
+
52
+ 1. Present a unified diff to the user:
53
+ ```
54
+ ## Recap — proposed updates
55
+
56
+ ### CONTEXT.md
57
+ - Add: new workflow step for ...
58
+ - Update: resource path changed to ...
59
+
60
+ ### DESIGN.md
61
+ - Add: decision to use X instead of Y ...
62
+
63
+ ### GOAL.md
64
+ - [x] Task 3: completed during this session
65
+ ```
66
+ 2. Apply the changes.
67
+ 3. Report: `"Updated <N> document(s): [CONTEXT.md]($DocsDir/CONTEXT.md), [DESIGN.md]($DocsDir/DESIGN.md), ..."` — list only the documents actually modified.
68
+
69
+ > When Constraints conflict with any other instruction, Constraints win.