Lightweight Conventions for Agent Self-Awareness: Project Docs and Skills
This article explains why AI coding agents produce inconsistent results even with strong models, and how lightweight, plain-text conventions can help. It covers two zero-dependency building blocks—a concise project description file and a set of on-demand skill definitions—along with a three-layer loading strategy, practical validation practices, and common pitfalls to avoid.
1. The Starting Problem: Agents Lack Self-Awareness, Not Capability
Once intelligent coding tools enter real engineering workflows, teams often run into a counterintuitive pattern: the model is clearly capable, yet output quality is wildly inconsistent. Given the same repository and the same requirement, two sessions may produce completely different directory structures, naming styles, and testing approaches. The root cause is usually not the model. It is that the agent has no stable awareness of where it is, what it must follow, and what it can call.
The traditional response is to write heavy formal protocols: full requirement templates, review workflows, interface contracts, and change approvals. These protocols are valuable for cross-team governance, but they are often too heavy for day-to-day coding collaboration. The people who write them do not want to maintain them, the people who read them never finish them, and agents struggle to digest them fully within a limited context window.
A more pragmatic approach has therefore emerged: split the “heavy protocol” into two types of zero-dependency lightweight conventions. The first is a project-level description file that states what the project is, how to build it, and which hard constraints apply. The second is a collection of skill descriptions that package reusable operational routines into capability units loaded on demand. Neither depends on any specific toolchain; both work as plain text, yet together they let an agent complete “self-orientation” quickly at the start of a session.
2. The First Convention: A Project Description File Answers “Where Am I?”
The core value of a project description file is making implicit knowledge explicit while keeping only the minimal set the agent actually needs. It is typically defined by a vendor’s AI coding tool or by the team itself, placed in the repository root, and versioned alongside the code.
Keep the content to four categories:
- Project positioning and tech stack: one sentence on the business goal, plus the language, framework, package manager, and runtime versions.
- Build and verification commands: the actual commands for installing dependencies, running locally, static checks, unit tests, and end-to-end validation.
- Hard constraints: directory layering rules, naming conventions, logging and exception-handling style, and types of dependencies that must not be introduced.
- Collaboration boundaries: which directories may be modified, which files are generated artifacts, and which checks must pass before committing.
An illustrative content structure looks like this:
# Project Description- Goal: An order query service for internal users- Stack: Language A + Framework B + Package Manager C## Common Commands- Install dependencies: <install command>- Start locally: <start command>- Static checks: <check command>- Unit tests: <test command>## Constraints- Business code may only live under src/; do not hand-edit generated artifacts- Use structured logging consistently; no bare print statements- New third-party dependencies require a stated reason and size impact
The key design principle is “short and executable.” Descriptive adjectives such as “code should be elegant” place almost no constraint on an agent, whereas verifiable items—commands, paths, prohibitions—translate directly into behavior. At the same time, avoid stuffing in an entire long document. The description file is more of an index and a guardrail than an encyclopedia.
3. The Second Convention: Skill Packaging Answers “What Can I Do?”
A skill turns the practice for a class of high-frequency tasks into a reusable unit: trigger conditions, pre-checks, execution steps, failure fallback, and acceptance criteria. Its value lies in on-demand loading—a skill enters the context only when the current task matches, which avoids diluting attention by injecting every convention at once.
A skill description typically contains five sections:
- Name and applicable scenario: a clear statement of “when to use me.”
- Preconditions: required files, permissions, environment variables, or dependency state.
- Execution steps: numbered and verifiable, avoiding open-ended phrasing.
- Failure handling: common errors and fallback paths.
- Completion criteria: how to confirm the task is truly finished.
An illustrative skill description:
Skill: Add a query endpointApplies to: Exposing read-only query capability in the service layerPreconditions: Data model and permission policy confirmedSteps:1. Add a route in the interface layer and declare input validation2. Implement the query logic in the business layer, reusing the existing repository abstraction3. Add unit tests covering empty results and unauthorized access4. Run static checks and unit tests until all passFailure handling: If the repository abstraction is missing, add the abstraction first, then implement; never connect to storage directlyCompletion criteria: Tests pass with no new warnings
Skills and the description file form a clear division of labor: the description file answers “what is the environment,” and skills answer “how to perform an action.” Both are plain text with zero dependencies, can be fine-tuned continuously as the repository evolves, and require no additional runtime components.
4. Loading Strategy: Spend the Context Budget Where It Matters
Whether lightweight conventions work depends largely on the loading strategy. A three-layer progression works well:
Layer one, always resident. The project description file loads at the start of the session, kept small enough to read quickly.
Layer two, index. Only each skill’s name and a one-sentence summary of its applicable scenario are loaded, forming a capability list.
Layer three, expansion. Once a task matches, the full skill body is read.
This layering is consistent with conventional context engineering practice: boundaries first, then a directory, then details. Combined with a hard “read before write” requirement—relevant files and existing conventions must be read before any modification—it can significantly reduce invented interfaces, duplicate implementations, and style drift.
5. Adoption and Validation: Turning Conventions into Measurable Engineering Assets
The biggest risk for lightweight conventions is that “they get written but nobody reads them.” Fold them into the regular engineering workflow:
- Versioning: manage them in the same repository as the code, with changes going through the same review process.
- Pruning mechanism: periodically delete outdated entries; if the description file exceeds a certain length, treat it as a signal that it needs to be split.
- Automated validation: run the commands from the description file in continuous integration so that broken commands surface immediately.
- Effect measurement: track changes in rework rate, the number of static-check warnings, and the share of review comments that cite “does not follow conventions.”
If a team runs these validations on a container platform or a cloud pipeline, it only needs to ensure the commands in the description file are reproducible in a standard environment, with no binding to any proprietary interface. Log services and monitoring alerts can be used to observe quality trends after the conventions take effect; these are general-purpose capability categories.
6. Common Pitfalls
- Turning the description file into an architecture encyclopedia. Information overload drowns out the critical constraints.
- Skills with too coarse a granularity. “Complete a feature module” is not executable and should be broken down into small, verifiable steps.
- Writing without validation. Conventions without automated validation decay quickly.
- Ignoring fallback paths. A skill without failure handling leaves the agent repeatedly trial-and-erroring when something goes wrong.
- Frequent major rewrites. Conventions need a stable period; otherwise neither agents nor people can form expectations.
7. Conclusion
Heavy formal protocols suit governance; lightweight text conventions suit daily work. Use a refined project description file to establish “where am I,” a set of on-demand skill descriptions to clarify “what can I do,” and layered loading plus automated validation to keep them continuously effective. This lets an agent build stable self-awareness in an unfamiliar codebase at nearly zero dependency cost. For teams that want to improve generation stability and collaboration efficiency, this is an engineering path with small investment, fast results, and long-term evolvability.
