feat: add .architect/ project mapping system with architect-indexer agent and Docker containerization

- Add .architect/ directory structure (10 template files) as project brain for agent orientation
- Add architect-indexer agent that scans codebase and generates structured architecture docs
- Add Docker containerization: Dockerfile.architect-indexer, docker-compose.architect.yml
- Add TypeScript project-mapper module with staleness detection and context injection
- Add /index-project command, architect-first-contact rule, project-mapping skill
- Integrate orchestrator first-contact check: triggers indexing before any task delegation
- Add npm arch:* scripts for Docker-based indexing workflow
- Register agent in capability-index.yaml and AGENTS.md
This commit is contained in:
¨NW¨
2026-04-22 20:01:38 +01:00
parent 9d85dd9f83
commit 6b71ea2b57
26 changed files with 2160 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ Agent: Runs full pipeline for issue #42 with Gitea logging
| `/research [topic]` | Run research and self-improvement | `/research multi-agent` |
| `/evolution log` | Log agent model change | `/evolution log planner "reason"` |
| `/evolution report` | Generate evolution report | `/evolution report` |
| `/index-project` | Index codebase into .architect/ for agent orientation | `/index-project` |
| `/web-test <url>` | Visual regression testing in Docker | `/web-test https://bbox.wtf` |
| `/e2e-test <url>` | E2E browser automation tests | `/e2e-test https://my-app.com` |
@@ -85,6 +86,7 @@ These agents are invoked automatically by `/pipeline` or manually via `@mention`
| `@agent-architect` | Creates new agents | glm-5.1 | thinking | capability-analyst, requirement-refiner, system-analyst |
| `@workflow-architect` | Creates workflows | glm-5.1 | thinking | *(edits files)* |
| `@markdown-validator` | Validates Markdown | nemotron-3-nano:30b | — | orchestrator |
| `@architect-indexer` | Maps project codebase into .architect/ | glm-5.1 | thinking | system-analyst, orchestrator |
### Cognitive Enhancement
| Agent | Role | Model | Variant | Can Call |
@@ -292,8 +294,74 @@ where:
| `.kilo/shared/gitea-api.md` | Centralized Gitea API client |
| `.kilo/shared/gitea-commenting.md` | Comment format for Gitea |
| `.kilo/shared/self-evolution.md` | Self-evolution protocol |
| `.kilo/rules/architect-first-contact.md` | First-contact project indexing rules |
| `.kilo/skills/project-mapping/SKILL.md` | Project mapping skill (`.architect/` system) |
| `.architect/` | Project codebase map (auto-indexed, see below) |
| `src/kilocode/` | TypeScript API for programmatic use |
## `.architect/` Project Mapping
The `.architect/` directory is the **project brain** — a structured, auto-indexed map of the codebase that all agents read before starting work.
### When Is It Used
1. **Orchestrator first contact**: Before routing any task, checks `.architect/state.json`
2. **Stale or missing**: Triggers `architect-indexer` to build/update
3. **Fresh**: Agents read relevant sections for context
4. **After changes**: `lead-developer`/`the-fixer` mark affected sections as stale
### Structure
```
.architect/
├── README.md # Navigation index (auto-updated)
├── project.json # Machine-readable project metadata
├── state.json # Index freshness state (hashes, timestamps)
├── architecture/
│ ├── overview.md # Architecture pattern, layers, boundaries
│ └── dependency-graph.md # Module dependency graph
├── entities/
│ └── entities.md # Domain entities, fields, relationships
├── db-schema/
│ └── schema.md # Tables, columns, indexes, foreign keys
├── api-surface/
│ └── endpoints.md # API endpoints, methods, auth, controllers
├── conventions/
│ └── conventions.md # Naming, patterns, forbidden practices
├── maps/
│ ├── file-graph.json # Programmatic file→imports/exports graph
│ └── module-graph.json # Programmatic module→dependencies graph
└── tech-stack/
└── stack.md # Languages, frameworks, databases, tools
```
### Context Injection Per Agent
| Agent | `.architect/` Sections |
|-------|----------------------|
| system-analyst | architecture/overview, entities, db-schema, api-surface |
| sdet-engineer | api-surface, entities, conventions |
| lead-developer | conventions, entities, architecture/overview |
| code-skeptic | conventions, architecture/dependency-graph |
| the-fixer | conventions, relevant file section |
| php-developer | conventions, entities, db-schema, api-surface |
| python-developer | conventions, entities, db-schema, api-surface |
| go-developer | conventions, entities, db-schema, api-surface |
| frontend-developer | conventions, api-surface, architecture/overview |
| backend-developer | conventions, entities, db-schema, api-surface |
### Staleness Triggers
| Event | Sections Marked Stale |
|-------|----------------------|
| New/removed file | file_graph, module_graph |
| New dependency | tech_stack (full reindex) |
| New migration | db_schema |
| New model/entity | entities |
| New API endpoint | api_surface |
| Convention change | conventions |
| Structural refactor | architecture_overview, dependency_graph |
## Using the TypeScript API
```typescript