@wistantkode/dotfiles 1.7.0 → 1.7.2
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/CHANGELOG.md +19 -1
- package/cli/assets.mjs +6 -0
- package/cli/cli.mjs +28 -118
- package/cli/constants.mjs +29 -0
- package/cli/engine.mjs +34 -0
- package/cli/renderSignature.mjs +19 -0
- package/cli/renderlogo.mjs +12 -0
- package/cli/ui.mjs +14 -0
- package/data/LICENSE +201 -0
- package/data/github.sh +174 -0
- package/{gitignore → data/gitignore} +1 -0
- package/package.json +1 -1
- package/protocols/ASSIST.md +0 -66
- package/protocols/COMMIT.md +0 -90
- package/protocols/DOTFILES.md +0 -29
- package/protocols/INIT.md +0 -37
- package/protocols/PR.md +0 -50
- package/protocols/REFACTOR.md +0 -189
- package/protocols/RELEASE.md +0 -104
- package/protocols/RODIN.md +0 -43
- package/protocols/TEST.md +0 -42
- package/protocols/UI.md +0 -37
- package/protocols/_INDEX.md +0 -43
package/data/github.sh
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# ═══════════════════════════════════════════════════════════════════════
|
|
4
|
+
# GITHUB SYNC · Integrity Gate · @wistantkode/dotfiles
|
|
5
|
+
# ════════════════════════════════════════───────────────────────════════
|
|
6
|
+
|
|
7
|
+
# ── Color palette (Minimalist 256-color) ──────────────────────────────
|
|
8
|
+
RESET='\033[0m'; BOLD='\033[1m'; DIM='\033[2m'
|
|
9
|
+
WHITE='\033[38;5;255m'; GRAY='\033[38;5;244m'; DGRAY='\033[38;5;238m'
|
|
10
|
+
RED='\033[38;5;203m'; GREEN='\033[38;5;114m'; YELLOW='\033[38;5;221m'
|
|
11
|
+
BLUE='\033[38;5;75m'; CYAN='\033[38;5;117m'
|
|
12
|
+
|
|
13
|
+
# ── Table dimensions ──────────────────────────────────────────────────
|
|
14
|
+
HASH_W=8 # hash column display width
|
|
15
|
+
MSG_W=52 # message column display width
|
|
16
|
+
|
|
17
|
+
# ── Layout helpers ────────────────────────────────────────────────────
|
|
18
|
+
_rep() { printf "%${1}s" | tr ' ' "${2}"; }
|
|
19
|
+
_sep() { echo -e "${DGRAY}$(_rep 66 '─')${RESET}"; }
|
|
20
|
+
|
|
21
|
+
_logo() {
|
|
22
|
+
echo -e "\n ${WHITE}██████╗ ██╗████████╗██╗ ██╗██╗ ██╗██████╗ "
|
|
23
|
+
echo -e " ${WHITE}██╔════╝ ██║╚══██╔══╝██║ ██║██║ ██║██╔══██╗"
|
|
24
|
+
echo -e " ${WHITE}██║ ███╗██║ ██║ ███████║██║ ██║██████╔╝"
|
|
25
|
+
echo -e " ${WHITE}██║ ██║██║ ██║ ██╔══██║██║ ██║██╔══██╗"
|
|
26
|
+
echo -e " ${WHITE}╚██████╔╝██║ ██║ ██║ ██║╚██████╔╝██████╔╝"
|
|
27
|
+
echo -e " ${WHITE} ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ${RESET}"
|
|
28
|
+
echo -e "\n ${GRAY}${BOLD}[ GITHUB AUTOMATION SYNC ]${RESET}\n"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_header() {
|
|
32
|
+
printf " ${BOLD}${GRAY}%-${HASH_W}s %-${MSG_W}s${RESET}\n" "HASH" "COMMIT MESSAGE"
|
|
33
|
+
_sep
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_row() {
|
|
37
|
+
local hash msg
|
|
38
|
+
hash=$(printf "%-${HASH_W}s" "${1:0:$HASH_W}")
|
|
39
|
+
local raw="$2"
|
|
40
|
+
[ ${#raw} -gt $((MSG_W-1)) ] && raw="${raw:0:$((MSG_W-3))}..."
|
|
41
|
+
msg=$(printf "%-${MSG_W}s" "$raw")
|
|
42
|
+
printf " ${BLUE}%s${RESET} ${WHITE}%s${RESET}\n" "$hash" "$msg"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
_progress() {
|
|
46
|
+
local label="$1"
|
|
47
|
+
printf " ${GRAY}%-28s ${RESET}" "$label"
|
|
48
|
+
for ((i=1; i<=20; i++)); do
|
|
49
|
+
printf "${WHITE}·${RESET}"
|
|
50
|
+
sleep 0.015
|
|
51
|
+
done
|
|
52
|
+
printf " ${GREEN}✔${RESET}\n"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# ── Core utilities ────────────────────────────────────────────────────
|
|
56
|
+
abort() {
|
|
57
|
+
echo ""
|
|
58
|
+
_sep
|
|
59
|
+
echo -e " ${RED}${BOLD}✗ ABORTED${RESET} ${GRAY}$1${RESET}"
|
|
60
|
+
_sep
|
|
61
|
+
echo ""
|
|
62
|
+
exit 1
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
ask() {
|
|
66
|
+
echo -ne "\n ${WHITE}${BOLD}?${RESET} $1 ${GRAY}(y/N)${RESET} "
|
|
67
|
+
read -r _r
|
|
68
|
+
[[ "$_r" =~ ^([yY][eE][sS]|[yY])$ ]]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# ── Phase 0 · Silent data collection ─────────────────────────────────
|
|
72
|
+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) \
|
|
73
|
+
|| { echo -e "\n ${RED}✗${RESET} Not a git repository."; exit 1; }
|
|
74
|
+
|
|
75
|
+
REMOTE="origin/${CURRENT_BRANCH}"
|
|
76
|
+
COMMITS_RAW=$(git log "${REMOTE}..HEAD" --oneline 2>/dev/null)
|
|
77
|
+
COMMIT_COUNT=0
|
|
78
|
+
[ -n "$COMMITS_RAW" ] && COMMIT_COUNT=$(echo "$COMMITS_RAW" | wc -l | tr -d ' ')
|
|
79
|
+
|
|
80
|
+
LOCAL_ONLY_TAGS=$(
|
|
81
|
+
git log --tags --simplify-by-decoration --pretty="format:%D" 2>/dev/null \
|
|
82
|
+
| grep "tag: " \
|
|
83
|
+
| sed 's/.*tag: \([^,)]*\).*/\1/' \
|
|
84
|
+
| while read -r t; do
|
|
85
|
+
git ls-remote --tags origin 2>/dev/null | grep -q "refs/tags/$t" || echo "$t"
|
|
86
|
+
done | sort -u
|
|
87
|
+
)
|
|
88
|
+
TAG_COUNT=0
|
|
89
|
+
[ -n "$LOCAL_ONLY_TAGS" ] && TAG_COUNT=$(echo "$LOCAL_ONLY_TAGS" | grep -c .)
|
|
90
|
+
PUSH_TAGS=""
|
|
91
|
+
[ "$TAG_COUNT" -gt 0 ] && PUSH_TAGS="--follow-tags"
|
|
92
|
+
|
|
93
|
+
case "$CURRENT_BRANCH" in
|
|
94
|
+
main|master) BLABEL="${RED}${BOLD}⬡ PRODUCTION${RESET}" ;;
|
|
95
|
+
*) BLABEL="${GRAY}◈ BRANCH${RESET}" ;;
|
|
96
|
+
esac
|
|
97
|
+
|
|
98
|
+
# ── Phase 1 · Working tree check ─────────────────────────────────────
|
|
99
|
+
clear
|
|
100
|
+
_logo
|
|
101
|
+
_sep
|
|
102
|
+
echo ""
|
|
103
|
+
echo -e " ${WHITE}${BOLD}◆ INTEGRITY GATE${RESET} ${DGRAY}· Software Engineer${RESET}"
|
|
104
|
+
echo ""
|
|
105
|
+
|
|
106
|
+
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
|
|
107
|
+
echo ""
|
|
108
|
+
echo -e " ${YELLOW}${BOLD}⚠ DIRTY WORKING TREE${RESET}"
|
|
109
|
+
echo ""
|
|
110
|
+
git status -s | sed 's/^/ /'
|
|
111
|
+
abort "Stage and commit all changes before syncing."
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
# ── Phase 2 · Summary panel ───────────────────────────────────────────
|
|
115
|
+
printf " ${GRAY}%-12s${RESET} ${WHITE}${BOLD}%s${RESET} %b\n" "Branch" "$CURRENT_BRANCH" "$BLABEL"
|
|
116
|
+
printf " ${GRAY}%-12s${RESET} ${WHITE}%s${RESET} commit(s) ahead\n" "Ahead" "$COMMIT_COUNT"
|
|
117
|
+
printf " ${GRAY}%-12s${RESET} ${WHITE}%s${RESET} to publish\n" "Tags" "$TAG_COUNT"
|
|
118
|
+
echo ""
|
|
119
|
+
_sep
|
|
120
|
+
|
|
121
|
+
# Commits table
|
|
122
|
+
if [ "$COMMIT_COUNT" -gt 0 ]; then
|
|
123
|
+
echo ""
|
|
124
|
+
_header
|
|
125
|
+
while IFS= read -r line; do
|
|
126
|
+
h=$(echo "$line" | awk '{print $1}')
|
|
127
|
+
m=$(echo "$line" | cut -d' ' -f2-)
|
|
128
|
+
_row "$h" "$m"
|
|
129
|
+
done <<< "$COMMITS_RAW"
|
|
130
|
+
_sep
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Tags list
|
|
134
|
+
if [ "$TAG_COUNT" -gt 0 ]; then
|
|
135
|
+
echo ""
|
|
136
|
+
echo -e " ${GRAY}Unpublished tags:${RESET}"
|
|
137
|
+
while IFS= read -r tag; do
|
|
138
|
+
echo -e " ${GREEN}✔${RESET} ${WHITE}${BOLD}$tag${RESET}"
|
|
139
|
+
done <<< "$LOCAL_ONLY_TAGS"
|
|
140
|
+
_sep
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
# ── Phase 3 · Final confirmation ──────────────────────────────────────
|
|
144
|
+
echo ""
|
|
145
|
+
SUMMARY="${WHITE}${BOLD}${COMMIT_COUNT}${RESET} commit(s)"
|
|
146
|
+
[ "$TAG_COUNT" -gt 0 ] && SUMMARY+=" ${DGRAY}+${RESET} ${WHITE}${BOLD}${TAG_COUNT}${RESET} tag(s)"
|
|
147
|
+
printf " ${GRAY}%-12s${RESET} %b\n" "Will push" "$SUMMARY"
|
|
148
|
+
printf " ${GRAY}%-12s${RESET} ${BLUE}%s${RESET}\n" "Target" "$REMOTE"
|
|
149
|
+
echo ""
|
|
150
|
+
|
|
151
|
+
ask "Confirm push to remote?" || abort "Gate: push cancelled."
|
|
152
|
+
|
|
153
|
+
# ── Phase 4 · Projection ──────────────────────────────────────────────
|
|
154
|
+
echo ""
|
|
155
|
+
_sep
|
|
156
|
+
echo ""
|
|
157
|
+
_progress "Initializing sync"
|
|
158
|
+
_progress "Verifying state"
|
|
159
|
+
_progress "Final handoff"
|
|
160
|
+
echo ""
|
|
161
|
+
|
|
162
|
+
if git push --quiet $PUSH_TAGS; then
|
|
163
|
+
echo ""
|
|
164
|
+
_sep
|
|
165
|
+
echo ""
|
|
166
|
+
echo -e " ${GREEN}${BOLD}✔ SUCCESS${RESET} Infrastructure synchronized."
|
|
167
|
+
echo ""
|
|
168
|
+
_sep
|
|
169
|
+
else
|
|
170
|
+
echo ""
|
|
171
|
+
abort "Git push failed. Check connectivity."
|
|
172
|
+
fi
|
|
173
|
+
|
|
174
|
+
echo ""
|
package/package.json
CHANGED
package/protocols/ASSIST.md
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# MASTER OPERATING PROTOCOL (ASSIST.md)
|
|
2
|
-
|
|
3
|
-
1. **`RODIN.md`** : Engineering Philosophy (Socratic Audit, Anti-compliancy).
|
|
4
|
-
2. **`ASSIST.md`** : Operational System (Technical role, methodology).
|
|
5
|
-
3. **`_INDEX.md`** : Navigation map.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## ROLE DEFINITION
|
|
10
|
-
|
|
11
|
-
You are a **Technical Assistant & Engineering Partner**. You facilitate excellence and ensure architectural integrity.
|
|
12
|
-
|
|
13
|
-
- **Communication First** : Tu réponds toujours aux questions posées **AVANT** de commencer à coder. La communication prime sur l'exécution.
|
|
14
|
-
- **Integrity Guard** : Si une solution sous-optimale est proposée, challenge-la (`RODIN.md`).
|
|
15
|
-
- **Architect** : Quand tu produis du code ou de la config, applique les standards professionnels sans prendre d'initiatives non validées sur le périmètre.
|
|
16
|
-
- **Context-Aware** : Adapt your methodology to the project type (library, monorepo, CLI, web app).
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## OPERATIONAL MODES
|
|
21
|
-
|
|
22
|
-
### Systems & Backend
|
|
23
|
-
|
|
24
|
-
*Target: Any backend stack (NestJS, Express, FastAPI, Go, etc.), databases, CI/CD, infrastructure.*
|
|
25
|
-
|
|
26
|
-
- **Action**: Document architecture and data flows. Enforce atomicity and zero-trust.
|
|
27
|
-
- **Communication**: Educational. Always ask a verification question before any major mutation.
|
|
28
|
-
|
|
29
|
-
### Frontend & UI
|
|
30
|
-
|
|
31
|
-
*Target: Any frontend stack (React, Vue, Svelte, etc.) and design systems.*
|
|
32
|
-
|
|
33
|
-
- **Action**: Enforce high visual quality and clean implementation patterns.
|
|
34
|
-
- **Communication**: Concise, focused on rendering, accessibility, and UX coherence.
|
|
35
|
-
|
|
36
|
-
### DevOps & Tooling
|
|
37
|
-
|
|
38
|
-
*Target: Docker, GitHub Actions, shell scripts, environment configuration.*
|
|
39
|
-
|
|
40
|
-
- **Action**: Validate security, idempotency, and reliability of automation scripts.
|
|
41
|
-
- **Communication**: Step-by-step. Surface side effects before execution.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## METHODOLOGY (THE CYCLE)
|
|
46
|
-
|
|
47
|
-
1. **Ecosystem Audit** : Identify package manager, stack, and architecture.
|
|
48
|
-
2. **Protocol Sync** : Read the corresponding protocol via `_INDEX.md`.
|
|
49
|
-
3. **The Socratic Test** : Reformulate the request and challenge it if it lacks depth or clarity.
|
|
50
|
-
4. **Surgical Execution** : Provide complete, typed, and optimized code.
|
|
51
|
-
5. **Git Sealing** : Generate atomic commits according to `COMMIT.md`.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## REFERENCE CONVENTIONS
|
|
56
|
-
|
|
57
|
-
| Topic | Protocol |
|
|
58
|
-
| :--- | :--- |
|
|
59
|
-
| **Identity & Philosophy** | [RODIN.md](./RODIN.md) |
|
|
60
|
-
| **Commits** | [COMMIT.md](./COMMIT.md) |
|
|
61
|
-
| **Release** | [RELEASE.md](./RELEASE.md) |
|
|
62
|
-
| **Security** | [SECURITY.md](./SECURITY.md) |
|
|
63
|
-
| **Initialization** | [INIT.md](./INIT.md) |
|
|
64
|
-
| **Refactoring** | [REFACTOR.md](./REFACTOR.md) |
|
|
65
|
-
| **Testing** | [TEST.md](./TEST.md) |
|
|
66
|
-
| **Dotfiles Architecture** | [DOTFILES.md](./DOTFILES.md) |
|
package/protocols/COMMIT.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# CONVENTION DE COMMITS ATOMIQUES
|
|
2
|
-
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> **Activation de l'Agent :**
|
|
5
|
-
> Des que l'utilisateur entame une phase de commit, tu actives le **Rodin Audit**. Ta mission est de refuser tout commit "fourre-tout". Tu dois forcer la decomposition des changements en intentions logiques isolees.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
### Règle d'Or 1 : Zéro "git add ."
|
|
10
|
-
|
|
11
|
-
Il est **STRICTEMENT INTERDIT** d'utiliser `git add .` ou `git commit -a`.
|
|
12
|
-
Chaque modification doit être atomique. On ne mélange pas la logique métier (`core/`) et le style (`ui/`).
|
|
13
|
-
|
|
14
|
-
### Règle d'Or 2 : Isolation des Commits (STRICTE)
|
|
15
|
-
|
|
16
|
-
L'IA ne doit **JAMAIS** modifier ou inclure les fichiers de release (`package.json`, `CHANGELOG.md`, `pom.xml`, etc.) ni manipuler les `git tags` lors d'une phase de commit classique. Toute interaction avec le versioning est réservée **EXCLUSIVEMENT** au protocole `RELEASE.md`.
|
|
17
|
-
|
|
18
|
-
### Règle d'Or 3 : Zéro Initiative de Versioning
|
|
19
|
-
|
|
20
|
-
Si l'utilisateur demande un commit, fais uniquement le commit du code demandé. Ne propose pas de bump de version ou de mise à jour du changelog de ton propre chef. Ne prends aucune décision sur le périmètre de la tâche sans validation préalable.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## METHODOLOGIE : LE CYCLE ATOMIQUE
|
|
25
|
-
|
|
26
|
-
### PHASE 1 : L'AUDIT D'INTENTION (Silent)
|
|
27
|
-
|
|
28
|
-
1. **Status Check** : Examine `git status` et `git diff`.
|
|
29
|
-
2. **Identification des Motifs** : Pourquoi as-tu fait ces changements ?
|
|
30
|
-
3. **Partitionnement** : Separe les changements techniques (refactor, deps) des changements fonctionnels (feat, fix).
|
|
31
|
-
|
|
32
|
-
### PHASE 2 : L'INTERROGATION SOCRATIQUE
|
|
33
|
-
|
|
34
|
-
Si l'utilisateur semble vouloir tout commiter d'un coup, pose la question :
|
|
35
|
-
> *"Je vois des changements sur [Fichier A] et [Fichier B]. Sont-ils lies par une seule intention logique, ou devons-nous les separer en deux commits distincts pour preserver l'historique ?"*
|
|
36
|
-
|
|
37
|
-
### PHASE 3 : GROUPEMENT & STAGING CIBLE
|
|
38
|
-
|
|
39
|
-
1. **Selection** : Ajoute uniquement les fichiers lies au motif n°1.
|
|
40
|
-
2. **Commande** : `git add [fichiers specifiques]`.
|
|
41
|
-
3. **Verification** : Effectue un `git status` pour valider que seule l'intention n°1 est dans le buffer.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Format du Message
|
|
46
|
-
|
|
47
|
-
Chaque commit doit suivre strictement ce format :
|
|
48
|
-
|
|
49
|
-
```text
|
|
50
|
-
<type>(scope): <sujet>
|
|
51
|
-
|
|
52
|
-
[Corps explicite mais concis — réservé aux changements d'ampleur moyenne ou majeure]
|
|
53
|
-
|
|
54
|
-
[Footer]
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 1. Types Autorises
|
|
58
|
-
|
|
59
|
-
- `feat`: Nouvelle fonctionnalite (ajoute de la valeur utilisateur).
|
|
60
|
-
- `fix`: Correction de bug (repare quelque chose de casse).
|
|
61
|
-
- `ui`: Changement purement visuel (CSS, style, assets) sans impact logique.
|
|
62
|
-
- `refactor`: Reecriture de code (ni fix ni feat, ex: nettoyage, simplification).
|
|
63
|
-
- `perf`: Amelioration des performances.
|
|
64
|
-
- `docs`: Documentation uniquement.
|
|
65
|
-
- `test`: Ajout ou modification de tests.
|
|
66
|
-
- `chore`: Maintenance, build, dependances (pas de code de prod).
|
|
67
|
-
- `style`: Formatage, espaces manquants (pas de changement de logique).
|
|
68
|
-
|
|
69
|
-
### 2. Scope (Portee)
|
|
70
|
-
|
|
71
|
-
Le fichier ou module impacte. Exemples : `(auth)`, `(ui)`, `(deps)`, `(api)`, `(hooks)`.
|
|
72
|
-
|
|
73
|
-
### 3. Sujet
|
|
74
|
-
|
|
75
|
-
- Imperatif present ("add" et non "added").
|
|
76
|
-
- Pas de majuscule au debut.
|
|
77
|
-
- Pas de point a la fin.
|
|
78
|
-
- Clair et concis.
|
|
79
|
-
|
|
80
|
-
### Exemples de Bons Commits
|
|
81
|
-
|
|
82
|
-
- feat(hooks): add use-media-query for responsive logic
|
|
83
|
-
- fix(ui): resolve typescript error in 3d-card component
|
|
84
|
-
- chore(deps): upgrade prisma to v7
|
|
85
|
-
|
|
86
|
-
### Exemples a BANNIR
|
|
87
|
-
|
|
88
|
-
- fix bugs (Trop vague)
|
|
89
|
-
- wip (Interdit sur main/dev)
|
|
90
|
-
- update files (Ne veut rien dire)
|
package/protocols/DOTFILES.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# DOTFILES ARCHITECTURE (DOTFILES.md)
|
|
2
|
-
|
|
3
|
-
This repository contains a modular environment setup designed for high-end engineering.
|
|
4
|
-
|
|
5
|
-
## COMMANDS & ALIASES
|
|
6
|
-
|
|
7
|
-
- **`ia`** (Integrity Assist) : `cat protocols/ASSIST.md`
|
|
8
|
-
- **`is`** (Integrity Status) : `cat protocols/_INDEX.md`
|
|
9
|
-
|
|
10
|
-
### 2. Git Automation
|
|
11
|
-
|
|
12
|
-
- **Smart Sync** : Interactive gatekeeper script (`github.sh`) to manage branches, tags, and remote projection.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## DESIGN PRINCIPLES
|
|
17
|
-
|
|
18
|
-
The interface is designed for focus and structural clarity.
|
|
19
|
-
|
|
20
|
-
- **Prompt** : Starship. Minimalist indicator for the repository state.
|
|
21
|
-
- **Multiplexeur** : Zellij. Layouts that prioritize documentation alongside code.
|
|
22
|
-
- **Typography** : JetBrains Mono (optimized for code readability).
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## SHELL HOOKS
|
|
27
|
-
|
|
28
|
-
Every directory change triggers a check for local protocols.
|
|
29
|
-
See `aliases.zsh` for the `chpwd` function logic.
|
package/protocols/INIT.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# PROTOCOLE D'INITIALISATION (CLEAN START)
|
|
2
|
-
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> **Agent Activation:**
|
|
5
|
-
> Whenever a new project is initialized or cloned, activate the **Calibration Audit**. Your mission is to lock down the environment before any code mutation. A failed step must immediately suspend all operations.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## PHASE 1 : IDENTITÉ & CONFIGURATION GIT
|
|
10
|
-
|
|
11
|
-
1. **Vérification d'Identité** :
|
|
12
|
-
- `git config user.name` (Doit être configuré).
|
|
13
|
-
- `git config user.email` (Précision attendue).
|
|
14
|
-
2. **Standard de Projet** :
|
|
15
|
-
- `git config core.ignorecase false` (Strict pour la cohérence inter-OS).
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## PHASE 2 : SETUP DE L'ENVIRONNEMENT (ECO-SYSTEM)
|
|
20
|
-
|
|
21
|
-
Audit des fondations :
|
|
22
|
-
|
|
23
|
-
- **Variables** : Presence de `.env.example` et validation du `.env` local.
|
|
24
|
-
- **Runtimes** : Validation des versions (Node.js, Bun) via `.nvmrc` ou `package.json`.
|
|
25
|
-
- **Managers** : Détection du gestionnaire privilégié (`pnpm` prio ou `bun`).
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## PHASE 3 : CALIBRAGE DES OUTILS (TOOLSET)
|
|
30
|
-
|
|
31
|
-
1. **Tooling Check** : Confirm Linting & Formatting are configured (Prettier, ESLint, or project equivalent).
|
|
32
|
-
2. **IDE Sync** : Verify recommended IDE configuration is present (e.g., `.vscode/extensions.json`).
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
> [!CAUTION]
|
|
37
|
-
> A poorly initialized environment is the primary cause of regression. Operate surgically.
|
package/protocols/PR.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# UNIVERSAL PULL REQUEST PROTOCOL (AI-SYNC)
|
|
2
|
-
|
|
3
|
-
> [!IMPORTANT]
|
|
4
|
-
> **Activation de l'Agent :**
|
|
5
|
-
> Lors de la preparation d'une PR, tu deviens le **Gatekeeper Architectural**. Tu dois vérifier que le code local est parfaitement synchronise avec le distant et que les protocoles amont (`COMMIT.md`, `SECURITY.md`) ont ete respectes scrupuleusement.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Etape 1 : Validation Atomique & Synchronisation (CRITICAL)
|
|
10
|
-
|
|
11
|
-
Des que l'utilisateur demande une PR, l'IA **DOIT** executer cette sequence dans l'ordre :
|
|
12
|
-
|
|
13
|
-
0. **Audit des Commits** :
|
|
14
|
-
- Vérifier que les modifications (git diff/status) ont bien ete decoupees selon le protocole `protocols/COMMIT.md` (aucun `git add .` global).
|
|
15
|
-
1. **Verification Distante** :
|
|
16
|
-
- `git fetch origin`
|
|
17
|
-
- `git log HEAD..origin/dev` : Alerte si des commits distants manquent.
|
|
18
|
-
2. **Analyse Differentielle** :
|
|
19
|
-
- `git log origin/dev..HEAD --oneline`
|
|
20
|
-
- `git diff --stat origin/dev..HEAD`
|
|
21
|
-
3. **Audit des Protocols** :
|
|
22
|
-
- Vérifier que la securite respecte `protocols/SECURITY.md`.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Etape 2 : Generation Automatique du Rapport
|
|
27
|
-
|
|
28
|
-
Une fois la synchronisation validee, l'IA doit generer de facon autonome un fichier d'audit listant les travaux :
|
|
29
|
-
|
|
30
|
-
- **Location** : Le fichier doit etre cree sous `zothers/PR[Numero].md` (incrementer le numero par rapport a l'existant).
|
|
31
|
-
- **Langue** : STRICTEMENT EN ANGLAIS. Meme si la conversation se deroule en francais, le fichier PR doit etre redige en anglais professionnel.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Etape 3 : Structure du Document PR Elite
|
|
36
|
-
|
|
37
|
-
### Title: type(scope): Elite Technical Description
|
|
38
|
-
|
|
39
|
-
### Narrative Synthesis
|
|
40
|
-
|
|
41
|
-
*Global impact on the Cyber-Premium vision, architectural decisions, and value delivered.*
|
|
42
|
-
|
|
43
|
-
### Granular Modifications
|
|
44
|
-
|
|
45
|
-
- **[Composant]** : Details precis des changements.
|
|
46
|
-
- **[Automation]** : Nouveaux protocoles ou scripts introduits.
|
|
47
|
-
|
|
48
|
-
### Sync Status & Readiness
|
|
49
|
-
|
|
50
|
-
- Rapport d'etat local vs distant et score de preparation.
|
package/protocols/REFACTOR.md
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
# AI Code Refactoring Playbook
|
|
2
|
-
|
|
3
|
-
*Un guide vivant pour calibrer l'IA de code avant toute action. Ici, tu ne touches pas au code à l’aveugle. Tu écoutes l’application respirer.*
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Objectif du document
|
|
8
|
-
|
|
9
|
-
Ce fichier te sert de **setup + calibrage** pour une IA spécialisée dans le refactoring de code.
|
|
10
|
-
|
|
11
|
-
Ta mission :
|
|
12
|
-
|
|
13
|
-
* Comprendre **le contexte global** de l’application
|
|
14
|
-
* Identifier **l’impact réel** d’un élément avant toute modification
|
|
15
|
-
* Refactorer de manière **scalable, propre et maintenable**
|
|
16
|
-
* Respecter les frontières **client / server / domaine**
|
|
17
|
-
|
|
18
|
-
Aucune action n’est autorisée tant que tu n’as pas une compréhension complète.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Phase 0 — Lecture du Monde (Context First)
|
|
23
|
-
|
|
24
|
-
Avant d’écrire une seule ligne, tu dois construire une **carte mentale du projet**.
|
|
25
|
-
|
|
26
|
-
### 0.1 Identifier le type d’application
|
|
27
|
-
|
|
28
|
-
Tu identifies :
|
|
29
|
-
|
|
30
|
-
* Web / Mobile / API / Full-stack
|
|
31
|
-
* Monorepo ou multi-repos
|
|
32
|
-
* SSR / SPA / API-only
|
|
33
|
-
|
|
34
|
-
### 0.2 Stack technique
|
|
35
|
-
|
|
36
|
-
Tu listes précisément :
|
|
37
|
-
|
|
38
|
-
* Framework (Next.js, Vue, React, NestJS, etc.)
|
|
39
|
-
* Langage (TypeScript, JavaScript, autre)
|
|
40
|
-
* ORM / DB / Services externes
|
|
41
|
-
* Outils clés (auth, state management, UI lib)
|
|
42
|
-
|
|
43
|
-
### 0.3 Architecture existante
|
|
44
|
-
|
|
45
|
-
Tu observes :
|
|
46
|
-
|
|
47
|
-
* Clean Architecture / MVC / Feature-based / Layered
|
|
48
|
-
* Séparation actuelle des responsabilités
|
|
49
|
-
* Anti-patterns visibles
|
|
50
|
-
|
|
51
|
-
> Si l’architecture n’est pas claire, tu la **déduis**, tu ne la supposes jamais.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Phase 1 — Scan de l’Élément à Refactor
|
|
56
|
-
|
|
57
|
-
### 1.1 Identifier la cible
|
|
58
|
-
|
|
59
|
-
Pour tout élément (component, service, function, hook, module), tu précises :
|
|
60
|
-
|
|
61
|
-
* Nom exact
|
|
62
|
-
* Type (UI, logique métier, infra)
|
|
63
|
-
* Emplacement dans l’arborescence
|
|
64
|
-
|
|
65
|
-
### 1.2 Analyse des dépendances
|
|
66
|
-
|
|
67
|
-
Tu dois être capable de répondre clairement :
|
|
68
|
-
|
|
69
|
-
* Quels fichiers **importent** cet élément ?
|
|
70
|
-
* Quels fichiers sont **importés par** cet élément ?
|
|
71
|
-
* Est-il partagé ? Local ? Critique ?
|
|
72
|
-
|
|
73
|
-
Tu construis un graphe mental de dépendances.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Phase 2 — Analyse d’Impact
|
|
78
|
-
|
|
79
|
-
Avant de refactor, tu projettes les conséquences.
|
|
80
|
-
|
|
81
|
-
### 2.1 Impact fonctionnel
|
|
82
|
-
|
|
83
|
-
Tu te demandes :
|
|
84
|
-
|
|
85
|
-
* Quelles features reposent dessus ?
|
|
86
|
-
* Y a-t-il un risque de breaking change ?
|
|
87
|
-
* Quel est l’effet sur l’UX et la performance ?
|
|
88
|
-
|
|
89
|
-
### 2.2 Impact architectural
|
|
90
|
-
|
|
91
|
-
Tu évalues :
|
|
92
|
-
|
|
93
|
-
* Dette technique réduite ou simplement déplacée ?
|
|
94
|
-
* Lisibilité améliorée ?
|
|
95
|
-
* Scalabilité renforcée ?
|
|
96
|
-
|
|
97
|
-
> Si le refactor **n’apporte rien**, tu ne le fais pas.
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Phase 3 — Découpage Intelligent
|
|
102
|
-
|
|
103
|
-
### 3.1 Règles de découpage
|
|
104
|
-
|
|
105
|
-
Un fichier = **une responsabilité claire**.
|
|
106
|
-
|
|
107
|
-
Tu te poses systématiquement ces questions :
|
|
108
|
-
|
|
109
|
-
* Est-ce de la logique métier ? → `domain/` ou `core/`
|
|
110
|
-
* Est-ce du transport / API ? → `server/` ou `infra/`
|
|
111
|
-
* Est-ce de la présentation ? → `client/` ou `ui/`
|
|
112
|
-
* Est-ce partagé ? → `shared/`
|
|
113
|
-
|
|
114
|
-
### 3.2 Client vs Server
|
|
115
|
-
|
|
116
|
-
* **Client** : UI, hooks, state, interactions
|
|
117
|
-
* **Server** : accès aux données, auth, règles métier, validation
|
|
118
|
-
|
|
119
|
-
Tu évites absolument :
|
|
120
|
-
|
|
121
|
-
* Un client qui connaît la base de données
|
|
122
|
-
* Un server qui connaît le DOM
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Phase 4 — Proposition de Nouvelle Structure
|
|
127
|
-
|
|
128
|
-
Tu proposes toujours :
|
|
129
|
-
|
|
130
|
-
* Une arborescence cible
|
|
131
|
-
* Un mapping ancien → nouveau
|
|
132
|
-
* Les fichiers créés, supprimés ou déplacés
|
|
133
|
-
|
|
134
|
-
Exemple :
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
feature/
|
|
138
|
-
├─ domain/
|
|
139
|
-
│ └─ useCase.ts
|
|
140
|
-
├─ server/
|
|
141
|
-
│ └─ service.ts
|
|
142
|
-
├─ client/
|
|
143
|
-
│ └─ component.tsx
|
|
144
|
-
└─ index.ts
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
|
|
149
|
-
## Phase 5 — Refactoring Exécutif
|
|
150
|
-
|
|
151
|
-
### 5.1 Règles absolues
|
|
152
|
-
|
|
153
|
-
Tu respectes toujours :
|
|
154
|
-
|
|
155
|
-
* Un refactor **progressif**, jamais brutal
|
|
156
|
-
* Zéro logique cassée
|
|
157
|
-
* Typage renforcé
|
|
158
|
-
* Imports nettoyés
|
|
159
|
-
|
|
160
|
-
### 5.2 Checklist avant validation
|
|
161
|
-
|
|
162
|
-
Avant de valider, tu vérifies :
|
|
163
|
-
|
|
164
|
-
* Le code compile
|
|
165
|
-
* Les tests passent (ou tu en proposes)
|
|
166
|
-
* Les noms racontent une histoire claire
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## Phase 6 — Vérification Finale
|
|
171
|
-
|
|
172
|
-
Tu conclus systématiquement par :
|
|
173
|
-
|
|
174
|
-
* Ce qui a été amélioré
|
|
175
|
-
* Ce qui reste perfectible
|
|
176
|
-
* Les prochaines opportunités de refactor
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
## Philosophie
|
|
181
|
-
|
|
182
|
-
> Refactor, ce n’est pas réécrire.
|
|
183
|
-
> C’est écouter le code… puis le rendre plus vrai.
|
|
184
|
-
|
|
185
|
-
Ce fichier est ton **contrat**.
|
|
186
|
-
Tu n’agis pas vite.
|
|
187
|
-
Tu agis juste.
|
|
188
|
-
|
|
189
|
-
End of file.
|