Skip to content

Commit b3501be

Browse files
committed
edit
1 parent a470b84 commit b3501be

24 files changed

Lines changed: 1743 additions & 102 deletions

commands/critic-d.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,26 @@ Document:
5252
- Security considerations
5353
- Required refactoring before implementation
5454
- Performance implications (latency, memory, storage)
55+
- Question architectural choices for future development,deployment, propose better alternatives to the plan's approach if they match the project's and feature's fundementals.
56+
- if any near future requirements are in your context regarding codebase, use them to show better alternative approaches too. But explicitylu state that they are better in the future context only.
57+
- Don't just patch the plan — question whether the plan's assumptions are correct.
58+
5559

5660
Rate each risk (severity) as: Low/Medium/High
57-
For each Medium/High risk, suggest three levels of mitigation : a quick fix, a robust fix, and a long-term fix. and for robust fix add a subfield called "why this is robust:" and for long term fix add a subfield called "why this is long term effective:"
61+
For each Medium/High risk, suggest three levels of mitigation :
62+
- a quick fix,
63+
- a robust fix
64+
- a long-term fix.
65+
for robust fix add a subfield called "why this is robust:" and for long term fix add a subfield called "why this is long term effective:"
66+
5867
Each Item should have impact field (possible effects of this Risk Item ), ELI10 field (non technical explanaition),| NoobEng field(explaining like explaining to a noob for engineer who doesnt understand the underlying dynamics)
5968

6069
Analyze how this feature will interact with the existing codebase:
6170

6271
1. Read all relevant module interfaces and implementations
6372
2. Create critic.md in relevant devdocs folder (same folder as our step by step plan file )
6473

74+
6575
----
6676

6777
But this prompt is too generic — it doesn't account for the specifics of the current task.

commands/devdocs-archivist.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# /devdocs-archivist — DevDocs Archive Collector
2+
3+
Scan all devdocs, compare each folder and file against the codebase and current context, and determine what should be archived. The archivist is conservative — it only archives work that is done, understanding documents that have already been consumed into plans, and alternative approaches that were not chosen.
4+
5+
## Additional Input/Instructions
6+
7+
$ARGUMENTS
8+
9+
---
10+
11+
## Instructions
12+
13+
### Step 1: Scan
14+
15+
Read every folder and file under `devdocs/`, excluding:
16+
- `devdocs/archive/` — already archived
17+
- `devdocs/*/future/` — planned work, never archive candidates
18+
- `devdocs/roadmaps/` — always active reference material
19+
- `devdocs/archaeology/` — always active (unless explicitly told to archive old traces)
20+
21+
For each folder and file, build an understanding of:
22+
- What work or understanding does this document describe?
23+
- What is the current state of that work in the codebase?
24+
- Does any other active (non-archive) devdoc reference this document?
25+
26+
### Step 2: Classify Each Item
27+
28+
For each folder/file, determine one of three verdicts:
29+
30+
**ARCHIVE** — The work described is done (reflected in the codebase) OR the document's understanding has been consumed into a plan/implementation and is no longer needed in active context.
31+
32+
**KEEP** — The work is not done, OR the document contains knowledge still relevant to active work, OR another active document references it.
33+
34+
**KEEP (reference hold)** — The work is done, but another active document references it. It stays until the referencing document is also ready to archive. Then both move together.
35+
36+
### Step 3: Handle Edge Cases
37+
38+
**Archive as a unit, not per-file.** When a folder's work is done, archive the ENTIRE folder — desc.md, plan, critic, sensemaking, all of it. They form a coherent unit of completed work and should stay together.
39+
40+
**Exception — orphaned alternatives.** Sometimes multiple approaches are explored for the same work (e.g., two different sensemaking analyses, two plan versions). If only one was used and the others are alternatives for the SAME completed work, archive them together with the used one. However, if an unused alternative is actually a separate idea/enhancement that could still be relevant independently, it stays.
41+
42+
**Cross-reference integrity.** Before archiving any item, check: does any ACTIVE (non-archive candidate) document reference it? If yes, the item stays until the referencing document is also an archive candidate.
43+
44+
### Step 4: Determine Archive Paths
45+
46+
Each archive run creates its own folder using a timestamp:
47+
48+
```
49+
devdocs/archive/run_YYYY_MM_DD_HH_MM_SS/
50+
```
51+
52+
Inside this run folder, each archived item gets a dated folder with its origin path:
53+
54+
```
55+
devdocs/archive/run_2026_04_01_15_38_12/
56+
├── 2026-04-01_scoped_feat_12_auth/ ← was devdocs/scoped/feat_12_auth/
57+
├── 2026-04-01_ideas_scorer_model/ ← was devdocs/ideas/scorer_model/
58+
└── 2026-04-01_clarifications_oauth2/ ← was devdocs/clarifications/oauth2.md
59+
```
60+
61+
The naming convention: `{date}_{origin_path_underscored}/`. This makes each archived item searchable by date and traceable back to where it came from. No collisions, fully recoverable.
62+
63+
### Step 5: Execute or Document
64+
65+
**Default behavior (no flags):** Present the full archive plan to the user — list every item with its verdict (ARCHIVE/KEEP), reasoning, and destination path. Ask for confirmation before moving anything.
66+
67+
**With `-doc` flag:** Do NOT move any files. Instead, create a markdown report at `devdocs/archive_report_YYYY_MM_DD.md` documenting the full analysis:
68+
69+
For each folder/file in devdocs:
70+
71+
```markdown
72+
### devdocs/scoped/feat_12_auth/
73+
74+
**Verdict:** ARCHIVE
75+
**Reason:** All described changes are reflected in the codebase. Auth token refresh, session management, and OAuth2 integration are implemented and tested. No active documents reference this folder.
76+
**Archive path:** devdocs/archive/run_2026_04_01_15_38_12/2026-04-01_scoped_feat_12_auth/
77+
78+
---
79+
80+
### devdocs/ideas/event_driven_architecture/
81+
82+
**Verdict:** KEEP
83+
**Reason:** The exploration is ongoing. No implementation exists in the codebase. The sensemaking analysis is still being referenced by devdocs/roadmaps/system_redesign/map.md.
84+
85+
---
86+
87+
### devdocs/clarifications/oauth2_grant_types.md
88+
89+
**Verdict:** ARCHIVE
90+
**Reason:** This understanding was consumed into devdocs/scoped/feat_12_auth/desc.md and step_by_step_impl_plan.md. The auth feature is complete. No other active document references this clarification.
91+
**Archive path:** devdocs/archive/run_2026_04_01_15_38_12/2026-04-01_clarifications_oauth2_grant_types/
92+
```
93+
94+
---
95+
96+
## Rules
97+
98+
1. **Staleness is inferred, not declared.** Check the codebase — "does the code reflect what this doc describes?" Do NOT rely on manual status fields or metadata tags.
99+
100+
2. **Archive as a unit.** When a folder's work is done, move the entire folder. Don't cherry-pick files from inside a folder unless they are genuinely unrelated to the folder's main work.
101+
102+
3. **Cross-references block archiving.** If an active doc references a done doc, the done doc stays. Both move together when both are ready.
103+
104+
4. **Be conservative.** When uncertain whether work is truly done, verdict is KEEP. False negatives (keeping something stale) are better than false positives (archiving something still needed).
105+
106+
5. **Never touch future/.** Items in any `future/` subfolder are planned work and are never archive candidates.
107+
108+
6. **Never touch roadmaps/ or archaeology/.** These are always-active reference material. Only archive old archaeology traces if explicitly told to.
109+
110+
7. **Each run is isolated.** Every archive execution creates a new `run_YYYY_MM_DD_HH_MM_SS/` folder. This means multiple runs don't collide, and each run is a recoverable unit — you can undo an entire run by moving its folder back.
111+
112+
---
113+
114+
## Output
115+
116+
**Without `-doc`:** Print the archive plan in the conversation. For each item: verdict, reasoning, archive path. Ask for confirmation, then move files.
117+
118+
**With `-doc`:** Create `devdocs/archive_report_YYYY_MM_DD.md` with the full analysis. Do NOT move any files. Print a summary in the conversation (how many items analyzed, how many ARCHIVE, how many KEEP, how many reference-held).

commands/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ commands=(
3030
dead-code-concepts.md
3131
roadmap.md
3232
overview-report.md
33+
devdocs-archivist.md
3334
)
3435

3536
for cmd in "${commands[@]}"; do
@@ -58,7 +59,7 @@ echo ""
5859
echo "Done. Installed ${#commands[@]} slash commands to $COMMANDS_DIR"
5960
echo "Done. Installed ${#hooks[@]} hooks to $HOOKS_DIR"
6061
echo ""
61-
echo "Slash commands: /elaborate, /task-desc, /task-plan, /critic, /critic-d, /sense-making, /arch-small-summary, /arch-intro, /arch-traces, /arch-top-improvements, /dead-code-index, /dead-code-concepts, /roadmap, /overview-report"
62+
echo "Slash commands: /elaborate, /task-desc, /task-plan, /critic, /critic-d, /sense-making, /arch-small-summary, /arch-intro, /arch-traces, /arch-top-improvements, /dead-code-index, /dead-code-concepts, /roadmap, /overview-report, /devdocs-archivist"
6263
echo ""
6364
echo "To activate the devdocs metadata hook, add this to .claude/settings.json:"
6465
echo ""

commands/overview-report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ Collect information from these sources for the given period:
3636
actually inspecting what changed in each modified file, No just reported on things you already have context.. your context is not full. RUN and an actual investigation of the diff. The right process is to git diff HEAD -- <file> for every file in the stat output and document what each change ...
3737

3838
**Devdocs artifacts** — scan `devdocs/` for files created or modified within the period:
39-
- `devdocs/enhancements/` — any step_by_step_plan.md, desc.md, critic.md files
39+
- `devdocs/scoped/` — any step_by_step_plan.md, desc.md, critic.md files
4040
- `devdocs/archaeology/` — traces, summaries, dead code indexes
4141
- `devdocs/roadmaps/` — any roadmap activity
42-
- `devdocs/fixes/` — any fix documentation
42+
- `devdocs/ideas/` — any fix documentation
4343
- Any other devdocs subfolders that have recent activity
4444

4545
**Conversation context** — if relevant context from recent conversation is available, incorporate it.

commands/smart-debug.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
okay we need a better structured understanding of current system in order to catch the main issue. And the way to do that is track the full process using logs. However a blind tracking and designating one issue and focusing on that is not enough. Becase spotted anamoly might be the reason of bigger error in the code.
4+
5+
First divide this operation which is not working properly (due to bug or wrong data etc) into the main steges. And for each stage identify relevant variables and logs that would validate things are okay or not.
6+
7+
then use the existing logs as well as structlog logs to compare and find at which stage error is coming from

commands/task-plan.md

Lines changed: 65 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,86 @@
1-
# /task-plan — Generate Step-by-Step Implementation Plan
1+
# /task-plan — (Two-Phase)
22

3-
Generate a detailed implementation plan for the feature described in the input. This plan becomes the single source of truth for execution.
3+
Generate a step a step implementation plan for given task desc
44

55
## Additional Input/Instructions
66

7-
87
$ARGUMENTS
98

109
## Instructions
1110

12-
### Step 0: Resolve Which Feature to Plan
11+
### Phase 0: Resolve Which task desc to base the implemenation plan (if it is not stated clearly and explicitly)
12+
13+
unless it is not clearly stated do this :
14+
Use your understanding of the already developed context or given Additional Input/Instructions (can be about codebase workspace, or past conversation regarding this topic etc) to interpret what is the relevant desc markdown file,
15+
16+
If multiple descs/tasks are referred in past recent messages (check last 4,5 messages) — present them as a numbered list and ask the user to confirm which one to create the implement the plan . Do NOT proceed until the user confirms.
17+
18+
**If only one task/desc exists** — show the user which plan you found and ask for a quick confirmation before proceeding.
19+
20+
1321

14-
Before generating anything, determine which feature description this plan is based on:
1522

16-
1. **If the input is a file path** — use that directly.
17-
2. **If the input is ambiguous or empty** — look at the project's existing `devdocs/` folder structure and scan for `desc.md` files. List every feature found with its name and path.
18-
3. **If multiple features exist** — present them as a numbered list and ask the user to confirm which one to plan for. Do NOT proceed until the user confirms.
19-
4. **If only one feature exists** — show the user which feature you found and ask for a quick confirmation before proceeding.
2023

21-
**Only after the user confirms**, continue to Step 1.
2224

23-
### Step 1: Read and Analyze
2425

25-
1. Read the confirmed `desc.md` file (or input) fully.
26-
2. Thoroughly read all relevant code files in the codebase to understand:
27-
- Existing patterns and conventions
28-
- Module interfaces and dependencies
29-
- Where the new code will live
30-
- What existing code will be touched
31-
3. Think deeply before writing. Use extended thinking to reason through the implementation.
32-
4. Create a `step_by_step_plan.md` in the same directory as the `desc.md` (no plan mode, i just need the .md).
26+
Phase 1:
27+
Understand the given task desc in detail. Understand what it tries to achieve by not just code but also using project context, or any bug/fix context as well.
3328

34-
## Output Format
29+
First think and understand all the steps that need to be done. Once it is clear and in harmony.
3530

36-
The `step_by_step_plan.md` must contain:
31+
Start creating step_by_step_impl_plan.md in same folder in such way:
3732

33+
34+
## Top-Level Structure
35+
Start the plan with these sections before any steps:
36+
37+
### What is the task
38+
One paragraph explaining WHAT we're trying to achieve and WHY.
39+
Not the steps — the intent.
40+
41+
### How this implementation moves toward desired state
42+
Explain how the series of changes transforms the current state
43+
into the desired state. The bridge between the problem (desc.md)
44+
and the solution (steps).
3845
### High-Level Summary
39-
Bullet-point overview of the implementation approach (5-10 bullets max). Someone should be able to read just this section and understand the plan.
4046

41-
### Full Implementation Plan
42-
For each step:
43-
- **Step N: [Title]**
44-
- What to do (specific files, functions, changes)
45-
- Why (rationale for this approach)
46-
- Dependencies (what must exist before this step)
47-
- Acceptance criteria (how to verify this step is done)
47+
A table with one row per step — step number, short description,
48+
and expected output. The reader should understand the full shape
49+
of the plan in 30 seconds.
50+
| Step | Description | Expected Output |
51+
|------|-------------|-----------------|
52+
| 1 | ... | ... |
53+
---
54+
55+
## Per-Step Structure
56+
57+
Each step has:
58+
59+
### Proposed changes
60+
61+
Freestyle explanation of what this step does. Can be long or
62+
short depending on complexity. Include file paths and code
63+
snippets where helpful.
64+
65+
### Output
66+
67+
What concretely exists after this step that didn't before.
68+
A new file, a changed column, a wired connection. Specific
69+
and verifiable.
70+
71+
### Safe in nature
72+
True or False. True means this step cannot break existing
73+
functionality. False means it touches existing behavior and
74+
requires care.
75+
76+
### Peripheral concepts
77+
What other concepts in the codebase this change touches.
78+
Listed inline, not one per line.
79+
Example: async_sessionmaker, Storage facade, tool closures, session lifecycle
80+
4881

49-
### Files to Modify/Create
50-
List every file that will be touched, with a one-line description of the change.
82+
### Hardness Lvl
83+
1 to 5. Sets expectations for complexity and review attention.
5184

52-
## Guidelines
5385

54-
- Be specific. "Update the API" is useless. "Add `POST /api/features` endpoint in `src/routes/features.ts`" is useful.
55-
- Follow existing codebase conventions — don't introduce new patterns unless necessary.
56-
- Order steps so each builds on the previous. No circular dependencies.
57-
- Keep the plan implementable in a single session where possible. If it's too large, note where to split.
86+
Create step_by_step_impl_plan.md in relevant devdocs folder (same folder as our desc files, probably under devdocs/scoped but it can be in other folders too )

commands/task-plan_old.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# /task-plan — Generate Step-by-Step Implementation Plan
2+
3+
Generate a detailed implementation plan for the feature described in the input. This plan becomes the single source of truth for execution.
4+
5+
## Additional Input/Instructions
6+
7+
8+
$ARGUMENTS
9+
10+
## Instructions
11+
12+
### Step 0: Resolve Which Feature to Plan
13+
14+
Before generating anything, determine which feature description this plan is based on:
15+
16+
1. **If the input is a file path** — use that directly.
17+
2. **If the input is ambiguous or empty** — look at the project's existing `devdocs/` folder structure and scan for `desc.md` files. List every feature found with its name and path.
18+
3. **If multiple features exist** — present them as a numbered list and ask the user to confirm which one to plan for. Do NOT proceed until the user confirms.
19+
4. **If only one feature exists** — show the user which feature you found and ask for a quick confirmation before proceeding.
20+
21+
**Only after the user confirms**, continue to Step 1.
22+
23+
### Step 1: Read and Analyze
24+
25+
1. Read the confirmed `desc.md` file (or input) fully.
26+
2. Thoroughly read all relevant code files in the codebase to understand:
27+
- Existing patterns and conventions
28+
- Module interfaces and dependencies
29+
- Where the new code will live
30+
- What existing code will be touched
31+
3. Think deeply before writing. Use extended thinking to reason through the implementation.
32+
4. Create a `step_by_step_plan.md` in the same directory as the `desc.md` (no plan mode, i just need the .md).
33+
34+
## Output Format
35+
36+
The `step_by_step_plan.md` must contain:
37+
38+
### High-Level Summary
39+
Bullet-point overview of the implementation approach (5-10 bullets max). Someone should be able to read just this section and understand the plan.
40+
41+
### Full Implementation Plan
42+
For each step:
43+
- **Step N: [Title]**
44+
- What to do (specific files, functions, changes)
45+
- Why (rationale for this approach)
46+
- Dependencies (what must exist before this step)
47+
- Acceptance criteria (how to verify this step is done)
48+
49+
### Files to Modify/Create
50+
List every file that will be touched, with a one-line description of the change.
51+
52+
## Guidelines
53+
54+
- Be specific. "Update the API" is useless. "Add `POST /api/features` endpoint in `src/routes/features.ts`" is useful.
55+
- Follow existing codebase conventions — don't introduce new patterns unless necessary.
56+
- Order steps so each builds on the previous. No circular dependencies.
57+
- Keep the plan implementable in a single session where possible. If it's too large, note where to split.

0 commit comments

Comments
 (0)