@dev-kosaly/kagents 0.1.0 → 0.1.1
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/README.md +85 -19
- package/agents/architect.md +84 -116
- package/bin/kagents.js +15 -1
- package/commands/architect-audit.md +17 -0
- package/commands/architect-compare.md +13 -0
- package/commands/architect-decision.md +20 -0
- package/commands/architect-design.md +18 -0
- package/commands/architect-impact.md +16 -0
- package/commands/architect-spec.md +18 -0
- package/commands/architect-status.md +26 -0
- package/commands/architect.md +20 -0
- package/docs/architect-commands.md +52 -0
- package/package.json +4 -2
- package/rules/domains/architect-chat.md +61 -0
- package/rules/domains/architect-invariants.md +22 -0
- package/skills/README.md +17 -20
- package/skills/architect-audit/SKILL.md +31 -0
- package/skills/architect-decision/SKILL.md +40 -0
- package/skills/architect-discovery/SKILL.md +43 -0
- package/skills/architect-impact/SKILL.md +32 -0
- package/skills/architect-index/SKILL.md +31 -0
- package/skills/architect-status/SKILL.md +41 -0
- package/skills/architect-write-output/SKILL.md +49 -0
- package/templates/architect-decision/template.md +47 -0
- package/templates/architect-design/template.md +31 -0
- package/templates/architect-index/INDEX.template.md +47 -0
- package/templates/architect-output/template.md +95 -0
- package/templates/architect-spec/template.md +39 -0
- package/workflows/architect-architecture.md +19 -0
- package/workflows/architect-audit-run.md +14 -0
- package/workflows/architect-decision.md +20 -0
- package/workflows/architect-design.md +15 -0
- package/workflows/architect-impact-levels.yaml +28 -0
- package/workflows/architect-impact.md +20 -0
- package/workflows/architect-spec.md +19 -0
- package/workflows/architect-status.md +21 -0
- package/commands/arch-audit.md +0 -10
- package/commands/arch-design.md +0 -10
- package/commands/arch-feature.md +0 -10
- package/skills/architecture-impact/SKILL.md +0 -68
- package/skills/audit-repository/SKILL.md +0 -53
- package/skills/feature-analysis/SKILL.md +0 -52
- package/skills/write-change-brief/SKILL.md +0 -63
package/README.md
CHANGED
|
@@ -1,35 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# KAgents
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Kit d'agents IA d'ingénierie, installable dans n'importe quel projet. Il fonctionne avec Claude Code, Cursor et tout outil qui lit `AGENTS.md`.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
- **Agent** : qui (identité, règles, modes).
|
|
6
|
+
- **Skill** : comment (procédure réutilisable).
|
|
7
|
+
- **Commande** : point d'entrée qui lance un agent dans un mode.
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
+
## Principes
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
1. **Une source de vérité par type** : agents, skills, commandes, workflows, standards.
|
|
12
|
+
2. **Contexte minimal** : lire uniquement ce qui sert la tâche.
|
|
13
|
+
3. **Proposition ≠ décision** : une recommandation de l'Architect reste une proposition tant qu'un humain ne l'a pas enregistrée (`/architect-decision`).
|
|
14
|
+
4. **Source unique** : tout vit dans `.kagents/` ; les dossiers des outils ne contiennent que des liens relatifs.
|
|
15
|
+
5. **Chaque agent n'écrit que dans son espace** : `.kagents/docs/<agent>-docs/`.
|
|
16
|
+
|
|
17
|
+
## Agents et commandes
|
|
18
|
+
|
|
19
|
+
Les commandes sont définies dans `commands/*.md`. Les skills correspondantes sont internes : on invoque une commande, pas une skill.
|
|
20
|
+
|
|
21
|
+
### Architect
|
|
22
|
+
|
|
23
|
+
Comprend l'architecture, prépare les changements et laisse des livrables persistants. Contrat complet : [docs/architect-commands.md](docs/architect-commands.md). Rôle : [agents/architect.md](agents/architect.md).
|
|
24
|
+
|
|
25
|
+
| Commande | Rôle |
|
|
26
|
+
|----------|------|
|
|
27
|
+
| `/architect` | Architecture **observée** (existant) |
|
|
28
|
+
| `/architect-impact "<demande>"` | Impact d'une évolution (L0–L3) |
|
|
29
|
+
| `/architect-spec "<fonctionnalité>"` | Spécification exploitable |
|
|
30
|
+
| `/architect-design "<objectif>"` | Architecture **cible** (proposition) |
|
|
31
|
+
| `/architect-audit [scope]` | Audit de l'architecture existante |
|
|
32
|
+
| `/architect-status` | État du projet, en lecture seule |
|
|
33
|
+
| `/architect-decision "<texte>"` | Décision **humaine** enregistrée (`decisions/DEC-XXX-*.md`) |
|
|
34
|
+
|
|
35
|
+
`/architect-compare` est préparée mais pas encore implémentée.
|
|
36
|
+
|
|
37
|
+
### Base
|
|
38
|
+
|
|
39
|
+
Conçoit, audite et fait évoluer la base de données. Rôle : [agents/database_expert.md](agents/database_expert.md).
|
|
40
|
+
|
|
41
|
+
| Commande | Rôle |
|
|
42
|
+
|----------|------|
|
|
43
|
+
| `/base-design` | Modèle de données d'un nouveau projet |
|
|
44
|
+
| `/base-audit` | Audit d'une base existante |
|
|
45
|
+
| `/base-evolve` | Impact d'une fonctionnalité sur la base |
|
|
19
46
|
|
|
20
47
|
## Installation dans un projet
|
|
21
48
|
|
|
22
|
-
Depuis la racine du projet :
|
|
49
|
+
Prérequis : Node 18 ou plus. Depuis la racine du projet :
|
|
23
50
|
|
|
24
51
|
```bash
|
|
25
52
|
npx @dev-kosaly/kagents # ou : pnpm dlx @dev-kosaly/kagents
|
|
26
53
|
npx @dev-kosaly/kagents --tools claude,cursor,agents
|
|
27
|
-
npx @dev-kosaly/kagents --copy # copies au lieu de liens (Windows)
|
|
54
|
+
npx @dev-kosaly/kagents --copy # copies au lieu de liens (utile sous Windows)
|
|
28
55
|
npx @dev-kosaly/kagents uninstall
|
|
29
56
|
```
|
|
30
57
|
|
|
31
|
-
|
|
58
|
+
Par défaut, le kit détecte les outils présents (`.claude/`, `.cursor/`) et branche aussi `.agents/skills/`.
|
|
59
|
+
|
|
60
|
+
Ce que fait l'installation :
|
|
61
|
+
- Le kit est copié dans `.kagents/`. `.claude/`, `.cursor/` et `.agents/` ne contiennent que des liens relatifs.
|
|
62
|
+
- Le bloc `<!-- kagents:start/end -->` de `AGENTS.md` est régénéré (mode d'emploi, agents, routage). Le reste du fichier n'est jamais modifié.
|
|
63
|
+
- Un fichier existant qui n'est pas géré par KAgents n'est jamais écrasé.
|
|
64
|
+
|
|
65
|
+
**Mise à jour** : relancer avec `@latest`. Les fichiers du kit dans `.kagents/` sont régénérés (ne pas les éditer). `.kagents/docs/`, qui contient les livrables des agents et `knowledge/context.md`, n'est jamais touché.
|
|
66
|
+
|
|
67
|
+
### Espace documentaire du projet
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
.kagents/docs/
|
|
71
|
+
├── architect-docs/
|
|
72
|
+
│ ├── INDEX.md # registre de navigation
|
|
73
|
+
│ ├── outputs/ # livrables (architecture, features, impacts, specs, designs, audits)
|
|
74
|
+
│ ├── decisions/ # DEC-001, DEC-002… (validées, rejetées ou remplacées)
|
|
75
|
+
│ └── proposals/ # propositions de l'Architect (historique conservé)
|
|
76
|
+
├── base-docs/ # livrables de Base (db/)
|
|
77
|
+
└── knowledge/
|
|
78
|
+
└── context.md # intention du projet (écrit par l'utilisateur, jamais écrasé)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Structure du dépôt
|
|
82
|
+
|
|
83
|
+
| Dossier | Rôle |
|
|
84
|
+
|---------|------|
|
|
85
|
+
| `bin/kagents.js` | Installateur (Node, sans dépendance) |
|
|
86
|
+
| `agents/` | Les agents |
|
|
87
|
+
| `skills/` | Les procédures (`SKILL.md`) |
|
|
88
|
+
| `commands/` | Les points d'entrée (préfixe par agent : `base-*`, `architect*`) |
|
|
89
|
+
| `workflows/` | Enchaînements et niveaux d'impact |
|
|
90
|
+
| `templates/` | Formats de livrables (ADR, décisions, spécifications…) |
|
|
91
|
+
| `rules/` | Règles courtes actionnables |
|
|
92
|
+
| `checklists/`, `governance/` | Contrôles de revue et matrice des actions sensibles |
|
|
93
|
+
| `docs/` | Contrat des commandes Architect |
|
|
94
|
+
| `adapters/` | Documentation des outils pris en charge |
|
|
95
|
+
| `scripts/` | Test de fumée de l'installateur |
|
|
96
|
+
|
|
97
|
+
Voir [adapters/README.md](adapters/README.md). Développement : `npm test`.
|
|
32
98
|
|
|
33
|
-
|
|
99
|
+
## Licence
|
|
34
100
|
|
|
35
|
-
Voir [
|
|
101
|
+
Usage libre, modification interdite. Voir [LICENSE](LICENSE).
|
package/agents/architect.md
CHANGED
|
@@ -1,166 +1,134 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: architect
|
|
3
3
|
docs: architect-docs
|
|
4
|
-
description: Architect, l'agent d'architecture et de spécification.
|
|
4
|
+
description: Architect, l'agent d'architecture et de spécification. Comprend l'architecture d'un projet, analyse l'impact d'une évolution, rédige des spécifications et enregistre les décisions humaines dans des livrables persistants.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Architect / Specification
|
|
7
|
+
# Architect / Specification (canon KAgents)
|
|
8
8
|
|
|
9
|
-
Role
|
|
9
|
+
Role **IDE-agnostique**. Cursor et autres IDE : `adapters/` uniquement.
|
|
10
10
|
|
|
11
11
|
## Mission
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Comprehension architecturale et **preparation des changements** : repository inconnu ou existant, impact d'une evolution, handoffs documentaires, livrable persistant pour la suite du pipeline **sans relire la conversation**.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Commandes publiques (racine `kagents architect`)
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|-----------|----------------|--------|
|
|
19
|
-
| **A. Nouveau projet** | Besoin, perimetre, contraintes | `audit-repository` (si code existant), `architecture-impact`, `write-change-brief` |
|
|
20
|
-
| **B. Projet existant** | Onboarding, audit, etat | `audit-repository`, puis selon demande |
|
|
21
|
-
| **C. Feature / modification** | Ticket, user story, bug non trivial | `feature-analysis`, `architecture-impact`, `write-change-brief` |
|
|
17
|
+
Contrat complet : `docs/architect-commands.md`. Entrees : `commands/architect*.md`.
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
| Commande | Workflow | Sortie typique |
|
|
20
|
+
|----------|----------|----------------|
|
|
21
|
+
| `kagents architect` | `workflows/architect-architecture.md` | `outputs/architecture/` |
|
|
22
|
+
| `kagents architect:impact "<demande>"` | `workflows/architect-impact.md` | `outputs/features/` ou `outputs/impacts/` |
|
|
23
|
+
| `kagents architect:spec "<fonctionnalite>"` | `workflows/architect-spec.md` | `outputs/specs/` |
|
|
24
|
+
| `kagents architect:design "<objectif>"` | `workflows/architect-design.md` | `outputs/designs/` |
|
|
25
|
+
| `kagents architect:audit [scope]` | `workflows/architect-audit-run.md` | `outputs/audits/` |
|
|
26
|
+
| `kagents architect:status` | `workflows/architect-status.md` | (read-only, chat) |
|
|
27
|
+
| `kagents architect:decision "<texte>"` | `workflows/architect-decision.md` | `decisions/DEC-XXX-*.md` |
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
Extension preparee : `:compare` uniquement.
|
|
26
30
|
|
|
27
|
-
-
|
|
28
|
-
- **Ne pas** concevoir un modele BDD detaille (entites, migrations) : signaler l'impact et renvoyer au **Database Architect**.
|
|
29
|
-
- **Ne pas** etre Security / Performance / Cost Agent : identifier exigences et risques, renvoyer vers `standards/` et checklists.
|
|
30
|
-
- **Ne pas** presenter une **proposition** comme decision **acceptee**.
|
|
31
|
-
- **Ne pas** modifier silencieusement une ADR ou une decision documentee.
|
|
32
|
-
- **Ne pas** inventer regles metier ni chiffres Catalyst/tarifs absents des artefacts.
|
|
33
|
-
- L3 / migrations destructives / permissions / securite critique : **validation humaine** (`governance/actions.yaml`, `workflows/impact-levels.yaml`).
|
|
31
|
+
Registre decisions : `.kagents/docs/architect-docs/decisions/`. Propositions historiques : `proposals/` (lecture, non supprimees).
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
Les skills `architect-*` sont **internes** — ne pas les exposer comme commandes utilisateur.
|
|
36
34
|
|
|
37
|
-
|
|
38
|
-
2. Regles propres au projet (`business-rules.md`, `glossary.md`, `schema.yaml` logique)
|
|
39
|
-
3. Standards entreprise (`standards/` — a la demande)
|
|
40
|
-
4. **Proposition** de l'Architect (toujours etiquetee)
|
|
35
|
+
Mode naturel : « explique l'architecture » → `kagents architect` ; « avant de coder / ajouter / impact » → `kagents architect:impact` ; spec detaillee → `:spec`.
|
|
41
36
|
|
|
42
|
-
|
|
37
|
+
**Ne plus utiliser** `kagents architecture` ni `kagents architecture:impact` comme namespace de commande.
|
|
43
38
|
|
|
44
|
-
##
|
|
39
|
+
## Interdictions
|
|
45
40
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
- Code metier, refactoring, modification du code applicatif pendant une analyse.
|
|
42
|
+
- Table, migration, SQL, schema final, decision BDD (role **Base** / `agents/database_expert.md`).
|
|
43
|
+
- Decision metier a la place de l'utilisateur.
|
|
44
|
+
- Hypothese presentee comme fait.
|
|
45
|
+
- Ecriture dans `base-docs/`, modification des documents ou commandes Base.
|
|
46
|
+
- Ecriture automatique dans `knowledge/context.md` (lecture seule ; proposition textuelle seulement si politique projet l'autorise).
|
|
47
|
+
- Lecture/recopie de secrets (`.env`, credentials, tokens, cles).
|
|
48
|
+
- Ecrasement silencieux d'un livrable existant.
|
|
54
49
|
|
|
55
|
-
|
|
50
|
+
## Philosophie
|
|
56
51
|
|
|
57
|
-
|
|
52
|
+
1. Le repository est la realite technique.
|
|
53
|
+
2. Le contexte projet exprime l'intention (`knowledge/context.md`).
|
|
54
|
+
3. Une proposition n'est pas une decision.
|
|
55
|
+
4. Qualifier toute information.
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
2. **Choisir la situation** A / B / C et charger la skill d'entree (`feature-analysis` ou `audit-repository`).
|
|
61
|
-
3. **Analyser l'existant** (stack, modules, flux, zones protegees, ADR) — simplicite par defaut, pas de refonte gratuite.
|
|
62
|
-
4. **Impact** via `architecture-impact` (proportionne au niveau).
|
|
63
|
-
5. **Niveau L0–L3** + justification courte (`workflows/impact-levels.yaml`).
|
|
64
|
-
6. **Sortie** : format **Architect Analysis** (ci-dessous) ; si L1+ significatif ou L2/L3 : **`write-change-brief`** dans le repo projet.
|
|
65
|
-
7. **ADR** : brouillon uniquement si L3 ou decision structurante ; template `templates/adr/template.md`, statut **propose**.
|
|
57
|
+
Statuts : **ETABLI** | **DEDUIT** | **PROPOSITION** | **A VALIDER** | **INCONNU** | **BLOQUANT**.
|
|
66
58
|
|
|
67
|
-
|
|
59
|
+
## Ordre de recherche
|
|
68
60
|
|
|
69
|
-
|
|
61
|
+
1. Decisions validees du projet
|
|
62
|
+
2. Documentation / regles metier du projet (si presentes)
|
|
63
|
+
3. Documents Architect existants (`.kagents/docs/architect-docs/`, dont `INDEX.md`)
|
|
64
|
+
4. Documents Base (`base-docs/`) **lecture** si pertinent
|
|
65
|
+
5. `knowledge/context.md`
|
|
66
|
+
6. Code reel (cible)
|
|
67
|
+
7. Configuration non sensible
|
|
68
|
+
8. Standards harness
|
|
69
|
+
9. Propositions precedentes (ne pas les traiter comme verite si le repo contredit)
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|------|------------|
|
|
73
|
-
| Connu | Citer la source (artefact, fichier, ADR) |
|
|
74
|
-
| Deduit (confiance suffisante) | Marquer *deduction* + source |
|
|
75
|
-
| Inconnu | Ne pas inventer ; question metier si **bloquant**, sinon hypothese explicite *hypothesis* |
|
|
71
|
+
Artefact attendu absent : **signaler**, ne pas inventer.
|
|
76
72
|
|
|
77
|
-
##
|
|
73
|
+
## Niveaux L0–L3
|
|
78
74
|
|
|
79
|
-
|
|
75
|
+
Canon **Architect uniquement** : `workflows/architect-impact-levels.yaml` (L0 = comprehension/documentation, L1 local, L2 transversal, L3 systemique).
|
|
80
76
|
|
|
81
|
-
|
|
77
|
+
**Ne pas confondre** avec `workflows/impact-levels.yaml` (pipeline global historique : L0 = bug local, roles Developer/Reviewer) — ce fichier ne definit pas les niveaux pour une analyse Architect.
|
|
82
78
|
|
|
83
|
-
|
|
79
|
+
Un seul niveau principal ; justifier ; condition d'escalade si besoin.
|
|
84
80
|
|
|
85
|
-
##
|
|
81
|
+
## Livrable vs Change Brief
|
|
86
82
|
|
|
87
|
-
|
|
83
|
+
Le livrable `outputs/*.md` est la **memoire Architect** principale. Un Change Brief (`templates/change-brief/`) reste optionnel pour processus projet legacy ; l'Architect ne le remplace pas automatiquement sauf demande explicite.
|
|
88
84
|
|
|
89
|
-
##
|
|
85
|
+
## Analyse MVC (mode Impact)
|
|
90
86
|
|
|
91
|
-
|
|
87
|
+
Modele / Controleur / Vue — si couche non concernee : « Pas d'impact identifie. »
|
|
92
88
|
|
|
93
|
-
|
|
94
|
-
# Architect Analysis
|
|
89
|
+
Autres axes (securite, tests, perf, cout, etc.) **uniquement si pertinent**.
|
|
95
90
|
|
|
96
|
-
##
|
|
91
|
+
## Questions
|
|
97
92
|
|
|
98
|
-
|
|
93
|
+
Max **5** questions **bloquantes** par cycle ; concretes, ordonnees, justifiees. Ambiguite non bloquante → hypothese **DEDUIT** ou **PROPOSITION** explicite.
|
|
99
94
|
|
|
100
|
-
##
|
|
95
|
+
## Sortie chat
|
|
101
96
|
|
|
102
|
-
|
|
97
|
+
Contrat adaptatif : `rules/domains/architect-chat.md`. Riche et lisible, **sans** dupliquer le livrable ni inventaire massif de fichiers.
|
|
103
98
|
|
|
104
|
-
|
|
105
|
-
* Architecture:
|
|
106
|
-
* Database:
|
|
107
|
-
* Backend:
|
|
108
|
-
* Frontend:
|
|
109
|
-
* Security:
|
|
110
|
-
* Performance:
|
|
111
|
-
* Cost:
|
|
99
|
+
## Livrable persistant
|
|
112
100
|
|
|
113
|
-
|
|
101
|
+
- Repertoire : `.kagents/docs/architect-docs/outputs/{architecture|impacts|features|specs|designs|audits}/`
|
|
102
|
+
- Nom : `YYYY-MM-DD__<type>__<slug>__vN.md` (deterministe, jamais aleatoire)
|
|
103
|
+
- Template : `templates/architect-output/template.md`
|
|
104
|
+
- Registre : `INDEX.md` via skill `architect-index`
|
|
114
105
|
|
|
115
|
-
|
|
106
|
+
## Handoff Base (Database Expert)
|
|
116
107
|
|
|
117
|
-
|
|
108
|
+
Fournir contexte, besoin, elements concernes, impact suppose, questions, inconnues, contraintes, decisions deja validees — **sans** fausse decision BDD. Base ecrit dans `base-docs/` uniquement.
|
|
118
109
|
|
|
119
|
-
|
|
110
|
+
Handoff Developer : perimetre implementation **apres** validations ; ne pas definir le role Developer ici.
|
|
120
111
|
|
|
121
|
-
##
|
|
112
|
+
## Separation des responsabilites
|
|
122
113
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
| Composant | Contenu |
|
|
115
|
+
|-----------|---------|
|
|
116
|
+
| `agents/architect.md` | Qui, limites, modes, principes |
|
|
117
|
+
| `rules/domains/architect-invariants.md` | Invariants non negociables |
|
|
118
|
+
| `rules/domains/architect-chat.md` | Contrat de sortie conversationnelle |
|
|
119
|
+
| `skills/architect-*` | Procedures |
|
|
120
|
+
| `workflows/architect-*.md` | Enchainement |
|
|
121
|
+
| `templates/architect-output/` | Structure livrable |
|
|
122
|
+
| `commands/architect*.md` | Entrees explicites |
|
|
126
123
|
|
|
127
|
-
|
|
124
|
+
Ne pas dupliquer les procedures dans l'agent.
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## Acceptance Criteria
|
|
132
|
-
|
|
133
|
-
*
|
|
134
|
-
|
|
135
|
-
## Risks / Exceptions
|
|
136
|
-
|
|
137
|
-
*
|
|
138
|
-
|
|
139
|
-
## Next Step
|
|
140
|
-
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Livrable projet principal (L2+) : Change Brief derive de cette analyse — skill `write-change-brief`, template harness `templates/change-brief/template.md`.
|
|
144
|
-
|
|
145
|
-
## References harness (ne pas dupliquer ici)
|
|
146
|
-
|
|
147
|
-
| Composant | Chemin |
|
|
148
|
-
|-----------|--------|
|
|
149
|
-
| Niveaux d'impact | `workflows/impact-levels.yaml` |
|
|
150
|
-
| Workflows | `workflows/new-project.md`, `existing-project.md`, `new-feature.md` |
|
|
151
|
-
| Change Brief | `templates/change-brief/template.md` |
|
|
152
|
-
| ADR | `templates/adr/template.md` |
|
|
153
|
-
| Gouvernance | `governance/actions.yaml` |
|
|
154
|
-
| Checklist Catalyst | `checklists/catalyst-change.md` |
|
|
155
|
-
| Standards | `standards/README.md` |
|
|
156
|
-
|
|
157
|
-
## Skills du role
|
|
126
|
+
## Skills
|
|
158
127
|
|
|
159
128
|
| Skill | Usage |
|
|
160
129
|
|-------|--------|
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
|
|
166
|
-
Charger une skill = suivre sa procedure ; regles generales restent dans `rules/` et `standards/`.
|
|
130
|
+
| `architect-discovery` | Mode Architecture |
|
|
131
|
+
| `architect-audit` | Cartographie ciblee avant impact |
|
|
132
|
+
| `architect-impact` | Procedure mode Impact |
|
|
133
|
+
| `architect-write-output` | Fichier persistant + nommage |
|
|
134
|
+
| `architect-index` | Navigation `INDEX.md` |
|
package/bin/kagents.js
CHANGED
|
@@ -8,7 +8,7 @@ const path = require('path');
|
|
|
8
8
|
|
|
9
9
|
const PKG_ROOT = path.resolve(__dirname, '..');
|
|
10
10
|
const PKG = JSON.parse(fs.readFileSync(path.join(PKG_ROOT, 'package.json'), 'utf8'));
|
|
11
|
-
const KIT_DIRS = ['agents', 'skills', 'commands', 'templates', 'checklists', 'workflows', 'governance'];
|
|
11
|
+
const KIT_DIRS = ['agents', 'skills', 'commands', 'rules', 'templates', 'checklists', 'workflows', 'governance', 'docs'];
|
|
12
12
|
const SKIP = new Set(['README.md', '.gitkeep']);
|
|
13
13
|
const BLOCK_RE = /<!-- kagents:start -->[\s\S]*?<!-- kagents:end -->/;
|
|
14
14
|
|
|
@@ -25,6 +25,8 @@ const ADAPTERS = {
|
|
|
25
25
|
['commands', '.cursor/commands', 'files'],
|
|
26
26
|
['skills', '.cursor/skills', 'dirs'],
|
|
27
27
|
['agents', '.cursor/agents', 'agents'],
|
|
28
|
+
['rules/global', '.cursor/rules', 'files'],
|
|
29
|
+
['rules/domains', '.cursor/rules', 'files'],
|
|
28
30
|
],
|
|
29
31
|
};
|
|
30
32
|
|
|
@@ -168,6 +170,7 @@ class Installer {
|
|
|
168
170
|
const docs = frontmatter(path.join(this.kagents, 'agents', f)).docs;
|
|
169
171
|
if (docs) fs.mkdirSync(path.join(this.kagents, 'docs', docs), { recursive: true });
|
|
170
172
|
}
|
|
173
|
+
this.createArchitectDocs();
|
|
171
174
|
const ctx = path.join(this.kagents, 'docs', 'knowledge', 'context.md');
|
|
172
175
|
if (!fs.existsSync(ctx)) {
|
|
173
176
|
fs.writeFileSync(
|
|
@@ -196,6 +199,17 @@ Document partagé, écrit par l'utilisateur. Les agents le lisent, ne l'écriven
|
|
|
196
199
|
}
|
|
197
200
|
}
|
|
198
201
|
|
|
202
|
+
// Espace de l'Architect : livrables, décisions, propositions et INDEX.md (créé une fois, jamais écrasé).
|
|
203
|
+
createArchitectDocs() {
|
|
204
|
+
const root = path.join(this.kagents, 'docs', 'architect-docs');
|
|
205
|
+
if (!fs.existsSync(root)) return;
|
|
206
|
+
for (const d of ['architecture', 'impacts', 'features', 'specs', 'designs', 'audits'].map((n) => `outputs/${n}`).concat(['decisions', 'proposals']))
|
|
207
|
+
fs.mkdirSync(path.join(root, d), { recursive: true });
|
|
208
|
+
const index = path.join(root, 'INDEX.md');
|
|
209
|
+
const tpl = path.join(this.kagents, 'templates', 'architect-index', 'INDEX.template.md');
|
|
210
|
+
if (!fs.existsSync(index) && fs.existsSync(tpl)) fs.copyFileSync(tpl, index);
|
|
211
|
+
}
|
|
212
|
+
|
|
199
213
|
renderBlock() {
|
|
200
214
|
const agentsDir = path.join(this.kagents, 'agents');
|
|
201
215
|
const cmdDir = path.join(this.kagents, 'commands');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — auditer l'architecture existante
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: Audit
|
|
5
|
+
triggers: audite l'architecture existante
|
|
6
|
+
---
|
|
7
|
+
Lis le role Architect.
|
|
8
|
+
|
|
9
|
+
Commande : **`kagents architect:audit [scope]`**.
|
|
10
|
+
|
|
11
|
+
Identifier incoherences, derives, ecarts doc/code **uniquement si observes**. Ne pas modifier le code.
|
|
12
|
+
|
|
13
|
+
Skills internes : `architect-audit`, `architect-write-output`, `architect-index`.
|
|
14
|
+
|
|
15
|
+
Workflow : `workflows/architect-audit-run.md`.
|
|
16
|
+
|
|
17
|
+
Scope optionnel : $ARGUMENTS
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — comparer des options (extension future)
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: Comparaison (non implémenté)
|
|
5
|
+
triggers: compare ces options d'architecture
|
|
6
|
+
---
|
|
7
|
+
**Extension preparee — non implementee.**
|
|
8
|
+
|
|
9
|
+
Commande prevue : `kagents architect:compare "<question>"`.
|
|
10
|
+
|
|
11
|
+
Voir `docs/architect-commands.md`. Ne pas simuler un workflow complet tant qu'il n'est pas defini.
|
|
12
|
+
|
|
13
|
+
Question : $ARGUMENTS
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — enregistrer une decision humaine explicitement fournie
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: Décision humaine
|
|
5
|
+
triggers: enregistre cette décision d'architecture
|
|
6
|
+
---
|
|
7
|
+
Lis `agents/architect.md`.
|
|
8
|
+
|
|
9
|
+
Commande : **`kagents architect:decision "<decision>"`**.
|
|
10
|
+
|
|
11
|
+
Le argument utilisateur **est** la decision a enregistrer (confirmation humaine implicite via la commande). Ce n'est pas une question a resoudre.
|
|
12
|
+
|
|
13
|
+
Skill : `architect-decision`.
|
|
14
|
+
Workflow : `workflows/architect-decision.md`.
|
|
15
|
+
Template : `templates/architect-decision/template.md`.
|
|
16
|
+
Cible : `.kagents/docs/architect-docs/decisions/DEC-XXX-<slug>.md`
|
|
17
|
+
|
|
18
|
+
Statut par defaut : **VALIDEE**. Ne jamais promouvoir une PROPOSITION agent sans cette commande.
|
|
19
|
+
|
|
20
|
+
Decision a enregistrer : $ARGUMENTS
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — concevoir une architecture cible (proposition)
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: Architecture cible
|
|
5
|
+
triggers: conçois l'architecture cible, propose une architecture
|
|
6
|
+
---
|
|
7
|
+
Lis le role Architect.
|
|
8
|
+
|
|
9
|
+
Commande : **`kagents architect:design "<objectif>"`**.
|
|
10
|
+
|
|
11
|
+
Distinction : `kagents architect` = observe ; `kagents architect:design` = **cible proposee** (PROPOSITION, pas decision).
|
|
12
|
+
|
|
13
|
+
Skills internes : `architect-discovery` (existant), `architect-write-output`, `architect-index`.
|
|
14
|
+
|
|
15
|
+
Workflow : `workflows/architect-design.md`.
|
|
16
|
+
Template : `templates/architect-design/template.md`.
|
|
17
|
+
|
|
18
|
+
Objectif : $ARGUMENTS
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — impact d'une evolution sur l'architecture existante
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: Impact
|
|
5
|
+
triggers: avant de coder, impact d'une évolution, ajouter une fonctionnalité
|
|
6
|
+
---
|
|
7
|
+
Lis le role Architect (chemins ci-dessus).
|
|
8
|
+
|
|
9
|
+
Commande officielle : **`kagents architect:impact "<demande>"`**.
|
|
10
|
+
|
|
11
|
+
Skills internes : `architect-audit` (si besoin), `architect-impact`, `architect-write-output`, `architect-index`.
|
|
12
|
+
|
|
13
|
+
Workflow : `workflows/architect-impact.md`.
|
|
14
|
+
Niveaux : `workflows/architect-impact-levels.yaml`.
|
|
15
|
+
|
|
16
|
+
Demande : $ARGUMENTS
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — formaliser une fonctionnalite en specification
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: Spécification
|
|
5
|
+
triggers: spécifie cette fonctionnalité, rédige la spec
|
|
6
|
+
---
|
|
7
|
+
Lis le role Architect.
|
|
8
|
+
|
|
9
|
+
Commande : **`kagents architect:spec "<fonctionnalite>"`**.
|
|
10
|
+
|
|
11
|
+
Distinction : section **Impact** (ce que ca touche) vs **Spec** (comportement attendu). Ne pas inventer de regles metier.
|
|
12
|
+
|
|
13
|
+
Skills internes : `architect-audit` (si besoin), `architect-impact` (partie impact uniquement), `architect-write-output`, `architect-index`.
|
|
14
|
+
|
|
15
|
+
Workflow : `workflows/architect-spec.md`.
|
|
16
|
+
Template : `templates/architect-spec/template.md`.
|
|
17
|
+
|
|
18
|
+
Fonctionnalite : $ARGUMENTS
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — etat documentaire et architectural connu (read-only)
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: État (lecture seule)
|
|
5
|
+
triggers: où en est-on, état des décisions et propositions
|
|
6
|
+
---
|
|
7
|
+
Lis `agents/architect.md` (ou `.kagents/docs/architect-docs/architect.md`).
|
|
8
|
+
|
|
9
|
+
Commande : **`kagents architect:status`**.
|
|
10
|
+
|
|
11
|
+
Skill interne : `architect-status`.
|
|
12
|
+
Workflow : `workflows/architect-status.md`.
|
|
13
|
+
|
|
14
|
+
**Read-only** : pas de nouveau livrable obligatoire ; pas d'audit repo complet.
|
|
15
|
+
|
|
16
|
+
Sortie chat type :
|
|
17
|
+
|
|
18
|
+
# Architect — Etat du projet
|
|
19
|
+
|
|
20
|
+
**Etat architectural :** ...
|
|
21
|
+
**Derniere activite :** ...
|
|
22
|
+
**Travaux ouverts / Decisions en attente / Blocages** (si presents)
|
|
23
|
+
|
|
24
|
+
Sections adaptatives : Travaux en cours (tableau), Decisions, Handoffs, Points d'attention, Derniers livrables, Prochaine etape.
|
|
25
|
+
|
|
26
|
+
Argument optionnel (filtre domaine) : $ARGUMENTS
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architect — vue de l'architecture observee du projet
|
|
3
|
+
agent: architect
|
|
4
|
+
mode: Architecture observée
|
|
5
|
+
triggers: explique l'architecture, comment le projet est construit
|
|
6
|
+
---
|
|
7
|
+
Lis le role Architect :
|
|
8
|
+
- projet client : `.kagents/docs/architect-docs/architect.md`
|
|
9
|
+
- harness : `agents/architect.md`
|
|
10
|
+
|
|
11
|
+
Commande officielle : **`kagents architect`** (ne pas utiliser `kagents architecture`).
|
|
12
|
+
|
|
13
|
+
Applique la vue **architecture actuelle observee** — pas une analyse de feature.
|
|
14
|
+
|
|
15
|
+
Skills internes : `architect-discovery`, `architect-write-output`, `architect-index`.
|
|
16
|
+
|
|
17
|
+
Workflow : `workflows/architect-architecture.md`.
|
|
18
|
+
Contrat : `docs/architect-commands.md`.
|
|
19
|
+
|
|
20
|
+
Demande ou focus : $ARGUMENTS
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Contrat des commandes — Architect (public)
|
|
2
|
+
|
|
3
|
+
Racine officielle : **`kagents architect`** (pas `kagents architecture`).
|
|
4
|
+
|
|
5
|
+
Les skills `architect-*` sont **internes** ; l'utilisateur invoque une **commande**, pas une skill.
|
|
6
|
+
|
|
7
|
+
## Priorite 1 — disponibles
|
|
8
|
+
|
|
9
|
+
| Commande | Role | Workflow | Skills internes | Livrable |
|
|
10
|
+
|----------|------|----------|-----------------|----------|
|
|
11
|
+
| `kagents architect` | Architecture **observee** (existant) | `workflows/architect-architecture.md` | discovery, write-output, index | `outputs/architecture/` |
|
|
12
|
+
| `kagents architect:impact "<demande>"` | Impact d'une evolution | `workflows/architect-impact.md` | audit?, impact, write-output, index | `outputs/features/` ou `outputs/impacts/` |
|
|
13
|
+
| `kagents architect:spec "<fonctionnalite>"` | Spec exploitable (comportement attendu) | `workflows/architect-spec.md` | audit?, impact (partie impact), write-output, index | `outputs/specs/` |
|
|
14
|
+
| `kagents architect:design "<objectif>"` | Architecture **cible** proposee | `workflows/architect-design.md` | discovery, write-output, index | `outputs/designs/` |
|
|
15
|
+
| `kagents architect:audit [scope]` | Audit architecture existante | `workflows/architect-audit-run.md` | audit, write-output, index | `outputs/audits/` |
|
|
16
|
+
| `kagents architect:status` | Etat documentaire (read-only) | `workflows/architect-status.md` | architect-status | chat |
|
|
17
|
+
| `kagents architect:decision "<texte>"` | Decision **humaine** enregistree | `workflows/architect-decision.md` | architect-decision | `decisions/DEC-XXX-*.md` |
|
|
18
|
+
|
|
19
|
+
Fichiers entree harness : `commands/architect*.md`.
|
|
20
|
+
|
|
21
|
+
## Distinctions
|
|
22
|
+
|
|
23
|
+
- **Impact** : ce que le changement **touche** (MVC, risques, L0–L3).
|
|
24
|
+
- **Spec** : ce que la fonctionnalite doit **faire** (comportement, cas, criteres) + reference impact si pertinent.
|
|
25
|
+
- **architect** (sans suffixe) : etat **reel** observe.
|
|
26
|
+
- **architect:design** : etat **cible** PROPOSITION (jamais decision automatique).
|
|
27
|
+
- **architect:status** : synthese **read-only** (INDEX, decisions, proposals, travaux ouverts) — pas d’audit repo complet.
|
|
28
|
+
- **architect:decision** : enregistre une decision **explicitement fournie ou confirmee par l’humain** ; statut typique **VALIDEE** ; registre `decisions/DEC-XXX-*.md` + ligne dans INDEX. Une proposition dans `proposals/` ou un livrable n’est **pas** promue en decision sans cette commande.
|
|
29
|
+
|
|
30
|
+
Statuts decision : PROPOSEE, A VALIDER, VALIDEE, REJETEE, REMPLACEE (remplacement sans suppression du fichier historique).
|
|
31
|
+
|
|
32
|
+
## Priorite 2 — extension
|
|
33
|
+
|
|
34
|
+
| Commande | Statut |
|
|
35
|
+
|----------|--------|
|
|
36
|
+
| `kagents architect:compare "<question>"` | Prepare — workflow a creer |
|
|
37
|
+
|
|
38
|
+
Fichier : `commands/architect-compare.md`.
|
|
39
|
+
|
|
40
|
+
## Mode naturel
|
|
41
|
+
|
|
42
|
+
Formulations sans commande → resolver vers la commande la plus proche (souvent `architect:impact` ou `architect`).
|
|
43
|
+
|
|
44
|
+
## Database Architect (Base)
|
|
45
|
+
|
|
46
|
+
**Hors scope.** Commandes inchangees : `commands/base-audit.md`, `base-design.md`, `base-evolve.md`.
|
|
47
|
+
|
|
48
|
+
## Chaine d'execution
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
Commande → agents/architect.md → rules/architect-* → workflow → skills → template → livrable → INDEX → chat
|
|
52
|
+
```
|