### Execute Project Setup Steps Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif/SKILL.md This bash script outlines the steps to execute the project setup, including directory creation, configuration updates, and skill installation. ```bash mkdir -p .ai-factory node ~/{{skills_dir}}/aif/references/update-config.mjs --template ~/{{skills_dir}}/aif/references/config-template.yaml --target .ai-factory/config.yaml --payload .ai-factory/config.update.json rm .ai-factory/config.update.json # Ensure .ai-factory/rules/ directory exists # Write .ai-factory/rules/base.md # ... other steps ``` -------------------------------- ### Docker Setup Summary Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-dockerize/references/SUMMARY-FORMAT.md This is a template for summarizing a Docker setup. It lists created files, provides quick start commands, and details services. ```markdown ## Docker Setup Complete ### Files Created/Updated - Dockerfile (multi-stage: development + production) - compose.yml (app + postgres + redis, COMPOSE_PROJECT_NAME from .env) - compose.override.yml (dev: hot reload, debug ports, mailpit) - compose.production.yml (hardened: read-only, non-root, resource limits, no infra ports) - .dockerignore (38 exclusion rules) - .env.example (with COMPOSE_PROJECT_NAME, DB credentials, app config) - docker/angie/ (reverse proxy config, if needed) - deploy/scripts/ (deploy, update, logs, health-check, rollback, backup) ### Quick Start # Development docker compose up # Development with email testing docker compose --profile dev up # Production (locally) docker compose -f compose.yml -f compose.production.yml up -d # Build production image docker build --target production -t myapp:latest . ### Services | Service | Port (dev) | Port (prod) | Image | |---------|------------|-------------|-------| | app | 3000, 9229 | — | built locally | | postgres | 5432 | — | postgres:17-alpine | | redis | 6379 | — | redis:7-alpine | | mailpit | 8025, 1025 | — | axllent/mailpit | ``` -------------------------------- ### Installation Hint Format Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/SUMMARY-FORMAT.md A general format for providing installation instructions for build tools if they are not already installed. This ensures users can set up the necessary environment. ```markdown ### Installation [install instructions for task/just/mage if not already installed] ``` -------------------------------- ### Go Build Command Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-ci/SKILL.md Example of a build command for Go projects. ```bash go build ./... ``` -------------------------------- ### Java Build Command Examples Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-ci/SKILL.md Examples of build commands for Java projects using Maven or Gradle. ```bash mvn package -DskipTests -B / ./gradlew assemble ``` -------------------------------- ### Rust Build Command Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-ci/SKILL.md Example of a release build command for Rust projects. ```bash cargo build --release ``` -------------------------------- ### Example Extension Directory Structure Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/extensions.md This illustrates the typical directory layout for an installed AI Factory extension. ```tree your-project/ ├── .ai-factory/ │ ├── extensions/ │ │ └── aif-ext-example/ # Installed extension │ │ ├── extension.json │ │ ├── commands/ │ │ ├── injections/ │ │ ├── skills/ │ │ └── mcp/ │ └── ... ├── .ai-factory.json # extensions[] array tracks installed extensions └── .mcp.json # MCP servers merged here (for Claude Code) ``` -------------------------------- ### Just Installation Command Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/SUMMARY-FORMAT.md Provides the command to install the Just build tool using Cargo or Homebrew. ```bash cargo install just ``` ```bash brew install just ``` -------------------------------- ### Standard MCP Runtime Wrapper Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif/SKILL.md Example of wrapping the filesystem server for standard MCP runtimes, using the 'mcpServers' key. ```json { "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] } } } ``` -------------------------------- ### Make Installation Command Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/SUMMARY-FORMAT.md Provides the command to install GNU Make, typically pre-installed on most systems. ```bash brew install make ``` -------------------------------- ### Example .env.example File Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-dockerize/references/FILE-ORGANIZATION.md This example `.env.example` file demonstrates how to define project, database, application, and production-specific environment variables. Production variables are commented out and can be uncommented for deployment. ```env # === Project === COMPOSE_PROJECT_NAME=myapp # === Database === DB_NAME=mydb DB_USER=app DB_PASSWORD=changeme POSTGRES_VERSION=17 # === Application === LOG_LEVEL=debug # prod: warn # (add project-specific vars detected in Step 2.8) # === Production (uncomment for deploy) === # DOCKER_REGISTRY=ghcr.io # DOCKER_IMAGE=myapp # VERSION=latest # ALLOWED_ORIGINS=https://myapp.com # TRUSTED_PROXIES=172.16.0.0/12 ``` -------------------------------- ### OpenCode Runtime Wrapper Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif/SKILL.md Example of wrapping the filesystem server for OpenCode runtime. Note the 'type: "local"' and command as an array. ```json { "mcp": { "filesystem": { "type": "local", "command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "."] } } } ``` -------------------------------- ### Example Extension Manifest with Skill Replacement Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/extensions.md This example shows a typical extension manifest structure including custom skills and a skill replacement for `aif-commit`. The extension's `my-commit/SKILL.md` will be installed as `aif-commit/SKILL.md`. ```json { "name": "aif-ext-custom-commit", "version": "1.0.0", "skills": ["skills/my-commit"], "replaces": { "skills/my-commit": "aif-commit" } } ``` -------------------------------- ### Task Installation Command Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/SUMMARY-FORMAT.md Provides the command to install the Task build tool using Go modules or Homebrew. ```bash go install github.com/go-task/task/v3/cmd/task@latest ``` ```bash brew install go-task ``` -------------------------------- ### Resuming Implementation Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-implement/references/IMPLEMENTATION-GUIDE.md Example dialogue showing the agent resuming an implementation session, detecting completed tasks, and continuing from the next pending task. ```text User: /aif-implement Agent: Resuming implementation... Found 3 completed tasks, 5 pending. Continuing from Task #4: Implement JWT generation [Executes task #4] ``` -------------------------------- ### GitHub Copilot Runtime Wrapper Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif/SKILL.md Example of wrapping the filesystem server for GitHub Copilot runtime. Note the 'type: "stdio"' key. ```json { "servers": { "filesystem": { "type": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] } } } ``` -------------------------------- ### Example .env Files Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-dockerize/references/BEST-PRACTICES.md Provides examples of `.env` files for managing environment variables. `.env` contains real secrets and is gitignored, while `.env.example` contains placeholders and is committed. ```env # .env (gitignored, never committed) — real values COMPOSE_PROJECT_NAME=myapp DB_PASSWORD=real-secret-value OPENAI_API_KEY=sk-... ``` ```env # .env.example (committed, with placeholders) COMPOSE_PROJECT_NAME=myapp DB_PASSWORD=changeme OPENAI_API_KEY= ``` -------------------------------- ### Install and Initialize AI Factory Project Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/getting-started.md Install AI Factory globally, navigate to your project, and initialize it. You can use the interactive wizard or specify agents and MCPs non-interactively. ```bash # 1. Install AI Factory npm install -g ai-factory # 2. Go to your project cd my-project # 3. Initialize — pick agents, install skills, configure MCP ai-factory init # Or non-interactively: ai-factory init --agents claude --mcp github,playwright # 4. Open your AI agent (Claude Code, Cursor, etc.) and run: /aif # Codex CLI and Codex app use: $aif # 5. Optional discovery before planning /aif-explore Add user authentication with OAuth # 6. Start building /aif-plan Add user authentication with OAuth ``` -------------------------------- ### Node.js Build Command Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-ci/SKILL.md Example of a build command for Node.js projects that have a 'build' script defined in their package.json. ```bash npm run build / pnpm build ``` -------------------------------- ### AI Factory Project Setup and Modes Source: https://github.com/lee-to/ai-factory/blob/2.x/AGENTS.md The `/aif` command initiates project setup with three distinct modes based on project state and user input: existing projects, new projects with descriptions, and empty projects. ```bash /aif (3 scenarios) ↓ Check: has arguments? has project files? ↓ ┌─────────────────────────────────────────────────────────────┐ │ Mode 1: Existing project (no args + has package.json, etc.) │ │ → Analyze project → Generate DESCRIPTION.md → Setup │ ├─────────────────────────────────────────────────────────────┤ │ Mode 2: New project with description │ │ → Interactive stack selection → DESCRIPTION.md → Setup │ ├─────────────────────────────────────────────────────────────┤ │ Mode 3: Empty project (no args + no config files) │ │ → Ask "What are you building?" → Stack selection → Setup │ └─────────────────────────────────────────────────────────────┘ ``` -------------------------------- ### TaskCreate Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-plan/references/TASK-FORMAT.md Example of a TaskCreate entry, specifying the subject, a detailed description including logging requirements, and the active form. ```text TaskCreate: subject: "Implement user login endpoint" description: | Create POST /api/auth/login endpoint that: - Accepts email and password - Validates credentials against database - Returns JWT token on success - Returns 401 on invalid credentials LOGGING REQUIREMENTS: - Log function entry with request context - Log validation result (pass/fail with reasons) - Log external service calls and responses - Log any errors with full context - Use format: [ServiceName.method] message {data} - Use log levels (DEBUG/INFO/WARN/ERROR) Files: src/api/auth/login.ts, src/services/auth.ts activeForm: "Implementing login endpoint" ``` -------------------------------- ### AI Factory Configuration Example Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/configuration.md This is a comprehensive example of the `.ai-factory/config.yaml` file, illustrating various settings for language, paths, workflow, git integration, and rules. Defaults are used when sections or keys are not specified. ```yaml # AI Factory Configuration # All sections are optional — defaults are used when not specified. # Language Settings language: # Language for AI-agent communication (prompts, questions, explanations) # Options: en, ru, de, fr, es, zh, ja, ko, pt, it ui: en # Language for generated artifacts (plans, specs, documentation) artifacts: en # How to handle technical terms: keep | translate | mixed technical_terms: keep # Path Configuration (all relative to project root) paths: description: .ai-factory/DESCRIPTION.md architecture: .ai-factory/ARCHITECTURE.md docs: docs/ roadmap: .ai-factory/ROADMAP.md research: .ai-factory/RESEARCH.md rules_file: .ai-factory/RULES.md plan: .ai-factory/PLAN.md plans: .ai-factory/plans/ fix_plan: .ai-factory/FIX_PLAN.md security: .ai-factory/SECURITY.md references: .ai-factory/references/ patches: .ai-factory/patches/ evolutions: .ai-factory/evolutions/ evolution: .ai-factory/evolution/ specs: .ai-factory/specs/ rules: .ai-factory/rules/ qa: .ai-factory/qa/ archive: .ai-factory/archive/ # Workflow Settings workflow: auto_create_dirs: true # Create .ai-factory/ directories when missing plan_id_format: slug # slug | sequential (timestamp, uuid — reserved, fall back to slug) analyze_updates_architecture: true architecture_updates_roadmap: true verify_mode: normal # strict | normal | lenient # Git Settings git: enabled: true # Set false for non-git repositories base_branch: main # Diff / review / merge target when git is enabled create_branches: true # Full plans may create branches when enabled branch_prefix: feature/ # Prefix for auto-created plan branches skip_push_after_commit: false # If true, /aif-commit skips push prompt after commit # Rules Configuration rules: base: .ai-factory/rules/base.md # Base rules file # api: .ai-factory/rules/api.md # frontend: .ai-factory/rules/frontend.md # backend: .ai-factory/rules/backend.md # database: .ai-factory/rules/database.md ``` -------------------------------- ### Display Implementation Progress Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-implement/SKILL.md Shows an example of how implementation progress is displayed to the user. ```markdown ## Implementation Progress ✅ Completed: 3/8 tasks 🔄 In Progress: Task #4 - Implement search service ⏳ Pending: 4 tasks Current task: #4 - Implement search service ``` -------------------------------- ### Docker Compose Volume Mount Example Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-dockerize/references/FILE-ORGANIZATION.md Example of how to configure volume mounts in `docker-compose.yml` to reference configuration files from the `docker/` directory, such as for an Angie reverse proxy. ```yaml # Example: Angie config mount volumes: - ./docker/angie/angie.conf:/etc/angie/angie.conf:ro - ./docker/angie/conf.d:/etc/angie/conf.d:ro ``` -------------------------------- ### Example Invocations for Learn Mode Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-skill-generator/references/LEARN-MODE.md These examples show how to invoke the AI Factory Skill Generator with URLs to activate Learn Mode. A non-URL argument can be used as a skill name hint. ```bash /aif-skill-generator https://docs.example.com/api-reference ``` ```bash /aif-skill-generator https://react.dev/learn https://react.dev/reference ``` ```bash /aif-skill-generator my-skill-name https://some-docs.com/guide ``` ```bash /aif-skill-generator https://github.com/owner/repo https://blog.example.com/best-practices ``` -------------------------------- ### Docker Compose Up Development Command Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-dockerize/references/SUMMARY-FORMAT.md Starts the development environment using Docker Compose. ```bash docker compose up ``` -------------------------------- ### Generate README.md Structure Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-docs/SKILL.md Provides a template structure for generating a README.md file, including sections for project name, tagline, description, quick start, key features, and an example. ```markdown # Project Name > One-line tagline describing the project. Brief 2-3 sentence description of what this project does and why it exists. ## Quick Start ```bash # Installation steps (1-3 commands) ``` ## Key Features - **Feature 1** — brief description - **Feature 2** — brief description - **Feature 3** — brief description ## Example ``` ``` -------------------------------- ### PHP CI Setup with Shared Configuration Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-ci/references/BEST-PRACTICES.md Define a reusable PHP CI configuration using YAML anchors and `extends` in GitLab CI. Includes image, package installation, and Composer dependency caching. ```yaml .php-setup: image: php:8.3-cli before_script: - apt-get update && apt-get install -y git unzip - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer - composer install --no-interaction --prefer-dist cache: - key: files: - composer.lock paths: - vendor/ policy: pull phpstan: extends: .php-setup stage: lint script: - vendor/bin/phpstan analyse ``` -------------------------------- ### npx Install Scan Workflow Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-skill-generator/references/SECURITY-SCANNING.md Steps for scanning a skill after installation using `npx skills install`. ```text 1. npx skills install {{skills_cli_agent_flag}} # Downloads skill 2. LEVEL 1: If a Python 3 command was detected, run the automated scan on the installed directory with that concrete command, for example `python3 ~/{{skills_dir}}/aif-skill-generator/scripts/security-scan.py `. 3. If Python 3 is unavailable, do not invoke `security-scan.py`; report "Level 1 skipped: Python 3 unavailable" and continue to Level 2 only if the user accepted that risk. 4. LEVEL 2: Read and review the skill content semantically 5. If BLOCKED and Python 3 is available → run the cleanup helper with the same selected Python 3 command, for example `python3 ~/{{skills_dir}}/aif-skill-generator/scripts/cleanup-blocked-skill.py --skill --installed-path ` (reuse the same `` you scanned in step 2 — upstream `skills` sanitizes the on-disk directory name, so synthesizing `{{skills_dir}}/` can miss the real folder; `--installed-path` lets the helper verify physical removal) and warn user. 6. If BLOCKED and Python 3 is unavailable → do not use the skill; ask the user to remove the installed directory or provide Python 3 so the cleanup helper can run. ``` -------------------------------- ### Install AI Factory via npm Source: https://github.com/lee-to/ai-factory/blob/2.x/README.md Installs the AI Factory CLI globally using npm. This is the primary method for installation. ```bash npm install -g ai-factory ``` -------------------------------- ### Install AI Factory via mise Source: https://github.com/lee-to/ai-factory/blob/2.x/README.md Installs the AI Factory CLI globally using mise, a task runner and installer. Useful for managing multiple tool versions. ```bash mise use -g npm:ai-factory ``` -------------------------------- ### Skill Structure Examples (File System) Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-skill-generator/references/BEST-PRACTICES.md Illustrates file organization for skills of varying complexity, from small to large. ```text skill-name/ └── SKILL.md ``` ```text skill-name/ ├── SKILL.md └── references/ └── REFERENCE.md ``` ```text skill-name/ ├── SKILL.md ├── references/ │ ├── REFERENCE.md │ ├── API.md │ └── EXAMPLES.md ├── scripts/ │ ├── main.py │ └── helpers.py ├── templates/ │ └── output.md └── assets/ └── schema.json ``` -------------------------------- ### Install and Scan External Skills Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif/SKILL.md Installs an external skill using the skills CLI and immediately performs a security scan on the installed path. Handles different exit codes for blocking, warnings, or clean states. ```bash npx skills install {{skills_cli_agent_flag}} # AUTO-SCAN: immediately after install. Example for PYTHON_CMD=(python3). python3 ~/{{skills_dir}}/aif-skill-generator/scripts/security-scan.py # Exit 1 (BLOCKED) → run cleanup script # Exit 2 (WARNINGS) → show to user, ask confirmation # Exit 0 (CLEAN) → read files yourself (Level 2), verify intent, proceed ``` -------------------------------- ### Example Plan During Execution Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/subagents.md Illustrates how the plan file is annotated during the execution of the implement-coordinator agent, showing task status and dependencies. ```markdown ### Phase 1: Setup - [x] Task 1: Create User model - [~] Task 2: Add authentication types ### Phase 2: Core - [ ] Task 3: Implement password hashing (depends on 1, 2) - [ ] Task 4: Create auth service (depends on 3) ``` -------------------------------- ### Example Self-Improvement Patch Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-fix/SKILL.md An example of a completed self-improvement patch for a null reference error in UserProfile. ```markdown # Null reference in UserProfile when user has no avatar **Date:** 2026-02-07 14:30 **Files:** src/components/UserProfile.tsx **Severity:** medium ## Problem TypeError: Cannot read property 'url' of undefined when rendering UserProfile for users without an uploaded avatar. ## Root Cause The `user.avatar` field is optional in the database schema but the component accessed `user.avatar.url` without a null check. This was introduced in commit abc123 when avatar display was added — the developer tested only with users that had avatars. ## Solution Added optional chaining: `user.avatar?.url` with a fallback to a default avatar URL. Also added a null check in the Avatar sub-component. ## Prevention - Always check if database fields marked as `nullable` / `optional` are handled with null checks in the UI layer - Add test cases for "empty state" — user with minimal data - Consider a lint rule for accessing nested optional properties ## Tags `#null-check` `#react` `#optional-field` `#typescript` ``` -------------------------------- ### Valid Name Field Examples Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-skill-generator/references/SPECIFICATION.md Provides examples of valid naming conventions for the 'name' field in SKILL.md. ```text pdf-processing data-analysis code-review ``` -------------------------------- ### Next Steps for Full Mode (Normal) Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-plan/SKILL.md Provides instructions after a plan is created in full mode without parallel execution. The user is prompted to review and manually start implementation. ```bash Plan created with [N] tasks. Plan file: / # see Step 1.2 / Step 5 for the exact stem To start implementation, run: /aif-implement To view tasks: /tasks (or use TaskList) ``` -------------------------------- ### Justfile: Parameters and Variadic Arguments Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/BEST-PRACTICES.md Shows how to define recipes with required parameters, optional parameters with defaults, and variadic arguments. ```justfile # Required parameter build target: go build -o bin/{{target}} ./cmd/{{target}} # Optional parameter with default deploy env="staging": ./deploy.sh {{env}} # Variadic arguments test *args: go test {{args}} ./... ``` -------------------------------- ### Run Implement Coordinator for Implementation Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/subagents.md Starts the implement coordinator agent to execute a pre-existing plan, reading the active plan or a specified file. ```bash claude --agent implement-coordinator ``` ```bash claude --agent implement-coordinator "@.ai-factory/plans/feature-auth.md" ``` -------------------------------- ### Mage Installation Command Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/SUMMARY-FORMAT.md Provides the command to install the Mage build tool using Go modules or Homebrew. ```bash go install github.com/magefile/mage@latest ``` ```bash brew install mage ``` -------------------------------- ### Justfile: Default Recipe for Help Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/BEST-PRACTICES.md Defines a default recipe that displays available tasks when Just is run without arguments, enhancing discoverability. ```justfile [doc("Show available recipes")] default: @just --list --unsorted ``` -------------------------------- ### Conventional Commit Example: Simple Feature Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-commit/SKILL.md Example of a simple feature commit using the conventional commit format. ```markdown feat(auth): add password reset functionality ``` -------------------------------- ### Tool Specification Syntax Examples Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-skill-generator/references/SPECIFICATION.md Illustrates various ways to specify allowed tools, including basic lists, bash commands with patterns, and combined lists. ```yaml # Basic tools allowed-tools: Read Write Grep Glob ``` ```yaml # Bash with patterns allowed-tools: Bash(git *) Bash(npm run *) Bash(docker *) ``` ```yaml # Combined allowed-tools: Read Write Bash(git *) Bash(python scripts/*.py) ``` -------------------------------- ### Conventional Commit Example: Breaking Change Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-commit/SKILL.md Example of a commit that introduces a breaking change, indicated by '!' and a BREAKING CHANGE footer. ```markdown feat(api)!: change response format for user endpoint BREAKING CHANGE: user endpoint now returns nested profile object ``` -------------------------------- ### Starting New Feature from Current Branch Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-implement/SKILL.md Use this command to start a new feature plan based on the current branch. ```bash /aif-plan full ``` -------------------------------- ### Install and Scan External Skill Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-skill-generator/SKILL.md Installs an external skill and runs a security scan. If the scan is blocked, a cleanup script is provided. ```bash npx skills install {{skills_cli_agent_flag}} python3 ~/{{skills_dir}}/aif-skill-generator/scripts/security-scan.py ``` ```bash python3 ~/{{skills_dir}}/aif-skill-generator/scripts/cleanup-blocked-skill.py --skill --installed-path ``` -------------------------------- ### Justfile: Cross-Platform Support with OS-Specific Recipes Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/BEST-PRACTICES.md Illustrates how to define OS-specific recipes using attributes like `[linux]`, `[macos]`, and `[windows]` for platform-dependent commands. ```justfile # OS-specific commands [linux] install-deps: sudo apt-get install -y build-essential [macos] install-deps: brew install gcc [windows] install-deps: choco install mingw ``` -------------------------------- ### Task Completion Status Examples Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-verify/SKILL.md Examples of verification results for tasks, indicating their completion status (COMPLETE, PARTIAL, NOT FOUND, SKIPPED). ```text ✅ Task #1: Create user model — COMPLETE - User model created at src/models/user.ts - All fields present (id, email, name, createdAt, updatedAt) - Validation decorators added ⚠️ Task #3: Add password reset endpoint — PARTIAL - Endpoint created at src/api/auth/reset.ts - MISSING: Email sending logic (task mentioned SendGrid integration) - MISSING: Token expiration check ❌ Task #5: Add rate limiting — NOT FOUND - No rate limiting middleware detected - No rate-limit related packages in dependencies ``` -------------------------------- ### Interactive Setup: Database Choice Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-dockerize/SKILL.md Prompts the user to select the database technology for the project when generating new Docker configurations. This influences the generated Dockerfile and Compose services. ```bash AskUserQuestion: Which database does this project use? Options: 1. PostgreSQL (Recommended) 2. MySQL / MariaDB 3. MongoDB 4. SQLite (no container needed) 5. None ``` -------------------------------- ### Conventional Commit Example: Bug Fix with Body Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-commit/SKILL.md Example of a bug fix commit that includes a body explaining the issue and resolution. ```markdown fix(api): handle null response from payment gateway The payment API can return null when the gateway times out. Added null check and retry logic. Fixes #123 ``` -------------------------------- ### Load Project Context Description Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/SKILL.md Reads the project description file to store context like tech stack and framework. This step is optional; if the file doesn't exist, context will be detected later. ```bash Read .ai-factory/DESCRIPTION.md ``` -------------------------------- ### Quality Gate Pass Status Example Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/quality-gates.md Example of a quality gate passing. This JSON structure indicates no blocking issues were found. ```aif-gate-result { "schema_version": 1, "gate": "review", "status": "pass", "blocking": false, "blockers": [], "affected_files": ["skills/aif-review/SKILL.md"], "suggested_next": { "command": "/aif-commit", "reason": "Review found no blocking issues." } } ``` -------------------------------- ### Quality Gate Warn Status Example Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/quality-gates.md Example of a quality gate returning a warning status. This indicates potential issues that do not block the process. ```aif-gate-result { "schema_version": 1, "gate": "rules", "status": "warn", "blocking": false, "blockers": [], "affected_files": [], "suggested_next": { "command": "/aif-rules", "reason": "Rules are missing or ambiguous for the changed scope." } } ``` -------------------------------- ### Start AI Factory Implementation from Specific Task Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-implement/SKILL.md Starts the implementation process from a specified task number, useful for skipping or re-doing tasks. ```bash /aif-implement 5 ``` -------------------------------- ### Full Mode Scenario (Normal) Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-plan/references/EXAMPLES.md Demonstrates the 'full' mode execution, including reconnaissance, branch creation, milestone linkage prompts, test/logging/docs questions, deep codebase exploration, and task creation with commit checkpoints. ```text /aif-plan full Add user authentication with OAuth -> mode=full -> Quick reconnaissance -> Plan slug: user-authentication -> Branch: feature/user-authentication (if git branch creation is enabled) -> If ROADMAP.md exists: asks about milestone linkage, user picks one (or skips) -> Asks about tests (Yes), logging (Verbose), docs (Yes) -> Creates branch only when `git.enabled=true` and `git.create_branches=true` -> Explores codebase deeply -> Creates 8 tasks with commit checkpoints -> Saves plan to `paths.plans/feature-user-authentication.md` (or `paths.plans/user-authentication.md` when no branch is created) -> When `workflow.plan_id_format = sequential`, the filename gains a 4-digit prefix: `paths.plans/0007_feature-user-authentication.md` -> STOP - user runs /aif-implement when ready ``` -------------------------------- ### Cleanup Blocked Skill Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif/SKILL.md This command is executed when a skill installation fails security checks (exit code 1). It cleans up the partially installed skill. ```bash ~/{{skills_dir}}/aif-skill-generator/scripts/cleanup-blocked-skill.py --skill --installed-path ``` -------------------------------- ### System Dynamic Context Commands Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-skill-generator/templates/dynamic-context.md Examples of system commands for checking software versions and system information, suitable for dynamic context integration. These commands help in understanding the execution environment. ```bash node --version ``` ```bash python --version ``` ```bash uname -a ``` ```bash cat package.json | jq '.name, .version' ``` -------------------------------- ### PHP Composer Install Commands Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-build-automation/references/BEST-PRACTICES.md Commands for installing Composer dependencies. The first is CI-friendly and reproducible, while the second is optimized for production by skipping development dependencies. ```bash # Install (CI-friendly, reproducible) composer install --no-interaction --prefer-dist --optimize-autoloader ``` ```bash # Install for production (skip dev deps) composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader ``` -------------------------------- ### Skill-Context File Format Example Source: https://github.com/lee-to/ai-factory/blob/2.x/docs/evolve.md Demonstrates the structure of a skill-context file, including metadata and auto-generated rules derived from project patches. ```markdown # Project Rules for /aif-fix > Auto-generated by `/aif-evolve`. Do not edit manually. > Last updated: 2026-02-15 14:30 > Based on: 12 analyzed patches ## Rules ### Null-check for optional relations **Source**: 2026-02-10-09.15.md, 2026-02-12-16.45.md, 2026-02-14-11.20.md **Rule**: Check for optional/nullable fields before accessing nested properties. This is the #1 source of bugs in this project — 5 of 12 patches involved null references on optional DB relations. ### Prisma unique constraint **Source**: 2026-02-13-10.00.md **Rule**: Before `create()` calls on models with unique fields, check for existing records with `findUnique()`. Use upsert when appropriate. ``` -------------------------------- ### Generate Git Branch Name Examples Source: https://github.com/lee-to/ai-factory/blob/2.x/skills/aif-plan/SKILL.md Examples of generated git branch names based on common development workflows. These follow a `type/description` format. ```text feature/user-authentication fix/cart-total-calculation refactor/api-error-handling chore/upgrade-dependencies ```