Set up agent context for a project. Analyzes tech stack, installs relevant skills from skills.sh, generates custom skills, and configures MCP servers. Use when starting new project, setting up AI context, or asking "set up project", "configure AI", "what skills do I need".
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./skills/aif/SKILL.mdBefore mode routing or work, read existing files relative to the current project root in this order (reuse them if already loaded):
.ai-factory/skill-context/global-skill-context.md — all bundled skills..ai-factory/skill-context/aif/SKILL.md — this skill.Missing files are skipped; an existing unreadable file stops dependent work with its path.
Precedence: individual > build (when applicable) > global > skill defaults; retain non-conflicting instructions and check all outputs against the effective rules.
These layers customize workflow; they do not replace the project's rules/architecture hierarchy or relax explicit requirements, ownership, scope, safety/privacy, validation, or approval boundaries. Report conflicts with those boundaries instead of overriding them.
global is a project-local layer, not home-directory configuration. Custom/extension skills do not automatically use it.
Set up agent for your project by:
/aif-skill-generatorResolve reference paths beside this installed entrypoint, including flat workflows. Read a reference in full only when its stated condition applies, before the dependent step; do not preload all references. If a selected reference is missing or unreadable, STOP before that step and report its path. The entrypoint dispatch and hard boundaries apply to every reference. Project skill-context overrides and managed extension injections retain their existing precedence. Keep managed aif-ext blocks in the entrypoint; never move them into references.
Before installing any external skill or generating a Learn Mode skill, read security scanning. Require supported Python 3 and both readable scanner/cleanup helpers before acquisition; missing prerequisites STOP acquisition. Never trust or use an external skill before the automated and semantic checks permit it. Scan only the actual installed external path; never block built-in aif* skills. A blocked skill requires cleanup exit 0 and verified removal of its scanned directory and known lock identities; otherwise report incomplete cleanup and STOP.
Read .ai-factory/skill-context/aif/SKILL.md — MANDATORY if the file exists.
This file contains project-specific rules accumulated by /aif-evolve from patches,
codebase conventions, and tech-stack analysis. These rules are tailored to the current project.
How to apply skill-context rules:
Enforcement: After generating any output artifact, verify it against all skill-context rules. If any rule is violated — fix the output before presenting it to the user.
Always search skills.sh before generating. Always scan before trusting.
For each recommended skill:
1. Search: npx skills search <name>
2. If found → Install: npx skills install {{skills_cli_agent_flag}} <name>
3. SECURITY: Scan installed EXTERNAL skill (never built-in aif*) → run the selected concrete Python command with `security-scan.py <path>`
- BLOCKED? → run the selected concrete Python command with `cleanup-blocked-skill.py --skill <name> --installed-path <path>` (reuse the same <path> from step 3, NOT a synthesized {{skills_dir}}/<name>), warn user, skip this skill
- WARNINGS? → show to user, ask confirmation
4. If not found → Generate: /aif-skill-generator <name>
5. Has reference URLs? → Learn: /aif-skill-generator <url1> [url2]...Learn Mode: When you have documentation URLs, API references, or guides relevant to the project — pass them directly to skill-generator. It will study the sources and generate a skill based on real documentation instead of generic patterns. Always prefer Learn Mode when reference material is available.
First, determine which mode to use:
Check $ARGUMENTS:
├── Has description? → Mode 2: New Project with Description
└── No arguments?
└── Check project files (package.json, composer.json, etc.)
├── Files exist? → Mode 1: Analyze Existing Project
└── Empty project? → Mode 3: Interactive New ProjectImmediately after determining Mode 1, Mode 2, or Mode 3, resolve the project language settings for the entire /aif run.
Run-scoped language state:
language.ui — use for all AskUserQuestion prompts, intermediate explanations, final summary, and next-step recommendationslanguage.artifacts — use for all setup-time text artifacts created in this run: .ai-factory/DESCRIPTION.md, .ai-factory/rules/base.md, AGENTS.md, and .ai-factory/ARCHITECTURE.md via /aif-architecturelanguage.technical_terms — preserve the existing value if it is already set; default to keep only when the key is missingResolution order for each missing key:
.ai-factory/config.yamlAGENTS.mdCLAUDE.mdRULES.mdResolution workflow:
.ai-factory/config.yaml if it exists and preserve any already-set language.ui / language.artifacts values.UI language, and the second language question MUST be about Artifact language.language.technical_terms from existing config when present; otherwise set it to keep when writing config./aif run. Do not generate setup-time text artifacts in a different language later in the same run.All user-facing text examples below are structure examples only. Ask them in resolved language.ui, never hard-code English when another UI language was resolved.
Before the first language question, config write, or generated artifact, read setup configuration and base-rule templates. Use the canonical update-config.mjs helper for create/merge; preserve comments, manual values, command defaults, rules.<area>, and user-owned warmup.paths. An unsafe structure or invalid payload stops setup; never fall back to free-form YAML. Persist resolved settings before any setup artifact or /aif-architecture.
For Mode 1 only, read existing-project setup, analyze the real stack, persist config before artifacts, and confirm the installation/generation plan before executing it.
For Mode 2 only, read new-project setup. Resolve language and persist config before stack questions or artifacts; ask for relevant stack choices and obtain confirmation.
For Mode 3 only, read empty-project setup. Resolve language and persist config before asking what to build, then read the new-project reference and follow its Steps 3–6 for stack selection and specification generation; do not repeat the completed language/config steps.
Only when configuring selected MCP servers, read runtime formats and server templates. Write the correct wrapper to {{settings_file}} and remind the user about required credential environment variables.
Before generating setup-time AGENTS.md, read project-map generation. Describe the actual project structure in language.artifacts; apply project skill-context requirements to the template.
{{settings_file}} — Project-level MCP configuration.ai-factory/DESCRIPTION.md, setup-time AGENTS.md, installed skills, and MCP configuration./aif-architecture to create/update .ai-factory/ARCHITECTURE.md.This skill ONLY sets up context (skills + MCP). It does NOT implement the project.
After setup artifacts are configured, read completion and architecture handoff, invoke /aif-architecture only after config exists, and present next steps in language.ui. Stop after the selected setup follow-ups. Do not write application code, implement features, or create application structure.
lee-to/ai-factory
9771b77
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.