Maintain AI-optimized documentation and organize codebase history for gnwebsite project. Use when updating docs, organizing changelog, improving readability for AI agents, or when documentation becomes too large. Covers changelog archiving, AI-friendly writing patterns, semantic structure, and knowledge retrieval optimization. Ensures documentation stays readable and discoverable for both humans and AI systems.
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
npx agent-skills-cli listSkill Instructions
name: documentation-management description: Maintain AI-optimized documentation and organize codebase history for gnwebsite project. Use when updating docs, organizing changelog, improving readability for AI agents, or when documentation becomes too large. Covers changelog archiving, AI-friendly writing patterns, semantic structure, and knowledge retrieval optimization. Ensures documentation stays readable and discoverable for both humans and AI systems.
Documentation Management
Comprehensive guide for maintaining high-quality, AI-optimized documentation and managing growing codebase history in gnwebsite project.
When to Use This Skill
- User asks to "update documentation" or "organize the changelog"
- Changelog exceeds 1500 lines or 6 months of sessions
- Documentation becomes hard to navigate or retrieve information from
- After major architectural changes or refactors
- When implementing new patterns that should be documented
- Creating or updating technical documentation for AI consumption
- When you hear: "The changelog is too big" or "Make docs more readable"
Core Principles
- AI-Optimized: Write for both humans and AI retrieval systems
- Self-Contained: Each section should work independently
- Explicit Context: Never rely on implicit knowledge or visual cues
- Hierarchical: Clear structure with semantic headings
- Discoverable: Use consistent terminology for semantic search
- Archived: Rotate old changelog entries to maintain readability
Documentation Philosophy (From kapa.ai Best Practices)
How AI Systems Process Documentation
AI agents use Retrieval-Augmented Generation (RAG) which works in three steps:
- Chunking: Documents are divided into smaller, focused sections
- Retrieval: Semantic search finds relevant chunks matching the query
- Generation: LLM uses retrieved chunks to construct answers
Critical implications:
- β Sections must be self-contained (can't assume linear reading)
- β Context must be explicit (AI can't infer unstated information)
- β Related info must be proximate (chunking may separate distant content)
- β Terminology must be consistent (enables semantic discoverability)
AI-Friendly Writing Patterns
1. Self-Contained Sections
β Context-Dependent (Bad):
## Updating Webhook URLs
Now change the endpoint to your new URL and save the configuration.
β Self-Contained (Good):
## Updating Django Webhook URLs in gnwebsite
To update webhook endpoints in gnwebsite backend:
1. Navigate to Admin Panel β Webhooks
2. Select the webhook to modify
3. Change endpoint URL field to new address
4. Click "Save" to apply changes
**Location**: `/panel-0911/webhooks/`
**Model**: `jewelry_portfolio.models.WebhookConfig`
Why: AI retrieves sections based on relevance, not document order. Include essential context (what system, where to find, complete steps).
2. Explicit Terminology
β Vague References (Bad):
## Configure Timeouts
Configure custom timeout settings through the admin panel.
β Explicit Product/Feature Names (Good):
## Configure Django API Timeouts in gnwebsite
Configure custom timeout settings for Django REST Framework endpoints:
- **Frontend API calls**: `axios` timeout in `frontend/src/api/index.ts`
- **Backend Gunicorn**: `timeout = 30` in `gunicorn.conf.py`
- **Nginx proxy**: `proxy_read_timeout 30s` in `nginx.conf`
Why: Product-specific terms improve semantic search. "Django" and "gnwebsite" create clear signals for retrieval.
3. Proximate Context
β Scattered Information (Bad):
Authentication tokens expire after 24 hours by default.
The system provides several configuration options for different environments.
When implementing the login flow, ensure you handle this appropriately.
β Context Proximity (Good):
Authentication tokens expire after 24 hours by default. When implementing the
login flow in gnwebsite, handle token expiration by:
1. Refreshing tokens before 24-hour limit (recommended: 23 hours)
2. Implementing error handling for expired token responses (401 errors)
3. Redirecting to login on token expiration
**Configuration**: `SIMPLE_JWT['ACCESS_TOKEN_LIFETIME']` in `settings.py`
Why: Keeping constraints near implementation guidance ensures they stay together during chunking.
4. Text Equivalents for Visuals
β Visual-Dependent (Bad):
See the diagram below for the complete API workflow:

Follow these steps to implement the integration.
β Text-Based Alternative (Good):
## gnwebsite OpenAPI Client Generation Workflow
The backend β frontend API sync follows this workflow:
1. **Update Backend**: Modify Django models/serializers/views
2. **Run Tests**: `docker-compose exec backend pytest jewelry_portfolio/ -x`
3. **Generate Schema**: `python manage.py spectacular --file openapi_schema.json`
4. **Generate Client**: `npx @openapitools/openapi-generator-cli generate ...`
5. **Type Check**: `cd frontend && npm run type-check`
6. **Update Services**: Modify service wrappers to use new types
7. **Test Frontend**: `npm run test:run`
8. **Commit Both**: `git add backend/openapi_schema.json frontend/src/api/generated/`

_Visual representation of the workflow steps above_
Why: AI can't parse images. Text-based workflows are fully discoverable.
5. Error Messages with Context
β Generic Troubleshooting (Bad):
## Connection Problems
If the connection fails, check your network settings.
β Specific Error Context (Good):
## Django Database Connection Errors in gnwebsite
### Error: "django.db.utils.OperationalError: could not connect to server"
**Cause**: PostgreSQL container not running or wrong credentials
**Solution**:
1. Check container status: `docker-compose ps`
2. Restart services: `docker-compose up -d`
3. Verify `DATABASE_URL` in `backend/.env`
4. Check PostgreSQL logs: `docker-compose logs backend`
### Error: "relation does not exist"
**Cause**: Missing migrations
**Solution**:
1. Run migrations: `docker-compose exec backend python manage.py migrate`
2. Verify migration files exist in `backend/jewelry_portfolio/migrations/`
Why: Users search by copying exact error messages. Including them improves discoverability.
6. Hierarchical Structure
β Good Information Architecture:
# Django Authentication (Product Family)
## HttpOnly Cookie JWT Flow (Specific Feature)
### Setup Instructions (Functional Context)
#### Backend Configuration (Component)
#### Frontend Configuration (Component)
### Troubleshooting (Functional Context)
#### Token Expiration Issues (Specific Problem)
#### CORS Configuration (Specific Problem)
Why: URL paths, document titles, and headings provide contextual metadata for retrieval.
Changelog Management
When to Archive
Archive changelog entries when:
- β File exceeds 1500 lines (currently at 1879 lines!)
- β Sessions older than 6 months
- β Historical sessions not referenced in recent work
- β Patterns documented in CODEBASE_ESSENTIALS.md
Current status: CODEBASE_CHANGELOG.md has 1879 lines β Archive needed!
Archive Structure
docs/changelog/
βββ 2026-Q1.md # Jan-Mar 2026
βββ 2025-Q4.md # Oct-Dec 2025
βββ 2025-Q3.md # Jul-Sep 2025
βββ archive-index.md # Summary of all archived periods
Archive Procedure
Step 1: Create Archive File
# Create quarterly archive
mkdir -p docs/changelog
touch docs/changelog/2026-Q1.md
Step 2: Move Old Sessions
Identify sessions older than 3 months:
# Example: Moving sessions from Oct-Dec 2025 to archive
# Cut from CODEBASE_CHANGELOG.md, paste to docs/changelog/2025-Q4.md
Archive file template:
# GN Website Changelog - 2025 Q4 (Oct-Dec)
Historical session notes from October-December 2025. For current patterns, see `CODEBASE_ESSENTIALS.md`.
**Archive Period**: October 1 - December 31, 2025
**Total Sessions**: 24
**Major Themes**: Authentication refactor, image optimization, tag system
---
## Session: [Title] (Dec 15, 2025)
[Full session content...]
---
## Session: [Title] (Dec 10, 2025)
[Full session content...]
Step 3: Update Main Changelog Header
# GN Website Changelog
Historical session notes and detailed changes. For current patterns and invariants, see `CODEBASE_ESSENTIALS.md`.
**Recent Sessions**: Last 3 months (current file)
**Older Sessions**: See [docs/changelog/](docs/changelog/) for quarterly archives
---
[Keep only recent sessions here]
Step 4: Create Archive Index
# Changelog Archive Index
Historical changelog organized by quarter. For current sessions, see main `CODEBASE_CHANGELOG.md`.
## 2026
### [Q1 (Jan-Mar)](2026-Q1.md)
- Dependency updates skill creation
- WYSIWYG image tracking
- Tag masonry performance optimization
- **Sessions**: 12
## 2025
### [Q4 (Oct-Dec)](2025-Q4.md)
- Privacy policy feature
- Pagination UI implementation
- Authentication refactor
- **Sessions**: 24
### [Q3 (Jul-Sep)](2025-Q3.md)
- Initial project setup
- Django + Vue architecture
- **Sessions**: 18
Archiving Best Practices
What to Archive:
- β Sessions older than 3-6 months
- β Completed features fully documented elsewhere
- β Historical debugging sessions
- β Temporary workarounds that were replaced
What NOT to Archive:
- β Sessions documenting current patterns
- β Recent architectural decisions
- β Frequently referenced sessions
- β Last 3 months of work
Archive Naming:
YYYY-QN.mdfor quarterly archives (e.g.,2026-Q1.md)YYYY-MM.mdfor monthly archives if needed (high activity periods)archive-index.mdfor searchable summary
Documentation Update Workflow
After Implementing Features
-
Update CODEBASE_ESSENTIALS.md if patterns changed:
## Critical Patterns & Invariants - **New Pattern**: Description with examples - Link to reference implementation -
Add Changelog Entry (MANDATORY for significant changes):
## Session: [Brief Title] (MMM D, YYYY) **Goal**: One sentence description **Changes**: - [file/path.ts](file/path.ts#L123): What changed and why **Validation**: - β Backend tests: X passed - β Frontend tests: X passed **Key Learning**: Pattern or gotcha for future reference -
Create Detailed Docs for complex features:
docs/ βββ components/COMPONENT_NAME.md βββ patterns/PATTERN_NAME.md βββ guides/GUIDE_NAME.md βββ incidents/INCIDENT_NAME.md
Documentation File Structure
docs/
βββ README.md # Documentation index
βββ architecture/ # System design docs
β βββ OVERVIEW.md
β βββ DATA_FLOW.md
βββ components/ # Component-specific docs
β βββ TURBULENT_DISSOLVE_IMAGE.md
β βββ PAGINATION_CONTROLS.md
βββ deployment/ # Deployment guides
β βββ RAILWAY.md
β βββ PRODUCTION.md
βββ guides/ # How-to guides
β βββ DEVELOPER_CHECKLIST.md
β βββ TESTING_STRATEGY.md
β βββ AI_AGENT_PERCEPTION.md
βββ incidents/ # Problem + solution docs
β βββ RAILWAY_DYNAMIC_IMPORT_FAILURE.md
βββ patterns/ # Reusable patterns
β βββ TWO_STAGE_UPLOAD_TESTING.md
β βββ UNIFIED_IMAGE_ARRAY_REFACTOR.md
βββ planning/ # Planning documents
β βββ FEATURE_ROADMAP.md
βββ privacy/ # Legal/compliance docs
β βββ privacy_and_cookie_policy.md
βββ reference/ # API references
β βββ MAILERLITE_INTEGRATION.md
βββ reviews/ # Code review guidelines
β βββ PULL_REQUEST_TEMPLATE.md
βββ changelog/ # Archived changelogs
βββ archive-index.md
βββ 2026-Q1.md
βββ 2025-Q4.md
Documentation Quality Checklist
Before finalizing any documentation:
Structure
- Uses semantic headings (H1 β H2 β H3, no skips)
- Each section is self-contained
- Related information is proximate (same section/paragraph)
- Hierarchical structure reflects logical relationships
Content
- Includes explicit product/feature names (gnwebsite, Django, Vue)
- No reliance on visual layout or positioning
- Error messages quoted exactly with solutions
- Prerequisites stated explicitly (no assumptions)
- Text alternatives for any diagrams/images
Discoverability
- Consistent terminology throughout
- Keywords appear in headings and first paragraph
- Cross-links to related documentation
- Examples include actual code/commands
AI Optimization
- Sections work when read in isolation
- No references like "as mentioned above" without repeating context
- Code examples include language identifiers (
python,typescript) - File paths use absolute paths from project root
Common Documentation Anti-Patterns
β Contextual Dependencies
Bad: "Now update the configuration we set up earlier."
Good: "Update the Django settings in backend/gnwebsite_config/settings.py..."
β Implicit Knowledge
Bad: "Run the standard Django commands."
Good:
# Apply database migrations
docker-compose exec backend python manage.py migrate
# Collect static files
docker-compose exec backend python manage.py collectstatic --noinput
β Visual-Only Information
Bad: Tables with merged cells and complex layouts
Good: Structured lists with repeated context:
### Django Environment Variables
**DATABASE_URL**
- Purpose: PostgreSQL connection string
- Format: `postgresql://user:pass@host:5432/dbname`
- Required: β
Production, β Development (uses SQLite)
**SECRET_KEY**
- Purpose: Django cryptographic signing
- Format: 50+ character random string
- Required: β
Always
β Scattered Prerequisites
Bad: Prerequisites in introduction, setup in middle, troubleshooting at end
Good: Self-contained sections with inline prerequisites:
## Setting Up Django Webhooks in gnwebsite
**Prerequisites** (check before proceeding):
- β
Django admin access (`/panel-0911/`)
- β
Valid HTTPS endpoint with SSL certificate
- β
gnwebsite API credentials
**Steps**:
1. Navigate to Admin Panel β Settings β Webhooks
2. ...
Template: Changelog Session Entry
## Session: [Brief Descriptive Title] (MMM D, YYYY)
**Goal**: One-sentence description of what this session accomplished
**Problem** (if fixing a bug/issue):
Brief description of the problem that required fixing
**Changes**:
- [backend/path/to/file.py](backend/path/to/file.py#L123-L145): **CREATED/UPDATED/FIXED**
- What changed at this location
- Why it was necessary
- Key implementation details
- [frontend/src/path/to/component.vue](frontend/src/path/to/component.vue):
- What changed
- Pattern used (link to CODEBASE_ESSENTIALS.md if relevant)
**Validation**:
- β
Backend tests: X passed, Y skipped
- β
Frontend tests: X passed
- β
TypeScript: No errors
- β
Manual testing: Description of what was tested
**Key Learning**:
Pattern, gotcha, or insight that should be remembered for future work. This often becomes a candidate for CODEBASE_ESSENTIALS.md.
**References** (optional):
- Link to related OpenSpec proposals
- Link to detailed documentation in docs/
- Link to related incidents or patterns
Template: Feature Documentation
# [Feature Name]
Brief overview of what this feature does and why it exists.
## Overview
- **Purpose**: What problem does this solve?
- **Users**: Who uses this feature?
- **Location**: Where in the app is this feature?
## Architecture
### Backend (Django)
**Models**: `jewelry_portfolio.models.FeatureName`
- Fields and relationships
- Key methods and their purpose
**API Endpoints**: `/api/feature/`
- GET: Retrieve feature data
- POST: Create new feature
- PUT/PATCH: Update feature
- DELETE: Remove feature
**Permissions**: `IsAdminOrReadOnly`
### Frontend (Vue 3)
**Views**:
- `FeatureView.vue` - Public view at `/feature`
- `FeatureForm.vue` - Admin editor at `/panel-0911/feature`
**Services**: `featureService.ts`
- API wrapper methods
- Type definitions
**Components**:
- `FeatureCard.vue` - Display component
- `FeatureEditor.vue` - Editing component
## Usage Examples
### Retrieving Feature Data
```typescript
import { featureService } from '@/services/featureService'
const data = await featureService.get()
console.log(data.value)
Admin Updates
const updated = await featureService.update({
field: 'new value',
anotherField: 123
})
Testing
Backend Tests
Location: backend/jewelry_portfolio/test_feature.py
# Run feature tests
docker-compose exec backend pytest jewelry_portfolio/test_feature.py -v
Coverage:
- Model CRUD operations
- API permissions (public/admin)
- Serialization/validation
- Edge cases
Frontend Tests
Location: frontend/tests/feature.test.ts
# Run feature tests
cd frontend && npm run test:run tests/feature.test.ts
Coverage:
- Component rendering
- API integration
- Error handling
- User interactions
Common Patterns
Pattern 1: [Name]
When to use: Description
Example:
# Backend example
// Frontend example
Troubleshooting
Error: "[Exact Error Message]"
Cause: What causes this error
Solution:
- Step-by-step fix
- With commands
- And verification
Related Documentation
## Changelog Archiving Checklist
When archiving old changelog entries:
- [ ] Identify sessions older than 3-6 months
- [ ] Create quarterly archive file: `docs/changelog/YYYY-QN.md`
- [ ] Copy archive header template with period, session count, themes
- [ ] Move old sessions from CODEBASE_CHANGELOG.md to archive
- [ ] Update main changelog header with archive reference
- [ ] Create/update `docs/changelog/archive-index.md` with summary
- [ ] Verify links to archived sessions still work
- [ ] Test that recent sessions remain easily accessible
- [ ] Commit with message: `docs: archive changelog Q[N] YYYY (X sessions)`
## Integration with Other Skills
- **After features**: Use [feature-implementation](../feature-implementation/SKILL.md) β then update docs
- **Before archiving**: Check [developer-checklist](../developer-checklist/SKILL.md) for recent patterns
- **Creating skills**: Use [skill-creator](../skill-creator/SKILL.md) to convert docs into skills
## Related Files
- [CODEBASE_ESSENTIALS.md](../../../CODEBASE_ESSENTIALS.md) - Current patterns and invariants
- [CODEBASE_CHANGELOG.md](../../../CODEBASE_CHANGELOG.md) - Recent session history
- [docs/README.md](../../../docs/README.md) - Documentation index
- [AGENTS.md](../../../AGENTS.md) - AI agent workflow instructions
## Quick Reference
### Archive Changelog (When > 1500 lines)
```bash
# 1. Create archive directory
mkdir -p docs/changelog
# 2. Create quarterly archive
cat > docs/changelog/2026-Q1.md << 'EOF'
# GN Website Changelog - 2026 Q1 (Jan-Mar)
**Archive Period**: January 1 - March 31, 2026
**Total Sessions**: 12
**Major Themes**: Dependency management, image tracking, performance
---
[Move old sessions here]
EOF
# 3. Update main changelog header
# Remove old sessions (keep last 3 months)
# 4. Create/update index
cat > docs/changelog/archive-index.md << 'EOF'
# Changelog Archive Index
## 2026
### [Q1 (Jan-Mar)](2026-Q1.md) - 12 sessions
EOF
# 5. Commit
git add docs/changelog/ CODEBASE_CHANGELOG.md
git commit -m "docs: archive changelog Q1 2026 (12 sessions)"
Create Feature Documentation
# Create component doc
cat > docs/components/COMPONENT_NAME.md << 'EOF'
# Component Name
Brief overview...
## Architecture
...
EOF
# Create pattern doc
cat > docs/patterns/PATTERN_NAME.md << 'EOF'
# Pattern Name
When to use this pattern...
EOF
Update CODEBASE_ESSENTIALS.md
## Critical Patterns & Invariants
- **New Pattern Name**: Description
- β
**DO:** Good practice
- β **DON'T:** Anti-pattern
- **Reference**: [ComponentName.vue](path/to/file.vue)
More by arpa73
View allSafe code refactoring guide for gnwebsite project. Use when refactoring components, removing duplication, improving code structure, or simplifying complex functions. Covers test-driven refactoring, incremental changes, extract function/composable patterns, and rollback procedures. Ensures refactoring preserves behavior while improving code quality.
Create new Agent Skills from existing project guides and documentation. Use when the user wants to create a skill, turn documentation into a skill, or make a guide into a reusable capability. Converts guides from docs/ into portable .github/skills/ format following VS Code Agent Skills standard.
Create new Agent Skills from existing project guides and documentation. Use when the user wants to create a skill, turn documentation into a skill, or make a guide into a reusable capability. Converts guides from docs/ into portable .github/skills/ format following VS Code Agent Skills standard.
Safe dependency update workflow for gnwebsite fullstack Django/Vue project. Use when updating packages, upgrading dependencies, fixing vulnerabilities, or when user asks to update dependencies. Covers backend Python (pyproject.toml), frontend npm packages, vulnerability audits, testing requirements, and rollback procedures. Ensures updates maintain compatibility and don't break existing functionality.
