Logo vun Source Architecture From Code

Source Architecture From Code

Communautéit
etr
source-architecture-from-code

Synchronize architecture document with codebase changes. Usage /groundwork:source-architecture-from-code

Iwwersiicht

Editeuretr
Repositorygroundwork
Skill-Nummsource-architecture-from-code
Stären
45
Forks
4
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum etr op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Source Architecture From Code an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/etr/groundwork/tree/main/skills/source-architecture-from-code
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/etr/groundwork.git /tmp/groundwork
mkdir -p .claude/skills
cp -r /tmp/groundwork/skills/source-architecture-from-code .claude/skills/source-architecture-from-code
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Source Architecture From Code an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Source Architecture From Code automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Source Architecture From Code net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Sync Architecture Skill

Keeps {{specs_dir}}/architecture.md synchronized with actual implementation decisions.

Pre-flight: Model Recommendation

Your current effort level is {{effort_level}}.

Skip this step silently if effort is high, xhigh, or max (the scale is low < medium < high < xhigh < max, so xhigh and max are already above high) AND you are Sonnet or Opus. If effort is low or medium (i.e. below high), you MUST show the recommendation prompt — regardless of model. If you are not Sonnet or Opus, you MUST show the recommendation prompt - regardless of effort level.

Otherwise → use AskUserQuestion:

json
{
  "questions": [{
    "question": "Do you want to switch? Architecture impact analysis from session changes benefits from consistent reasoning.\n\nTo switch: cancel, run `/effort high` (and `/model sonnet` if on Haiku), then re-invoke this skill.",
    "header": "Recommended: Sonnet or Opus at high effort",
    "options": [
      { "label": "Continue" },
      { "label": "Cancel — I'll switch first" }
    ],
    "multiSelect": false
  }]
}

If the user selects "Cancel — I'll switch first": output the switching commands above and stop. Do not proceed with the skill.

Step 0: Resolve Project Context

Before loading specs, ensure project context is resolved:

  1. Monorepo check: Does .groundwork.yml exist at the repo root?
    • If yes → Is {{project_name}} non-empty?
      • If empty → Invoke Skill(skill="groundwork:select-project") to select a project, then restart this skill.
      • If set → Project is {{project_name}}, specs at {{specs_dir}}/.
    • If no → Continue (single-project repo).
  2. CWD mismatch check (monorepo only):
    • Skip if not in monorepo mode or if the project was just selected in item 1 above.
    • If CWD is the repo root → fine, proceed.
    • Check which project's path CWD falls inside (compare against all projects in .groundwork.yml).
    • If CWD is inside the selected project's path → fine, proceed.
    • If CWD is inside a different project's path → warn via AskUserQuestion:

      "You're working from <cwd> (inside [cwd-project]), but the selected Groundwork project is [selected-project] ([selected-project-path]/). What would you like to do?"

      • "Switch to [cwd-project]"
      • "Stay with [selected-project]" If the user switches, invoke Skill(skill="groundwork:select-project").
    • If CWD doesn't match any project → proceed without warning (shared directory).
  3. Proceed with the resolved project context. All {{specs_dir}}/ paths will resolve to the correct location.

File Locations

  • Target: Architecture document (may be single file or directory)
    • Single file: {{specs_dir}}/architecture.md
    • Directory: {{specs_dir}}/architecture/ (content split across files)
  • Context: Current session history, codebase changes

Detection: Check for single file first (takes precedence), then directory.

When to Trigger

This skill should activate when:

  • User explicitly invokes /groundwork:source-architecture-from-code
  • Session involved architectural decisions (new tech choices, pattern changes)
  • Implementation deviated from documented architecture
  • New components or integrations were added

Workflow Overview

  1. Analyze Session - Review what happened this session
  2. Detect Changes - Identify architectural implications
  3. Propose Updates - Draft specific changes to architecture doc
  4. Apply Changes - Update document with user approval

Step 1: Analyze Session

Review the current session for:

Explicit Decisions:

  • "Let's use X instead of Y"
  • "We should add a cache layer"
  • "This needs to be async"

Implicit Decisions (from implementation):

  • New dependencies added (package.json, requirements.txt)
  • New services/components created
  • New integrations configured
  • Database schema changes

Deviations:

  • Implementation differs from architecture doc
  • Workarounds that changed the design
  • Scope changes affecting architecture

Step 2: Detect Change Categories

CategorySignalSingle file sectionDirectory mode file
New componentNew service/module created§4 Component Details04-components/<component-slug>.md (new file)
Tech changeDifferent library/framework used§3 System Overview, relevant DR03-system-overview.md or 11-decisions/DR-NNN.md
Data changeSchema migration, new store§5 Data Architecture05-data.md
IntegrationNew external service§6 Integration Architecture06-integration.md
SecurityAuth/encryption changes§7 Security Architecture07-security.md
InfraNew environment, deployment change§8 Infrastructure08-infrastructure.md
DecisionExplicit "let's do X" statement§11 Decision Records11-decisions/DR-NNN.md (new file)

Step 3: Propose Updates

For each detected change, propose a specific update:

markdown
## Proposed Architecture Updates

### 1. New Decision Record

**Trigger:** You decided to use Redis for session caching instead of DynamoDB.

**Proposed addition to §11 Decision Records:**

### DR-00X: Session Cache Technology

**Status:** Accepted
**Date:** [today]
**Context:** [extracted from session]

**Options Considered:**
1. **DynamoDB** - Originally planned
   - Pros: AWS native, no new service
   - Cons: Overkill for simple key-value, higher latency
2. **Redis (ElastiCache)** - New choice
   - Pros: Sub-millisecond latency, built for sessions
   - Cons: Additional service to manage

**Decision:** Redis via ElastiCache

**Rationale:** [from session discussion]

---

### 2. Component Update

**Trigger:** Added new `NotificationService` module.

**Proposed addition to §4 Component Details:**

### 4.X Notification Service

**Responsibility:** Send transactional emails and push notifications

**Technology:** AWS SES + SNS

**Interfaces:**
- Exposes: Internal event handlers
- Consumes: EventBridge events

**Related Requirements:** PRD-XXX-REQ-NNN

---

Approve these updates? (yes/no/modify)

Step 4: Apply Changes

On approval:

  1. Detect spec format - Check if architecture is single file or directory
  2. Read current content:
    • Single file: Read {{specs_dir}}/architecture.md
    • Directory: Aggregate all .md files from {{specs_dir}}/architecture/
  3. Route updates to appropriate files:
    • Single file mode: Edit {{specs_dir}}/architecture.md directly
    • Directory mode: Route each update:
      • Decision records (DR-NNN) → Find or create in {{specs_dir}}/architecture/11-decisions/<DR-NNN>.md
      • Components → {{specs_dir}}/architecture/04-components/<component>.md
      • Data architecture → {{specs_dir}}/architecture/05-data.md
      • Security → {{specs_dir}}/architecture/07-security.md
      • Updates to existing content → Find the file containing that content
  4. Update "Last updated" timestamp
  5. Add entry to change log if present

Important: Preserve existing content. Add to sections, don't replace unless explicitly correcting an error.

Step 4a: Auto-Split Check (single file mode only)

Skip this step if the architecture doc is already in directory mode.

After applying changes to the single-file architecture doc, check whether it should be split:

  1. Count lines: wc -l {{specs_dir}}/architecture.md
  2. Count decision records: number of ### DR-\d+ headings in the file

If lines >= 500 OR decision records >= 10:

  • Invoke Skill(skill="groundwork:split-architecture") — this runs automatically with no user input needed.
  • After the split completes, include in the session summary: "The architecture doc was automatically split into directory format at {{specs_dir}}/architecture/."

If neither threshold is crossed, continue silently.

Change Detection Heuristics

Strong signals (likely architectural):

  • New infrastructure resources (Terraform, CDK changes)
  • New service directories created
  • Database migrations
  • New external API integrations
  • Changes to authentication/authorization
  • New environment variables for services

Weak signals (maybe architectural):

  • New utility functions
  • Refactoring within existing components
  • Bug fixes
  • Test additions
  • Documentation updates

Focus on strong signals. Ask about weak signals only if they seem significant.

Session Summary Format

At session end, provide summary:

markdown
## Architecture Sync Summary

**Session Date:** [date]

### Changes Detected:
1. [Change 1] → Proposed DR-00X
2. [Change 2] → Updated §4.3
3. [Change 3] → No architecture impact (implementation detail)

### Architecture Document:
- [X] Updated with approved changes
- [ ] No changes needed
- [ ] Changes pending user review

### Open Items:
- [Any unresolved architectural questions from session]

Heefeg gestallte Froen

Wat mécht de KI-Skill Source Architecture From Code?

Synchronize architecture document with codebase changes. Usage /groundwork:source-architecture-from-code

Firwat Source Architecture From Code op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Source Architecture From Code besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Source Architecture From Code an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/etr/groundwork/tree/main/skills/source-architecture-from-code an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Source Architecture From Code benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Source Architecture From Code benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Source Architecture From Code domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Source Architecture From Code gratis?

Jo. De Skill gëtt vum etr ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇