-
Notifications
You must be signed in to change notification settings - Fork 2
Custom Templates
How to extend ai-coding-ok with your own templates — for organization-specific conventions, compliance requirements, or specialized project types.
| Scenario | Approach |
|---|---|
| Your team has standard coding conventions | Modify coding-standards.md after install |
| Your org has compliance requirements | Add a COMPLIANCE.md template |
| You work with a specific tech stack repeatedly | Create a templates/ variant for your stack |
| You want to share conventions across repos | Create a shared template repo |
After installing ai-coding-ok, customize the installed files directly:
# Edit the coding standards for your team
vim .github/agent/coding-standards.md
# Add your compliance rules
echo "## SOC2 Requirements" >> .github/agent/memory/project-memory.md
# Commit the changes
git add .github/agent/
git commit -m "chore: customize ai-coding-ok for team conventions"Pros: Simple, no framework changes needed.
Cons: Must repeat for each project. Changes may conflict with upgrades.
Add a custom template to the ai-coding-ok repo and reference it in the install process:
# Create in both languages
mkdir -p templates/en/my-org
mkdir -p templates/zh/my-orgCreate templates/en/my-org/COMPLIANCE.md:
<!-- ai-coding-ok: v3.1.0 -->
# {{project-name}} — Compliance Requirements
## SOC2 Controls
| Control | Requirement | Implementation |
|---------|-------------|----------------|
| Access Control | All endpoints require auth | Enforced by {{framework}} middleware |
| Audit Logging | All data mutations logged | Using {{database}} audit table |
| Encryption | Data encrypted at rest | Using {{database}} encryption |In SKILL.md, add to the "What this skill installs" section and the placeholder replacement list.
In install.sh and install.py, add the new file to the copy list.
REQUIRED_FILES+=("my-org/COMPLIANCE.md")Create a variant of the full template set for a specific tech stack:
templates/
├── en/
│ ├── default/ ← Standard templates
│ └── react-fastapi/ ← Variant for React + FastAPI projects
│ ├── AGENTS.md
│ ├── .github/agent/coding-standards.md ← JS + Python conventions
│ └── ...
└── zh/
└── ...
The variant overrides the default files that need tech-stack-specific content.
For teams that want to share templates across many repos:
# Create a shared template repo
git clone git@github.com:your-org/ai-coding-ok-templates.git
# Structure:
your-org-templates/
├── coding-standards.md ← Override the default
├── project-memory.md ← Add org-specific sections
├── COMPLIANCE.md ← Custom file
└── install.sh ← Wrapper that installs ai-coding-ok + your templatesThe wrapper script:
#!/usr/bin/env bash
# install.sh — install ai-coding-ok + org templates
# 1. Install base ai-coding-ok
bash /path/to/ai-coding-ok/install.sh --copilot
# 2. Overlay org templates (preserve ai-coding-ok placeholders)
cp -n coding-standards.md .github/agent/coding-standards.md
cp -n project-memory.md .github/agent/memory/project-memory.md
cp -n COMPLIANCE.md .github/agent/COMPLIANCE.md
echo "✅ ai-coding-ok + org templates installed"- Use
UPPER_CASE.mdfor root-level files - Use
kebab-case.mdfor subdirectory files - Match the existing naming convention in the target directory
- English:
{{kebab-case-name}}(e.g.,{{org-name}}) - Chinese:
{{中文名称}}(e.g.,{{组织名称}}) - Reuse existing placeholders where possible
- Document new placeholders
Every template file MUST start with:
<!-- ai-coding-ok: v3.1.0 -->Follow the existing section hierarchy:
-
#— Page title -
##— Major sections -
###— Sub-sections -
####— Details
# Create a test project
mkdir /tmp/test-project
cd /tmp/test-project
# Run install with your custom templates
bash /path/to/your-templates/install.sh
# Verify
bash /path/to/ai-coding-ok/scripts/verify.shIn the test project, ask the AI to do a small task and verify:
- Memory files are read before coding
- Memory Updates section appears in the response
- Custom template content is referenced
- Created in both
templates/en/andtemplates/zh/ - Uses existing placeholders where possible
- New placeholders documented
- Version marker on line 1
- Added to
SKILL.mdinstall list - Added to
install.sh/install.py - Added to
verify.shrequired files - Tested with a fresh install
- Tested with an upgrade
- Template System — understand the base template architecture
- Placeholder System — placeholder reference
- Contributing — how to contribute templates back to ai-coding-ok
🧠 ai-coding-ok — AI 编程的 PDCA 记忆闭环。
GitHub · Issues · MIT License