@orderful/droid 0.35.4 → 0.37.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/.claude-plugin/marketplace.json +6 -6
- package/CHANGELOG.md +36 -0
- package/README.md +34 -19
- package/dist/tools/brain/.claude-plugin/plugin.json +1 -1
- package/dist/tools/brain/TOOL.yaml +1 -1
- package/dist/tools/brain/commands/brain.md +3 -2
- package/dist/tools/brain/skills/brain/SKILL.md +35 -7
- package/dist/tools/brain/skills/brain/references/templates.md +61 -0
- package/dist/tools/brain/skills/brain/references/workflows.md +69 -4
- package/dist/tools/codex/.claude-plugin/plugin.json +2 -2
- package/dist/tools/codex/TOOL.yaml +2 -2
- package/dist/tools/codex/commands/codex.md +1 -1
- package/dist/tools/codex/skills/codex/SKILL.md +120 -329
- package/dist/tools/codex/skills/codex/references/reading-workflows.md +56 -0
- package/dist/tools/codex/skills/codex/references/review/prd.md +49 -0
- package/dist/tools/codex/skills/codex/references/review/workflow.md +40 -230
- package/dist/tools/comments/.claude-plugin/plugin.json +1 -1
- package/dist/tools/comments/TOOL.yaml +1 -1
- package/dist/tools/comments/skills/comments/SKILL.md +6 -4
- package/dist/tools/plan/.claude-plugin/plugin.json +1 -1
- package/dist/tools/plan/TOOL.yaml +1 -1
- package/dist/tools/plan/commands/plan.md +3 -1
- package/dist/tools/plan/skills/plan/SKILL.md +21 -9
- package/dist/tools/plan/skills/plan/references/workflows.md +57 -20
- package/dist/tools/tech-design/.claude-plugin/plugin.json +1 -1
- package/dist/tools/tech-design/TOOL.yaml +1 -1
- package/dist/tools/tech-design/skills/tech-design/SKILL.md +6 -4
- package/package.json +1 -1
- package/src/tools/brain/.claude-plugin/plugin.json +1 -1
- package/src/tools/brain/TOOL.yaml +1 -1
- package/src/tools/brain/commands/brain.md +3 -2
- package/src/tools/brain/skills/brain/SKILL.md +35 -7
- package/src/tools/brain/skills/brain/references/templates.md +61 -0
- package/src/tools/brain/skills/brain/references/workflows.md +69 -4
- package/src/tools/codex/.claude-plugin/plugin.json +2 -2
- package/src/tools/codex/TOOL.yaml +2 -2
- package/src/tools/codex/commands/codex.md +1 -1
- package/src/tools/codex/skills/codex/SKILL.md +120 -329
- package/src/tools/codex/skills/codex/references/reading-workflows.md +56 -0
- package/src/tools/codex/skills/codex/references/review/prd.md +49 -0
- package/src/tools/codex/skills/codex/references/review/workflow.md +40 -230
- package/src/tools/comments/.claude-plugin/plugin.json +1 -1
- package/src/tools/comments/TOOL.yaml +1 -1
- package/src/tools/comments/skills/comments/SKILL.md +6 -4
- package/src/tools/plan/.claude-plugin/plugin.json +1 -1
- package/src/tools/plan/TOOL.yaml +1 -1
- package/src/tools/plan/commands/plan.md +3 -1
- package/src/tools/plan/skills/plan/SKILL.md +21 -9
- package/src/tools/plan/skills/plan/references/workflows.md +57 -20
- package/src/tools/tech-design/.claude-plugin/plugin.json +1 -1
- package/src/tools/tech-design/TOOL.yaml +1 -1
- package/src/tools/tech-design/skills/tech-design/SKILL.md +6 -4
- package/dist/tools/codex/skills/codex/references/creating.md +0 -112
- package/dist/tools/codex/skills/codex/references/decisions.md +0 -124
- package/dist/tools/codex/skills/codex/references/loading.md +0 -292
- package/dist/tools/codex/skills/codex/references/topics.md +0 -215
- package/src/tools/codex/skills/codex/references/creating.md +0 -112
- package/src/tools/codex/skills/codex/references/decisions.md +0 -124
- package/src/tools/codex/skills/codex/references/loading.md +0 -292
- package/src/tools/codex/skills/codex/references/topics.md +0 -215
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# Creating New Projects
|
|
2
|
-
|
|
3
|
-
Detailed procedure for scaffolding new project entries in the codex.
|
|
4
|
-
|
|
5
|
-
## When to Use
|
|
6
|
-
|
|
7
|
-
- Starting work on a new feature/project
|
|
8
|
-
- `/codex new project {name}` command
|
|
9
|
-
- User asks to create a codex entry for something new
|
|
10
|
-
|
|
11
|
-
## Procedure
|
|
12
|
-
|
|
13
|
-
### 1. Determine Project Name
|
|
14
|
-
|
|
15
|
-
From user input:
|
|
16
|
-
- Use kebab-case: `transaction-templates`, `audit-logging`
|
|
17
|
-
- Should match how the team refers to the feature
|
|
18
|
-
|
|
19
|
-
### 2. Check for Existing Entry
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
ls {codex_repo}/projects/ | grep -i {name}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
If exists:
|
|
26
|
-
```
|
|
27
|
-
A project named '{name}' already exists. Did you mean to load it?
|
|
28
|
-
→ /codex search {name}
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### 3. Start Write Operation
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
droid config --get tools.codex | droid exec droid-codex git-start-write --config - --branch codex/new-{name}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
This runs the git preamble (ensures clean main + pulls latest) and creates the branch.
|
|
38
|
-
|
|
39
|
-
### 4. Create Project Directory and Copy Templates
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
mkdir -p {codex_repo}/projects/{name}
|
|
43
|
-
cp {codex_repo}/templates/PRD.md {codex_repo}/projects/{name}/
|
|
44
|
-
cp {codex_repo}/templates/TECH-DESIGN.md {codex_repo}/projects/{name}/
|
|
45
|
-
cp {codex_repo}/templates/DECISIONS.md {codex_repo}/projects/{name}/
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### 5. Update Frontmatter
|
|
49
|
-
|
|
50
|
-
In each file, update:
|
|
51
|
-
- `title`: Project name (Title Case)
|
|
52
|
-
- `created`: Today's date
|
|
53
|
-
- `updated`: Today's date
|
|
54
|
-
|
|
55
|
-
### 6. Optionally Pre-Fill Content
|
|
56
|
-
|
|
57
|
-
If user provides context, fill in what we know:
|
|
58
|
-
- PRD.md: Problem statement, goals if discussed
|
|
59
|
-
- TECH-DESIGN.md: Any architectural decisions mentioned
|
|
60
|
-
- DECISIONS.md: Leave as template (decisions come during impl)
|
|
61
|
-
|
|
62
|
-
### 7. Finish Write Operation
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
droid config --get tools.codex | droid exec droid-codex git-finish-write --config - \
|
|
66
|
-
--message "feat(codex): scaffold {name} project" \
|
|
67
|
-
--pr-title "New project: {name}" \
|
|
68
|
-
--pr-body "Scaffold for {name} project"
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
This commits, pushes, creates PR, and returns to main.
|
|
72
|
-
|
|
73
|
-
### 8. Confirm to User
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
✅ Created codex project: {name}
|
|
77
|
-
|
|
78
|
-
📁 {codex_repo}/projects/{name}/
|
|
79
|
-
├── PRD.md (template - fill in requirements)
|
|
80
|
-
├── TECH-DESIGN.md (template - fill in technical design)
|
|
81
|
-
└── DECISIONS.md (ready for decisions during implementation)
|
|
82
|
-
|
|
83
|
-
PR: {pr_url}
|
|
84
|
-
(Auto-merges for new projects)
|
|
85
|
-
|
|
86
|
-
Next steps:
|
|
87
|
-
1. Fill in PRD.md with product requirements
|
|
88
|
-
2. Fill in TECH-DESIGN.md with technical approach
|
|
89
|
-
3. Use `/codex decision` to capture decisions as you implement
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Example
|
|
93
|
-
|
|
94
|
-
**User:** `/codex new audit-logging`
|
|
95
|
-
|
|
96
|
-
**Result:**
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
✅ Created codex project: audit-logging
|
|
100
|
-
|
|
101
|
-
📁 ~/src/github.com/orderful-codex/projects/audit-logging/
|
|
102
|
-
├── PRD.md (template - fill in requirements)
|
|
103
|
-
├── TECH-DESIGN.md (template - fill in technical design)
|
|
104
|
-
└── DECISIONS.md (ready for decisions during implementation)
|
|
105
|
-
|
|
106
|
-
Next steps:
|
|
107
|
-
1. Fill in PRD.md with product requirements
|
|
108
|
-
2. Fill in TECH-DESIGN.md with technical approach
|
|
109
|
-
3. Use `/codex decision` to capture decisions as you implement
|
|
110
|
-
|
|
111
|
-
Want me to help fill in any of these based on what we've discussed?
|
|
112
|
-
```
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# Adding Decisions
|
|
2
|
-
|
|
3
|
-
Detailed procedure for capturing decisions during implementation.
|
|
4
|
-
|
|
5
|
-
## When to Use
|
|
6
|
-
|
|
7
|
-
- User explicitly asks to record a decision
|
|
8
|
-
- `/codex decision {text}` command
|
|
9
|
-
- During implementation when a significant choice is made
|
|
10
|
-
|
|
11
|
-
## Prerequisites
|
|
12
|
-
|
|
13
|
-
- **Active project** must be set (from previous `/codex search {project}` load)
|
|
14
|
-
- If no active project, prompt user to select one first
|
|
15
|
-
|
|
16
|
-
## Procedure
|
|
17
|
-
|
|
18
|
-
### 1. Verify Active Project
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
If no active project:
|
|
22
|
-
"No project is currently active. Which project should I add this decision to?"
|
|
23
|
-
→ List projects, let user pick
|
|
24
|
-
→ Set as active
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 2. Parse Decision Text
|
|
28
|
-
|
|
29
|
-
From the user's input, extract:
|
|
30
|
-
- **Summary:** Brief title for the decision
|
|
31
|
-
- **Context:** What situation prompted this?
|
|
32
|
-
- **Decision:** What was decided?
|
|
33
|
-
- **Rationale:** Why this choice?
|
|
34
|
-
|
|
35
|
-
If any parts are unclear, ask:
|
|
36
|
-
```
|
|
37
|
-
I'll add this decision. Can you clarify:
|
|
38
|
-
- What prompted this decision?
|
|
39
|
-
- Were there alternatives you considered?
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 3. Start Write Operation
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
droid config --get tools.codex | droid exec droid-codex git-start-write --config - --branch codex/decision-{short-summary}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### 4. Read and Update DECISIONS.md
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
cat {codex_repo}/projects/{active}/DECISIONS.md
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Append new decision at the end:
|
|
55
|
-
|
|
56
|
-
```markdown
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## {YYYY-MM-DD}: {Summary}
|
|
60
|
-
|
|
61
|
-
**Context:** {What situation prompted this decision?}
|
|
62
|
-
|
|
63
|
-
**Decision:** {What was decided?}
|
|
64
|
-
|
|
65
|
-
**Rationale:** {Why this choice over alternatives?}
|
|
66
|
-
|
|
67
|
-
**Alternatives Considered:**
|
|
68
|
-
- {Alternative 1} - {Why rejected}
|
|
69
|
-
- {Alternative 2} - {Why rejected}
|
|
70
|
-
|
|
71
|
-
**Consequences:**
|
|
72
|
-
- {Expected outcomes, trade-offs}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Update the `updated` field in frontmatter to today's date.
|
|
76
|
-
|
|
77
|
-
### 5. Finish Write Operation
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
droid config --get tools.codex | droid exec droid-codex git-finish-write --config - \
|
|
81
|
-
--message "decision({active}): {summary}" \
|
|
82
|
-
--pr-title "Decision: {summary}" \
|
|
83
|
-
--pr-body "{full decision text}"
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### 6. Confirm to User
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
✅ Added decision to {active}/DECISIONS.md:
|
|
90
|
-
"{summary}"
|
|
91
|
-
|
|
92
|
-
PR: {pr_url}
|
|
93
|
-
(Auto-merges for append-only changes)
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Example
|
|
97
|
-
|
|
98
|
-
**User:** `/codex decision "Using UUIDv7 for all new IDs because it's sortable and includes timestamp"`
|
|
99
|
-
|
|
100
|
-
**Active project:** transaction-templates
|
|
101
|
-
|
|
102
|
-
**Result appended to DECISIONS.md:**
|
|
103
|
-
|
|
104
|
-
```markdown
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## 2026-01-07: Using UUIDv7 for ID Generation
|
|
108
|
-
|
|
109
|
-
**Context:** Need to choose ID format for new transaction template records.
|
|
110
|
-
|
|
111
|
-
**Decision:** Use UUIDv7 for all new IDs.
|
|
112
|
-
|
|
113
|
-
**Rationale:** UUIDv7 is sortable (timestamp-based prefix) and includes creation timestamp, making it ideal for ordered data and debugging.
|
|
114
|
-
|
|
115
|
-
**Alternatives Considered:**
|
|
116
|
-
- UUIDv4 - Random, not sortable, no timestamp
|
|
117
|
-
- Auto-increment - Database-specific, exposes record count
|
|
118
|
-
- ULID - Similar benefits but less standard
|
|
119
|
-
|
|
120
|
-
**Consequences:**
|
|
121
|
-
- IDs will be longer than auto-increment (36 chars)
|
|
122
|
-
- Natural ordering by creation time
|
|
123
|
-
- No database sequence dependencies
|
|
124
|
-
```
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
# Loading Codex Entries
|
|
2
|
-
|
|
3
|
-
Detailed procedure for loading entries from the codex.
|
|
4
|
-
|
|
5
|
-
## Search and Match
|
|
6
|
-
|
|
7
|
-
**IMPORTANT:** Use the index file for fast lookups. This avoids expensive file-by-file searching.
|
|
8
|
-
|
|
9
|
-
1. **Get codex repo path** by running `droid config --get tools.codex` and parsing the JSON output
|
|
10
|
-
2. **Read the index file** at `{codex_repo}/index.yaml`:
|
|
11
|
-
```yaml
|
|
12
|
-
# index.yaml structure
|
|
13
|
-
projects:
|
|
14
|
-
partnership-automation:
|
|
15
|
-
title: "Partnership Automation & Sample Transaction Engine"
|
|
16
|
-
aliases: ["transaction-templates", "template-transactions"]
|
|
17
|
-
patterns:
|
|
18
|
-
jsdoc-config-directives:
|
|
19
|
-
title: "JSDoc @config Directives"
|
|
20
|
-
aliases: ["config-directives", "comment-directives"]
|
|
21
|
-
topics:
|
|
22
|
-
handlebars-template-security:
|
|
23
|
-
title: "Handlebars Template Security"
|
|
24
|
-
aliases: []
|
|
25
|
-
domains: {}
|
|
26
|
-
proposals: {}
|
|
27
|
-
```
|
|
28
|
-
3. **Match `{name}` against the index:**
|
|
29
|
-
- Check each entry's key (folder/file name)
|
|
30
|
-
- Check each entry's `aliases` array
|
|
31
|
-
- Match is case-insensitive and supports partial matching
|
|
32
|
-
- Example: "template transactions" matches `partnership-automation` via alias "template-transactions"
|
|
33
|
-
4. **Handle matches:**
|
|
34
|
-
- No matches → "No codex entry found for '{name}'. Did you mean one of these?" + suggest entries from index
|
|
35
|
-
- Single match → proceed to load from the matched category/path
|
|
36
|
-
- Multiple matches → show list with category, let user pick
|
|
37
|
-
|
|
38
|
-
**Fallback:** If `index.yaml` doesn't exist, fall back to directory scanning:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
ls {codex_repo}/projects/ | grep -i {name}
|
|
42
|
-
ls {codex_repo}/domains/ | grep -i {name}
|
|
43
|
-
# ... etc
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Loading a Project
|
|
47
|
-
|
|
48
|
-
Projects are folders with multiple files:
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
projects/transaction-templates/
|
|
52
|
-
├── PRD.md
|
|
53
|
-
├── TECH-DESIGN.md
|
|
54
|
-
├── DESIGN.md # Optional
|
|
55
|
-
├── CONTEXT.md # Auto-generated summary (progressive disclosure layer 1)
|
|
56
|
-
└── DECISIONS.md
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Progressive Disclosure
|
|
60
|
-
|
|
61
|
-
CONTEXT.md is the **first layer** - a synthesised summary that's enough for most queries. Only load full documents when deeper detail is needed.
|
|
62
|
-
|
|
63
|
-
| Layer | What | When to use |
|
|
64
|
-
| ----- | ----------------- | ------------------------------------------------------------ |
|
|
65
|
-
| 1 | CONTEXT.md (~2KB) | General questions, getting oriented, "what is this project?" |
|
|
66
|
-
| 2 | Specific file | Deep dives - "show me the full technical architecture" |
|
|
67
|
-
| 3 | All files | Comprehensive review, major updates, onboarding |
|
|
68
|
-
|
|
69
|
-
### Procedure
|
|
70
|
-
|
|
71
|
-
1. **List files** in project folder
|
|
72
|
-
2. **Check for CONTEXT.md:**
|
|
73
|
-
|
|
74
|
-
**If CONTEXT.md exists:**
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
📂 Loading transaction-templates
|
|
78
|
-
|
|
79
|
-
CONTEXT.md available (updated 2026-01-05, ~2KB)
|
|
80
|
-
→ Loading summary for general context...
|
|
81
|
-
|
|
82
|
-
[CONTEXT.md content]
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
Need more detail? Available files:
|
|
86
|
-
- PRD.md - Full requirements and goals
|
|
87
|
-
- TECH-DESIGN.md - Architecture and implementation
|
|
88
|
-
- DECISIONS.md - Decision log
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Load CONTEXT.md automatically. Only load additional files if user asks.
|
|
92
|
-
|
|
93
|
-
**If no CONTEXT.md:**
|
|
94
|
-
→ Trigger auto-generation (see below)
|
|
95
|
-
|
|
96
|
-
3. **Set project as active** for scoped operations
|
|
97
|
-
4. **Check freshness** (see below)
|
|
98
|
-
|
|
99
|
-
## Loading a Domain or Proposal
|
|
100
|
-
|
|
101
|
-
Domains and proposals are single files:
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
domains/partnerships.md
|
|
105
|
-
proposals/caching-layer.md
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
**Procedure:**
|
|
109
|
-
|
|
110
|
-
1. Read the file
|
|
111
|
-
2. Check freshness
|
|
112
|
-
3. Output content
|
|
113
|
-
|
|
114
|
-
## Loading a Pattern or Topic
|
|
115
|
-
|
|
116
|
-
Patterns and topics are single files:
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
patterns/api-design.md
|
|
120
|
-
topics/organization-hierarchy.md
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**Procedure:**
|
|
124
|
-
|
|
125
|
-
1. Read the file
|
|
126
|
-
2. Check freshness
|
|
127
|
-
3. Output content
|
|
128
|
-
|
|
129
|
-
## Auto-Generating CONTEXT.md
|
|
130
|
-
|
|
131
|
-
If loading a project and no CONTEXT.md exists, generate it immediately.
|
|
132
|
-
|
|
133
|
-
**User sees:**
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
📂 Loading transaction-templates
|
|
137
|
-
|
|
138
|
-
No CONTEXT.md found - generating summary from available artifacts...
|
|
139
|
-
|
|
140
|
-
Reading PRD.md...
|
|
141
|
-
→ Extracting problem statement, goals, success metrics
|
|
142
|
-
Reading TECH-DESIGN.md...
|
|
143
|
-
→ Extracting architecture overview, key decisions
|
|
144
|
-
Reading DECISIONS.md...
|
|
145
|
-
→ Extracting decision log summary
|
|
146
|
-
|
|
147
|
-
Synthesising unified context...
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
**Procedure:**
|
|
151
|
-
|
|
152
|
-
Generate CONTEXT.md either synchronously or asynchronously:
|
|
153
|
-
|
|
154
|
-
### Option A: Synchronous (works everywhere)
|
|
155
|
-
|
|
156
|
-
1. **Inform user:** "No CONTEXT.md found - generating summary from available artifacts"
|
|
157
|
-
2. **Read all available files:** PRD.md, TECH-DESIGN.md, DECISIONS.md
|
|
158
|
-
3. **Generate unified summary** (see template below)
|
|
159
|
-
4. **Create PR** (see git workflow below)
|
|
160
|
-
5. **Output the new CONTEXT.md** with "need more detail?" options
|
|
161
|
-
|
|
162
|
-
### Option B: Asynchronous (Claude Code only, optional)
|
|
163
|
-
|
|
164
|
-
1. **Spawn background agent** to synthesize CONTEXT.md (non-blocking):
|
|
165
|
-
```
|
|
166
|
-
Use Task tool with subagent_type: "general" and run_in_background: true
|
|
167
|
-
Prompt: "Generate CONTEXT.md for {project} from PRD.md, TECH-DESIGN.md, DECISIONS.md. Create branch, commit, open PR."
|
|
168
|
-
```
|
|
169
|
-
2. **Immediately ask user** which file to load (don't wait for synthesis)
|
|
170
|
-
3. **Load selected file** and continue working
|
|
171
|
-
4. **When background agent completes**, inform user: "CONTEXT.md ready - PR #{number}"
|
|
172
|
-
|
|
173
|
-
**Choose whichever approach works best.** Synchronous is simpler and works everywhere. Asynchronous avoids blocking but requires background agent support.
|
|
174
|
-
|
|
175
|
-
### CONTEXT.md Template
|
|
176
|
-
|
|
177
|
-
Generate a unified summary from the project files:
|
|
178
|
-
|
|
179
|
-
```markdown
|
|
180
|
-
---
|
|
181
|
-
title: { Project Name }
|
|
182
|
-
type: context
|
|
183
|
-
created: { today }
|
|
184
|
-
updated: { today }
|
|
185
|
-
confidence: high
|
|
186
|
-
source: implementation
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
# {Project Name} - Context
|
|
190
|
-
|
|
191
|
-
## Overview
|
|
192
|
-
|
|
193
|
-
{Synthesised from PRD problem statement + goals}
|
|
194
|
-
|
|
195
|
-
## Technical Approach
|
|
196
|
-
|
|
197
|
-
{Synthesised from TECH-DESIGN architecture + key decisions}
|
|
198
|
-
|
|
199
|
-
## Key Decisions
|
|
200
|
-
|
|
201
|
-
{Summarised from DECISIONS.md}
|
|
202
|
-
|
|
203
|
-
## Current Status
|
|
204
|
-
|
|
205
|
-
{Inferred from most recent updates}
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
_Auto-generated from PRD.md, TECH-DESIGN.md, and DECISIONS.md_
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Git Workflow for CONTEXT.md
|
|
213
|
-
|
|
214
|
-
After generating the CONTEXT.md content:
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
cd {codex_repo}
|
|
218
|
-
git checkout -b auto/context-{project-name}
|
|
219
|
-
# Write CONTEXT.md to projects/{project}/CONTEXT.md
|
|
220
|
-
git add projects/{project}/CONTEXT.md
|
|
221
|
-
git commit -F - <<EOF
|
|
222
|
-
feat: auto-generate CONTEXT.md for {project}
|
|
223
|
-
EOF
|
|
224
|
-
git push -u origin auto/context-{project-name}
|
|
225
|
-
gh pr create --title "Auto-generated CONTEXT.md for {project}" --body "Synthesised from PRD, TECH-DESIGN, and DECISIONS."
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
Then inform the user:
|
|
229
|
-
|
|
230
|
-
```
|
|
231
|
-
✅ CONTEXT.md created and PR #{number} opened
|
|
232
|
-
|
|
233
|
-
[Show CONTEXT.md content]
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
Need more detail? Available files:
|
|
237
|
-
- PRD.md - Full requirements and goals
|
|
238
|
-
- TECH-DESIGN.md - Architecture and implementation
|
|
239
|
-
- DECISIONS.md - Decision log
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
## Freshness Checking
|
|
243
|
-
|
|
244
|
-
After loading any file:
|
|
245
|
-
|
|
246
|
-
1. **Parse frontmatter** for `updated` date
|
|
247
|
-
2. **Calculate age:**
|
|
248
|
-
```
|
|
249
|
-
days_old = today - updated
|
|
250
|
-
```
|
|
251
|
-
3. **Check against threshold** (`freshness_days` from config, default 30):
|
|
252
|
-
- If `days_old > freshness_days`:
|
|
253
|
-
```
|
|
254
|
-
⚠️ This doc was last updated {updated} ({days_old} days ago).
|
|
255
|
-
Want me to verify it's still accurate?
|
|
256
|
-
```
|
|
257
|
-
4. **Check codebase changes** (if `codebase_paths` present):
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
cd {workspace}
|
|
261
|
-
git log --oneline --since="{updated}" -- {codebase_paths}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
- If commits found:
|
|
265
|
-
```
|
|
266
|
-
⚠️ Files in {paths} have changed since this doc was updated.
|
|
267
|
-
Recent commits: {list}
|
|
268
|
-
Want me to review for needed updates?
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
5. **Note confidence** (if `confidence: low`):
|
|
272
|
-
```
|
|
273
|
-
ℹ️ This was a quick exploration and may be incomplete.
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
## Output Format
|
|
277
|
-
|
|
278
|
-
After loading, output:
|
|
279
|
-
|
|
280
|
-
```
|
|
281
|
-
📚 Loaded: {category}/{name}
|
|
282
|
-
Updated: {updated} ({days_old} days ago)
|
|
283
|
-
Confidence: {confidence}
|
|
284
|
-
|
|
285
|
-
---
|
|
286
|
-
|
|
287
|
-
{file content}
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
{freshness warnings if any}
|
|
292
|
-
```
|