Maintain only the target App repository's AGENTS.md. Readportal convention material, fill gaps and merge by semantics, do not replace the whole file. Leave product and design documents to other tools.
This document's formal content inside code fences consists of execution instructions written in DSL form, and must be followed according to each rule's obligation strength, applicable conditions, and explicit exceptions.formal code fences are for layout only and do not mean these instructions are examples or optional references.
RULE @target_scope:
MUST: [user_supplied_target_first, default_current_app_repository,
"完整读取目标 AGENTS.md、适用的上级及嵌套规则与相关引用,确认实际作用域。",
"从现有 manifest、README、配置确认 Portal App 形态;用户已说明接入目标时,不以缺 manifest 阻止补约定。"]
MUST_NOT: [skill_installation_directory_as_implicit_target,
create_or_modify_product_or_design_documents,
create_or_mirror_claude_md, unrelated_configuration_changes,
initialize_onebox_or_install_packages_or_publish]
RULE @dsl_composition: MUST: ["Read the currently installed use-prompt-dsl and its language specification, and write directly embedded RULE fragments according to compose.", preserve_obligation_strength_conditions_exceptions_and_scope, brief_syntax_explanation_in_target, "Keep this skill's out-of-fence execution declaration before the target's first formal fence; if an equivalent declaration already exists, merge it, with language following the target."] PREFER: self_descriptive_literals MUST_NOT: [outer_wrappers, forced_ontology_or_workflow_blocks, cryptic_abbreviations, require_dsl_reload_for_ordinary_coding] ON_UNMET: ["When use-prompt-dsl is missing, state the absence and recommend installation, pause DSL writing, and do not install automatically."]
RULE @merge: MUST: [read_portal_conventions_material, create_agents_md_when_missing, "When AGENTS.md already exists, compare semantics item by item: keep valid rules, merge duplicates in place, and add only missing conventions.", preserve_project_facts_commands_and_local_exceptions, "Write only the Portal conventions added or merged this time as ODC; do not use this as an opportunity to rewrite unrelated coding principles.", "Handle substantive conflicts according to the current user instruction and scope of applicability; when undeterminable, ask only about the conflicting items and continue with the non-conflicting parts."] MUST_NOT: [skip_existing_agents_md, wholesale_replacement, duplicate_covered_rules, infer_facts_from_missing_files, rewrite_complete_target_for_diff]
RULE @applicability: MUST: [include_six_skill_index, "For projects with a frontend, merge frontend rules; for services confirmed to have no frontend, do not add UI rules; when the form is unknown, keep the conditional for when a frontend exists.", "API, SQL, Redis, and worker rules retain their respective applicable conditions, and do not introduce backend tasks for pure frontend projects.", "Private npm access points directly to xgent-app-release's references/private-npm.md, without loading the entire release skill."] MUST_NOT: [copy_portal_monorepo_source_paths, inject_initialization_workflow_into_target, require_missing_product_or_design_documents]
RULE @references: MUST: ["Generate usable links according to the actual installation locations in the target environment; use relative paths for in-repository skills, and for out-of-repository skills use the skill name plus the resource path relative to that skill.", "Relative links in the material are based on the material itself, and must be relocated when written into the target.", "When the target environment lacks a relevant skill, keep the purpose index and report the absence, prompting installation; do not fabricate paths or claim it has been used."] MUST_NOT: [assume_author_machine_paths, load_all_indexed_skills, automatic_skill_installation]
RULE @verification: MUST: [recheck_target_before_write, preserve_concurrent_edits, reread_result_and_diff, "Check item by item the material coverage, conditions, strength, duplicates and conflicts, and whether the actual paths and references are usable.", "Confirm that PRODUCT.md, DESIGN.md, and unrelated files are unchanged, and that using this skill again on the complete target should not produce duplicate content."] MUST_NOT: [static_text_regression_tests, unrelated_builds_or_runtime_checks]
RULE @delivery: MUST: [report_created_merged_added_or_unchanged_content, disclose_unresolved_conflicts_missing_skills_and_unverified_items]