@oaklandzoo/ostup 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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +191 -0
  3. package/bin/cli.mjs +150 -0
  4. package/package.json +58 -0
  5. package/src/config.mjs +41 -0
  6. package/src/credential-prompts.mjs +117 -0
  7. package/src/env-loader.mjs +27 -0
  8. package/src/exec.mjs +78 -0
  9. package/src/mvp-flow.mjs +219 -0
  10. package/src/preflight.mjs +55 -0
  11. package/src/project-prompts.mjs +220 -0
  12. package/src/prompts.mjs +60 -0
  13. package/src/scaffold.mjs +112 -0
  14. package/src/steps/github.mjs +21 -0
  15. package/src/steps/ingest.mjs +121 -0
  16. package/src/steps/inject.mjs +22 -0
  17. package/src/steps/next-app.mjs +41 -0
  18. package/src/steps/protection.mjs +181 -0
  19. package/src/steps/vercel.mjs +46 -0
  20. package/src/substitute.mjs +44 -0
  21. package/src/summary.mjs +34 -0
  22. package/src/templates.mjs +41 -0
  23. package/src/update.mjs +26 -0
  24. package/templates/.claude/commands/bootstrap.md +111 -0
  25. package/templates/.claude/commands/create-prd.md +85 -0
  26. package/templates/.claude/commands/generate-tasks.md +74 -0
  27. package/templates/.claude/commands/prompt-end.md +129 -0
  28. package/templates/.claude/commands/prompt-mid.md +74 -0
  29. package/templates/.claude/commands/prompt-start.md +85 -0
  30. package/templates/.ostup-config.yml.example +10 -0
  31. package/templates/AGENTS.md +33 -0
  32. package/templates/CLAUDE.md +256 -0
  33. package/templates/HANDOFF.md +49 -0
  34. package/templates/README.md +15 -0
  35. package/templates/_gitignore +9 -0
  36. package/templates/docs/ARCHITECTURE.md +59 -0
  37. package/templates/docs/MANUAL_TASKS.md +20 -0
  38. package/templates/docs/PROJECT_STATE.md +41 -0
  39. package/templates/docs/SESSION_NOTES.md +29 -0
  40. package/templates/inputs/README.md +25 -0
  41. package/templates/inputs/images/.gitkeep +0 -0
  42. package/templates/inputs/notes/.gitkeep +0 -0
  43. package/templates/inputs/references/.gitkeep +0 -0
  44. package/templates/inputs/research/.gitkeep +0 -0
  45. package/templates/tasks/.gitkeep +0 -0
@@ -0,0 +1,85 @@
1
+ ---
2
+ description: Draft a PRD for a new feature. Asks 3-5 clarifying questions, then writes /tasks/prd-[feature-name].md.
3
+ ---
4
+
5
+ # Rule: Generating a Product Requirements Document (PRD)
6
+
7
+ ## Goal
8
+
9
+ To guide an AI assistant in creating a detailed Product Requirements Document (PRD) in Markdown format, based on an initial user prompt. The PRD should be clear, actionable, and suitable for a junior developer to understand and implement the feature.
10
+
11
+ ## Process
12
+
13
+ 1. **Receive Initial Prompt:** The user provides a brief description or request for a new feature or functionality.
14
+ 2. **Ask Clarifying Questions:** Before writing the PRD, the AI *must* ask only the most essential clarifying questions needed to write a clear PRD. Limit questions to 3-5 critical gaps in understanding. The goal is to understand the "what" and "why" of the feature, not necessarily the "how" (which the developer will figure out). Make sure to provide options in letter/number lists so I can respond easily with my selections.
15
+ 3. **Generate PRD:** Based on the initial prompt and the user's answers to the clarifying questions, generate a PRD using the structure outlined below.
16
+ 4. **Save PRD:** Save the generated document as `prd-[feature-name].md` inside the `/tasks` directory.
17
+
18
+ ## Clarifying Questions (Guidelines)
19
+
20
+ Ask only the most critical questions needed to write a clear PRD. Focus on areas where the initial prompt is ambiguous or missing essential context. Common areas that may need clarification:
21
+
22
+ * **Problem/Goal:** If unclear - "What problem does this feature solve for the user?"
23
+ * **Core Functionality:** If vague - "What are the key actions a user should be able to perform?"
24
+ * **Scope/Boundaries:** If broad - "Are there any specific things this feature *should not* do?"
25
+ * **Success Criteria:** If unstated - "How will we know when this feature is successfully implemented?"
26
+
27
+ **Important:** Only ask questions when the answer isn't reasonably inferable from the initial prompt. Prioritize questions that would significantly impact the PRD's clarity.
28
+
29
+ ### Formatting Requirements
30
+
31
+ - **Number all questions** (1, 2, 3, etc.)
32
+ - **List options for each question as A, B, C, D, etc.** for easy reference
33
+ - Make it simple for the user to respond with selections like "1A, 2C, 3B"
34
+
35
+ ### Example Format
36
+
37
+ ```
38
+ 1. What is the primary goal of this feature?
39
+ A. Improve user onboarding experience
40
+ B. Increase user retention
41
+ C. Reduce support burden
42
+ D. Generate additional revenue
43
+
44
+ 2. Who is the target user for this feature?
45
+ A. New users only
46
+ B. Existing users only
47
+ C. All users
48
+ D. Admin users only
49
+
50
+ 3. What is the expected timeline for this feature?
51
+ A. Urgent (1-2 weeks)
52
+ B. High priority (3-4 weeks)
53
+ C. Standard (1-2 months)
54
+ D. Future consideration (3+ months)
55
+ ```
56
+
57
+ ## PRD Structure
58
+
59
+ The generated PRD should include the following sections:
60
+
61
+ 1. **Introduction/Overview:** Briefly describe the feature and the problem it solves. State the goal.
62
+ 2. **Goals:** List the specific, measurable objectives for this feature.
63
+ 3. **User Stories:** Detail the user narratives describing feature usage and benefits.
64
+ 4. **Functional Requirements:** List the specific functionalities the feature must have. Use clear, concise language (e.g., "The system must allow users to upload a profile picture."). Number these requirements.
65
+ 5. **Non-Goals (Out of Scope):** Clearly state what this feature will *not* include to manage scope.
66
+ 6. **Design Considerations (Optional):** Link to mockups, describe UI/UX requirements, or mention relevant components/styles if applicable.
67
+ 7. **Technical Considerations (Optional):** Mention any known technical constraints, dependencies, or suggestions (e.g., "Should integrate with the existing Auth module").
68
+ 8. **Success Metrics:** How will the success of this feature be measured? (e.g., "Increase user engagement by 10%", "Reduce support tickets related to X").
69
+ 9. **Open Questions:** List any remaining questions or areas needing further clarification.
70
+
71
+ ## Target Audience
72
+
73
+ Assume the primary reader of the PRD is a **junior developer**. Therefore, requirements should be explicit, unambiguous, and avoid jargon where possible. Provide enough detail for them to understand the feature's purpose and core logic.
74
+
75
+ ## Output
76
+
77
+ * **Format:** Markdown (`.md`)
78
+ * **Location:** `/tasks/`
79
+ * **Filename:** `prd-[feature-name].md`
80
+
81
+ ## Final instructions
82
+
83
+ 1. Do NOT start implementing the PRD
84
+ 2. Make sure to ask the user clarifying questions
85
+ 3. Take the user's answers to the clarifying questions and improve the PRD
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Generate a stepwise task list from a PRD or requirements. Two-phase: parent tasks first, then sub-tasks after "Go".
3
+ ---
4
+
5
+ # Rule: Generating a Task List from User Requirements
6
+
7
+ ## Goal
8
+
9
+ To guide an AI assistant in creating a detailed, step-by-step task list in Markdown format based on user requirements, feature requests, or existing documentation. The task list should guide a developer through implementation.
10
+
11
+ ## Output
12
+
13
+ - **Format:** Markdown (`.md`)
14
+ - **Location:** `/tasks/`
15
+ - **Filename:** `tasks-[feature-name].md` (e.g., `tasks-user-profile-editing.md`)
16
+
17
+ ## Process
18
+
19
+ 1. **Receive Requirements:** The user provides a feature request, task description, or points to existing documentation
20
+ 2. **Analyze Requirements:** The AI analyzes the functional requirements, user needs, and implementation scope from the provided information
21
+ 3. **Phase 1: Generate Parent Tasks:** Based on the requirements analysis, create the file and generate the main, high-level tasks required to implement the feature. **IMPORTANT: Always include task 0.0 "Create feature branch" as the first task, unless the user specifically requests not to create a branch.** Use your judgement on how many additional high-level tasks to use. It's likely to be about 5. Present these tasks to the user in the specified format (without sub-tasks yet). Inform the user: "I have generated the high-level tasks based on your requirements. Ready to generate the sub-tasks? Respond with 'Go' to proceed."
22
+ 4. **Wait for Confirmation:** Pause and wait for the user to respond with "Go".
23
+ 5. **Phase 2: Generate Sub-Tasks:** Once the user confirms, break down each parent task into smaller, actionable sub-tasks necessary to complete the parent task. Ensure sub-tasks logically follow from the parent task and cover the implementation details implied by the requirements.
24
+ 6. **Identify Relevant Files:** Based on the tasks and requirements, identify potential files that will need to be created or modified. List these under the `Relevant Files` section, including corresponding test files if applicable.
25
+ 7. **Generate Final Output:** Combine the parent tasks, sub-tasks, relevant files, and notes into the final Markdown structure.
26
+ 8. **Save Task List:** Save the generated document in the `/tasks/` directory with the filename `tasks-[feature-name].md`, where `[feature-name]` describes the main feature or task being implemented (e.g., if the request was about user profile editing, the output is `tasks-user-profile-editing.md`).
27
+
28
+ ## Output Format
29
+
30
+ The generated task list _must_ follow this structure:
31
+
32
+ ```markdown
33
+ ## Relevant Files
34
+
35
+ - `path/to/potential/file1.ts` - Brief description of why this file is relevant (e.g., Contains the main component for this feature).
36
+ - `path/to/file1.test.ts` - Unit tests for `file1.ts`.
37
+ - `path/to/another/file.tsx` - Brief description (e.g., API route handler for data submission).
38
+ - `path/to/another/file.test.tsx` - Unit tests for `another/file.tsx`.
39
+ - `lib/utils/helpers.ts` - Brief description (e.g., Utility functions needed for calculations).
40
+ - `lib/utils/helpers.test.ts` - Unit tests for `helpers.ts`.
41
+
42
+ ### Notes
43
+
44
+ - Unit tests should typically be placed alongside the code files they are testing (e.g., `MyComponent.tsx` and `MyComponent.test.tsx` in the same directory).
45
+ - Use `npx jest [optional/path/to/test/file]` to run tests. Running without a path executes all tests found by the Jest configuration.
46
+
47
+ ## Instructions for Completing Tasks
48
+
49
+ **IMPORTANT:** As you complete each task, you must check it off in this markdown file by changing `- [ ]` to `- [x]`. This helps track progress and ensures you don't skip any steps.
50
+
51
+ Example:
52
+ - `- [ ] 1.1 Read file` → `- [x] 1.1 Read file` (after completing)
53
+
54
+ Update the file after completing each sub-task, not just after completing an entire parent task.
55
+
56
+ ## Tasks
57
+
58
+ - [ ] 0.0 Create feature branch
59
+ - [ ] 0.1 Create and checkout a new branch for this feature (e.g., `git checkout -b feature/[feature-name]`)
60
+ - [ ] 1.0 Parent Task Title
61
+ - [ ] 1.1 [Sub-task description 1.1]
62
+ - [ ] 1.2 [Sub-task description 1.2]
63
+ - [ ] 2.0 Parent Task Title
64
+ - [ ] 2.1 [Sub-task description 2.1]
65
+ - [ ] 3.0 Parent Task Title (may not require sub-tasks if purely structural or configuration)
66
+ ```
67
+
68
+ ## Interaction Model
69
+
70
+ The process explicitly requires a pause after generating parent tasks to get user confirmation ("Go") before proceeding to generate the detailed sub-tasks. This ensures the high-level plan aligns with user expectations before diving into details.
71
+
72
+ ## Target Audience
73
+
74
+ Assume the primary reader of the task list is a **junior developer** who will implement the feature.
@@ -0,0 +1,129 @@
1
+ ---
2
+ description: Close session. Rewrite HANDOFF.md. Append to SESSION_NOTES.md. Update other docs only if changed.
3
+ ---
4
+
5
+ # Session close
6
+
7
+ Execute in order. Do not skip.
8
+
9
+ ## Step 1: Verify all claimed deliverables exist
10
+
11
+ ```bash
12
+ git status --short
13
+ git diff --stat
14
+ ```
15
+
16
+ For every file you claimed to create or edit this session, confirm it exists with `ls` or `wc -l`. If anything is missing, declare error per CLAUDE.md Part 7 before continuing. Do not write a clean handoff over a dirty session.
17
+
18
+ ## Step 2: REWRITE HANDOFF.md (overwrite, not append)
19
+
20
+ `HANDOFF.md` is a single-page snapshot. Replace its contents entirely with the current state. Use this template:
21
+
22
+ ```markdown
23
+ # HANDOFF.md
24
+
25
+ > **READ THIS FIRST.** Single page. Current state only. Overwritten by `/prompt-end` every session.
26
+
27
+ ## Where we are right now
28
+
29
+ **Status:** <one-line current state>
30
+ **Last session ended:** <YYYY-MM-DD HH:MM>
31
+ **Branch:** <current branch>
32
+ **Working tree:** <clean | N dirty files>
33
+
34
+ ## What to do next
35
+
36
+ The very next action when the operator opens a session:
37
+
38
+ 1. <next action 1>
39
+ 2. <next action 2>
40
+ 3. <next action 3>
41
+
42
+ ## Active context
43
+
44
+ **Current objective:** <what we are building or fixing>
45
+
46
+ **In progress:**
47
+ - <task>: <status>
48
+
49
+ **Blocked on:**
50
+ - <blocker or "none">
51
+
52
+ **Decisions pending the operator input:**
53
+ - <question or "none">
54
+
55
+ ## Files I touched last session
56
+
57
+ - <path>: <why>
58
+
59
+ ## Don't forget
60
+
61
+ - <important reminder or "none">
62
+ ```
63
+
64
+ Save with: `cat > HANDOFF.md << 'EOF' ... EOF` or equivalent. Verify with `cat HANDOFF.md` after writing.
65
+
66
+ ## Step 3: Append to docs/SESSION_NOTES.md
67
+
68
+ Add a new entry at the TOP of the file (newest first):
69
+
70
+ ```markdown
71
+ ## YYYY-MM-DD HH:MM <session title>
72
+
73
+ **Objective:** <what the operator asked for>
74
+
75
+ **Done:**
76
+ - <deliverable>
77
+
78
+ **Files changed:**
79
+ - <path>: <reason>
80
+
81
+ **Decisions made:**
82
+ - <decision and why>
83
+
84
+ **Open threads:**
85
+ - <unfinished item>
86
+
87
+ **Next session should:**
88
+ - <specific action>
89
+
90
+ ---
91
+ ```
92
+
93
+ ## Step 4: Update docs/PROJECT_STATE.md ONLY IF priorities changed
94
+
95
+ Skip if priorities are identical to before. Don't churn this file.
96
+
97
+ ## Step 5: Update docs/MANUAL_TASKS.md if you hit a wall
98
+
99
+ Append any new human-only blockers:
100
+
101
+ ```markdown
102
+ - [ ] <task>, needed because <reason>, added <YYYY-MM-DD>
103
+ ```
104
+
105
+ ## Step 6: Print the close-out
106
+
107
+ ```
108
+ SESSION CLOSED
109
+
110
+ Files updated:
111
+ - HANDOFF.md (rewritten)
112
+ - docs/SESSION_NOTES.md (new entry appended)
113
+ - docs/PROJECT_STATE.md (touched: yes/no)
114
+ - docs/MANUAL_TASKS.md (touched: yes/no)
115
+
116
+ Files changed in repo:
117
+ <git diff --stat output>
118
+
119
+ Commit suggestion:
120
+ git add -A
121
+ git commit -m "<short summary of session>"
122
+
123
+ Next session: run /prompt-start. First action will be:
124
+ <first item from new HANDOFF.md>
125
+ ```
126
+
127
+ Do NOT run the commit yourself unless the operator explicitly says so.
128
+
129
+ Stop.
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Mid-session refocus. Check context budget, verify progress, restate plan.
3
+ ---
4
+
5
+ # Mid-session check
6
+
7
+ Execute in order.
8
+
9
+ ## Step 1: Context budget
10
+
11
+ Estimate context used so far. If >80% used, alert the operator immediately:
12
+
13
+ ```
14
+ WARNING: Context at <X>%. Approaching limit.
15
+ Recommend: /prompt-end now and start fresh session.
16
+ ```
17
+
18
+ If under 80%, continue.
19
+
20
+ ## Step 2: Restate where we are
21
+
22
+ Print:
23
+
24
+ ```
25
+ MID-SESSION CHECKPOINT
26
+
27
+ Original objective: <what the operator said at /prompt-start>
28
+
29
+ Done so far:
30
+ - <bullet 1>
31
+ - <bullet 2>
32
+
33
+ In progress:
34
+ - <current task>
35
+
36
+ Blocked on:
37
+ - <list, or "nothing">
38
+ ```
39
+
40
+ ## Step 3: Verify, do not assume
41
+
42
+ For every file you claim to have created or edited in this session:
43
+
44
+ ```bash
45
+ ls -la <file_path>
46
+ wc -l <file_path>
47
+ ```
48
+
49
+ If a file you claimed to write does not exist, declare an error per CLAUDE.md error protocol:
50
+
51
+ ```
52
+ STATEMENT OF ERROR: I claimed <file> was created. It does not exist.
53
+ ROOT CAUSE: <why>
54
+ CORRECTED INSTRUCTION: <what I'll do now>
55
+ PREVENTION: <how I'll avoid this next time>
56
+ ```
57
+
58
+ ## Step 4: Loop detection
59
+
60
+ If you have tried to fix the same bug 3+ times without progress, stop and print:
61
+
62
+ ```
63
+ LOOP DETECTED on: <issue>
64
+ Attempts: <count>
65
+ Recommend: the operator manually inspect, or change approach.
66
+ ```
67
+
68
+ ## Step 5: Confirm next step
69
+
70
+ ```
71
+ Continue with <next step>? Or pivot?
72
+ ```
73
+
74
+ Wait for confirmation before proceeding.
@@ -0,0 +1,85 @@
1
+ ---
2
+ description: Open a working session. Read HANDOFF, state where we are, ask for objective.
3
+ ---
4
+
5
+ # Session start
6
+
7
+ Execute these steps in order. Do not ask the operator anything until Step 7.
8
+
9
+ ## Step 1: Confirm rules are loaded
10
+
11
+ ```bash
12
+ cat CLAUDE.md
13
+ ```
14
+
15
+ You must internalize Parts 3 (Hard Rules), 4 (Reply Format), 5 (Style), 6 (Done), and 7 (Error Protocol) before proceeding.
16
+
17
+ ## Step 2: Read HANDOFF first
18
+
19
+ ```bash
20
+ cat HANDOFF.md
21
+ ```
22
+
23
+ This tells you where the last session ended and what comes next. It is the entry point.
24
+
25
+ ## Step 3: Check blockers
26
+
27
+ ```bash
28
+ cat docs/MANUAL_TASKS.md
29
+ ```
30
+
31
+ If there are active items, surface them. Some may block today's work.
32
+
33
+ ## Step 4: Working tree check
34
+
35
+ ```bash
36
+ git status --short
37
+ git branch --show-current
38
+ git log --oneline -3
39
+ ```
40
+
41
+ Note: dirty file count, current branch, last 3 commits.
42
+
43
+ ## Step 5: Optional sanity check
44
+
45
+ If `CLAUDE.md` Part 15 lists a build or typecheck command, run it. Surface any failure before proceeding. Skip if no command defined.
46
+
47
+ ## Step 6: Print the briefing
48
+
49
+ ```
50
+ SESSION OPEN
51
+
52
+ Project: <from CLAUDE.md Part 13>
53
+ Branch: <current>
54
+ Working tree: <clean | N dirty files>
55
+
56
+ WHERE WE ARE (from HANDOFF.md):
57
+ <one-line status>
58
+
59
+ LAST SESSION ENDED AT:
60
+ <HANDOFF.md "Last session ended" timestamp>
61
+
62
+ NEXT ACTIONS QUEUED (from HANDOFF.md):
63
+ 1. <action 1>
64
+ 2. <action 2>
65
+ 3. <action 3>
66
+
67
+ ACTIVE BLOCKERS (from MANUAL_TASKS.md):
68
+ - <blocker or "none">
69
+
70
+ GUARDRAILS ACTIVE
71
+ - Never claim done without testing
72
+ - Verify files exist before referencing
73
+ - No assuming, no training data: read current source
74
+ - Alert at 20% context
75
+ - Deliver downloadable files
76
+ - Destructive ops require explicit confirm
77
+ ```
78
+
79
+ ## Step 7: Ask the operator
80
+
81
+ ```
82
+ Proceed with queued actions, or different objective?
83
+ ```
84
+
85
+ Wait for response before doing anything else.
@@ -0,0 +1,10 @@
1
+ # Sample .ostup-config.yml. Rename or copy to `.ostup-config.yml` to drive
2
+ # non-interactive scaffolding via `ostup init --yes`.
3
+ #
4
+ # Precedence: CLI flags > this file > interactive prompts > defaults / TBD.
5
+
6
+ projectName: my-app # used for PROJECT_NAME and REPO_NAME tokens
7
+ purpose: A friendly thing that does X for Y # one-sentence description (fills PURPOSE / WHAT_WE_ARE_BUILDING_OR_FIXING / WHAT_LIVES_HERE)
8
+ owner: Mr. Goodshin # OWNER_OR_CLIENT
9
+ stack: Next.js + Supabase + Vercel # LANGUAGE / FRAMEWORK
10
+ deploy: https://my-app.example.com # DEPLOY_TARGET / LIVE_URL_OR_TBD (leave blank for TBD)
@@ -0,0 +1,33 @@
1
+ # Agents
2
+
3
+ This repo is set up to be driven by AI coding agents through the Ostup Agent Kit.
4
+
5
+ ## Quick links
6
+
7
+ - Repo: {{REPO_URL}}
8
+ - Deploy: {{DEPLOY_URL}}
9
+
10
+ ## Project facts
11
+
12
+ - Name: {{PROJECT_NAME}}
13
+ - Owner: {{OWNER_OR_CLIENT}}
14
+ - Stack: {{FRAMEWORK}}
15
+ - Purpose: {{PROJECT_PURPOSE_ONE_SENTENCE}}
16
+
17
+ ## Materials
18
+
19
+ Operator materials live in `{{INPUTS_PATH}}`. Read `{{INPUTS_PATH}}README.md` for the layout. If `{{INPUTS_PATH}}INGEST_MANIFEST.md` exists, read it before starting work.
20
+
21
+ ## How to work with this repo
22
+
23
+ 1. Open Claude Code from the repo root.
24
+ 2. Run `/prompt-start` to brief the agent on current state.
25
+ 3. Read `CLAUDE.md` for the full operating manual.
26
+ 4. Read `HANDOFF.md` to see where the last session left off.
27
+
28
+ ## Slash commands available
29
+
30
+ - `/bootstrap`, `/prompt-start`, `/prompt-mid`, `/prompt-end`
31
+ - `/create-prd`, `/generate-tasks`
32
+
33
+ See each file under `.claude/commands/` for details.