Skip to content

Commit bcdc3b7

Browse files
committed
edit
1 parent 5673d55 commit bcdc3b7

31 files changed

Lines changed: 896 additions & 1537 deletions

SUMMARY.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@
5252

5353
## Appendices
5454

55-
* [Appendix 1: New Project Prompts](content/APPENDIX1_NEW_PROJECT_PROMPTS.md)
56-
* [Appendix 2: From Existing Codebase Prompts](content/APPENDIX2_FROM_EXISTING_CODEBASE_PROMPTS.md)
57-
* [Appendix 9: AlignStack Slash Commands](src/APPENDIX9_ALIGNSTACK_SLASH_COMMANDS.md)
55+
* [Appendix 1: New Project Prompts](content/APPENDIX1_New_Project_Prompts.md)
56+
* [Appendix 2: From Existing Codebase Prompts](content/APPENDIX2_From_Existing_Codebase_Prompts.md)
57+
* [Appendix 8: AlignStack Slash Commands](src/APPENDIX8_Alignstack_Slash_Commands.md)
58+
* [Appendix 9: DevDocs Folder Convention](src/APPENDIX9_Devdocs_Folder_Convention.md)
5859

5960
## Additional Resources
6061

commands/arch-intro.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ $ARGUMENTS
1919

2020
4. Be honest — if the architecture is inconsistent, messy, or in transition, say so. If patterns are partially applied, note it.
2121

22+
### Metadata
23+
24+
When saving to a file, insert a metadata header at the very top by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
25+
26+
```
27+
---
28+
created: YYYY-MM-DD
29+
branch: <current branch>
30+
base_commit: <short HEAD commit>
31+
author: <git user.name>
32+
---
33+
```
34+
2235
### Output
2336

2437
**If `--save` is passed as an argument:**

commands/arch-small-summary.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ $ARGUMENTS
2121

2222
4. Be honest about the state of things — if something looks half-built, say so. If something looks abandoned, note it.
2323

24+
### Metadata
25+
26+
When saving to a file, insert a metadata header at the very top by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
27+
28+
```
29+
---
30+
created: YYYY-MM-DD
31+
branch: <current branch>
32+
base_commit: <short HEAD commit>
33+
author: <git user.name>
34+
---
35+
```
36+
2437
### Output
2538

2639
**If `--save` is passed as an argument:**

commands/arch-top-improvements.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ $ARGUMENTS
1919

2020
4. Rank them by impact, highest first.
2121

22+
### Metadata
23+
24+
Before writing the file, insert a metadata header at the very top by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
25+
26+
```
27+
---
28+
created: YYYY-MM-DD
29+
branch: <current branch>
30+
base_commit: <short HEAD commit>
31+
author: <git user.name>
32+
---
33+
```
34+
2235
### Output
2336

2437
Write to `devdocs/archaeology/top_improvements.md` (create the directory if needed). If the file already exists, overwrite it completely — rewrite fresh, don't patch.

commands/arch-traces.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ Each trace file must contain:
3434
- **What feels vulnerable**
3535
- **What feels like bad design**
3636

37+
### Metadata
38+
39+
Insert a metadata header at the very top of each trace file by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
40+
41+
```
42+
---
43+
created: YYYY-MM-DD
44+
branch: <current branch>
45+
base_commit: <short HEAD commit>
46+
author: <git user.name>
47+
---
48+
```
49+
3750
### Output
3851

3952
Write trace files to `devdocs/archaeology/traces/` (create the directory if needed). If the folder already exists, overwrite all trace files completely — rewrite fresh, don't patch.

commands/critic-d.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ For each identified risk item, document:
6363
| **Affected areas** | Which existing features, modules, or endpoints are affected |
6464
| **Mitigation** (Medium/High only) | Three levels: quick fix, robust fix, long-term fix |
6565

66+
## Metadata
67+
68+
Before writing any file, insert a metadata header at the very top by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
69+
70+
```
71+
---
72+
created: YYYY-MM-DD
73+
branch: <current branch>
74+
base_commit: <short HEAD commit>
75+
author: <git user.name>
76+
---
77+
```
78+
79+
---
80+
6681
## Guidelines
6782

6883
- Be specific. "This might cause performance issues" is useless. "Adding a full table scan in `getUsers()` on a table with 100k+ rows will degrade response time from ~50ms to ~2s" is useful.

commands/critic.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,21 @@ Use the same output format (risk items with Severity, Impact, ELI5, Mitigation)
9090

9191
---
9292

93+
## Metadata
94+
95+
Before writing any file, insert a metadata header at the very top by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
96+
97+
```
98+
---
99+
created: YYYY-MM-DD
100+
branch: <current branch>
101+
base_commit: <short HEAD commit>
102+
author: <git user.name>
103+
---
104+
```
105+
106+
---
107+
93108
## Guidelines
94109

95110
- Be specific. "This might cause performance issues" is useless. "Adding a full table scan in `getUsers()` on a table with 100k+ rows will degrade response time from ~50ms to ~2s" is useful.

commands/elaborate.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,49 @@
11
# /elaborate — Rephrase for Alignment Verification
22

3-
Take the input below and rephrase it back to me — clearer, more structured, more understandable. Use your understanding of the codebase to interpret what I mean and fill in obvious gaps.
3+
Take the input below and rephrase it, clearer, more structured, more understandable. Use your understanding of the already developed context (can be about codebase workspace, or past conversation regarding this topic etc) to interpret what the input material means and fill in obvious gaps to make it more explicit.
4+
5+
If you dont have any developed relevant context output that the elaboration will be done without relevant context in pure way in terminal as a warning.
46

57
## Input
68

79
$ARGUMENTS
810

911
## Instructions
1012

11-
1. Parse the input. It can be:
12-
- **Raw text only** — notes, a ticket, a data dump, or a loose description.
13-
- **A file path only** — read the file and use its contents as the input.
14-
- **A file path + additional text** — read the file first, then treat the remaining text as extra context or instructions on top of the file contents. Both parts matter.
13+
1. Consume the input fully and correctly. It can be markdown, file path with code or text files, image paths, MCP links. if file path is given
1514

16-
If the input starts with something that looks like a file path (e.g. `devdocs/...`, `src/...`, or any path with `/`), attempt to read it as a file. Everything after the path is additional context.
15+
- if file path is given read the files fully. .
16+
- if file image or image paths are given consume the images
17+
- additional text or commands should be respected as well.
1718

18-
2. Use codebase context to understand what the user is referring to (existing modules, patterns, terminology).
19-
3. Rephrase the input in clear, precise language. Make it structured and easy to follow — organize scattered thoughts, group related ideas, clarify vague phrasing. Keep the user's intent intact, don't reshape it into a format they didn't ask for.
19+
2. If relevant, use codebase context to understand what the content is referring to (existing modules, patterns, terminology).
20+
3. Rephrase the input in clear, precise language. Make it structured and easy to follow — organize scattered thoughts, group related ideas, clarify vague phrasing. Keep the content's intent intact, don't reshape it into a format they didn't ask for.
2021
4. After the rephrased version, add:
21-
- **Ambiguities**: Anything that is unclear, has multiple interpretations, or needs a decision — list these explicitly.
22+
- **Ambiguities Section**: Anything that is unclear for you, has multiple interpretations, or needs a decision to make sense of the rest of the material — list these explicitly in form of questions
2223

2324
### Output
2425

25-
5. Save the output as markdown file(s). Split into multiple files if the input covers distinct topics or is large enough to warrant it.
26-
- **If the input was file path(s)** — save the elaborated output in the same folder as the input files.
27-
- **Otherwise** — save under `devdocs/clarifications/<suitable-name>/` (create the directory if needed, use a short descriptive name based on the content).
28-
6. Print the output in the conversation as well.
29-
7. End with: *"Does this capture what you meant? Correct anything that's off before we proceed."*
26+
output this in devdocs as elaboration.md where the input source material is located in devdocs already. If input was not in devdocs then you can use mkdir command to create a subfolder with relevant name and create it there
27+
28+
if the input covers distinct topics or is large enough to warrant it split into multiple files. But this is only needed if material is really huge and long. if this is the case under devdocs and relevant folder you can create elaboration folder and under it you can create multiple markdown files (use a short descriptive name based on the content).. But again, this is rare case.
29+
30+
## Metadata
31+
32+
Before writing any file, insert a metadata header at the very top by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
33+
34+
```
35+
---
36+
created: YYYY-MM-DD
37+
branch: <current branch>
38+
base_commit: <short HEAD commit>
39+
author: <git user.name>
40+
---
41+
```
42+
43+
---
3044

3145
## Purpose
3246

3347
The primary goal is to take messy, scattered input and make it tidy — structured, clear, and easy to read. As a side effect, this also serves as an alignment check: if the rephrased version doesn't match intent, it gets caught here rather than three steps later. Only flag ambiguities that actually matter for moving forward — don't nitpick.
48+
49+

commands/install.sh

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
#!/bin/bash
2-
# Install AlignStack slash commands for Claude Code
2+
# Install AlignStack slash commands and hooks for Claude Code
33
# Usage: curl -sL https://raw.githubusercontent.com/karaposu/alignstack/main/commands/install.sh | bash
44

55
set -e
66

7-
BASE_URL="https://raw.githubusercontent.com/karaposu/alignstack/main/commands"
8-
TARGET_DIR="$HOME/.claude/commands"
7+
REPO_URL="https://raw.githubusercontent.com/karaposu/alignstack/main"
8+
COMMANDS_DIR="$HOME/.claude/commands"
9+
HOOKS_DIR="$HOME/.claude/hooks"
910

10-
mkdir -p "$TARGET_DIR"
11+
mkdir -p "$COMMANDS_DIR"
12+
mkdir -p "$HOOKS_DIR"
13+
14+
# --- Slash Commands ---
15+
16+
echo "Installing slash commands..."
1117

1218
commands=(
1319
elaborate.md
@@ -24,9 +30,32 @@ commands=(
2430

2531
for cmd in "${commands[@]}"; do
2632
echo " downloading $cmd"
27-
curl -sL "$BASE_URL/$cmd" -o "$TARGET_DIR/$cmd"
33+
curl -sL "$REPO_URL/commands/$cmd" -o "$COMMANDS_DIR/$cmd"
2834
done
2935

36+
# --- Hooks ---
37+
38+
echo ""
39+
echo "Installing hooks..."
40+
41+
hooks=(
42+
devdocs_metadata_appender.sh
43+
)
44+
45+
for hook in "${hooks[@]}"; do
46+
echo " downloading $hook"
47+
curl -sL "$REPO_URL/hooks/$hook" -o "$HOOKS_DIR/$hook"
48+
chmod +x "$HOOKS_DIR/$hook"
49+
done
50+
51+
# --- Summary ---
52+
53+
echo ""
54+
echo "Done. Installed ${#commands[@]} slash commands to $COMMANDS_DIR"
55+
echo "Done. Installed ${#hooks[@]} hooks to $HOOKS_DIR"
56+
echo ""
57+
echo "Slash commands: /elaborate, /task-desc, /task-plan, /critic, /critic-d, /sense-making, /arch-small-summary, /arch-intro, /arch-traces, /arch-top-improvements"
58+
echo ""
59+
echo "To activate the devdocs metadata hook, add this to .claude/settings.json:"
3060
echo ""
31-
echo "Done. Installed ${#commands[@]} slash commands to $TARGET_DIR"
32-
echo "Available in Claude Code: /elaborate, /task-desc, /task-plan, /critic, /critic-d, /sense-making, /arch-small-summary, /arch-intro, /arch-traces, /arch-top-improvements"
61+
echo ' {"hooks":{"PreToolUse":[{"matcher":"Write","hooks":[{"type":"command","command":"~/.claude/hooks/devdocs_metadata_appender.sh"}]}]}}'

commands/sense-making.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@ $ARGUMENTS
1919

2020
3. Execute the full Structural Sensemaking process described below, producing all Sense Versions (SV1 through SV6).
2121

22-
4. Save the output as a markdown file:
22+
4. Before writing any file, insert a metadata header at the very top by running `git branch --show-current`, `git rev-parse --short HEAD`, and `git config user.name` to populate:
23+
24+
```
25+
---
26+
created: YYYY-MM-DD
27+
branch: <current branch>
28+
base_commit: <short HEAD commit>
29+
author: <git user.name>
30+
---
31+
```
32+
33+
5. Save the output as a markdown file:
2334
- **If the input was a file path** — save in the same folder as the input file.
2435
- **Otherwise** — save under `devdocs/sensemaking/<suitable-name>.md` (create the directory if needed).
2536

0 commit comments

Comments
 (0)