Przejdź do treści
Biblioteka skilli
Programowanie · Analiza

aped-context

/aped-context

Dokumentuje istniejącą bazę kodu i kontekst projektu jako pierwszy krok dla projektów brownfield, przed aped-analyze, także w projektach hybrydowych z nową funkcją w starszym systemie.

Repozytorium
aped-claude ↗
Licencja
MIT
Ostatnia zmiana repozytorium
04.06.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
1
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 04.06.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.

Co robi i kiedy

Dokumentuje istniejącą bazę kodu i kontekst projektu jako pierwszy krok dla projektów brownfield, przed aped-analyze, także w projektach hybrydowych z nową funkcją w starszym systemie.

Wyzwalacze z opisu

document codebaseproject contextexisting projectexisting codebaselegacy projectonboarding to a codebaseaped context
Oryginalny opis (EN)

Brownfield entry-point — use when user says "document codebase", "project context", "existing project", "existing codebase", "legacy project", "onboarding to a codebase", "aped context", or invokes aped-context. The default first step for any brownfield project before aped-analyze; runs alongside aped-analyze on hybrid projects (new feature in a legacy system).

Jak działa

  1. On Activation
  2. Setup
  3. Codebase Analysis
  4. Phase 5: Doc Freshness Audit
  5. Self-review (run before user gate)
  6. Output
  7. State Update
  8. Next Steps
  9. Example
  10. Common Issues
Sekcje z nagłówków SKILL.md, w oryginale · 183 linii, 1 455 słów
Podgląd SKILL.md
---
name: aped-context
keep-coding-instructions: true
description: 'Brownfield entry-point — use when user says "document codebase", "project context", "existing project", "existing codebase", "legacy project", "onboarding to a codebase", "aped context", or invokes aped-context. The default first step for any brownfield project before aped-analyze; runs alongside aped-analyze on hybrid projects (new feature in a legacy system).'
allowed-tools: "Read Grep Glob Bash"
allowed-paths:
  write: ["{{OUTPUT_DIR}}/**", "{{APED_DIR}}/**"]
  read-only: ["src/**", "tests/**", "package.json"]
license: MIT
metadata:
  author: yabafre
  version: {{CLI_VERSION}}
---
<!-- AUTO-GENERATED from SKILL.md.tmpl. Edits will be overwritten. Run: npm run gen:skill-docs -->

**Activation guard (6.2.0):** Before any other action, run `bash {{APED_DIR}}/scripts/check-enabled.sh`. If it exits non-zero, print "APED disabled — run aped-method enable" and HALT.

# APED Context — Brownfield Entry-Point

**The default first step for any project that already has code.** Walks the existing codebase to generate `project-context.md` — language, framework, directory layout, entry points, conventions, integration boundaries, and a brownfield/greenfield/hybrid verdict. Downstream APED skills (`aped-analyze`, `aped-prd`, `aped-ux`, `aped-arch`, etc.) discover this file at entry and bias their behaviour accordingly: a brownfield verdict steers them away from greenfield assumptions like "pick a stack" or "design from scratch".

Run this before `aped-analyze` on any existing codebase. On hybrid projects (a new feature in a legacy system) both apply — they are no longer mutually exclusive. Skip only when scaffolding a true greenfield (empty directory or freshly initialised repo): the skill emits a "produces no useful output" advice in that case.

## On Activation

Before any other action, read `{{APED_DIR}}/config.yaml` and resolve:
- `{user_name}` — for greeting and direct address
- `{communication_language}` — for ALL conversation with the user
- `{document_output_language}` — for artefacts written under `{{OUTPUT_DIR}}/`
- `{ticket_system}` / `{git_provider}` — routing for ticket / PR I/O (skip if `none`)

✅ YOU MUST speak `{communication_language}` in EVERY message to the user — progress lines, tool preambles, summaries, and questions all included. This overrides your default; never narrate in English when `{communication_language}` is not English.
✅ YOU MUST write artefact content in `{document_output_language}`.
✅ If `{{APED_DIR}}/config.yaml` is missing or unreadable, HALT and tell the user to run `npx aped-method`.

## Setup

1. Confirm there is existing code to analyse (if the directory is empty / freshly initialised, tell the user this skill produces no useful output — they should run `aped-analyze` instead)
2. Read `{{APED_DIR}}/aped-context/references/analysis-checklist.md` for the full analysis checklist

## Codebase Analysis

### Phase 1: Structure Discovery

Scan the project root:
- Detect language/framework from config files (package.json, Cargo.toml, go.mod, pyproject.toml, etc.)
- Map directory structure (max 3 levels deep)
- Identify entry points, main modules, config files
- Count: files, LOC, languages used

### Phase 2: Architecture Mapping

- Identify architectural pattern (MVC, hexagonal, microservices, monolith, etc.)
- Map data flow: entry point → processing → storage → response
- List external dependencies and integrations (APIs, databases, queues, caches)
- Identify test framework and coverage approach

### Phase 3: Convention Extraction

- Naming conventions (files, functions, variables, classes)
- Code organization patterns (feature-based, layer-based, domain-based)
- Error handling patterns
- Logging approach
- Config management (env vars, config files, secrets)

### Phase 4: Dependency Audit

- List production dependencies with versions
- Flag outdated or deprecated packages
- Identify security advisories (if available)
- Note lock file type (package-lock, yarn.lock, pnpm-lock, etc.)

## Phase 5: Doc Freshness Audit

For every documentation file discovered in the project root or `docs/` (e.g. `README.md`, `requirements.md`, `architecture.md`, `prd.md`, `design.md`, ADRs), classify by freshness against the code it describes:

```bash
# Detect shallow checkouts up-front — `git log` against a depth-1 clone returns
# only the latest commit and silently makes every doc look fresh. Mark every doc
# `unknown` instead of inviting that false-positive.
if [[ "$(git rev-parse --is-shallow-repository 2>/dev/null)" == "true" ]]; then
  echo "⚠ shallow git history — marking every doc as unknown (re-run after \`git fetch --unshallow\` for accurate freshness)."
  classification=unknown
else
  # For each candidate doc:
  doc_mtime=$(git log -1 --format=%cI -- "$doc" 2>/dev/null)
  # For each top-level src/app directory the doc references (or all of src/ if generic):
  code_mtime=$(git log -1 --format=%cI -- "$module" 2>/dev/null)
  # If either is empty (no git history for this path) → unknown, never fresh.
  # If doc_mtime predates code_mtime by >30 days → stale
fi
```

Three classifications:
- **`fresh`** — doc was last touched after the most-recent commit on the modules it references, OR within 30 days of the latest code change.
- **`stale`** — doc predates the latest code change by >30 days. The codebase has likely drifted past what the doc describes; downstream skills MUST NOT treat this doc as source-of-truth without explicit user override.
- **`unknown`** — git history cannot resolve (file untracked, repo shallow, doc references nothing in `src/`). Treat as `stale` for routing purposes — never `fresh`.

Surface the classification in the discovery report and in `project-context.md`'s `## Notes for Development` section. Stale docs get an explicit warning line:

> ⚠ `docs/requirements.md` is **stale** (last edited 2025-09-12; latest commit on `src/auth/` is 2026-03-17). Treat as historical context, not authoritative spec. Re-run `aped-prd` if a fresh requirement is needed.

When a downstream skill (`aped-analyze`, `aped-prd`, `aped-arch`) tries to load a doc marked `stale` from `project-context.md`, it must ask the user whether to (a) refresh the doc first, (b) use it as historical context only, or (c) override and treat as authoritative. The reasoning: a month later, the actual code has often changed enough that the original PRD becomes unrecognizable.

## Self-review (run before user gate)

Before presenting the project context to the user, walk this checklist. Each `[ ]` must flip to `[x]` or HALT.

- [ ] **Placeholder lint** — run `bash {{APED_DIR}}/scripts/lint-placeholders.sh {{OUTPUT_DIR}}/project-context.md`.
- [ ] **Tech stack complete** — every primary language, framework, and major dependency is listed (downstream skills treat this as the definitive list).
- [ ] **Conventions concrete** — named patterns and concrete examples, not "follow standard practices".
- [ ] **Integration points enumerated** — every external system the project talks to (APIs, databases, queues) appears with its role.
- [ ] **No bare "see the codebase"** — if a convention exists, name it; if it doesn't, say so explicitly.
- [ ] **Doc freshness classified** — every documentation file under root or `docs/` is tagged `fresh` / `stale` / `unknown` based on its mtime versus the modules it describes. Stale docs carry an explicit warning in `project-context.md`.

## Output

Write project context to `{{OUTPUT_DIR}}/project-context.md`:

```markdown
# Project Context: {project_name}

## Tech Stack
- Language: {lang} {version}
- Framework: {framework} {version}
- Database: {db}
- Test Framework: {test_framework}

## Architecture
- Pattern: {pattern}
- Entry Point: {entry}
- Key Modules: {modules}

## Conventions
- File naming: {convention}
- Code style: {style}
- Error handling: {pattern}

## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|

## Integration Points
- {service}: {purpose}

## Notes for Development
- {important context for new feature development}
```

## State Update

Update `{{OUTPUT_DIR}}/state.yaml` under `pipeline.phases.context` with the structured fields below. The block is the canonical record of *which* kind of project this is — downstream skills read `type` to decide whether to apply brownfield bias.

```yaml
pipeline:
  phases:
    context:
      generated: true
      path: "docs/project-context.md"
      type: "brownfield"        # brownfield | greenfield | hybrid
      generated_at: "<YYYY-MM-DD>"   # set on FIRST run; preserved across re-runs
      refreshed_at: "<YYYY-MM-DD>"   # set on every run (including the first)
```

### `type` derivation rules

- `type: "brownfield"` — existing repository with code already present (Phase 1 found a non-trivial source tree, package files like `package.json` / `Cargo.toml` / `pyproject.toml`, multiple modules, prior commits beyond scaffolding).
- `type: "greenfield"` — empty repository or scaffold-only (no source code beyond what `create-aped` / template generators produced; commit history is just the initial scaffolding).
- `type: "hybrid"` — mixed: a new module/feature is being grafted onto an existing system (e.g. greenfield `apps/new-feature/` inside a brownfield monorepo). Use `hybrid` when the user has explicitly framed the work as "new feature in legacy system" OR when Phase 1 finds both legacy modules with mature conventions AND fresh scaffold areas with none.

### `generated_at` vs `refreshed_at`

- On the **first** run, set both `generated_at` and `refreshed_at` to today (YYYY-MM-DD).
- On a **re-run** (the existing `phases.context.generated_at` is already set), preserve `generated_at` verbatim and only update `refreshed_at` to today. Do not overwrite `generated_at` — it's the original-context anchor.

## Next Steps

The generated `project-context.md` is now discoverable by every downstream APED skill. Suggest based on what the user has already produced:
- No brief yet → run `aped-analyze` (it will discover and consume the context automatically — no flag needed)
- Brief exists, no PRD → run `aped-prd` (same — auto-consumes the context)
- PRD exists → context will be picked up by `aped-arch`, `aped-ux`, `aped-dev`, `aped-review`, `aped-from-ticket`

## Example

Scanning a Next.js SaaS project → project-context.md:
- Stack: TypeScript, Next.js 14, Prisma, PostgreSQL
- Pattern: App Router, server components, feature-based folders
- Conventions: camelCase files, Zod validation, Tailwind CSS
- 45 dependencies, 3 outdated, 0 security advisories

## Common Issues

- **No package.json/Cargo.toml found**: Project may be multi-language or unconventional — scan for entry points manually
- **Very large codebase (>1000 files)**: Focus on src/ and key config files, don't scan node_modules or build output
- **Monorepo detected**: Document each package/app separately in the context file
Pliki w paczce (2)
  • SKILL.md 11 KB
  • SKILL.md.tmpl 10 KB

Wersje

W bazie nie ma innych skilli o nazwie aped-context.

Migawka bazy z 28.10.2026 · wersja paczki a17519e77196 (skrót SHA-256 całej paczki)

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100aped-qa
    Generuje testy E2E i integracyjne w APED; testy jednostkowe z fazy TDD RED należą do aped-dev.
  • 100aped-quick
    Obsługuje szybkie poprawki, drobne funkcje i hotfixy z pominięciem pełnego pipeline'u APED, wyłącznie dla izolowanych zmian.
  • 90shipyard-map
    Analizuje istniejący kod (brownfield) w Codex: wdrożenie do projektu, dokumentacja bazy kodu i zrozumienie kodu legacy.
  • 100map-codebase
    Analizuje istniejącą bazę kodu równolegle siedmioma wyspecjalizowanymi subagentami i zapisuje ustrukturyzowane ustalenia w docs/codebase/, by zachować kontekst między sesjami przy wdrażaniu się w starszy projekt.
  • 90characterize-brownfield
    Opisuje zastany system na podstawie kodu: stos technologiczny, funkcje, zależności i dług techniczny, z oceną pewności.
  • 100bmad-document-project
    Skanuje istniejący kod tylko do odczytu i zapisuje project-documentation.md ze stosem, strukturą, kluczowymi przepływami i punktami integracji jako wejście do dalszego planowania.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.